diff --git a/Distribution/Disk_Images/GBBS.CONFIG.po b/Distribution/Disk_Images/GBBS.CONFIG.po index 6307162..ec4863a 100644 Binary files a/Distribution/Disk_Images/GBBS.CONFIG.po and b/Distribution/Disk_Images/GBBS.CONFIG.po differ diff --git a/Distribution/Disk_Images/GBBS.SYSTEM.po b/Distribution/Disk_Images/GBBS.SYSTEM.po index d60d2a6..d52dc1f 100644 Binary files a/Distribution/Disk_Images/GBBS.SYSTEM.po and b/Distribution/Disk_Images/GBBS.SYSTEM.po differ diff --git a/Distribution/GBBS.CONFIG/ACOS#FF2000 b/Distribution/GBBS.CONFIG/ACOS#FF2000 index 2eea863..f68e3bf 100644 Binary files a/Distribution/GBBS.CONFIG/ACOS#FF2000 and b/Distribution/GBBS.CONFIG/ACOS#FF2000 differ diff --git a/Distribution/GBBS.CONFIG/ENCODE#060300 b/Distribution/GBBS.CONFIG/ENCODE#060300 index 399f052..2ed8953 100644 Binary files a/Distribution/GBBS.CONFIG/ENCODE#060300 and b/Distribution/GBBS.CONFIG/ENCODE#060300 differ diff --git a/Distribution/GBBS.CONFIG/config.system#FF2000 b/Distribution/GBBS.CONFIG/config.system#FF2000 index ee2dfcd..47999f5 100644 Binary files a/Distribution/GBBS.CONFIG/config.system#FF2000 and b/Distribution/GBBS.CONFIG/config.system#FF2000 differ diff --git a/Distribution/GBBS.SYSTEM/XDOS#065000 b/Distribution/GBBS.SYSTEM/XDOS#065000 deleted file mode 100644 index a0e3ccd..0000000 Binary files a/Distribution/GBBS.SYSTEM/XDOS#065000 and /dev/null differ diff --git a/Distribution/GBBS.SYSTEM/XDOS#069e00 b/Distribution/GBBS.SYSTEM/XDOS#069e00 new file mode 100644 index 0000000..a118ddb Binary files /dev/null and b/Distribution/GBBS.SYSTEM/XDOS#069e00 differ diff --git a/Source/Acos/ACOS.LOAD.S b/Source/Acos/ACOS.LOAD.S index 1d6a57e..0cbad5a 100644 --- a/Source/Acos/ACOS.LOAD.S +++ b/Source/Acos/ACOS.LOAD.S @@ -161,7 +161,7 @@ INIT_2 LDA #0 ; reset screen ASC '########################################' ; 1 ASC '# ACOS LOADER V2.2N # ACOS FILES #' ; 2 ASC '# COPYRIGHT 86-2019 ####################' ; 3 - ASC '# Kevin Smallwood # #' ; 4 + ASC '# KEVIN SMALLWOOD # #' ; 4 ASC '##################### #' ; 5 ASC '# FILENAMES # #' ; 6 ASC '##################### #' ; 7 @@ -199,7 +199,7 @@ INIT_2 LDA #0 ; reset screen LDA PREFIX+1 ; get rid of drive specifier AND #$F TAX - INX ; add 1 for '/' + INX ; add 1 for '/' STX PREFIX LDA #'/' ; put in leading slash @@ -289,7 +289,7 @@ SNAME3 LDA LNBUF-1,Y ; copy filename DEY BNE SNAME3 - TXA ; save length + TXA ; save length STA (TEMP),Y JMP SNAME ; go back @@ -314,7 +314,7 @@ CHKPRG JSR MLI JMP CHKPRG ; get a directory and look for ".s" files. -; if any exist, check to see if they have +; if any exist, check to see if they have ; been changed. If so, kill the ".c" file. DOCHECK JSR PRSTAT @@ -403,7 +403,7 @@ RDLOOP4 LDX TEMP LDY DRIVEA ; get length of path TYA - TAX ; save length + TAX ; save length MVPATH LDA DRIVEA,Y STA FLNAME,Y ; move pathname DEY @@ -485,7 +485,7 @@ RDLOOP4C LDX TEMP LDY #0 LDA (TEMP),Y - TAY ; change file back to .S + TAY ; change file back to .S LDA #'S' STA (TEMP),Y @@ -552,7 +552,7 @@ WAIT2C LDA #1 LDY LNBUF ; get pathname length INY -SHOW2 DEY ; count down +SHOW2 DEY ; count down BMI SHOW3 ; they match LDA LNBUF,Y @@ -649,7 +649,7 @@ PRSTAT LDA #2 STA $23 JSR HOME ; clear window -PR PLA ; point to string +PR PLA ; point to string STA PRN PLA STA PRN+1 @@ -697,7 +697,7 @@ PRWIND STX PRN ; point to filename STA $22 LDA WNDBTM,Y STA $23 - SEC ; make into vtab + SEC ; make into vtab SBC #1 STA $25 JSR VTAB ; vtab down @@ -725,7 +725,7 @@ WNDBTM DB 19,08,15,19 PRSTR STX PRN STA PRN+1 ; point at string TYA - TAX ; save length + TAX ; save length LDY #0 PRSTR2 LDA (PRN),Y ; get data ORA #$80 @@ -741,7 +741,7 @@ MOVPATH STX TEMP ; point to buffer STA TEMP+1 LDX #0 -MOVE2 DEY ; count down +MOVE2 DEY ; count down BMI MOVE3 ; all finished TXA @@ -774,7 +774,7 @@ FLCOPY JSR MLI JSR MLI ; close compiled file DB $CC DA P_CLOSE -FLCOPY2 RTS ; all is well +FLCOPY2 RTS ; all is well FLCOPY1 LDX FLNAME ; change '.c' back to '.s' LDA #'S' @@ -820,7 +820,7 @@ FLCOPY1 LDX FLNAME ; change '.c' back to '.s' JSR MLI ; close file 2 DB $CC DA P_CLOSE - RTS ; we are done + RTS ; we are done ; prodos parmlist diff --git a/Source/Acos/ACOS.S b/Source/Acos/ACOS.S index 0efb4d4..7d41620 100644 --- a/Source/Acos/ACOS.S +++ b/Source/Acos/ACOS.S @@ -1 +1,52 @@ -ҍҠҍ 䍍ԠƍΠ٠ŠĠ ٯΩˠӮʍϠōԍ΍ԠӍǠԠÍԠӍԠԍԠōԠҍԠȍԠˍԠōԠύԠčԠčԠIJԠԍӠܠ썍ԠҍĠԠԍˠōԠō \ No newline at end of file + TR + TR ADR +******************************** +* * +* GBBS Pro Version 2.20 * +* * +******************************** + +* Copyright 1986-2019 by Kevin Smallwood + + LST OFF +N = 0 +n = 0 +Y = 1 +y = 1 + +L_SOURCE KBD "List this assembly? (Y/N)" + + DSK ACOS.OBJ + + DO L_SOURCE + LST + FIN + + PUT EQUATES + + ORG $800 + + PUT DRVSPEC + PUT DRIVERS + PUT START + PUT ROUTINE + PUT VAR + PUT MATH + PUT DISK + PUT DRIVE + PUT DISKIO + PUT LOAD + PUT CMD + PUT CMD2 + PUT EDIT + + DS \ fill + + PUT FILTER +CODEND = * + + PUT INIT + + DSK ENCODE + + PUT ENCODE diff --git a/Source/Acos/CMD.S b/Source/Acos/CMD.S index 08b742c..80fecf2 100644 --- a/Source/Acos/CMD.S +++ b/Source/Acos/CMD.S @@ -1 +1,1410 @@ -Ǎ Ӯ ō 􍪭ҠؠРҍ̠ӍԠԍҠ֍ҠàРҰҰҠčҠ׍ؠЍ؍ؠ֍Ԡұؠ֍ұҠР썠ŠҰӍұҠ͠堢؍ؠȍҠԍРŠҰҠԍҠ͍؍ؠ֍РҰҹ捠Рԍұ 堢ܢĠ鍺ұàҠԍҰҠР፠Ѡҹ쿍РѠҵРѠҲРѠҴ򿍠РѠҵ忍РѠҴ忍ҠԠ썠РѠұàРѠұРѠұРܢѠұ 捠РޢѠҰؠРҍҲҠԍҳҠԍѠҰ썍РѠҰ占ҠԍРҳҴҠ͠ҠԍРҰҵҠЍàҴ򍍠ҠҲ؍؍٠Ҷ؍ѠҰ獍éٍҠԍٍРҶԠРҩ􍪭ϠҠנҠ׍ԲҫҍӍ􍪭 Ҡ 퍠ҠנҠ׍ҍˬؠ덠؍ҫˬ؍؍ؠ̍РԲ ؠ̍ؠŠ³퍍ؠ²˫؍˫ؠ⍠˫؍ˬ؍؍؍ؠŠ²³Ӎ덪ȠҠ 퍠Ҡנ덠ˬ؍؍Ҡ׍ˬ؍؍ؠ̍Ӎ덪Р٠̠Ѡв𠭭򍍠ٍٍ٠̍вӍ덪Ԡؠ⍠٠̠ѠԳ򍍠ٍˬٍҫٍˬٍҍ٠̍ԲӍԳРҠ󍍪卪֠ҠԠ占Ҡ͍ؠѠĠ򿍍ؠѠР𿍍ؠŠԲ忍Ҡ占֍Ӎ򍪭ĠРҠ򍍪РРЍ덪ˠ̠덠РԠ塍򍪭٠ΠԍРԠ塍䍪ҠҠԍРѠ֠占Р⍠Ѡˠ덠РѠ٠򍍪􍪭ҠĠ͍čͫ٠͠٠Ѝ٠ٍͫ٠Ы٠̠썠Щٍ͠占ҍͫҫÍͫàͫҍÍàͫͫ占͍ҍҫӍ􍪭ԠҠԠ翍Р獠Š԰卍ҠŠ԰ҠԠ占ҠՍōҠҫŠ獠̠Բ򍍠ҠҠ荠РԳԲҠ͍ԳؠР፠Ы٠ٍҫҍ̠Ե㍍٠ҩٍвٍҩٍвѠԵ򮮮РčŠԵ卍ٍҩ٠荠؍٠ԴЩٍв٠獠ٍ؍ŠԴӍԵ٠占ЍҩٍٍЫҩ٠占ٍٍҩ٠荠΍ƴӍ􍪭ƠҠ͠ؠЍЍŠƴƲҠ РѠƳР占ŠƲ忍ƳԠÍ̠ƴРԍ􍪭ŠҠ РŠōѠƳ卍󍪭 Ҡ׍РѠ±῍Р⍠Ѡ±Р荠Šƴ嬠±Ҡ׍Р׍󍪭͠ҠǍؠŠͲ̍؍Ь؍ЍЫ؍ЫРЩ卍ͲӍРͰ썠ͱͲ썪ͰōҠǠ占ҠԠؠؠӠؠà占ؠԠ卍؍ؠŠؠϠͰ߱썠ԍͰ߲Ҡ٠̠Ͱ߳ 䍠ĠƠ۰ݠ占Рǧ썠ѠͰߵ썠Рѧ썠ѠͰߴР썠ŠͰ߳獍ҠӠ卍Ͱ߳ҠǠӠͰ߶􍍠Ҡà占ԍРڧ썠ѠͰ߱àԍРͰ߲ͰߴРԱ􍍺ͰߵҠǠŠ썠ԍРƠ򍍺Ͱ߶ҠΠӠͰ߶占РƠ򍍪卪􍪍ͱ󍪠ԠĸĠ忍̠Ҡ卪򠸰󍪍Ҡà诲àĭԯٍРҠԍٍ̠ЍͱԠЍԍЫ٠ĭԠ荠ٍ٠ЩٍҠĭԠ占ҍҠԍٍٍ̠ͱ߲Š퍠РǠ卍ͲōРҠҠ퍍獪ΠҠǠ獠Πؠؠ؍ؠӍ፪ΠҠŠŠ占ԠƍҠ֠ҠàؠΠ젣βĠҠԍРѠβà獠РܢѠβōРŠγҠԠ堢ҠԍĠƠٍ٠ŠγԬٍŠ占РβčβŠ堢ܢҠԍҠԍРβčβàҠԠβҠԍРѠβ 忬ҠԍРββ ҠԍРŠγ卍ҠԠγؠΠ젣ؠѠγĠ卍ؠγҠР占Ġ鍠Р捠Ѡγ捍٠Šγγ Ƭؠ؍РŠγѠγà嬠γĠҠΠ卍γàԠ卍δҠԍҠԠؠРŠεҠ͠ؠεؠв򍍠Š򿍠̠θ٠ҫҩ٠獠ٍҍҩٍ٠в򍍠ؠԍηƬؠРѠη؍РвѠη忍ҩ٠àв򍍠àҍŠηàҫŠηηؠԍ٠ؠв荠Ѡηà蠰ōĠѠηÍؠ蠱ηàҩٍη в忍РŠδ卍ҠԍРܢŠηĠ忬卍ҠԠ占РγηĠӍθԍгƍгҠΠ򍍠٠ҩٍ٠ҩٍؠгؠԠƬ؍РѠη 獍àԍРη РРҲРԠӍϠҠՠҠҍƍ٠Π젱٠ŠȲ٠é٠占Ġ鍺ȲύӍϠ  򨩍ԠҠǍΠ獠ÍëҠǠ獍ЫЍвҠԠ ۬ݍؠ РŠҰҠ͠ Ҡ͠ ؍ҠԠ ҰؠѠұ؍ұؠвؠ 荠вѠҷ笠荍Í΍àв àҶ 塍΍ÍÍàв ÍëàëÍΠ迍àвàҶ塍؍؍ؠв󠱍ؠ󠰍Ҳ٠堰ҳЩ٠占Ҡ֠г占é٠占Ҡ֠РгŠҴ迬卍٠٠вŠҳ忬卍ؠ󫱍ҷРҴàà占ŠҵàëҵؠؠвŠҲ忬卍Ҷ荠Рؠ堻РҍԠҠҠ荠РҠ卍ԠҠҍÍвàв䍠ѠԲÍàР獠ЍàЫЫԲРҠ 䤍ĠҠҠ獠àвÍвàЍР獠àЫЫҠԍؠРŠIJ笠卍Ҡ͠占Ҡ͠ҠԠ堩IJÍвàв 荍ؠвРвԠij卍ijвҠؠР㠦荠Ы٠вРҍҠҠǠ獠àЍëЫ΍вҠǍؠвؠвԠԲ썍ؠвԲؠвӍ򤨩ҠҠǠҠԍؠ፠РŠҲҠǍҲؠ󍍠Ҡ獠ҫ٠ҳҩ٠獠àҍŠҴàҫҴ؍Šҳ堲Ӎ獪̠ҠԠ堨ҠҲ占٠΍Ƭ٠獺ٍ̲ɠ̳éٍƬ٠獠Р̲̳Ơ獠гƍгҠΠؠҠԠ堩報Ӎ򩍪Ġà獠Ӡԍ䍪ԠàԠЍ٠ԠԲƬ٠ٍ̠ԲРӠ԰򍍪󍪭ԠҠǠ獠ҍӠԱ獍ؠؠѠ԰ؠŠԳ퍍ƍؠҠ砢墠Ƭ؍԰ƍؠҠ砢墠Ƭ؍Ơƫ獠ҠӍԱҠà΍ŠԲЍ٠é٠Ҡ֍ٍƍƠƬ٠ЍԲӠԍӍԳؠ堻Рҍ򍪭ԠҠŠԠƍҠԠō̠Գ򍍠ҠŠàԳ԰ҠΠԠԍ̠Բ썍àԍҠԠР԰ԲҠ֍٠ҩ٠򍍠ҍҩ٠ٍҫҩٍٍҩ٠蠱àҍŠԳ占àҫԳӍ󍪭ԠҠԠҠՍҠԠ쿍РŠԲ卍ҠԠҠԍҠ占ЍҫЫؠѠԳԲҍҫҠ͠獠Ҡ͍Ҡ͠獍Р獠ЫҫҍԳ٠荠ҩٍٍЫҩ٠ٍЍҩ٠Ӎ퍪ҠҠǠ獍Ҡ占ҫ̠ҍ̍ҫҠ ҠԍҫҍҠ獠ҫ͍荍٠ؠҲͬ؍ҩ٠占؍àҍŠҳ占àҫҳà͍ŠҲ󍍠占Ӎ卪ԠҠ͠占ؠЍؠРѠԲ؍ԲР􍍪獪ǠҠԍРѠDz翬ԠƠ̠DZ卍ҠՠҠ͠ؠҠҫӍDZؠҠҫРȠDzԠƠР􍍠ҠǠ獠Ġ؍̬؍в占РҠ«Ҡލ͍àҍР«àҫЫЍɠǴ٠Щ٠占Ġв占Ѡdz獺dzРǴҠՠҠ͍٠ «ŠǵвҠƠ덠ĠЩ٠Щ٠占ӍǵвЩ٠Щ٠占Ӎ̠ؠҠ卪 ҠԠ῍РѠ²ԠƠ̠±Ҡՠ占Ҡ͍ؠҠҫӍ±ؠҠ占ҫРȍ²ԠƠЍҠǠ獠Ѝɠ´Ҡٍҩ٠卍Ӡ³卍Рҍލ³ĠƠ፠Р´Ҡՠ占Ҡ͍Ҡ占٠卍Ѝ፠РԠ´忬´Р占Р̍ލЫЍӠµ卍ҩ٠占ĠƠ捠Ыҩ٠占Ӎµҩ٠占Ġư䍠Рҩ٠占Ӎ堨멍ԠҠԠ򿍠РѠԲ卍ԠƠ󿍠̠ԱҠՠ占Ҡ͍ؠҠҫӍԱؠҠҫРȍԲԠƠЍҠǠ獠ЍɠԳ𠭭ލ٠ ҩ٠፠РԳ獠Ҡՠ占Ҡ͠占РѠԳ忬ؠԳ٠􍍠ҩ٠占Ӎ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Commands * +* * +******************************** + DATE +*------------------------------- +* print statement +*------------------------------- + +ERR LDX #syntax + JMP ERROR + +NIL RTS + +DO_PRNT LDA #0 ;PRINT + JSR GETDEV + JSR SETOVEC ;set output vector + JMP :DO_PR0 + +:DO_PR0A JSR VIDWND + JSR TOPSHOW + LDX WNDTOP + INX + CPX CV + BLT :DO_PR1 + STX CV + +:DO_PR1 JSR INPTYP ;check for eol + BNE :DO_PR0 + RTS + +:DO_PR1A JSR INPNUM ;handle "@" + DEX + STX CH + JSR CHKBYT + CMP #"," + BNE :DO_PR0 + + JSR GETBYT + JSR INPNUM + DEX + STX CV + JMP :DO_PR0 + +:DO_PR9 LDA #cr ;print cr/lf + JMP DO_OUT + +:DO_PR1B LDA #cr ;handle "\" + AND #clrhi +:DO_PR1C JSR DO_OUT + +:DO_PR0 JSR INPTYP ;get data + BEQ :DO_PR9 ;eol? + + CMP #1 + BEQ :DO_PR5 ;token? + CMP #2 + BEQ :DO_PR2 ;hard-coded text? + CMP #3 + BEQ :DO_PR4 ;number? + CMP #5 + BEQ :DO_PR5 ;string variable? + CMP #6 + BEQ :DO_PR4 ;numeric variable? + + JSR GETBYT ;must be control + CMP #"," + BEQ :DO_PR1C ;print it + CMP #";" + BEQ :DO_PR1 ;no cr + CMP #"@" + BEQ :DO_PR1A ;position + CMP #"\" + BEQ :DO_PR1B ;cr/lf + CMP #"^" + BEQ :DO_PR0A ;display top + + LDX #syntax ;syntax error + JMP BADERR + +:DO_PR2 JSR GETBYT +:DO_PR3 JSR GETBYT + BEQ :DO_PR0 ;if eol + + CMP #""" + BEQ :DO_PR0 ;gobble + JSR DO_OUT + JMP :DO_PR3 ;and loop + +:DO_PR4 JSR INPNUM ;get number + JSR DECOUT + JMP :DO_PR0 + +:DO_PR5 JSR ARGTYP + BCC :DO_PR4 ;if it is a number + + JSR INSTR2 ;set up pointers + TYA + TAX + INX + LDY #0 + +:DO_PR6 DEX + BEQ :DO_PR0 ;print out string + + LDA (STRLOC),Y + JSR DO_OUT + INY + JMP :DO_PR6 + +DO_OUT JMP (VECTOR) + +*------------------------------- +* goto statement +*------------------------------- + +DO_GOTO JSR GETRAW ;get address + PHA + JSR GETRAW +DO_GT2 STA PRGPTR+1 ;put into program counter + PLA + STA PRGPTR + RTS + +*------------------------------- +* gosub statement +*------------------------------- + +DO_GSB JSR TST_GSB ;make sure there is room + JSR GETRAW ;get address + PHA + JSR GETRAW + PHA + + LDA PRGPTR + STA GSBSTK,X ;put current address onto gosub stack + INX + LDA PRGPTR+1 + STA GSBSTK,X + INX + STX GSBLVL + PLA + JMP DO_GT2 ;do the goto + +TST_GSB LDX GSBLVL + CPX #32 + BNE :TSTGSB3 ;there's enough room + + LDX #0 +:TSTGSB2 LDA GSBSTK+3,X + STA GSBSTK+1,X ;kill oldest gosub + LDA GSBSTK+2,X + STA GSBSTK,X + INX + INX + CPX #30 + BNE :TSTGSB2 + +:TSTGSB3 RTS + +*------------------------------- +* push a level onto the stack +*------------------------------- + +DO_PUSH JSR TST_GSB ;make sure there is room + JSR GETRAW ;put data onto stack + STA GSBSTK,X + INX + JSR GETRAW + STA GSBSTK,X + INX + STX GSBLVL + RTS + +*------------------------------- +* pop a level off the gosub stack +*------------------------------- + +DO_POP LDY GSBLVL ;make sure there is something to pop + BEQ :DO_POP2 ;nothing to pop -- give error + + DEY + DEY + STY GSBLVL +:DO_POP2 RTS + +*------------------------------- +* return to the address on the stack +*------------------------------- + +DO_RET LDX #nogosub + LDY GSBLVL ;make sure there is a return address + BEQ DO_RET3 ;nothing to return to -- give error + + DEY + LDA GSBSTK,Y + STA PRGPTR+1 ;return to caller + DEY + LDA GSBSTK,Y + STA PRGPTR + STY GSBLVL +DO_RET2 RTS + +DO_RET3 JMP BADERR ;No gosubs + +*------------------------------- +* clear a device +*------------------------------- + +CLRDEV JSR GETBYT ;gobble + JSR INPNUM + CPX #8 + BEQ :CLR_ED ;clear editor? + + CPX #9 + BEQ :JCLRTOP ;clear screen top? + + CPX #10 + BNE DO_RET2 ;clear ram drive? + + LDA #0 + STA RAMPTR ;clear ram drive + STA RAMDRV + RTS + +*------------------------------- +* clear the editor +*------------------------------- + +:CLR_ED JMP ED_CLR ;clear editor + +*------------------------------- +* clear user stats at screen top +*------------------------------- + +:JCLRTOP JMP CLRTOP + +*------------------------------- +* clear the gosub stack +*------------------------------- + +CLRSTK LDA #0 + STA GSBLVL ;reset gosub stack + JMP GETBYT ;gobble! + +*------------------------------- +* clear the keyboard buffer +*------------------------------- + +CLRKEY LDA #0 + STA TYPIN ;reset type-ahead buffer + STA TYPOUT + JMP GETBYT ;gobble! + +*------------------------------- +* clear command +*------------------------------- + +DO_CLR JSR CHKBYT + CMP #"#" + BEQ CLRDEV ;clear a device + CMP #gosub + BEQ CLRSTK ;clear the stack + CMP #key + BEQ CLRKEY ;clear the type-ahead buffer + +*------------------------------- +* clear statement +*------------------------------- + +CLEAR LDA #ENDMOD + STA HIMEM+1 + + LDY HIMEM ;clear out pointers + STY TEMP + LDY HIMEM+1 + DEY + STY TEMP+1 + LDY #$FA + LDA #0 + STA FORLVL ;reset for-next level + STA (TEMP),Y + LDA LOMEM ;reset string space + STA VARSTR + LDA LOMEM+1 + STA VARSTR+1 + + SEC + LDA HIMEM+1 ;midmem = lomem+(himem-lomem)/2 + SBC LOMEM+1 + LSR + CLC + ADC LOMEM+1 + STA MIDMEM+1 ;compute initial midmem value + LDA #0 + STA MIDMEM + + STA FROMERR + STA FROMERR+1 + RTS + +*------------------------------- +* let statement +*------------------------------- + +DO_LET JSR CHKBYT ;doing a string? + CMP #string + BNE :DO_LET0 ;nope + + JSR CHKFRE ;free old strings +:DO_LET0 JSR VARSET ;set up pointers to variable + JSR GOBEQU + + LDA VNAME + PHA + LDA VPTR ;save var address + PHA + LDA VPTR+1 + PHA + + LDA VNAME ;check name to see if string + BPL :DO_LET2 ;or number + + JSR INPSTR ;get string address and length + JMP :DO_LET3 + +:DO_LET2 JSR INPNUM +:DO_LET3 STX TEMP ;save a + STA TEMP+1 + STY SAVE_Y + + PLA + STA VPTR+1 ;point back at var + PLA + STA VPTR + PLA + BPL :DO_LET5 ;if numeric + + LDY #0 + LDA (VPTR),Y + STA TEMP2 + INY + LDA (VPTR),Y + STA TEMP2+1 ;see if variable is in low memory + BEQ :DO_LET5 ;if new var... + + CMP #>CODEND + BGE :DO_LET5 ;nope + + INY + LDA (VPTR),Y ;get length + TAX + + LDY #0 +:DO_LET4 LDA (TEMP),Y + STA (TEMP2),Y ;copy string + INY + DEX + BNE :DO_LET4 + RTS + +:DO_LET5 LDY #0 ;save low address or byte + LDA TEMP + STA (VPTR),Y + INY + LDA TEMP+1 + STA (VPTR),Y ;save high address or byte + INY + LDA SAVE_Y + STA (VPTR),Y ;save length + LDA #0 + STA TTLLEN +DO_IF4 RTS + +*------------------------------- +* if statement +*------------------------------- + +DO_IF JSR INPNUM ;evaluate expression + STX TEMP + ORA TEMP + BNE DO_IF4 + +:DO_IF2 JSR IFGOB ;loop until a chain + CMP #chain2 + BEQ DO_IF3 + CMP #else + BNE :DO_IF2 ;is there an else clause? + +DO_IF3 BIT SHWTRC + BPL DO_IF4 ;just return + JMP LIST + +*------------------------------- +* else statement +*------------------------------- + +DO_ELSE JSR IFGOB ;loop until a chain + CMP #chain2 + BNE DO_ELSE + BEQ DO_IF3 ;link back to code + +*------------------------------- +* gobble program bytes +*------------------------------- + +IFGOB JSR GETRAW + CMP #goto + BEQ :IFGOB1 ;is byte followed by data? + CMP #gosub + BEQ :IFGOB1 + CMP #push + BNE DO_IF4 ;else, return + +:IFGOB1 JSR GETRAW + JMP GETRAW + +*------------------------------- +* handle modem calls +*------------------------------- + +DO_MDM JSR INPNARG + CPX #3 + BGE :DO_MDM2 + + TXA + ASL + TAX + LDA MDMJMP,X + STA TEMP + LDA MDMJMP+1,X + STA TEMP+1 + JMP (TEMP) ;go to routine + +:DO_MDM2 RTS + +MDMJMP DA MDM0 ;wait for call + DA MDM1 ;hang up + DA MDM2 ;dud command for now + +*------------------------------- +* handle waiting for a call +*------------------------------- + +MDM0 LDA #0 + STA REMOTE + JSR MDMHANG ;hang up phone + JSR MDMRSET ;setup for answer + LDX #0 + STX NULLS ;reset nulls + STX EXEC ;reset possible exec mode + STX DOCHAT ;reset chat mode + + DEX + STX REMOTE ;setup for local only + STX VIDECHO ;turn off any echo + +:MDM0_1 LDA #'A'-ctrl + STA TOPRIGHT + +:MDM0_2 JSR VIDKEY ;check for keypress + BPL :MDM0_3 + + STA KBDSTRB ;clear keyboard + AND #$1F ;make into [0-31] range + CMP #'G'-ctrl + BEQ :MDM0_5 ;do local + CMP #'Q'-ctrl + BEQ :MDM0_4 ;quit + CMP #'A'-ctrl + BNE :MDM0_3 ;keep checking + + JSR MDMANS ;answer phone + +:MDM0_3 JSR MDMRING ;check for connect + BCS :MDM0_6 ;we got a connect + + JSR USERVEC ;do user sub-routine + LDA TOPRIGHT + CMP #'Z'-ctrl + BEQ :MDM0_1 + INC TOPRIGHT + JMP :MDM0_2 + +:MDM0_4 JMP RESTART1 ;quit + +:MDM0_5 JSR MDMHANG ;hang up (disable AA) + LDA #0 + STA REMOTE ;set to local + STA SPCINIT + JMP CLRBUF ;clear keyboard buffer + +:MDM0_6 JSR MDMIN ;get modem input + BCS :MDM0_6 ;and gobble until gone + JMP CLRBUF ;clear keyboard buffer + +*------------------------------- +* hang up +*------------------------------- +* this code centers the copyright message +* but kevin does not like it so we removed it +* +*MDM1 LDA #20 ;default to 40 columns +* BIT RD80VID ;in 80 column mode? +* BPL :CENTER ;nope +* LDA #40 ;reset for 80 columns +* +*:CENTER SEC ;subtract length/2 +* SBC #COPEND-COPNOT/2 +* TAY +* LDA #' ' ;print spaces to center +*]LOOP JSR COUT +* DEY +* BPL ]LOOP + +MDM1 LDA #COPNOT + STA TEMP+1 + LDY #COPEND-COPNOT ;set length + DEY +:PRNTCPY LDA (TEMP),Y + EOR #COPEND-COPNOT ;translate + ROR + JSR COUT + DEY + BPL :PRNTCPY + +MDM1_2 LDA #0 + STA REMOTE ;set local modem + JMP MDMHANG ;hang up phone + +*------------------------------- +* dud command for now +*------------------------------- + +MDM2 LDA #0 + STA REMOTE + JMP MDMDTR ;raise DTR so that we can talk to the modem + +*------------------------------- +* get the length of a string +*------------------------------- + +DO_LEN JSR INPSARG ;point to string + LDA STRLEN ;get length +SVDATA STA DATA+1 + LDX #0 + STX DATA+2 + INX + STX DATA + RTS + +*------------------------------- +* input a line of text or data +*------------------------------- + +DO_IN JSR CHKFRE ;check the free memory + LDA #%10000001 + STA INPMODE ;default input mode + LDA #0 + STA INTOUT ;reset output interrupt + STA INTBUF + + JSR GETDEV ;setup dev pointer + JSR SETIVEC ;set input vector + STX SHWIN ;save channel # + +:DO_IN2D JSR CHKBYT + CMP #""" + BEQ :DO_IN2C ;check for string + CMP #"\" + BEQ :DO_IN2E + CMP #"@" + BNE :DO_IN3 + + JSR GETBYT ;gobble "@" + JSR GETBYT + AND #$F ;see if its all ligit + TAY + CPY #5 + BGE :DO_IN3 + + LDA MODEBYT,Y + STA INPMODE ;set new mode + JMP :DO_IN2D + +:DO_IN2E LDA #cr ;handle "\" + JSR COUT + JSR GETBYT + JMP :DO_IN2D + +:DO_IN2C JSR GETBYT ;gobble up +:DO_IN2A JSR GETBYT + CMP #""" + BEQ :DO_IN2B ;are we done?, yep + + JSR COUT + JMP :DO_IN2A + +:DO_IN2B JSR CHKBYT + CMP #";" + BNE :DO_IN3 ;possible gobble + + JSR GETBYT ;gobble colon + +:DO_IN3 LDX SHWIN ;get back channel # + CPX #0 + BEQ :DO_IN3D ;use console input routine + + LDX #0 +:DO_IN3A JSR DO_INP ;get input line + AND #clrhi + CMP #lf + BEQ :DO_IN3A ;gobble lf + + TAY ;set zero/non-zero bit + BNE :DO_IN3B + + LDA #cr +:DO_IN3B STA LNBUF,X ;save char + INX + CMP #cr + BNE :DO_IN3A + BEQ :DO_IN3C ;nope, yep + +:DO_IN3D JSR INPLN ;get console input line + +:DO_IN3C LDA #0 + STA LNCNT ;reset pointer to start of line + +:DO_IN4 JSR VARSET + JSR CHKBYT ;see if there's more input + LDX #cr + CMP #"," + BNE :DO_IN5 + + JSR GOBCOM ;gobble up char + LDX #',' +:DO_IN5 STX TEMP2 ;save ending character + + LDA VNAME ;input a number? + BPL :DO_IN8 ;yep + + LDY #1 + LDA VARSTR+1 + STA (VPTR),Y ;point at new string + DEY + LDA VARSTR + STA (VPTR),Y + STY TEMP2+1 ;zero counter + + LDX LNCNT +:DO_IN7 LDA LNBUF,X ;get input + CMP #cr + BEQ :DO_IN7A + + INX + CMP TEMP2 + BEQ :DO_IN7A ;are we done? + + STA (VARSTR),Y ;copy + INC TEMP2+1 ;inc length counter + + INC VARSTR + BNE :DO_IN7 + INC VARSTR+1 + BNE :DO_IN7 + +:DO_IN7A STX LNCNT + LDY #2 + LDX TEMP2+1 ;get the length + BEQ :DO_IN7C ;length 0 + + LDA INPMODE + AND #2 + BEQ :DO_IN7C + + LDX #1 ;use length 1 +:DO_IN7C TXA + STA (VPTR),Y + +:DO_IN7B LDA TEMP2 ;are we done? + CMP #cr + BNE :DO_IN4 ;nope + + JSR CHKBYT + CMP #"\" + BNE :DO_IN7D ;get another line?, nope + + JSR GETBYT ;gobble + JMP :DO_IN3 + +:DO_IN7D RTS + +:DO_IN8 LDA LNCNT + STA TEMP3 + LDA #>LNBUF + STA TEMP3+1 + JSR ZNUMIN ;get number + + LDY #1 + STA (VPTR),Y + DEY ;save it + TXA + STA (VPTR),Y + + LDX TEMP3 + STX LNCNT ;reset line counter + LDA LNBUF,X + CMP #cr + BEQ :DO_IN7B ;keep going + + INC LNCNT + JMP :DO_IN7B ;finish up + +DO_INP JMP (VECTOR2) ;get a byte of input + +NO_INP LDA #0 ;no input available +NO_OUT RTS + +*------------------------------- +* set echo +*------------------------------- + +DO_ECHO JSR GOBEQU ;gobble equal sign + JSR INPSTR + LDA #$FF + LDY STRLEN ;see if it is legal 1 char + CPY #1 + BNE :DO_ECH2 + + LDY #0 + LDA (STRLOC),Y ;get char and save + AND #clrhi +:DO_ECH2 STA VIDECHO + + RTS + +VIDECHO DB -1 + +*------------------------------- +* get the instr() +*------------------------------- + +DO_INST JSR INPSARG + LDA STRLEN ;save address and length of string + PHA + LDA STRLOC + PHA + LDA STRLOC+1 + PHA + + JSR INPSARG ;get other string + + PLA + STA TEMP+1 ;restore first string info + PLA + STA TEMP + PLA + STA TEMP2 + + JSR CHKBYT ;Lane Roathe - support optional index [,start] + LDX #0 ;default index is zero + CMP #"," + BNE :DO_NSR0 + + JSR GOBCOM ;eat , + JSR INPNUM ;get index in X + JSR GETBYT ;eat ) +:DO_NSR0 + CPX #0 + BEQ :DO_NSR1 + DEX +:DO_NSR1 + STX TEMP2+1 + + LDX #1 ;def location is 1 for null match + LDA TEMP2 + BEQ :DO_NSR7 ;if null string, always match + + SEC + LDA STRLEN + SBC TEMP2+1 ;how many chars to search after index? + BCC :DO_NSR6 ; none! + STA STRLEN + + CLC + LDA STRLOC + ADC TEMP2+1 ;advance source string past index + STA STRLOC + LDA STRLOC+1 + ADC #0 + STA STRLOC+1 + + SEC + LDA STRLEN ;how many chars to search? + SBC TEMP2 + BCC :DO_NSR6 ;none! + + TAX + INX + STX TEMP2+1 ;save passes plus 1 + + LDX #0 ;start at pass 0 +:DO_NSR2 LDY #0 ;start checking at byte 0 +:DO_NSR3 LDA (TEMP),Y ;get first byte + JSR CONV ;make upper + STA TEMP3 ;save + LDA (STRLOC),Y ;get second byte + JSR CONV ;make upper + CMP TEMP3 + BNE :DO_NSR4 ;do they match?, nope + + INY ;inc pointer + CPY TEMP2 + BNE :DO_NSR3 ;we done?, nope + + INX ;get pass+1 +:DO_NSR7 TXA + JMP SVDATA ;return + +:DO_NSR4 INC STRLOC ;check against next byte + BNE :DO_NSR5 + INC STRLOC+1 +:DO_NSR5 INX ;count up passes + CPX TEMP2+1 + BNE :DO_NSR2 ;are we done?, nope + +:DO_NSR6 LDA #0 ;no match + JMP SVDATA + + LDX #badtype ;type mismatch error + JMP BADERR + +*------------------------------- +* get the left$ +*------------------------------- + +DO_LFT JSR DO_ISTR ;get string and length + JMP DO_XSTR ;we're done + +*------------------------------- +* get the right$ +*------------------------------- + +DO_RGT JSR DO_ISTR + SEC + LDA TEMP2+1 + SBC TEMP2 ;find out how much is to be used + BEQ :DO_RGT2 + + CLC + ADC TEMP ;get start of string + STA TEMP + LDA #0 + ADC TEMP+1 + STA TEMP+1 +:DO_RGT2 JMP DO_XSTR ;finish up + +*------------------------------- +* get the mid$ +*------------------------------- + +DO_MID JSR DO_ISTR ;point to string + DEC TEMP2 + + CLC + LDA TEMP2 + ADC TEMP + STA TEMP ;get start of string + LDA #0 + ADC TEMP+1 + STA TEMP+1 + + JSR CHKBYT + LDX #-1 + CMP #"," + BNE :DO_MID2 ;see if there is a length arg, nope + + JSR GOBCOM ;gobble + JSR INPNUM ;get it + JSR GETBYT ;gobble ) + +:DO_MID2 SEC + LDA TEMP2+1 + SBC TEMP2 ;compute maximum length + + STX TEMP2+1 + CMP TEMP2+1 + BLT :DO_MID3 ;find out which to use + + TXA +:DO_MID3 STA TEMP2 + +DO_XSTR LDX TEMP ;return string loc & length + LDA TEMP+1 + LDY TEMP2 + JMP SVSTR + +DO_ISTR JSR INPARG ;get the string + LDA STRLOC ;save string info + STA TEMP + LDA STRLOC+1 + STA TEMP+1 + LDA STRLEN + STA TEMP2+1 + + JSR INPNARG + STX TEMP2 ;get the number + CPX TEMP2+1 + BLT :DO_IST2 ;make length legal + + LDX TEMP2+1 +:DO_IST2 STX TEMP2 + RTS + +*------------------------------- +* handle the chr$() function +*------------------------------- + +DO_CHR JSR INPNARG ;get char number + TXA + PHA + + JSR CHKBYT + LDX #1 ;check for more data + CMP #"," + BNE :DO_CHR2 + + JSR INPNARG +:DO_CHR2 STX DATA+3 ;get number of chars + + LDA VARSTR ;point to string + STA DATA+1 + LDA VARSTR+1 + STA DATA+2 + + PLA + LDY #0 +:DO_CHR3 STA (VARSTR),Y ;create string + INC VARSTR + BNE :DO_CHR4 + INC VARSTR+1 + +:DO_CHR4 DEX + BNE :DO_CHR3 + + LDA #2 + STA DATA ;data type 2 + RTS + +*------------------------------- +* get the value from a string +*------------------------------- + +DO_VAL JSR GETBYT ;gobble ( + JSR INSTR2 ;don't use any space + LDY STRLEN + LDA #0 + STA LNBUF,Y ;terminate string +:DO_VAL2 DEY + BMI :DO_VAL3 + + LDA (STRLOC),Y + STA LNBUF,Y ;copy string + JMP :DO_VAL2 + +:DO_VAL3 LDA #LNBUF + STA TEMP3+1 + JSR ZNUMIN ;get number + STX DATA+1 + STA DATA+2 + JSR GETBYT ;gobble ) + LDA #1 + STA DATA ;data type 1 + RTS + +*------------------------------- +* set interupt key to spacevar (for editor) +*------------------------------- + +DO_SED SEC ;set flag + BCS XINT + +*------------------------------- +* set interupt keys that can be used +*------------------------------- + +DO_SINT CLC ;fall into aint routine +XINT PHP + LDY #127 + LDA #0 + STA INTOUT ;reset output +:SINT2 STA INTBUF,Y ;clear int buffer + DEY + BPL :SINT2 ;loop and fall into "addint" + PLP ;restore status + BCS AINT0 ;just enable spacebar + +*------------------------------- +* add interupt keys +*------------------------------- + +DO_AINT JSR INPARG ;get arg + LSR + BCS AINT1 ;error, should be a string + + LDX NUMB + CPX #1 + BEQ AINT0 ;fix stop char + CPX #2 + BNE AINT3 ;there's a problem + + LDA #$FF + LDX NXTCHR ;flag "next-message" char + STA INTBUF,X + +AINT0 LDA #$FF + LDX STPCHR ;flag "stop-message" char + STA INTBUF,X + STA INTBUF ;enable int's + STA INTBUF+127 ;special int flag + LDA #0 + STA INTCHR ;clear int char + RTS + +AINT1 LSR ;put arg count into carry + + DEC STRLEN + BNE AINT2 + PHP + LDY #0 + LDA (STRLOC),Y ;get key + JSR CONV + + TAY + LDA #$FF + STA INTBUF ;enable int + STA INTBUF,Y ;mark as an int key + PLP +AINT2 BCS DO_AINT + RTS + +AINT3 LDX #badtype ;type mismatch error + JMP BADERR + +*------------------------------- +* get a single character +*------------------------------- + +DO_GET JSR CHKFRE ;make sure enough memory + LDA #0 + STA INTOUT ;reset output + STA INTBUF + JSR VARSET ;setup var + LDA VNAME + BPL AINT3 ;its a number + + JSR CHKTIME ;check for timeout + BCC :DO_GET3 ;opps, timeout! + +:DO_GET0 JSR KEYIN ;get the char + BIT DOCHAT + BPL :DO_GET2 ;all is well + + DEC INCHAT + JSR DO_CHAT ;handle chat + JMP :DO_GET0 + +:DO_GET2 JSR CONV + LDY #0 + STA (VARSTR),Y ;save character + + LDA VARSTR + STA (VPTR),Y ;point to char + INY + LDA VARSTR+1 + STA (VPTR),Y + INY + LDA #1 + STA (VPTR),Y ;length 1 + + INC VARSTR + BNE :DO_GET3 ;inc string space + INC VARSTR+1 + +:DO_GET3 RTS + +*------------------------------- +* set up variable pointers +*------------------------------- + +DO_SET JSR VARSET ;set up pointers + JSR GOBEQU + + JSR CHKBYT ;set to null? + CMP #""" + BNE :SET2 ;nope + + JSR GETBYT ;gobble quotes + JSR GETBYT + + LDA VARSTR ;point at empty space + STA TEMP + LDA VARSTR+1 + STA TEMP+1 + LDX #0 ;set length to zero + BEQ :SET3 + +:SET2 LDA VPTR + PHA + LDA VPTR+1 ;save current pointers + PHA + + JSR INPNUM ;get address of string + PHA + TXA + PHA + JSR GOBCOM + JSR INPNUM ;get length of string + + PLA + STA TEMP ;restore address of string + PLA + STA TEMP+1 + + PLA + STA VPTR+1 ;restore pointers to orig var + PLA + STA VPTR + +:SET3 LDY #2 + TXA ;save file length + STA (VPTR),Y + DEY + + LDA TEMP+1 + STA (VPTR),Y ;save high byte of address + DEY + LDA TEMP + STA (VPTR),Y ;save low byte of address + RTS + +*------------------------------- +* get a number in string form +*------------------------------- + +DO_STR JSR INPNARG ;get arg + + LDA VECTOR ;save current vector value + PHA + LDA VECTOR+1 + PHA + + LDA #NIL + STA VECTOR+1 + + JSR GETNUMB ;print number to memory + JSR DECOUT + + PLA + STA VECTOR+1 ;restore vector + PLA + STA VECTOR + + LDA VARSTR ;point to string + STA DATA+1 + LDA VARSTR+1 + STA DATA+2 + + LDA TXTNUM + STA DATA+3 ;save length + + LDY #0 + LDX #1 +:DO_STR2 LDA TXTNUM,X + STA (VARSTR),Y ;copy byte + INX + INC VARSTR + BNE :DO_STR3 ;point to next byte + INC VARSTR+1 + +:DO_STR3 DEC TXTNUM + BNE :DO_STR2 ;count the digits + + LDA #2 + STA DATA ;we're done + RTS + +*------------------------------- +* "not" a value +*------------------------------- + +DO_NOT JSR INPNUM ;get value + STX TEMP + LDX #1 + ORA TEMP ;see if its zero or non-zero + BEQ :DO_NOT2 + + DEX +:DO_NOT2 TXA + JMP SVDATA ;save result + +*------------------------------- +* check a flag +*------------------------------- + +DO_FLAG JSR CHKBYT + CMP #"(" + BEQ :FLAG2 ;is there an arg?, yep + + BIT IMMDEF ;was it an assignment? + BPL :FLAG1 ;nope + + JSR GOBEQU ;gobble equal's + JSR INPNUM ;get location + STX FLGPTR ;that's it! + STA FLGPTR+1 + RTS + +:FLAG1 LDX FLGPTR ;get current pointer + LDA FLGPTR+1 + JMP DO_MATH ;and return + +:FLAG2 BIT IMMDEF ;check exec status + PHP ;and save it + + JSR INPNARG ;get arg + TXA + AND #%00000111 ;save bit number + TAX + LDA BITVAL,X + STA TEMP2 ;convert to bit value + LUP 3 ;shift down 3 bits + LSR NUMB+1 + ROR NUMB + --^ + CLC + LDA NUMB + ADC FLGPTR + STA TEMP ;add in start + LDA NUMB+1 + ADC FLGPTR+1 + STA TEMP+1 + + PLP + BMI :FLAG4 ;yep + + LDY #0 + LDA (TEMP),Y ;get byte + AND TEMP2 ;and value + BEQ :FLAG3 + + LDA #1 ;return flag setting +:FLAG3 JMP SVDATA + +:FLAG4 JSR GOBEQU ;gobble equal's + JSR INPNUM + LDY #0 + LDA NUMB ;check for zero + ORA NUMB+1 + BNE :FLAG5 ;non-zero + + LDA TEMP2 ;get bit + EOR #$FF ;make into mask + AND (TEMP),Y ;kill bit + STA (TEMP),Y ;save + RTS + +:FLAG5 LDA TEMP2 ;get bit + ORA (TEMP),Y ;add in + STA (TEMP),Y ;save + RTS + +BITVAL HEX 0102040810204080 + +FLGPTR DA 0 + +*------------------------------- +* get value of a nibble +*------------------------------- + +DO_NIB JSR CHKBYT ;do they want to check data? + CMP #"(" + BEQ :NIB2 ;yep + + BIT IMMDEF ;get address + BPL :NIB1 + + JSR GOBEQU ;gobble + JSR INPNUM + STX NIBPTR ;save pointer + STA NIBPTR+1 + RTS + +:NIB1 LDX NIBPTR ;get point to nibble + LDA NIBPTR+1 + JMP DO_MATH + +:NIB2 BIT IMMDEF ;is this an assignment? + PHP + JSR INPNARG ;get arg + PLP + BMI :NIB4 ;yep + + TXA + LSR ;divide by 2 + TAY + LDA (NIBPTR),Y ;get byte + + BCS :NIB3 ;nope + + LUP 4 + LSR + --^ +:NIB3 AND #$F ;get rid of any extra + JMP SVDATA + +:NIB4 TXA + PHA + + JSR GOBEQU ;gobble + JSR INPNUM + + PLA ;get back offset + LSR ;divide + TAY ;save + + PHP + TXA ;get data + CMP #16 + BLT :NIB4A ;in range?, yep + + LDA #15 ;set to max +:NIB4A STA TEMP ;save + LUP 4 + ASL + --^ + STA TEMP+1 ;save x 16 + + PLP + BCS :NIB5 ;do appropriate save + + LDA (NIBPTR),Y ;get orig byte + AND #$F ;kill old stuff + ORA TEMP+1 ;insert new + STA (NIBPTR),Y ;save + RTS + +:NIB5 LDA (NIBPTR),Y ;get orig byte + AND #$F0 ;kill old + ORA TEMP ;insert new + STA (NIBPTR),Y ;save + RTS + +*------------------------------- +* get value of a byte (like peek) +*------------------------------- + +DO_BYT JSR CHKBYT ;set the pointer? + CMP #"(" + BEQ :BYT2 ;nope + + BIT IMMDEF ;do they want to know what it is? + BPL :BYT1 ;yep + + JSR GOBEQU ;gobble + JSR INPNUM + STX BYTPTR ;save new pointer + STA BYTPTR+1 + RTS + +:BYT1 LDX BYTPTR ;return current pointer + LDA BYTPTR+1 + JMP DO_MATH + +:BYT2 BIT IMMDEF ;is this an assignment? + PHP + JSR INPNARG ;get arg + PLP + BMI :BYT3 ;yep -- ^^^^ + + LDY NUMB ;get index + LDA (BYTPTR),Y ;get data + JMP SVDATA + +:BYT3 TXA + PHA ;save arg + JSR GOBEQU ;gobble + JSR INPNUM ;get value + CMP #0 + BEQ :BYT3A ;in range?, yep + + LDX #255 ;use max + +:BYT3A PLA + TAY ;restore offset + + TXA + STA (BYTPTR),Y ;save value + RTS diff --git a/Source/Acos/DISK.S b/Source/Acos/DISK.S index 4783d68..c7c2072 100644 --- a/Source/Acos/DISK.S +++ b/Source/Acos/DISK.S @@ -1 +1,1872 @@ -Ǎ Ӯ ō ݍΠؠҠŠ Ҡ͠ ؍ؠв ؠŠδ ۱ݍūؠ 占ɠγҠ͠ ፠ҠŠ 占٠в Ҡ΍ؠв 占Ӡβ͍β¬ؠ àūؠ 墍Ӎγؠ 占Šεδؠ εРҍ 썪Π٠ ūٍ̠β ٍū٠ ɠγ 썍βҠΠ 占Ӡγ Ӡ 썍γà Ӎ 卪РҠ֠ 占Ҡˠ 占¬ٍ͠ 퍠РĠ 卍 卪ӠҠ֠ 占ؠѠ̳ 썍Ҡˠ 占ؠ ūؠ ¬ؠ 퍠Ѡ̶ ͍РŠ 󩍍 󍪭̳ū ̴̠  Ѡ̴ ͍Ҡō̴ū ̵̠« Ѡ̵ ͍Ҡō̵ū ū̶Ӎ 卪α  ͍Рōβ« ͍Рō 卪Ա  ͍РōԲ«͠ Рō Ӡ 󍍪 򍪭֠Ҡԍؠ٠РŠֱ 卍ҠԠ Ҡ 占ҠԍР獠ѠǠ 卍Ҡ͍РŠֲ ԠԠ 𿍠ɠDzؠѠֲ 퍍DzҠԍРŠְҠԠ ፺ְŬؠ 占ֲ̠卍٠ ̠ ؍ֱӍǠҠԠ占Ҡ͠ ؠ͠占ͫԠ 占ؠ 썠РDz ֲؠ Рҍˠ٠ 占٠Šֲ 宮Ӎ 卪ŠҠǠ ؠŠֲ 卍­ؠ 퍠͍Ҡڠ 占Рȍ 卪ƠҠǠ ؠŠֲ 卍­ؠ 퍠͍ҠƠ 捠Р 󍍪 卪ˠҠǍؠѠ˵ 忍؍ؠŠ˳ 썍ūؠ 占̠˳¬؍٠ 퍍ԠƠ 䍠̠˲Ҡՠ ٠٠ 덠Ҡ͍٠ٍРˍ˲Ҡˠ 덠à˴ 썍Р˴РȠ ˳ؠ Рҍ˵ԠƠ 俍̠˶卍ҠՍҠ͠ ؠҠ占Ӎ˶Ҡ Р 􍪭ˠҠŠ Ҡ̳ ҠŠ 占̍ҠԍРŠ˴ 卍Ҡ͠ ፠ҠҠ 썍٠˲é٠ 占Ҡ֍ٍ٠΍Š˳ 򿍍˳̭٠ ٠Š˲ ٍ̭˴ҠӠ ҠĠ 占ҠР 󍍠Ġ 塍ҍčҫ̠ 쿍Ѡ˹ ؠ ˵٠ ˶Ƭؠ Ѡ˸ 卍؍Рٍ̬Š˷ 荠ٍ̠ 忍à˶ 獍Ġư ؍؍ƫ؍Ҡ 占ƫ؍ҫ˹Ӡ˷ ؍ĠưÍà 썠؍à˵ ፍ˸ؠ렻 䍠Рҍ̠Ӡ 썍 卪ҠҠ̳ ҠŠ 占٠፠占ؠ占ҠŠ 占ҠΠ 卍ҠӠ ҠōҠō͠ Ҡō͠ ҠōͫҠōÍͫàͫÍà ፠Ҡōٍ̍ؠ͠ 덠ͫҠˍҠŠ 占ҠР Ӎ ̠Ҡ̳ 󍍠ҠŠ 占ҠҍҠ΍à̲ 占ؠРҠ 卍̲ҠŠ ҠōҠŠ ͍Ҡō͍ؠ ፠ҠōͫҠŠ ፠ٍ̍Ҡˠ ፍҠŠ 卍 ӍҠРӍ ፪ӠҠŠ ͠ ЍͫЫ 荠Ӎвà ЍàЍЫàЫ٠ЩٍѠе 獠ЍӍЍ̠в 󍍠٠ЩٍҠ 獠ٍЩٍҫٍЩٍ؍Ѡв 箮ҫ 䍠Рͫ Ѡг 퍠Šв РĠ 퍠Ԡв 䍍гҍР͍Šв 덍٠дҩٍҩ٠ ٍ؍Šд ؍٠ҍҩ٠ 獠ٍҫҩٍÍàҠ ҍàҫҫРвеӠ 忍Ѡи 􍍠Р гЫг͍РҍŠж àҫжҍàЫàҫ٠٠͍зҩٍЩ٠ 占ٍŠзҫà͍àЫàҫ 占РͫŠзؠЍؠ͠ ؠЫ؍ؠͫ͠ ͫиӍ 󍪭РӠ 俍Ѡи 獍Í͍à 􍍠ͫà 􍍠͠ ЍͫЫؠ͍٠вٍͩЩ٠ 占ٍŠвàͫàЫ 占؍ŠвР ݍҍЫҫ͍ЍͫЫгÍЍàР ЫàЫ٠ЩٍѠд 占̠г 󍍠٠ 獠Щ٠ 翍ѠгٍЩ٠ 獠РčԠг 􍍠ٍÍàЩٍЩ٠ ٍàЩٍЩٍРгдÍЫàͫ ҠÍà͍ͫͫӠӍ 卪נԠ ҠԠ РŠװҠǠ ؠԠ 􍍺װҠ֠ 占٠΍ìؠ Ҳë؍Ҳ­ٍ͠ 퍠Šװ ҠŠ 卍װҠԍРŠױҠ͠卺ױҠ֍٠ԍìؠ ҍë؍ҫΠ 占РŠ׳РŠײ  ҠΠ 占ӠӠ 롩ײҠԠ 占͍Ơ 퍍 卍׳Ԡ̠ 쿍ɠ׳ؠ΍РŠ׳ 忬 ׳ؠƍ͠ 􍍠ҠŠ à״Р׵ ፍ 卍׳ؠ ׳ ҠР ፠РŠ׳à  卍 􍍺׳àƬؠ占ٍ؍؍٠Ѡ״ 忬 ٠Š׳  忬 卍 썍Ԡ РŠ״卍Ơ Ġ鍠РŠ״卍ƫ آҠ֍РاŠ״卍ƫ 忍Ġ鍠Р Š״卍ҠΠ 占Ԡ̍ɠײ  卍״ؠ ״ؠ؍Ƭؠ ፠Ѡ׵ 卍Ġ鍠Р捠Ѡ״  ҠԠ ״ ؠؠ ؍РŠ״ 忬 卍 􍍠Ԡ Ѡ״à卍àԍѠ׵ 썍״àΠ 쿍РѠ׳Ԡ Š׳卍ԠԠ ̠׳卍 ׵Ԡ̠ ɠ׵  􍍠Π 忍Š׶卍׵ ƍ͠ 퍠ҠŠ 占Ԡ̠̍׶à̠ 썺׳Р׳ 卍׶Ԡ Р Ԡβ  䍠РԍΠƫ 占ÍƫëΠ 荠ҠͰ 卍ҠΠ 占Ӡβ à̠ βӍΠ Ԡ Ơ ̠  卪ӠҠ֠ 占Ҡˠ 卍¬ٍ͠ 򍍠Ҡ͠ 荠ؠӠ 荠ӫҠ͠ ፠Ҡ͠ ؠӫ ӫӫ ҠԍРŠӲ 箮Ҡ͠ ፠Ҡ͍ؠӫ 􍍺ӲؠӠ ӫҠӫӫҠ̰Íӫàԍؠ ة àԫ٠ԫ ٩РӍ ĠҠ֍ìؠ Ҳë؍ҲҠ͠ ፠ؠввҠ͠ ፠Ҡ͠ 䍍٠IJҠР вٍٍ؍ŠIJӍ 卪ԠҠ֍ìؠ ҍë؍ҫҠ͠ ፠ؠввҠ͠ ፠Ҡ͠ 荍٠Ҳв٠ ፠Ҡԍٍ؍ŠҲӍ 婍̠ҠԍРѠ̲ 忬 ҠŠ 占РŠ 卍̲Ҡ֠ ؠ͍ͫҠǍ٠ ؍ЩٍٍЩٍЩ٠ ٍЩٍٍЩٍٍЩٍҠҠ 덍 荠ٍ ؍̳ؠ͠ ͫ͠忍Ѡ̴ͫҠà 덍ؠ͠ ͫҠˠ 덍ؠƠ 덠ƍ٠Ҡˍؠƫ ƫР̳ 􍍺̴ҠԠ РȠ  卪٠ҠԠ 忍РŠٰ卍Р֠ 卍ٰƠ 퍠͍Ѡٱ 䍍ҠŠ 卍ٱҠŠ 占ōѠٳ 􍍠٠ ҠΠ 占Ӡٴ 䡍͍Ơ 퍍٠ٲҠŠ Ϭٍٍ٠ŠٲǠ 䍠ǍūūٳӍٴؠ砻 䍠РҍȠƠ 퍠͍ؠҠˍ٠ȲϬ٠ Ҡōٍ٠ŠȲӍ 󩍪ǠҠǠ ԠƠ ɠǴؠϫŠDz 忬 占РϫŠDz卍ؠϫ ϫРȍDz  󿍠Šdz卍ؠϫ ϫРȍdzҠ  ҠǠ ٠Щ٠ ؍ٍЩٍРȠ Ǵ Ҡՠ占Ҡ͠ 򍍠 ؍ؠϫŠǵ 忬 卍РϫŠǵ 卍 Ҡ  占ؠϫϫҠȠ 덍 ؍ǵҠǠ Ҡ  ٠Щ٠ ٍЩٍРҠ 덍 Ǡؠ ؠŠDZÍàDZؠР ؠв̠в ̠̍ ̠ РǍѠDzǠ ÍàϠ 􍍠؍ 덠ҠǠ 䍍ؠƠ ƍ٠ ҠˍDzР ̠̍ Ѝ ፠̍ÍàƠ ЫӠ 卪̠ԠҠ ɠ̲卍ؠؠ ؠ̱Ҭ؍Ҭؠ ؍̠̱ؠ؍àҠ 卺̲РǍ 􍪭Ġؠˠ ˫ؠˍŠı 卍Р˫ѠIJ 卍ıؠˠ占˫Ҡˠ 덠ؠƠ ƍ٠ҠˍIJҍҠ ԸŸҸҸӍ 䍍ǠԠ 占ؠ͠ ͫҠǠ 卍٠ Щٍ؍ٍЩ٠ ᮮŠ؍РDzؠЩٍDZؠˠ ˫Ҡˠ 卍Ġ ƍؠƠ ፠ƍ٠Ҡˍ٠٠Ҡ Ÿ ؠؠ ٠ٍ 卪Ǡؠؠ ٠ٍԠԠ 󿍠̠Ǡ 􍍠ԠĠ ῍ɠDzԠŸ 占ɠDz 􍍠٠Ҡ ٠Ѡdz Ῥ Ƭ٠ 占̠ ѠǴ ፠ҠҸ 占Ҡ 占àҠ àŸ 占РdzDzҸ 占ҠѠǴؠؠŸ Рdzdzƫ؍ƫ ѠǴƫРDZ 덍ǴàĠ ፍDz dzؠؠ ፠٠ٍӍ 卪Ǡؠ͠ ͫРϫѠǰԠDZŠǵ 翍ǰؠϫԠDZǵؠϫ ϫDZҠǠ 占٠ЩٍٍЩٍŠDzҠà 덍ؠˠ ˫٠ЩٍٍЩٍҠҠ 덍ؠ؍àԠ 獠Ÿ Ҳ ѠǴDzǠ 俍РŠDz󍍠٠ Щٍ؍ٍЩٍҠӍDzҠˠ ؠؠ ٠ٍdzҠǠ ፠РŠdzҠˠ Ǵ٠ٍĠ ፍǶؠؠ ٠ٍ 卪Ǡؠؠ ٠ٍԠԠ 俍ɠǰРǠ卍ǰԠĠ ɠDZ  卍ԠŸ 占ɠDz 􍍠٠Ҳ ٠ѠDZ 뿬 Ʋ٠ 占àҲàŸ 占РŠǴǰؠؠƲ 덠ؠƲРDZ DZҠà 덠ؠƲƲDZؠˠ 덠˫ҠˍؠƲ 덠Ʋ٠ҠˍҲ Ÿ 򍍠Ʋ ˍƲ˫ˠ 뿍ŠǶҠԠ ҠȠ àĠ ؠ؍٠ٍDZ ӍDzؠҲ٠̍dz؍̠Ʋؠ ̍ҠƲ؍ٍŠdzؠؠŸ 占ѠǰǴؠؠ ٠ٍӍ ፪àǠ РƍѠô٠ òؠóƬ٠ 덠Ġ̬؍Ѡõ 卍ؠ 忍ؠŠó占ٍ̠ò 卍ҠԠ 덍ôàǠ 忍ҠԠ Рà 獍õƬٍ̬ؠ 占Ƭٍ٠в ̠в̠̍в̠̍в̍в à àв ؍àввǠ ̠̍ Íàв ፍàϫŠö àϫöӍ ㍪àҠӍР ҠЫҍҠЫҍҍٍؠв ̬؍ҠƍĠƬ٠ Ƭ٠ 卍ϫ Š̳àϫ̳àϫӍ ӠÍàЍĠв 󩍠àЫ ةҍҠ РǍѠ̲  Ǡ 𿍠РƍѠ̱ 卍ҠԠ ̱Ǡ ҠԠ ̲Ӎ 덍ԠؠǍҠǠ 덍ؠƠ 덠ƍ٠Рˍ 덍ԠؠǠ 덠ҠǍؠƠ ƍ٠Рˍ 򍪭ˠؠˠ ˫ÍϠ 僧àϫà àÍàˠ ፠؍˫àРǍ 덪ҠÍǠ àύ؍ҠǍÍϫ àǠ РԠұ ұ٠ 占ؠƠ ƍРˍ 󍪭ˠ٠˲Ƭ٠ 占ƲٍƬ٠ Ʋ٠ ٍ̠˲٠˳Ҭ٠ ҲٍҬٍҲٍٍ̠˳Ӎ 卪ŠҠŠ 占٠ԍ占ؠ占РŠ 􍍪 卪ȠؠƍؠǍؠǫ 덠؍ؠϫ ؠϫؠ٠ȲؠѠȳ 뿍Ǡ ῍РϫѠȷƫؠ ƫ؍Šȴؠ ؍؍؍̠Ȳ 卍ȳàǍؠǠ 忍РϫѠȲ٠٠ ٍÍàϠ ؍ҠǠؠƠ 덠ƍ٠Ҡˍ٠٠ ٍؠѠȲ 獍ȷؠؠƠ ؠƫؠƫ ؠƫȴ٠Ѡȶ 뿬 ȵǠ 俍РϫѠȶàϫŠȵ àϫȵƬ؍ϫ 占ƫ٠ 䍠؍ٍƬ؍ϫ 占ƫ٠ 䍠؍ٍƬ؍ƫ٠ 占؍ٍƬ؍ƫ٠ 占؍ٍРȲȶǫ 󿍠РƍѠȸ卍ؠؠ ÍàϠ ؍ҠǠؠƫ ƫ٠Ҡˍؠؠ ٠ȸȹƫ٠ ٍŠȹàǫ ٍǫРϫŠȵ 俬 卍ҠȠ ƍǠ Ӎ 덪РƠ 퍠͍РȠ 덍 䍪ŠƠ 퍠͍Ѡű 䍍ҠŠ 卍ƍű٠Ҡà ҠÍҠŠ 占ҠΠ 占ӠŲؠčč٠ 멍ҠˍҠŠ РĠ 卍Ųؠ 썠Рҍ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Disk * +* * +******************************** + DATE +*------------------------------- +* open a text file [actually, any type of file!] +*------------------------------- + +DO_OPEN LDX #"#" + JSR GOBBLE ;gobble "#" + JSR INPNUM ;get channel to open + DEX + STX TEMP2 ;save buffer number + CPX #2 + BGE :DO_OPN4 ;make sure it's in range [1-2] + + LDA DEVUSE+1,X ;see if channel in use + BMI :DO_OPN3 + + JSR GOBCOM ;gobble comma + JSR MOVNAME ;move file name + LDY TEMP2 ;get buffer number + JSR BFOPEN + + LDX TEMP2 + LDA #0 ;save refnum or 0 if none + BCS :DO_OPN2 + + LDA REFNUM +:DO_OPN2 STA REFTAB,X ;save ref number + DEC DEVUSE+1,X ;put "in use" + RTS + +:DO_OPN3 LDX #badfn ;bad file name + BNE :DO_OPN5 + +:DO_OPN4 LDX #baddev ;bad device number +:DO_OPN5 JMP BADERR + +*------------------------------- +* try to open in a non-used channel +*------------------------------- + +IFOPEN LDY #0 ;check channel 1 + LDA DEVUSE+1,Y + BPL :IFOPEN2 ;it's open + + INY + LDA DEVUSE+1,Y ;try channel 2 + BMI :IFOPEN3 ;hmm, no open channel + +:IFOPEN2 JSR BFOPEN ;open file + BCS :IFOPEN3 ;opps, file didn't open + RTS ;clc = all is well + +:IFOPEN3 SEC ;opps, couldn't open + RTS + +*------------------------------- +* append to a file +*------------------------------- + +DO_APP JSR GETDEV ;get device + JSR CHKDSK ;make sure device is a file + LDA REFTAB,Y + STA REFNUM ;get refnum + JMP APPEND ;append to file + +*------------------------------- +* close a file +*------------------------------- + +DO_CLOS JSR GETDEV ;get device + CPX #0 + BEQ DO_CL3 ;if there wasn't one (or dev0) close all + + JSR CHKDSK ;make sure device is a file + TYA + TAX ;x = y + LDA #0 + STA DEVUSE+1,X ;"un use" it + LDA REFTAB,X ;get refnum + BEQ DO_CL6 ;opps, not really open + + STA REFNUM + JMP CLOSE ;close the correct file(s) + +*------------------------------- +* close open files +*------------------------------- + +DO_CL3 LDA DEVUSE+1 ;check channel 1 + BPL :DO_CL4 + + LDA REFTAB ;close channel 1 + BEQ :DO_CL4 ;opps, not really open + + STA REFNUM + JSR CLOSE + +:DO_CL4 LDA DEVUSE+2 ;check channel 2 + BPL :DO_CL5 + + LDA REFTAB+1 ;close channel 2 + BEQ :DO_CL5 ;opps, not really open + + STA REFNUM + JSR CLOSE + +:DO_CL5 LDA #0 + STA DEVUSE+1 ;close both channels + STA DEVUSE+2 +DO_CL6 RTS + +*------------------------------- +* get input from the file +*------------------------------- + +DISKIN1 LDA REFTAB ;use channel 1 + STA REFNUM + JMP RDBYTE + +DISKIN2 LDA REFTAB+1 ;use channel 2 + STA REFNUM + JMP RDBYTE + +*------------------------------- +* output to a file +*------------------------------- + +DSKOUT1 PHA + LDA REFTAB ;use channel 1 + STA REFNUM + PLA + JMP WRBYTE + +DSKOUT2 PHA + LDA REFTAB+1 + STA REFNUM ;use channel 2 + PLA + JMP WRBYTE + +REFTAB DS 2 ;reference numbers + +*------------------------------- +* get the device number +*------------------------------- + +GETDEV JSR CHKBYT + LDX #0 + LDY #0 + CMP #"#" + BNE :GETDEV1 ;device indicator?, nope + + JSR GETBYT ;gobble '#' + LDA #0 + STA DEVCLR ;reset device byte + JSR CHKBYT + CMP #msg + BEQ :GETMSG ;check for message + + JSR INPNUM + CMP #0 + BNE GETDEV2 ;if > 255 + + BIT MSGINIT ;is channel 6 setup? + BMI :GETMSG2 ;yep + + CPX #6 + BEQ GETDEV2 ;trying to use channel 6?, yes, stop them + +:GETMSG2 JSR CHKBYT + CMP #"," + BNE :GETDEV0 + + JSR GETBYT ;gobble comma +:GETDEV0 LDA DEVUSE,X ;is channel in use + BPL GETDEV2 ;nope + + TXA + TAY ;y = x + ASL ;x = x * 2 + TAX +:GETDEV1 RTS + +:GETMSG JSR GETBYT ;gobble + JSR INPNUM ;get msg number + STX MSGNUM ;save + STA MSGNUM+1 + LDA #0 + STA MSGINIT ;init message + LDX #6 ;return channel + JMP :GETMSG2 ;finish up + +GETDEV2 LDX #baddev ;bad device # + JMP BADERR + +CHKDSK DEY ;make sure device is a file + CPY #2 + BGE GETDEV2 ;if it's not a file... + + RTS + +*------------------------------- +* get the size of the open file +*------------------------------- + +DO_SIZE JSR INPNARG ;get volume number + CPX #3 + BGE GETDEV2 ;bad device + + LDA REFTAB-1,X ;get refnum + STA REFNUM + JSR GETSIZ ;get the file size + JMP DO_MATH + +*------------------------------- +* check for end of file +*------------------------------- + +DO_EOF JSR INPNARG ;get channel number + CPX #3 + BGE GETDEV2 ;bad device + + LDA REFTAB-1,X ;move refnum + STA REFNUM + JSR CHKEOF ;check for eof + TXA + JMP SVDATA ;return results + +*------------------------------- +* set/get the mark for a file +*------------------------------- + +DO_MARK JSR INPNARG + CPX #10 + BEQ :DO_MRK5 ;ram drive? + + DEX + CPX #2 + BGE :DO_MRK3 ;make sure it's a valid channel + + LDA DEVUSE+1,X ;not current in use + BPL :DO_MRK3 + + LDA REFTAB,X + TAY ;get refnum + + BIT IMMDEF ;see if mark was exec'ed + BPL :DO_MRK2 + + JSR GOBEQU ;possible syntax error + STY SAVE_Y ;set the mark + JSR INPNUM + LDY SAVE_Y + JMP SETMARK + +:DO_MRK2 JSR GETMARK ;get the mark + BCC :DO_MRK4 ;all is well + + LDA #1 ;error + JMP SVDATA + +:DO_MRK4 JMP DO_MATH ;return location + +:DO_MRK3 LDX #baddev ;bad device # + JMP BADERR + +:DO_MRK5 BIT IMMDEF ;did they exec command? + BPL :DO_MRK6 ;nope + + JSR GOBEQU + JSR INPNUM ;get pointer + STX RAMPTR ;save + RTS + +:DO_MRK6 LDA RAMPTR ;return pointer + JMP SVDATA + +*------------------------------- +* link to another segment +*------------------------------- + +DO_LINK JSR DO_FRE ;compact variables + JSR DO_CL3 ;close all open files + JSR MOVNAME ;move filename + LDA #0 + STA LNKLBL + JSR CHKBYT + CMP #"," + BNE :LINK4 ;check for link label, nope + + JSR GOBCOM ;gobble comma + JSR INPSTR ;get link label + + LDY #0 +:LINK2 LDA (STRLOC),Y ;copy label name + JSR CONV + INY + CPY STRLEN + BNE :LINK3 ;is this the last char? + + ORA #hibit +:LINK3 STA LNKLBL-1,Y ;save char + CPY #8 + BNE :LINK2 + + ORA #hibit ;mark last char + STA LNKLBL-1,Y + +:LINK4 JSR COMPRES ;compress variables + JSR LD_MOD ;load in module + JSR UNCOMP ;un-compress variables + + LDA #CODEND + STA PRGPTR+1 + LDA LNKLBL ;link to a label? + BEQ :LINK9 ;nope, just return + + LDX #128 ;start table pointer +:LINK5 LDY #0 ;start string pointer +:LINK6 LDA LNBUF,X ;get first char + BEQ :LINK8 ;opps, end of table + + INX + CMP LNKLBL,Y + BNE :LINK7 ;check it, no match + INY + ASL ;are we done? + BCC :LINK6 ;nope, keep checking + + TXA + AND #$F0 ;round down X + TAX + + LDA LNBUF+8,X + STA PRGPTR ;get address and save + LDA LNBUF+9,X + STA PRGPTR+1 +:LINK9 RTS ;return + +:LINK7 TXA ;round down X + AND #$F0 + CLC + ADC #$10 ;go to next label + TAX + BCC :LINK5 ;keep going if more data + +:LINK8 LDX #nolink ;link label not found + JMP BADERR + +LNKLBL DS 9 ;location of link label + +*------------------------------- +* store current variables to a disk file +*------------------------------- + +DO_STOR JSR DO_CL3 ;close any open files + JSR MOVNAME ;move filename + LDY #a2data + LDA #>packfile + LDX #CODEND ;make sure it's really in program + BLT :COMP2 ;good thing we checked + +:COMP3 LDA VPTR + CMP LOMEM + BGE :COMP2 ;it's ok + + LDY #0 +:COMP4 LDA (VPTR),Y + STA (VARSTR),Y ;copy string along with other strings + INY + DEX + BNE :COMP4 + + TYA ;x = y + TAX + LDY #2 + LDA VARSTR + STA (VPTR),Y ;point to new string + INY + LDA VARSTR+1 + STA (VPTR),Y + + CLC + TXA + ADC VARSTR ;move up pointers + STA VARSTR + LDA #0 + ADC VARSTR+1 + STA VARSTR+1 + JMP :COMP2 + +:COMP5 LDA CPASS ;anything done? + BEQ COMP8 ;no, just exit + + LDA TEMP ;save pointer to end of var pointers + STA TEMP3 + LDA TEMP+1 + STA TEMP3+1 + + LDA LOMEM + CMP VARSTR + BGE :COMP6 ;make pointers point to a boundry + + INC VARSTR+1 +:COMP6 STA VARSTR + DEC TEMP+1 + DEC VARSTR+1 + + LDY #0 + STY FREMEM + +:COMP7 LDA (VARSTR),Y + STA (TEMP),Y ;copy a page + INY + BNE :COMP7 + + LDA VARSTR+1 + INC FREMEM + DEC TEMP+1 + DEC VARSTR+1 ;go until we are done + CMP LOMEM+1 + BNE :COMP7 + + LDX TEMP + STX MIDMEM ;save location of strings + LDX TEMP+1 + INX + STX MIDMEM+1 + + LDA LOMEM ;point to variables/tables + STA DATA + LDA LOMEM+1 + STA DATA+1 +COMP8 RTS + +*------------------------------- +* un-compress memory into variables +*------------------------------- + +UNCOMP LDA CPASS ;anything compressed? + BEQ COMP8 ;no, do nothing + + SEC + LDA LOMEM + SBC DATA + STA DATA ;compute offset + + LDA LOMEM+1 + SBC DATA+1 + STA DATA+1 ;compute offset + + LDA LOMEM ;point at strings + STA TEMP + LDA LOMEM+1 + STA TEMP+1 + + LDX FREMEM + LDY #0 +:UNCOMP2 LDA (MIDMEM),Y + STA (TEMP),Y ;copy a page + INY + BNE :UNCOMP2 + + INC MIDMEM+1 + INC TEMP+1 ;count the page + DEX + BNE :UNCOMP2 + + LDA TEMP ;set up varstr [approx...] + STA VARSTR + LDA TEMP+1 + STA VARSTR+1 + + LDA HIMEM + STA TEMP + LDA HIMEM+1 + STA TEMP+1 + +:UNCOMP3 SEC + LDA TEMP + SBC #6 + STA TEMP ;count down through strings + LDA TEMP+1 + SBC #0 + STA TEMP+1 + + LDY #0 + LDA (TEMP),Y + BEQ :UNCOMP4 ;were done + BPL :UNCOMP3 ;don't fool with numbers + + LDY #4 ;check length of string + LDA (TEMP),Y ;is it an empty string? + BEQ :UNCOMP3 ;yep + + DEY + LDA (TEMP),Y ;get address of string + CMP #>CODEND + BLT :UNCOMP3 ;don't touch it + + DEY + CLC + LDA DATA + ADC (TEMP),Y + STA (TEMP),Y ;fix pointers + INY + LDA DATA+1 + ADC (TEMP),Y + STA (TEMP),Y + JMP :UNCOMP3 + +:UNCOMP4 SEC + LDA TEMP+1 + SBC LOMEM+1 ;fix midmem pointer + LSR A + CLC + ADC LOMEM+1 + STA MIDMEM+1 + + LDA #0 + STA MIDMEM +SHWRTS RTS + +*------------------------------- +* copy a file from device to device +*------------------------------- + +DO_SHOW LDA #0 + STA SHW_CNT ;reset line count + JSR CHKBYT ;check for # of lines + CMP #"(" + BNE :SHOW0A + + JSR INPNARG ;get argument + STX SHW_CNT ;save count + +:SHOW0A JSR GETDEV ;get input source + STY SHWIN + + LDA INPVEC,X ;save vector + STA VECTOR2 + LDA INPVEC+1,X + STA VECTOR2+1 + + LDA REFTAB-1,Y + STA REFNUM ;save possible refnum + TYA + BNE :SHOW0 ;if using device, skip + + JSR MOVNAME ;get filename + +:SHOW0 JSR CHKBYT + CMP #"," + BNE :SHOW1 + + JSR GOBCOM ;gobble +:SHOW1 JSR GETDEV + STY SHWOUT + + LDA OUTVEC,X ;save output vectors + STA VECTOR + LDA OUTVEC+1,X + STA VECTOR+1 + + LDA SHWIN ;get input device + CMP #3 + BGE :SHOW3 + CMP #0 + BNE :SHOW2 ;is file open?, yep + + JSR OPEN ;open the file + BCS SHWRTS ;we are done (that was quick!) + +:SHOW2 JSR RDLNSET ;setup for rdline + LDA REFNUM + STA SHWREF ;save refnum + +* input line of data from a disk file + +:SHOW3 BIT XTERNAL ;use external? + BMI :SHOW3X ;yep + + LDA SHWIN + CMP #3 + BGE :SHOW3A ;char device?, yep + +:SHOW3X LDA SHWREF + STA REFNUM ;make sure refnum is correct + + JSR RDLINE ;get char + BCC :SHOW4 + JMP :SHOW5 ;opps, end of data + +* input a line of data from a character device + +:SHOW3A LDX #0 ;start pointer +:SHOW3B TXA + PHA + JSR DO_INP ;get data + CMP #eot + BNE :SHOW3C ;end of section?, nope + + LDA #0 ;mark it + +:SHOW3C STA LNBUF,X ;save + TAY + PLA + TAX + INX + + CPY #0 + BEQ :SHOW4 ;are we done?, yep + CPY #cr + BNE :SHOW3B ;end of line?, nope + +* check for and handle ".x" external + + LDA SHWOUT ;is it to the crt? + CMP #6 + BGE :SHOW4 ;nope + + LDA LNBUF ;is it a dot? + AND #clrhi + CMP #'.' + BNE :SHOW4 ;nope + + LDA LNBUF+1 ;check for "X" + JSR CONV + CMP #'X' + BNE :SHOW4 ;nope + + LDA LNBUF+2 ;is it a space? + AND #clrhi + CMP #' ' + BNE :SHOW4 ;nope + + JSR EXTERN ;set up external file + BIT XTERNAL + BMI :SHOW2 ;ok, file is open + +* output a line of data to a device + +:SHOW4 LDX #0 ;start pointer +:SHOW4A STX SHOW_X + LDA LNBUF,X ;get data + BEQ :SHOW5 ;we are done with file + + AND #clrhi + CMP #lf + BEQ :SHOW4B ;strip all lf's + PHA + JSR DO_OUT ;output it + PLA + +:SHOW4B LDX SHOW_X ;get back pointer + INX + CMP #cr + BNE :SHOW4A ;done with line?, nope + +* handle end of line of output + + LDA SHW_CNT ;is there a line limit? + BEQ :SHOW4C ;nope + + DEC SHW_CNT + BEQ :SHOW5 ;count down lines, opps, that is all + +:SHOW4C LDA SHWIN ;is this a read mail? + CMP #7 + BEQ :JSHOW3 ;yep + + LDA SHWOUT ;is output to the crt? + BNE :JSHOW3 ;nope + + BIT INTOUT ;stop output? + BPL :JSHOW3 ;nope + +* handle end of output and return + +:SHOW5 BIT XTERNAL ;external on? + BMI :SHOW5B ;yep, close it + + LDA SHWIN ;is this from a disk file? + BNE :SHOW6 ;nope + +:SHOW5B LDA SHWREF + STA REFNUM ;get correct refnum + JSR CLOSE ;close file + BIT XTERNAL + BPL :SHOW6 + + INC XTERNAL ;turn off external +:JSHOW3 JMP :SHOW3 ;and continue + +:SHOW6 LDA SHWOUT ;check destination + CMP #4 ;is it console, disk 1 or 2? + BLT EXTERN2 ;yep, don't send null, just return + + LDA #0 ;were finished + JMP DO_OUT + +EXTERN LDA #LNBUF+3 + STA STRLOC+1 + LDA #19 + STA STRLEN ;save max string length + JSR MOVNM0 ;move the filename + + JSR IFOPEN ;open file + BCS EXTERN2 ;opps, file didn't open + + DEC XTERNAL ;flag that external read is on +EXTERN2 RTS + +SHWIN DB 0 +SHWOUT DB 0 +SHWREF DB 0 +XTERNAL DB 0 + +*------------------------------- +* position into a file +*------------------------------- + +DO_POS JSR GETDEV ;get device + JSR CHKDSK ;make sure it's a file + + LDA REFTAB,Y + STA REFNUM ;save the reference number + + JSR INPNUM ;get record length + STX FLPOS ;save rec length + STA FLPOS+1 + + JSR GOBCOM ;gobble comma + JSR INPNUM ;get record number + STX FLPOS+2 ;save rec number + STA FLPOS+3 + + LDA #0 + STA FLPOS+4 ;default offset to 0 + JSR CHKBYT + CMP #"," + BNE :DO_POS2 ;check for last arg... + + JSR GOBCOM ;gobble comma + JSR INPNUM + STX FLPOS+4 ;save byte offset + +:DO_POS2 LDX FLPOS ;set up for multiply + LDA FLPOS+1 + JSR SAVNUMB + + LDA FLPOS+2 + STA DATA+1 + LDA FLPOS+3 + STA DATA+2 + + JSR DO_MUL0 + + CLC + LDA FLPOS+4 + ADC RESULT + TAX ;save low (X) + LDA #0 ;compute med (A) + ADC RESULT+1 + LDY RESULT+2 ;get high (Y) + JMP SETPOS + +*------------------------------- +* read data from device into memory +*------------------------------- + +DO_READ JSR GETDEV + LDA INPVEC,X ;point to vector + STA VECTOR2 + LDA INPVEC+1,X + STA VECTOR2+1 + + JSR INPNUM ;point to data + STX TEMP2 + STA TEMP2+1 + + JSR GOBCOM ;gobble comma + JSR INPNUM ;get length of read + + LDY #0 +:DO_RD2 JSR DO_INP ;read data into memory + STA (TEMP2),Y + INY + DEX + BNE :DO_RD2 + RTS + +*------------------------------- +* write data to a device +*------------------------------- + +DO_WRIT JSR GETDEV + LDA OUTVEC,X ;set up vectors + STA VECTOR + LDA OUTVEC+1,X + STA VECTOR+1 + + JSR INPNUM ;point to data + STX TEMP2 + STA TEMP2+1 + + JSR GOBCOM ;gobble comma + JSR INPNUM ;get length + + LDY #0 +:DO_WR2 LDA (TEMP2),Y ;write data + JSR DO_OUT + INY + DEX + BNE :DO_WR2 + RTS + +*------------------------------- +* kill a file (or message) +*------------------------------- + +DO_KILL JSR CHKBYT + CMP #"#" + BEQ :KILL2 ;kill message?, yep + + JSR MOVNAME ;get filename + JMP DELFILE ;delete file + +:KILL2 JSR GETDEV ;get msg number + LDX MSGNUM + LDA MSGNUM+1 + JSR MSG + + LDY #2 ;get first block into A & X + LDA (TEMP),Y + PHA + INY + LDA (TEMP),Y + PHA + + LDA #0 + STA (TEMP),Y ;zero pointers + DEY + STA (TEMP),Y + DEY + STA (TEMP),Y + DEY + STA (TEMP),Y + JSR WRTDIR ;write dir back to disk + + PLA ;get high + TAY + PLA ;get low + TAX + TYA + +:KILL3 STX MSGNUM ;save block number + STA MSGNUM+1 + ORA MSGNUM ;done? + BEQ :KILL4 ;yep + + LDA MSGNUM+1 + JSR DEALLOC ;de-alloc block + + LDX MSGNUM ;get block number + LDA MSGNUM+1 + JSR SETBLK ;position to block + + LDX #LNBUF + LDY #1 + JSR RDBLK + + LDX LNBUF+126 ;get next block number + LDA LNBUF+127 + JMP :KILL3 ;and repeat + +:KILL4 JSR WRTBIT ;update bitmap + JMP FINISH ;write out dir info + +*------------------------------- +* ready a message file +*------------------------------- + +DO_RDY JSR CHKBYT ;do they want to ready a message? + CMP #"#" + BNE :DO_RDY0 ;nope + + JMP GETDEV ;fix message + +:DO_RDY0 LDA MSGREF ;get back old refnum + STA REFNUM + BEQ :DO_RDY1 ;file is closed + + JSR CLOSE ;close old msgfile + +:DO_RDY1 JSR MOVNAME ;get msg-file name + LDA FLNAME + BEQ :DO_RDY3 ;they are done with it + + LDY #2 ;use msgfile buffer + JSR BFOPEN ;open file + BCS :DO_RDY4 ;hmmm, thats bad! + + LDA REFNUM + STA MSGREF ;save refnum + + LDY #0 +:DO_RDY2 JSR RDBYTE ;read in info + STA MSGINFO,Y + INY + CPY #8 + BNE :DO_RDY2 + + LDA #-1 + STA DIRSEG ;no dir or bit seg loaded + STA BITSEG + STA DEVUSE+6 + STA DEVUSE+7 +:DO_RDY3 RTS + +:DO_RDY4 LDX #nomsg ;message file not found + JMP BADERR + +FINISH LDA MSGREF ;get refnum + STA REFNUM + LDX #0 + TXA + JSR SETMARK + + LDY #0 +:FINISH2 LDA MSGINFO,Y ;write the info + JSR WRBYTE + INY + CPY #8 + BNE :FINISH2 + RTS + +*------------------------------- +* get new message info (or number of messages) +*------------------------------- + +DO_MSG JSR INPNARG ;what message do they want to know about? + + BIT IMMDEF ;is this an assignment [msg(x)=] ? + BMI :DO_MSG4 ;yep + + CPX MSGINFO+4 + BNE :DO_MSG2 ;is it the last message?, nope + CMP MSGINFO+5 + BNE :DO_MSG2 ;nope + + LDX MSGINFO+6 ;we don't need to load the dir to find out + LDA MSGINFO+7 + JMP DO_MATH + +:DO_MSG2 ORA NUMB ;do they want the number of files? + BNE :DO_MSG3 ;nope + + LDX MSGINFO+4 ;get number of files + LDA MSGINFO+5 + JMP DO_MATH + +:DO_MSG3 JSR GETNUMB ;get message number + JSR MSG ;get info + + LDY #0 + LDA (TEMP),Y ;get new message # into a & x + TAX + INY + LDA (TEMP),Y + JMP DO_MATH ;finish up + +:DO_MSG4 PHA ;save msg number + TXA + PHA + + JSR GOBEQU ;gobble + JSR INPNUM ;get number + + PLA ;get back msg number + TAX + PLA + + CPX MSGINFO+4 + BNE :DO_MSG5 ;is this last message?, nope + + CMP MSGINFO+5 + BNE :DO_MSG5 ;check high, nope + + PHA ;save a and x + TXA + PHA + + JSR GETNUMB ;update highest new message + STX MSGINFO+6 + STA MSGINFO+7 + JSR FINISH ;write info to disk + + PLA ;restore a and x + TAX + PLA + +:DO_MSG5 JSR MSG ;position to info + + JSR GETNUMB ;get the new number + LDY #1 + STA (TEMP),Y ;save new message number + DEY + TXA + STA (TEMP),Y + JMP WRTDIR ;write dir back to disk + +*------------------------------- +* position and load directory for needed segment +* and setup pointers for needed entry +*------------------------------- + +MSG DEX ;msg = msg - 1 + CPX #-1 + BNE :MSG1 + + SEC + SBC #1 + +:MSG1 STX TEMP ;save msg number + STX TEMP2 + + ASL TEMP2 ;compute dir section number + ROL + ASL ;a = a * 4 + ASL ;make A into actual block number + CMP DIRSEG + BEQ :MSG2 + + STA DIRSEG ;save loaded dir seg number + CLC + ADC MSGINFO ;add in dir offset + + TAX + LDA #0 ;we have starting block + JSR POSMSG ;position for read + + LDX #DIRBUF + LDY #4 ;read 4 blocks + JSR RDBLK + +:MSG2 LDA TEMP ;get msg number + ASL + ASL ;a = a * 4 + STA TEMP + LDA #0 ;put last bit into a + ROL + CLC + ADC #>DIRBUF ;add in location of buffer + STA TEMP+1 + RTS ;all is set up + +*------------------------------- +* read a mail file +*------------------------------- + +RDMAIL BIT DEVCLR ;is this start? + BMI :RDMAIL2 ;nope + + STX BUF_X ;save x + LDX #4 +:RDMAIL1 LDA MSGPTR,X + STA RWDPTR,X ;copy all 5 bytes + DEX + BPL :RDMAIL1 ;loop + + LDX BUF_X + DEC DEVCLR ;clear change +:RDMAIL2 JMP RDMSG + +*------------------------------- +* rewind file to previous spot +*------------------------------- + +DO_RWD LDX RWDBLK ;get old block number + LDA RWDBLK+1 + + CPX RMXBLK + BNE :DO_RWD1 ;check low, nope + + CMP RMXBLK+1 + BEQ :DO_RWD2 ;check high, yep, it's the same + +:DO_RWD1 STX RMXBLK ;update + STA RMXBLK+1 + + JSR SETBLK ;point to block + LDX #BLKBUF + LDY #1 + JSR RDBLK + +:DO_RWD2 LDA RWDPTR + STA MSGPTR ;move pointers + LDA RWDBYT8 + STA BYTE8 + LDA RWDCHR8 + STA CHAR8 + RTS + +* setup message for read + +SETMSG LDA #-1 + STA MSGINIT ;init message base + LDX MSGNUM ;get message number + LDA MSGNUM+1 + JSR MSG ;locate message + + LDY #2 ;get starting block number + LDA (TEMP),Y + TAX + INY + ORA (TEMP),Y ;check for no data... + BNE SETMSGX + JMP SETMSG2 + +SETMSGX LDA (TEMP),Y +SETMSG1 STX RMXBLK ;save current block number + STA RMXBLK+1 + JSR SETBLK ;position and translate + + LDA #0 + STA RDEND ;reset end pointer + STA BLKBUF + LDX #BLKBUF + LDY #1 + JSR RDBLK + + LDY #0 + STY MSGPTR ;reset pointer + LDA #6 + STA BYTE8 ;reset hidden byte counter + LDX MSG_X ;get back x and y + LDY MSG_Y + +* ... fall through and read a byte ... + +*------------------------------- +* read a byte of message +*------------------------------- + +RDMSG STX MSG_X ;save both x and y + STY MSG_Y + + BIT MSGINIT ;is read in progress? + BPL SETMSG ;nope, start it + + BIT RDEND ;at end of data? + BMI SETMSG2 ;yep + + BIT BYTE8 ;check for hidden byte + BMI RDMSG2 ;do it + + LDY MSGPTR ;get index + CPY #126 + BEQ RDMSG3 ;need more data?, yep + + LDA BLKBUF,Y ;get byte + ASL ;put extra bit into carry + BEQ RDMSG4 ;opps, end of data + ROR CHAR8 ;put carry into hidden byte + LSR ;fix byte + INC MSGPTR ;inc pointer + DEC BYTE8 ;count down for hidden byte + JMP SETMSG3 + +RDMSG2 LDA CHAR8 ;get hidden byte + LSR ;fix + BEQ RDMSG4 + + LDX #6 + STX BYTE8 ;reset hidden byte counter + JMP SETMSG3 + +RDMSG3 LDA BLKBUF+126 + TAX + ORA BLKBUF+127 ;is next block 0? + BEQ RDMSG4 ;yep + + LDA BLKBUF+127 + JMP SETMSG1 ;read next block + +RDMSG4 DEC RDEND ;at end of data + +SETMSG2 LDA #0 ;opps, no data +SETMSG3 LDX MSG_X ;get back data + LDY MSG_Y + RTS + +*------------------------------- +* setup message for write +*------------------------------- + +WRTMSG LDX MSGNUM ;get msg number + LDA MSGNUM+1 + + CMP MSGINFO+5 + BEQ WRTMSG0 + BLT WRTMSG1 + BGE WRTMSG5 ;is the meessage file this big? + +WRTMSG0 CPX MSGINFO+4 + BLT WRTMSG1 + +WRTMSG5 STX MSGINFO+4 ;update message count + STA MSGINFO+5 + +WRTMSG1 JSR MSG ;locate message + LDY #2 + LDA (TEMP),Y + INY + ORA (TEMP),Y + BNE WRTMSG2 + + JSR ALLOC ;allocate new block + + STX WRKBLK ;update block number + STA WRKBLK+1 + + LDY #3 + STA (TEMP),Y + DEY + TXA + STA (TEMP),Y + JSR WRTDIR ;write dir back to disk + + LDX MSG_X + DEC MSGINIT ;init msg + LDA #6 + STA BYTE82 ;init byte counter + LDA #0 + STA MSGPTR2 ;init message pointer + BEQ WRTMSG4 + +WRTMSG2 LDA BITSEG ;bitmap loaded? + CMP #-1 + BNE WRTMSG2A ;yes + + LDY #2 ;read in bitmap + LDA (TEMP),Y + TAX + INY + LDA (TEMP),Y + JSR GETBITS + +WRTMSG2A JSR SWPBLK ;swap pointers + LDX MSG_X ;restore x and y + LDY MSG_Y + +WRTMSG3 JSR RDMSG ;do append to current data + CMP #0 + BNE WRTMSG3 + + JSR SWPBLK ;swap back +WRTMSG4 LDY MSG_Y + LDA #0 + STA WRTEND ;let them write data + +WRTMSG6 LDX MSG_X ;get back parms + LDY MSG_Y + PLA + +* ... fall througn and write byte ... + +*------------------------------- +* write a byte to a message +*------------------------------- + +WRMSG PHA + STX MSG_X ;save x and y + STY MSG_Y + + BIT MSGINIT ;have we started? + BMI WRMSG0A + JMP WRTMSG ;nope + +WRMSG0A BIT WRTEND ;has end been written? + BMI WRMSG1B ;yep, take no more + + BIT BYTE82 ;check for hidden byte + BMI WRMSG2 ;add it + + LDY MSGPTR2 ;get index + CPY #126 + BEQ WRMSG1 ;allocate new block?, yep + + STA BLKBUF2,Y ;save data and continue + INC MSGPTR2 + DEC BYTE82 ;count down hidden byte + CMP #0 + BNE WRMSG4 + +WRMSG0 LDX #0 + STX BLKBUF2+126 ;no link + STX BLKBUF2+127 + JMP WRMSG1A ;skip around link setup + +WRMSG1 JSR ALLOC ;allocate new block + STX BLKBUF2+126 + STA BLKBUF2+127 + +WRMSG1A LDX WRKBLK ;translate and position block + LDA WRKBLK+1 + JSR SETBLK + + LDX #BLKBUF2 + LDY #1 + JSR WRBLK + + LDA #0 + STA MSGPTR2 ;reset pointer + LDA #6 + STA BYTE82 ;reset hidden counter + + LDA BLKBUF2+126 ;save new block number + STA WRKBLK + LDA BLKBUF2+127 + STA WRKBLK+1 + ORA WRKBLK ;is there another block? + BNE WRTMSG6 ;yep + + JSR WRTBIT ;write out bitmap + JSR FINISH ;write out info + DEC WRTEND ;end has been written + LDX MSG_X + LDY MSG_Y +WRMSG1B PLA + RTS + +WRMSG2 LDX MSGPTR2 + LDY #7 + ASL +WRMSG3 DEX + ROL BLKBUF2,X ;add in bit 7 + ASL + ROR BLKBUF2,X + DEY + BNE WRMSG3 + + LDX #6 + STX BYTE82 + PLA ;get back byte + PHA + BEQ WRMSG0 + +WRMSG4 LDX MSG_X ;restore x and y + LDY MSG_Y + PLA + RTS + +*------------------------------- +* allocate a block for data +*------------------------------- + +ALLOC LDA BITSEG ;fresh start? + CMP #$FF + BEQ :ALLOC4 ;yep + + LDY #0 ;start count +:ALLOC2 LDX #0 +:ALLOC3 LDA BITBUF,Y ;search for free block + AND BITVAL,X + BEQ :ALLOC5 ;found one + + INX ;done with byte? + CPX #8 + BNE :ALLOC3 ;nope + INY + BPL :ALLOC2 ;done with buffer?, nope + + JSR WRTBIT ;write bit map back to disk + +:ALLOC4 INC BITSEG ;is there more space? + JSR RDBIT ;read in bit map segment + JMP ALLOC ;start (keep) looking + +:ALLOC5 LDA BITBUF,Y + ORA BITVAL,X ;mark byte + STA BITBUF,Y + + STY TEMP2 ;shift Y into 16 bits + LDA #0 ;bit16 = y * 8 + ASL TEMP2 + ROL + ASL TEMP2 + ROL + ASL TEMP2 + ROL + STA TEMP2+1 + + TXA ;add in x + SEC ;special (+1) + ADC TEMP2 ;bit16 = bit16 + x + 1 + TAX + LDA #0 + ADC TEMP2+1 + STA TEMP2+1 + + LDA BITSEG ;add in segment + ASL + ASL ;a = a * 4 + CLC + ADC TEMP2+1 ;bit16 = bit16 + a + + INC MSGINFO+2 + BNE :ALLOC6 ;add 1 to used blocks + INC MSGINFO+3 +:ALLOC6 RTS + +*------------------------------- +* de-alloc +*------------------------------- + +DEALLOC JSR GETBITS + + LDA TEMP ;shift down temp 3 bits into A + LSR TEMP+1 + ROR + LSR TEMP+1 + ROR + LSR + TAY + + LDX TEMP2 ;get bit offset + LDA BITVAL,X + EOR #$FF + AND BITBUF,Y ;clear bit + STA BITBUF,Y ;and save + + LDA MSGINFO+2 ;used blocks = used blocks -1 + BNE :DEALL3 + DEC MSGINFO+3 +:DEALL3 DEC MSGINFO+2 + RTS + +* read in bitmap, save old one (if any) + +GETBITS SEC + PHA + TXA + SBC #1 + STA TEMP + AND #%00000111 + STA TEMP2 ;save offset (in bits) + PLA + SBC #0 + STA TEMP+1 ;temp = (AX)-1 + + LSR + LSR ;a = a / 4 + + CMP BITSEG + BEQ :DEALL2 ;are we in position?, yep + + PHA + LDA BITSEG ;first access to bitmap? + CMP #$FF + BEQ :DEALL1 ;yep, done write + + JSR WRTBIT ;hmmm, write out current bitmap +:DEALL1 PLA + STA BITSEG ;update segment + JSR RDBIT ;read bit map +:DEALL2 RTS + +* read bit map from disk + +RDBIT LDX BITSEG + LDA #0 + JSR POSMSG ;position to block + + LDX #BITBUF + LDY #1 + JMP RDBLK + +* write bit map back to disk + +WRTBIT LDX BITSEG ;position to block + LDA #0 + JSR POSMSG + + LDX #BITBUF + LDY #1 + JMP WRBLK + +*------------------------------- +* position to false block number +*------------------------------- + +SETBLK STX POSBLK ;save block number + STA POSBLK+1 + CLC + LDA MSGINFO ;a = msginfo + msginfo(1) + ADC MSGINFO+1 + SEC ;a = a - 1 + SBC #1 + CLC + ADC POSBLK ;blk = blk + a + TAX + LDA POSBLK+1 + ADC #0 + JMP POSMSG + +*------------------------------- +* write the current directory segment back to disk +*------------------------------- + +WRTDIR CLC + LDA DIRSEG ;position to dir segment + ADC MSGINFO + TAX + LDA #0 + JSR POSMSG + + SEC + LDA MSGINFO+1 ;get # of dir blocks + SBC DIRSEG ;subtract current pointer + CMP #4 + BLT :WRTDIR1 ;there are less than 4 blocks left + LDA #4 ;there are more - only write 4 + +:WRTDIR1 TAY ;# of blocks to write + LDX #DIRBUF + JMP WRBLK + +*------------------------------- +* switch block buffers +*------------------------------- + +SWPBLK LDY #127 +:SWPBLK2 LDA BLKBUF,Y ;get buf 1 char + PHA ;save + LDA BLKBUF2,Y + STA BLKBUF,Y ;get buf 2 char, put in buf 1 + PLA + STA BLKBUF2,Y ;restore buf 1 char, put in buf 2 + DEY + BPL :SWPBLK2 ;loop + + LDY #5 +:SWPBLK3 LDA MSGPTR,Y ;swap pointers + PHA + LDA MSGPTR2,Y + STA MSGPTR,Y + PLA + STA MSGPTR2,Y + DEY + BPL :SWPBLK3 + RTS + +*------------------------------- +* create a file +*------------------------------- + +DO_MAKE JSR MOVNAME ;get filename + LDY #txt ;TEXT + LDA #notype + JMP CREATE ;create it + +*------------------------------- +* crunch a message file +*------------------------------- + +DO_CNCH LDX #$FF + STX DIRSEG + STX DIRSEG+1 ;load in first dir block + INX + STX MSGINFO+4 ;reset number of msg's + STX MSGINFO+5 + LDX #128 + LDY #128 + +:CRUNCH2 CPX #128 + BEQ :CRUNCH3 ;at end of block? + + LDA DIRSEG ;more data? + CMP MSGINFO+1 + BEQ :CRUNCH7 ;yep + + LDA DIRBUF+2,X ;is there any entry? + ORA DIRBUF+3,X + BNE :CRUNCH4 ;yep + + INX ;x = x + 4 + INX + INX + INX + BPL :CRUNCH2 ;keep going until 128 done + +:CRUNCH3 INC DIRSEG + LDX #0 + LDA DIRSEG ;are we done? + CMP MSGINFO+1 + BEQ :CRUNCH2 ;yep + + STY SAVE_Y ;save Y + CLC + ADC MSGINFO ;add in bitmap offset + TAX + LDA #0 + JSR POSMSG ;position + + LDX #DIRBUF + LDY #1 + JSR RDBLK + + LDY SAVE_Y ;restore Y + LDX #0 + BEQ :CRUNCH2 ;keep going + +:CRUNCH7 LDX #0 + STX DIRBUF ;use 0 offset + STX DIRBUF+1 + STX DIRBUF+2 ;zero pointers + STX DIRBUF+3 + +:CRUNCH4 CPY #128 + BEQ :CRUNCH6 ;at end of block?, yep + +:CRUNCH5 LDA DIRSEG ;are we at end? + CMP MSGINFO+1 + BEQ :CRUNCH6 ;yep + + INC MSGINFO+4 + BNE :CRUNCH5A ;add one to message count + INC MSGINFO+5 + +:CRUNCH5A LDA DIRBUF,X + STA MSGINFO+6 ;copy byte + STA DIRBUF+128,Y ;and save in new message field + INX + INY + + LDA DIRBUF,X + STA MSGINFO+7 ;copy other byte + STA DIRBUF+128,Y ;and save in new message field + INX + INY + + LDA DIRBUF,X + STA DIRBUF+128,Y ;copy byte + INX + INY + LDA DIRBUF,X + STA DIRBUF+128,Y ;copy byte + INX + INY + + JMP :CRUNCH2 + +:CRUNCH6 LDA DIRSEG+1 ;do we want to write this? + CMP #$FF + BEQ :CRUNCH8 ;nope + + STX SAVE_X ;save x + CLC + ADC MSGINFO ;add in bitmap + TAX + LDA #0 + JSR POSMSG ;position + + LDX #DIRBUF+128 + LDY #1 + JSR WRBLK + + LDX SAVE_X ;restore x + LDY #128 +:CRUNCH8 LDA #0 +:CRUNCH9 STA DIRBUF+127,Y ;fill buffer with 0's + DEY + BNE :CRUNCH9 + + INC DIRSEG+1 ;use next segment + TAY + LDA DIRSEG+1 + CMP MSGINFO+1 + BNE :CRUNCH5 ;are we at end?, nope + + JSR FINISH ;write out 8 byte header + LDA #$FF + STA DIRSEG ;reset dir segment + RTS + +*------------------------------- +* update a file back to disk +*------------------------------- + +DO_UP LDA MSGREF ;use msg refnum + STA REFNUM + JMP FLUSH ;flush file back to disk + +*------------------------------- +* use an external command +*------------------------------- + +DO_USE LDA MSGREF ;get back old refnum + STA REFNUM + BEQ :DO_USE1 ;file is closed + + JSR CLOSE ;close old msgfile + + LDA #0 + STA MSGREF + +:DO_USE1 LDY #0 + JSR SETIVEC ;set to default input/output + JSR SETOVEC + + JSR MOVNAME ;setup filename + JSR OPEN ;open file + BCS :DO_USE2 + + LDX #ENDMOD + LDY #32 ;read 32 - 128 byte pages (4k) + JSR RDBLK + + JSR CLOSE ;finish up + JMP ENDMOD ;exec external routine + +:DO_USE2 LDX #badxtrn ;unable to load external + JMP BADERR + + diff --git a/Source/Acos/DISKIO.S b/Source/Acos/DISKIO.S index 409f12f..036dc73 100644 --- a/Source/Acos/DISKIO.S +++ b/Source/Acos/DISKIO.S @@ -1 +1,349 @@ -Ǎ Ӯ ɯ ōŠ٠ԫ 占ԫؠԫҠɍ ōԫūԫōԫūԫҠɍ ðԍӍΠ٠ΠҬ٠ ΫҠɍ ø΍ŠβΫ 퍠͍ÍӍβ 썠͍ÍӍҠ ƱƲƍŠ͍ūҠɍ ÍōӍȠ͍ūҠɍ čōӍ 䍪Ԡ͍ױ 퍠ΫҠɍ ùױ 占Ӎ 卪ŠҠɍ ΍ŠŲ 򍍠ؠΫ 忍ƭ؍Ġ鍠РŠŲ 捠ÍӍŲƠ 占à捠Ӎ 卪Š͠ 퍠ѠŲԫҠɍ Ԡ 占ŠŲŠ 占à 占ӍŲ ፠ÍӍ 󍪭ˠōРˠ 썍 󍪭ˠŠ 썠ˠؠ˫ ˫˫ 䍠٠˫Ҡ˫ Ҡ˫͍˫ 퍍Ҡɠ Š  ˍӍ ፪ŠŠ ፠͍ѠŲ 퍍ԫҠɍ Ԡ 占ÍѠų 썍Ųà 퍺ų ፠Ӎ 卪Ǡ٠ƍ٠͠ 퍍Ҡ ٬ 占ٍҍҍ؍РӍ 卪Ơ͍˫ 퍠Ҡɍ ıˠ 捠ؠ˫ 荠˫٠˫Ӎ 卪ƠҠˠ 占ҠƠ 占ٍؠ٠˫ŠƲ 忬 占Р˫ŠƲ占ؠ ƲӍ 卪ڠҠƠ 占ؠ˫ ˫Ӎ 卪ĠҠƠ 占РӠ䍍 卪ˠ٠ Ӡؠ˫ ˫٠˫͍˫ 퍍ӲҠɍ ōˠ 덠РčŠӳ 卍Ҡɍ İˠ 捠ѠӲ ӳӍ 򍪭ˠ͍˫ 퍠Ҡɍ ƍˠ 덠ÍŠ˲ 򍍠Íؠ˫ 썠˫˲Ӎ 卪ŠҠɍ ñ̠ 占Ӎ Π ōƱ Š  Ԡ  ōŠ ˠ  Ӡױ   鍠 Π  ƍˠ  ̠ ōԠ ōؠų   \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - ProDOS disk I/O * +* * +******************************** + DATE +*------------------------------- + +CREATE STY P_CREAT+4 ;save filetype + STA P_CREAT+6 + STX P_CREAT+5 + JSR MLI + DB $82 + DA 0 + LDA MLIDATE + STA P_CREAT+8 + LDA MLIDATE+1 + STA P_CREAT+9 + LDA MLITIME + STA P_CREAT+10 + LDA MLITIME+1 + STA P_CREAT+11 + JSR MLI + DB $C0 + DA P_CREAT + RTS + +OPEN LDY #0 +BFOPEN LDA BUFADR,Y ;point at buffer + STA P_OPEN+4 + + JSR MLI + DB $C8 + DA P_OPEN + BNE :OPEN2 + + LDA P_OPEN+5 ;save refnum + STA REFNUM + CLC + RTS + +:OPEN2 LDA #-1 ;make sure refnum is illegal + STA REFNUM + SEC + RTS + +BUFADR DB >FBUF1,>FBUF2,>MSGBUF + +CLOSE LDA REFNUM + STA P_CLOSE+1 + JSR MLI + DB $CC + DA P_CLOSE + RTS + +FLUSH LDA REFNUM + STA P_CLOSE+1 + JSR MLI + DB $CD + DA P_CLOSE + RTS + +*------------------------------- +* setup for single line read +*------------------------------- + +RDLNSET LDA REFNUM + STA P_NEW1+1 ;save refnum + STA P_RDLN+1 + JSR MLI + DB $C9 + DA P_NEW1 ;enable newline + RTS + +*------------------------------- +* read a line from a file +*------------------------------- + +RDLINE JSR MLI + DB $CA + DA P_RDLN + BNE :RDLINE2 ;read error + + LDX P_RDLN+6 ;is there a cr at end of line? + LDA LNBUF-1,X + AND #clrhi + CMP #cr + BNE :RDLINE2 ;no more stuff + CLC + RTS + +:RDLINE2 LDA #0 + STA LNBUF ;no data in line + SEC ;eof + RTS + +*------------------------------- +* read a single byte +*------------------------------- + +RDBYTE LDA REFNUM ;save refnum + BEQ :RDBYTE2 + + STA P_RBYT+1 + JSR MLI + DB $CA + DA P_RBYT ;read 1 byte + BNE :RDBYTE2 + + LDA P_BYTE ;get byte + CLC ;were done + RTS + +:RDBYTE2 LDA #0 ;fake data + SEC + RTS + +*------------------------------- +* write a block for the msg routines +*------------------------------- + +WRBLK PHA + LDA #$CB + STA RWTYPE + PLA + JMP RWBLK ;use write call + +*------------------------------- +* read a block for the msg routines +*------------------------------- + +RDBLK PHA + LDA #$CA + STA RWTYPE ;use read call + PLA + +RWBLK STX P_RDBLK+2 ;save read address + STA P_RDBLK+3 + + LDA #0 + STA P_RDBLK+4 ;save number of blocks to read + STY P_RDBLK+5 + + LSR P_RDBLK+5 ;divide by 2 + ROR P_RDBLK+4 + + LDA REFNUM + STA P_RDBLK+1 ;get refnum + + JSR MLI ;call mli +RWTYPE DB $CA ;*** modified *** + DA P_RDBLK + RTS + +*------------------------------- +* write a byte of data +*------------------------------- + +WRBYTE STA P_BYTE ;save data + PHA + LDA REFNUM + BEQ :WRBYTE2 ;if no refnum + + STA P_RBYT+1 + JSR MLI + DB $CB + DA P_RBYT ;write byte + CLC + BEQ :WRBYTE3 ;all is well + +:WRBYTE2 SEC ;opps, problem +:WRBYTE3 PLA ;get back data + RTS + +*------------------------------- +* position file +*------------------------------- + +POSMSG LDY MSGREF + STY REFNUM ;save refnum + + LSR ;setup Y,A,X w/exact byte + TAY + TXA + ROR + PHA + LDA #$10 + ROR + TAX + PLA + JMP SETPOS + +*------------------------------- +* find the end of file +*------------------------------- + +GETEOF LDA REFNUM + STA P_MARK+1 ;save refnum + JSR MLI + DB $D1 + DA P_MARK ;get eof + LDX P_MARK+2 ;get length + LDA P_MARK+3 + LDY P_MARK+4 + RTS + +*------------------------------- +* check for end of file +*------------------------------- + +CHKEOF JSR GETMARK ;get the current place + PHA + TXA + PHA + JSR GETEOF ;get the end of file + PLA + TAY + + PLA + LDX #0 + CPY P_MARK+2 + BNE :CHKEOF2 ;are they the same?, nope + CMP P_MARK+3 + BNE :CHKEOF2 ;nope + INX ;yep, mark it +:CHKEOF2 RTS + +*------------------------------- +* check end of file +*------------------------------- + +GETSIZ JSR GETEOF ;get the end of file + LDX P_MARK+3 ;get # of sectors + LDA P_MARK+4 + RTS + +*------------------------------- +* append data to file +*------------------------------- + +APPEND JSR GETEOF ;get end of file + JMP SETPOS ;append + +*------------------------------- +* set a mark into a file +*------------------------------- + +SETMARK LDY #0 ;do actual position set within file +SETPOS STX P_MARK+2 ;point to new location + STA P_MARK+3 + STY P_MARK+4 + + LDA REFNUM + STA P_MARK+1 ;save refnum + +SETPOS2 JSR MLI + DB $CE + DA P_MARK ;set mark + CMP #$4D + BNE :SETPOS3 ;check for out-of-range + + JSR MLI + DB $D0 + DA P_MARK ;set eof + BEQ SETPOS2 ;position again + +:SETPOS3 RTS + +*------------------------------- +* get current file marker +*------------------------------- + +GETMARK LDA REFNUM + STA P_MARK+1 ;save refnum + JSR MLI + DB $CF + DA P_MARK ;get mark + SEC + BNE :GETMRK2 ;opps, error + + CLC + LDX P_MARK+2 ;all is well + LDA P_MARK+3 +:GETMRK2 RTS + +*------------------------------- +* delete file +*------------------------------- + +DELFILE JSR MLI + DB $C1 + DA P_DEL ;delete file + RTS + +*------------------------------- +* ------ parms ------ +*------------------------------- + +P_OPEN DB 3 + DA FLNAME + DA FBUF1 + DB 0 + +P_CLOSE DB 1 + DB 0 + +P_RBYT DB 4 + DB 0 + DA P_BYTE + DA 1 + DA 0 + +P_BYTE DB 0 + +P_MARK DB 2 + DB 0 + DS 3 + +P_NEW1 DB 3 + DB 0 + DB clrhi + DB cr + +P_RDLN DB 4 + DB 0 + DA LNBUF + DA 255 + DA 0 + +P_RDBLK DB 4 + DB 0 + DA 0 + DA 128 + DA 0 + +P_DEL DB 1 + DA FLNAME + +P_CREAT DB 7 + DA FLNAME + HEX E3 + DB 0 + DA 0 + DB 1 + DA 0 + DA 0 + + diff --git a/Source/Acos/DRIVE.S b/Source/Acos/DRIVE.S index fb7093b..1e7c367 100644 --- a/Source/Acos/DRIVE.S +++ b/Source/Acos/DRIVE.S @@ -1 +1,189 @@ -Ǎ Ӯ ō 䍪ŠҠҲ Ͱ΍Ѡʹ٠٠Ġ 獠٠ư٠Ʊé٠ 占Ҡ֍͠ ㍠Р̧ŠͲ􍍠ҠƍӠͲ 썍ٍé٠ 忍РѠͳ 卍Ҡ͠ 忍ӠͲ卍ư ٍé٠ 忍РѠͳ 卍Ҡ͠ 忍ӠͲ卍Ʊ ٍé٠ 򿍠РѠͳ 卍Ͳ٠Ơ 占٠Ġ 獍ͳٍؠ٠΍Ѡ͵ Ῥ 퍍ʹé٠ 占Ҡ֠ РԠ͵ ݍūؠ 占؍ٍ٠΍Ѡ͵ ؠŠʹ 卍͵ؠŠ 荠Ġ ̠֠Ӎ ؍à٠ ٠ư٠Ʊ͠ ݍѠ֠ 􍍠Ҡø ؠư РѠ֠ ưؠƱ ֠͠ Ѝ͍Ы͠ ĠƍƍְàƍѠֱ 󍍠٠Щ٠ 卍ÍàЍР àЫЫРְ 򍍺ֱ٠Щ٠ 獠Ѡͷ 卍ٍؠ 荍ֲЩٍƬ٠ 捠ֲٍ̠ư Ѡִ卍ؠ荠Ƭؠ卍ƱѠִ卍ؠ 荠Ƭؠ 􍍺ִ؍Ƭؠ 獠ؠƠ 荍Ҡɠ  ÷؍ؠƠ 忍РƫŠֶ ֵƬؠ 忍Рƫ؍Šֶ ؍ֵ̠Ӡ ֶҠɠ  ö؍Šͷ Ӎͷؠ堻 РҍĠ ͠ ư Ʊ ŠӠؠ ƫؠ ƍ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - ProDOS Drive * +* * +******************************** + DATE +*------------------------------- +* move the name into the filename field +*------------------------------- + +MOVNAME JSR INSTR2 ;get name (dont use memory) +MOVNM0 LDA STRLEN + BEQ :MOVNAM4 + + LDY #0 + STY DRVCHD ;init change drive string + STY DRVOFF0 + STY DRVOFF1 + + LDA (STRLOC),Y ;get first byte + JSR CONV + STA DRVNUM ;save it as a drive spec + CMP #'L'+1 + BGE :MOVNAM2 not + + JSR TST_ALF + BCS :MOVNAM2 ;opps, not legal + + INY + LDA (STRLOC),Y ;are we done? + CMP #':' + BEQ :MOVNAM3 ;yep, get filename + + JSR TST_NUM ;is it a legal sub-drive? + BCS :MOVNAM2 ;nope + + STA DRVOFF0 ;save sub-drive byte 1 + INY + LDA (STRLOC),Y ;are we done? + CMP #':' + BEQ :MOVNAM3 ;yep, get filename + + JSR TST_NUM ;is it a legal sub-drive? + BCS :MOVNAM2 ;nope + + STA DRVOFF1 ;save sub-drive byte 2 + INY + LDA (STRLOC),Y ;is there a terminator? + CMP #':' + BEQ :MOVNAM3 ;yep, get filename + +:MOVNAM2 LDY #$FF ;no drive parm, just get name + STY DRVCHD ;init change drive flag + +:MOVNAM3 INY + LDX #0 + CPY STRLEN + BEQ :MOVNAM5 ;is there any data?, hmmm + +:MOVNAM4 LDA (STRLOC),Y ;copy filename + JSR CONV ;convert to upper + CMP #'.' + BLT :MOVNAM5 ;we are done [anything less, illegal] + + STA FLNAME+1,X ;save name + INX + INY + CPY STRLEN + BEQ :MOVNAM5 ;done yet? + + CPX #15 + BNE :MOVNAM4 ;have we done 15 chars (the max), nope + +:MOVNAM5 STX FLNAME ;save length + LDA DRVCHD ;change drive first? + BPL SETDRV ;yep + RTS + +*------------------------------- +* log to drive A, offset X +*------------------------------- + +LOGSPEC LDY #0 ;reset offsets + STY DRVOFF0 + STY DRVOFF1 + + STA DRVNUM ;save drive number [A-L] + TXA + BEQ SETDRV ;no offset + + JSR BINDEC8 ;translate to two-byte number + STX DRVOFF0 ;save offset + CMP #'0' + BEQ SETDRV ;1 byte offset?, yep + STA DRVOFF0 + STX DRVOFF1 ;save offset + +SETDRV LDA #DEVNAM + STA TEMP+1 + + LDA DRVNUM ;turn drive num into offset + AND #$F + STA LNBUF + +:SETDRV0 DEC LNBUF + BEQ :SETDRV1 ;count down drives + + LDY #0 + LDA (TEMP),Y ;get length of pathname + + SEC + ADC TEMP + STA TEMP ;point to next entry + LDA #0 + ADC TEMP+1 + STA TEMP+1 + JMP :SETDRV0 ;set drive number + +:SETDRV1 LDY #0 + LDA (TEMP),Y ;get length of string + BEQ :MOVNAM7 ;pathname not in use + + TAY + TAX ;save length + +:SETDRV2 LDA (TEMP),Y + STA LNBUF,Y ;move pathname to lnbuf + DEY + BPL :SETDRV2 + + LDA DRVOFF0 ;was there an offset? + BEQ :SETDRV4 nope + + INX increase length + STA LNBUF,X save + + LDA DRVOFF1 was + BEQ :SETDRV4 ;nope + + INX ;increase length + STA LNBUF,X ;save offset + +:SETDRV4 INX + LDA #'/' + STA LNBUF,X ;add '/' to end of string + STX LNBUF ;update length + + JSR MLI ;get current prefix + DB $C7 + DA GETPFX + + LDX LNBUF ;are the length's the same? + CMP LNBUF+64 + BNE :SETDRV6 ;nope, change to new prefix + +:SETDRV5 LDA LNBUF,X ;is data the same? + CMP LNBUF+64,X + BNE :SETDRV6 ;nope, change to new prefix + + DEX + BPL :SETDRV5 + RTS ;they are the same, just return + +:SETDRV6 JSR MLI ;set to the new prefix + DB $C6 + DA SETPFX + BNE :MOVNAM7 ;opps, error + RTS + +:MOVNAM7 LDX #baddrive ;bad drive specifier + JMP BADERR + +DRVCHD DB 0 +DRVNUM DB 0 +DRVOFF0 DB 0 +DRVOFF1 DB 0 + +FLNAME DS 16 + +GETPFX DB 1 + DA LNBUF+64 + +SETPFX DB 1 + DA LNBUF + + diff --git a/Source/Acos/DRIVERS.S b/Source/Acos/DRIVERS.S index db44b7a..3b3475a 100644 --- a/Source/Acos/DRIVERS.S +++ b/Source/Acos/DRIVERS.S @@ -1 +1,65 @@ - ōԠРӠРԠР̠РΠРԠРԠР٠РΠРĠРĠР٠РӠРԠРӠԍ ҍԠ ԠРԠРҠРӠ܍ ˍԠ Š ŠРŠРŠРӠ܍ ͍Ԡ  Ԡ ԠӠԠРԠРǠРӠРǠРΠРԠРĠРĠРԠРҠРƠРԠРӠԍ \ No newline at end of file +*------------------------------- +* CONSOLE +*------------------------------- + +VIDINIT JMP 0 +VIDCLS JMP 0 +VIDCOUT JMP 0 +VIDSCRL JMP 0 +VIDBAN JMP 0 +VIDLST JMP 0 +VIDRDST JMP 0 +VIDRDKY JMP 0 +VIDRDFN JMP 0 +VIDWND JMP 0 +VIDRD JMP 0 +VIDKEY JMP 0 +VIDPOS JMP 0 +VIDCHAT JMP 0 + DS $300-*+VIDINIT + +*------------------------------- +* PRINTER +*------------------------------- + +PRSLOT DB 0 +PRINIT JMP 0 +PRCOUT JMP 0 +PRCLEAR JMP 0 + DS \ + +*------------------------------- +* CLOCK +*------------------------------- + +CLKSLOT DB 0 +CLKMODE DB 0 +GETDATE JMP 0 +GETTIME JMP 0 +SETDATE JMP 0 + DS \ + +*------------------------------- +* MODEM +*------------------------------- + +MDMSLOT DB 0 +MDMEXTRA DB 0 +SPCINIT DB 0 +BYTCNT DS 3 +MDMINIT JMP 0 +MDMRSET JMP 0 +MDMRING JMP 0 +MDMANS JMP 0 +MDMHANG JMP 0 +MDMIN JMP 0 +MDMOUT JMP 0 +MDMDCD JMP 0 +MDMSPD JMP 0 +MDMINT JMP 0 +MDMDTR JMP 0 +MDMCBUF JMP 0 +MDMQUIT JMP 0 + DS $400-*+MDMSLOT + + diff --git a/Source/Acos/EDIT.S b/Source/Acos/EDIT.S index 9709ee9..3ef36b7 100644 --- a/Source/Acos/EDIT.S +++ b/Source/Acos/EDIT.S @@ -1 +1,1817 @@ -Ǎ򠠠ō򍪭ԠҠǠ獠ؠŠҍ̍؍Ь؍ЍЫ؍ЫРЩ􍍺ҠР؍Рҍ؍ÍȍōÍ򍪭ؠ؍ؠˠ덠à렳؍ӍԠ󍠠Ԡ󍠠Ơ󍠠ԠŠ堧姠占̍Ԡ퍠ҍԍҫҠĠ󍠠Ơ򍠠ѠҠ卍РĠ卍򍪭ҠƠ򍠠Š򍠠ūҍƍҫӍ򍪭àҠčÍҍàƠ蠽䠭􍠠؍ҫàƍРȍŠ򍪭àؠƠ͠፠ƍРȍȠԠƠ䍠ɠȱΠ荠РȱҠՠҠ͠荠ѠȲ퍍ؠΠȲӍ卪ŠԠƍɠű􍍠ӍРፍűҠՠ占Ӡ占Ҡ͠占ؠѠȲ̠ӠؠѠȲ􍍠̠Ӡ占ӍҠҠƠΠǍРΰؠҠҫҠ΍ؠҠҫŠαٍҩٍàα卍ōРĠ䠧姍αàōŠβàūβÍҫ򠳮덠àčŠΠР῍Šΰؠ덠ҠǍĠƠҍƍҫؠ獠ҠǍҠIJРčIJҠčҠȍ ؍àЍàԍàçԍàħ̍àŧčàȧвàɧӍà̧ԍàΧ׍àϧˍàӧˍàڧč Ԡà̠ij卍ҠȠàҧčàקԍ ijؠ䍠РǍРؠ捠РǍвŠ占Íōë΍ҠͰ占ҠΠ썠ӠеҠĠ덺гҠŠ፠ӠдፍҠԠ፠ԠԠ̠г卍àԠдàƍРŠ卍еؠРǍŠàԠؠҠǍҠčР٧ŠӍҠҠؠαҠǍРؠԠؠ占Íҫ忍àčѠαҠԠ宮РΠ捍ӠӍ̠ؠ忍ҠǍҠ΍ҠԠӠ̠䍍̠ҠǠѠӍӠҍؠǠǫҠΠ卺̲ҠΠ荠ٍ٠ҍؠЍЫҠԠ卍ŠŠ̳àū̳àōҠǍà̲ԲӍҠРҠ卍űԠԍ̠Բ堧姠٠٠Ԡ䍍àōРҲĠؠҠǍҠ΍ҠԠӠĠ䍍ĠҠǠѠűѠӲӠҠ퍍ҠƍؠǠǫҠΠҠΠ荠в荠؍Ѡij٠IJЩٍƬ٠捠ٍ؍ŠIJijРЫƠ捠ЍƍЫҠΠҠŠ占ԠӠ占àĸҠηРķ􍍺ĸҠƠҠΠ٠٠в嬠卍ķàР捠Ҡ̲占àР卍ггӠԠ䠧姍ķÍàв荠Ѡĵ衍àĴٍҠذ퍠РĵĴҠ占ٍٍҠذ􍍺ĵ٠ؠв荠؍ĶƬٍг٠덠ٍ؍ŠĶРƠ栨婍ԠӍҠؠҠǍРƠ栨婍ӠؠҠǍҠ΍ҠԠӠӍӠҠǍѠԍӠҍؠҠǍӰؠƠ占ƍҠΠ捠ӠӲ٠в荠٠䠱ҍ٠ٍؠǍǫҠΠ占٠ٍҠԠ􍍠٠ӱƬٍг٠占ٍàٍŠӱؠؠѠα 𿬠卍αƬ٠፠ٍƬؠ덠؍ؠŠα忬卍α àǍŠαààǫαààōŠӰàūŠӰӲԠԠ俍̠Ԡ嬠РԠ卍ҰРҠ卍ԠؠҠǍҠ΍Ԡ٠٠Π堣ҩٍҠ֍Р٧ŠԱ󿬠卍ΠàҍŠԱàҫԱҠǍӠҰҠƍΠؠǠǫҠΠ􍍺ԲԠΠ󿍠̠Գ卍ҠΠԳҠΠ荠вҠŠ卍à占вàЍР𠽠𠫠𲠫àЫЫҠƠҠǍàԲӍנؠҠǍҠčР٧ŠײҠҠؠҠǠԠРΠ卍ײӍĠҠԍҠÍؠҠԍؠ䍠РǍԠԍҠԍѠײ󍍠ҠԍײӍ卍נҠΠ፠Ơ獠ÍƍëΠ荠РͰ卍ĠؠҠǍҠ׍ҠΠӠĴƠ占ҍƍҫIJҠŠ占ЍҠԍЍàIJijҠŠРĠĴؠРǍԠؠҠǍҠנ덠ҠŠ占٠ؠҠŠ占Ҡ΍Ӡij򍍠Ҡ卍ҲҠР፠РѠij䍍ҠŠ占àҲ썠ؠ占ҠǠ占РijˠٍЩٍˠԠà忍̠԰Рؠ􍍺԰Ҡ忍Ѡˠ嬠ا󍍠ƠЍƍЫРԷ卍ԱҬؠ؍̠򿍠àԱ卍٠卺ԳҬؠѠԵ卍вЩ٠Ҡ֠Ҡв򠭠̠ŠԱ謠獍ؠٍàԳ獍ԴٍЩٍ٠ŠԴԵàЍŠԷ占àЫԷؠ٠Щ٠占Ѡˠ䍍РŠԳᬠԠԵ卍ˠƠ䍠ЍƠ獠Ы٠٠󠰠˱Щ٠٠󠱍Ѡؠ፠Р俍Š˲ﬠ卍٠䍠ЩٍҠ֍РاؿŠ˲ﬠ卍٠ЩٍР忍Š˲ﬠ卍堧ؠ쩍Щ٠蠧تש̍˲٠٠˳àР占Š˴àЫ˴ЩٍѠؠРŠ˳忬占٠٠Š˱ؠؠˍӍӍ󠭭Π٠荠٠вؠР፠ЫԠԠ̠̱卍Ҡԍ̱𿍠Ѡ̲卍٠в荠ҠŠ荠Рı̲٠ıҠ٠ҠIJРıIJҠȍ ؠ Ҡݍ ⍠ΰݍ α嬠ݍ 썠αݍ δ쬠ݍ αݍ 􍍠ԠӠ占àIJȠҠȍ β嬠ݍ 덠γ嬠ݍ ㍠εݍ ㍠ζݍ 썠η嬠ݍ 썠θ嬠ݍ 䍠ι䬠ݍ 䍠α䬠ݍ IJȠРԠIJà쿬󍍠٠΍ѠijЩ٠ҠԠ٠вŠIJ 忬卍àвIJ ٠IJàӍIJڠٍٍIJؠ썠РԍijԠР̠IJؠ卍РѠҠ뿬󍍠Щ٠ٍ؍ijٍѠIJڠ塍Щ٠占РŠij嬠獍٠в荠٠ij ٠ؠҠӠؠвŠij 忬獍٠ፍҠ٠в荠Щ٠䍠ҠԠ􍍠٠ЩٍōРѠҰ俬РŠҲ俬ҰōԠԠ俍ɠҲ占àԠ䍍ÍЍҠàҍЫҫàҫ٠ЩٍٍЩ٠䍠ҠұҠĠ򍍠٠٠Ԡ占٠в䍍Ҡ፠ЍҫЫӍұҠ֠Ҡȍàԍàħ̍àŧčàȧЍàɧӍà̧ԍàΧ׍àϧˍàӧˍàЧԍàڧč ٠٠Ԡ䍠ōЩ٠Ҳ占ԠŠᠧ姿ɠҵ􍍠вРŠҴ卍ؠŧҠҍӠҵ󍍺Ҵà占в󠽠蠫ҩàЍ؍àЫà㠽썠ӍҵؠРЫӠ㠽卍⍪ΰ٠΍Ѡΰ忬卍占ҠIJĠᠱ㿍Šΰ卺ΰӍ䠱卪βà٠вѠβ忬󍍠Щ٠ҠԠ٠àβӍ卪γؠ젰γ٠вѠγ 嬠󍍠ҠԍؠٍŠγ䍍γ ؠѠγà忬󍍠ҠԠàв٠؍Šγ 卍γàӍ卪δҠγ占в썠ѠδδҠӠ٠àвŠδ荍δ Ӎ報򍪭ε٠вѠεĠ忍٠ٍàвؠε٠вѠε 卍ٍЩ٠덠ٍЩٍٍ؍ҠԠРεε Ҡԍ٠ٍεàҠԍ؍ŠεÍεĠӍ򍪭ζ٠вѠζà忍в迍Р΍Ѡζà󍍠٠ٍؠζҠԍؠ􍍠Щٍв占Щ٠вٍ٠вԠζѠζ忍àв䠱٠ٍζ ҠԠ؍ŠζζàӠ卍卪η٠Ѡη 翬󍍺ηҠԠٍŠηη Ӎ卪Š٠썍卪θ٠вѠη 忬󍍠ЩٍҠԠ䩍٠獠Рθ䍪ι٠Ѡι翬󍍠ҠԠٍЩ٠렱俍РŠιιӍ䍪α٠вѠα俬󍍠Щ٠䍠ҠԍٍЩٍРŠα俬αӍ􍪭αвῬѠαҠηҠҠӠα 퍍ввв荠ҠŠ占ввРвŠα򿬠Ҡγ卍αввα Ӎ𠱠򍪭α٠Ѡα 忬󍍠ԠӠ占ɠαàα卍ٍРԠ󍍪򍪭α٠Ѡα 翍٠ҠԍРεαٍàвРӍˠ Ԡ Π Р Ǡ  Ӡ Π Ԡ Š Š ԠɠŧݍȠؠ٠ٍг᭱г٠ȲгٍѠȴР؍Ѡȳ٠ٍٍŠȲȳٍгٍ؍ٍгٍРȵ􍍺ȴ٠Íàг؍àгȵؠгг٠ٍ؍Рг򍍪􍪭Ҡؠ󍍠٠Ҳٍ٠вѠҸЩ٠РѠҲҳЩٍƫؠ占؍ٍРѠҴؠв荺Ҵ٠вŠҳ忬ÍΠ䍠àвҠҸЍ٠占ЍÍѠҷ؍Íàв荠вҵЩ٠ٍ؍ŠҵҶƫ؍Щ٠덠؍ٍ٠вŠҶ忬ÍҷӍ卪РؠРǍ䍪ĠŠ占ҠΠŠ덠ƍԠƠ󿍠̠ҷРؠ򍍪򍪭Πؠвв٠Ơ٠ЍƍЫβвŠβ𲠽𲠭àв荺βàввв忍Šγ٠ЍؠР占ЫӍγЩ٠占ٍŠδàЫδРŠγѠβ忮卪Π٠βٍЩ٠占РŠβҳà荠Ӎ獪Ҡ٠堰ҲЩٍٍҠ֠ҠԬؠ؍̠Šҳ荠àҲ獠Ӎ􍪭ǠŠ῍ūѠҠҠԍҠгҫгҠΠؠǠ占ǫРǠҠÍӍ󍪭ǠǍǫҠԍŠ堣ǍūǫǠ፠ѠҠ퍍Ҡ፠гҫг٠г٠忍РѠǷРѠDzРѠDzҠΠؠǍؠǍǫǫҠǍӠǶ卍٠г٠忍РѠDzРŠǵDzàгŠǴàгǴŠ占Ǎūǫ٠гٍРѠǵ󍍠Ҡ΍ؠǠǫҠǍӠǶǫ占РǫԠǵ덍Ǡ占РǍŠǵ栽덍ÍӠǶ砾獍ǵÍǶӍǷÍӍ卪Ǡؠؠ፠ٍؠ򿍠ѠDzﬠ󠰍ū荠РٍԠDz卍ؠŠؠ؍ԠDz卍à썠獠ӍDzà占Ӎ姠卪ԠԠԠ俍̠Dz٠ҩ٠占Ҡ֍Р̧ŠDz謠ؠōؠǍؠǍūǫǫРǠ썍Ӎ卪ǠǠ忍РǍŠǫ忍РǫŠà占ӍàǍŠàǫàӍ󍪭ԠŠ占ǍūǫǍѠፍÍǍàǠؠ؍ǫàǫҠǠ뿍àԲ󍍠ؠؠǠ報؍ؠǫԲРΠ󮮮٠􍪭Ԡؠггذ٠٠堣썍ггز٠ٍг٠٠г٠򍍠àгŠسàгسРŠز򍍠ггشӍ٠􍪭Ԡؠггذ٠٠堣􍍠٠г٠гٍزг٠῍Ѡس󍍠àгŠز፠àгŠزس٠г٠占٠ٍĠ鍠г٠ɠشгŠشàг덺شàгРس򍪭ĠƠҫ٠ƍ٠ҍ٠ō٠ū򍍺βҩ٠忍Ѡδ󍍠РŠγ忬àōŠγàūγٍŠβàҫŠβ荍δ٠ҍӍ卪ӠԠӠ󿍠ɠӠ󍍠ҠԠҠԍԠӠРԠƠԠԍ̠ԲƠŠӍ򍪭ΠؠǠǫҠԍҠԍРƠ􍪭ԠƠҠ֠Р̧ÍŠԲؠҠǍҠΠ􍍠Π󍍠ҠԱàԲӍ卪Ԡؠ占ҠǍΠҠԠРĠ󍍪󠭭γƍҠƍҫàҠ獍򍪭РԠҠ̠γ󍍠٠٠ٍ٠ҩٍѠβ捍àҍŠβ占àҫβ٠٠ٍӍ򍪭Ԡ٠٠ٍ٠Ҡ俍٠čŠԲ٠ҫ俍٠čѠԳ󍍺Բ٠ҩ٠占ٍҩٍàҍŠԳ占àҫԳ٠٠Ӎ֠͠вčԠؠİč֠ é ֲčӠ܍ \ No newline at end of file + PAG +******************************** +* * +* MultiPro - Editor * +* * +******************************** + DATE +*------------------------------- +* system editor +*------------------------------- + +DO_EDIT JSR INPNARG ;get arg + CPX #6 + BGE :ED_ERR + + TXA + ASL + TAX + LDA EDJMP,X + STA TEMP + LDA EDJMP+1,X + STA TEMP+1 + JMP (TEMP) ;do it + +:ED_ERR JMP SYNTAX + +EDJMP DA ED_CLR + DA ED_STX + DA ED_SPC + DA ED_WIDTH + DA ED_MODE + DA ED_LOC + +*------------------------------- +* entering the editor +*------------------------------- + +ED_STX TSX + STX EDSTACK ;save stack + TXA + SBC #32 ;move stack 32 levels down + TAX + TXS + + LDA #0 + STA PROMPT ;turn off prompts + STA EXE_DOT ;enable dot commands + STA INTBUF ;don't allow int's + STA INTOUT ;make sure output is on + STA DOT_E ;make sure '.e' is not active + STA ERVAL + + LDA #COUT + STA VECTOR+1 + + JSR FINDEND ;setup end pointers + LDA EDBUF ;check contents of buffer + BEQ ED_LNCR ;nothing there + + JMP ED_CMD ;handle command line + +*------------------------------- +* clear the editor +*------------------------------- + +ED_CLR LDA #0 + STA EDBUF ;reset data pointer + STA EDLINE ;zero line counter + STA EDLINE+1 + STA EDPTR + LDA #>EDBUF + STA EDPTR+1 + RTS + +*------------------------------- +* return bytes in editor +*------------------------------- + +ED_SPC JSR FINDEND + SEC + LDA EDPTR + SBC #EDBUF + JMP DO_MATH + +*------------------------------- +* get location of USE buffer +*------------------------------- + +ED_LOC LDX #EDBUF + JMP DO_MATH + +ED_WIDTH BIT IMMDEF ;get cmd + BMI :WIDTH1 ;yep + + LDA VIDLEN ;return current width + JMP SVDATA + +:WIDTH1 JSR GOBEQU ;gobble equ + JSR INPNUM ;get video width + TXA + BEQ WIDTH2 ;opps, problem + + STX VIDLEN ;save it +WIDTH2 RTS + +*------------------------------- +* read or set backspace mode +*------------------------------- + +ED_MODE BIT IMMDEF + BMI :MODE1 setting it + + LDA NONBS + JMP SVDATA return data + +:MODE1 JSR GOBEQU gobble + LDA #$40 + STA NONBS non-destruct bs mode + JSR INPNUM get mode + CPX #1 + BEQ WIDTH2 we were correct, return + + ASL NONBS set to destruct bs + CPX #2 + BEQ WIDTH2 do it + + ASL NONBS unknown mode + RTS + +ED_LNCR JSR PRCRLF add a line feed +ED_LN LDA WWFLAG + STA WWRAP get word-wrap status +:ED_LN0 LDX EDPTR get a line of text + LDA EDPTR+1 + JSR GETEDLN + + STX EDPTR save new end address + STA EDPTR+1 + LDA WWEXTRA + BNE :ED_LN1 + + LDA #0 add in end of editor + TAY + STA (EDPTR),Y + BCC :ED_LN1 they did not type done + + LDA #0 + STA DOT_E + JMP ED_CMD if they typed 'done' + + +:ED_LN1 INC EDLINE + BNE :ED_LN2 add line to editor + INC EDLINE+1 + +:ED_LN2 SEC + LDA EDPTR+1 check for 3.75k + SBC #>EBUFEND + BNE ED_LN there is plenty + + LDA #0 + STA WWRAP turn off word-wrap + LDA WWEXTRA is there word-wrap data? + BNE :ED_LN0 yep + LDX #thats4k + JSR PREDMSG + +ED_CMD LDA #LNBUF + STA ARGPTR+1 + + LDX #editing + JSR PREDMSG + JSR ED_CMD2 + JMP ED_CMD + +ED_CMD2 JSR GETCMD + JSR MATCH + DB -1 + DA ED_EX + ASC '?' + DA ED_HLP + ASC 'A' + DA ED_ABT + ASC 'C' + DA ED_CONT + ASC 'D' + DA ED_DEL + ASC 'E' + DA ED_ED + ASC 'H' + DA ED_HLP2 + ASC 'I' + DA ED_INS + ASC 'L' + DA ED_LST + ASC 'N' + DA ED_NEW + ASC 'O' + DA ED_OK + ASC 'S' + DA ED_OK + ASC 'Z' + DA ED_USED + DB 0 + + BIT EXEC check for sysop + BPL :ED_CMD3 nope + + JSR MATCH check the rest + ASC 'R' + DA ED_RD + ASC 'W' + DA ED_WRT + DB 0 + +:ED_CMD3 LDX #badcmd + JMP PREDMSG + +ED_HLP LDX #edithelp show the help stuff + JMP PREDMSG + +ED_HLP2 LDA #HLPFILE + STA STRLOC+1 + LDA #11 + STA STRLEN + JSR MOVNM0 move name + JSR IFOPEN open into a unused channel + BCS :ED_HLP5 + + JSR DO_SED make spacebar work +:ED_HLP3 JSR RDBYTE get data + BCS :ED_HLP4 end of data + + JSR COUT show data + BIT INTOUT did they interupt? + BPL :ED_HLP3 nope + + INC INTOUT re-enable output +:ED_HLP4 INC INTBUF + JMP CLOSE close file + +:ED_HLP5 LDX #nofile system error + JMP PRMSG + +HLPFILE ASC 'b:hlp.edit' + +ED_ABT LDX #abort? + JSR PREDMSG + JSR GETCMD + CMP #'Y' + BNE ED_RTS + + JSR ED_CLR clear editor + LDX #aborted +ED_CON1 JSR PREDMSG + JMP ED_EX return + +ED_CONT LDX #aborted thats 4k message + SEC + LDA EDPTR+1 enough space? + SBC #>EBUFEND + BEQ ED_CON1 yep + + JSR CONT continue... + PLA + PLA + JMP ED_LN get more stuff + +ED_RTS RTS + +ED_DEL LDX #delete? + JSR PREDMSG + JSR INPLN + JSR CHKLIST do list? + BCS ED_DEL yes we did + +DOT_DEL JSR XYARG get arg's + BEQ ED_RTS + BCS ED_ERR + + LDX X_ARG get line number + LDA X_ARG+1 + JSR FINDLN find the line +:ED_DEL2 JSR FNDLEN get the length + TAY + INY kill CR + LDX TEMP + LDA TEMP+1 + JSR DEL_TXT delete the line + + LDA EDLINE decrease line count + BNE :ED_DEL3 + DEC EDLINE+1 + +:ED_DEL3 DEC EDLINE + JSR INCXARG + BCC :ED_DEL2 loop until done +CR_RET2 RTS + +ED_ERR JMP CR_ERR link to error routine + +DOT_E1 BIT EXE_DOT + BPL CR_RET2 + + PLA handle the '.e' option + PLA + LDY #0 + STY EXE_DOT no dot command + + DEC DOT_E + JMP EDLNCR2 + +ED_ED LDX #edit? + JSR PREDMSG + JSR INPLN + JSR CHKLIST do a list? + BCS ED_ED we did + +DOT_ED JSR XARG get line number + BEQ DOT_E1 just a return (was BEQ CR_RTS2) + BCS ED_ERR opps, a problem + + JSR PRCRLF + LDX X_ARG get line number + LDA X_ARG+1 + JSR FINDLN get address + JSR FNDLEN get length + STA TEMP2 + PHA save orig length + TAX + BEQ :ED_ED3 + + LDY #0 +:ED_ED2 LDA (TEMP),Y + STA LNBUF,Y move data to lnbuf + INY + DEX + BNE :ED_ED2 + +:ED_ED3 LDA TEMP save address + PHA + LDA TEMP+1 + PHA + + LDA #LNBUF + STA TEMP+1 + JSR SHOWLN show line number + JSR LSTLINE print line + BIT NONBS check bs mode + BVC :ED_ED8 print line again + + JSR EDLN7 back up + JMP :ED_ED7 do edit + +:ED_ED8 JSR PRCRLF add a return + JSR SHOWLN show the line number + LDY #0 + STY TEMP2 kill line, reset line + +:ED_ED7 INC WWRAP toggle word wrap off + JSR GETEDL2 edit line + DEC WWRAP put word wrap to old state + + PLA + STA TEMP3+1 save old line address + PLA + STA TEMP3 + + PLA + BCS CR_RET if they typed 'done' + +:ED_ED7A SEC + SBC TEMP2 find out length + BEQ :ED_ED5 hmm, same length! + BCC :ED_ED4 + + TAY + JSR DEL_TX0 make room + JMP :ED_ED5 + +:ED_ED4 EOR #-1 make positive + TAY + INY + JSR INS_TX0 insert + +:ED_ED5 LDY #0 + LDX TEMP2 get length + INX +:ED_ED6 LDA LNBUF,Y + STA (TEMP3),Y copy line back + INY + DEX + BNE :ED_ED6 + JMP PRCRIF add extra lf (maybe) + +CR_RET RTS + +CR_ERR LDX #badln + JSR PREDMSG + JMP PRCRIF add extra lf (maybe) + +ED_INS LDX #insert? + JSR PREDMSG + JSR INPLN + JSR CHKLIST do a list? + BCS ED_INS + +DOT_INS JSR XARG + BEQ CR_RET + BCS CR_ERR + LDX #insert + JSR PREDMSG + +:ED_INS0 LDX #LNBUF + JSR GETEDLN get a line of stuff + BCS :ED_INS2 + + LDY TEMP2 save length + INY add 1 for CR + STY SAVE_Y + LDX X_ARG + LDA X_ARG+1 + JSR FINDLN locate line + LDY SAVE_Y + JSR INS_TXT insert text + + LDY #0 +:ED_INS1 LDA LNBUF,Y + STA (TEMP3),Y copy in new line + INY + DEC SAVE_Y + BNE :ED_INS1 + + LDX #0 + CPX WWEXTRA + BEQ :ED_IN1B word-wrap?, nope + +:ED_IN1A LDA LNBUF,Y get next bit of data + INY + STA LNBUF,X move back + INX + CPX WWEXTRA + BNE :ED_IN1A done?, nope + +:ED_IN1B INC X_ARG + BNE :ED_IN1C inc line to insert at + INC X_ARG+1 + +:ED_IN1C INC EDLINE + BNE :ED_INS0 inc line count + INC EDLINE+1 + BNE :ED_INS0 + +:ED_INS2 BIT EXE_DOT is it .i command? + BPL CR_RET nope, return + JMP CONT continue + +CR_ERR0 JMP CR_ERR goto error routine + +ED_LST LDX #list? + JSR PREDMSG + JSR INPLN + +DOT_LST LDY #0 + STY SHWLN reset line # bit + LDA (ARGPTR),Y + JSR CONV + CMP #'Y' + BNE ED_LST1 show numbers?, nope + + LDA #-1 + STA SHWLN show line numbers + INC ARGPTR + BNE ED_LST1 point to next char + INC ARGPTR+1 + +ED_LST1 JSR XYARG + BCS CR_ERR0 + + JSR PRCRLF +ED_SHLN LDX X_ARG get line number + LDA X_ARG+1 + JSR FINDLN locate it + +:ED_LST2 BIT SHWLN show line numbers? + BPL :ED_LST3 nope + + JSR SHOWLN add the line number +:ED_LST3 JSR FNDLEN get the length + STA TEMP2 + JSR LSTLINE list the line + + SEC advance pointer to next line + LDA TEMP2 + ADC TEMP + STA TEMP temp = temp + temp2 + 1 + LDA #0 + ADC TEMP+1 + STA TEMP+1 + + JSR PRCRLF add cr + JSR INCXARG + BCC :ED_LST2 + RTS + +ED_NEW LDX #new? + JSR PREDMSG + JSR GETCMD + CMP #'Y' + BNE :ED_NEW2 + + JSR ED_CLR clear editor + LDX #enter + JSR PREDMSG enter message now... + LDA #0 + STA EXE_DOT allow dot commands + JMP ED_LN get message + +:ED_NEW2 RTS + +ED_USED LDA #cr + JSR COUT + JSR ED_SPC + LDA DATA+2 + LDX DATA+1 + JSR DECOUT + LDX #bytsused + JMP PREDMSG + +DOT_PMT LDA PROMPT + EOR #-1 toggle prompt status + STA PROMPT + BEQ ED_NEW2 dont show prompts + + LDA #'>' show first prompt + JSR COUT + +ED_NEW2 RTS +; common read/write + +ED_RW JSR INPLN input data + LDA #LNBUF + STA STRLOC+1 + LDA #19 + STA STRLEN save max length + JMP MOVNM0 move the name + +ED_RD LDX #readfn? + JSR PREDMSG + JSR ED_RW + JSR IFOPEN try and open + BCS ED_RD4 error, no go + + LDA #EDBUF + STA EDPTR+1 + +:ED_RD2 JSR RDBYTE read in file + PHP + JSR EDOUT + PLP + BCC :ED_RD2 + +ED_RD3 JSR CLOSE finish up + JMP FINDEND fix pointers + +ED_RD4 LDX #nofile print no buffers + JMP PRMSG + +ED_WRT LDX #writefn? + JSR PREDMSG + JSR ED_RW setup for work + JSR DELFILE delete existing file + LDY #txt + LDA #0 + LDX #0 + JSR CREATE create a text file + JSR IFOPEN + BCS ED_RD3 error + + LDA #0 + STA DEVCLR reset device + +:ED_WR2 JSR EDINP get data + CMP #0 + BEQ ED_RD3 thats the end + + JSR WRBYTE write out byte + BCC :ED_WR2 all is well + LDX #badwrite + JSR PRMSG show message + JMP ED_RD3 finish up + +DOT_OK LDA #0 add in eof char + TAY + STA (TEMP),Y + +ED_OK BIT EXEC exec user online? + BPL :FILT0 + JMP ED_EX yes, exit + +:FILT0 LDA FILTER is filter in place? + BEQ :XCHECK nope, check for .X's + + LDA #EDBUF + STA TEMP+1 + + JMP :FILT7 start routine + +:FILT1 LDA FILTER,X go to next entry + INX + ASL A at last char? + BCC :FILT1 nope + + LDY #0 start at first byte +:FILT3 LDA FILTER,X get filter char + BEQ :FILT5 end of table + + STA TEMP2 save it + LDA (TEMP),Y get byte in question + JSR CONV convert to upper + EOR TEMP2 check against filter - save hi bit + ASL A put high into carry + BNE :FILT1 no match, keep checking + + INX inc pointers + INY + BCC :FILT3 keep checking for rest of string + + LDA #'*' change text into *'s +:FILT4 DEY + STA (TEMP),Y + CPY #0 + BNE :FILT4 + +:FILT5 INC TEMP + BNE :FILT7 go to next byte + INC TEMP+1 + +:FILT7 LDX #0 start both index's off at 0 + LDY #0 + LDA (TEMP),Y get byte + BEQ :XCHECK end + + CMP #'A' + BGE :FILT3 is it good data, check it + BLT :FILT5 goto next byte + +:XCHECK LDA #EDBUF start at beginning + STA TEMP+1 + + LDY #0 Y is 0 on first pass only +:XCK1 LDA (TEMP),Y all other passes, Y is 1 + BEQ ED_EX no data + CMP #'.' command? + BNE :XCK2 no, skip to next line + + INY check the command + LDA (TEMP),Y + JSR CONV + CMP #'X' is it an X? + BNE :XCK2 no, skip to next line + + INY check if space follows + LDA (TEMP),Y + CMP #' ' is there a space? + BNE :XCK2 no, skip to next line + + LDA #'*' replace '.X ' (kills external) + STA (TEMP),Y with '.X*' (see DO_SHOW) + STA ERVAL + +:XCK2 LDY #0 set Y back to 0 +:XCK3 INC TEMP search for end of line + BNE :XCK4 or end of text + INC TEMP+1 +:XCK4 LDA (TEMP),Y + BEQ ED_EX no more text + CMP #cr + BNE :XCK3 end of line?, look some more + INY Y is now 1 + BNE :XCK1 branch always + +ED_EX LDX EDSTACK + TXS + RTS + +*------------------------------- +* ----- editor routines ----- +*------------------------------- + +GETEDLN LDY #0 line length + STY TEMP2 + STX TEMP point to data + STA TEMP+1 + + BIT PROMPT are prompts on? + BPL :GETEDL1 nope + + LDA #'>' display prompt + JSR COUT + +:GETEDL1 LDA WWEXTRA word-wrap? + BEQ GETEDL2 nope + + STY WWEXTRA reset word-wrap + STA TEMP2 save length + JSR LSTLINE list the partial line and fall through + JMP GETED1 don't want to reset to 0! + +GETEDL2 LDY #0 + +GETED1 JSR RDKEY get input + JSR GETED2 + JMP GETED1 + +GETED2 JSR MATCH + DB -1 + DA ED_EX carrier lost + DB cr + DA EDLNCR handle [return] + DB tab + DA EDLN0 handle [tab] + DB bs + DA EDLN1 handle [backspace, ctrl-h] + DB del + DA EDLN12 handle [delete] + DB can + DA EDLN4 handle [cancel, ctrl-x] + DB ctr + DA EDLN11 handle [center, ctrl-c] + DB 0 finish this set + + BIT NONBS good bs mode + BVC :GETED2H no + + JSR MATCH + DB fs + DA EDLN2 handle [forward space, ctrl-u] + DB hak + DA EDLN3 handle [truncate, ctrl-t] + DB dc + DA EDLN5 handle [delete char, ctrl-d] + DB ic + DA EDLN6 handle [insert char, ctrl-f] + DB bol + DA EDLN7 handle [begin line, ctrl-b] + DB eol + DA EDLN8 handle [end of line, ctrl-e] + DB lwd + DA EDLN9 handle [last word, ctrl-l] + DB nwd + DA EDLN10 handle [next word, ctrl-n] + DB 0 + +:GETED2H CMP #' ' + BLT :GETED2C control?, yes + + CPY VIDLEN + BEQ :GETED3 + STA (TEMP),Y store it. + JSR COUT output it + CPY TEMP2 + BNE :GETED2B at end of line?, nope + + INC TEMP2 inc end of line pointer +:GETED2B INY inc data pointer +:GETED2C RTS + +:GETED2Z TXA restore Y + TAY +:GETED2X LDA #bel ring bell + JMP COUT + +:GETED3 BIT WWRAP is word wrap on? + BPL :GETED2X nope + + CMP #' ' + BEQ EDLNCR was it an even break?, yes + + STA (TEMP),Y save char + TYA save Y + TAX +:GETED3A DEY + BEQ :GETED2Z count down, no spaces in line! + + LDA (TEMP),Y check for space + CMP #' ' + BNE :GETED3A nope, keep looking + + STY TEMP2 save new length + LDY #0 + +:GETED3B INY count number of extra's + DEX first char doesn't count + JSR PRBS backup + CPX TEMP2 + BNE :GETED3B we done?, keep looping + + STY WWEXTRA remember extra + +EDLNCR LDY TEMP2 get line length + LDA #cr + STA (TEMP),Y save return at end + JSR COUT show it + + LDY #0 + LDA (TEMP),Y + STA DOT_SAVE + CMP #'.' + BEQ EDLNCR0 dot command?, yes + CMP #'/' + BNE EDLNCR2 slash command?, no + +EDLNCR0 LDA #0 + STA DOT_E + + BIT EXE_DOT dot commands allowed? + BMI EDLNCR2 nope + DEC EXE_DOT exec a dot command + + CLC + LDA TEMP + STA EDPTR set up arg pointer + ADC #2 + STA ARGPTR + + LDA TEMP+1 + STA EDPTR+1 + ADC #0 + STA ARGPTR+1 + + LDY #0 + TYA end text + STA (TEMP),Y + INY + LDA (TEMP),Y get command + JSR EDLNCR1 + + JSR FINDEND get new end pointer + + LDY #0 + STY EXE_DOT get a new line + STY TEMP2 no in dot command + + LDA EDPTR point back to data + STA TEMP + LDA EDPTR+1 + STA TEMP+1 + RTS + +EDLNCR1 JSR CONV make upper + JSR MATCH + ASC 'A' + DA ED_ABT + ASC 'D' + DA DOT_DEL + ASC 'E' + DA DOT_ED + ASC 'H' + DA DOT_HLP + ASC 'I' + DA DOT_INS + ASC 'L' + DA DOT_LST + ASC 'N' + DA ED_NEW + ASC 'O' + DA DOT_OK + ASC 'S' + DA DOT_OK + ASC 'P' + DA DOT_PMT + ASC 'Z' + DA ED_USED + DB 0 + PLA + PLA + + LDY #0 + STY EXE_DOT no dot command + LDA DOT_SAVE + STA (TEMP),Y restore the dot + +EDLNCR2 PLA return from getline + PLA + + BIT DOT_E is it a '.e'? + BMI :EDLNCR5 yes, so handle it + + LDA TEMP2 was length correct? + CMP #4 + BNE :EDLNCR4 nope + + LDX #0 was it 'DONE'? + JSR CMPSTR + BCS :EDLNCR5 yes + +:EDLNCR4 SEC return with end address of line + LDA TEMP2 address = start + length + 1 (for CR) + ADC TEMP + TAX + LDA #0 + ADC TEMP+1 + CLC return status: clc = all well + RTS + +:EDLNCR5 LDX TEMP get old address + LDA TEMP+1 + RTS return status: sec = exit edit mode + +*------------------------------- +* handle a tab +*------------------------------- + +EDLN0 CPY VIDLEN + BEQ :EDLN0A at end of line?, no more + + LDA #' ' do a space + JSR GETED2 + TYA + AND #7 are we at a 1/8 inc? + BNE EDLN0 nope +:EDLN0A RTS + +*------------------------------- +* go forward 1 space +*------------------------------- + +EDLN2 SEC cant do fs + CPY TEMP2 + BEQ :EDLN2A at end of line?, yes + + LDA (TEMP),Y get char + JSR COUT output it + INY move pointer + CLC can do fs +:EDLN2A RTS + +*------------------------------- +* truncate contents of line +*------------------------------- + +EDLN3 LDX #0 kill 0 chars +:EDLN3A CPY TEMP2 + BEQ :EDLN3B are we done, yes + + LDA #' ' + JSR COUT + INX count it + INY + BNE :EDLN3A move forward + +:EDLN3B CPX #0 + BEQ :EDLN3C done?, yes + + JSR BSOUT do bs + DEC TEMP2 move back line count + DEY move back data pointer + DEX + BNE :EDLN3B count down, loop if not done + +:EDLN3C RTS + +*------------------------------- +* delete entire line +*------------------------------- + +EDLN4 JSR EDLN3 hack line + LDA TEMP2 no data to kill + BEQ :EDLN4B + +:EDLN4A JSR PRBS destructive bs + DEY back up data pointer + DEC TEMP2 + BNE :EDLN4A decrease line length + +:EDLN4B RTS + +*------------------------------- +* delete 1 character +*------------------------------- + +EDLN5 CPY TEMP2 + BEQ :EDLN5D at end of line? + + STY SAVE_Y + DEC TEMP2 decrease line count + LDX #1 +:EDLN5A CPY TEMP2 + BEQ :EDLN5B done + + INY + LDA (TEMP),Y move each char back + DEY + STA (TEMP),Y + INY + INX + JSR COUT show char + JMP :EDLN5A + +:EDLN5B LDA #' ' delete last char + JSR COUT + LDY SAVE_Y + +:EDLN5C JSR BSOUT + DEX + BNE :EDLN5C + +:EDLN5D RTS + +*------------------------------- +* insert 1 character +*------------------------------- + +EDLN6 CPY TEMP2 + BEQ :EDLN6C at the end of the line? + + LDA TEMP2 are we at max line width? + CMP VIDLEN + BEQ :EDLN6C yes + + STY SAVE_Y + LDX #0 start counter + LDA #' ' show a space first +:EDLN6A JSR COUT + INX inc count + + PHA + LDA (TEMP),Y + STA TEMP2+1 get new char and save + PLA + STA (TEMP),Y save old char + LDA TEMP2+1 + + INY + CPY TEMP2 + BLT :EDLN6A + BEQ :EDLN6A done? + + INC TEMP2 add 1 to line count + LDY SAVE_Y +:EDLN6B JSR BSOUT backup + DEX + BNE :EDLN6B + +:EDLN6C RTS done + +*------------------------------- +* goto beginning of line +*------------------------------- + +EDLN7 CPY #0 + BEQ EDLN7B at beginning?, yes + +:EDLN7A JSR BSOUT back up + DEY + BNE :EDLN7A + +EDLN7B RTS + +*------------------------------- +* list a line +*------------------------------- + +LSTLINE LDY #0 use show to eol + +*------------------------------- +* goto end of line +*------------------------------- + +EDLN8 CPY TEMP2 + BEQ EDLN7B at end of line?, yes + + LDA (TEMP),Y + JSR COUT print char (move forward) + INY keep checking + JMP EDLN8 + +*------------------------------- +* back up to last word +*------------------------------- + +EDLN9 CPY #0 + BEQ :EDLN9A at beginning?, yes + + JSR BSOUT back up + DEY + LDA (TEMP),Y back 1 word? + CMP #' ' + BNE EDLN9 no + +:EDLN9A RTS + +*------------------------------- +* goto next word +*------------------------------- + +EDLN10 CPY TEMP2 + BEQ :EDLN10A at end?, yes + + LDA (TEMP),Y move forward + JSR COUT + INY + LDA (TEMP),Y + CMP #' ' + BNE EDLN10 at end of word?, no + +:EDLN10A RTS + +*------------------------------- +* center line of text +*------------------------------- + +EDLN11 LDA TEMP2 any data?, no + BEQ EDLN11B + + JSR EDLN7 move cursor to first char + JSR CENTER center text + BCS EDLN11B problem + + LDA TEMP2 + PHA + LDA TEMP2+1 + STA TEMP2 save new length + JSR LSTLINE show the line + PLA + STA TEMP2 + + LDA TEMP2+1 + CMP TEMP2 + BGE EDLN11A is new line smaller?, no + JSR EDLN3 hack rest of line + +EDLN11A LDA TEMP2+1 + STA TEMP2 +EDLN11B RTS + +*------------------------------- +* back up 1 char +*------------------------------- + +EDLN1 CPY #0 + BEQ EDLN11B at beginning of line?, yes + + BIT NONBS destruct bs mode + BMI EDLN13 + BVC EDLN13 unknown mode + + DEY + JMP BSOUT do bs + +*------------------------------- +* handle delete character +*------------------------------- + +EDLN12 CPY #0 + BEQ EDLN11B at beginning? + + DEY backup + JSR BSOUT + JMP EDLN5 delete char + +EDLN13 DEY + DEC TEMP2 + JMP PRBS + +EDSTACK DB 0 +EXE_DOT DB 0 +SHWLN DB 0 +WWRAP DB 0 +WWFLAG DB -1 +WWEXTRA DB 0 +NONBS DB 0 +VIDLEN DB 39 +PROMPT DB 0 +DOT_SAVE DB 0 +DOT_E DB 0 +QTEXT DCI 'DONE' + +*------------------------------- +* easy dispatch routine [must save Y] +*------------------------------- + +MATCH STA SAVE_X save match char + STY SAVE_Y + PLA + STA TEMP3 get address of data-1 + PLA + STA TEMP3+1 + + LDY #1 +:MATCH2 LDA (TEMP3),Y + BEQ :MATCH4 + + CMP SAVE_X + BEQ :MATCH3 + + INY y = y + 3 + INY + INY + BNE :MATCH2 loop + +:MATCH3 INY + LDA (TEMP3),Y + TAX + INY + LDA (TEMP3),Y + JMP :MATCH5 do it + +:MATCH4 INY increase count + CLC + TYA + ADC TEMP3 add in offset + TAX + LDA #0 + ADC TEMP3+1 + +:MATCH5 STX TEMP3 save address + STA TEMP3+1 + LDY SAVE_Y + LDA SAVE_X + JMP (TEMP3) return to caller + +*------------------------------- +* center a line of text +*------------------------------- + +CENTER LDX #0 start index's + + LDY #-1 +:CENTER2 INY + CPY TEMP2 + BEQ :CENTER8 + + LDA (TEMP),Y gobble leading spaces + CMP #' ' + BEQ :CENTER2 + +:CENTER3 LDA (TEMP),Y + STA LNBUF+128,X get data and save + INX + INY + CMP #' ' + BEQ :CENTER4 + + STX TEMP2+1 update length +:CENTER4 CPY TEMP2 + BNE :CENTER3 done?, no + + SEC + LDA VIDLEN find number of spaces to add + SBC TEMP2+1 + LSR A +:CENTER8 PHP + LDY #0 go to beginning of line + PLP + SEC + BEQ CENTER7 don't add any + + TAX + CLC + ADC TEMP2+1 get new total length + STA TEMP2+1 + + LDA #' ' +:CENTER5 STA (TEMP),Y add in leading spaces + INY + DEX + BNE :CENTER5 + +:CENTER6 LDA LNBUF+128,X + STA (TEMP),Y copy data back + INX + INY + CPY TEMP2+1 + BNE :CENTER6 done?, no + + CLC +CENTER7 RTS + +*------------------------------- +* print small help file +*------------------------------- + +DOT_HLP LDX #legaldot + JMP PREDMSG + +*------------------------------- +* input a command +*------------------------------- + +GETCMD LDA #%10000000 + STA INPMODE set upper, no blank line + JSR INPLN get input + LDA #%10100000 + STA INPMODE upper, blanks ok + LDA LNBUF + BIT LOGOFF any problems? + BPL CENTER7 no + JMP ED_EX quit editor + +*------------------------------- +* find a line number +*------------------------------- + +FINDLN STX TEMP2 save line number + STA TEMP2+1 + LDY #EDBUF + STA TEMP+1 + +:FINDLN2 LDA TEMP2 count down lines + BNE :FNDLN2A temp2 = temp2 - 1 + DEC TEMP2+1 count down high +:FNDLN2A DEC TEMP2 + LDA TEMP2 + ORA TEMP2+1 are we done? + BNE :FINDLN3 no + + STY TEMP + LDX TEMP get address of line + LDA TEMP+1 + RTS + +:FINDLN3 LDA (TEMP),Y get byte + INY + BNE :FINDLN4 + INC TEMP+1 + +:FINDLN4 CMP #cr + BNE :FINDLN3 + BEQ :FINDLN2 done?.. + +*------------------------------- +* get length of line +*------------------------------- + +FNDLEN LDY #-1 +:FNDLEN2 INY + LDA (TEMP),Y count length of line + CMP #cr + BNE :FNDLEN2 + + TYA +CMPSTR3 CLC no match + RTS + +*------------------------------- +* compare data with string +*------------------------------- + +CMPSTR LDY #0 start at byte 0 +CMPSTR2 LDA (TEMP),Y + INY + JSR CONV make into upper + EOR QTEXT,X check against exit text + INX + ASL A + BNE CMPSTR3 no match + BCC CMPSTR2 keep checking + RTS + +*------------------------------- +* handle single argument +*------------------------------- + +XARG LDA EDLINE is there data? + ORA EDLINE+1 + BEQ XYCLR no + + JSR CHKLAST + + LDA ARGPTR set up pointers + STA TEMP3 + LDA ARGPTR+1 + STA TEMP3+1 + + JSR ZNUMIN get number + STX X_ARG save + STA X_ARG+1 + + JMP CHKRNG get legality + +XYCLR SEC + RTS + +*------------------------------- +* handle arguments +*------------------------------- + +XYARG LDA #<1 first pointer to 1 + STA X_ARG + LDA #>1 + STA X_ARG+1 + + JSR CHKLAST + + LDA EDLINE second pointer to last line # + STA Y_ARG + LDA EDLINE+1 + STA Y_ARG+1 + + ORA Y_ARG check for no data + BEQ XYCLR problem + + LDA ARGPTR point to data + STA TEMP3 + LDA ARGPTR+1 + STA TEMP3+1 + + LDY #0 + LDA (TEMP3),Y blank line? + CMP #cr + BEQ :XYARG7 yes + CMP #',' + BEQ :XYARG2 check separator + CMP #'-' + BEQ :XYARG2 + + JSR ZNUMIN get first number + STX X_ARG + STX Y_ARG + STA X_ARG+1 + STA Y_ARG+1 + JSR CHKRNG + BCS :XYARG6 out of range + + LDY #0 + LDA (TEMP3),Y any more? + CMP #',' + BEQ :XYARG2 yes + CMP #'-' + BNE :XYARG5 no + +:XYARG2 INC TEMP3 + BNE :XYARG4 inc pointer + INC TEMP3+1 + +:XYARG4 LDA EDLINE save ending editor line + STA Y_ARG + LDA EDLINE+1 + STA Y_ARG+1 + + LDY #0 is it xx- format? + LDA (TEMP3),Y + CMP #cr + BEQ :XYARG5 yes + + JSR ZNUMIN + STX Y_ARG save second number + STA Y_ARG+1 + JSR CHKRNG + BCS :XYARG6 + + LDA X_ARG+1 check high byte + CMP Y_ARG+1 + BLT :XYARG5 all is ok + + LDA Y_ARG check low byte + CMP X_ARG + BGE :XYARG5 if =>, ok + + SEC + BCS :XYARG6 x_arg > y_arg + +:XYARG5 CLC +:XYARG6 LDA #1 not just a return + RTS + +:XYARG7 CLC + LDA #0 just a return + RTS + +*------------------------------- +* make sure line number is in range +*------------------------------- + +CHKRNG STX SAVE_X save data + STA SAVE_Y + ORA SAVE_X is there a number? + BEQ CHKRNG2 no, it's 0 + + LDA EDLINE+1 check high + CMP SAVE_Y + BLT CHKRNG2 its out of range + + LDX EDLINE check low + CPX SAVE_X + BLT CHKRNG2 its out of range + + CLC all's well + LDA #1 clear return flag + RTS + +CHKRNG2 SEC out of range + RTS + +*------------------------------- +* check for 'last line' reference +*------------------------------- + +CHKLAST BIT EXE_DOT execing dot command? + BPL CHKRNG2 no + LDY #0 + LDA (ARGPTR),Y get byte + JSR CONV + CMP #'L' + BNE CHKRNG2 no match, return + + PLA + PLA + LDX EDLINE + STX X_ARG + STX Y_ARG + LDA EDLINE+1 + STA X_ARG+1 + STA Y_ARG+1 + JMP CHKRNG make sure line is legal + + RTS + +*------------------------------- +* move up xarg pointer and see if were done +*------------------------------- + +INCXARG LDA X_ARG done? + CMP Y_ARG + BNE :INCXA2 no + + LDA X_ARG+1 done? + CMP Y_ARG+1 + BNE :INCXA2 no + + SEC we are done + RTS + +:INCXA2 INC X_ARG + BNE :INCXA3 move counter + INC X_ARG+1 + +:INCXA3 CLC still ok +INCXA4 RTS + +*------------------------------- +* show last 3 lines +*------------------------------- + +SHWLAST LDA EDLINE point to last line + STA Y_ARG + LDA EDLINE+1 + STA Y_ARG+1 + ORA Y_ARG + BEQ INCXA4 no data + + SEC + LDA Y_ARG + SBC #2 + STA X_ARG get X line number + TAX + LDA Y_ARG+1 + SBC #0 + STA X_ARG+1 + JSR CHKRNG is it ok? + BCC :SHWLST2 yes + + LDX #1 + STX X_ARG start at line 1 + DEX + STX X_ARG+1 + +:SHWLST2 JMP ED_SHLN show last 3 lines... + +*------------------------------- +* delete Y bytes of text +*------------------------------- + +DEL_TXT STX TEMP3 save pointer + STA TEMP3+1 +DEL_TX0 STY SAVE_Y save # of chars to kill + + LDA TEMP3 save old pointer + PHA + LDA TEMP3+1 + PHA + +:DEL_TX2 LDY SAVE_Y + LDA (TEMP3),Y get char + LDY #0 + STA (TEMP3),Y save char + + INC TEMP3 + BNE :DEL_TX3 + INC TEMP3+1 + +:DEL_TX3 CMP #0 + BNE :DEL_TX2 loop till end of editor + + PLA + STA TEMP3+1 restore old pointer + PLA + STA TEMP3 +DEL_TX4 RTS + +*------------------------------- +* insert Y bytes of text +*------------------------------- + +INS_TXT STX TEMP3 save pointer + STA TEMP3+1 +INS_TX0 STY SAVE_Y save # of chars to insert + + LDY #0 + LDA (TEMP3),Y flag last char + ORA #hibit + STA (TEMP3),Y + +:INS_TX2 LDA (TEMP3),Y at end of data? + BEQ :INS_TX3 yes + + INC TEMP3 + BNE :INS_TX2 move through data + INC TEMP3+1 + BNE :INS_TX2 + +:INS_TX3 LDY #0 + LDA (TEMP3),Y get byte + PHA + LDY SAVE_Y + AND #clrhi + STA (TEMP3),Y move it + PLA + BMI DEL_TX4 + + LDA TEMP3 + BNE :INS_TX4 + DEC TEMP3+1 count back +:INS_TX4 DEC TEMP3 + JMP :INS_TX3 + +*------------------------------- +* find end of editor +*------------------------------- + +FINDEND LDA #>EDBUF point to start of editor + STA EDPTR+1 + LDY #' show prompt + JSR COUT + JMP PRCRLF add a return + +*------------------------------- +* check and see if they want to list +*------------------------------- + +CHKLIST LDA LNBUF get input + JSR CONV make upper + CMP #'L' + CLC + BNE CHKLST2 they dont want to list + LDX #list? + JSR PREDMSG + JSR INPLN read input + + LDA #-1 + STA SHWLN show line numbers + + JSR ED_LST1 do list + SEC show list done +CHKLST2 RTS + +*------------------------------- +* continue message +*------------------------------- + +CONT LDX #continue + JSR PREDMSG + LDA #0 + STA SHWLN dont show line numbers + JSR SHWLAST show last 3 lines + JMP FINDEND reset pointers + +*------------------------------- +* ---- editor i/o routines ----- +*------------------------------- + +EDIN3 LDA #EDBUF + STA EDPTR+1 reset pointers + DEC DEVCLR clear flag + +*------------------------------- +* get a character from the edit buffer +*------------------------------- + +EDINP BIT DEVCLR reset? + BPL EDIN3 yes + + STY SAVE_Y save Y + LDY #0 + LDA (EDPTR),Y + BEQ :EDIN2 if eof + + INC EDPTR + BNE :EDIN2 point to next byte + INC EDPTR+1 +:EDIN2 LDY SAVE_Y restore Y + RTS + +*------------------------------- +* add a character to editor buffer +*------------------------------- + +EDOUT STY SAVE_Y save Y + + LDY EDPTR are we at end? + CPY #EBUFEND + BEQ :EDOUT3 yes + +:EDOUT2 LDY #0 + STA (EDPTR),Y save byte + INY + + PHA save end marker + LDA #0 + STA (EDPTR),Y + PLA + + INC EDPTR + BNE :EDOUT3 inc pointers to next byte + INC EDPTR+1 + +:EDOUT3 LDY SAVE_Y restore and return + RTS + +SERNUM REV 'GP2140002' +SEREND + +COPNOT HEX 0D0D + REV 'GBBS Pro (C)86-2019 Kevin Smallwood V2.20n' +COPEND + DS \ diff --git a/Source/Acos/ENCODE.S b/Source/Acos/ENCODE.S index ffa0578..7124577 100644 --- a/Source/Acos/ENCODE.S +++ b/Source/Acos/ENCODE.S @@ -1 +1,37 @@ -Ǎ Ӯ ǠŠԍЍԍЫ٠ĭԍٍРЩٍ̠ҠĭԍЩٍٍ̠Ѝ͍Ѝ͍Ы٠ĭٍ͍вЩٍ̠Ҡĭ͍Щٍٍ̠вӍ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Copyright Encode * +* * +******************************** + + ORG $300 + +COPCODE LDA #COPNOT + STA TEMP+1 + LDY #COPEND-COPNOT + DEY +:LOOP LDA (TEMP),Y + ROL A + EOR #COPEND-COPNOT + STA (TEMP),Y + DEY + BPL :LOOP + + LDA #SERNUM + STA TEMP+1 + LDY #SEREND-SERNUM + DEY +:LOOP2 LDA (TEMP),Y + ROL A + EOR #SEREND-SERNUM + STA (TEMP),Y + DEY + BPL :LOOP2 + RTS + + diff --git a/Source/Acos/FILTER.S b/Source/Acos/FILTER.S index 205c2b2..e56745e 100644 --- a/Source/Acos/FILTER.S +++ b/Source/Acos/FILTER.S @@ -1 +1,23 @@ -Ǎ Ӯ ōҠɠ˧ɠԧɠΧɠŧɠ˧ɠ˧ɠ˧  à ֺ é ͮ č ֺ é ̦ 㮧č ֺ é č ̮姰İӠ܍ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Profanity Filter * +* * +******************************** + DATE +*------------------------------- + +FILTER DCI 'FUCK' + DCI 'SHIT' + DCI 'DAMN' + DCI 'ASSHOLE' + DCI 'COCK' + DCI 'SUCK' + DCI 'PRICK' + DB 00 + DB cr + ASC 'GBBS Pro V:2.20 (C) 1986-2019 by Kevin M. Smallwood '0D +* ASC 'GBBS Pro V:2.20 (C) 1986-1989 by L&L Productions, Inc.'0D +* ASC 'GBBS Pro V:1.4 (C) 1986-1989 by L & L Productions'0D +* ASC 'Lance Taylor-Warren, fixes by A.Wells & L.Roathe'0D00 + DS \ diff --git a/Source/Acos/INIT.S b/Source/Acos/INIT.S index 22091ff..ec8aa83 100644 --- a/Source/Acos/INIT.S +++ b/Source/Acos/INIT.S @@ -1 +1,638 @@ -Ǎ Ӯ ōԱҠŠ 占Ҡ̠ 捠Ҡ̵ Р̶ԲҠŠ Р̱ 퍍 Š͠ 덠͍ ፠ЍЫԠ вԍв٠ ؠ֫βЩٍв٠ 占ٍŠβàЫàв؍Šβ ٠ԳdzЬٍԬ٠ 占ٍ̠Գ ؍ ԍ ؍ ԫӍǠč Ԡ 䍠 䍠 䍠ɠħ 占ɠϧ ɠ§ ɠȧ ɠç 卍ɠ 䍍ɠҧ ɠ˧ ɠŧ ɠԧ ɠ٧ 占ɠԧ ɠԧ 占ɠԧ ɠԧ ɠǧ ɠŧ ɠŧ ɠƧ ɠΧ ɠŧ ɠΧ ɠЧ ɠͧ ɠΧ 荠ɠϧ ɠǧ 占ɠΧ 占ɠŧ 占ɠ˧ ɠ̧ ɠŧ ɠΧ ɠԧ ɠ٧ ɠħ ɠŧ ɠԧ ɠ٧ ɠԧ ɠǧ ɠħ ɠŧ ɠȧ ɠҧ ɠϧ ɠЧ ɠԧ ɠҧ ɠ̧ ɠŧ ɠͲ 占ɠͧ 占ɠŧ ɠȧ ɠŧ ɠԧ 䍠ɠħ ɠ̧ ɠ ҧ ɠ ҧ ɠҧ ɠŧ ɠϧ ɠ˧ ɠŧ ɠŧ ɠ˧ ɠƧ ɠŧ ɠ̧ ɠͧ ɠç ɠ̧ ɠŧ ɠ̧ Ơԍɠ˧ ɠ˧ ΍ɠҤ ɠŤ ɠŤ ɠŤ ɠΤ ɠԤ ɠԤ ɠĤ ɠҤ ɠĤ ɠɠɠɠɠɠɠɠɠɠħ 䍠ɠҧ 䍠ɠҧ 䍍ɠɠɠɠɠħ䍠ɠӧ 占  卪Ҡנ򠽠үנԠ砽үנԠ䠽үנĠүנϠ⠽үנ 蠽үנȠ㠽үנҠүנ̠үנ̠򠽠үנҠנˠנŠÍנԠčננōנԠƍנΠנԠנԠנǠנ נԠנƠנ̠堽үנŠנԠנРנ͠נΠÍנϠčנŠōנΠƍנӠנˠנ̠נŠנӠנԠנ٠נĠנԠנԠүנ٠נԠ砽үנǠÍנĠčנŠōנĠƍנҠүנҠ𠽠үנҠנԠנԠנ̠נŠנͲנ͠נŠנȠנРנԠÍנРčנ̠ōנĠƍנҠנϠנ͠נϠנˠנŠנŠנˠנƠנŠנ̠נĠנàÍנ̠čנҠōנ̠ƍƠԍנˍנˍ΍𠽠үנҠנŠנŠנŠנΠנԠנԠנĠנҠנӠ堽үנԠנԠנѠÍנѠčנѠōנѠƍ젽үנѠנԠנԠ㠽үנĠנҠנҠ蠽үנӠ󠽠үנ נԠנĠנĠנӠנÍ 󍪭Ӡ ɠ 䧍ɠ 姍ɠ 䧍ɠ 짍ɠ 򧍠ɠ 짍ɠ 짍ɠ ᧍ɠ 觍ɠ ɠ ɠ 种ɠ 짍ɠ ⧍ɠ 򧍠ɠ 姍ɠ 짍ɠ 򧍠ɠ 䧍ɠ 䧍ɠ ɠ 򧍠ɠ 짍ɠ Ʈ 󍪭Ӡ  à 宮ĸč à 宮ĸč à 䧸čà ĸčà 宮ĸč à 䧸č à č à 宮č 󍪭Ӡ  ɠ 𩺧 à 觸č à 䧸č ɠ 忧 à䧸č à ĸč ɠ ̬ ɠ ̬ à č ɠ ̬ ɠ  à  ɠ 򿧍 à ĸč ɠ 婺 ɠ 婺 à é ĩ ũčàȩ ɩ ̩ Ω ө姰čàک 䧸čà 䧍à 婧İčà à à čà à à 姰čà à à ĸčà 䮧ĸč 󍪭Ӡ ɠ ɠӠӠ Ӡ Ԡ    ፠      àנΠ 䍠נα נβ נР נΠ נР נǠ נ̠ 썠נР נР נΠ àנԠ נԱ נԲ נԠ 占נԠ נԠ נǠ נԠ ݍנԠ נԠ נԠ Рԍԍэээээԍԍ̠ؠưưƍàв 󍍪 덍ˠà à Խ ͽ н ̽ н à à ؠ Ӡààà姍à䧍àà駍àؠ Ӡàà⧍à򧍠à򧍠ààà짍à种à𧍠ààà㧍Ơ ٠ ٍ͠Ӡ ƍˠӠ ፍҠӠ ĠӠРӠàӠŠӠ͠Ӡ͠ӠӠӠӠ Ǡ ͠ Ǡ àǠ àҠ 䍍Ӡ Š ͠ ͠ Ԡ Բ Р Ӡ ΠΠ ԠӠƠ  ᅪϠ  詍  詍נ נ נ 卍Ҡ  Ÿ  Ҹ  ˠנ Ġ  ῍Ҳ  Ÿ    ˠנ Ġ  ῍Ҡ  Ը Ҹ ˠנǠ Ǡ  ͠נ ˠנ Ԡ  俍ƠӠ 卍ԍčǍ֠dzРǠԠРԍРԍР͍Р͍РҍРōРҍРÍРԍРҍР΍РÍРԍР԰РōР΍РōРōРōРˍРˍРōРˍРˍРÍō͠ Ʋ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Init Code * +* * +******************************** + DATE +*------------------------------- + +START1 JSR MOVECODE ;do memory move + JSR FATAL ;init stuff + JSR FATAL5 ;move file name (no return) + JMP FATAL6 + +START2 JSR MOVECODE ;move memory + JMP FATAL1 ;init w/o doing modem + +*------------------------------- +* do memory move and setup +*------------------------------- + +MOVECODE LDA SETRAM ;select main lc bank + LDA SETRAM + + LDA #ZDATA + STA TEMP+1 + + LDA #SYMTXT + STA TEMP2+1 + + LDY #0 ;start offset + LDX #>END_MV+$256 +:DO_IN2 LDA (TEMP),Y + STA (TEMP2),Y ;copy byte + INY + BNE :DO_IN2 + + INC TEMP+1 + INC TEMP2+1 + DEX + BNE :DO_IN2 ;count down + + LDY #80 +:INIT3 LDA PG3JMP,Y + STA ENTPOINT,Y ;copy jump table into place + DEY + BPL :INIT3 + +* LDA #IRQ_FIX +* STA IRQVECT+1 + RTS + +ZDATA ORG RAMCARD + +*------------------------------- +* ----- actual tokens ----- +*------------------------------- + +SYMTXT DB -1 ;reserved + DB -1 ;reserved + DB -1 ;reserved + DCI 'END' ;end of module + DCI 'GOTO' ;goto statement + DCI 'GOSUB' ;gosub statement + DCI 'PUSH' ;push statement + DCI 'PUBLIC' ;public directive + + DCI ':' ;colon + DB -1 ;reserved + + DCI 'CLEAR' ;use ascii with hi-bit clear + DCI 'LINK' ;on text, set on last char + DCI 'HOME' ;home cmd, used wierd ways + DCI 'PRINT' ;print statement + DCI 'COPY' ;copy a file + DCI 'GET' ;get a character + DCI 'INPUT' ;input a line + DCI 'SETINT' ;set interupt keys + DCI 'ADDINT' ;add interupt keys + DCI 'FLAG' ;user flags + DCI 'NIBBLE' ;nibble function + DCI 'BYTE' ;byte function + DCI 'IF' ;if statement + DCI 'THEN' ;then statement + DCI 'ELSE' ;else statement + DCI 'RETURN' ;return statement + DCI 'POP' ;pop statement + DCI 'MODEM' ;modem statement + DCI 'LEN' ;string length + DCI 'ECHO' ;set video echo + DCI 'LOG' ;log to a drive + DCI 'OPEN' ;open a file + DCI 'CLOSE' ;close a file + DCI 'MARK' ;get/set function + DCI 'VAL' ;val function + DCI 'FREE' ;free statement + DCI 'POSITION' ;position statement + DCI 'SET' ;set statement + DCI 'READY' ;ready statement + DCI 'READ' ;read statement + DCI 'WRITE' ;write statement + DCI 'NOT' ;not statement + DCI 'KEY' ;key function + DCI 'EDIT' ;edit statement + DCI 'MSG' ;msg function + DCI 'REWIND' ;rewind statement + DCI 'TONE' ;tone function + DCI 'WIDTH' ;width function + DCI 'FOR' ;for statement + DCI 'TO' ;to statement + DCI 'STEP' ;step statement + DCI 'NEXT' ;next statement + DCI 'INSTR' ;instr function + DCI 'KILL' ;kill statement + DCI 'MOVE' ;move statement + DCI 'RAM2' ;ram2 value + DCI 'RAM' ;ram value + DCI 'CREATE' ;create statement + DCI 'CRUNCH' ;crunch statement + DCI 'UPDATE' ;update statement + DCI 'TEXT' ;text command + DCI 'APPEND' ;append statement + DCI 'FILL' ;fill statement + DCI 'ON NOCAR' ;on no carrier + DCI 'ON ERROR' ;on error + DCI 'ERR' ;error number + DCI 'RESUME' ;resume from error + DCI 'INFO' ;info function + DCI 'CLOCK' ;time function + DCI 'USE' ;use statement + DCI 'POKE' ;poke statement + DCI 'PEEK' ;peek function + DCI 'EOF' ;eof function + DCI 'SIZE' ;size function + DCI 'PDL' ;pdl function + DCI 'RANDOM' ;random function + DCI 'ASC' ;ascii function + DCI 'CALL' ;call statement + DCI 'STORE' ;store statement + DCI 'RECALL' ;recall statement + IF NET + DCI 'LOCK' ;lock statement + DCI 'UNLOCK' ;unlock statement + FIN + + DCI 'CHR$' ;chr$ statement + DCI 'DATE$' ;date statement + DCI 'TIME$' ;time$ statement + DCI 'FMTDATE$' ;formatted date statement + DCI 'WHEN$' ;when$ statement + DCI 'LEFT$' ;left$ statement + DCI 'RIGHT$' ;right$ statement + DCI 'MID$' ;mid$ statement + DCI 'STR$' ;str$ statement + DCI 'RND$' ;rnd$ function + + DCI '<>' ;<> + DCI '><' ;>< + DCI '<=' ;<= + DCI '>=' ;>= + DCI '=<' ;=< + DCI '=>' ;=> + DCI '=' ;= + DCI '<' ;< + DCI '>' ;> + + DCI 'AND' ;and operand + DCI 'OR' ;or operand + DCI 'EOR' ;eor operand + + DCI '+' ;plus + DCI '-' ;minus + DCI '*' ;multiplication + DCI '/' ;division + DCI 'MOD' ;mod + DCI 'ABS' ;absolute value + DB 0 + +*------------------------------- +* token jump table +*------------------------------- + +SYMADR DW 0 ;00 +number = *-SYMADR/2 + DW DO_LET ;01 +string = *-SYMADR/2 + DW DO_LET ;02 +end = *-SYMADR/2 + DW DO_END ;03 +goto = *-SYMADR/2 + DW DO_GOTO ;04 +gosub = *-SYMADR/2 + DW DO_GSB ;05 +push = *-SYMADR/2 + DW DO_PUSH ;06 +public = *-SYMADR/2 + DW ERR ;07 + +chain = *-SYMADR/2 + DW NIL ;08 +chain2 = *-SYMADR/2 + DW NIL ;09 + +clear = *-SYMADR/2 + DW DO_CLR ;0A + DW DO_LINK ;0B + DW DO_HOME ;0C + DW DO_PRNT ;0D + DW DO_SHOW ;0E + DW DO_GET ;0F + DW DO_IN ;10 + DW DO_SINT ;11 + DW DO_AINT ;12 + DW DO_FLAG ;13 + DW DO_NIB ;14 + DW DO_BYT ;15 + DW DO_IF ;16 + DW NIL ;17 +else = *-SYMADR/2 + DW DO_ELSE ;18 + DW DO_RET ;19 + DW DO_POP ;1A + DW DO_MDM ;1B + DW DO_LEN ;1C + DW DO_ECHO ;1D + DW MOVNAME ;1E + DW DO_OPEN ;1F + DW DO_CLOS ;20 + DW DO_MARK ;21 + DW DO_VAL ;22 + DW DO_FRE ;23 + DW DO_POS ;24 + DW DO_SET ;25 + DW DO_RDY ;26 + DW DO_READ ;27 + DW DO_WRIT ;28 + DW DO_NOT ;29 +key = *-SYMADR/2 + DW DO_KEY ;2A + DW DO_EDIT ;2B +msg = *-SYMADR/2 + DW DO_MSG ;2C + DW DO_RWD ;2D + DW DO_TONE ;2E + DW DO_WID ;2F + DW DO_FOR ;30 +to = *-SYMADR/2 + DW ERR ;31 +step = *-SYMADR/2 + DW ERR ;32 + DW DO_NXT ;33 + DW DO_INST ;34 + DW DO_KILL ;35 + DW DO_MOVE ;36 + DW DO_RAM2 ;37 + DW DO_RAM ;38 + DW DO_MAKE ;39 + DW DO_CNCH ;3A + DW DO_UP ;3B + DW DO_TEXT ;3C + DW DO_APP ;3D + DW DO_FILL ;3E + DW DO_NOCD ;3F + DW DO_ONERR ;40 + DW DO_ERRNO ;41 + DW DO_RESUM ;42 + DW DO_INFO ;43 + DW DO_CLOK ;44 + DW DO_USE ;45 + DW DO_POKE ;46 + DW DO_PEEK ;47 + DW DO_EOF ;48 + DW DO_SIZE ;49 + DW DO_PDL ;4A + DW DO_RND ;4B + DW DO_ASC ;4C + DW DO_CALL ;4D + DW DO_STOR ;4E + DW DO_RCAL ;4F + IF NET + DW DO_LOCK + DW DO_UNLK + FIN + +strtyp = *-SYMADR/2 + DW DO_CHR ;50 + DW DO_DATE ;51 + DW DO_TIME ;52 + DW DO_FDATE ;53 + DW DO_WHEN ;54 + DW DO_LFT ;55 + DW DO_RGT ;56 + DW DO_MID ;57 + DW DO_STR ;58 + DW DO_RNDS ;59 +compare = *-SYMADR/2 + DW CP_NOT ;5A + DW CP_NOT ;5B + DW CP_LTEQ ;5C + DW CP_GTEQ ;5D + DW CP_LTEQ ;5E + DW CP_GTEQ ;5F +equal = *-SYMADR/2 + DW CP_EQ ;60 + DW CP_LT ;61 + DW CP_GT ;62 + +logic = *-SYMADR/2 + DW CP_AND ;63 + DW CP_OR ;64 + DW CP_EOR ;65 + +math = *-SYMADR/2 + DW DO_PLUS ;66 +minus = *-SYMADR/2 + DW DO_SUB ;67 + DW DO_MULT ;68 + DW DO_DIVD ;69 + DW DO_MOD ;6A + DW DO_ABS ;6B + DW 0 ;6C + +*------------------------------- +* system error messages +*------------------------------- + +ERRMSGS DB -1 + DCI 'Starting Module Not Found' + DCI 'Module Too Large' + DCI 'Label Not Found' + DCI 'Symbol Table Full' + DCI 'Syntax Error' + DCI 'Missing Symbol' + DCI 'Undefined Label' + DCI 'Missing Data' + DCI 'Type Mismatch' + DCI 'Overflow > 32767' + DCI 'Division By 0' + DCI 'String Too Long' + DCI 'Gosub Stack Full' + DCI 'Return Without Gosub' + DCI 'Bad Device Number' + DCI 'Illegal Filename' + DCI 'For Stack Full' + DCI 'Next Without For' + DCI 'Link Label Not Found' + DCI 'Message File Not Found' + DCI 'END of Program' + DCI 'Bad Drive Specifier' + DCI 'Unable to Load External' + DCI 'Unclosed quote at EOF......' + +*------------------------------- +* misc. messages +*------------------------------- + +MISCMSGS DB -1 + DB cr,cr + ASC 'Sysop is on-line...'0D8D + DB cr + ASC 'Sysop is off-line...'0D8D + DB cr,cr + ASC 'Sorry, time limit exceeded'8D + ASC '...please wait...'0D8D + ASC '...exiting exec mode...'0D8D + DB cr + ASC 'Error: Help file could not be opened'8D + DB cr + ASC 'File Write Error'8D + DB cr + ASC 'One moment please...'8D + +*------------------------------- +* editor messages +*------------------------------- + +EDMSGS DB -1 + DB cr + DCI 'Editing (?=Help):' + DB cr + ASC 'That is 4k worth'8D + DB cr + ASC 'Illegal Command'8D + DB cr + DCI 'Abort: Are you sure?' + DB cr + ASC 'Aborted'8D + DB cr + ASC 'Continue message now...'0D8D + DB cr + DCI 'Delete Line (L,x-y):' + DB cr + DCI 'Edit Line (L,x):' + DB cr + ASC 'Illegal line number'8D + DB cr + DCI 'Insert Line (L,x):' + DB cr + DCI 'List Line (x-y):' + DB cr + ASC 'Insert text:' + DB cr + DCI 'New: Erase and start over?' + DB cr + ASC 'Enter message now...'0D8D + DB cr + DCI 'Read File (name):' + DB cr + DCI 'Write File (name):' + DB cr + ASC 'A)bort, C)ontinue, D)elete, E)dit'0D + ASC 'H)elp, I)nsert, L)ist, N)ew, S)ave'0D + ASC 'Z) Space Used'8D + ASC 'Valid editor commands: ("/commmand" and' + ASC '".command" acceptable)'0D0D + ASC ' A = Abort ' + ASC ' Dx-y = Delete line(s) x-y ' + ASC ' N = New'0D + ASC ' H = Help ' + ASC ' Ix = Insert at line x ' + ASC ' S = Save'0D + ASC ' Z = Space ' + ASC ' Ex = Edit line x ' + ASC ' Lx-y = List line(s) x-y'0D8D + ASC ' Bytes Used.'0D8D + +*------------------------------- +* compiler messages +*------------------------------- + +COMPMSGS DB -1 + DCI 'One moment, compiling segment.' + DCI '..' + DS 32,bs + DS 32,' ' + DS 31,bs + DB bs+hibit + +MODEBYT DB %10000011 ;default, get 1 byte only + DB %11000001 ;upper / no blanks / no comma + DB %10100000 ;upper and return + DB %00100000 ;accept all and return + DB %01100000 ;no blanks / no comma / return + +INPVEC DW KEYIN ;console keyboard + DW DISKIN1 ;disk channel 1 + DW DISKIN2 ;disk channel 2 + DW NO_INP ;console input + DW MDMIN ;modem input + DW NO_INP ;line printer + DW RDMSG ;msg input + DW RDMAIL ;read mail + DW EDINP ;editor input + DW NO_INP ;no input from screen + DW RAMIN ;ram drive input + +OUTVEC DW COUT ;console output + DW DSKOUT1 ;disk channel 1 + DW DSKOUT2 ;disk channel 2 + DW VIDCOUT ;local console + DW ZMDMOUT ;modem output + DW PRCOUT ;line printer + DW WRMSG ;msg output + DW NO_OUT ;read mail [none] + DW EDOUT ;editor output + DW TOPPRINT ;print user stats + DW RAMOUT ;ram drive output + +JSTRCP DA ST_NOT + DA ST_NOT + DA ST_LTEQ + DA ST_GTEQ + DA ST_LTEQ + DA ST_GTEQ + DA ST_EQ + DA ST_LT + DA ST_GT + +DEVTBL HEX FF0000FFFFFF0000FFFFFF + ASC 'GP214182' ;fake serial number for peepers + +* screen top mask + +TOPMASK ASC '#..... ............................... ' + ASC 'Stats: CT=.. CM=... UP=.. DL=... BP=... ' + ASC 'Ph: ............ ........ ....-******** ' + ASC 'Flg: .................................. ' + +DAYINDEX DB 0,3,6,9,12,15,18 + +DAYS ASC 'Sun' + ASC 'Mon' + ASC 'Tue' + ASC 'Wed' + ASC 'Thu' + ASC 'Fri' + ASC 'Sat' + +MTHINDEX DB 0,3,6,9,12,15,18,21,24,27,30,33 + +MONTHS ASC 'Jan' + ASC 'Feb' + ASC 'Mar' + ASC 'Apr' + ASC 'May' + ASC 'Jun' + ASC 'Jul' + ASC 'Aug' + ASC 'Sep' + ASC 'Oct' + ASC 'Nov' + ASC 'Dec' + +TOPBUF DB 0 + +DUMMY = * ;standard memory allocation + + DUM DUMMY + + DS 159 ;finish up TOPBUF + +GSBSTK DS $20 ;gosub stack area + +FORVAR DS $10 ;for stack area +FOREND DS $10 +FORSTP DS $10 +FORLOC DS $10 + +DEVUSE DS 11 + +NUM DS 7 +TXTNUM DS 6 +FLPOS DS 6 + +DATA DS 4 +NUMB DA 0 +NEGFLG DB 0 +FREMEM DB 0 + +NOCDFLG DB 0 +NOCDVEC DA 0 + +ONERRFLG DB 0 +ONERRVEC DA 0 +FROMERR DA 0 ;where error occurred + +NULLS DB 0 +REMOTE DB 0 + +SYMNUM DB 0 +LBLNUM DB 0 +LNCNT DB 0 +LNCNT2 DB 0 +TOKTYP DB 0 + +CPASS DB 0 + +REMAIN DA 0 +SIGN DB 0 +RESULT DS 3 + +MSGREF DB 0 ;is message file ready to go? + +MSGINFO DB 0 ;# of bit blocks (512k each) + DB 0 ;# of dir blocks (32 entries each) + DW 0 ;# of free blocks + DW 0 ;# of files + DW 0 ;# of newest message + +MSGPTR DB 0 ;point to message data +BYTE8 DB 0 ;7 -> 8 conversion counter +CHAR8 DB 0 ;7 -> 8 conversion data +RMXBLK DW 0 ;read mail block +RDEND DB 0 ;at end of data? + +MSGPTR2 DB 0 ;for write data +BYTE82 DB 0 ;second set of pointers + DB 0 ;second char8 buffer - not needed for write +WRKBLK DW 0 ;current working write block num +WRTEND DB 0 ;at end of data? + +RWDPTR DB 0 ;point to rewind data +RWDBYT8 DB 0 +RWDCHR8 DB 0 +RWDBLK DW 0 + +DIRSEG DA 0 ;current directory segment +BITSEG DB 0 ;current bit-map segment + +MSGNUM DW 0 ;current message number +POSBLK DW 0 ;postion block counter + +MSGINIT DB 0 ;is message currently being read? + +CHATBUF DS 90 ;storage area for chat routine + +LASTBYT + DEND + ORG +END_MV = *-ZDATA + +PG3JMP ORG $380 + +ENTPOINT JMP GETBYT + JMP CHKBYT + JMP GOBCOM + JMP INPNUM + JMP INPSTR + JMP MOVNAME + JMP BADERR + JMP SETIVEC + JMP GET + JMP GETCHR + JMP INPLN + JMP SETOVEC + JMP COUT + JMP DECOUT0 + JMP CREATE + JMP OPEN + JMP CLOSE + JMP RDBYTE + JMP WRBYTE + JMP RDBLK + JMP WRBLK + JMP RDLINE + JMP GETMARK + JMP SETMARK + JMP LOGSPEC + + DA FLNAME +REFNUM DB 0 + DA FBUF2 diff --git a/Source/Acos/LOAD.S b/Source/Acos/LOAD.S index 61d9f82..34df3d1 100644 --- a/Source/Acos/LOAD.S +++ b/Source/Acos/LOAD.S @@ -1 +1,712 @@ -Ǎ Ӯ ōĠǍǍؠōؠŠı硍؍Ŭؠç؍çŬ؍ؠōҠΠ忍ӠIJ卍Ơ퍠͍ƍƫƫؠƫƫ٠Ҡˍƫ占͍ƫͫؠĠ占č٠ҠˍҠōƠ퍍ƫ뿍РǧŠIJ嬠卍ƫ뿍РӧŠIJ嬠卍Ӡ塍ıؠ堨󩍠РҍIJؠŠ占ӧŬؠӧ占ҠΠ占Ӡı퍍ҠԠ占Ġ占ЫčЍ͍͠ؠ屍ҠǍРŰ󠱠ŴРŴŰԠ򿍠РԠŰ䍠٠ЩٍҠЍŰԠҠŠӠŴ濍ƠРѠŰҠƠ썠ӠűҠ͠占àŰؠ젻ҠҍРŰųв占РųŲҠ̠占РűűàԠű٠ԍƬٍРѠŰ卍РԠű􍍠РѠų卍РѠų卍ҠΠ占РڢŠűӍРŠűĠ卍٠٠ˍűӠР㍠ѠŲ㿬٠ЩٍҠЍРѠŲР荠ѠŲР⍠Šűڠ󍍠٠ˍ٠ŠŲűڠˍРűűàРŰ堰󠭭űĠв占ؠԍƬؠҠƍàűōҠ͍àűōàԠ嬠űŠв卍ؠԍűƠ؍Ƭؠ占ҠƍàűƍҠ͍àűƍؠԍؠРŠűǠ򍍠àԠ獠ؠ獍űǠ٠占ЩٍҠЍвҠ֍Щ٠ҠЍвҠ֍Щ٠ҠЍРűŲ٠̍ЩٍҠЍҠ̠堲ӠűÍ٠ЩٍҠЍРű獪ų٠ԍƬ٠占РвѠųà卍ųРŠų 忬卍в뿍РѠųĠ덺ų ٠占ЩٍҠЍàԍРŠų卍ԠҠŠ卍àų獍ؠ堻ƍҠҠ獠РŴ卍ųààԍųĠ٠占ЩٍҠЍРű󠲠Ŵؠ岍ҠǍ٠䍠ЩٍҠЍԠЩٍҠōؠ͍¬؍ؠ͍¬؍ҠЍР占͍ƫЫƫͫؠ٠ŴŴ«卺Ŵ ¬٠䍠àŴ«占Ƭؠ፠؍Ġ堸ѠŴ 卍٠Íà𮍠؍àŴ獍ؠ卺ŵ؍¬؍ŠŵčРŶ忍ŵĠ٠ŵƠٍ¬ٍŠŵà獍ؠ栻䍠Ҡҍ؍ŵūۢҠԍŵŠ¬؍ЍҠԠàŵūЍ̠ŵŠ䍍ݢҠԍƍ¬ؠ占ƍ«̱ؠ占РŵŵРŵƠ󍍺ŵà¬ؠ占Р¬ٍŠŵ荠̍Ӡŵ 卍«̱؍Р«ٍ̱Šŵ̍Ӡŵ«̲؍Р«ٍ̲Šŵ̍Ӡŵ«̳؍Р«ٍ̳Šŵ̍Ӡŵ«̴؍Р«̴ٍŠŵ̍Ӡŵ«̵؍Р«̵ٍŠŵ̍Ӡŵ«̶؍Р«̶ٍŠŵ̍Ӡŵ«̷؍Р«̷ٍŠŵŵ «̸ٍ¬ؠ«ٍ̹«̱؍Рŵ󠳠Ŷؠ٠ŶĠ¬ٍƫؠ«ٍ̱ƫ؍٠󠣍Íà؍àŶĠᬠ獍Ġ占ЍčЫŶ٠ЩٍРԍѠŶÍР̍ŠŶٍЩ٠ؠ占«̱؍Щٍٍ¬؍ЩٍàЍŠŶ àЫŶ àЍŠŶàЫŠŶŶàؠŠ䠧ççŬ؍٠꠻占占ؠ占ҠōҠ΍ӠŶŠ퍍Ơ퍠͍Ơ􍍠ǧƫӧƫؠƫ祉ƫ٠ҠˍÍͫàĠ䠣占ٍ̠٠占ٍؠĠ፠čҠˍҠŠƠ卍ŶŠؠ占ҠǍРŠ卍堭͠٠Ͳ٠썠ƬٍҠ֠占ƬٍРѠͳРѠͳРŠͲͳٍƬ٠Ƭٍƫ占ƫؠ͠ؠƍѠͶ͵占٠ʹٍƬٍЍ͵¬ؠ䠪à͵Ѝ̠ʹ卍Ѝ«̸ؠЫ«̹؍à͠占ÍӍͶàӍ堭̱ؠ썠ҠҠ썠ÍӍ̠٠ԍٍ±ٍƬٍРѠ̱쿬򍍠ҠƠӠ±٠Ԡٍؠ²٠썠ƬٍРѠ³РѠ³РѠ³Ҡ֠؍Š̲̲ƬٍР²³٠ԲٍƬ٠Ƭٍؠ͠ؠƍѠ̱ؠ卺´؍ؠ͍Ѡ·썍¶卍٠ԍµƬٍ¶Р¬ؠ䠪Ѝà¶ٍЍŠ´̠àµ占Ӡ̱卍·¹٠ԍ¸ƬٍЍ¹¬؍à¹ٍЍ̠¸à̱͠٠Բ٠ԍÍӍ̱ؠ썠ҠҍàӍΠԠ占вԍв٠٠РѠδ荍αàРβвٍٍŠγàвγ̠àβδؠԠεв٠嬠荠Ѡη΍ƬؠҠ֍ҠΠ̠Šα荍ؠٍŠζàвζàε獍ؠԠЍӍηƬؠàԍҠ֠占Ӎ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Load * +* * +******************************** + DATE +*------------------------------- +* -- read module into memory -- +*------------------------------- + +LD_MOD LDA #0 ;reset no carrier and on error vectors + STA NOCDFLG + STA ONERRFLG + + LDX FLNAME + CPX #14 + BGE LD_MOD1 ;too long! + + INX + LDA #'.' + STA FLNAME,X ;tack on '.C' extension + INX + LDA #'C' + STA FLNAME,X + STX FLNAME + + JSR OPEN ;is there a compiled module? + BCS LD_MOD2 ;nope + + LDA MSGREF ;save msg refnum + PHA + LDA REFNUM + STA MSGREF + + LDA #0 + STA LNBUF+140 + STA LNBUF+141 + + LDX #LNBUF+128 + LDY #1 + JSR RDBLK + + LDA LNBUF+142 ;set up variable space + STA LOMEM + LDA LNBUF+143 + STA LOMEM+1 + + LDX #CODEND + LDY #128 + JSR RDBLK + + JSR CLOSE + PLA + STA MSGREF ;restore msg refnum + + LDA LNBUF+140 ;is first i/d byte ok? + CMP #'G' + BNE LD_MOD2 ;nope, compile + + LDA LNBUF+141 ;is second i/d byte ok? + CMP #'S' + BNE LD_MOD2 ;nope, compile + + RTS ;and we are done! + +LD_MOD1 LDX #badfn ;illegal filename (>14 chars) + JMP BADERR + +LD_MOD2 LDX FLNAME ;change name back to source + LDA #'S' + STA FLNAME,X ;'.S' for source + JSR OPEN ;open source file + BCS LD_MOD1 ;opps, problem + + JSR RDLNSET ;setup for rdline + LDA #>CODEND ;point to module space + STA TEMP+1 + LDA #LBLTAB + STA :STATE4B+2 ;changes code +:STATE4B LDA LBLTAB,Y ;*** self-modified + INC :STATE4B+2 ;changes code + STA LNBUF,X ;save data + INX + TXA + AND #%00001000 ;have we done 8 yet? + BEQ :STATE4B ;nope + + INY ;ready for next + CLC + TXA + ADC #8 ;add it up. + TAX + BCC :STATE4A ;keep going + + LDX #-1 ;start at beginning of table +:STATE5 INX + LDA LBLTAB,X + BNE :STATE5D + JMP :STATE6 ;are we done? + +:STATE5D LDY #-1 +:STATE5F INY + LDA SYMTAB,Y + BNE :STATE5C ;keep checking + + TXA + PHA + LDX #lblnf ;label not found + JSR ERROR + PLA + TAX + LDA #>LBLTAB + STA :STATE5E+2 ;start at first char + LDA #"[" + JSR COUT + +:STATE5E LDA LBLTAB,X + PHP + JSR COUT ;print char + INC :STATE5E+2 ;get ready for next + PLP + BPL :STATE5E ;loop until finished + + LDA #"]" + JSR COUT + LDA #NOLBLDEF + STA LBLTAB+L1,X ;address into table + JMP :STATE5 + +:STATE5A JMP :STATE5F ;extension from branches + +:STATE5C LDA LBLTAB,X ;check each byte + CMP SYMTAB,Y + BNE :STATE5A ;opps, no match + ASL + BCS :STATE5B ;high bit means were done + + LDA LBLTAB+L1,X + CMP SYMTAB+L1,Y + BNE :STATE5A + ASL + BCS :STATE5B + + LDA LBLTAB+L2,X + CMP SYMTAB+L2,Y + BNE :STATE5A + ASL + BCS :STATE5B + + LDA LBLTAB+L3,X + CMP SYMTAB+L3,Y + BNE :STATE5A + ASL + BCS :STATE5B + + LDA LBLTAB+L4,X + CMP SYMTAB+L4,Y + BNE :STATE5A + ASL + BCS :STATE5B + + LDA LBLTAB+L5,X + CMP SYMTAB+L5,Y + BNE :STATE5A + ASL + BCS :STATE5B + + LDA LBLTAB+L6,X + CMP SYMTAB+L6,Y + BNE :STATE5A + ASL + BCS :STATE5B + + LDA LBLTAB+L7,X + CMP SYMTAB+L7,Y + BNE :STATE5A + +:STATE5B LDA SYMTAB+L8,Y + STA LBLTAB,X ;copy label address + LDA SYMTAB+L9,Y + STA LBLTAB+L1,X + JMP :STATE5 + +*------------------------------- +* ----- pass 3 ----- +*------------------------------- + +:STATE6 LDX #128 ;start counters + LDY #0 +:STATE6D LDA LBLTAB,Y + STA LNBUF+8,X ;move first address + LDA LBLTAB+L1,Y + STA LNBUF+9,X + INY ;inc address # + CLC + TXA + ADC #16 ;move dest pointer + TAX + BCC :STATE6D ;more data, keep going + + LDA #CODEND + STA TEMP+1 + +:STATE6A LDY #0 + LDA (TEMP),Y + CMP #QUIT + BEQ :STATE6C + + CMP #LABEL + BNE :STATE6B + + INY + LDA (TEMP),Y ;get label address + TAX ;and insert into code + LDA LBLTAB+L1,X + STA (TEMP),Y + DEY + LDA LBLTAB,X + STA (TEMP),Y + + INC TEMP + BNE :STATE6B ;inc pointers + INC TEMP+1 + +:STATE6B INC TEMP + BNE :STATE6A + INC TEMP+1 + BNE :STATE6A + +:STATE6C LDX FLNAME ;add '.C' back on + LDA #'C' + STA FLNAME,X + + LDY #a2obj ;user defined filetype + LDA #>comfile + LDX #LNBUF+128 + LDY #1 + JSR WRBLK + + SEC + LDA LOMEM+1 + SBC #>CODEND ;find # of pages in module + ASL ;multiply by 2 into blocks + TAY + INY ;add in extra page just in case + INY + + LDX #CODEND + JSR WRBLK + + JSR CLOSE ;finish up + PLA + STA MSGREF ;and restore + +:STATE6E LDX #compwipe + JSR PRCMPMSG + JMP PAUSE ;were done + +*------------------------------- +* ----- add to symbol table ---- +*------------------------------- + +ADD_SYM LDY #-1 +:ADD_SM2 INY ;find last char of label + LDA LNBUF,Y + JSR CONV ;convert to uppercase + STA LNBUF,Y + CMP #' ' + BEQ :ADD_SM3 + CMP #':' + BEQ :ADD_SM3 + CMP #cr + BNE :ADD_SM2 + +:ADD_SM3 DEY + LDA LNBUF,Y ;set high-bit of last char + ORA #hibit + STA LNBUF,Y + + LDA LNBUF+7 ;mark last char just in case + ORA #hibit + STA LNBUF+7 + + LDX SYMNUM ;check for overflow + CPX #$FF + BEQ :ADD_SM6 + + LDA #>SYMTAB + STA :ADD_SM5+2 ;set up table + LDY #-1 +:ADD_SM4 INY + LDA LNBUF,Y + PHP +:ADD_SM5 STA SYMTAB,X ;*** self-modified *** + INC :ADD_SM5+2 + PLP + BPL :ADD_SM4 ;loop until done + + LDA TEMP + STA SYMTAB+L8,X ;save label location + LDA TEMP+1 + STA SYMTAB+L9,X + INC SYMNUM ;add to table + CLC + RTS + +:ADD_SM6 SEC ;symbol tabel overflow + RTS + +*------------------------------- +* ----- add to label table ----- +*------------------------------- + +ADD_L12 LDX #nosymbol + JSR SHERR ;missing symbol + SEC + RTS + +ADD_LBL LDY LNCNT + DEY +:ADD_LB1 INY + LDA LNBUF,Y + CMP #cr + BEQ ADD_L12 ;eol?, opps, error + + JSR TST_ALF ;gobble until a legal char + BCS :ADD_LB1 + STY LNCNT ;save new location + DEY + LDX #8 +:ADD_LB2 INY ;find last char of label + LDA LNBUF,Y + CMP #' ' + BEQ :ADD_LB3 + CMP #':' + BEQ :ADD_LB3 + CMP #cr + BEQ :ADD_LB3 + + JSR CONV ;convert to upper + DEX + BNE :ADD_L2A + + ORA #hibit ;always fix 8th char +:ADD_L2A STA LNBUF,Y + JMP :ADD_LB2 + +:ADD_LB3 STY LNCNT2 ;save new line count + DEY + LDA LNBUF,Y ;set high-bit of last char + ORA #hibit + STA LNBUF,Y + + LDX LBLNUM ;check for overflow + CPX #$FF + BEQ ADD_L11 + + LDX #-1 ;go through and add to table +:ADD_LB4 INX + CPX LBLNUM + BEQ :ADD_LB7 ;add new label + + LDA #>LBLTAB + STA :ADD_LB6+2 ;set up table + + LDY LNCNT +:ADD_LB5 LDA LNBUF,Y +:ADD_LB6 CMP LBLTAB,X ;*** self-modified *** + PHP + INC :ADD_LB6+2 + INY + PLP + BNE :ADD_LB4 + + ASL ;put high-bit into carry + BCC :ADD_LB5 ;loop until done + BCS :ADD_L10 ;we already have label in table + +:ADD_LB7 LDA #>LBLTAB + STA :ADD_LB9+2 ;move label into new location + LDY LNCNT +:ADD_LB8 LDA LNBUF,Y + PHP +:ADD_LB9 STA LBLTAB,X + INC :ADD_LB9+2 + INY + PLP + BPL :ADD_LB8 + + INC LBLNUM ;increment count +:ADD_L10 LDY LNCNT2 + STY LNCNT + TXA ;return label number + CLC + RTS + +ADD_L11 LDX #symfull + JSR SHERR + SEC ;symbol tabel overflow + RTS + +*------------------------------- +* ----- get a token ----- +*------------------------------- + +TOKEN LDA #SYMTXT + STA TEMP2+1 + LDY #0 + STY TOKTYP ;start token count + BEQ :TOKEN4 ;try and find a match + +:TOKEN1 INC TOKTYP ;try next token +:TOKEN2 LDA (TEMP2),Y + INY + BNE :TOKEN3 + + INC TEMP2+1 +:TOKEN3 ASL ;put into carry + BCC :TOKEN2 ;was high bit set? + +:TOKEN4 LDX LNCNT ;get line offset +:TOKEN5 LDA (TEMP2),Y ;were done, no match + BEQ :TOKEN7 + + STA PRN + LDA LNBUF,X ;check it + JSR CONV + EOR PRN ;match bits + ASL ;move bit 7 + BNE :TOKEN1 ;no match + + INX ;increment pointers + INY + BNE :TOKEN6 + INC TEMP2+1 + +:TOKEN6 BCC :TOKEN5 ;keep checking + + STX LNCNT ;save new text pointer + LDA TOKTYP + RTS + +:TOKEN7 LDA LNBUF,X ;get char + INC LNCNT + JSR CONV ;make uppercase + ORA #hibit + RTS diff --git a/Source/Acos/MATH.S b/Source/Acos/MATH.S index adf16da..7ddc2f6 100644 --- a/Source/Acos/MATH.S +++ b/Source/Acos/MATH.S @@ -1 +1,337 @@ -Ǎ Ӯ ōӠ« ҠȠ Íà  䍠؍à«РȠ  « 占ҠȠ Íà  ؍à«Ƞؠ ٠٠ Ӎ ԠҠ֠ 䍠Ҡ̰ 󍪭IJؠԍԫ̠ijؠ獠РҠ ijԠ΍̠ȍҠРȍ֠Ҡ  Π Ҡӱ 占ؠ ҠͰ ҠΠ ΍« Ҡӱ ؠ  «Ӎ 卪̰ԍԫԫؠ̱Ҡ«Ҡ  à̲ÍàԍԠ 򍍠àԫԫ 򍍠àԫԫ̲̠ ̠̠؍Š̱Ӎ 卪ĠҠֱ 占РIJĠҠֱ 占Π ԍΫԫРIJ ֱҠ֍«ѠֵΠ ΫÍؠֲ̠ ̠̠΍̠ΫÍΠ àٍΫà«àֳ 􍍠٠Π 占Ϋֳ؍Šֲ̠ ̠ԍԫӍֵؠ Рҍ 卪ӠҠǍҠ  Ҡӱ РȠ ӱР̠Ӳ 덍Ҡؠ 占Ҡ؍ŠӲ ÍàӲӍ ѠҠԠ 썠ҠэРčԠҠԠ 썠ҠѠ 썠ҠԍРčԠҠԠ ҠԍҠԍРčԠҠԠ ҠԍҠԍРčѠҠԠ 썠ҠԍҠԠ ҠԍРčѠҠԠ 썠ҠԍҠԠ ҠԍРčĠҠԠ Ġ؍«ĠРčҠҠԠ ؍«РčҠҠԠ Ҡ؍«ҠРčԠ  « 捠ҠȍӍԠҠ «Ҡ«ӍĠؠ ٠٠Ӎ ѠؠРŠѰ«РŠѰ؍ѰӍԠؠ«РԠ԰ŠԱРѠ԰Ԡ԰Ա؍԰ӍԠؠР«Ԡ԰ŠԱРѠ԰Ԡ԰Ա؍԰ӍԠ Ҡ؍Ӎ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Math * +* * +******************************** + DATE +*------------------------------- + +DO_PLUS LDA NUMB+1 ;save old number + PHA + LDA NUMB + PHA + JSR INPMATH ;get next part + CLC + PLA + ADC NUMB ;do add + TAX + PLA + ADC NUMB+1 + JMP DO_MATH ;finish up + +DO_SUB LDA NUMB+1 ;save initial value + PHA + LDA NUMB + PHA + JSR INPMATH ;get other amount + SEC + PLA + SBC NUMB ;do actual subtraction + TAX + PLA + SBC NUMB+1 + +DO_MATH STX DATA+1 ;save result + STA DATA+2 + LDY #1 + STY DATA ;set data type 1 + RTS + +*------------------------------- +* do multiply +*------------------------------- + +DO_MULT JSR DO_MLDV ;command mult/divd + JSR DO_MUL0 ;do multiply + +*------------------------------- +* finish up routine for signed operands +*------------------------------- + +DO_MLD2 LDX RESULT + LDA RESULT+1 + BPL :DO_MLD3 + + LDX #num2big + JMP BADERR ;overflow > 32767 + +:DO_MLD3 BIT SIGN + BPL DO_MATH + + JSR NEGXA + JMP DO_MATH + +DO_MLDV JSR GETNUMB ;get first number + STA SIGN ;save this sign + JSR DO_ABS1 ;make it positive + STX DATA+1 ;save it + STA DATA+2 + + JSR INPNUM0 ;get next number + EOR SIGN ;make into result sign + STA SIGN + LDA NUMB+1 ;get this sign + JSR DO_ABS1 ;make this positive too + STX NUMB ;save it + STA NUMB+1 + RTS + +*------------------------------- +* actual multiply routine +*------------------------------- + +DO_MUL0 LDA #0 + STA RESULT + STA RESULT+1 + STA RESULT+2 + STA DATA+3 + LDX #16 +:DO_MUL1 LSR NUMB+1 + ROR NUMB ;put bit 0 into carry + BCC :DO_MUL2 + + CLC + LDA DATA+1 + ADC RESULT + STA RESULT ;add in multiplyer + + LDA DATA+2 + ADC RESULT+1 + STA RESULT+1 ;add in multiplyer + + LDA DATA+3 + ADC RESULT+2 + STA RESULT+2 + +:DO_MUL2 ASL DATA+1 ;multiply all 16 bits + ROL DATA+2 + ROL DATA+3 + DEX + BNE :DO_MUL1 + RTS + +*------------------------------- +* divide routine +*------------------------------- + +DO_DIVD JSR DO_DIV1 ;do divide + JMP DO_MLD2 + +DO_MOD JSR DO_DIV1 ;do divide + LDA REMAIN ;get remainder + STA RESULT + LDA REMAIN+1 + STA RESULT+1 + JMP DO_MLD2 ;finish up + +DO_DIV1 JSR DO_MLDV + LDA NUMB + ORA NUMB+1 + BEQ :DO_DIV5 + + LDA #0 + STA REMAIN ;clear remainder + STA REMAIN+1 + CLC + + LDX #16 +:DO_DIV2 ROL DATA+1 ;shift up the carry bit + ROL DATA+2 + ROL REMAIN + ROL REMAIN+1 + + SEC + LDA REMAIN ;check for remainder > divisor + SBC NUMB + TAY + LDA REMAIN+1 + SBC NUMB+1 + BCC :DO_DIV3 ;nope, skip subtract + + STY REMAIN ;allow subtract to take place + STA REMAIN+1 + +:DO_DIV3 DEX + BNE :DO_DIV2 + + ROL DATA+1 ;shift in quotent + ROL DATA+2 + + LDA DATA+1 + STA RESULT + LDA DATA+2 + STA RESULT+1 + RTS + +:DO_DIV5 LDX #divby0 ;division by zero + JMP BADERR + +*------------------------------- +* absolute value +*------------------------------- + +DO_ABS JSR INPARG + JSR GETNUMB ;get number + JSR DO_ABS1 ;get abs + JMP DO_MATH ;finish up + +DO_ABS1 CMP #0 + BPL DO_ABS2 ;if it is already ok + +NEGXA PHA + TXA + EOR #-1 + TAX ;make positive + PLA + EOR #-1 + + INX + BNE DO_ABS2 ;and add 1 + + CLC + ADC #1 +DO_ABS2 RTS + +*------------------------------- +* ----- compare routines ------- +*------------------------------- + +CP_EQ JSR CP_ST ;compare for equal + JSR CMPEQ + JMP CP_END + +CP_NOT JSR CP_ST ;compare if not equal + JSR CMPEQ ;just inverse compare equal + JSR INVERT + JMP CP_END + +CP_LT JSR CP_ST ;compare if less than + JSR CP_LTGT + JSR CMPLT + JMP CP_END + +CP_GT JSR CP_ST ;compare if greater than + JSR CP_LTGT + JSR CMPGT + JMP CP_END + +CP_LTEQ JSR CP_ST ;compare if less than or equal + JSR CP_LTGT + JSR CMPGT ;just inverse compare greater than + JSR INVERT + JMP CP_END + +CP_GTEQ JSR CP_ST ;compare if greater than or equal + JSR CP_LTGT + JSR CMPLT ;just inverse compare less than + JSR INVERT + JMP CP_END + +CP_AND JSR CP_ST ;'and' 2 numbers + LDA NUMB + AND DATA+1 + TAX + LDA NUMB+1 + AND DATA+2 + JMP CP_END + +CP_OR JSR CP_ST ;'or' 2 numbers + LDA NUMB + ORA DATA+1 + TAX + LDA NUMB+1 + ORA DATA+2 + JMP CP_END + +CP_EOR JSR CP_ST ;'eor' 2 numbers + LDA NUMB + EOR DATA+1 + TAX + LDA NUMB+1 + EOR DATA+2 + JMP CP_END + +CP_ST LDA NUMB ;compare start + PHA + LDA NUMB+1 ;just save stuff + PHA + JSR INPMATH + PLA + STA DATA+2 + PLA + STA DATA+1 + RTS + +CP_LTGT LDA DATA+2 + EOR #hibit ;invert sign bits of numbers + STA DATA+2 + LDA NUMB+1 + EOR #hibit + STA NUMB+1 + RTS + +CP_END STX DATA+1 + STA DATA+2 ;save result + LDY #1 + STY DATA + RTS + +*------------------------------- +* ----- logic operations ------- +*------------------------------- + +CMPEQ LDX #0 + LDA NUMB + CMP DATA+1 + BNE :CMPEQ0 + + LDA NUMB+1 + CMP DATA+2 + BNE :CMPEQ0 + + INX + +:CMPEQ0 LDA #0 + RTS + +CMPLT LDX #0 + LDA NUMB+1 + CMP DATA+2 + BLT :CMPLT0 + BNE :CMPLT1 + + LDA NUMB + CMP DATA+1 + BEQ :CMPLT0 + BLT :CMPLT0 + +:CMPLT1 INX + +:CMPLT0 LDA #0 + RTS + +CMPGT LDX #0 + LDA DATA+2 + CMP NUMB+1 + BLT :CMPGT0 + BNE :CMPGT1 + + LDA DATA+1 + CMP NUMB + BEQ :CMPGT0 + BLT :CMPGT0 + +:CMPGT1 INX + +:CMPGT0 LDA #0 + RTS + +INVERT PHA ;change bit 0 + TXA + EOR #1 + TAX + PLA + RTS + + diff --git a/Source/Acos/OLD/ACOS.LOAD.OLD.S b/Source/Acos/OLD/ACOS.LOAD.OLD.S index 900624f..2cd3859 100644 --- a/Source/Acos/OLD/ACOS.LOAD.OLD.S +++ b/Source/Acos/OLD/ACOS.LOAD.OLD.S @@ -1 +1,876 @@ - 捠퍍砤ፍ氰㵸氍㲲䳵㰰尰池 ፠𫱍ፍᠣ堻 占ᠣ占𫱍ᠣ 𲍠ᠣ𲫱 ᠨ 占ᠨ𲩬卍𫱠 占𲫱卍፠𫱠 ፠ 卍ܠ 卍򍍻 ᠤ㳰⍠𠣱߲ᠤ㳰㍠𠣤߱ᠤ㰵㍠߲߱𠣤߲ᠣᠤⲍ߲ᠣ ᠤᠤᠣᠤᠣᠤ堻  㠧 㠧 ֲ 㠧 㠧 ̦ 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 Ӻ 㠧 Ӯ 㠧 鍠⠤㷠 栻 􍍠ᠤ泰 덠鍠⠤㵠 占 䠣捠 ᠣ 荠鍠⠤㶠 沠砻 􍍠ᠤ𠣧 迍沠 卍 荍鍠⠤㶠 ᠣᠤ湴頻 ⠤㍠卍鍠⠤㸠 占 퍠䫱鍠⠤ᠻ ꍠ䍍鍠⠤㠻 占卍  뿍𠣱堻 卍𫱍 𠣲崍 ꫲ 占ꫳ𫱍㠧 ۧᠨ岠ᠨ 占ᠣ岍 獠㠧ݺ  򿍠崠 򿍠堻 ፠峠歱 占ᠨ峍ᠠ 荠ᠨ堻 덍崠ꫲꫳ 䍍ᠣᠻ 占﫱ᠣ፠﫲鍠⠤㴠 덍㠧 ŧ䬰獍 󮍻 宍㠧Ӻ䍠㠧 Ӯ鍠⠤㷠 籠 忍䠣粠 卍籠 獍粠頻 ⠤㸍 퍠櫱򫱍󫱍頻 ⠤፠捍頻 ⠤占󍍠 䍠󫱍 덍ᠣ櫴 捠ᠣ櫴𫱍頻 덠⠤፠𱠻 򍍠 󿍠𲠻 卍 𵠻 忍﫤𳠻 卍󫱠 荠﫤𳠻 卍荍ᠨ 占䠣捠ᠨ 捠𲍠ፍ𵍍 𴍠󫱍𫱠 䍍ᠻ 荠፠ 占荍ᠣ 荠負ᠨ 占𲍠貍ᠣç 㧍堻 荍𲠻 荠𠣳 忍𵠻 卍ᠨ 󧍠𠣧ӧ𵍍ᠨ 󧍠𠣧𵍍𫱍 占䍍 占﫱𫱍﫲ᠣ 頻 ⠤㴍𵠻 򍍠﫵 ᠻ 썍ᠣ﫵 卍ᠣ 頻 ⠤㳍ᠨ Íᠣçᠨ𫱍 䍍ᠨ Ӎᠣӧᠨ頻 占⠤㱍썍 卍㍠ 﫤𫱍㠣𫱍 덠﫤𶠻 덍𲠻 덍ᠣ 덍ᠣ嫱頻 占⠤㍠卍ᠤ㰰 忍𠣤ᰍ㠻 卍ᠣᠤᠤᠣᠤᠣᠤ堻 㠧 ź䬰 捠ᠣ捠蠻 卍 º櫱ᠣ櫱蠻 卍栻 荠  荍櫱 忍 㠧 捠櫱ᠣ櫱 卍㠧 櫱櫱ᠣ櫱 卍栻 占ᠣ捠荍㠧 捠櫱ᠣ櫱 卍櫱ᠣ櫱 占荍栻 荠 荍 忍櫱 㠧 櫱櫱ᠣ櫱㠧 ŧ䬰䍠㠧 ᠣᠤ湴 鍠⠤㠻 堻 󍍠꫶꫷𫱍𩠻 獍 ᠣᠤᠣᠤᠣ ᠤᠣᠤ堻 ᠠ 獠፠ 占򳍠 占ᠨᠣ𠣢 뿍ᠻ 占ᠣ ፠򲠻 獍 򴍠  㠧 Ů䳵𠣤䍠򲍠󍍍  占 ᠤᠤᠤᠤᠤ㠠 ⍠㠣ᠤ㲲 ᠣ䍠氠 ᠨ 荠䲠ᠨ 占ᠣ氍䲍⠰⠱⠰⠱ ٍ 獠፠ 荠ᠨ ፠ᠣ氍򲠻 獠󍍍 𫱍岠 峠 䍍፠㍠ 岍峠 荠𲠻 򍍠崠ᠨ 𲠻 荠崍󍍍 鍠⠤㸠  卍嫱頻 占⠤㍠󠠻 썍堻 󧍠ᠣӧ鍠⠤㰠 占 􍍠鍠⠤㸠 占 퍠䫱嫱鍠⠤ᠻ 占䍍鍠⠤㠻 占卍鍠⠤㸠 占 占嫱嫱䫶 荠嫴䫷嫵鍠⠤⠻ 卍頻 ⠤㍠占󠠻 卍 ⠷占⠤㳍⠤⠱⠳捠⠰⠳占汍⠰⠳汍⠰⠴⠰⠴⠰捠⠴⠰捠⠴⠰捠⠱⠰⠤፠⠰⠰⠰⠱卍⠲⠰⠤⠱⠱⠲⠰ ⠳占池 ⠰⠴⠰ꍠ⠱⠰⠸㠧꧍捍䍍 \ No newline at end of file +******************************** +* * +* ACOS Loader Version 2.0 * +* * +******************************** + +*------------------------------- +* Date: 12/21/86 +*------------------------------- + typ $ff + dsk acos.system + + org $2000 + +cr equ $0d +lf equ $0a + +mli equ $bf00 +home equ $fc58 +cout equ $fdf0 +vtab equ $fc22 +inpln equ $fd6f +rdkey equ $fd35 + +lnbuf equ $0200 +flname equ $0300 +acosobj equ $0800 +drivea equ $0815 + +dirinfo equ $5c00 +dirbuf equ $5e00 +prefix equ $6000 +flbuf equ $6100 +flbuf1 equ $6500 + +runadr equ $6900 + +temp equ $00 +temp2 equ $02 +numfls equ $04 +blkcnt equ $06 +prn equ $08 + +; relocate code up to $800 + + lda temp ; save startup bytes + pha + lda temp+1 + pha + + lda #objcode + sta temp+1 + + lda #runadr + sta temp2+1 + + ldx #$10 ; move $10 pages + ldy #0 +domove lda (temp),y ; move a byte + sta (temp2),y + iny + bne domove + + inc temp+1 ; go to the next page + inc temp2+1 + dex + bne domove + + pla + sta startup+1 ; save startup bytes + pla + sta startup + jmp runadr ; execute code + + ds \ ; fill space + +objcode org runadr + +; set to normal 40 col text mode +init lda $c30b + cmp #1 + bne init_2 + + lda $c30c + cmp #$82 + bne init_1 + + lda $c058 + clc + bcc init_2 + +init_1 cmp #$87 + bne init_2 + + lda #0 + sta $c0b2 + +init_2 lda #0 ; reset screen + sta $20 + sta $22 + lda #40 + sta $21 + lda #24 + sta $23 + + jsr home ; clear screen + jsr pr ; show main screen + asc '########################################' ; 1 + asc '# ACOS LOADER V2.1 # ACOS FILES #' ; 2 + asc '# COPYRIGHT 1986-90 ####################' ; 3 + asc '# L&L PRODUCTIONS # #' ; 4 + asc '##################### #' ; 5 + asc '# FILENAMES # #' ; 6 + asc '##################### #' ; 7 + asc '# # #' ; 8 + asc '# ####################' ; 9 + asc '# # DELETED FILES #' ; 10 + asc '# ####################' ; 11 + asc '# # #' ; 12 + asc '# # #' ; 13 + asc '# # #' ; 14 + asc '# # #' ; 15 + asc '# ####################' ; 16 + asc '# # STARTUP SEGMENT #' ; 17 + asc '# ####################' ; 18 + asc '# # #' ; 19 + asc '########################################' ; 20 + asc '# STATUS: #' ; 21 + asc '# LOADING ACOS.OBJ #' ; 22 + asc '########################################',00 ; 23 + + jsr mli + db $c7 ; get prefix + dw p_pfx + + lda prefix + bne gotdef ; we have a default + + lda $bf30 ; save currently used disk + sta p_onln+1 + + jsr mli + db $c5 ; get the online volume + dw p_onln + + lda prefix+1 ; get rid of drive specifier + and #$0f + tax + inx ; add 1 for '/' + stx prefix + + lda #'/' ; put in leading slash + sta prefix+1 + + jsr mli + db $c6 ; set the prefix + dw p_pfx + +gotdef ldx $280 ; get length of path +gotdef2 dex + beq loadg ; we have the path set + + lda $280,x + cmp #'/' ; find path? + bne gotdef2 ; nope + + stx $280 ; set new length + + jsr mli + db $c6 ; set prefix + dw p_pfx2 + +loadg lda #0 + sta $bf94 + jsr mli ; close ALL open files + db $cc + dw r_close + + jsr mli + db $c8 ; open a file + dw r_open + + lda r_open+5 ; move refnum + sta r_read+1 + + jsr mli + db $ca ; read in acos.obj + dw r_read + + jsr mli + db $cc ; close file + dw r_close + +; check for turnkey run + lda startup ; is first i/d byte ok? + cmp #1 + bne sname ; nope + + lda startup+1 + sta startup ; make sure they dont match again + cmp #2 + beq sname4 + +; get name of starting segment +sname lda acosobj+2 ; point to filename + sta temp + lda acosobj+3 + sta temp+1 + + jsr prstat + asc 'SOURCE MODULE [',00 + ldy #0 + lda (temp),y + + tax +sname2 iny + lda (temp),y ; print filename + ora #$80 + jsr cout + dex + bne sname2 + + jsr pr ; finish off string + asc ']: ',00 + + jsr inpln + cpx #0 ; cr? + beq sname4 ; yep + cpx #14 ; 14 or over? + bcs sname ; yep + + txa + tay +sname3 lda lnbuf-1,y ; copy filename + sta (temp),y + dey + bne sname3 + + txa ; save length + sta (temp),y + jmp sname ; go back + +sname4 ldx acosobj+2 + lda acosobj+3 ; display in window 3 + ldy #3 + jsr prwind + + lda #drivea + sta p_ginfo+2 + +chkprg jsr mli + db $c4 ; get file info + dw p_ginfo + beq docheck + + jsr prstat + asc 'INSERT SYSTEM DISK INTO OTHER DRIVE',0d,00 + jsr getcr + jmp chkprg + +; get a directory and look for ".s" files. +; if any exist, check to see if they have +; been changed. If so, kill the ".c" file. + +docheck jsr prstat + asc 'STATUS:',0d + asc ' CHECKING FILES...',00 + +logprg jsr mli + db $c7 ; get the current prefix + dw p_pfx + + ldy drivea +logprg1 lda drivea,y ; are these 2 paths the same? + eor prefix,y + and #%11011111 + bne logprg2 ; nope + + dey + bne logprg1 ; keep checking + +logprg2 jsr mli ; open the current prefix + db $c8 + dw p_open + + lda p_open+5 ; get refnum + sta p_rdinf+1 + sta p_rddir+1 + sta p_pos+1 + + jsr mli ; read dir info + db $ca + dw p_rdinf + + jsr mli ; set to byte 0 + db $ce + dw p_pos + + ldx #0 + stx numfls ; 0 files processed + stx numfls+1 + dex + stx blkcnt ; start at file 1 in block + +rdloop lda #dirbuf+4 + sta temp+1 + + jsr mli ; read block + db $ca + dw p_rddir + bne rdloop1 ; opps, error + + lda blkcnt ; first pass? + bpl rdloop2 ; nope + + inc blkcnt ; set to 0 + jmp rdloop5 ; go to next entry + +rdloop2 lda numfls ; we done? + cmp dirinfo+$25 + bne rdloop3 ; nope + + lda numfls+1 ; check high + cmp dirinfo+$26 + bne rdloop3 ; were done + +rdloop1 jmp finish + +rdloop3 ldy #0 + lda (temp),y ; get length and type + and #$0f + sta (temp),y ; get rid of extra stuff + sta temp2 + bne rdlp3a + + jmp rdloop5 + +rdlp3a inc numfls ; inc file count + bne rdloop4 + inc numfls+1 + +rdloop4 ldx temp + lda temp+1 ; display filename in window 0 + ldy #0 + jsr prwind + + ldy drivea ; get length of path + tya + tax ; save length +mvpath lda drivea,y + sta flname,y ; move pathname + dey + bpl mvpath + + lda #'/' ; add in slash + inx + sta flname,x + + ldy #0 +mvpath2 inx + iny + lda (temp),y ; get name of file + sta flname,x + cpy temp2 + bne mvpath2 + + lda #'C' ; make into '.c' + sta flname,x + stx flname ; update length + + lda temp2 ; get length + cmp #3 ; is it a possible '.s' file? + bcc rdloop5 ; nope + + tay + lda (temp),y ; check for 's' in '.s' + cmp #'S' + bne rdloop5 + + dey + lda (temp),y ; check for '.' in '.s' + cmp #'.' + bne rdloop5 + +rdloop4c ldx temp + lda temp+1 + ldy #1 ; display .s source file + jsr prwind + + lda temp ; point at filename + sta p_ginfo+1 + sta p_open2+1 + lda temp+1 + sta p_ginfo+2 + sta p_open2+2 + + lda #10 ; setup for get.info + sta p_ginfo + + jsr mli ; get file info + db $c4 + dw p_ginfo + bne rdloop5 ; hmmm, error + + lda p_ginfo+5 ; check backup bit + bne rdlop4a ; all is well + + lda #1 + sta p_ginfo+5 ; set bit in mod.time + + lda #7 ; setup for set.file.info + sta p_ginfo + + jsr mli ; set info + db $c3 + dw p_ginfo + + ldy #0 + lda (temp),y ; change file into .C + tay + lda #'C' + sta (temp),y + + ldx temp + lda temp+1 + ldy #2 ; display in window 2 + jsr prwind + + ldy #0 + lda (temp),y + tay ; change file back to .S + lda #'S' + sta (temp),y + + jsr mli ; delete '.c' file + db $c1 + dw p_del + +rdlop4a jsr flcopy ; copy over the file + +rdloop5 clc + lda temp ; go to next entry + adc dirinfo+$23 + sta temp + lda temp+1 + adc #0 + sta temp+1 + + inc blkcnt ; inc place within block + lda blkcnt + cmp dirinfo+$24 + beq rdloop6 ; go to next block + + jmp rdloop2 ; do next entry within this block + +rdloop6 lda #0 ; reset count + sta blkcnt + jmp rdloop ; do another block + +finish lda #0 + sta p_close+1 + + jsr mli ; close file + db $cc + dw p_close + + lda $c000 ; did they want to pause? + cmp #$a0 + beq wait2c ; yep, wait to see + + jmp exeacos + +wait2c lda #1 + sta $20 + sta $22 + lda #38 + sta $21 + lda #22 + sta $23 + jsr home ; clear screen + jsr pr + db cr + asc ' MAKE SURE THESE DISKS ARE IN PLACE:',0d,00 + + + ldy #0 ; move A: + ldx #lnbuf + jsr movpath ; move pathname + + ldy #1 ; move B: + ldx #lnbuf+128 + jsr movpath ; move pathname + + ldy lnbuf ; get pathname length + iny +show2 dey ; count down + bmi show3 ; they match + + lda lnbuf,y + cmp lnbuf+128,y ; are they the same? + beq show2 ; yep + + jsr pr + db cr + asc ' BOOT DISK -- ',00 + ldy lnbuf + ldx #lnbuf+1 + jsr prstr ; show pathname + +show3 jsr pr + db cr + asc ' SYSTEM DISK -- ',00 + ldy lnbuf+128 + ldx #lnbuf+129 + jsr prstr ; show pathname + + ldy #5 + ldx #lnbuf + jsr movpath + + jsr pr + db cr + asc ' BULLETIN DISK -- ',00 + ldy lnbuf + ldx #lnbuf+1 + jsr prstr ; show pathname + + ldy #6 + ldx #lnbuf+128 ; move pathname + jsr movpath + + ldy lnbuf ; get length of path + iny +show4 dey + bmi show5 ; the path's match + + lda lnbuf,y ; are they the same? + cmp lnbuf+128,y + beq show4 ; yep + + jsr pr + db cr + asc ' MAIL DISK -- ',00 + ldy lnbuf+128 + ldx #lnbuf+129 + jsr prstr + +show5 jsr pr + db cr,cr + asc ' ONCE THESE DISKS ARE IN PLACE',0d,0d + asc ' ',00 + jsr getcr + +exeacos lda #0 + sta $bf94 ; set level to 0 + + jsr mli + db $cc ; close all open files + dw r_close ; specifically EXEC files + + lda acosobj+6 + sta temp + lda acosobj+7 + sta temp+1 + jmp (temp) ; start acos running + + +; sub-routines +; print a line of status +prstat lda #2 + sta $20 + lda #36 + sta $21 + lda #20 ; set window + sta $22 + lda #22 + sta $23 + jsr home ; clear window + +pr pla ; point to string + sta prn + pla + sta prn+1 + +pr2 inc prn ; get next byte + bne pr3 + inc prn+1 + +pr3 ldy #0 ; get byte + lda (prn),y + ora #$80 + cmp #"#" ; inverse block? + bne pr3a ; nope + lda #$20 + +pr3a jsr cout ; print + asl a + bne pr2 ; keep going + + inc prn ; make into correct address + bne pr4 + inc prn+1 + +pr4 jmp (prn) ; return + + +; get a return +getcr jsr pr + asc 'PRESS [RETURN] TO CONTINUE...',00 +getcr2 jsr $fd35 + cmp #$8d + bne getcr2 + rts + + +; print a filename within a window +prwind stx prn ; point to filename + sta prn+1 + lda wndlft,y ; define text window + sta $20 + sta $24 + lda wndrgt,y + sta $21 + lda wndtop,y + sta $22 + lda wndbtm,y + sta $23 + sec ; make into vtab + sbc #1 + sta $25 + jsr $fc22 ; vtab down + lda #$8d + jsr $fdf0 ; scroll down + + ldy #0 + lda (prn),y ; get filename length + tax +prwind2 iny + lda (prn),y ; print name + ora #$80 + jsr $fdf0 + dex + bne prwind2 + rts + +wndlft db 02,22,22,22 +wndrgt db 16,16,16,16 +wndtop db 07,03,11,18 +wndbtm db 19,08,15,19 + + +; print a string pointed to by X & A, length Y +prstr stx prn + sta prn+1 ; point at string + tya + tax ; save length + ldy #0 +prstr2 lda (prn),y ; get data + ora #$80 + jsr $fdf0 + iny + dex + bne prstr2 ; do entire string + rts + + +; move a pathname into a buffer +movpath stx temp ; point to buffer + sta temp+1 + + ldx #0 +move2 dey ; count down + bmi move3 ; all finished + + txa + sec + adc drivea,x ; add in next offset + tax + jmp move2 + +move3 lda drivea,x ; get path length + sta temp2 ; save as counter + + ldy #0 +move4 lda drivea,x + sta (temp),y ; save in buffer + inx + iny + dec temp2 ; count down length + bpl move4 + rts + + +; copy over a source file +flcopy jsr mli + db $c8 ; does '.c' file exist? + dw p_open1 + bne flcopy1 ; nope, copy source + + lda p_open1+5 + sta p_close+1 + jsr mli ; close compiled file + db $cc + dw p_close +flcopy2 rts ; all is well + +flcopy1 ldx flname ; change '.c' back to '.s' + lda #'S' + sta flname,x + + jsr mli + db $c0 ; create new file + dw p_creat + bne flcopy2 ; file must already exist + + jsr mli + db $c8 ; open old file + dw p_open2 + + lda p_open2+5 ; save refnum + sta p_read+1 + sta p_close+1 + + jsr mli + db $ca ; read in file + dw p_read + + jsr mli + db $cc ; close source file + dw p_close + + jsr mli + db $c8 ; open new file + dw p_open1 + + lda p_open1+5 ; setup write routine + sta p_write+1 + sta p_close+1 + lda p_read+6 ; setup write length + sta p_write+4 + lda p_read+7 + sta p_write+5 + + jsr mli + db $cb ; write out segment + dw p_write + + jsr mli ; close file 2 + db $cc + dw p_close + rts ; we are done + + +; prodos parmlist +startup dw 0 + +p_creat db 7 + dw flname + db $c3 + db $04 + dw 0 + db 1 + dw 0 + dw 0 + +p_open db 3 + dw prefix + dw flbuf + db 0 + +p_open1 db 3 + dw flname + dw flbuf1 + db 0 + +p_open2 db 3 + dw 0 + dw flbuf1 + db 0 + +p_rdinf db 4 + db 0 + dw dirinfo + dw $0100 + dw 0 + +p_rddir db 4 + db 0 + dw dirbuf + dw $0200 + dw 0 + +p_read db 4 + db 0 + dw copybuf + dw copylen + dw $0000 + +p_write db 4 + db 0 + dw copybuf + dw copylen + dw $0000 + +p_close db 1 + db 0 + +p_ginfo db $0a + dw 0 + db 0 + db 0 + dw 0 + db 0 + dw 0 + dw 0 + dw 0 + dw 0 + dw 0 + +p_del db 1 + dw flname + +p_pos db 2 + db 0 + db $00,$00,$00 + +p_pfx db 1 + dw prefix + +p_pfx2 db 1 + dw $280 + +p_onln db 2 + db 0 + dw prefix+1 + +; data for relocated code +r_open db 3 + dw r_file + dw flbuf1 ; use last possible buffer + db 0 + +r_read db 4 + db 0 + dw acosobj + dw $6000 + dw $0000 + +r_close db 1 + db 0 + +r_file db 8 + asc 'acos.obj' + +copybuf equ * +copylen equ mli-copybuf + + end + + diff --git a/Source/Acos/OLD/ACOS.LOAD1.S b/Source/Acos/OLD/ACOS.LOAD1.S index 3c1d320..77f0cbc 100644 --- a/Source/Acos/OLD/ACOS.LOAD1.S +++ b/Source/Acos/OLD/ACOS.LOAD1.S @@ -1 +1,869 @@ - 捠퍍砤ፍ氰㵸氍㲲䳵㰰尰池 ፠𫱍ፍᠣ堻 占ᠣ占𫱍ᠣ 𲍠ᠣ𲫱 ᠨ 占ᠨ𲩬卍𫱠 占𲫱卍፠𫱠 ፠ 卍ܠ 卍򍍻 ᠤ㳰⍠𠣱߲ᠤ㳰㍠𠣤߱ᠤ㰵㍠߲߱𠣤߲ᠣᠤⲍ߲ᠣ ᠤᠤᠣᠤᠣᠤ堻  㠧 㠧 ֲ 㠧 㠧 ̦ 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 㠧 Ӻ 㠧 Ӯ 㠧 鍠⠤㷠 栻 􍍠ᠤ泰 덠鍠⠤㵠 占 䠣捠 ᠣ 荠鍠⠤㶠 沠砻 􍍠ᠤ𠣧 迍沠 卍 荍鍠⠤㶠 ᠣᠤ湴頻 ⠤㍠卍鍠⠤㸠 占 퍠䫱鍠⠤ᠻ ꍠ䍍鍠⠤㠻 占卍  뿍𠣱堻 卍𫱍 𠣲崍 ꫲ 占ꫳ𫱍㠧 ۧᠨ岠ᠨ 占ᠣ岍 獠㠧ݺ  򿍠崠 򿍠堻 ፠峠歱 占ᠨ峍ᠠ 荠ᠨ堻 덍崠ꫲꫳ 䍍ᠣᠻ 占﫱ᠣ፠﫲鍠⠤㴠 덍㠧 ŧ䬰獍 󮍻 宍㠧Ӻ䍠㠧 Ӯ鍠⠤㷠 籠 忍䠣粠 卍籠 獍粠頻 ⠤㸍 퍠櫱򫱍󫱍頻 ⠤፠捍頻 ⠤占󍍠 䍠󫱍 덍ᠣ櫴 捠ᠣ櫴𫱍頻 덠⠤፠𱠻 򍍠 󿍠𲠻 卍 𵠻 忍﫤𳠻 卍󫱠 荠﫤𳠻 卍荍ᠨ 占䠣捠ᠨ 捠𲍠ፍ𵍍 𴍠󫱍𫱠 䍍ᠻ 荠፠ 占荍ᠣ 荠負ᠨ 占𲍠貍ᠣç 㧍堻 荍𲠻 荠𠣳 忍𵠻 卍ᠨ 󧍠𠣧ӧ𵍍ᠨ 󧍠𠣧𵍍𫱍 占䍍栻 ᠨፍ 占﫱𫱍﫲ᠣ﫵 卍ᠣ 頻 ⠤㳍ᠨ Íᠣçᠨ𫱍 䍍ᠨ Ӎᠣӧᠨ頻 占⠤㱍썍 卍㍠ 﫤𫱍㠣𫱍 덠﫤𶠻 덍𲠻 덍ᠣ 덍ᠣ嫱頻 占⠤㍠卍ᠤ㰰 忍𠣤ᰍ㠻 卍ᠣᠤᠤᠣᠤᠣᠤ堻 㠧 ź䬰 捠ᠣ捠蠻 卍 º櫱ᠣ櫱蠻 卍栻 荠  荍櫱 忍 㠧 捠櫱ᠣ櫱 卍㠧 櫱櫱ᠣ櫱 卍栻 占ᠣ捠荍㠧 捠櫱ᠣ櫱 卍櫱ᠣ櫱 占荍栻 荠 荍 忍櫱 㠧 櫱櫱ᠣ櫱㠧 ŧ䬰䍠㠧 ᠣᠤ湴 鍠⠤㠻 堻 󍍠꫶꫷𫱍𩠻 獍 ᠣᠤᠣᠤᠣ ᠤᠣᠤ堻 ᠠ 獠፠ 占򳍠 占ᠨᠣ𠣢 뿍ᠻ 占ᠣ ፠򲠻 獍 򴍠  㠧 Ů䳵𠣤䍠򲍠󍍍  占 ᠤᠤᠤᠤᠤ㠠 ⍠㠣ᠤ㲲 ᠣ䍠氠 ᠨ 荠䲠ᠨ 占ᠣ氍䲍⠰⠱⠰⠱ ٍ 獠፠ 荠ᠨ ፠ᠣ氍򲠻 獠󍍍 𫱍岠 峠 䍍፠㍠ 岍峠 荠𲠻 򍍠崠ᠨ 𲠻 荠崍󍍍 鍠⠤㸠  卍嫱頻 占⠤㍠󠠻 썍堻 󧍠ᠣӧ鍠⠤㰠 占 􍍠鍠⠤㸠 占 퍠䫱嫱鍠⠤ᠻ 占䍍鍠⠤㠻 占卍鍠⠤㸠 占 占嫱嫱䫶 荠嫴䫷嫵鍠⠤⠻ 卍頻 ⠤㍠占󠠻 卍 ⠷占⠤㳍⠤⠱⠳捠⠰⠳占汍⠰⠳汍⠰⠴⠰⠴⠰捠⠴⠰捠⠴⠰捠⠱⠰⠤፠⠰⠰⠰⠱卍⠲⠰⠤⠱⠱⠲⠰ ⠳占池 ⠰⠴⠰ꍠ⠱⠰⠸㠧꧍捍䍍 \ No newline at end of file +******************************** +* * +* ACOS Loader Version 2.0 * +* * +******************************** + +*------------------------------- +* Date: 12/21/86 +*------------------------------- + typ $ff + dsk acos.system + + org $2000 + +cr equ $0d +lf equ $0a + +mli equ $bf00 +home equ $fc58 +cout equ $fdf0 +vtab equ $fc22 +inpln equ $fd6f +rdkey equ $fd35 + +lnbuf equ $0200 +flname equ $0300 +acosobj equ $0800 +drivea equ $0815 + +dirinfo equ $5c00 +dirbuf equ $5e00 +prefix equ $6000 +flbuf equ $6100 +flbuf1 equ $6500 + +runadr equ $6900 + +temp equ $00 +temp2 equ $02 +numfls equ $04 +blkcnt equ $06 +prn equ $08 + +; relocate code up to $800 + + lda temp ; save startup bytes + pha + lda temp+1 + pha + + lda #objcode + sta temp+1 + + lda #runadr + sta temp2+1 + + ldx #$10 ; move $10 pages + ldy #0 +domove lda (temp),y ; move a byte + sta (temp2),y + iny + bne domove + + inc temp+1 ; go to the next page + inc temp2+1 + dex + bne domove + + pla + sta startup+1 ; save startup bytes + pla + sta startup + jmp runadr ; execute code + + ds \ ; fill space + +objcode org runadr + +; set to normal 40 col text mode +init lda $c30b + cmp #1 + bne init_2 + + lda $c30c + cmp #$82 + bne init_1 + + lda $c058 + clc + bcc init_2 + +init_1 cmp #$87 + bne init_2 + + lda #0 + sta $c0b2 + +init_2 lda #0 ; reset screen + sta $20 + sta $22 + lda #40 + sta $21 + lda #24 + sta $23 + + jsr home ; clear screen + jsr pr ; show main screen + asc '########################################' ; 1 + asc '# ACOS LOADER V2.11 # ACOS FILES #' ; 2 + asc '# COPYRIGHT 1986-90 ####################' ; 3 + asc '# L&L PRODUCTIONS # #' ; 4 + asc '##################### #' ; 5 + asc '# FILENAMES # #' ; 6 + asc '##################### #' ; 7 + asc '# # #' ; 8 + asc '# ####################' ; 9 + asc '# # DELETED FILES #' ; 10 + asc '# ####################' ; 11 + asc '# # #' ; 12 + asc '# # #' ; 13 + asc '# # #' ; 14 + asc '# # #' ; 15 + asc '# ####################' ; 16 + asc '# # STARTUP SEGMENT #' ; 17 + asc '# ####################' ; 18 + asc '# # #' ; 19 + asc '########################################' ; 20 + asc '# STATUS: #' ; 21 + asc '# LOADING ACOS.OBJ #' ; 22 + asc '########################################',00 ; 23 + + jsr mli + db $c7 ; get prefix + dw p_pfx + + lda prefix + bne gotdef ; we have a default + + lda $bf30 ; save currently used disk + sta p_onln+1 + + jsr mli + db $c5 ; get the online volume + dw p_onln + + lda prefix+1 ; get rid of drive specifier + and #$0f + tax + inx ; add 1 for '/' + stx prefix + + lda #'/' ; put in leading slash + sta prefix+1 + + jsr mli + db $c6 ; set the prefix + dw p_pfx + +gotdef ldx $280 ; get length of path +gotdef2 dex + beq loadg ; we have the path set + + lda $280,x + cmp #'/' ; find path? + bne gotdef2 ; nope + + stx $280 ; set new length + + jsr mli + db $c6 ; set prefix + dw p_pfx2 + +loadg lda #0 + sta $bf94 + jsr mli ; close ALL open files + db $cc + dw r_close + + jsr mli + db $c8 ; open a file + dw r_open + + lda r_open+5 ; move refnum + sta r_read+1 + + jsr mli + db $ca ; read in acos.obj + dw r_read + + jsr mli + db $cc ; close file + dw r_close + +; check for turnkey run + lda startup ; is first i/d byte ok? + cmp #1 + bne sname ; nope + + lda startup+1 + sta startup ; make sure they dont match again + cmp #2 + beq sname4 + +; get name of starting segment +sname lda acosobj+2 ; point to filename + sta temp + lda acosobj+3 + sta temp+1 + + jsr prstat + asc 'SOURCE MODULE [',00 + ldy #0 + lda (temp),y + + tax +sname2 iny + lda (temp),y ; print filename + ora #$80 + jsr cout + dex + bne sname2 + + jsr pr ; finish off string + asc ']: ',00 + + jsr inpln + cpx #0 ; cr? + beq sname4 ; yep + cpx #14 ; 14 or over? + bcs sname ; yep + + txa + tay +sname3 lda lnbuf-1,y ; copy filename + sta (temp),y + dey + bne sname3 + + txa ; save length + sta (temp),y + jmp sname ; go back + +sname4 ldx acosobj+2 + lda acosobj+3 ; display in window 3 + ldy #3 + jsr prwind + + lda #drivea + sta p_ginfo+2 + +chkprg jsr mli + db $c4 ; get file info + dw p_ginfo + beq docheck + + jsr prstat + asc 'INSERT SYSTEM DISK INTO OTHER DRIVE',0d,00 + jsr getcr + jmp chkprg + +; get a directory and look for ".s" files. +; if any exist, check to see if they have +; been changed. If so, kill the ".c" file. + +docheck jsr prstat + asc 'STATUS:',0d + asc ' CHECKING FILES...',00 + +logprg jsr mli + db $c7 ; get the current prefix + dw p_pfx + + ldy drivea +logprg1 lda drivea,y ; are these 2 paths the same? + eor prefix,y + and #%11011111 + bne logprg2 ; nope + + dey + bne logprg1 ; keep checking + +logprg2 jsr mli ; open the current prefix + db $c8 + dw p_open + + lda p_open+5 ; get refnum + sta p_rdinf+1 + sta p_rddir+1 + sta p_pos+1 + + jsr mli ; read dir info + db $ca + dw p_rdinf + + jsr mli ; set to byte 0 + db $ce + dw p_pos + + ldx #0 + stx numfls ; 0 files processed + stx numfls+1 + dex + stx blkcnt ; start at file 1 in block + +rdloop lda #dirbuf+4 + sta temp+1 + + jsr mli ; read block + db $ca + dw p_rddir + bne rdloop1 ; opps, error + + lda blkcnt ; first pass? + bpl rdloop2 ; nope + + inc blkcnt ; set to 0 + jmp rdloop5 ; go to next entry + +rdloop2 lda numfls ; we done? + cmp dirinfo+$25 + bne rdloop3 ; nope + + lda numfls+1 ; check high + cmp dirinfo+$26 + bne rdloop3 ; were done + +rdloop1 jmp finish + +rdloop3 ldy #0 + lda (temp),y ; get length and type + and #$0f + sta (temp),y ; get rid of extra stuff + sta temp2 + bne rdlp3a + + jmp rdloop5 + +rdlp3a inc numfls ; inc file count + bne rdloop4 + inc numfls+1 + +rdloop4 ldx temp + lda temp+1 ; display filename in window 0 + ldy #0 + jsr prwind + + ldy drivea ; get length of path + tya + tax ; save length +mvpath lda drivea,y + sta flname,y ; move pathname + dey + bpl mvpath + + lda #'/' ; add in slash + inx + sta flname,x + + ldy #0 +mvpath2 inx + iny + lda (temp),y ; get name of file + sta flname,x + cpy temp2 + bne mvpath2 + + lda #'C' ; make into '.c' + sta flname,x + stx flname ; update length + + lda temp2 ; get length + cmp #3 ; is it a possible '.s' file? + bcc rdloop5 ; nope + + tay + lda (temp),y ; check for 's' in '.s' + cmp #'S' + bne rdloop5 + + dey + lda (temp),y ; check for '.' in '.s' + cmp #'.' + bne rdloop5 + +rdloop4c ldx temp + lda temp+1 + ldy #1 ; display .s source file + jsr prwind + + ldy #$1f ; offset for aux type in dir struct + lda (temp),y + bne rdlop4a + + lda temp ; point at filename + sta p_ginfo+1 + sta p_open2+1 + lda temp+1 + sta p_ginfo+2 + sta p_open2+2 + + lda #1 + sta p_ginfo+5 ; set bit in mod.time + + lda #7 ; setup for set.file.info + sta p_ginfo + + jsr mli ; set info + db $c3 + dw p_ginfo + + ldy #0 + lda (temp),y ; change file into .C + tay + lda #'C' + sta (temp),y + + ldx temp + lda temp+1 + ldy #2 ; display in window 2 + jsr prwind + + ldy #0 + lda (temp),y + tay ; change file back to .S + lda #'S' + sta (temp),y + + jsr mli ; delete '.c' file + db $c1 + dw p_del + +rdlop4a jsr flcopy ; copy over the file + +rdloop5 clc + lda temp ; go to next entry + adc dirinfo+$23 + sta temp + lda temp+1 + adc #0 + sta temp+1 + + inc blkcnt ; inc place within block + lda blkcnt + cmp dirinfo+$24 + beq rdloop6 ; go to next block + + jmp rdloop2 ; do next entry within this block + +rdloop6 lda #0 ; reset count + sta blkcnt + jmp rdloop ; do another block + +finish lda #0 + sta p_close+1 + + jsr mli ; close file + db $cc + dw p_close + + lda $c000 ; did they want to pause? + cmp #$a0 + beq wait2c ; yep, wait to see + + jmp exeacos + +wait2c lda #1 + sta $20 + sta $22 + lda #38 + sta $21 + lda #22 + sta $23 + jsr home ; clear screen + jsr pr + db cr + asc ' MAKE SURE THESE DISKS ARE IN PLACE:',0d,00 + + + ldy #0 ; move A: + ldx #lnbuf + jsr movpath ; move pathname + + ldy #1 ; move B: + ldx #lnbuf+128 + jsr movpath ; move pathname + + ldy lnbuf ; get pathname length + iny +show2 dey ; count down + bmi show3 ; they match + + lda lnbuf,y + cmp lnbuf+128,y ; are they the same? + beq show2 ; yep + + jsr pr + db cr + asc ' BOOT DISK -- ',00 + ldy lnbuf + ldx #lnbuf+1 + jsr prstr ; show pathname + +show3 jsr pr + db cr + asc ' SYSTEM DISK -- ',00 + ldy lnbuf+128 + ldx #lnbuf+129 + jsr prstr ; show pathname + + ldy #5 + ldx #lnbuf + jsr movpath + + jsr pr + db cr + asc ' BULLETIN DISK -- ',00 + ldy lnbuf + ldx #lnbuf+1 + jsr prstr ; show pathname + + ldy #6 + ldx #lnbuf+128 ; move pathname + jsr movpath + + ldy lnbuf ; get length of path + iny +show4 dey + bmi show5 ; the path's match + + lda lnbuf,y ; are they the same? + cmp lnbuf+128,y + beq show4 ; yep + + jsr pr + db cr + asc ' MAIL DISK -- ',00 + ldy lnbuf+128 + ldx #lnbuf+129 + jsr prstr + +show5 jsr pr + db cr,cr + asc ' ONCE THESE DISKS ARE IN PLACE',0d,0d + asc ' ',00 + jsr getcr + +exeacos lda #0 + sta $bf94 ; set level to 0 + + jsr mli + db $cc ; close all open files + dw r_close ; specifically EXEC files + + lda acosobj+6 + sta temp + lda acosobj+7 + sta temp+1 + jmp (temp) ; start acos running + + +; sub-routines +; print a line of status +prstat lda #2 + sta $20 + lda #36 + sta $21 + lda #20 ; set window + sta $22 + lda #22 + sta $23 + jsr home ; clear window + +pr pla ; point to string + sta prn + pla + sta prn+1 + +pr2 inc prn ; get next byte + bne pr3 + inc prn+1 + +pr3 ldy #0 ; get byte + lda (prn),y + ora #$80 + cmp #"#" ; inverse block? + bne pr3a ; nope + lda #$20 + +pr3a jsr cout ; print + asl a + bne pr2 ; keep going + + inc prn ; make into correct address + bne pr4 + inc prn+1 + +pr4 jmp (prn) ; return + + +; get a return +getcr jsr pr + asc 'PRESS [RETURN] TO CONTINUE...',00 +getcr2 jsr $fd35 + cmp #$8d + bne getcr2 + rts + + +; print a filename within a window +prwind stx prn ; point to filename + sta prn+1 + lda wndlft,y ; define text window + sta $20 + sta $24 + lda wndrgt,y + sta $21 + lda wndtop,y + sta $22 + lda wndbtm,y + sta $23 + sec ; make into vtab + sbc #1 + sta $25 + jsr $fc22 ; vtab down + lda #$8d + jsr $fdf0 ; scroll down + + ldy #0 + lda (prn),y ; get filename length + tax +prwind2 iny + lda (prn),y ; print name + ora #$80 + jsr $fdf0 + dex + bne prwind2 + rts + +wndlft db 02,22,22,22 +wndrgt db 16,16,16,16 +wndtop db 07,03,11,18 +wndbtm db 19,08,15,19 + + +; print a string pointed to by X & A, length Y +prstr stx prn + sta prn+1 ; point at string + tya + tax ; save length + ldy #0 +prstr2 lda (prn),y ; get data + ora #$80 + jsr $fdf0 + iny + dex + bne prstr2 ; do entire string + rts + + +; move a pathname into a buffer +movpath stx temp ; point to buffer + sta temp+1 + + ldx #0 +move2 dey ; count down + bmi move3 ; all finished + + txa + sec + adc drivea,x ; add in next offset + tax + jmp move2 + +move3 lda drivea,x ; get path length + sta temp2 ; save as counter + + ldy #0 +move4 lda drivea,x + sta (temp),y ; save in buffer + inx + iny + dec temp2 ; count down length + bpl move4 + rts + + +; copy over a source file +flcopy jsr mli + db $c8 ; does '.c' file exist? + dw p_open1 + bne flcopy1 ; nope, copy source + + lda p_open1+5 + sta p_close+1 + jsr mli ; close compiled file + db $cc + dw p_close +flcopy2 rts ; all is well + +flcopy1 ldx flname ; change '.c' back to '.s' + lda #'S' + sta flname,x + + jsr mli + db $c0 ; create new file + dw p_creat + bne flcopy2 ; file must already exist + + jsr mli + db $c8 ; open old file + dw p_open2 + + lda p_open2+5 ; save refnum + sta p_read+1 + sta p_close+1 + + jsr mli + db $ca ; read in file + dw p_read + + jsr mli + db $cc ; close source file + dw p_close + + jsr mli + db $c8 ; open new file + dw p_open1 + + lda p_open1+5 ; setup write routine + sta p_write+1 + sta p_close+1 + lda p_read+6 ; setup write length + sta p_write+4 + lda p_read+7 + sta p_write+5 + + jsr mli + db $cb ; write out segment + dw p_write + + jsr mli ; close file 2 + db $cc + dw p_close + rts ; we are done + + +; prodos parmlist +startup dw 0 + +p_creat db 7 + dw flname + db $c3 + db $04 + dw 0 + db 1 + dw 0 + dw 0 + +p_open db 3 + dw prefix + dw flbuf + db 0 + +p_open1 db 3 + dw flname + dw flbuf1 + db 0 + +p_open2 db 3 + dw 0 + dw flbuf1 + db 0 + +p_rdinf db 4 + db 0 + dw dirinfo + dw $0100 + dw 0 + +p_rddir db 4 + db 0 + dw dirbuf + dw $0200 + dw 0 + +p_read db 4 + db 0 + dw copybuf + dw copylen + dw $0000 + +p_write db 4 + db 0 + dw copybuf + dw copylen + dw $0000 + +p_close db 1 + db 0 + +p_ginfo db $0a + dw 0 + db 0 + db 0 + dw 0 + db 0 + dw 0 + dw 0 + dw 0 + dw 0 + dw 0 + +p_del db 1 + dw flname + +p_pos db 2 + db 0 + db $00,$00,$00 + +p_pfx db 1 + dw prefix + +p_pfx2 db 1 + dw $280 + +p_onln db 2 + db 0 + dw prefix+1 + +; data for relocated code +r_open db 3 + dw r_file + dw flbuf1 ; use last possible buffer + db 0 + +r_read db 4 + db 0 + dw acosobj + dw $6000 + dw $0000 + +r_close db 1 + db 0 + +r_file db 8 + asc 'acos.obj' + +copybuf equ * +copylen equ mli-copybuf + + end + + diff --git a/Source/Acos/OLD/ACOSA.S b/Source/Acos/OLD/ACOSA.S index 0cbd79d..a129aab 100644 --- a/Source/Acos/OLD/ACOSA.S +++ b/Source/Acos/OLD/ACOSA.S @@ -1 +1,52 @@ -ҍҠҍ 䍍ԠƍΠ٠ŠĠ ٯΩˠӮʮፍϠōԍ΍ԠӍǠԠÍԠӍԠԍԠōԠҍԠȍԠˍԠōԠύԠčԠčԠIJ፠ԠԍӠܠ썍ԠҍĠԠፍˠōԠō \ No newline at end of file + TR + TR ADR +******************************** +* * +* GBBS Pro Version 2.20 * +* * +******************************** + +* Copyright 1986-2019 Kevin Smallwood + + LST OFF +N = 0 +n = 0 +Y = 1 +y = 1 + +L_SOURCE KBD "List this assembly? (Y/N)" + + DSK ACOS.OBJ.a + + DO L_SOURCE + LST + FIN + + PUT EQUATES + + ORG $800 + + PUT DRVSPEC + PUT DRIVERS + PUT START + PUT ROUTINE + PUT VAR + PUT MATH + PUT DISK + PUT DRIVE + PUT DISKIO + PUT LOAD + PUT CMD + PUT CMD2a + PUT EDIT + + DS \ fill + + PUT FILTER +CODEND = * + + PUT INITa + + DSK ENCODE + + PUT ENCODE diff --git a/Source/Acos/OLD/CMD2A.S b/Source/Acos/OLD/CMD2A.S index 2f49dab..8016225 100644 --- a/Source/Acos/OLD/CMD2A.S +++ b/Source/Acos/OLD/CMD2A.S @@ -1 +1,1058 @@ -Ǎ Ӯ ō 󍪭٠ҠĠ ҠԠ 䍍ҠǠ ؠѠٳ 򿍠ؠѠٴ 򿍠ؠѠٱ 卍ҠҠ 򍍺ٲĠ鍠РٳؠҠ Šٵ 荍ٴؠҠ ٵؠҍŠٲ 卍Šٲ 荍ٱԠ 俍Р ĠҠǠ 獠ؠŠˠ 忬 卍Ȭؠ 荠Рˠؠ ҠРҍ 􍪭Ҡ̍ؠ썠РѠҠ 򍍠٠ 덠ҩ٠  占٠占ҩٍҠԠ ؠ̠ 썠 Ҭ؍ҫ؍ؠ Ϣ ҠōҠ͍٠̠ 썠īٍĬ٠ 卍Ь٠ ЫٍҠԠ 𿍠РŠұ卍ҠԠ 𢍠Ҡ͠ ٠̍Ы٠ ЬٍЫ٠ Ѡˠ 􍍺ұؠ̠ ҧ ҍì؍ҫë؍à̠ 썠à̍Ӎ Ԡؠ̠ ѠԶҠԠ 占РŠԲ 덍ҠԠ 占ؠ̠ 덺Աؠ 썠؍ɠԶҬ؍РōŠԱҫ؍РūŠԱؠ 덠؍ؠ̍ŠԳԲؠ 덠؍Ҭ؍ōҫ؍ūҠԳ Գؠ̠ ؍؍ҍР ҫЫ٠Ыؠ 𿍠ɠԷ 􍍠Щ٠ 忍Рī؍ԠԹ ѠԴ 占ŠԵ 卍Դ٠ 忍ЩٍРĬ؍ԠԹ Եà̠ à̍ԶӍԷЩٍРīؠ 忍ѠԸ 占ԠԵ ŠԹ Ը٠ 忍ЩٍРĬ؍ѠԵ ԠԵ 卍Թì؍Ҡ ë؍ҫà 占٠Ь؍àЩٍЩ٠ ٍЫ؍àЩٍЩ٠ 荠Ӎ ŠҠ͠ ؠввҠ͠ ፠Ҡ͠ 占ؠҠŠ ϧ 􍍠Ҡ͠ ؠЍЫؠ 卍٠ŲвٍЩ٠ 占ٍ؍ŠŲ 塍Ӎ 퍪͠ؠȍȍРȍ 퍪ͲؠȫȫРȍ 򍪭ӠčĠƠ ۰ݍРڧ썠ԠIJ 卍à 卺IJ٠àҩ٠ īҠ´àčĠ ̍̍̍īؠҠ ҫٍàҍŠijàҫijРҠ 򍍪 򍪭ĠҠǠ 占ؠР 占Ы٠ Ѡΰ 䍠īΰؠĠ 䍍βРЫѠδ Šε γРȠ 򍍺δؠЍѠγ 占Ԡγ εÍàРة ة 占؍àЫӠβ 덍 ̠Ҡ͍ؠР ЫҠ͠卍Ҡ͠ 썠ؠвҠ͠卍Ҡ͠ 荠٠̲Щ٠썠ٍàвŠ̲Ӎ 򍪭ĠǠ ҠԠ РŠò ᅪҠԠ 占ÍҠԠ 占ëàǍòӍ 򍪭ϠύР 򍪭ҠǠ ҠԠ РŠҲ ᅪҠԠ 占ÍҠԠ 占ëàǍҲӍ 䍪͠Ҡ 򿍠ҫѠҠ 䍍Ҡ ҍҫҫҠԠ 占РԍРҠԠ 卺ԠР 忍ѠŠ 퍠Р ᅪѠ̍Р⠻ ⿍Ѡ̍Р蠻 迍ŠР 卺̠Ҡנ Ҡ׍РЍŠӍҠ 占Ǎؠ 占Рҍ 퍪ϠҠǠ ؠŠƲ̠ ؍Ь؍Р 占Ы؍ЫԠƍРЩƲؠ РҍРנư 獠נƱ נƲ 占נƳ נƴ 占נƵ נƶ 卍 󍪭ưŠ 獠РƱР ϫ Р̠̠Ѝލ؍ЍРȠ 󍍪 卪ƲԠ 䍠Р 󍪭ƳɠƳ߰ 䍠Ӡ 獠РƳ߰Ҡՠ 占Ҡ͍ؠӍӍƴҠՠ 占Ҡ͍РԠ 荍 卪Ƶɠñ 䍠ÍР 卍ñҠՍà 獠Ҡ͠ 占ؠŠò 􍍠ؠà òӍƶύ̍̍Р 󍍠à 䍠Р 䍠àϫ؍ЍàϫĠ頻 РȠ 󍍪 ΠàȲ ፍҠՠ ҠР 占ӠȱҠ͠ ؠҠ 占ҫӍȱҠҠ占ҠŠ 卍٠ҩ٠ 占ٍҩٍӍȲ٠ҩ٠ 占؍ٍҩٍРԲ卍 卪ŠàԱ 卍Ҡՠ ҠҲ ؠÍë٠΍РŠ 卍ԱҠōԲР ፠ؠЫ čЫĠƍҠø ҫؠҫЫ 荠ҠР Ҡ РҍލҠøҠ 荠ؠҫР Ҡø 鍠ҫؠҫؠҠ 獠ҍ٠Ҡؠ٠ӍҠà 卪ŠҠŠ 덠٠ŠҠ 獍ŠؠؠҠ 򍍠ҠŠ Р Ġƍв 荠ҠР Ҡ ĠưРҍލв 荠؍ԭ؍г 􍍠ؠР Íà Ҡ ҍÍàР à ҠĠ ٠ ٍ ؠĠ 򿍠Ѡű؍űؠЫ 獍 덠Íàг àв 荍٠в ٠ԠŲàЫ 獺ŲҠĠ ؠ ؍٠جؠ ؠ ųӬ٠ ؍ѠŴҠٍŠųŴ ؠ Ҡ؍в ؍٠حؠ ؠŵӬ٠ 獠؍ѠŶҠٍŠŵŶ 占Ҡв Ҡø РŠŷ 占 ŷҠؠ 荍 ؠ Ҡ؍ ؠҠ؍Р Ҡø Ҡؠ 􍍠ؠŠ 獠ō٠Ҡ 荠РҠ 퍍ؠҠ ؠŠ ؍ؠҠ Ŭؠ àҠ ؠŠ ؍ӍŠ Ġà ĠàӠčà čӍԠ Ҡ Šà 󍪭ˠҠǠ ؠŠ΍̠ ؍Ь؍Р Ы؍ЫРЩР˰˱˲ 򍪭˰Ҡà ؠōūΠӍ 󍪭˱Ҡ΍˱РȠ 卍 􍪭˲ؠ΍ΫԠƠ ̠˱Ҡՠ占Ҡ͠ ؠΠ ΫӍ 󍪭ΠҠà ÍàŠ 占؍àūӠαàŠ ؠ àōαӍŠ àҠōؠг 獠г ҠΠ Šò 󍍠 䍍òРԠó 忬 卍à 卍óؠ ҠҠ̰ 󍍠àгҠΠ 卍ÍàԠ ؍àԫҠ Ҡ̰àг Ҡ΍ÍàԠ ؍àԫӍ˴ΠҠβ РѠ΍Р׍Π͠ Ѝ͍Ы٠ĭ͠ ٍРЩٍҠĭ͍ҠҠԍٍ̠ЍנӍ 卪ŠҠ͠ 占ؠЍЫҠ͠占Ҡ͠ 占٠Щ٠ Ӎ ˠҠǠ 獠ؠЍЫ٠Щ٠ 占Р  򍪭Šƍв 卍ҠǠ ؠвҠǠ ؠЫ àŲ 􍍠ҠԠ РŠŶ 卍ؠв 占ҠǠ ؠЫ ŲҠЫ 占вг 卍ųвг 占Ҡ 򍍺Ŵ؍Šŵ àЫɠŸ 卍ŵàгѠų 卍 占àгŠŴ вг 占Ҡ РŴ Ŷ؍ŠŷؠвҠ 卺ŷٍŠŶàЫŠŶŸӍԠР ŠРӠ  卪̠ҠǠ Ǡ ٠Р Р 䍺̲Ӭؠ 獠̠̳ 占ٍŠ̲ 獠٠ ̳Р 卍 獪àҠǠ 獠ؠΠ 忍Ѡò ٠éٍòР 卍 卪̠Ҡ͠ ؠЍЫРЩ 썍 ˠᠠ 獠፠ᠠ 獠፠뱠Ӎᠻ 벍 栻 ⠻ 뱠 ᠻ베ƍᠣ㍠ᠤ፠፠፠󍍻 ˠ΍፠ᠣᠤ፠󍍍 \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Commands2 * +* * +******************************** + DATE +*------------------------------- +* check for keypress +*------------------------------- + +DO_KEY JSR CHKDCD ;make key check for carrier + LDA #0 + JSR COUT ;poll modem/keyboard + + JSR INPNARG ;gobble argument + CPX #1 + BEQ :DO_KEY3 ;check for 'stop' char? + CPX #2 + BEQ :DO_KEY4 ;check for 'next' char? + CPX #3 + BEQ :DO_KEY1 ;check for any int taking place + + JSR GETCHR ;check buffer + +:DO_KEY2 AND #clrhi + JMP SVDATA + +:DO_KEY3 LDX STPCHR ;check stop char + BNE :DO_KEY5 ;-- always branch + +:DO_KEY4 LDX NXTCHR ;check next char +:DO_KEY5 LDA #0 + CPX INTCHR + BNE :DO_KEY2 ;did they hit it?, nope + + LDA #1 ;yep + BNE :DO_KEY2 ;-- always branch + +:DO_KEY1 LDA INTOUT ;has output been interupted? + JMP SVDATA + +*------------------------------- +* get width from index +*------------------------------- + +DO_WID JSR INPNARG ;get arg + CPX #5 + BGE WOK ;in range?, nope + + LDA WIDTH,X ;get width + JMP SVDATA + +WOK LDX #syntax ;syntax error +GO_ERR JMP BADERR + +*------------------------------- +* handle for-next statement +*------------------------------- + +DO_FOR LDA FORLVL + LDX #forfull + CMP #16 + BEQ GO_ERR ;for stack full error + + LDY #2 ;save variable name on stk + LDA (PRGPTR),Y ;since DO_LET could return + PHA ;a possible second variable + DEY ;name + LDA (PRGPTR),Y + PHA + JSR DO_LET ;do assign + + LDX FORLVL ;get level + PLA ;save var pointer + STA FORVAR,X + PLA + STA FORVAR+1,X + + LDX #to ;gobble "TO" statement + JSR GOBBLE + + JSR INPNUM + LDY FORLVL ;get level + STA FOREND+1,Y + TXA + STA FOREND,Y ;save end value + + LDA #<1 + STA FORSTP,Y ;save default step count (1) + LDA #>1 + STA FORSTP+1,Y + + JSR CHKBYT ;did they specify a step? + CMP #step + BNE :DO_FOR1 ;nope + + JSR GETBYT ;gobble "step" + JSR INPNUM ;get step + LDY FORLVL + STA FORSTP+1,Y ;save desired step + TXA + STA FORSTP,Y + + ORA FORSTP+1,Y ;did they try step 0? + BEQ WOK ;the dolt! error out + +:DO_FOR1 LDX FORLVL ;save address of 'FOR' section + LDA PRGPTR + STA FORLOC,X + LDA PRGPTR+1 + STA FORLOC+1,X + + INC FORLVL ;inc level + INC FORLVL + RTS + +*------------------------------- +* handle "next" part of for-next loop +*------------------------------- + +DO_NXT LDX FORLVL ;check for next without for + BEQ :DO_NXT6 + + JSR CHKBYT ;check for specified variable + CMP #number + BNE :DO_NXT2 ;none, use next on stack + + JSR VARSET ;get variable + LDX FORLVL ;find variable in stack +:DO_NXT1 DEX ;back down 1 level + DEX + BMI :DO_NXT6 + + LDA FORVAR,X + CMP VNAME + BNE :DO_NXT1 + + LDA FORVAR+1,X + CMP VNAME+1 + BNE :DO_NXT1 + + INX ;set the pointer into stack + INX + STX FORLVL + BNE :DO_NXT3 + +:DO_NXT2 DEX ;get next variable in stack + DEX + LDA FORVAR,X + STA VNAME + LDA FORVAR+1,X + STA VNAME+1 + JSR VARSET3 ;find variable in memory +:DO_NXT3 LDX FORLVL ;back down to it + DEX + DEX + LDA VPTR + STA TEMP ;restore var pointer + LDA VPTR+1 + STA TEMP+1 + + LDY #1 + LDA FORSTP+1,X ;doing negative step? + BMI :DO_NXT7 ;yes, do it + + LDA (TEMP),Y ;check high - are we done? + CMP FOREND+1,X + BLT :DO_NXT9 ;no, loop + BEQ :DO_NXT4 ;hmmm, check low byte + BGE :DO_NXT5 ;yes, we are done + +:DO_NXT4 DEY ;check low - are we done? + LDA (TEMP),Y + CMP FOREND,X + BLT :DO_NXT9 ;no, loop + +:DO_NXT5 DEC FORLVL ;conclude loop + DEC FORLVL +:DO_NXT6 RTS + +:DO_NXT7 LDA (TEMP),Y + CMP FOREND+1,X ;check high - are we done? + BEQ :DO_NXT8 ;maybe, check mid byte + BLT :DO_NXT5 ;yes, finish up + BGE :DO_NXT9 ;nope, loop + +:DO_NXT8 DEY ;Are we done with low byte? + LDA (TEMP),Y + CMP FOREND,X + BEQ :DO_NXT5 ;yes, finish up + BLT :DO_NXT5 ;if less, we are done + +:DO_NXT9 LDA FORLOC,X + STA PRGPTR ;point to "for" location + LDA FORLOC+1,X + STA PRGPTR+1 + CLC ;add in step value + LDY #0 + LDA FORSTP,X + ADC (TEMP),Y + STA (TEMP),Y ;do low + INY + LDA FORSTP+1,X + ADC (TEMP),Y + STA (TEMP),Y ;do high + RTS + +*------------------------------- +* move memory +*------------------------------- + +DO_MOVE JSR INPNUM ;get source address + STX TEMP2 + STA TEMP2+1 + + JSR GOBCOM ;gobble comma + JSR INPNUM ;get # of bytes to move + TXA + PHA + + LDX #to + JSR GOBBLE ;gobble 'TO' statement + + JSR INPNUM ;get destination address + STX TEMP + STA TEMP+1 + + PLA + TAX ;get back # of bytes to move + + LDY #0 +:MOVE2 LDA (TEMP2),Y + STA (TEMP),Y ;copy byte + INY + DEX + BNE :MOVE2 ;count down, were done! + RTS + +*------------------------------- +* get location of scratch ram +*------------------------------- + +DO_RAM LDX #SCRATCH + JMP DO_MATH + +*------------------------------- +* get location of aux scratch ram +*------------------------------- + +DO_RAM2 LDX #SCRATCH+64 + JMP DO_MATH + +*------------------------------- +* generate a random character +*------------------------------- + +DO_RNDS LDA RND + AND #$1F ;make in range [0-31] + CMP #'Z'-ctrl + BLT :DO_RND2 ;in range + + SBC #10 ;put into range +:DO_RND2 LDY #0 + ADC #'A' + STA (VARSTR),Y ;save character + LDA RND+1 + EOR #$B4 + ADC RND + STA RND ;re-seed for next pass + ROL + ROL + ROL + STA RND+1 + + LDX VARSTR ;point to random char + LDA VARSTR+1 + INY + + INC VARSTR + BNE :DO_RND3 + INC VARSTR+1 +:DO_RND3 JMP SVSTR ;save location of char + +*------------------------------- +* get a random number +*------------------------------- + +DO_RND JSR INPNARG ;get range + STX TEMP ;save range + STA TEMP+1 + TAY ;is it below 256? + BEQ :DO_RN0 ;yep, just get 8 bit seed + LDA RND+1 +:DO_RN0 LDX RND ;get seed + +:DO_RN2 CMP TEMP+1 + BEQ :DO_RN4 ;check low + BGE :DO_RN5 ;kill number +:DO_RN3 JMP DO_MATH ;return number + +:DO_RN4 CPX TEMP + BEQ :DO_RN3 ;check low byte + BLT :DO_RN3 ;all is well, return + +:DO_RN5 PHA + SEC + TXA + SBC TEMP ;(AX) = (AX) - range + TAX + PLA + SBC TEMP+1 + BCS :DO_RN2 ;loop and check + +*------------------------------- +* fill a range of memory +*------------------------------- + +DO_FILL JSR INPNUM + STX TEMP ;point to fill location + STA TEMP+1 + JSR GOBCOM ;gobble + + JSR INPNUM ;get number of bytes to fill + STX TEMP2 + JSR GOBCOM ;gobble + + JSR INPNUM ;get byte to fill with + TXA + + LDY #0 +:FILL2 STA (TEMP),Y ;fill + INY + DEC TEMP2 + BNE :FILL2 ;repeat + RTS + +*------------------------------- +* setup no carrier vector +*------------------------------- + +DO_NOCD LDA #0 + STA NOCDFLG ;reset carrier vector + JSR GETBYT ;see if it has a vector + CMP #goto + BNE :DO_NOC2 ;was it goto? + + JSR GETBYT ;get low byte of routine + STA NOCDVEC + JSR GETBYT ;get high byte of routine + STA NOCDVEC+1 + DEC NOCDFLG +:DO_NOC2 RTS + +*------------------------------- +* return error numer +*------------------------------- + +DO_ERRNO LDA ERRNO + JMP SVDATA + +*------------------------------- +* setup error vector +*------------------------------- + +DO_ONERR LDA #0 + STA ONERRFLG ;reset onerr vector + JSR GETBYT ;see if it has a vector + CMP #goto + BNE :DO_ERR2 ;was it goto? + + JSR GETBYT ;get low byte of routine + STA ONERRVEC + JSR GETBYT ;get high byte of routine + STA ONERRVEC+1 + DEC ONERRFLG +:DO_ERR2 RTS + +*------------------------------- +* resume command +*------------------------------- + +DO_RESUM LDA FROMERR ;was there an error? + ORA FROMERR+1 + BEQ :NOERR ;no error occurred + + LDA FROMERR ;replace error location + STA PRGPTR + LDA FROMERR+1 + STA PRGPTR+1 + + JSR CHKBYT ;get the byte there + JMP :TSTIT + +]LOOP JSR GETBYT ;get next byte +:TSTIT CMP #chain2 ;end of line? + BEQ :DONE ;yes, continue with pgm + CMP #goto ;a goto? + BEQ :DO_LBL + CMP #gosub ;a gosub? + BEQ :DO_LBL + CMP #push ;a push? + BNE ]LOOP ;nope, next byte +:DO_LBL JSR GETRAW ;skip label address + JSR GETRAW + JMP ]LOOP + +:DONE RTS + +:NOERR LDA #0 ;don't trap this one + STA ONERRFLG + LDX #$19 ;no error message + JMP BADERR + +*------------------------------- +* get general system to program +*------------------------------- + +DO_INFO JSR INPNARG ;get arg number + CPX #7 + BGE :DO_INF2 + + TXA + ASL ;a = a * 2 + TAX + + LDA INFOJMP,X + STA TEMP ;execute routine + LDA INFOJMP+1,X + STA TEMP+1 + BIT IMMDEF + JMP (TEMP) + +:DO_INF2 LDX #syntax ;syntax error + JMP BADERR + +INFOJMP DW INF0 ;get remote flag + DW INF1 ;msg board capacity + DW INF2 ;get users baud rate + DW INF3 ;get/set nulls + DW INF4 ;display chat mode + DW INF5 ;get/set exec flags + DW INF6 ;number of blocks free + +*------------------------------- +* return online status +*------------------------------- + +INF0 LDA REMOTE ;pass remote flag + JMP SVDATA + +INF1 LDA #0 + STA TEMP ;zero temp + LDA MSGINFO+1 ;multiple by 32 + LUP 5 + ASL A + ROL TEMP + --^ + TAX + LDA TEMP + JMP DO_MATH ;return # of entries + +*------------------------------- +* return users baud rate +*------------------------------- + +INF2 LDA SPCINIT ;get caller speed + JMP SVDATA + +*------------------------------- +* read, or set nulls +*------------------------------- + +INF3 BMI :INF3_0 ;do set, not read + LDA NULLS ;return current null setting + JMP SVDATA + +:INF3_0 JSR GOBEQU ;set new null value + JSR INPNUM + STX NULLS + RTS + +INF4 JSR GOBEQU ;set chat mode + JSR INPNUM + TXA + JMP VIDCHAT ;carry through + +*------------------------------- +* read or set EXEC mode +*------------------------------- + +INF5 BMI :EXEC1 ;opps, do set, not read + LDA EXEC + JMP SVDATA ;return current exec mode + +:EXEC1 JSR GOBEQU + LDA #%10111111 + STA EXEC ;set exec flag + JSR INPNUM ;set new exec mode + CPX #0 + BNE :EXEC2 ;it is already set + + STX EXEC ;set exec to 0 +:EXEC2 RTS + +INF6 LDA MSGINFO + ASL + ASL + STA TEMP ;save total # of bit blocks + + SEC ;new code for fixing the bug found + LDA TEMP ;by someone in a document named + SBC MSGINFO+2 ;sodapatches + TAX + LDA TEMP + SBC MSGINFO+3 + + AND #clrhi ;kill high bit + JMP DO_MATH ;return results + +*------------------------------- +* get date from 2 byte binary +*------------------------------- + +DO_WHEN BCC :DO_WH2 ;get data + + JSR GOBEQU ;gobble equal's + JSR ARGTYP ;find out data type + BCS :DO_WH1 + + JSR INPNUM ;get location + STX WHNPTR ;and save + STA WHNPTR+1 + RTS + +:DO_WH1 JSR INPSTR ;gobble + JSR GETDATE ;get date + + LDY #0 + PHA + TXA + STA (WHNPTR),Y ;save compacted date + INY + PLA + STA (WHNPTR),Y + RTS + +:DO_WH2 LDY #0 + LDA (WHNPTR),Y ;get compressed date + TAX + INY + LDA (WHNPTR),Y + JMP DO_DT2 ;translate + +*------------------------------- +* get date +*------------------------------- + +DO_DATE BCC :DO_DT1 ;get the date + + JSR GOBEQU ;gobble equ + JSR INSTR2 ;get string w/o using memory + LDX STRLOC + LDA STRLOC+1 + LDY STRLEN + JMP SETDATE ;set the date + +:DO_DT1 JSR GETDATE +DO_DT2 STA TEMP ;save date data + STX TEMP+1 ;date format: YYYYYYYMMMMDDDDD + + LDA TEMP+1 + AND #$1F + JSR BINDEC8 ;save day + STA DATESTR+3 + STX DATESTR+4 + + LDA TEMP+1 ;get most of month + LSR TEMP ;shift last bit into carry + ROR ;move bit in + LUP 4 + LSR + --^ + JSR BINDEC8 + STA DATESTR ;save month + STX DATESTR+1 + + LDA TEMP ;get year + JSR BINDEC8 ;make ascii + STA DATESTR+6 + STX DATESTR+7 + + LDX #DATESTR + LDY #8 +SVSTR STX DATA+1 + STA DATA+2 + STY DATA+3 + LDA #2 + STA DATA + RTS + +DATESTR ASC '06/20/85' + +*------------------------------- +* get time +*------------------------------- + +DO_TIME JSR GETTIME ;read clock + LDY #11 + BNE SVSTR ;return string + +DO_FDATE LDX #0 + STX DATEPTR ;zero date text pointer + + JSR GETDATE ;get date in ProDOS format + STA TEMP ;save year * 2 + TXA + PHA + AND #$1F + STA TEMP2 ;save day of month + PLA + LSR TEMP ;divide year by 2 + ROR ;move high bit of month into A + AND #$F0 + LUP 4 + LSR + --^ + STA TEMP2+1 ;save extracted month + TAX + LDA MTH_CNST-1,X + STA TEMP3 ;get month constant + + LDX TEMP ;get year + TXA + SEC + SBC #85 ;subtract 85 from year + LSR ;multiply by 2 + LSR + + CLC + ADC TEMP ;add in year again + SBC #83 ;subtracrt 83 + JSR WEEK_MOD ;a = a mod 7 + + TAY ;save in Y + TXA ;put year in A + LDX #0 + AND #3 ;leap year? + BEQ :FDATE1 + DEX +:FDATE1 STX TEMP+1 ;save leap year flag + + TYA ;get interm day of week back + CLC + ADC TEMP3 ;add in month constant + ADC TEMP2 ;add in day of month + + LDY TEMP2+1 ;get month number + CPY #3 + BLT :FDATE2 + ADC TEMP+1 ;add in leap year flag +:FDATE2 JSR WEEK_MOD ;a = a mod 7 + + TAX ;move day to X + LDY DAYINDEX,X ;get index to day text + LDX #4 ;4 characters +:FDATE3 LDA DAYS,Y ;move the text + DEX + BEQ :FDATE4 + JSR PUTA + INY + BNE :FDATE3 + +:FDATE4 LDA #'.' ;insert ". " + LDX #' ' + JSR PUTAX + + LDA TEMP2+1 ;get the month number + TAX + LDY MTHINDEX-1,X ;get index into month text + LDX #4 +:FDATE5 LDA MONTHS,Y ;move month text to string + DEX + BEQ :FDATE6 + JSR PUTA + INY + BNE :FDATE5 + +:FDATE6 LDA #' ' ;put in a space + JSR PUTA + + LDA TEMP2 ;get day of month number + JSR BINDEC8 ;make it text + CMP #'0' + BNE :FDATE7 ;change leading 0 to space + LDA #' ' +:FDATE7 JSR PUTAX ;save day of month + + LDA #',' ;add in a ", " + LDX #' ' + JSR PUTAX + + LDA #'1' ;put in the leading 19 + LDX #'9' + JSR PUTAX + + LDA TEMP ;get year - 1900 + JSR BINDEC8 ;convert to text + JSR PUTAX ;save it + + LDX #FMTDATE + LDY DATEPTR ;get the length + JMP SVSTR ;put it to program + +PUTAX JSR PUTA ;put the text in A + TXA ;move X to A +PUTA STX X_DATE ;save X + LDX DATEPTR ;get text pointer + STA FMTDATE,X ;store the character + INC DATEPTR ;bump the length pointer + LDX X_DATE ;get back X + RTS + +X_DATE DB 0 + +WEEK_MOD SEC ;subtract 7 till < 0 +:MOD SBC #7 + BCS :MOD + ADC #7 ;add back in 7 for MOD + RTS + +MTH_CNST DB 0,3,3,6,1,4,6,2,5,0,3,5 + +DATEPTR DB 0 + +FMTDATE ASC 'Fri. Jan 13, 1989' + +*------------------------------- +* do time computations +*------------------------------- + +DO_CLOK JSR INPNARG ;get function number + CPX #3 + BGE CLKRTN + + TXA + ASL ;x = x * 2 + TAX + + LDA CLKJMP,X + STA TEMP ;setup address for jump + LDA CLKJMP+1,X + STA TEMP+1 + JMP (TEMP) + +CLKJMP DA CLK0 + DA CLK1 + DA CLK2 + +*------------------------------- +* reset timer +*------------------------------- + +CLK0 JSR CONVSEC ;get base in seconds + STX CLKBASE + STA CLKBASE+1 +CLKRTN RTS + +*------------------------------- +* get connect time in seconds +*------------------------------- + +CLK1 JSR SECON +CLK1A JMP DO_MATH ;save time + +*------------------------------- +* get time limit +*------------------------------- + +CLK2 LDX TIMEON + LDA TIMEON+1 + BIT IMMDEF ;check exec status + BPL CLK1A + + JSR GOBEQU ;gobble + JSR INPNUM ;get time limit + STX TIMEON ;save time limit + STA TIMEON+1 + RTS + +*------------------------------- +* find time on in seconds +*------------------------------- + +SECON JSR CONVSEC ;get current time in seconds + SEC + PHA + TXA + SBC CLKBASE ;time on = current - base + TAX + PLA + SBC CLKBASE+1 + BCS :SECON1 + + PHA + TXA + ADC #ROLTIME +:SECON1 RTS + +ROLTIME = 43200 ;# seconds in 12 hours + +CONVSEC JSR GETTIME + STX TEMP3 ;point to time string + STA TEMP3+1 + + LDA #60 + STA DATA+1 ;set up multiplier + LDA #0 + STA DATA+2 + STA DATA+3 + + JSR ZNUMIN ;get hour + TXA + BNE :CONVSC2 ;not 0 hours + + LDA #24 ;make 0 hundred into 24 hundred + +:CONVSC2 CMP #13 + BLT :CONVSC3 ;is it out of range?, nope + + SBC #12 ;make into 1-12 range + +:CONVSC3 TAX ;save result + LDA #0 + JSR SAVNUMB + JSR DO_MUL0 ;multiply into minutes + + INC TEMP3 + JSR ZNUMIN ;get minute + + CLC + TXA + ADC RESULT ;add in minutes + TAX + LDA #0 + ADC RESULT+1 + JSR SAVNUMB + + LDA #60 + STA DATA+1 ;multiply by 60 + JSR DO_MUL0 + + INC TEMP3 ;position to seconds + JSR ZNUMIN + + CLC + TXA + ADC RESULT ;add in seconds + TAX + LDA #0 + ADC RESULT+1 + RTS + +CHK4SN JSR KEYIN2 ;check for serial # access + CMP #'?' + BEQ :SHOWSN + + JMP :NOSHOW + +:SHOWSN LDA #SERNUM + STA TEMP+1 + + LDY #SEREND-SERNUM ;point to data to print + DEY + +]LOOP LDA (TEMP),Y + EOR #SEREND-SERNUM + ROR A + JSR COUT + DEY + BPL ]LOOP + +:NOSHOW RTS + +*------------------------------- +* poke a value +*------------------------------- + +DO_POKE JSR INPNUM ;get place to poke + STX TEMP + STA TEMP+1 + JSR GOBCOM ;gobble + JSR INPNUM ;get value + TXA + LDY #0 + STA (TEMP),Y ;no offset + RTS + +*------------------------------- +* peek a location +*------------------------------- + +DO_PEEK JSR INPNARG ;get arg + STX TEMP + STA TEMP+1 + LDY #0 + LDA (TEMP),Y ;get value + JMP SVDATA ;return in + +*------------------------------- +* produce a tone with apple speaker +*------------------------------- + +DO_TONE LDA #$FF + STA TEMP2+1 ;default to 1 tone + + JSR INPNARG ;get tone argument + STX TEMP2 + + JSR INPNARG ;get duration/tone2 argument + STX TEMP+1 ;save as duration + BCC :TONE2 ;last argument -- everything is correct + + JSR CHKBYT ;check for last argument + CMP #"," + BNE :TONE6 ;do normal single tone + + STX TEMP2+1 ;save second tone + JSR INPNARG ;get real duration + STX TEMP+1 ;save duration + +:TONE2 LSR TEMP+1 ;correct timing to match old routine + LDA TEMP2+1 + STA TEMP3+1 ;reset second tone + +:TONE3 LDA TEMP2 + STA TEMP3 ;reset first tone + LDA SPKR ;click speaker + +:TONE4 DEX + BNE :TONE5 ;time down + DEC TEMP+1 + BMI :TONE8 ;done with tone + +:TONE5 PHA + PLA + DEC TEMP3 + BEQ :TONE3 ;count down first tone + + PHA + PLA ;count down second tone + DEC TEMP3+1 + BNE :TONE4 ;nope, do main loop + + LDA TEMP2+1 + STA TEMP3+1 ;reset second tone + LDA SPKR ;click speaker + JMP :TONE4 ;go main loop + +:TONE6 DEX + BNE :TONE7 + + LDX TEMP2 + LDA SPKR ;modified from "keeper" code +:TONE7 DEY + BNE :TONE6 + + DEC TEMP+1 + BNE :TONE6 +:TONE8 RTS + +DO_TEXT LDA #0 + STA WNDTOP ;set to full screen +DO_HOME JMP VIDCLS ;clear the local screen + +*------------------------------- +* read status of a paddle +*------------------------------- + +DO_PDL JSR INPNARG ;get paddle number + LDA PTRIG ;toggle paddle trigger + LDY #0 + NOP ;give delay so we dont + NOP ;get a false read +:DO_PDL2 LDA PDLS,X ;check paddle flag + BPL :DO_PDL3 ;we are done + INY + BNE :DO_PDL2 ;keep counting + DEY ;change 0 to 255 +:DO_PDL3 TYA + JMP SVDATA ;return value + +*------------------------------- +* get ascii value of a string +*------------------------------- + +DO_ASC JSR INPSARG ;read string + LDA #-1 + LDX STRLEN ;any string there? + BEQ :DO_ASC2 ;nope, return value of 255 + + LDY #0 + LDA (STRLOC),Y +:DO_ASC2 JMP SVDATA ;return byte + +*------------------------------- +* call a machine-language rotine +*------------------------------- + +DO_CALL JSR INPNUM ;get address + STX TEMP + STA TEMP+1 + JMP (TEMP) ;transfer control + +;lock out other computer writing +DO_LOCK pha ; save a reg + txa + pha ; save x reg + tya + pha +lock1 lda MLBUS + asl a ; shift status to carry + bcs lock2 + ldy #1 ; get node # +lock1a ldx $ff ; set up loop +lock1b dex + bne lock1b ; count down inner loop + dey + beq lock1 ;done yet? Yes, check again + bne lock1a ;No +lock2 sta ANU_OFF + lda #$0c + sta $427 + pla + tay + pla + tax + pla + rts + +;enable other computer writing +DO_UNLK sta ANU_ON + pha + lda #$15 + sta $427 + pla + rts + + diff --git a/Source/Acos/OLD/INIT.CH.S b/Source/Acos/OLD/INIT.CH.S index b8f55ff..24c85cf 100644 --- a/Source/Acos/OLD/INIT.CH.S +++ b/Source/Acos/OLD/INIT.CH.S @@ -1 +1,623 @@ -Ǎ Ӯ ōԱҠŠҠ̠Ҡ̵占Р̶ԲҠŠ占Р̱􍍪 Š͍͠ЍЫԠвԍв٠ؠ֫βЩٍв٠ٍŠβàЫàв؍Šβ􍍠٠ԳdzЬٍԬ٠ٍ̠Գ؍ԍ؍ԫӍǠč Ԡ 䍠 䍠 䍠ɠħ䍠ɠϧɠ§⍠ɠȧ荠ɠç㍍ɠ 䍍ɠҧ占ɠ˧ɠŧ占ɠԧɠ٧ɠԧɠԧɠԧɠԧ䍠ɠǧɠŧ占ɠŧ占ɠƧ捠ɠΧɠŧ占ɠΧɠЧɠͧ퍠ɠΧ獠ɠϧɠǧ獠ɠΧɠŧ占ɠ˧ɠ̧썠ɠŧ占ɠΧɠԧɠ٧ɠħ䍠ɠŧ占ɠԧɠ٧ɠԧɠǧ獠ɠħ䍠ɠŧ占ɠȧ荠ɠҧɠϧɠЧɠԧɠҧɠ̧썠ɠŧ占ɠͲɠͧ퍠ɠŧ占ɠȧ荠ɠŧ占ɠԧɠħ䍠ɠ̧썠ɠ ҧɠ ҧɠҧɠŧ占ɠϧɠ˧占ɠŧ占ɠŧ占ɠ˧덠ɠƧ捠ɠŧ占ɠ̧썠ɠͧ퍠ɠç鍠ɠ̧썠ɠŧ占ɠ̧썍ɠҤ򤍠ɠŤ占ɠŤ复ɠŤ䍠ɠΤɠԤɠԤɠĤ䤍ɠҤ򤍠ɠĤ䤍ɠɠɠɠɠɠɠɠɠɠħ䍠ɠҧɠҧ򍍠ɠɠɠɠɠħ䍠ɠӧ占  卪Ҡנ򠽠үנԠ砽үנԠ䠽үנĠүנϠ⠽үנ 蠽үנȠ㠽үנҠүנ̠үנ̠򠽠үנҠנˠנŠÍנԠčננōנԠƍנΠנԠנԠנǠנ נԠנƠנ̠堽үנŠנԠנРנ͠נΠÍנϠčנŠōנΠƍנӠנˠנ̠נŠנӠנԠנ٠נĠנԠנԠүנ٠נԠ砽үנǠÍנĠčנŠōנĠƍנҠүנҠ𠽠үנҠנԠנԠנ̠נŠנͲנ͠נŠנȠנРנԠÍנРčנ̠ōנĠƍנҠנϠנ͠נϠנˠנŠנŠנˠנƠנŠנ̠נĠנàÍנ̠čנҠōנ̠ƍ𠽠үנҠנŠנŠנŠנΠנԠנԠנĠנҠנӠ堽үנԠנԠנѠÍנѠčנѠōנѠƍ젽үנѠנԠנԠ㠽үנĠנҠנҠ蠽үנӠ󠽠үנ נԠנĠנĠנӠנÍ 󍪭Ӡ ɠ 䧍ɠ 姍ɠ 䧍ɠ 짍ɠ 򧍠ɠ 짍ɠ 짍ɠ ᧍ɠ 觍ɠ ɠ ɠ 种ɠ 짍ɠ ⧍ɠ 򧍠ɠ 姍ɠ 짍ɠ 򧍠ɠ 䧍ɠ 䧍ɠ ɠ 򧍠ɠ 짍ɠ Ʈ 󍪭Ӡ  à 宮ĸč à 宮ĸč à 䧸čà ĸčà 宮ĸč à 䧸č à č à 宮č 󍪭Ӡ  ɠ 𩺧 à 觸č à 䧸č ɠ 忧 à䧸č à ĸč ɠ ̬ ɠ ̬ à č ɠ ̬ ɠ  à ɠ 򿧍 à ĸč ɠ 婺 ɠ 婺 à ý Ľ ŽčàȽ ɽ ̽ νčàϽ ڽ 䧸čàà䧠婫İčà čà 姰čà ĸčà 䮧ĸč 󍪭Ӡ ɠ ɠӠà Ӡ Ԡ     àנΠ占נα덠נβ덠נР占נΠ퍠נР占נǠ獠נ̠䍠נРנРנΠ퍍àנԠ占נԱ덠נԲ덠נԠ썠נԠ퍠נԠ占נǠ獠נԠ䍠נԠנԠנԠ퍍Рԍԍэээээԍԍ̠ؠưưƍàв卍 덍ˠà à Խ ͽ н ̽ н à à ؠ Ӡààà姍à䧍àà駍àؠ Ӡàà⧍à򧍠à򧍠ààà짍à种à𧍠ààà㧍Ơ ٠䍍ٍ͠Ӡ荍ˠӠ⍍ҠӠĠӠРӠàӠŠӠ͠Ӡ͠ӠӠӠӠ Ǡ ͠ Ǡ àǠ àҠ卍Ӡ Š ͠ ͠ Ԡ Բ Р ΠΠ ԠӠƠ Ϡ  נננҠ Ÿ Ҹ ˠנĠ Ҳ Ÿ 䍠 ˠנĠ Ҡ Ը Ҹ ˠנǠǠ ͠נˠנԠ ƠӠ卍ԍčǍ֠dzРǠԠРԍРԍР͍Р͍РҍРōРҍРÍРԍРҍР΍РÍРԍР԰РōР΍РōРōРōРˍРˍРōРˍРˍРÍō͠ Ʋ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Init Code * +* * +******************************** + DATE +*------------------------------- + +START1 JSR MOVECODE do + JSR FATAL init + JSR FATAL5 move + JMP FATAL6 + +START2 JSR MOVECODE move + JMP FATAL1 init + +*------------------------------- +* do memory move and setup +*------------------------------- + +MOVECODE LDA SETRAM select + LDA SETRAM + + LDA #ZDATA + STA TEMP+1 + + LDA #SYMTXT + STA TEMP2+1 + + LDY #0 start + LDX #>END_MV+$256 +:DO_IN2 LDA (TEMP),Y + STA (TEMP2),Y copy + INY + BNE :DO_IN2 + + INC TEMP+1 + INC TEMP2+1 + DEX + BNE :DO_IN2 count + + LDY #80 +:INIT3 LDA PG3JMP,Y + STA ENTPOINT,Y copy + DEY + BPL :INIT3 + LDA #IRQ_FIX + STA IRQVECT+1 + RTS + +ZDATA ORG RAMCARD + +*------------------------------- +* ----- actual tokens ----- +*------------------------------- + +SYMTXT DB -1 reserved + DB -1 reserved + DB -1 reserved + DCI 'END' end + DCI 'GOTO' goto + DCI 'GOSUB' gosub + DCI 'PUSH' push + DCI 'PUBLIC' public + + DCI ':' colon + DB -1 reserved + + DCI 'CLEAR' use + DCI 'LINK' on + DCI 'HOME' home + DCI 'PRINT' print + DCI 'COPY' copy + DCI 'GET' get + DCI 'INPUT' input + DCI 'SETINT' set + DCI 'ADDINT' add + DCI 'FLAG' user + DCI 'NIBBLE' nibble + DCI 'BYTE' byte + DCI 'IF' if + DCI 'THEN' then + DCI 'ELSE' else + DCI 'RETURN' return + DCI 'POP' pop + DCI 'MODEM' modem + DCI 'LEN' string + DCI 'ECHO' set + DCI 'LOG' log + DCI 'OPEN' open + DCI 'CLOSE' close + DCI 'MARK' get/set + DCI 'VAL' val + DCI 'FREE' free + DCI 'POSITION' position + DCI 'SET' set + DCI 'READY' ready + DCI 'READ' read + DCI 'WRITE' write + DCI 'NOT' not + DCI 'KEY' key + DCI 'EDIT' edit + DCI 'MSG' msg + DCI 'REWIND' rewind + DCI 'TONE' tone + DCI 'WIDTH' width + DCI 'FOR' for + DCI 'TO' to + DCI 'STEP' step + DCI 'NEXT' next + DCI 'INSTR' instr + DCI 'KILL' kill + DCI 'MOVE' move + DCI 'RAM2' ram2 + DCI 'RAM' ram + DCI 'CREATE' create + DCI 'CRUNCH' crunch + DCI 'UPDATE' update + DCI 'TEXT' text + DCI 'APPEND' append + DCI 'FILL' fill + DCI 'ON NOCAR' on + DCI 'ON ERROR' on + DCI 'ERR' error + DCI 'RESUME' resume + DCI 'INFO' info + DCI 'CLOCK' time + DCI 'USE' use + DCI 'POKE' poke + DCI 'PEEK' peek + DCI 'EOF' eof + DCI 'SIZE' size + DCI 'PDL' pdl + DCI 'RANDOM' random + DCI 'ASC' ascii + DCI 'CALL' call + DCI 'STORE' store + DCI 'RECALL' recall + + DCI 'CHR$' chr$ + DCI 'DATE$' date + DCI 'TIME$' time$ + DCI 'FMTDATE$' formatted + DCI 'WHEN$' when$ + DCI 'LEFT$' left$ + DCI 'RIGHT$' right$ + DCI 'MID$' mid$ + DCI 'STR$' str$ + DCI 'RND$' rnd$ + + DCI '<>' <> + DCI '><' >< + DCI '<=' <= + DCI '>=' >= + DCI '=<' =< + DCI '=>' => + DCI '=' = + DCI '<' < + DCI '>' > + + DCI 'AND' and + DCI 'OR' or + DCI 'EOR' eor + + DCI '+' plus + DCI '-' minus + DCI '*' multiplication + DCI '/' division + DCI 'MOD' mod + DCI 'ABS' absolute + DB 0 + +*------------------------------- +* token jump table +*------------------------------- + +SYMADR DW 0 00 +number = *-SYMADR/2 + DW DO_LET 01 +string = *-SYMADR/2 + DW DO_LET 02 +end = *-SYMADR/2 + DW DO_END 03 +goto = *-SYMADR/2 + DW DO_GOTO 04 +gosub = *-SYMADR/2 + DW DO_GSB 05 +push = *-SYMADR/2 + DW DO_PUSH 06 +public = *-SYMADR/2 + DW ERR 07 + +chain = *-SYMADR/2 + DW NIL 08 +chain2 = *-SYMADR/2 + DW NIL 09 + +clear = *-SYMADR/2 + DW DO_CLR 0A + DW DO_LINK 0B + DW DO_HOME 0C + DW DO_PRNT 0D + DW DO_SHOW 0E + DW DO_GET 0F + DW DO_IN 10 + DW DO_SINT 11 + DW DO_AINT 12 + DW DO_FLAG 13 + DW DO_NIB 14 + DW DO_BYT 15 + DW DO_IF 16 + DW NIL 17 +else = *-SYMADR/2 + DW DO_ELSE 18 + DW DO_RET 19 + DW DO_POP 1A + DW DO_MDM 1B + DW DO_LEN 1C + DW DO_ECHO 1D + DW MOVNAME 1E + DW DO_OPEN 1F + DW DO_CLOS 20 + DW DO_MARK 21 + DW DO_VAL 22 + DW DO_FRE 23 + DW DO_POS 24 + DW DO_SET 25 + DW DO_RDY 26 + DW DO_READ 27 + DW DO_WRIT 28 + DW DO_NOT 29 +key = *-SYMADR/2 + DW DO_KEY 2A + DW DO_EDIT 2B +msg = *-SYMADR/2 + DW DO_MSG 2C + DW DO_RWD 2D + DW DO_TONE 2E + DW DO_WID 2F + DW DO_FOR 30 +to = *-SYMADR/2 + DW ERR 31 +step = *-SYMADR/2 + DW ERR 32 + DW DO_NXT 33 + DW DO_INST 34 + DW DO_KILL 35 + DW DO_MOVE 36 + DW DO_RAM2 37 + DW DO_RAM 38 + DW DO_MAKE 39 + DW DO_CNCH 3A + DW DO_UP 3B + DW DO_TEXT 3C + DW DO_APP 3D + DW DO_FILL 3E + DW DO_NOCD 3F + DW DO_ONERR 40 + DW DO_ERRNO 41 + DW DO_RESUM 42 + DW DO_INFO 43 + DW DO_CLOK 44 + DW DO_USE 45 + DW DO_POKE 46 + DW DO_PEEK 47 + DW DO_EOF 48 + DW DO_SIZE 49 + DW DO_PDL 4A + DW DO_RND 4B + DW DO_ASC 4C + DW DO_CALL 4D + DW DO_STOR 4E + DW DO_RCAL 4F + +strtyp = *-SYMADR/2 + DW DO_CHR 50 + DW DO_DATE 51 + DW DO_TIME 52 + DW DO_FDATE 53 + DW DO_WHEN 54 + DW DO_LFT 55 + DW DO_RGT 56 + DW DO_MID 57 + DW DO_STR 58 + DW DO_RNDS 59 +compare = *-SYMADR/2 + DW CP_NOT 5A + DW CP_NOT 5B + DW CP_LTEQ 5C + DW CP_GTEQ 5D + DW CP_LTEQ 5E + DW CP_GTEQ 5F +equal = *-SYMADR/2 + DW CP_EQ 60 + DW CP_LT 61 + DW CP_GT 62 + +logic = *-SYMADR/2 + DW CP_AND 63 + DW CP_OR 64 + DW CP_EOR 65 + +math = *-SYMADR/2 + DW DO_PLUS 66 +minus = *-SYMADR/2 + DW DO_SUB 67 + DW DO_MULT 68 + DW DO_DIVD 69 + DW DO_MOD 6A + DW DO_ABS 6B + DW 0 6C + +*------------------------------- +* system error messages +*------------------------------- + +ERRMSGS DB -1 + DCI 'Starting Module Not Found' + DCI 'Module Too Large' + DCI 'Label Not Found' + DCI 'Symbol Table Full' + DCI 'Syntax Error' + DCI 'Missing Symbol' + DCI 'Undefined Label' + DCI 'Missing Data' + DCI 'Type Mismatch' + DCI 'Overflow > 32767' + DCI 'Division By 0' + DCI 'String Too Long' + DCI 'Gosub Stack Full' + DCI 'Return Without Gosub' + DCI 'Bad Device Number' + DCI 'Illegal Filename' + DCI 'For Stack Full' + DCI 'Next Without For' + DCI 'Link Label Not Found' + DCI 'Message File Not Found' + DCI 'END of Program' + DCI 'Bad Drive Specifier' + DCI 'Unable to Load External' + DCI 'Unclosed quote at EOF......' + +*------------------------------- +* misc. messages +*------------------------------- + +MISCMSGS DB -1 + DB cr,cr + ASC 'Sysop is on-line...'0D8D + DB cr + ASC 'Sysop is off-line...'0D8D + DB cr,cr + ASC 'Sorry, time limit exceeded'8D + ASC '...please wait...'0D8D + ASC '...exiting exec mode...'0D8D + DB cr + ASC 'Error: Help file could not be opened'8D + DB cr + ASC 'File Write Error'8D + DB cr + ASC 'One moment please...'8D + +*------------------------------- +* editor messages +*------------------------------- + +EDMSGS DB -1 + DB cr + DCI 'Editing (?=Help):' + DB cr + ASC 'That is 4k worth'8D + DB cr + ASC 'Illegal Command'8D + DB cr + DCI 'Abort: Are you sure?' + DB cr + ASC 'Aborted'8D + DB cr + ASC 'Continue message now...'0D8D + DB cr + DCI 'Delete Line (L,x-y):' + DB cr + DCI 'Edit Line (L,x):' + DB cr + ASC 'Illegal line number'8D + DB cr + DCI 'Insert Line (L,x):' + DB cr + DCI 'List Line (x-y):' + DB cr + ASC .Insert text: + DB cr + DCI 'New: Erase and start over?' + DB cr + ASC 'Enter message now...'0D8D + DB cr + DCI 'Read File (name):' + DB cr + DCI 'Write File (name):' + DB cr + ASC 'A=Abort, C=Continue, D=Delete, E=Edit'0D + ASC 'H=Help, I=Insert, L=List, N=New'0D + ASC 'O=Ok to send, Z=Space Used'8D + ASC .Valid editor + ASC +'.command' acceptable)+0D0D + ASC ' A = Abort Dx-y = Delete line(s) x-y N = New'0D + ASC ' H = Help Ix = Insert at line x S = Save'0D + ASC ' Z = Space Ex = Edit line x Lx-y = List line(s) x-y'0D8D + ASC ' Bytes Used.'0D8D + +*------------------------------- +* compiler messages +*------------------------------- + +COMPMSGS DB -1 + DCI 'One moment, compiling segment.' + DCI '..' + DS 32,bs + ASC ' ' + DS 31,bs + DB bs+hibit + +MODEBYT DB %10000011 default, + DB %11000001 upper + DB %10100000 upper + DB %00100000 accept + DB %01100000 no + +INPVEC DW KEYIN console + DW DISKIN1 disk + DW DISKIN2 disk + DW NO_INP console + DW MDMIN modem + DW NO_INP line + DW RDMSG msg + DW RDMAIL read + DW EDINP editor + DW NO_INP no + DW RAMIN ram + +OUTVEC DW COUT console + DW DSKOUT1 disk + DW DSKOUT2 disk + DW VIDCOUT local + DW ZMDMOUT modem + DW PRCOUT line + DW WRMSG msg + DW NO_OUT read + DW EDOUT editor + DW TOPPRINT print + DW RAMOUT ram + +JSTRCP DA ST_NOT + DA ST_NOT + DA ST_LTEQ + DA ST_GTEQ + DA ST_LTEQ + DA ST_GTEQ + DA ST_EQ + DA ST_LT + DA ST_GT + +DEVTBL HEX FF0000FFFFFF0000FFFFFF + ASC 'GP200001' fake + +; screen top mask + +TOPMASK ASC '#..... ............................... ' + ASC 'Stats: CT=.. CM=... UP=.. DL=... BP=... ' + ASC 'Ph: ............ ........ ....-******** ' + ASC 'Flg: .................................. ' + +DAYINDEX DB 0,3,6,9,12,15,18 + +DAYS ASC 'Sun' + ASC 'Mon' + ASC 'Tue' + ASC 'Wed' + ASC 'Thu' + ASC 'Fri' + ASC 'Sat' + +MTHINDEX DB 0,3,6,9,12,15,18,21,24,27,30,33 + +MONTHS ASC 'Jan' + ASC 'Feb' + ASC 'Mar' + ASC 'Apr' + ASC 'May' + ASC 'Jun' + ASC 'Jul' + ASC 'Aug' + ASC 'Sep' + ASC 'Oct' + ASC 'Nov' + ASC 'Dec' + +TOPBUF DB 0 + +DUMMY = * standard + + DUM DUMMY + + DS 159 finish + +GSBSTK DS $20 gosub + +FORVAR DS $10 for +FOREND DS $10 +FORSTP DS $10 +FORLOC DS $10 + +DEVUSE DS 11 + +NUM DS 7 +TXTNUM DS 6 +FLPOS DS 6 + +DATA DS 4 +NUMB DA 0 +NEGFLG DB 0 +FREMEM DB 0 + +NOCDFLG DB 0 +NOCDVEC DA 0 + +ONERRFLG DB 0 +ONERRVEC DA 0 +FROMERR DA 0 where + +NULLS DB 0 +REMOTE DB 0 + +SYMNUM DB 0 +LBLNUM DB 0 +LNCNT DB 0 +LNCNT2 DB 0 +TOKTYP DB 0 + +REMAIN DA 0 +SIGN DB 0 +RESULT DS 3 + +MSGREF DB 0 is + +MSGINFO DB 0 # + DB 0 # + DW 0 # + DW 0 # + DW 0 # + +MSGPTR DB 0 point +BYTE8 DB 0 7 +CHAR8 DB 0 7 +RMXBLK DW 0 read +RDEND DB 0 at + +MSGPTR2 DB 0 for +BYTE82 DB 0 second + DB 0 second +WRKBLK DW 0 current +WRTEND DB 0 at + +RWDPTR DB 0 point +RWDBYT8 DB 0 +RWDCHR8 DB 0 +RWDBLK DW 0 + +DIRSEG DA 0 current +BITSEG DB 0 current + +MSGNUM DW 0 current +POSBLK DW 0 postion + +MSGINIT DB 0 is + +CHATBUF DS 90 storage + +LASTBYT + DEND + ORG +END_MV = *-ZDATA + +PG3JMP ORG $380 + +ENTPOINT JMP GETBYT + JMP CHKBYT + JMP GOBCOM + JMP INPNUM + JMP INPSTR + JMP MOVNAME + JMP BADERR + JMP SETIVEC + JMP GET + JMP GETCHR + JMP INPLN + JMP SETOVEC + JMP COUT + JMP DECOUT0 + JMP CREATE + JMP OPEN + JMP CLOSE + JMP RDBYTE + JMP WRBYTE + JMP RDBLK + JMP WRBLK + JMP RDLINE + JMP GETMARK + JMP SETMARK + JMP LOGSPEC + + DA FLNAME +REFNUM DB 0 + DA FBUF2 + + diff --git a/Source/Acos/OLD/INITA.S b/Source/Acos/OLD/INITA.S index 050803b..6527e0e 100644 --- a/Source/Acos/OLD/INITA.S +++ b/Source/Acos/OLD/INITA.S @@ -1 +1,634 @@ -Ǎ Ӯ ōԱҠŠ 占Ҡ̠ 捠Ҡ̵ Р̶ԲҠŠ Р̱ 퍍 Š͠ 덠͍ ፠ЍЫԠ вԍв٠ ؠ֫βЩٍв٠ 占ٍŠβàЫàв؍Šβ ٠ԳdzЬٍԬ٠ 占ٍ̠Գ؍ԍ؍ԫӍǠč Ԡ 䍠 䍠 䍠ɠħ 占ɠϧ ɠ§ ɠȧ ɠç 卍ɠ 䍍ɠҧ ɠ˧ ɠŧ ɠԧ ɠ٧ 占ɠԧ ɠԧ 占ɠԧ ɠԧ ɠǧ ɠŧ ɠŧ ɠƧ ɠΧ ɠŧ ɠΧ ɠЧ ɠͧ ɠΧ 荠ɠϧ ɠǧ 占ɠΧ 占ɠŧ 占ɠ˧ ɠ̧ ɠŧ ɠΧ ɠԧ ɠ٧ ɠħ ɠŧ ɠԧ ɠ٧ ɠԧ ɠǧ ɠħ ɠŧ ɠȧ ɠҧ ɠϧ ɠЧ ɠԧ ɠҧ ɠ̧ ɠŧ ɠͲ 占ɠͧ 占ɠŧ ɠȧ ɠŧ ɠԧ 䍠ɠħ ɠ̧ ɠ ҧ ɠ ҧ ɠҧ ɠŧ ɠϧ ɠ˧ ɠŧ ɠŧ ɠ˧ ɠƧ ɠŧ ɠ̧ ɠͧ ɠç ɠ̧ ɠŧ ɠ̧ ɠ˧ ɠ˧ 􍍠ɠҤ ɠŤ ɠŤ ɠŤ ɠΤ ɠԤ ɠԤ ɠĤ ɠҤ ɠĤ ɠɠɠɠɠɠɠɠɠɠħ 䍠ɠҧ 䍠ɠҧ 䍍ɠɠɠɠɠħ䍠ɠӧ 占  卪Ҡנ򠽠үנԠ砽үנԠ䠽үנĠүנϠ⠽үנ 蠽үנȠ㠽үנҠүנ̠үנ̠򠽠үנҠנˠנŠÍנԠčננōנԠƍנΠנԠנԠנǠנ נԠנƠנ̠堽үנŠנԠנРנ͠נΠÍנϠčנŠōנΠƍנӠנˠנ̠נŠנӠנԠנ٠נĠנԠנԠүנ٠נԠ砽үנǠÍנĠčנŠōנĠƍנҠүנҠ𠽠үנҠנԠנԠנ̠נŠנͲנ͠נŠנȠנРנԠÍנРčנ̠ōנĠƍנҠנϠנ͠נϠנˠנŠנŠנˠנƠנŠנ̠נĠנàÍנ̠čנҠōנ̠ƍנˍנˍ𠽠үנҠנŠנŠנŠנΠנԠנԠנĠנҠנӠ堽үנԠנԠנѠÍנѠčנѠōנѠƍ젽үנѠנԠנԠ㠽үנĠנҠנҠ蠽үנӠ󠽠үנ נԠנĠנĠנӠנÍ 󍪭Ӡ ɠ 䧍ɠ 姍ɠ 䧍ɠ 짍ɠ 򧍠ɠ 짍ɠ 짍ɠ ᧍ɠ 觍ɠ ɠ ɠ 种ɠ 짍ɠ ⧍ɠ 򧍠ɠ 姍ɠ 짍ɠ 򧍠ɠ 䧍ɠ 䧍ɠ ɠ 򧍠ɠ 짍ɠ Ʈ 󍪭Ӡ  à 宮ĸč à 宮ĸč à 䧸čà ĸčà 宮ĸč à 䧸č à č à 宮č 󍪭Ӡ  ɠ 𩺧 à 觸č à 䧸č ɠ 忧 à䧸č à ĸč ɠ ̬ ɠ ̬ à č ɠ ̬ ɠ  à ɠ 򿧍 à ĸč ɠ 婺 ɠ 婺 à é ĩ ũčàȩ ɩ ̩ Ω ө姰čàک 䧸čà 䧍à 婧İčà à à čà à à 姰čà à à ĸčà 䮧ĸč 󍪭Ӡ ɠ ɠӠӠ Ӡ Ԡ    ፠      àנΠ 䍠נα נβ נР נΠ נР נǠ נ̠ 썠נР נР נΠ àנԠ נԱ נԲ נԠ 占נԠ נԠ נǠ נԠ ݍנԠ נԠ נԠ Рԍԍэээээԍԍ̠ؠưưƍàв 󍍻 덍ˠà à Խ ͽ н ̽ н à à ؠ Ӡààà姍à䧍àà駍àؠ Ӡàà⧍à򧍠à򧍠ààà짍à种à𧍠ààà㧍Ơ ٠ ٍ͠Ӡ ƍˠӠ ፍҠӠ ĠӠРӠàӠŠӠ͠Ӡ͠ӠӠӠӠ Ǡ ͠ Ǡ àǠ àҠ 䍍Ӡ Š ͠ ͠ Ԡ Բ Р ΠΠ ԠӠƠ  ᅪϠ  詍  詍נ נ נ 卍Ҡ  Ÿ  Ҹ  ˠנ Ġ  ῍Ҳ  Ÿ    ˠנ Ġ  ῍Ҡ  Ը Ҹ ˠנǠ Ǡ  ͠נ ˠנ Ԡ  俍ƠӠ 卍ԍčǍ֠dzРǠԠРԍРԍР͍Р͍РҍРōРҍРÍРԍРҍР΍РÍРԍР԰РōР΍РōРōРōРˍРˍРōРˍРˍРÍō͠ Ʋ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Init Code * +* * +******************************** + DATE +*------------------------------- + +START1 JSR MOVECODE ;do memory move + JSR FATAL ;init stuff + JSR FATAL5 ;move file name (no return) + JMP FATAL6 + +START2 JSR MOVECODE ;move memory + JMP FATAL1 ;init w/o doing modem + +*------------------------------- +* do memory move and setup +*------------------------------- + +MOVECODE LDA SETRAM ;select main lc bank + LDA SETRAM + + LDA #ZDATA + STA TEMP+1 + + LDA #SYMTXT + STA TEMP2+1 + + LDY #0 ;start offset + LDX #>END_MV+$256 +:DO_IN2 LDA (TEMP),Y + STA (TEMP2),Y ;copy byte + INY + BNE :DO_IN2 + + INC TEMP+1 + INC TEMP2+1 + DEX + BNE :DO_IN2 ;count down + + LDY #80 +:INIT3 LDA PG3JMP,Y + STA ENTPOINT,Y ;copy jump table into place + DEY + BPL :INIT3 + LDA #IRQ_FIX + STA IRQVECT+1 + RTS + +ZDATA ORG RAMCARD + +*------------------------------- +* ----- actual tokens ----- +*------------------------------- + +SYMTXT DB -1 ;reserved + DB -1 ;reserved + DB -1 ;reserved + DCI 'END' ;end of module + DCI 'GOTO' ;goto statement + DCI 'GOSUB' ;gosub statement + DCI 'PUSH' ;push statement + DCI 'PUBLIC' ;public directive + + DCI ':' ;colon + DB -1 ;reserved + + DCI 'CLEAR' ;use ascii with hi-bit clear + DCI 'LINK' ;on text, set on last char + DCI 'HOME' ;home cmd, used wierd ways + DCI 'PRINT' ;print statement + DCI 'COPY' ;copy a file + DCI 'GET' ;get a character + DCI 'INPUT' ;input a line + DCI 'SETINT' ;set interupt keys + DCI 'ADDINT' ;add interupt keys + DCI 'FLAG' ;user flags + DCI 'NIBBLE' ;nibble function + DCI 'BYTE' ;byte function + DCI 'IF' ;if statement + DCI 'THEN' ;then statement + DCI 'ELSE' ;else statement + DCI 'RETURN' ;return statement + DCI 'POP' ;pop statement + DCI 'MODEM' ;modem statement + DCI 'LEN' ;string length + DCI 'ECHO' ;set video echo + DCI 'LOG' ;log to a drive + DCI 'OPEN' ;open a file + DCI 'CLOSE' ;close a file + DCI 'MARK' ;get/set function + DCI 'VAL' ;val function + DCI 'FREE' ;free statement + DCI 'POSITION' ;position statement + DCI 'SET' ;set statement + DCI 'READY' ;ready statement + DCI 'READ' ;read statement + DCI 'WRITE' ;write statement + DCI 'NOT' ;not statement + DCI 'KEY' ;key function + DCI 'EDIT' ;edit statement + DCI 'MSG' ;msg function + DCI 'REWIND' ;rewind statement + DCI 'TONE' ;tone function + DCI 'WIDTH' ;width function + DCI 'FOR' ;for statement + DCI 'TO' ;to statement + DCI 'STEP' ;step statement + DCI 'NEXT' ;next statement + DCI 'INSTR' ;instr function + DCI 'KILL' ;kill statement + DCI 'MOVE' ;move statement + DCI 'RAM2' ;ram2 value + DCI 'RAM' ;ram value + DCI 'CREATE' ;create statement + DCI 'CRUNCH' ;crunch statement + DCI 'UPDATE' ;update statement + DCI 'TEXT' ;text command + DCI 'APPEND' ;append statement + DCI 'FILL' ;fill statement + DCI 'ON NOCAR' ;on no carrier + DCI 'ON ERROR' ;on error + DCI 'ERR' ;error number + DCI 'RESUME' ;resume from error + DCI 'INFO' ;info function + DCI 'CLOCK' ;time function + DCI 'USE' ;use statement + DCI 'POKE' ;poke statement + DCI 'PEEK' ;peek function + DCI 'EOF' ;eof function + DCI 'SIZE' ;size function + DCI 'PDL' ;pdl function + DCI 'RANDOM' ;random function + DCI 'ASC' ;ascii function + DCI 'CALL' ;call statement + DCI 'STORE' ;store statement + DCI 'RECALL' ;recall statement + DCI 'LOCK' ;lock statement + DCI 'UNLOCK' ;unlock statement + + DCI 'CHR$' ;chr$ statement + DCI 'DATE$' ;date statement + DCI 'TIME$' ;time$ statement + DCI 'FMTDATE$' ;formatted date statement + DCI 'WHEN$' ;when$ statement + DCI 'LEFT$' ;left$ statement + DCI 'RIGHT$' ;right$ statement + DCI 'MID$' ;mid$ statement + DCI 'STR$' ;str$ statement + DCI 'RND$' ;rnd$ function + + DCI '<>' ;<> + DCI '><' ;>< + DCI '<=' ;<= + DCI '>=' ;>= + DCI '=<' ;=< + DCI '=>' ;=> + DCI '=' ;= + DCI '<' ;< + DCI '>' ;> + + DCI 'AND' ;and operand + DCI 'OR' ;or operand + DCI 'EOR' ;eor operand + + DCI '+' ;plus + DCI '-' ;minus + DCI '*' ;multiplication + DCI '/' ;division + DCI 'MOD' ;mod + DCI 'ABS' ;absolute value + DB 0 + +*------------------------------- +* token jump table +*------------------------------- + +SYMADR DW 0 ;00 +number = *-SYMADR/2 + DW DO_LET ;01 +string = *-SYMADR/2 + DW DO_LET ;02 +end = *-SYMADR/2 + DW DO_END ;03 +goto = *-SYMADR/2 + DW DO_GOTO ;04 +gosub = *-SYMADR/2 + DW DO_GSB ;05 +push = *-SYMADR/2 + DW DO_PUSH ;06 +public = *-SYMADR/2 + DW ERR ;07 + +chain = *-SYMADR/2 + DW NIL ;08 +chain2 = *-SYMADR/2 + DW NIL ;09 + +clear = *-SYMADR/2 + DW DO_CLR ;0A + DW DO_LINK ;0B + DW DO_HOME ;0C + DW DO_PRNT ;0D + DW DO_SHOW ;0E + DW DO_GET ;0F + DW DO_IN ;10 + DW DO_SINT ;11 + DW DO_AINT ;12 + DW DO_FLAG ;13 + DW DO_NIB ;14 + DW DO_BYT ;15 + DW DO_IF ;16 + DW NIL ;17 +else = *-SYMADR/2 + DW DO_ELSE ;18 + DW DO_RET ;19 + DW DO_POP ;1A + DW DO_MDM ;1B + DW DO_LEN ;1C + DW DO_ECHO ;1D + DW MOVNAME ;1E + DW DO_OPEN ;1F + DW DO_CLOS ;20 + DW DO_MARK ;21 + DW DO_VAL ;22 + DW DO_FRE ;23 + DW DO_POS ;24 + DW DO_SET ;25 + DW DO_RDY ;26 + DW DO_READ ;27 + DW DO_WRIT ;28 + DW DO_NOT ;29 +key = *-SYMADR/2 + DW DO_KEY ;2A + DW DO_EDIT ;2B +msg = *-SYMADR/2 + DW DO_MSG ;2C + DW DO_RWD ;2D + DW DO_TONE ;2E + DW DO_WID ;2F + DW DO_FOR ;30 +to = *-SYMADR/2 + DW ERR ;31 +step = *-SYMADR/2 + DW ERR ;32 + DW DO_NXT ;33 + DW DO_INST ;34 + DW DO_KILL ;35 + DW DO_MOVE ;36 + DW DO_RAM2 ;37 + DW DO_RAM ;38 + DW DO_MAKE ;39 + DW DO_CNCH ;3A + DW DO_UP ;3B + DW DO_TEXT ;3C + DW DO_APP ;3D + DW DO_FILL ;3E + DW DO_NOCD ;3F + DW DO_ONERR ;40 + DW DO_ERRNO ;41 + DW DO_RESUM ;42 + DW DO_INFO ;43 + DW DO_CLOK ;44 + DW DO_USE ;45 + DW DO_POKE ;46 + DW DO_PEEK ;47 + DW DO_EOF ;48 + DW DO_SIZE ;49 + DW DO_PDL ;4A + DW DO_RND ;4B + DW DO_ASC ;4C + DW DO_CALL ;4D + DW DO_STOR ;4E + DW DO_RCAL ;4F + DW DO_LOCK + DW DO_UNLK + + +strtyp = *-SYMADR/2 + DW DO_CHR ;50 + DW DO_DATE ;51 + DW DO_TIME ;52 + DW DO_FDATE ;53 + DW DO_WHEN ;54 + DW DO_LFT ;55 + DW DO_RGT ;56 + DW DO_MID ;57 + DW DO_STR ;58 + DW DO_RNDS ;59 +compare = *-SYMADR/2 + DW CP_NOT ;5A + DW CP_NOT ;5B + DW CP_LTEQ ;5C + DW CP_GTEQ ;5D + DW CP_LTEQ ;5E + DW CP_GTEQ ;5F +equal = *-SYMADR/2 + DW CP_EQ ;60 + DW CP_LT ;61 + DW CP_GT ;62 + +logic = *-SYMADR/2 + DW CP_AND ;63 + DW CP_OR ;64 + DW CP_EOR ;65 + +math = *-SYMADR/2 + DW DO_PLUS ;66 +minus = *-SYMADR/2 + DW DO_SUB ;67 + DW DO_MULT ;68 + DW DO_DIVD ;69 + DW DO_MOD ;6A + DW DO_ABS ;6B + DW 0 ;6C + +*------------------------------- +* system error messages +*------------------------------- + +ERRMSGS DB -1 + DCI 'Starting Module Not Found' + DCI 'Module Too Large' + DCI 'Label Not Found' + DCI 'Symbol Table Full' + DCI 'Syntax Error' + DCI 'Missing Symbol' + DCI 'Undefined Label' + DCI 'Missing Data' + DCI 'Type Mismatch' + DCI 'Overflow > 32767' + DCI 'Division By 0' + DCI 'String Too Long' + DCI 'Gosub Stack Full' + DCI 'Return Without Gosub' + DCI 'Bad Device Number' + DCI 'Illegal Filename' + DCI 'For Stack Full' + DCI 'Next Without For' + DCI 'Link Label Not Found' + DCI 'Message File Not Found' + DCI 'END of Program' + DCI 'Bad Drive Specifier' + DCI 'Unable to Load External' + DCI 'Unclosed quote at EOF......' + +*------------------------------- +* misc. messages +*------------------------------- + +MISCMSGS DB -1 + DB cr,cr + ASC 'Sysop is on-line...'0D8D + DB cr + ASC 'Sysop is off-line...'0D8D + DB cr,cr + ASC 'Sorry, time limit exceeded'8D + ASC '...please wait...'0D8D + ASC '...exiting exec mode...'0D8D + DB cr + ASC 'Error: Help file could not be opened'8D + DB cr + ASC 'File Write Error'8D + DB cr + ASC 'One moment please...'8D + +*------------------------------- +* editor messages +*------------------------------- + +EDMSGS DB -1 + DB cr + DCI 'Editing (?=Help):' + DB cr + ASC 'That is 4k worth'8D + DB cr + ASC 'Illegal Command'8D + DB cr + DCI 'Abort: Are you sure?' + DB cr + ASC 'Aborted'8D + DB cr + ASC 'Continue message now...'0D8D + DB cr + DCI 'Delete Line (L,x-y):' + DB cr + DCI 'Edit Line (L,x):' + DB cr + ASC 'Illegal line number'8D + DB cr + DCI 'Insert Line (L,x):' + DB cr + DCI 'List Line (x-y):' + DB cr + ASC .Insert text: + DB cr + DCI 'New: Erase and start over?' + DB cr + ASC 'Enter message now...'0D8D + DB cr + DCI 'Read File (name):' + DB cr + DCI 'Write File (name):' + DB cr + ASC 'A)bort, C)ontinue, D)elete, E)dit'0D + ASC 'H)elp, I)nsert, L)ist, N)ew, S)ave'0D + ASC 'Z) Space Used'8D + ASC 'Valid editor commands: ("/commmand" and' + ASC '".command" acceptable)'0D0D + ASC ' A = Abort ' + ASC ' Dx-y = Delete line(s) x-y ' + ASC ' N = New'0D + ASC ' H = Help ' + ASC ' Ix = Insert at line x ' + ASC ' S = Save'0D + ASC ' Z = Space ' + ASC ' Ex = Edit line x ' + ASC ' Lx-y = List line(s) x-y'0D8D + ASC ' Bytes Used.'0D8D + +*------------------------------- +* compiler messages +*------------------------------- + +COMPMSGS DB -1 + DCI 'One moment, compiling segment.' + DCI '..' + DS 32,bs + DS 32,' ' + DS 31,bs + DB bs+hibit + +MODEBYT DB %10000011 ;default, get 1 byte only + DB %11000001 ;upper / no blanks / no comma + DB %10100000 ;upper and return + DB %00100000 ;accept all and return + DB %01100000 ;no blanks / no comma / return + +INPVEC DW KEYIN ;console keyboard + DW DISKIN1 ;disk channel 1 + DW DISKIN2 ;disk channel 2 + DW NO_INP ;console input + DW MDMIN ;modem input + DW NO_INP ;line printer + DW RDMSG ;msg input + DW RDMAIL ;read mail + DW EDINP ;editor input + DW NO_INP ;no input from screen + DW RAMIN ;ram drive input + +OUTVEC DW COUT ;console output + DW DSKOUT1 ;disk channel 1 + DW DSKOUT2 ;disk channel 2 + DW VIDCOUT ;local console + DW ZMDMOUT ;modem output + DW PRCOUT ;line printer + DW WRMSG ;msg output + DW NO_OUT ;read mail [none] + DW EDOUT ;editor output + DW TOPPRINT ;print user stats + DW RAMOUT ;ram drive output + +JSTRCP DA ST_NOT + DA ST_NOT + DA ST_LTEQ + DA ST_GTEQ + DA ST_LTEQ + DA ST_GTEQ + DA ST_EQ + DA ST_LT + DA ST_GT + +DEVTBL HEX FF0000FFFFFF0000FFFFFF + ASC 'GP200001' ;fake serial number for peepers + +; screen top mask + +TOPMASK ASC '#..... ............................... ' + ASC 'Stats: CT=.. CM=... UP=.. DL=... BP=... ' + ASC 'Ph: ............ ........ ....-******** ' + ASC 'Flg: .................................. ' + +DAYINDEX DB 0,3,6,9,12,15,18 + +DAYS ASC 'Sun' + ASC 'Mon' + ASC 'Tue' + ASC 'Wed' + ASC 'Thu' + ASC 'Fri' + ASC 'Sat' + +MTHINDEX DB 0,3,6,9,12,15,18,21,24,27,30,33 + +MONTHS ASC 'Jan' + ASC 'Feb' + ASC 'Mar' + ASC 'Apr' + ASC 'May' + ASC 'Jun' + ASC 'Jul' + ASC 'Aug' + ASC 'Sep' + ASC 'Oct' + ASC 'Nov' + ASC 'Dec' + +TOPBUF DB 0 + +DUMMY = * ;standard memory allocation + + DUM DUMMY + + DS 159 ;finish up TOPBUF + +GSBSTK DS $20 ;gosub stack area + +FORVAR DS $10 ;for stack area +FOREND DS $10 +FORSTP DS $10 +FORLOC DS $10 + +DEVUSE DS 11 + +NUM DS 7 +TXTNUM DS 6 +FLPOS DS 6 + +DATA DS 4 +NUMB DA 0 +NEGFLG DB 0 +FREMEM DB 0 + +NOCDFLG DB 0 +NOCDVEC DA 0 + +ONERRFLG DB 0 +ONERRVEC DA 0 +FROMERR DA 0 ;where error occurred + +NULLS DB 0 +REMOTE DB 0 + +SYMNUM DB 0 +LBLNUM DB 0 +LNCNT DB 0 +LNCNT2 DB 0 +TOKTYP DB 0 + +REMAIN DA 0 +SIGN DB 0 +RESULT DS 3 + +MSGREF DB 0 ;is message file ready to go? + +MSGINFO DB 0 ;# of bit blocks (512k each) + DB 0 ;# of dir blocks (32 entries each) + DW 0 ;# of free blocks + DW 0 ;# of files + DW 0 ;# of newest message + +MSGPTR DB 0 ;point to message data +BYTE8 DB 0 ;7 -> 8 conversion counter +CHAR8 DB 0 ;7 -> 8 conversion data +RMXBLK DW 0 ;read mail block +RDEND DB 0 ;at end of data? + +MSGPTR2 DB 0 ;for write data +BYTE82 DB 0 ;second set of pointers + DB 0 ;second char8 buffer - not needed for write +WRKBLK DW 0 ;current working write block num +WRTEND DB 0 ;at end of data? + +RWDPTR DB 0 ;point to rewind data +RWDBYT8 DB 0 +RWDCHR8 DB 0 +RWDBLK DW 0 + +DIRSEG DA 0 ;current directory segment +BITSEG DB 0 ;current bit-map segment + +MSGNUM DW 0 ;current message number +POSBLK DW 0 ;postion block counter + +MSGINIT DB 0 ;is message currently being read? + +CHATBUF DS 90 ;storage area for chat routine + +LASTBYT + DEND + ORG +END_MV = *-ZDATA + +PG3JMP ORG $380 + +ENTPOINT JMP GETBYT + JMP CHKBYT + JMP GOBCOM + JMP INPNUM + JMP INPSTR + JMP MOVNAME + JMP BADERR + JMP SETIVEC + JMP GET + JMP GETCHR + JMP INPLN + JMP SETOVEC + JMP COUT + JMP DECOUT0 + JMP CREATE + JMP OPEN + JMP CLOSE + JMP RDBYTE + JMP WRBYTE + JMP RDBLK + JMP WRBLK + JMP RDLINE + JMP GETMARK + JMP SETMARK + JMP LOGSPEC + + DA FLNAME +REFNUM DB 0 + DA FBUF2 + + diff --git a/Source/Acos/OLD/atlk.test.S b/Source/Acos/OLD/atlk.test.S index 497ea9d..1dda359 100644 --- a/Source/Acos/OLD/atlk.test.S +++ b/Source/Acos/OLD/atlk.test.S @@ -1 +1,57 @@ -ɠư렽젽 堽Š Ӎ㶍Ƴ 퍠 􍍠Ҡɠ 멍 덠덍РŠ߰ 򍍠Ҡɠ  썠؍ؠ捠Ѡ߰ 䍍؍ĠƠ 卍à堻 占ؠ堻 ꍠ占㰠 ߰ӍҠӮʧӠ Ӡ櫤ؠ   נ 占 䍠̠栻 卍܍捍 \ No newline at end of file +MLI = $BF00 +Read_Blk = $80 +ATCall = $42 ;appletalk MLI call +NodeSave = $DE ;location to pass node # to ACOS +Prefix = $c6 +LastDev = $BF30 + +init LDA LastDev ;get the device we just lauched from + STA UnitNum ;save it + + JSR MLI ;do a block read (invalid under AppleTalk) + DB Read_Blk + DA r_block + + CMP #$88 + BNE init_0 ;did not boot off server + + JSR MLI ;get the user directory... + DB ATCall + DA FIUserPFX + + LDX copybuf + BEQ init_0 ;no user directory found + + DEX + LDA copybuf,x + AND #$0F ;strip of the $cx part of the ASCII eqiv. + STA NodeSave + + INC r_file ;kick file length up a byte + LDX r_file ;length of acos.obj + LDA NodeSave + ORA #$c0 ;make it an ascii # + STA r_file,x + +init_0 RTS + + + +r_file STR 'ACOS.OBJ' + DS 2 + +r_block DB 3 +UnitNum DS 1 + DA copybuf+$200 + DA 0 + +FIUserPFX DB $00 ;Synchronous Only + DB $2A ;Command +Result DW $0 ;Result Code + DB $00 ;Reserved + ADRL copybuf ;pointer to Pathname + + ds \ +copybuf + + diff --git a/Source/Acos/ROUTINE.S b/Source/Acos/ROUTINE.S index 5e36c4e..e46bc04 100644 --- a/Source/Acos/ROUTINE.S +++ b/Source/Acos/ROUTINE.S @@ -1 +1,1684 @@ -ǍӮʠ堠ō􍪭占ҠԍΠԠԠɠαà퍍ҠŠ뿍àααà٠αҠ΍ԠԠ̠αԠԠ̠α Ӡα 忍٠ŠβàԠ占ҠԠР΍αԠƠɠθРѠζРѠβ占РѠβ썠Р썠Šγ卍β٠Ѡα𿬠卍Ҡˠ占٠РѠβŠα쬠獍γРԠα򮮮٠΍Šδ荍Ƭ٠򍍠ōĠ𿍠ѠγŠ卍٠Р荠Ƭ٠РѠ쬠􍍠ؠ⍺γƬ٠፠РѠγ 占ٍŠγ獍٠Р荠ŠγŠγ ٍҠˠƬٍƬ؍؍٠ЍŠγ 䍍ؠР占Ҡԍ٠γàƬٍҠԠ፠ٍ٠ЍŠγÍРα􍍺θɠθζѠζθɠθγŠҠԠ썠РαδԠŠ̠δ卍Ҡ֠򍍺δԠŠ占àεРѠε ፠РŠε占٠Ѡε 卍εƬ٠ٍԠϠᅪɠε卍ύεҠԠε РαζƬ٠٠Šη卍Š忍ĠŠԠРΠ嬠ԠηРԠθƠ占Ӎ卪ˠ󠭠堭ҠԍҠԍРԍ򍪭ΠҠҠŠεβߢҠԠҠԍ̍ԫ۳ݠԫ򍍠ԠŠ獠̠ββ ԍԫγàԍŠγԫԠ􍍠àԫŠγ堲򍍠ԫ占ĠƠ 쿍Šγ썠ҠԲγ ԠǠ̠γ򍍠Ԡàɠγ捍àԫŠγ􍍠捠ƍӍγҠԠŠδ塍ԠԠ獠̠γδҠԠҠԍεӍԠӠ󍍪򠭭卪٠ҠҠŠٵҠԍٲҠٍԠŠ썠̠ٳҠōӠٳҠ΍Ҡͱ߲ƍӍٳàčŠٴ占àīī迍Ġ뿍ѠٲٴҠԠѠٳ占ҠΠ򍍺ٵӍРؠ堰в٠гҠĠҠԠٍ٠ȍŠг迍占Ҡԍ؍ؠŠв忬卍ҠԠ٠؍РԲԵŠ獠ҠōРԶԶȠРѠԲàǍŠԶǍԶРѠԲҠ׍ԲРԲԷƍԠ䍠РԲԸƠ捠ӠԹԠ䍠РԲԴРР𩍍󍪭ԠàčŠ԰䍠àī԰Ҡ٠䍠̠Բ卍Ġ鍠Π썠 РѠԹ忍РѠԸ濍РѠԷРѠԶРѠԵРѠԴР獠ŠԳ򿍍ԠԠ忍ɠԸԠà忍̠ϸРԸ ϸ àԠ􍍠٠֍٠ԠԱ쿬占٠𠲠ٍ٠֠Ҡ̠፠Ҡ̍ԱҠ֠ҠҠ占àкҠ֠à͠àٍ͍Բ፠ԠŠ̠Գ 卍ҠĠ򿍠àԳ 塍ҠΠ퍠àԳ ፍҠΠݠĠ頻ԳԠԠ̠Գ 卍РŠԳ쿬卍ޢҠ΍ԳҠ΍Գ РӍԸàԠ占àÍٍҠ֠􍍠ҠҠ占àǺҠ֠٠ٍРԲԸ Ҡ֍àà獠à͠à͍ҠԠ堲Ҡ֍؍ٍРԲŠ Ԡ à 卍蠯֠ȍȠ֍֍Ƞݍ֍Ӎ蠯֠ؠȠ٠֍ҠӍٍ؍Ӎ卪נ٠ٍ٠ҩ٠占àҍŠײàҫײ٠ٍӍ嬠􍪭ԠҠנ፠РŠԳ卍ҠԠ占ԍԳԠà忍̠ԴҠԠ卍ԴРӍ卪􍪠󍪭Ԡ٠ٍ٠ҩٍ٠ٍРŲӍ󍪭ՠؠ썠Šō፪͠ؠŠؠԠ占ҠԠ፠РԍѠŲ썍ؠРҠԠ РàЍŠРàЫРӍ򍪭ĠÍԠǠ뿍̠IJ卍ԠŠ忍̠IJҠĠ򿍠ӠIJҠͱ߲䍠ƍà򡍺IJӍ 婍ŠԠǠ뿍̠͵卍ԠƠɠʹΠΫѠ͵卍ҠΠРΫ占ѠͲŠͳԠ͵Ͳؠ΍Ԡ͵썍ͳؠҠǍƍʹà򠯠Ӎ͵à 썠Ӎ卪ƠҠ֠占РԠ̲РڧԠ̳̲Í̳Ӎ卪͠Ġ頻РԠͲРԠͳͲÍͳӍ􍪭֠Ġ頻Р᧍ԠֲРŠֲàƠ򬠭ֲӍԠԠԠɠֲ؍ҠԠѠԱР捠Š԰󍍠ҠβРԱ԰Ҡβ젣РŠ԰ÍҠ˴΍԰àРԱ ԰ԠƠ䍠̠Ա卍Ҡ֠Ա۰ݍԱԠƠ䍠̠ԱƠàԠ􍍠򿍠РҍѠԱà卍ҠԲԱàԱҠ占ԠƫɠԳԱҠҠԱ ؍ԲРѠԳῬ占ҍԠŠ쿍̠Բ͠卍ҠԍРŠԲ͍捠ҠԍӠ󿍠ѠԲΠ占ؠؠ؍РҠԠ썠؍ŠЍؠؠԲΠԲ͠Р썠ѠԍР捠ѠӍРԍӠؠ؍٠ٍҠӍؠ؍٠ٍӍԠԠ΍ɠԳР̍ԳӍҠ 򍪭ҠР⍠ѠƠ򿬠ؠؠ؍ؠΠƬؠ፠؍̠ұ썍ؠұؠԍѠҲؠΠؠؠ؍ӍҲؠؠ؍Ӎ򍪭ƠΠԍӍ򍪭Ҡؠ؍ؠԠؠ΍ѠҲῬ卍Ƭؠ؍̠ұ忍ؠұؠԠ卺Ҳؠؠ؍РӍԠؠ؍ؠύРͧ썠ѠҲРŠ̳Ҳ؍ҳ؍Ƭ؍Ѡ̲РѠҴРŠҵҴƬ؍ŠҳҵΠ̱؍Ƭ؍Ѡ̲РѠ̲РŠ̱̲ؠύؠ؍Ӎ̳Ġ鍠Ƭ؍Ѡ̵РѠ̴РŠ̵̴Ƭ؍àύؠ؍Ӎ̵ؠ؍ӍРؠ؍ؠؠǍ؍ؠύ٠вˬ؍Ƭ؍؍ٍŠвؠƍҠ΍ؠ؍ӍϠ נҠ֍٠Ҡō٠ǍҠōȍРŠв٠Ҡō٠ҠōвٍР֍ŠàǍؠӬٍ٠ױƬ؍̠ײԠō̠ײײҠԍ؍ٍŠױàǍ؍ӍӠ Ǡ ᠰ卪ҠΠΫٍҲà΍Šҳ占àΫҳ٠Ω٠占ѠҶ占ɠҴ􍍠ҠԠ썠РҵҴҠΠҵҠōРҲҶà΍ŠҷàΫҷ٠ٍРΩˠЍҠƠ̠ᠽᠪӠ˲٠ҬٍЍҫٍЫР占РЩ䍍˲Р덠ؠ獠РҠ򍍪卪ҠҠҠ占ҠԍԍؠҲƬؠ占؍ҠԍРŠҲԍӍ卪Ҡؠ؍ؠѠҲ򿬠占ҠԍҠԍӠ΍ӍΫؠ؍ҠDz捠Ҡԍؠ؍ҲӍ卪ǠӠ΍ӍΫРDz󍪭ǠӠ΍ӍΫРDz󍪭ǠӠ΍ӍΫ󍪭Dz٠፺dzΩٍٍŠǴàΫǴ̠忍àdz卍؍Šdz忬卍ǵΩ٠፠ЍĠ鍠ҠԠٍŠǶàΫǶЍ̠ǵ䬠嬠Ӎ􍪭Р٠ҩ٠占̠гؠРѠв؍РѠв῍؍Ҡ͠򿍠àвб؍вӍгؠРѠв򿍍؍Р獠Ѡв翍ؠРѠв򿍠Р젨ѠвŠб۰ݍø٠θРԠθ 卍à󠱰ٍŠθ䠱報θ 報ؠ占報Ӡ卍԰ؠͫ͠РԱ􍍪ۭݍԠҠӱ占ؠ̠ͫ͠Ա占ҠԍԱͫͫͫͫč٠卺Բ̠͍̠ͫͫàͫͫ젧ͫàͫͫ젧ٍ̠ͫŠԲĠ썠٠󍍺ԳͫĠƍŠԴᅪԠͫᅪ̠ԵԴàͫؠͫͫؠàͫҠԍԵؠԶ̠̠̠̠ͫͫͫͫ؍̠ԶٍɠԷŠԳ󍍠ؠͫ占̠ԳԷͫ͠荠Ӎ۰ݍΠ͍ͫǍҠԠ忍РŠβ占àǠ獠ҠԠ堭βҠԠ̠δҠ͍ӠδҠԠҠΠРβδؠ͠占ͫԠǠ忍̠Ӡ卍ҠӠӍ􍪭ΠĠƠ堰ͫͫؠγÍ͍àͫͫͫàͫͫ؍Šγͫ͠썠ͫͫӠ獍򍪭Π͍ͫǍ٠г٠忍РŠβ占àǠ獠àг堭Šβàгβ٠г٠Ҡ͍Ӡδ卍àгŠγàгγҠΠРβ󍪭Ԡ͍͠ؠҠ忍ŠԱؠԠ忍ŠԱРɠԱ卍ؠР獠ѠԳ翬卍ؠРѠԳ򿬠卍РѠԱ뿬卍Р̠Դ󍍺ԱҠ΍Ҡō٠堦؍ӍԳ٠占٠ҠРԱԱàҠ占РԱԴ؍٠ԍҍԍҫ؍ԵҩٍٍŠԵ卍àҫԵ̠忍àԵ占؍̠Ե獍Զҩ٠፠Ҡ΍ٍŠԶàҫԶ̠Զ͠썠РѠԱР荠ѠԱР⍠ŠԸԱҠ΍Ը РԱ͠ Ҡ 􍪭ŠҠ٠䍠Рڢ썠ѠűРڧ썠ŠųűŲҠԠѠŲųӍ򍪭ҠҠԍ؍ŠҍӍ̠٠°̲ÍҠԍҍٍŠٍ̲Ӎ卪ԠÍԲԳàŠԳàŠԲӍ򍪭Šؠ֍٠ȍٍŲҠĠƫٍٍ̠Ų卍ȍƠōƫ占Ӎ򍪭ŠؠƠ荠Ѡγፍ٠βƫٍҠԠ占ٍ؍ŠβγƫōӍ㮮àҠԠ卍Íàōԍƍàؠ獠ҠǍŠ占Ԡ獠ԠРŠ卍ò獠Ҡԍؠ㠻箮獠ҠǍÍà占ԍŠ卍ҠŠፍԠԠ占ӠԲ􍍠ԠԍӍà Ԡ 卪ԠҠŠ占Ԡà占ӠòԠԍàà卍Բؠ獠ҠǍŠ쬠㍠ԠҠԠ卍ԴҠΠ占ԠƍɠԶԠԠ̠Դ卍ؠ栻獠ҠǍҠŠ卍ԠԠ㿍ӠԶРàԶԠ獠ԍӍ􍪭Π٠ٍ፠٠Ҡɠβ卍֬٠፠àҠβ٠ٍӠ卍􍪭Ԡ٠ٍ٠Ҡ忍ɠԲ卍֬٠፠àҠԲ٠ٍӍ򍪭à̍؍ì؍Ҳë؍ҲӍ򍪭à̍؍ì؍ҍë؍ҫӍԠҠԠ፠РƠҿ占ŠͲ栻ƍҠԍҍͲӍ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Routine * +* * +******************************** + DATE +*------------------------------- +* get a line of input +*------------------------------- + +INPLNA LDA #cr ;print cr before getting line + JSR COUT + +INPLN BIT INCHAT ;in chat? + BMI :INPLN1C ;don't bug them + + JSR CHKTIME ;is time ok? + BCC :INPLN1A ;opps, timeout! + +:INPLN1C LDY #0 +:INPLN1 JSR KEYIN + BIT DOCHAT ;do chat? + BPL :INPLN1A ;no + + BIT INCHAT ;in chat? + BPL :INPLN1B ;no + + RTS ;return early + +:INPLN1B LDA #can ;do we need to del line? + CPY #0 + BNE :INPLN2 ;yep + + DEC INCHAT ;set inchat mode + JSR DO_CHAT ;do actual chat + JMP INPLN + +:INPLN1A BIT LOGOFF ;check for no carrier/timeout + BMI :JINPLN8 + + CMP #cr + BEQ :JINPLN6 ;return + CMP #bs + BEQ :INPLN2 ;back space + CMP #can + BEQ :INPLN2 ;ctrl-x / cancel + CMP #del + BNE :INPLN3 ;delete + +:INPLN2 CPY #0 + BEQ :INPLN1 ;can we back up?, nope + + PHA + JSR PRBACK ;do backspace + DEY ;decrease char count + PLA + CMP #can + BEQ :INPLN2 + BNE :INPLN1 ;if its a cancel, keep going + +:INPLN3 CMP #' ' + BLT :INPLN1 ;if its a control char... + + CPY VIDLEN + BNE :INPLN4 ;check for max length + + STA LNBUF,Y ;save last character + + LDA INPMODE + AND #%00010000 ;do word-wrap? + BEQ :INPLN3E ;nope + + STY TEMP ;save line length + LDA LNBUF,Y ;get last char + CMP #' ' + BEQ INPLNA ;all is well, just restart + + LDX #0 ;setup for inpln3b +:INPLN3A LDA LNBUF,Y ;check data + CMP #' ' + BEQ :INPLN3B ;we found a space + DEY + BNE :INPLN3A ;keep checking + + LDY TEMP ;get back length + BNE :INPLN3E ;opps, cant do word-wrap + +:INPLN3B INY + JSR PRBACK ;back up + LDA LNBUF,Y + STA LNBUF,X + INX + CPY TEMP + BNE :INPLN3B ;loop until all bs's and data copied + + STX TEMP ;save end pointer + LDA #cr ;start a new line + JSR COUT + + LDY #0 +:INPLN3C LDA LNBUF,Y + JSR COUT ;print data + INY + CPY TEMP + BNE :INPLN3C + JMP :INPLN1 ;go back for more input + +:JINPLN8 BMI INPLN8 +:JINPLN6 BEQ :INPLN6 +*:JINPLN8 BMI INPLN8 + +:INPLN3E LDA #7 + JSR COUT ;beep the stupid bell + JMP :INPLN1 + +:INPLN4 BIT INPMODE ;do we convert? + BPL :INPLN4A ;nope + + JSR CONV ;convert to upper + +:INPLN4A BIT INPMODE ;check the inpmode + BVC :INPLN5 + CMP #',' + BEQ :INPLN5B ;don't accept a comma + CMP #' ' + BNE :INPLN5 ;don't accept a space + CPY #0 + BEQ :INPLN5B ;for first char of the line + +:INPLN5 STA LNBUF,Y ;save char + INY + BIT VIDECHO ;special echo? + BMI :INPLN5A ;nope + + LDA VIDECHO +:INPLN5A JSR COUT ;print it +:INPLN5B JMP :INPLN1 ;loop + +:INPLN6 LDA #cr + STA LNBUF,Y ;save the return + CPY #0 + BNE INPLN7 ;was is just a return?, nope + + LDA INPMODE ;can we accept a blank line? + AND #%00100000 + BNE CROUT ;yep + + JMP INPLN ;don't take, cr, start over + +CROUT LDA #cr +INPLN7 JMP COUT ;print the return and exit + +INPLN8 LDA #cr + STA LNBUF ;return blank line + RTS + +*------------------------------- +* print a backspace +*------------------------------- + +PRBACK LDA #bs ;print bs - space - bs + JSR COUT + LDA #' ' + JSR COUT + LDA #bs + JMP COUT + +*------------------------------- +* get a character +*------------------------------- + +KEYIN JSR GETCHR ;get char from buffer + BNE KEYIN5 ;(if present) + +KEYIN2 LDA #"_" + JSR VIDCOUT ;print cursor + LDA #bs + JSR VIDCOUT + + LDA TOVAL + STA TIMEOUT+2 ;[32=1 minute] - 5 minutes + LDA #0 + STA TIMEOUT+1 ;reset medium counter + + LDA #150 ;local time constant + BIT REMOTE ;don't change anything + BPL :KEYIN2B + + LDA #36 ;get modem time constant +:KEYIN2B STA TIMEOUT + STA TIMEOUT+3 + +:KEYIN3 DEC TIMEOUT + BNE :KEYIN3A ;count down + + LDA TIMEOUT+3 + STA TIMEOUT ;reset low-byte constant + + INC TIMEOUT+1 + BNE :KEYIN3A ;cycle 256 counter + + LDA TIMEOUT+2 ;check time + AND #$1F ;do bell? + BNE :KEYIN3B + + LDA #7 ;beep bell + JSR COUT2 + +:KEYIN3B BIT NOCDFLG ;if no carrier vector + BPL :KEYIN3A ;don't bother + + BIT EXEC ;check for exec user + BMI :KEYIN3A ;skip logoff + + DEC TIMEOUT+2 + BNE :KEYIN3A ;count down minutes, still time left + + LDA #-1 ;signal logoff + STA LOGOFF + RTS + +:KEYIN3A JSR GET ;wait for keypress + BNE :KEYIN4 ;got one! + + BIT DOCHAT ;check chat flag + BPL :KEYIN3 + + LDA #0 ;return early +:KEYIN4 PHA + LDA #" " + JSR VIDCOUT ;remove cursor + LDA #bs + JSR VIDCOUT + PLA +KEYIN5 RTS + +TIMEOUT DS 4 ;timeout counters + +*------------------------------- +* get a character -- non destructable +*------------------------------- + +RDKEY JSR GETCHR ;get char from buffer + BNE :RDKEY5 ;(if present) + JSR VIDRDST + +:RDKEY2 JSR VIDRDKY + + BIT REMOTE ;we are local + BPL :RDKEY3 + + JSR CHKTIME + BCS :RDKEY3 + + JSR VIDRDFN + JSR MDM1_2 + LDA #-1 ;return without carrier + STA LOGOFF + RTS + +:RDKEY3 INC MONRND + BNE :RDKEY4 ;count down time + INC MONRND+1 + + LDA MONRND+1 ;count down high? + AND #%00001111 ;blink? + BEQ :RDKEY2 ;yep + +:RDKEY4 JSR GET ;check for keypress + BEQ :RDKEY3 ;nope + JSR VIDRDFN ;put back original char + +:RDKEY5 RTS + +*------------------------------- +* do a screen dump +*------------------------------- + +SDUMP TXA + PHA ;save x & y + TYA + PHA + + LDX #0 ;start at line 0 +:SDUMP2 LDY #0 ;start at char zero +:SDUMP3 JSR VIDRD ;read char from screen + JSR PRCOUT ;print char on printer + INY + CPY WNDWDTH + BNE :SDUMP3 ;at window width? + + LDA #cr ;add cr to line + JSR PRCOUT + INX + CPX #24 + BNE :SDUMP2 ;at last line?, nope + + JSR PRCOUT ;add extra cr + PLA + TAY ;restore x & y + PLA + TAX + JMP GET2 ;go back to get + +GET5 LDA PWHIDE ;toggle hide password flag + EOR #-1 + STA PWHIDE + JMP GET6A ;show screen top + +GET6 LDA WNDWDTH ;show other half of top + CMP #80 + BEQ JGET2 + + DEC TOPSEG + BNE GET6A + + LDA #3 + STA TOPSEG + +GET6A LDA WNDTOP ;show user stats + BEQ JGET2 + JSR TOPSHOW +JGET2 JMP GET2 ;go back to get + +GET7 LDA #$FF + STA DOCHAT ;signal chat is needed + JMP GET2 ;finish up + +GET8 LDA #-1 + STA LOGOFF ;signal logoff + RTS ;return no carrier status + +GET9 LDA #$80 + STA DOCHAT ;signal exec mode is wanted + JMP GET2 + +GET4 JMP SDUMP ;go to get4 (screen dump) + +*------------------------------- +* scan modem / keyboard for chars +*------------------------------- + +GET INC RND + BNE :GET0 ;setup random seed + INC RND+1 + +:GET0 JSR VIDKEY ;check local keyboard + BPL GET2 ;nope + + AND #clrhi + STA LASTIN ;last char from local + STA KBDSTRB ;get char + CMP #execon + BEQ GET9 ;exec mode? + CMP #logout + BEQ GET8 ;quick logoff? + CMP #chat + BEQ GET7 ;chat? + CMP #revtop + BEQ GET6 + CMP #toglpw + BEQ GET5 + CMP #prnscr + BEQ GET4 ;print screen? + CMP #bartog + BNE GET3 ;toggle bottom bar? + + BIT SHWTXT ;go into program trace mode? + BMI GET8A ;yep + + BIT SHWTRC ;exit program trace mode? + BPL :NO8B + JMP GET8B ;yep + +:NO8B DEC SHWTXT ;show user input + + TYA + PHA + LDY CV + CPY #22 + BLT :GET1A ;do we need to scroll?, nope + DEY ;move cursor up 2 lines + DEY + STY CV ;save new cursor position + JSR VIDSCRL ;scroll data + JSR VIDSCRL + +:GET1A LDA #23 + JSR SVCHCV ;save current horiz / very position + + JSR PR ;print message + ASC 'INP:'00 + + JSR LDCHCV ;restore position + DEC WNDBTM ;shorten screen + DEC WNDBTM + PLA + TAY + +GET2 LDA #0 ;no data + BIT REMOTE ;check modem? + BPL GET3B ;nope + + JSR CHKDCD ;is there carrier? + BCC GET3B ;nope! + + JSR MDMIN ;check modem + BCC GET3B ;no data + + ROR LASTIN ;put carry [set] into high bit + AND #clrhi ;strip high bit + +GET3 BIT SHWTXT ;show input? + BPL GET3B ;nope + + PHA + ORA #hibit + CMP #" " + BGE :GET3A ;is it a control?, nope + + PHA + LDA #"^" ;show control lead-in + JSR VIDBAN + PLA +:GET3A JSR VIDBAN + PLA + +GET3B CMP #0 ;set status + RTS + +GET8A INC SHWTXT ;select program trace + DEC SHWTRC + + TYA + PHA ;save Y + LDA #23 + JSR SVCHCV ;save current horiz / vert + + JSR PR ;print message + ASC 'PRG:'00 + + JSR LDCHCV ;restore position + PLA + TAY ;restore Y + JMP GET2 + +GET8B JSR SVCHCV + INC SHWTRC ;select nothing + INC WNDBTM ;select bottom 2 lines + INC WNDBTM + TYA + PHA + TXA + PHA + JSR VIDLST ;clear line 24 + JSR LDCHCV + PLA + TAX + PLA + TAY + JMP GET2 + +INPMODE DB 0 +SHWTXT DB 0 ;show users input +SHWTRC DB 0 ;show program trace + +*------------------------------- +* save current ch / cv +*------------------------------- + +SVCHCV PHA + LDA CH + STA OLDCH ;save old values + LDA CV + STA OLDCV + + LDA #0 + STA CH ;position to 0,[inparg] + PLA + STA CV + RTS + +*------------------------------- +* restore old ch / cv +*------------------------------- + +LDCHCV TXA + PHA ;save both x & y + TYA + PHA + LDX OLDCH ;position + LDY OLDCV + JSR VIDPOS + PLA + TAY + PLA + TAX + RTS + +*------------------------------- +* get a program byte +*------------------------------- + +GETRAW STY SAVE_Y + LDY #0 + LDA (PRGPTR),Y ;get byte + INC PRGPTR + BNE :GETRAW2 ;inc pointers + INC PRGPTR+1 + +:GETRAW2 LDY SAVE_Y + RTS + +*------------------------------- +* get a byte, test for text +*------------------------------- + +GETBYT JSR GETRAW ;get raw data + CMP #""" + BNE :GETBYT3 ;is it text?, nope + + PHA + EOR LSTTXT ;toggle text mode + STA LSTTXT + PLA + +:GETBYT3 BIT SHWTRC ;show trace? + BPL :GETBYT4 + + JSR LIST ;show trace + +:GETBYT4 CMP #0 ;set flags + RTS + +*------------------------------- +* check current program byte +* get program byte but +* dont inc pointers +*------------------------------- + +CHKBYT STY SAVE_Y + LDY #0 + LDA (PRGPTR),Y + LDY SAVE_Y + CMP #0 ;set flags +GOBBLE2 RTS + +*------------------------------- +* gobble an equal's +*------------------------------- + +GOBEQU LDX #equal + BNE GOBBLE + +*------------------------------- +* gobble a comma +*------------------------------- + +GOBCOM LDX #"," +GOBBLE STX GOBBYT ;save byte + JSR GETBYT ;get data + CMP GOBBYT + BEQ GOBBLE2 ;all is well + + LDX #syntax + JMP BADERR ;syntax error + +GOBBYT DB 0 + +*------------------------------- +* increment temp +*------------------------------- + +INCTMP INC TEMP + BNE :INCTMP ;increment temp by 1 + INC TEMP+1 +:INCTMP RTS + +*------------------------------- +* check carrier +*------------------------------- + +CHKDCD SEC + BIT NOCDFLG ;bother to check? + BPL :CHKDCD2 ;nope + + BIT REMOTE ;are we remote? + BPL :CHKDCD2 + + JSR MDMDCD ;is there carrier? + BCS :CHKDCD2 ;yep + + JSR MDM1_2 ;hang up user + LDA #-1 ;signal logoff needed + STA LOGOFF + CLC ;no carrier! +:CHKDCD2 RTS + +*------------------------------- +* check for timeout (total time online) +*------------------------------- + +CHKTIME BIT NOCDFLG ;bother to check? + BPL :CHKTM5 ;nope + + BIT LOGOFF ;in logoff mode already? + BMI :CHKTM4 ;yep + + LDA TIMEON ;is there a limit? + ORA TIMEON+1 + BEQ :CHKTM5 ;nope + + JSR SECON ;get time on + + CMP TIMEON+1 ;check low byte + BEQ :CHKTM2 + BGE :CHKTM3 + BLT :CHKTM5 + +:CHKTM2 CPX TIMEON + BLT :CHKTM5 ;check low, all is well + +:CHKTM3 LDX #timeup + JSR PRMSG + LDA #-1 + STA LOGOFF +:CHKTM4 CLC ;no carrier / timeout + RTS + +:CHKTM5 SEC ;all is well + RTS + +*------------------------------- +* is byte a letter? clc=yep, sec=nope +*------------------------------- + +TST_ALF PHA + JSR CONV ;change to uppercase + CMP #'A' + BLT :TST_AL2 + + CMP #'Z'+1 + BLT :TST_AL3 + +:TST_AL2 SEC +:TST_AL3 PLA + RTS + +*------------------------------- +* is byte a number? clc=yep, sec=nope +*------------------------------- + +TST_NUM PHA + AND #clrhi ;strip high bit + CMP #'0' + BLT :TST_NM2 + + CMP #'9'+1 + BLT :TST_NM3 + +:TST_NM2 SEC +:TST_NM3 PLA + RTS + +*------------------------------- +* convert lower to upper and clear high bit +*------------------------------- + +CONV AND #clrhi ;strip high bit + CMP #'a' + BLT CONV2 + + CMP #'z'+1 + BGE CONV2 + + SBC #$1F ;since carry is clear, -$20 +CONV2 RTS + +*------------------------------- +* output byte in A +*------------------------------- + +COUT BIT INTOUT ;output interrupt? + BMI CONV2 ;skip + STA SAVE_X + + JSR GET ;check for a char + BEQ COUT1B + + CMP #xoff + BNE COUT0 ;check for ctrl-s + + JSR KEYIN2 ;get a char + JMP COUT1B + +COUT0A JSR KEYIN2 ;check for serial # show access + CMP #pass + BNE COUT0C + + JSR CHK4SN + +COUT0C JMP COUT1B ;dont check for int + +COUT0 BIT INTBUF ;see if int's enabled + BPL COUT1A ;nope + + PHA + JSR CONV ;convert to upper + STA COUT1+1 ;point to parm [0-127] + PLA +COUT1 BIT INTBUF ;*** self-modified + BPL COUT1A + + LDA #0 + STA INTBUF ;no more int's + DEC INTOUT ;turn on output interupt + + LDA #cr ;was last char a cr? + CMP LASTCHR + BEQ COUT1C ;nope + + JSR COUT2 ;print cr + +COUT1C LDA COUT1+1 + STA INTCHR ;get converted byte + BIT INTBUF+127 ;special flag for (ctrl-x,ctrl-n) + BMI COUT3 + +COUT1A JSR PUTCHR ;save char in buffer + +COUT1B LDA SAVE_X + +COUT2 CMP #0 + BEQ COUT3 ;any data?, nope + STA LASTCHR + BIT REMOTE ;remote call? + BPL :COUT2M ;nope + + JSR MDMOUT + CMP #cr + BNE :COUT2M + + LDA #lf + JSR MDMOUT + LDA NULLS ;add nulls? + BEQ :COUT2N ;nope + STX SAVE_X ;save x + TAX + LDA #0 +]LOOP JSR MDMOUT ;send a null + DEX + BNE ]LOOP + LDX SAVE_X ;restore x + +:COUT2N LDA #cr +:COUT2M CMP #bel + BEQ :DOIT + + CMP #ff + BEQ :DO_CLS + JMP VIDCOUT + +:DO_CLS STX SAVE_X + STY SAVE_Y + JSR VIDCLS + LDX SAVE_X + LDY SAVE_Y + RTS + +:DOIT BIT LASTIN + BMI COUT3 + JMP DO_BELL + +COUT3 RTS + +INTCHR DB 0 + +*------------------------------- +* save character in input buffer +*------------------------------- + +PUTCHR CMP #clb + BEQ CLRBUF ;clear the buffer?, yep + + STX BUF_X ;save X + LDX TYPIN ;any room? + STA TYPBUF,X ;save data + INX + BPL :PUTCHR1 ;all is well + + LDX #0 ;reset pointer +:PUTCHR1 CPX TYPOUT + BEQ :PUTCHR2 ;overflow?, yep + + STX TYPIN ;save pointer + LDX BUF_X ;restore X + RTS + +:PUTCHR2 LDX BUF_X ;restore X + PHA + LDA #7 + PLA + RTS + +*------------------------------- +* clear the input buffer +*------------------------------- + +CLRBUF PHA + LDA #0 + STA TYPIN ;zero pointers + STA TYPOUT + PLA + RTS + +*------------------------------- +* get a character from the input buffer +*------------------------------- + +GETCHR LDA #0 ;default to no input + STX BUF_X + LDX TYPOUT ;get pointer + CPX TYPIN + BEQ :GETCHR2 ;any data?, nope + + LDA TYPBUF,X ;get character + INX + BPL :GETCHR1 ;inc pointer, still in range? + + LDX #0 ;reset pointer +:GETCHR1 STX TYPOUT ;update +:GETCHR2 LDX BUF_X ;restore X + CMP #0 + RTS + +*------------------------------- +* print user stats at top of screen +*------------------------------- + +TOPPRINT STX SAVE_X + PHA + LDX TOPSEGNO + CMP #'M'-ctrl + BEQ :TOPPR2 + CMP #"," + BNE PRTOPL3 +:TOPPR2 DEX +:TOPPR3 INX + LDA TOPBUF,X + BEQ PRTOPL2 + CMP #'.' + BEQ :TOPPR4 + CMP #'*' + BNE :TOPPR5 + +:TOPPR4 LDA #' ' + STA TOPBUF,X + BNE :TOPPR3 + +:TOPPR5 PLA + +PRTOPLN PHA +:PRTOPL1 INX + LDA TOPBUF,X + BEQ PRTOPL2 + CMP #'.' + BEQ PRTOPL2 + CMP #'*' + BNE :PRTOPL1 + +PRTOPL2 STX TOPSEGNO + PLA + LDX SAVE_X + RTS + +PRTOPL3 PLA + AND #clrhi + PHA + LDA TOPBUF,X + BEQ PRTOPL5 + CMP #'.' + BEQ :PRTOPL4 + CMP #'*' + BNE PRTOPL5 + PLA + ORA #hibit + PHA +:PRTOPL4 PLA + STA TOPBUF,X + INC TOPSEGNO + LDX SAVE_X + RTS + +PRTOPL5 PLA + LDX SAVE_X + RTS + +CLRTOP STX SAVE_X + PHA + LDX #1 + STX TOPSEG + DEX + STX TOPSEGNO + + LDY #160 +:CLRTOP2 LDA TOPMASK,X + STA TOPBUF,X + INX + DEY + BNE :CLRTOP2 + + LDX #$FF + JSR PRTOPLN + PLA + LDX SAVE_X + RTS + +TOPSEGNO DB 0 + +TOPSHOW TYA + PHA + LDA #1 + JSR SVCHCV + LDY #0 + JSR SHOWLINE + LDY TOPSEG + JSR SHOWLINE + + LDA WNDWDTH + CMP #80 + BNE :TOP2 + + LDY #2 + JSR SHOWLINE + LDY #3 + JSR SHOWLINE + +:TOP2 PLA + TAY + JMP LDCHCV + +SHOWLINE TXA + PHA + DEC INVFLG + LDX TOPSEGS,Y + LDY #40 + +:SHOW1 LDA TOPBUF,X + BPL :SHOW2 + BIT PWHIDE + BPL :SHOW2 + LDA #'*' +:SHOW2 JSR VIDCOUT + INX + DEY + BNE :SHOW1 + + INC INVFLG + PLA + TAX + RTS + +TOPSEGS DB 0,40,80,120 + +TOPSEG DB 1 + +*------------------------------- +* jsr pr data 0 -- quick print routine +*------------------------------- + +PR PLA + STA PRN ;save calling address + PLA + STA PRN+1 + TYA + PHA ;save Y + +:PR2 INC PRN + BNE :PR3 ;get next byte + INC PRN+1 + +:PR3 LDY #0 + LDA (PRN),Y ;get byte + BEQ :PR6 ;we're done + BMI :PR4 ;if high bit set use banner print + + JSR VIDCOUT ;otherwise use normal + JMP :PR5 + +:PR4 JSR VIDBAN ;print it +:PR5 JSR PAUSE + JMP :PR2 + +:PR6 INC PRN + BNE :PR7 ;inc for return + INC PRN+1 + +:PR7 PLA + TAY ;restore Y + JMP (PRN) + +*------------------------------- +* execute a token +*------------------------------- + +EX_TOK PHP + ROR IMMDEF ;save execution status + ASL ;a = a * 2 + BCS :EX_TOK2 ;opps, not a token! + TAY ;move to index + LDA SYMADR,Y + STA TEMP + LDA SYMADR+1,Y + STA TEMP+1 + PLP ;restore run state + JMP (TEMP) ;exec command + +:EX_TOK2 PLP ;remove from stack + LDX #seg2big + JMP BADERR ;syntax error + +*------------------------------- +* show an error message +*------------------------------- + +SHERR JSR ERROR ;show error message + LDA #'>' + JSR VIDCOUT + LDA LNCNT + PHA + LDX #0 ;reset line count +:SHERR2 LDA LNBUF,X ;print line + INX + JSR VIDCOUT + CMP #cr + BNE :SHERR2 + PLA + STA LNCNT + RTS + +*------------------------------- +* print an error message +*------------------------------- + +ERROR STX SAVE_X + CPX #0 + BEQ ERROR2 ;error?, nope + LDA #cr + JSR VIDCOUT + JSR VIDCOUT + LDA #ERRMSGS + STA PRN+1 + LDX SAVE_X + JSR PRMSG2 + LDA #cr ;print cr/lf + JSR VIDCOUT + LDX SAVE_X +ERROR2 RTS + +*------------------------------- +* print an editor message +*------------------------------- + +PREDMSG LDA #EDMSGS + STA PRN+1 + JMP PRMSG2 + +*------------------------------- +* print compiler messages +*------------------------------- + +PRCMPMSG LDA #COMPMSGS + STA PRN+1 + JMP PRMSG2 + +*------------------------------- +* print misc messages +*------------------------------- + +PRMSG LDA #MISCMSGS + STA PRN+1 + +*------------------------------- +* print error messages +*------------------------------- + +PRMSG2 LDY #0 ;get data +:PRMSG3 LDA (PRN),Y + INY + BNE :PRMSG4 ;move pointers + INC PRN+1 +:PRMSG4 ASL ;done? + BCC :PRMSG3 ;nope + + DEX + BNE :PRMSG3 ;done?, nope + +:PRMSG5 LDA (PRN),Y ;get data + PHP + AND #clrhi + JSR COUT ;show char + INY + BNE :PRMSG6 + INC PRN+1 +:PRMSG6 PLP + BPL :PRMSG5 ;end, nope, loop + RTS + +*------------------------------- +* get next type of input +*------------------------------- + +INPTYP LDY #0 + LDA (PRGPTR),Y ;get current program byte + BPL :INPTYP3 ;if some sort of token + + LDX #1 + CMP #"(" + BEQ :INPTYP2 ;is it an expression + + INX + CMP #""" + BEQ :INPTYP2 ;is it data? + + INX + JSR TST_NUM ;is it a number? + BCC :INPTYP2 ;yep + +:INPTYP1 INX +:INPTYP2 TXA + RTS + +:INPTYP3 LDX #6 + CMP #number + BEQ :INPTYP2 ;is it a var number? + + DEX + CMP #string + BEQ :INPTYP2 ;is it a var string? + + LDX #0 + CMP #chain + BEQ :INPTYP2 ;is it a statement separator? + CMP #chain2 ;is it an eol (chain2)? + BEQ :INPTYP2 + BNE :INPTYP1 ;must be a token + +*------------------------------- +* translate a binary to text [0-99] +*------------------------------- + +BINDEC8 LDY #0 ;start 10's counter +:BIN8A CMP #10 + BLT :BIN8B ;less than 10, were done + + SBC #10 ;minus 10 + INY + BNE :BIN8A ;add 1 to the 10's counter, loop + +:BIN8B ORA #'0' ;make 1's into text + TAX ;save + TYA + ORA #'0' ;make 10's into text + RTS ;done + +*------------------------------- +* decimal output without negative translation +*------------------------------- + +DECOUT0 STX NUM ;save number + STA NUM+1 + JMP DECOUT1 ;do normal output + +*------------------------------- +* display a decimal number [-32767 to +32767] +*------------------------------- + +DECOUT PHA ;save status + JSR DO_ABS1 ;make positive + STX NUM ;save number + STA NUM+1 + PLA + BPL DECOUT1 ;display negative sign? + + LDA #'-' ;show it is negative + JSR DO_OUT + +DECOUT1 LDA #0 + STA NUM+2 + STA NUM+3 + STA NUM+5 + STA NUM+6 + SED + + LDY #16 ;use decimal mode +:DECOUT2 ASL NUM + ROL NUM+1 + LDA NUM+2 + ADC NUM+2 + STA NUM+2 ;do actual 'woz' conversion + LDA NUM+3 + ADC NUM+3 + STA NUM+3 ;do actual 'woz' conversion + ROL NUM+4 + DEY + BNE :DECOUT2 ;loop down + + CLD ;done with decimal + LDY #4 ;print 5 digits + +:DECOUT3 LDA NUM+4 ;get digit + AND #$F + BNE :DECOUT4 ;is it zero? + + BIT NUM+5 ;is this a leading zero? + BPL :DECOUT5 ;yep + +:DECOUT4 DEC NUM+5 + ORA #'0' ;print digit + LDX NUM+6 + STA TXTNUM+1,X ;save number to memory + INC NUM+6 + JSR DO_OUT + +:DECOUT5 LDX #3 ;move up next digit +:DECOUT6 ASL NUM+1 + ROL NUM+2 + ROL NUM+3 + ROL NUM+4 + DEX + BPL :DECOUT6 + + DEY + BMI :DECOUT7 + BNE :DECOUT3 ;count down digits + + STX NUM+5 ;print last zero for sure + BPL :DECOUT3 +:DECOUT7 LDA NUM+6 + STA TXTNUM ;save number length + RTS + +*------------------------------- +* input a number from memory of from program [0-65535] +*------------------------------- + +NUMIN LDA #0 ;zero totals + STA NUM + STA NUM+1 + STA NEGFLG + + JSR CHKBYT ;is this negative? + CMP #minus + BNE NUMIN2 ;nope + DEC NEGFLG ;flag as neg + JSR GETBYT ;skip the - + +NUMIN2 JSR CHKBYT ;get digit + BPL NUMIN4 + + JSR TST_NUM + BCS NUMIN4 + + JSR GETBYT ;get digit + JSR XNUMIN ;process + JMP NUMIN2 ;loop + +NUMIN4 LDX NUM ;get the value + LDA NUM+1 + BIT NEGFLG ;was it negative? + BPL :POS ;nope + + JSR NEGXA ;invert it +:POS RTS + +*------------------------------- +* process digit +*------------------------------- + +XNUMIN AND #$F ;make into range 0..9 + STA NUM+2 + LDA #0 + STA NUM+3 + + LDX #10 ;(num+2) = (num+2)+(num*10) +:XNUMIN3 CLC + LDA NUM + ADC NUM+2 + STA NUM+2 + LDA NUM+1 + ADC NUM+3 + STA NUM+3 + DEX + BNE :XNUMIN3 ;num = num * 10 + + LDA NUM+2 + STA NUM ;move new total + LDA NUM+3 + STA NUM+1 + RTS ;keep going + +*------------------------------- +* input a number from a pointer +*------------------------------- + +ZNUMIN LDA #0 ;zero totals + STA NUM + STA NUM+1 + STA NEGFLG + + LDY #0 + LDA (TEMP3),Y ;is this negative? + CMP #'-' + BNE :ZNUMIN2 ;nope + DEC NEGFLG ;flag as neg + INC TEMP3 ;skip the - + BNE :ZNUMIN2 + INC TEMP3+1 + +:ZNUMIN2 LDY #0 + LDA (TEMP3),Y ;get char + JSR TST_NUM + BCS NUMIN4 ;we're done + + INC TEMP3 + BNE :ZNUMIN3 + INC TEMP3+1 + +:ZNUMIN3 JSR XNUMIN ;process digit + JMP :ZNUMIN2 ;loop + +*------------------------------- +* show the program as it runs +*------------------------------- + +LIST PHA + STA LSTNUM ;save all registers + TXA + PHA + TYA + PHA + + LDA LSTNUM + LDX LSTVAR ;are we showing a variable? + BNE :LIST10 ;yep + + LDX LSTTXT ;are we in text mode? + BNE :LIST11 ;yep + + CMP #0 + BMI :LIST11 ;is it a token?, nope + + LDX #"$" + CMP #string + BEQ :LIST3 ;is it a string?, nope + + LDX #"#" + CMP #number + BEQ :LIST3 ;is it a number?, nope + + CMP #chain2 + BEQ :LIST13 ;is it a statement link?, nope + + CMP #0 + BPL :LIST4 ;is it a token?, yes + +:LIST11 ORA #hibit ;display text + JSR VIDBAN + + JSR PAUSE + PLA + TAY ;restore & return + PLA + TAX + PLA + RTS + +:LIST3 LDY #2 ;setup to show next 2 variable + STY LSTVAR ;bytes + TXA + JMP :LIST11 + +:LIST10 DEC LSTVAR ;count down display time + JMP :LIST11 + +:LIST4 TAX + LDY #0 + LDA #SYMTXT + STA LSTPTR+1 + DEX + +:LIST5 LDA (LSTPTR),Y + INY + BNE :LIST5A ;goto next byte + + INC LSTPTR+1 +:LIST5A ASL ;we done? + BCC :LIST5 ;nope + DEX + BPL :LIST5 ;keep going + +:LIST6 LDA (LSTPTR),Y ;get data + PHA + + ORA #hibit ;display it + JSR VIDBAN + + INY + BNE :LIST6A ;inc pointers + INC LSTPTR+1 +:LIST6A PLA + BPL :LIST6 + + LDA LSTNUM ;check for tokens that use a label + CMP #goto + BEQ :LIST13 + CMP #push + BEQ :LIST13 + CMP #gosub + BNE :LIST8B + +:LIST13 LDA #":" ;also do chain statement + JSR VIDBAN + +:LIST8B LDA #" " + JMP :LIST11 + +LSTNUM DB 0 +LSTVAR DB 0 + +*------------------------------- +* check to see if pause should go into effect +*------------------------------- + +PAUSE JSR VIDKEY ;check local keyboard + CMP #"Z"-ctrl + BEQ :PAUSE1 + CMP #'Z'-ctrl + BNE :PAUSE3 + +:PAUSE1 STA KBDSTRB +:PAUSE2 JSR GET ;wait for a keypress + BEQ :PAUSE2 +:PAUSE3 RTS + +*------------------------------- +* repeat and print a character +*------------------------------- + +PRCHR JSR VIDCOUT + DEX + BNE PRCHR + RTS + +*------------------------------- +* standard Apple beep +*------------------------------- + +DO_BELL PHA + TYA + PHA + LDY #$B0 +:BELL2 LDA #$C + JSR WAIT + LDA SPKR + DEY + BNE :BELL2 + PLA + TAY + PLA + RTS + +*------------------------------- +* copy of monitor wait routine +*------------------------------- + +WAIT SEC +:WAIT2 PHA +:WAIT3 SBC #1 + BNE :WAIT3 + PLA + SBC #1 + BNE :WAIT2 + RTS + +*------------------------------- +* save current line into buffer +*------------------------------- + +SVLINE LDX CV + LDY WNDWDTH + DEY +:SVLINE2 JSR VIDRD ;read character + STA CHATBUF+2,Y + DEY + BPL :SVLINE2 ;save entire line + + LDA CH + STA CHATBUF ;save current ch position + LDA INPMODE + STA CHATBUF+1 ;save current input mode + RTS + +*------------------------------- +* restore current line in buffer +*------------------------------- + +RSTLINE LDX CHATBUF ;get length + BEQ :RSTLN3 ;no data + + LDY #0 +:RSTLN2 LDA CHATBUF+2,Y + JSR COUT ;print line + INY + DEX + BNE :RSTLN2 + +:RSTLN3 LDA CHATBUF+1 + STA INPMODE + RTS + +*------------------------------- +* set exec mode to verify users, etc... +*------------------------------- + +DO_EXEC LDA #2 + JSR VIDCHAT ;show exec on message + + LDA EXEC + STA OLDEXEC ;save old status + LDA REMOTE + STA OLDRMT + + LDA #$FF + STA EXEC ;set exec mode on + + LDX #hangon ;show ...please wait... msg + JSR PRMSG + + LDA #0 + STA REMOTE ;set to local input/output mode + STA DOCHAT ;reset chat flag + STA INCHAT ;no actually in chat + JMP RSTLINE ;restore copy of line + +EXEC2 LDA #0 ;get rid of exec mode flag + JSR VIDCHAT + + LDX #exitexec ;print ...exiting.. msg + JSR PRMSG + + LDA OLDEXEC + STA EXEC ;restore exec state + LDA OLDRMT + STA REMOTE ;restore remote state + + JSR RSTLINE ;put back extra + + BIT DOCHAT ;check chat mode + BVS CHAT2 ;go directly into chat + + LDA #0 + STA DOCHAT ;reset all modes + STA INCHAT + RTS + +OLDEXEC DB 0 +OLDRMT DB 0 + +*------------------------------- +* chat with user routine +*------------------------------- + +DO_CHAT JSR SVLINE ;save current line + BIT EXEC ;exit exec mode + BVS EXEC2 + + BIT DOCHAT + BVC DO_EXEC ;opps, we really want exec mode + +CHAT2 LDX #sysopon ;sysop online msg + JSR PRMSG + LDA #$30 + STA INPMODE ;accept u/l, cr, word-wrap, etc + LDA #0 + STA DOCHAT ;reset chat + JSR VIDCHAT ;turn off chat message + +:CHAT4 JSR INPLN ;get a line of type + BIT LOGOFF + BMI :CHAT6 + + BIT DOCHAT ;exit? + BPL :CHAT4 ;nope + + LDX #sysopoff ;sysop offline msg + JSR PRMSG + JSR RSTLINE ;restore line + + BIT DOCHAT ;do they want to exec? + BVS :CHAT6 + JMP DO_EXEC ;yep + +:CHAT6 LDA #0 + STA DOCHAT ;clear chat flag + STA INCHAT + RTS + +*------------------------------- +* handle ram drive input +*------------------------------- + +RAMIN STY SAVE_Y + LDA #0 ;default to no data + LDY RAMPTR ;get pointer + BMI :RAMIN2 ;opps, out of range + + LDA RAMDRV,Y ;get data + INC RAMPTR ;move pointer +:RAMIN2 LDY SAVE_Y + RTS ;we are done + +*------------------------------- +* handle ram drive output +*------------------------------- + +RAMOUT STY SAVE_Y + LDY RAMPTR ;is pointer in range? + BMI :RAMOUT2 ;nope + + STA RAMDRV,Y ;save data + INC RAMPTR ;move pointer +:RAMOUT2 LDY SAVE_Y + RTS + +*------------------------------- +* setup input vector +*------------------------------- + +SETIVEC TYA + ASL + TAX + LDA INPVEC,X + STA VECTOR2 + LDA INPVEC+1,X + STA VECTOR2+1 + RTS + +*------------------------------- +* setup output vector +*------------------------------- + +SETOVEC TYA + ASL + TAX + LDA OUTVEC,X + STA VECTOR + LDA OUTVEC+1,X + STA VECTOR+1 + RTS + +*------------------------------- +* send to modem only +*------------------------------- + +ZMDMOUT JSR MDMOUT ;send data + CMP #cr ;add LF to CR?, nope + BNE :ZMDM2 + + LDA #lf ;send LF + JSR MDMOUT + LDA #cr ;set back to CR +:ZMDM2 RTS diff --git a/Source/Acos/START.S b/Source/Acos/START.S index f6a8c06..ce721a1 100644 --- a/Source/Acos/START.S +++ b/Source/Acos/START.S @@ -1 +1,267 @@ -Ǎ Ӯ ō ɍ̠Ҡԍ̱ҠԍҠԍ ɍҠƍĠ ͠ 䍠͍ؠؠōؠԠ ؠԍؠ΍ؠΫؠƍؠƍؠԍؠ̍ؠ̍ؠ΍؍ؠōà 卍͠ ̲Ҡōà͍̠̲ؠ̳Ьؠ  ؍Š̳ƍР 󍍠٠ 卺̴ٍ̬Ŭ̴ٍٍ̠Ԡ ÍԍëҠ 占֍Ӎ̵ؠРǬؠ 占Ҡ֠ 占Ŭ؍؍̠Ѝ̶ؠҠà ҠĠ 卍ҠҍıĠ 퍠ҍčҫؠƠ 덠ӍIJҠԠ Р䍠Ԡij 卍ҠԠ占Рɠؠ 򍍺ijĠ 䍠à 䍠Ҡˠ ԠƠ 򿍠̠IJ卍Ҡ̳ à 占ҍëҫǠ 獠ƍРIJ 獍Ԡà֠ à 占Ԡ 􍍠РԱ 󍪭ؠؠ ŠҍƠؠ젻 썠ŠҍĠؠ砻 ҠؠϠ ԠǍ̠ԍҠ 䍠ҍҫҫà 占ҍëҫǠ 獠РIJԠҠҠ Ա͠ 䍠͍Š 卍Ҡͱ߲ 퍍Ҡҍà Ժ Ӭͬ Р ЫвԲԠѠԲ卍àЍŠԲàЫ ŠԲàвŠԲàԠ РԳ 퍍ԲҠԠ Ҡ֠ 占РӧѠԳ 퍍РͧѠԴ 卍РѠԵ 򍍠РѧŠԲ􍍠ҠԠ 獍ƍǠ 獍Ҡɍ ԍԳ 占ԍҠ̠ Р̵ԴРı Ե͠ 퍠Р΍ ؠĠŠčɧ썠ԍҠ΍Ҡ΍ٍ؍ɍĠ͍Рԩ ǠҠήǧ 占ӠǬԠ ӠԠ    \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Start * +* * +******************************** + DATE +*------------------------------- + + ;FATAL SEI +FATAL JSR MDMINIT +FATAL1 JSR VIDINIT + JSR PRINIT + STA KBDSTRB +; SEI + JSR CLRBUF + LDA LORESMD ;** it makes things work !! ** + + LDA SETRAM ;select ram card + LDA SETRAM + + LDX #0 + STX REMOTE + STX DOCHAT ;turn off chat + STX INCHAT + STX TIMEON + STX TIMEON+1 + STX LOGOFF + + STX MSGREF + STX LSTTXT + + STX GSBLVL + STX FORLVL + + STX ANU_ON + DEX + STX PWHIDE + + LDA #$60 + STA USERVEC ;put RTS in modem-user-routine + + LDA #4 + STA REFNUM ;close all files +:FATAL2 JSR CLOSE + DEC REFNUM + BPL :FATAL2 + + LDA #1 + LDX #23 +:FATAL3 STA BITMAP,X ;move 1 - 000 pattern + LDA #0 ;and free up memory + DEX + BNE :FATAL3 + + LDA #$CF + STA BITMAP ;protect bottom pages + + LDY #10 ;reset device table +:FATAL4 LDA DEVTBL,Y + STA DEVUSE,Y + DEY + BPL :FATAL4 + + LDA #RESET + STA RESETVEC+1 + + EOR #$A5 ;get power-up byte + STA SOFTEV + + RTS + +FATAL5 LDX #15 +:STARTUP LDA BBS_PRG,X ;copy default filename + JSR CONV ;convert to upper case + STA FLNAME,X + DEX + BPL :STARTUP + +FATAL6 LDA #'A' + LDX #0 + JSR LOGSPEC ;log to A: + + JSR LD_MOD ;load module + + JSR CLEAR + +RUNMOD1 LDA #CODEND + STA PRGPTR+1 + + LDX #$FF ;set up stack + TXS + +RUNMOD2 JSR CHKBYT ;get token + CMP #end + BLT :RUNMOD3 ;if 'let', don't get byte + + JSR GETBYT ;gobble + CMP #0 + BMI SYNTAX ;special character? Y = error + +:RUNMOD3 STA CMD ;save cmd + SEC ;mark as command + JSR EX_TOK ;execute it + BIT LOGOFF ;drop user? + BPL RUNMOD2 ;nope + + JSR DO_CL3 ;close all open files + LDA NOCDVEC ;point to no cd routine + STA PRGPTR + LDA NOCDVEC+1 + STA PRGPTR+1 + + LDA #0 + STA NOCDFLG ;reset cd flag + STA LOGOFF + + JMP RUNMOD2 ;keep going + +RESET INC SOFTEV ;make sure next reset reboots + LDA #0 + STA SHWTRC ;clear trace mode + STA AUTORST ;disable auto reset + + JMP RESTART1 + +*------------------------------- +* enter error dispatch routines +*------------------------------- + +SYNTAX LDX #syntax ;syntax error + BNE BADERR + +NOLBLDEF LDX #nolabel ;undefined label + BNE BADERR + +DO_END LDX #endprog ;end of program +BADERR STX ERRNO ;save error # + BIT ONERRFLG + BPL :KILLIT + + LDA PRGPTR ;save where error occurred + STA FROMERR + LDA PRGPTR+1 + STA FROMERR+1 + + LDA ONERRVEC ;point to error handler routine + STA PRGPTR + LDA ONERRVEC+1 + STA PRGPTR+1 + + LDA #0 + STA ONERRFLG ;reset onerr flag + JMP RUNMOD2 + +:KILLIT JSR ERROR ;show error +RESTART1 LDA SETRAM ;select ram card + LDA SETRAM + + LDA #0 + STA REMOTE ;turn off remote + + JSR MDM1_2 ;hang up modem + + JSR PR + ASC "*** RESTART: S,M,Q ?"00 + + LDA #0 + STA TEMP ;start restart timeout + STA TEMP+1 + LDA #-10 + STA TEMP2 + +:REST2 LDA AUTORST ;auto-restart? + BEQ :REST2A ;nope + + INC TEMP + BNE :REST2A + INC TEMP+1 ;do low/med counter + BNE :REST2A + + INC TEMP2 + BNE :REST2A + + DEC AUTORST ;countdown auto-restart count + JMP REST3 ;restart system + +:REST2A JSR GET ;get input + JSR CONV ;make upper case + CMP #'S' + BEQ REST3 ;restart system + + CMP #'M' + BEQ REST4 ;restart module + + CMP #'*' + BEQ REST5 ;goto monitor + + CMP #'Q' + BNE :REST2 ;quit + + JSR MDMQUIT ;reset the modem before quiting + + LDA #$FF + STA INVFLG ;reset inverse flag + + JSR MLI + DB $65 + DA P_QUIT + +REST3 LDA #3 ;reset auto-restart byte + STA AUTORST + + JSR FATAL ;cold start + JMP FATAL5 + +REST4 JMP RUNMOD1 ;warm start + +REST5 LDA SETROM ;enable rom + JMP ENTRMON + +*------------------------------- +* handle an incoming irq (and fix it) +*------------------------------- + +IRQ_FIX STA IRQ_A + PLA + PHA + AND #%00010000 + BNE :BRKD + LDA IRQ_A + PHA + TXA + PHA + TYA + PHA + LDA #'I'-ctrl + STA TOPRIGHT + JSR MDMIN + JSR MDMIN + PLA + TAY + PLA + TAX + PLA + RTI + +:BRKD STA SETROM + JMP (IRQVECT) + +* save buffers & variables + +BBS_PRG STR 'LOGON.SEG' ;main segment name + DS 16-*+BBS_PRG,$20 + +P_QUIT DB 4 + DS 6 + +AUTORST DB 3 ;allow auto-restart 3 times + +IRQ_A DB 0 + + diff --git a/Source/Acos/VAR.S b/Source/Acos/VAR.S index d1b0ace..96b73cd 100644 --- a/Source/Acos/VAR.S +++ b/Source/Acos/VAR.S @@ -1 +1,761 @@ -Ǎ Ӯ ō󍪭ԠҠԠҠԠ占ōҠԍūРѠԳ򍍠Р獠ѠԲ獍ؠРҠ򡍍ԲŠ獠ŠԳ͍ЍͫЫԵà𠽠𠭠ЍàЍЫàЫ٠Щ٠占ѠԸ򍍠РōŠԵ荍ٍЩ٠占РūŠԵ荍Էà򠽠𠫠àЍҍؠؠàЫҫӍԸÍЫàͫ占ҍÍàͫͫ占占͍àЫ٠ƹؠ蠰ԹٍŠàЫЩٍ؍ŠԹ٠ōЩ٠占ٍūЩٍРԷ󍍪͠РЫввҠͰͳҠԍɠͳР占Š͵󍍺ͳв捠вЫЍР͵ҠͲРͳ󍪭ȠҠͰȱҠԍɠР荠Ԡ 䬠卍ҠͲРȱҠҠԠ占Ҡ͍Ҡ 򍍠ҠԍРѠҲ忬ؠРҍ卪 ؠ«ҲӍ ؠ«Ӎ򍪭Ͱ؍ҠҠԠРѠͰ፠РѠͰРѠͰР獠ѠͱРѠͱРѠҠРԠͲР占Ԡͱ翍Р̠ͲҠ͍àͱؠРҍͰҠԍ٠جҩٍ؍ٍҩٍР 􍍺ͱҠРРͰؠᠻ፠РҍͱҠ΍Ҡ Р̠ؠ썠РҍͲ፠Ҡԍà占ҠˠĠ῍ŠͲͳؠ堻РҍͲؠ፠Р􍪭ǠҠǠĠŠͳ笠Р 󍍪􍪭ǠҠǠĠѠͳӍ􍪭ǠҠԠ፠РѠDzРѠDz􍍺DZؠᠻ፠РҍDzҠР堨積ЍӠdzҠ͍РǴdzҠҍǴҠԠ占ؠРѠǵ忬ҠԠؠРŠDZ笠嬠򍍺ǵ򠽠獠Р򠽠堠̍РӍРҠԍРѠб􍍠РѠвРɠв􍍠Р獠Ѡб򍍠РԠв笠Р占Šв卍бà獠ӍвàӍҲҍҫҠҍҫҍӍ獪ҠҠҰëؠÍ٠΍ҠԍР荠ŠƠ􍍠ҫҍҠԠ占Ҡٍ ҫҍҠҰ獠ëؠÍ٠΍ҠҫΠ荠Ҡ٠獠΍ҠԍР荠Šà嬠􍍠ҠԠ占РàΠ፠ÍëƠë捠ؠÍ٠΍Ӎ獪ҰҠԍРѠұ􍍠Р獠ŠҵҠԠ٠ҩ٠ٍҩ٠؍٠ҩ٠荠ٍӍұҠԠ占ؠҠҫ٠ҲҠԠ荠РѠҴ䍍ٍŠҲؠ砻ҳРҍҴ፠Ӎҵ占Ҡԍà占Ҡˠؠ占ĠѠҳؠ፠٠Ӎ򍪭٠٠в٠΍Ѡг卍éٍҩ٠占àΠ荠ѠҲǠ獠ٍŠвг䍠ÍàҍҍàҫҫӍҲǠؠ砻獠Рҍ堲󍪭РҠ占ҫҠҠ砱à፠гëг΍вፍҠԍР占Ԡи卍Р㍠ŠиҠԠÍà占̍ҠҠ獠؍Ь؍ЍЫ؍ЫРЩиؠ蠽䍠в蠾䍠Ѡйؠйҫ捠ҍӍѠҠэРйԠҠэҠԍРйԠҠԍРйԠҠԍРйѠҠԍҠԍРйѠҠԍҠԍРй󠭭Ѡؠвؠ΍ŠѰ٠Ѳٍ٠΍Ѡѱ忬гٍРéٍѠѲ묠獍ѰؠӍѱؠӍԠؠв荠ؠ΍ŠԲؠ΍ؠвԲ٠Գٍ٠вѠ԰гٍРéٍѠԳԠԱŠ԰вР΍Ӡ԰ԱؠӍ԰ؠӍԠؠΠ荠ؠвŠԲؠвؠ΍Բ٠Գٍ٠΍Ѡ԰éٍРгٍѠԳԠԱŠ԰΍РвӠ԰ԱؠӍ԰ؠӠӍŠؠҫ؍ؠͫԠӠ뿬썍Š͠ЍͫЫ͠占гͫгÍ͍à͍вͫàͫв͠栱卍ŲÍЍàРЫàЫ٠ЩٍѠŴ占̠Ų󍍠٠ЩٍҠ獠ٍЩٍҫѠŲ獍РčԠŲ笠􍍠ٍЩٍ؍ѠŲ٠򍍠ÍгàвЩٍٍгàвЩٍ٠ųҩٍгٍٍ؍ŠųÍàгггàŲ獍àгà͍РŲ獍ŴÍгàвҠгàвҫ͠占ЍͫЫ͠вͫвؠ͠占٠ŵвٍЩٍٍŠŵàЫàв؍Šŵ占Ӎ \ No newline at end of file + PAG +******************************** +* * +* ACOS.OBJ - Variables * +* * +******************************** + DATE +*------------------------------- +* set up pointers to variables +*------------------------------- + +VARSET JSR GETBYT ;get string or number indicator + PHA + JSR GETBYT ;get name + STA VNAME + JSR GETBYT + STA VNAME+1 + PLA + CMP #number + BEQ VARSET3 ;handle number + + CMP #string + BEQ :VARSET2 ;handle string + + LDX #syntax + JMP BADERR ;syntax error! + +:VARSET2 LDA VNAME ;show it's a string + ORA #hibit + STA VNAME ;point to start of pointers +VARSET3 LDA HIMEM + STA TEMP + LDA HIMEM+1 + STA TEMP+1 +:VARSET5 SEC ;temp = temp - 6 + LDA TEMP + SBC #6 + STA TEMP + LDA TEMP+1 + SBC #0 + STA TEMP+1 + + LDY #0 + LDA (TEMP),Y ;check low byte + BEQ :VARSET8 ;create new var + + CMP VNAME + BNE :VARSET5 ;no match + + INY + LDA (TEMP),Y ;check high byte + CMP VNAME+1 + BNE :VARSET5 ;no match + +:VARSET7 CLC ;vptr = temp + 2 + LDA #2 + ADC TEMP + STA VPTR + TAX ;return with A & X pointing at var + LDA #0 + ADC TEMP+1 + STA VPTR+1 + RTS + +:VARSET8 SEC + LDA TEMP+1 + SBC LOMEM+1 ;find total string space + LSR + CLC + ADC LOMEM+1 ;find boundary + STA MIDMEM+1 ;save high byte + LDA #0 ;save low byte + STA MIDMEM + + DEC TEMP+1 + LDY #$F9 ;do next entry also + LDX #10 ;fill rest with 0's + LDA #0 +:VARSET9 INY + BNE :VARSETA + INC TEMP+1 +:VARSETA STA (TEMP),Y + DEX + BNE :VARSET9 + + LDY #0 + LDA VNAME + STA (TEMP),Y ;save the var name + INY + LDA VNAME+1 + STA (TEMP),Y + JMP :VARSET7 ;set up pointers + +*------------------------------- +* input a number or expression +*------------------------------- + +INPNUM LDA TEMP ;save temp var's + PHA + LDA TEMP+1 + PHA + LDA TEMP2 + PHA + LDA TEMP2+1 + PHA + + JSR INPNUM0 ;get initial number +:INPNUM3 JSR CHKBYT + BMI :INPNM3A + + CMP #compare + BGE :INPNUM5 ;don't do compare operands + +:INPNM3A PLA + STA TEMP2+1 ;restore stuff + PLA + STA TEMP2 + PLA + STA TEMP+1 + PLA + STA TEMP + JMP GETNUMB + +:INPNUM5 JSR INPNUM2 ;exec token + JMP :INPNUM3 + +*------------------------------- +* input a number of expression for math operations +*------------------------------- + +INPMATH JSR INPNUM0 ;get initial number +INPMTH1 JSR CHKBYT + BMI GETNUMB + + CMP #math + BLT GETNUMB ;check for math operand, we're done + + JSR INPNUM2 + JMP INPMTH1 + +*------------------------------- +* input a paren +*------------------------------- + +INPPAR JSR GETBYT ;get the byte + JSR INPNUM + JSR SAVNUMB ;save number + + JSR GETBYT + CMP #")" + BEQ INPPAR2 ;was close there?, yep + + LDX #syntax ;syntax error + JMP BADERR + +*------------------------------- +* finish up here +*------------------------------- + +GETNUMB LDX NUMB + LDA NUMB+1 +INPPAR2 RTS + +SAVNUMB STX NUMB + STA NUMB+1 + RTS + +*------------------------------- +* input a number +*------------------------------- + +INPNUM0 LDA #0 ;init number + TAX + JSR SAVNUMB + JSR CHKBYT ;get next token + CMP #chain + BEQ :INPNM0A ;missing data + CMP #chain2 + BEQ :INPNM0A + + CMP #number + BEQ :INPNM0 ;check if var + CMP #string + BEQ :INPNM1 + CMP #""" + BEQ :INPNM1 + + CMP #"(" + BEQ INPPAR ;if an expression + + CMP #strtyp + BLT INPNUM2 ;check if other token + CMP #compare + BLT :INPNM1 ;is it a string? + CMP #0 + BPL INPNUM2 ;is it a token? + + JSR TST_NUM + BCC :INPNUM1 + + LDX #syntax ;syntax error + JMP BADERR + +:INPNM0 JSR VARSET + + LDY #0 ;get value of variable in X,A + LDA (VPTR),Y + TAX + INY + LDA (VPTR),Y + JMP SAVNUMB ;save it + +:INPNM1 JSR STRCMP ;get value of expression + LDA #0 ;save the number + JMP SAVNUMB + +:INPNM0A LDX #nodata ;missing data + JMP BADERR + +:INPNUM1 JSR NUMIN + JSR SAVNUMB ;save number + CMP #0 + BPL GETNUMB + LDX #nosymbol + JMP BADERR + +INPNUM2 LDA #0 + STA DATA ;reset data + JSR GETBYT + CLC ;call from somewhere else + JSR EX_TOK ;exec the token + LDA DATA + AND #1 ;did we get valid data? + BNE INPNM2 ;yep + +INPNM3 LDX #badtype ;type mismatch error + JMP BADERR + +INPNM2 LDX DATA+1 ;transfer data + LDA DATA+2 + JMP SAVNUMB + +*------------------------------- +* input a numeric argument +*------------------------------- + +INPNARG JSR INPARG ;do input + AND #1 + BNE INPNM3 ;if string, error + JMP GETNUMB ;return values + +*------------------------------- +* input a string argument +*------------------------------- + +INPSARG JSR INPARG ;do input + AND #1 + BEQ INPNM3 ;if number, error + RTS + +*------------------------------- +* input a argument +*------------------------------- + +INPARG JSR GETBYT ;get data + CMP #"(" + BEQ :INPARG2 ;check for start or continuation + CMP #"," + BEQ :INPARG2 ;of an argument + +:INPARG1 LDX #nodata ;missing data + JMP BADERR + +:INPARG2 JSR ARGTYP ;find out type (number or string) + PHP + BCS :INPARG3 + + JSR INPNUM + JMP :INPARG4 + +:INPARG3 JSR INPSTR +:INPARG4 JSR CHKBYT ;check next byte + LDX #1 + CMP #"," + BEQ :INPARG5 ;is there more?, yep + + JSR GETBYT ;get the rest + LDX #0 + CMP #")" + BNE :INPARG1 ;of arg, nope, error + +:INPARG5 TXA ;bit 0 : clear = number set = string + PLP ;bit 1 : clear = done set = more args + ROL + CMP #0 + RTS + +*------------------------------- +* find out type of data/token +*------------------------------- + +ARGTYP JSR CHKBYT + CMP #""" + BEQ :ARGTYP1 ;if it's text + + CMP #"(" + BEQ :ARGTYP2 ;if it's an expression + + CMP #0 + BMI :ARGTYP2 ;if it's other than text + + CMP #string + BEQ :ARGTYP1 ;if it's a string var + + CMP #strtyp + BLT :ARGTYP2 ;if it's a string, set the carry + + CMP #compare + BGE :ARGTYP2 ;make sure it's in range + +:ARGTYP1 SEC ;it's a string + RTS + +:ARGTYP2 CLC ;it's a number + RTS + +*------------------------------- +* input a string without allocating memory +*------------------------------- + +INSTR2 LDA VARSTR + PHA + LDA VARSTR+1 + PHA + JSR INPSTR + PLA + STA VARSTR+1 + PLA + STA VARSTR + RTS + +*------------------------------- +* input a string +*------------------------------- + +INPSTR JSR INPSTR0 + STA STRLOC+1 ;save length and location + STX STRLOC + STY STRLEN + + JSR CHKBYT + CMP #math + BNE GTSTRINF ;a quick exit point + + LDA VARSTR+1 ;save the new pointer + PHA + LDA VARSTR + PHA + TYA + PHA + + JSR GETBYT ;save start of working string space + JSR STRCOPY + +:INPSTRB LDA VARSTR+1 ;save current pointer + PHA + LDA VARSTR + PHA + + JSR INPSTR0 ;get new string + STA STRLOC+1 ;save length and location + STX STRLOC + STY STRLEN + + PLA + STA VARSTR ;restore var pointers + PLA + STA VARSTR+1 + PLA + STA TTLLEN ;update length + JSR STRCOPY ;copy the new string + LDA TTLLEN + PHA + + JSR CHKBYT + CMP #math + BNE :INPSTRC ;if there more, do it + + JSR GETBYT ;gobble and continue + JMP :INPSTRB + +:INPSTRC PLA + STA STRLEN ;put back data + PLA + STA STRLOC + PLA + STA STRLOC+1 + +GTSTRINF LDA STRLOC+1 ;get back stuff + LDX STRLOC + LDY STRLEN + RTS + +*------------------------------- +* actually get the string +*------------------------------- + +INPSTR0 JSR CHKBYT + CMP #""" + BEQ :INPSTR1 ;if text + + CMP #string + BNE :INPSTR5 ;handle token + + JSR VARSET ;point to var + LDY #1 + LDA (VPTR),Y ;get the high-byte of pointer + PHA + DEY + LDA (VPTR),Y ;get the low-byte of pointer + TAX + LDY #2 + LDA (VPTR),Y ;get the length + TAY + PLA + RTS + +:INPSTR1 JSR GETBYT ;and gobble first quote + LDX PRGPTR ;save string location + LDA PRGPTR+1 + PHA + LDY #0 +:INPSTR2 JSR GETBYT ;calc string length + CMP #""" + BEQ :INPSTR4 ;check for end + + INY + BNE :INPSTR2 + + PLA + LDX #str2big ;string overflow +:INPSTR3 JMP BADERR + +:INPSTR4 PLA ;a,x,y now have string data + RTS + +:INPSTR5 LDA #0 + STA DATA ;reset data type + JSR GETBYT + CLC ;called from somewhere else + JSR EX_TOK ;exec token + LDA DATA + LDX #badtype + AND #2 + BEQ :INPSTR3 ;string overflow + + LDX DATA+1 ;get data + LDA DATA+2 + LDY DATA+3 + RTS + +*------------------------------- +* copy a string from pointers to current varstr +*------------------------------- + +STRCOPY LDY #0 +:STRCOP2 CPY STRLEN + BEQ :STRCOP3 ;go until done + + LDA (STRLOC),Y + STA (VARSTR),Y ;copy byte + INC TTLLEN ;increase total length + BEQ :STR2BIG ;now it's too big + INY + BNE :STRCOP2 + +:STRCOP3 TYA ;add in bytes copied + CLC + ADC VARSTR + STA VARSTR + LDA #0 + ADC VARSTR+1 + STA VARSTR+1 + RTS + +:STR2BIG LDX #str2big ;String too long + JMP BADERR + +*------------------------------- +* compare 2 strings +*------------------------------- + +STRCMP LDA VARSTR ;don't gobble any space + PHA + LDA VARSTR+1 + PHA + + JSR INPSTR ;get string 1 + LDA STRLOC ;save pointers to data + STA TEMP3 + LDA STRLOC+1 + STA TEMP3+1 + LDA STRLEN + STA TEMP2 ;save length of data + + JSR CHKBYT + CMP #compare + BLT :STRCMP8 ;see if there is actually a compare + + CMP #logic + BGE :STRCMP8 + + JSR GETBYT ;gobble token + SEC + SBC #compare + ASL + PHA + JSR INPSTR ;get second string + PLA + TAX + + LDA JSTRCP,X + STA TEMP + LDA JSTRCP+1,X + STA TEMP+1 + JMP (TEMP) + +:STRCMP8 LDX #0 ;if length = 0, not valid + LDA TEMP2 ;if length > 0, return valid + BEQ STRCMP9 + + LDX #1 +STRCMP9 PLA + STA VARSTR+1 ;restore stuff + PLA + STA VARSTR + LDA #0 + RTS + +ST_EQ JSR STREQ + JMP STRCMP9 + +ST_NOT JSR STREQ + JSR INVERT + JMP STRCMP9 + +ST_LT JSR STRLT + JMP STRCMP9 + +ST_GT JSR STRGT + JMP STRCMP9 + +ST_LTEQ JSR STRGT + JSR INVERT + JMP STRCMP9 + +ST_GTEQ JSR STRLT + JSR INVERT + JMP STRCMP9 + +*------------------------------- +* ----- compare algorithms ----- +*------------------------------- + +STREQ LDX TEMP2 ;check string length's + CPX STRLEN + BNE :STREQ0 + + LDY #-1 +:STREQ2 INY + CPY STRLEN + BEQ :STREQ1 ;are we done?, yep + + LDA (TEMP3),Y + CMP (STRLOC),Y + BEQ :STREQ2 ;do check, keep going + +:STREQ0 LDX #0 + RTS + +:STREQ1 LDX #1 + RTS + +STRLT LDX TEMP2 ;save smaller length + CPX STRLEN + BGE :STRLT2 + + LDX STRLEN + STX TEMP2 + +:STRLT2 LDY #-1 +:STRLT3 INY + CPY TEMP2 + BEQ :STRLT0 + + LDA (TEMP3),Y + CMP (STRLOC),Y + BEQ :STRLT3 + BLT :STRLT1 + BGE :STRLT0 + + LDA TEMP2 + CMP STRLEN + BCS :STRLT0 + +:STRLT1 LDX #1 + RTS + +:STRLT0 LDX #0 + RTS + +STRGT LDX STRLEN ;save smaller length + CPX TEMP2 + BGE :STRGT2 + + LDX TEMP2 + STX STRLEN + +:STRGT2 LDY #-1 +:STRGT3 INY + CPY STRLEN + BEQ :STRGT0 + + LDA (STRLOC),Y + CMP (TEMP3),Y + BEQ :STRGT3 + BLT :STRGT1 + BGE :STRGT0 + + LDA STRLEN + CMP TEMP2 + BCS :STRGT0 + +:STRGT1 LDX #1 + RTS + +:STRGT0 LDX #0 +STRRTS RTS + +*------------------------------- +* check and see if we need to clear up +*------------------------------- + +CHKFRE LDX VARSTR+1 ;get high of current pointer + INX + CPX MIDMEM+1 + BLT STRRTS ;are we ok?, all is well + +*------------------------------- +* clean up strings in memory +*------------------------------- + +DO_FRE LDA HIMEM ;point to pointers + STA TEMP + LDA HIMEM+1 + STA TEMP+1 + + LDA MIDMEM ;point to working space + STA TEMP3 + LDA MIDMEM+1 + STA TEMP3+1 + + SEC + LDA MIDMEM + SBC LOMEM + STA TEMP2 ;compute offset + LDA MIDMEM+1 + SBC LOMEM+1 + STA TEMP2+1 + + LDA #1 + STA FREMEM ;move minimum of 1 page + +:FRE2 SEC + LDA TEMP + SBC #6 + STA TEMP ;move pointers + LDA TEMP+1 + SBC #0 + STA TEMP+1 + + LDY #0 + LDA (TEMP),Y + BEQ :FRE4 ;we are done + BPL :FRE2 ;don't do numbers + + LDY #2 + LDA (TEMP),Y + STA VPTR ;point to string + INY + LDA (TEMP),Y + STA VPTR+1 + BEQ :FRE2 ;new string + + CMP #>CODEND + BLT :FRE2 ;if protected string, don't move it + + INY + LDA (TEMP),Y + TAX + BEQ :FRE2 ;if empty... + + LDY #2 ;put in new pointer + + SEC + LDA TEMP3 + SBC TEMP2 + STA (TEMP),Y + INY + LDA TEMP3+1 + SBC TEMP2+1 + STA (TEMP),Y + + LDY #0 +:FRE3 LDA (VPTR),Y + STA (TEMP3),Y + INY + DEX + BNE :FRE3 + + CLC + TYA + ADC TEMP3 ;move up pointer + STA TEMP3 + LDA TEMP3+1 + BCC :FRE2 ;keep looping + + INC TEMP3+1 + INC FREMEM + JMP :FRE2 ;keep going + +:FRE4 SEC + LDA TEMP3 + SBC TEMP2 + STA VARSTR ;compute new varstr + LDA TEMP3+1 + SBC TEMP2+1 + STA VARSTR+1 + + LDA LOMEM ;point at string space + STA TEMP + LDA LOMEM+1 + STA TEMP+1 + + LDA MIDMEM ;point at fixed strings + STA TEMP2 + LDA MIDMEM+1 + STA TEMP2+1 + + LDX FREMEM ;number of pages to move + LDY #0 +:FRE5 LDA (TEMP2),Y + STA (TEMP),Y + INY + BNE :FRE5 + + INC TEMP+1 + INC TEMP2+1 + DEX + BNE :FRE5 ;do the move + RTS diff --git a/Source/Config/Boardedit.S b/Source/Config/Boardedit.S index a2e9e6d..c65cfce 100644 --- a/Source/Config/Boardedit.S +++ b/Source/Config/Boardedit.S @@ -1 +1,1144 @@ - ⠱㠧 䱠⠱㠧 Ǣ䍠㠧 ͢ 姬䍠㠧 󮧬 맍ᠣ㠻 占䱍氠 덠ᠣ 卍㠧 䬰䍠㠧 󧬰䍠㠧 䧬䍠㠧 䧬䍠㠧 䧬䍠㠧 󧬰䍠㠧 󧬰䍠㠧 姬䍠㠧 䬰䍠㠧 ۱ 占퍍፠ ᠣ占፠፠  䠻 䍠젻 䍠 䍠 䍠􍍻 ⠱㠧 󧬰䬰䍠㠧 䧬䍠㠧 溺䍠㠧 ٯ 򱍠 卍ᠣ䲠 䲍ᠣ 占捠占䰠 䍍 ⠱㠧 䧬䬰䍠㠧 䍠㠧 ٯ 䰍 卍䰠䲠 ㍠㠣 퍠䲍፠ 捍䱠 ፠䍠䱍ᠣƧ 捠ᠣ櫱ᠣ§櫲ᠣ櫴 占櫵ᠠ ፠㸠 鍠櫳𠣧 䲠 卍櫳 ㍠櫴䲠 占ፍ䲠 ᲍፠ 栻 䍠ᠣ捠䲠 䍠卍ᠣ 占占 􍍍 ⠱㠧 䧬䬰䬰䲠 ፍ㠧 䍠㠧 宧䍠㠧 ۱፠፠㸠 㠧 ᠠ ፠ 𲍍፠㍠㠣 𲫱䲠 󍍠䲍𲫱 俍𲍠쳠 철𲠻 栻 䍠ᠣ捠䲠 ፍ𲍠捠ᠣ捠䲠 ፍ𲍠𲍠𲫱 忍철 卍쳠栻 占㍠፠፠㠣 ፠㠣捠堻 占 􍍻 ⠱㠧 䧬䬰䬰䲠 ፍ㠧 䍠㠧 䍠㠧 ۱ᠠ ፠㸠 㠧 ፠ 퍠 卍ᠣ 占卍䲍퍠捠ᠣ栻 䍠䲍卍ᠣ 卍⠱㠧 捠ᠣ捠򫱲 卍㠧 򫱲 卍㠧 썍⠱㠧 򫱲 썍㠧 ፠𳍍 𳫱𳫱 𳫱𳍠፠ 򍍠㠧 򫱲 卍፠蠻 俍𠣱 󍍠𳫱 𿍠 卍㠧 ݧ㠧 ݧ፠㠧 󍍠㠧 򍍠㠧 򫱲򍍠㠧 秬䍠㠧 䬰䍍㠧 ۱ 퍠𠣱 􍍠፠፠ 獠荍ᠣ 卍ᠣ 占占ᠣ  ፍ 𠣶 忍 栻 忍 卍 荠፠챬 챬챠፠፠⍠፠􍍍 ᠣ⠻ ᠣ⠻ 捠ᠣ捠 ᠣ捠 ᠣ⍍⠱㠧 ٯ  卍䲠 ᲍捠ᠣ捠 䲠 䍠占堻 占 퍠䍍 卍⠱㠧 ٯ  󍍍 ⠱㠧 󧬰䬰䬰䲠 𫱍㠧 䍠㠧 𮧬䬰䍠㠧 ۱𫱍፠㸠 㠧 򍍠፠፠ 㠧 ۱፠፠㸠 㠧 ፠ 䍠퍠𫱍䲠 ᲍𫱍捠ᠣ捠䲠 ᲍ 䍠櫤ᠣ櫤䲠 䍍捠ᠣ捠䲠 䍍𫱍櫤ᠣ櫤䲠 䍠占􍍍 ⠱㠧 󧬰䬰䬰䲠 ㍠㠣 ᠣ 퍠䲠 占ᠣ 퍠 卍捠ᠣ捠䲠 卍퍠㸍㠧ᠣ蠻 򍍠捠ᠣ栻 䍠򫱲򍍠 荍򫱲 ㍠ᠣ 占퍠 ᠣ  ⠱ 𠣱 占 ⠱㠧 姬䬰䬰䲠 ፍ㠧 觬䍠㠧 򮧬䍠㠧 ۱፠፠㸠 㠧 ፠ 퍍፠䲠 占፠ 䍠捠ᠣ捠䲠 占卍岠⠱㠧 姬䬰䍠㠧 捠ᠣ栻 占򫱲򍍠 占㠧 򫱲򍍠㠧 ᠣ፠ ፠㍠፠㠣 䠣 ፠㠣 󫱍⠻ 㠧ݺ ᠣ ᠣ占 󫱍捠峠 􍍠栻 ᠣ捠峠󫲠 󫳍󫲠 堪岠 㠧 󫱠 ⍠㠧ݺ  占󫱍捠崠 􍍠捠ᠣ栻 崠󫴠 󫵍󫴍堪岠 ⠱㠧 󺧬䬰䍠㠧 捠ᠣ捠򫱲 占򍍠㠧 򫱲 占򍍠㠧 󫲍󫳍⍍㠧 󫴍󫵍⍍㠧맬䬰䍠㠧 ٯ 㠪􍍠ᠣ 占፠𫱍ᠨ 占㍠㠣㍍ ㍠ᠨ䠣捠𠣧⠻ 􍍠㠧 姬䍠㠧 宧 嵠ᠨ 占嫱𠣧 忍嶠 卍 荠嵍嶠堻 荠㠧 ㍠㍠㠣㠧 宧巠獠㍠㠻 占巠 占ᠣ堻 占㠪ᠻ 卍⠱㠧 姬䍠㠧 䬧䍠㠧 姬䍠㠧䮧䬰䍠㠧 ٯ 㠪 卍占ᠣ占堻 ㍠󫴠 㠣󫴍󫵍㠣󫴠 ፠ 卍㍠󫲍㠣󫲠 󫳍㠣𠳍󫲠 ፠ލ򫱠 卍㍠㠻 卍堻 占ᠣ占 占卍堻 占ᠣ占ᠣ 􍍠帠 帍幠栻 덠ᠣ捠㠻 幍占􍍻 䲠Რ 占ᠣ᲍堻 Რ 䲠ᠣ 占㍠䲠 ᲍ ᠣ덍櫱 捠ᠣ櫱􍍠堻 卍櫱ᠣ櫱 ፠󍍻 䲠፠䲠 占ᠣ 덠ፍ፠㸠 櫱櫱ᠣ 櫱櫱ᠣ櫱 􍍠占፠󍍻 䲠䲠 􍍻 䲠䲠 䍠􍍻 䲠፠ᠠ ፍᠣ𳍠፠㍠㠣 󍍠፠𳠻 𳍠렻 卍፠ ፠󍍍 𳠻 ፠繠 ፠ፍ𳍠繠 𳠻 ፠ᠣ ፠櫱䲠 ፠䲍䳠 ፠䵠 卍𳠻 𳠻 䴠፠𳫱 占፠䳍𳫱 占䴍䵠󍍍 繠 ፠ᠣ捠󍍍 繠堻 ፠⠻ 卍 ፠ፍ堻 忍ᠻ 卍󍍍 𳠻 占𳫱𲍍捠ᠣ捠 򍍠𳫱𳍠񠪫 򍍠 퍠ᠣ 占𲍠ፍ󍍍 㠧 䧬䬍㠧ƺ䍠㠧䍠㠧䍠㠧⠰ ⠷⠸⠱⠱⠱⠱⠱⠱⠰⠰ 㠧䍠㠧䍠㠧㠧 ⠰ ⠰ ⠰ ⠰ ⠰ \ No newline at end of file +******************************** +* * +* Config - Edit Bulletins Info * +* * +******************************** + +*------------------------------- +* Date: 01/19/87 +*------------------------------- + +brdedit jsr TopBox + jsr print + db 1,3,7 + asc '- Edit Bulletin Board Info -',00 + +brded1 jsr cls + jsr print + db 1,7,0 + asc 'Please make sure that both the "CONFIG"',0d + asc 'disk and the "SYSTEM" disk are on-line',0d + asc 'and available for access.',00 + jsr getcr ; wait for an 'ok' + lda #1 + jsr logspec ; log there + bcs brded1 + +do_edit ldx #$f0 ; reset stack + txs + ldx #start ; setup esc handler + jsr escape + + jsr cls + jsr print + asc 'Select an Option:',0d,0d + asc ' 1) Clear all previous boards',0d + asc ' 2) Add a new bulletin board',0d + asc ' 3) Delete a bulletin board',0d + asc ' 4) Edit an existing board',0d + asc ' 5) Swap two bulletin boards',0d + asc ' 6) List all bulletin boards',0d + asc ' 7) Create board storage file',0d + asc ' 8) Return back to main menu',0d,0d + asc 'Enter choice [1-8] ? ',00 + + ldx #8 ; input choice + jsr inpnum + + pha + ldx #do_edit + jsr escape + pla + asl a + tax + + lda edjmptbl,x + sta prn + inx ;push low + lda edjmptbl,x + sta prn+1 + jmp (prn) + +edjmptbl dw 0 + dw b_clr ; clear current boards + dw b_add ; add a new board + dw b_del ; delete a board + dw b_edit ; edit a board + dw b_swap ; swap 2 boards + dw b_list ; list all boards + dw b_creat ; create new bulletin board + dw start + +; clear all current boards +b_clr jsr cls ; clear screen + jsr print + db 1,7,12 + asc 'Clear all boards',0d,0d + asc 'This operation will delete your board',0d + asc 'configuration. Do you really wish to',0d + asc 'continue [Y/N] ? ',00 + jsr inpyn + bcc b_clr1 + jmp do_edit ; nope + +b_clr1 lda #0 + jsr snumbd2 ; set boards to 0 + jsr opend2 + ldx #<1152 + lda #>1152 ; set end of file + jsr puteof + jsr close + jmp b_add0 ; add a new board + +; add a new bulletin board +b_add jsr cls + jsr print + db 1,7,12 + asc 'Add a board',0d,0d + asc 'Do you wish to add another bulletin',0d + asc 'board to your system [Y/N] ? ',00 + jsr inpyn + bcc b_add0 + jmp do_edit ; nope + +b_add0 jsr gnumbd2 ; get number of boards + clc + adc #1 ; add 1 to number of boards + sta recnum + jsr snumbd2 + + pha + ldx #0 + txa +b_add1f sta hdrbuf,x ; fill buffer with zero's + inx + bpl b_add1f + + ldx #0 +b_add1 lda newbd,x ; copy over the new board data + sta hdrbuf,x + inx + cpx #newbdnd-newbd + bne b_add1 + + lda #'F' ; add on prefix + sta lnbuf + lda #':' + sta lnbuf+1 + lda #'B' + sta lnbuf+2 + lda #cr + sta lnbuf+4 ; add end of line + sta lnbuf+5 + + pla ; get number of boards + pha + jsr bindec8 ; translate into ascii + stx lnbuf+3 + cmp #'0' ; was it greater than 10? + beq b_add2 ; nope + + sta lnbuf+3 ; save complete spec + stx lnbuf+4 + +b_add2 ldy #1 ; change default drive/name + jsr chgdata + + jsr opend2 ; open data2 + pla + tay ; save new record number + ldx #hdrbuf + jsr writed2 ; save record + jsr close + + lda #-1 ; set flag for going to create storage + sta gomake + jmp b_edit1 ; edit it + + +; delete a current board +b_del jsr cls + jsr print + db 1,7,12 + asc 'Delete a Board',0d,0d,00 + + jsr gnumbd2 ; get number of boards + pha + + jsr print + asc 'Enter the number of the bulletin',0d + asc 'board that you want to delete.',0d + asc 'Delete Board [1-',00 + + pla + pha + jsr bindec8 ; print # of boards + jsr decout8 + + jsr print + asc '] ? ',00 + + pla ; get number of boards + pha + tax + jsr inpnum ; get selection + sta temp2 + + pla + sec + sbc #1 ; save new number of boards + sta temp2+1 + jsr snumbd2 ; set new number of boards + + jsr opend2 + ldx temp2+1 ; did they do last board? + inx + cpx temp2 + beq b_del3 ; yep + +b_del2 ldy temp2 ; get the board part marker + iny + ldx #hdrbuf + jsr readd2 ; get data + + ldy temp2 + ldx #hdrbuf + jsr writed2 ; save data + + lda temp2 + inc temp2 + cmp temp2+1 ; done? + bne b_del2 ; nope + +b_del3 jsr geteof ; get the end of file + sec + pha + txa + sbc #128 ; move back eof 128 bytes + tax + pla + sbc #0 + jsr puteof + jsr close ; close file + jmp do_edit ; go back to start + +; edit a board +b_edit jsr cls + jsr print + db 1,7,12 + asc 'Edit a Board',0d,0d,00 + + jsr gnumbd2 ; get number of boards + pha + + jsr print + asc 'Enter the number of the bulletin',0d + asc 'board that you want to edit.',0d + asc 'Edit Board [1-',00 + + pla ; get # of boards + pha + jsr bindec8 ; display number + jsr decout8 + + jsr print + asc '] ? ',00 + + pla + tax ; limit input + jsr inpnum + sta recnum ; and save + + lda #0 ; reset jump to create storage + sta gomake + +b_edit1 jsr opend2 + ldy recnum + ldx #hdrbuf ; read in record + jsr readd2 + jsr close + +b_edit2 ldx #do_edit ; setup esc handler + jsr escape + + jsr cls + jsr print + db 1,7,0 + asc '1) Name: ',00 + + ldx #hdrbuf + ldy #cr+128 + jsr prstr ; print name + + jsr print + db cr + asc '2) File: ',00 + ldy #cr+128 + jsr prstr ; print filename + + jsr print + db cr,cr + asc '3) Access: ',00 + ldy #"," + jsr prstr ; show access level + + jsr print + db 1,10,18 + asc '4) Write: ',00 + ldy #cr+128 + jsr prstr ; show write level + + jsr print + db cr,cr + asc '5) Aux Sysop Numb: ',00 + pha + stx temp3 + + jsr numin ; get value from number + stx temp3+1 + ora temp3+1 ; save zero status + sta temp3+1 + + ldx temp3 + pla + ldy #"," + jsr prstr ; show sysop number + + jsr print + db cr + asc '6) Aux Sysop Name: ',00 + ldy #cr+128 + jsr prstr ; print name + + pha + lda ch ; did anything get printed? + cmp #19 + bne b_edit5 ; yep, dont process + + lda temp3+1 ; was their an aux sysop? + beq b_edit6 ; nope + + jsr print + asc '[ Use Real Name ]',00 + jmp b_edit5 + +b_edit6 jsr print + asc '[ No Aux Sysop ]',00 + +b_edit5 pla + jsr print + db cr,cr + asc '7) Max # of Bulletins: ',00 + ldy #"," + jsr prstr ; show max bulletins + + jsr print + db cr + asc '8) Auto Kill Threshold: ',00 + ldy #"," + jsr prstr + + jsr print + db cr + asc '9) Bulletin # to Kill: ',00 + ldy #cr+128 + jsr prstr + + jsr print + db cr,cr + asc '10) Abort without Saving',0d + asc '11) Save changes and Quit',0d,0d + + asc 'Edit [1-11] ? ',00 + ldx #11 + jsr inpnum + cmp #10 + bcs b_edit3 ; opps, save or abort + + pha + asl a + tax + lda xyedit-2,x ; do positioning + sta cv + lda xyedit-1,x + sta ch + + ldx #b_edit2 ; setup esc handler + jsr escape + + lda #%00100000 ; set default mode + sta inpmode + lda #30 ; max length 30 chars + sta maxlen + jsr inpln ; get their input + pla + + tay + dey ; setup data pointer + cmp #6 ; was it aux sysop name? + beq b_edit3 ; yep + + ldx lnbuf ; did they enter a line? + cpx #cr + bne b_edit3 ; yep + jmp b_edit2 ; nope + +b_edit3 jsr b_edit4 ; handle dispatch + jmp b_edit2 + +b_edit4 asl a + tax + lda edjmptbl1,x + sta prn + inx ;push low + lda edjmptbl1,x + sta prn+1 + jmp (prn) + +edjmptbl1 dw 0 + dw chgdata + dw chgdata + dw e_acces + dw e_acces + dw e_auxnb + dw chgdata + dw e_var + dw e_var + dw e_var + dw e_abort + dw e_edit + + +; code to handle editing each parameter +e_acces ldx #<34 + lda #>34 + jmp chgnumb ; change the number + +e_auxnb ldx #<5000 + lda #>5000 + jsr chgnumb ; change the number + ldx #lnbuf + jsr numin ; get number + stx temp + ora temp + bne e_auxnm ; opps, an aux sysop + + lda #cr + sta lnbuf + ldy #5 ; kill aux sysop + jsr chgdata +e_auxnm rts + +e_var ldx #<1024 ; maximum of 1024 bulletins + lda #>1024 + jmp chgnumb + +e_edit jsr print + db 1,22,0 + asc 'Save: Are you Sure [Y/N] ? ',00 + jsr inpyn + bcs e_abt2 ; nope + + jsr opend2 ; open data2 + ldx #hdrbuf + ldy recnum ; get record number + jsr writed2 ; write record + jsr close + bit gomake ; make storage file + bpl e_abt1 + + lda recnum ; create file number recnum + jmp makebd + +e_abt1 jmp do_edit ; we are done + +e_abort jsr print + db 1,22,0 + asc 'Abort: Are you Sure [Y/N] ? ',00 + jsr inpyn + bcc e_abt1 ; yep + +e_abt2 rts + + +; swap 2 boards +b_swap jsr cls + jsr print + db 1,7,12 + asc 'Swap two boards',0d,0d,00 + + jsr gnumbd2 ; get # of boards + sta temp+1 + + jsr print + asc 'Enter the numbers of the two bulletin',0d + asc 'boards that you wish to swap.',0d,0d + asc 'Swap Board [1-',00 + + lda temp+1 + pha + jsr bindec8 ; print number + jsr decout8 + + jsr print + asc '] ? ',00 ; prompt for number + + pla + pha + tax + jsr inpnum ; get first board # + sta temp + + jsr print + db cr,cr + asc 'With Board [1-',00 + + pla + pha + jsr bindec8 ; print number + jsr decout8 + + jsr print + asc '] ? ',00 + + pla + tax ; get second board + jsr inpnum + sta temp+1 + + jsr opend2 ; open data2 + + ldy temp+1 + ldx #hdrbuf + jsr readd2 ; read data2 + + ldy temp ; get first board + ldx #hdrbuf+$100 + jsr readd2 ; read second record + + ldy temp + ldx #hdrbuf + jsr writed2 ; write second record + + ldy temp+1 + ldx #hdrbuf+$100 + jsr writed2 ; write first record + jsr close + jmp do_edit + + +; list all boards +b_list jsr cls + jsr print + db 1,7,12 + asc 'List all boards',0d,0d,00 + + jsr gnumbd2 ; get number of boards + clc + adc #1 + sta recnum+1 ; save total + 1 + + lda #1 ; start at record 1 + sta recnum + jsr opend2 ; open data file + lda #11 + sta recnum+2 ; only list 11 lines + +b_list2 ldy recnum + cpy recnum+1 + beq b_list3 ; we are done + + ldx #hdrbuf + jsr readd2 ; read data file + + lda recnum + jsr bindec8 + jsr decout8 + jsr print + asc ')',00 + lda #4 + sta ch ; htab over + + ldx #hdrbuf ; print name of board + ldy #cr+128 + jsr prstr + + ldy #34 ; htab over + sty ch + + ldy #cr+128 + jsr prstr ; print drive spec + lda #cr + jsr cout ; move down a line + inc recnum + dec recnum+2 + bne b_list2 ; list next entry + + lda #11 ; reset line counter + sta recnum+2 + jsr getcr ; wait for a return + ldx #9 ; clear bottom of screen + jsr cleos + jsr print + db 1,9,0,00 + jmp b_list2 ; clear and loop + +b_list3 lda recnum+2 ; did we just wait for a return? + cmp #11 + beq b_list4 ; yep + + jsr getcr +b_list4 jsr close + jmp do_edit ; return to menu + + +; create a new bulletin file +b_creat jsr cls + jsr print + db 1,7,8 + asc 'Create board storage file',0d,0d,00 + + jsr gnumbd2 ; get the number of boards + pha + + jsr print + asc 'Enter the number of the board you wish',0d + asc 'to create a storage file for.',0d + asc 'Create for Board [1-',00 + + pla + pha + jsr bindec8 ; display number of boards + jsr decout8 + + jsr print + asc '] ? ',00 + pla + tax ; get board number + jsr inpnum + +makebd pha + jsr opend2 ; open the data file + pla + tay ; point to record + ldx #hdrbuf + jsr readd2 ; read the file + jsr close + +b_cre2 jsr cls + jsr print + db 1,7,8 + asc 'Create board storage file',0d,0d + asc 'Name: ',00 + + ldx #hdrbuf ; print board name + ldy #cr+128 + jsr prstr + + jsr print ; print file name + db cr,cr + asc 'File: ',00 + ldy #cr+128 + jsr prstr + + jsr print + db cr,cr + asc 'Directory Capacity [default=',00 + + lda #6 + jsr findata + jsr numin ; get max bulletins + pha + clc + txa + adc #31 ; move up + and #%11100000 ; make multiple of 32 + tax + pla + adc #0 + stx crbbs ; save the default + sta crbbs+1 + jsr prnumb ; display default capacity + + jsr print + asc ']: ',00 + lda #4 ; only allow 4 chars + sta maxlen + lda #%00100000 + sta inpmode + jsr inpln ; get the input + ldx crbbs ; get default capacity + lda crbbs+1 + ldy lnbuf + cpy #cr + beq b_cre3 ; use default + + ldx #lnbuf + jsr numin +b_cre3 stx crbbs+2 ; save input + sta crbbs+3 + ora crbbs+2 ; check for 0 + bne *+5 + jmp b_cre2 ; make them do it again + + jsr print + db cr + asc 'Storage Capacity [default=',00 + + ldx crbbs + lda crbbs+1 ; display default + jsr prnumb + jsr print + asc 'k]: ',00 + + jsr inpln + ldx crbbs ; default storage + lda crbbs+1 + ldy lnbuf + cpy #cr + beq b_cre4 ; use default + + ldx #lnbuf ; get number + jsr numin +b_cre4 stx crbbs+4 ; save input + sta crbbs+5 + ora crbbs+4 + bne *+5 + jmp b_cre2 ; make them do it again + + jsr cls + jsr print + db 1,7,10 + asc 'Board Specifications:',0d,0d + asc 'Name: ',00 + + ldx #hdrbuf + ldy #cr+128 ; show board name + jsr prstr + + jsr print + db cr,cr + asc 'File: ',00 + ldy #cr+128 ; show file name + jsr prstr + + jsr print + db cr,cr + asc 'Max Bulletins: ',00 + ldx crbbs+2 + lda crbbs+3 + jsr prnumb + + jsr print + db cr,cr + asc 'Max Storage: ',00 + ldx crbbs+4 + lda crbbs+5 + jsr prnumb + + jsr print + asc 'k',0d,0d + asc 'Is the above correct [Y/N] ? ',00 + jsr inpyn + bcc *+5 + jmp do_edit + + lda #1 ; point to filename + jsr findata + stx temp + sta temp+1 + + ldy #0 + lda (temp),y + jsr conv ; find & save drive + sec + sbc #'A' + sta drvspec + + iny ; check for drive spec + lda (temp),y + and #$7f + cmp #':' + beq b_cre4b ; got it + + jsr print + db cr,cr + asc 'Error: This board does not have a drive',0d + asc 'specifier in its filename.',00 + jsr getcr + jmp do_edit + +b_cre4b ldx #-1 ; point into flname buffer +b_cre5 inx + iny + lda (temp),y ; copy filename + jsr conv + sta flname+1,x + cmp #'.' ; done? + bcc b_cre6 ; nope + + cpx #16 ; truncate length + bne b_cre5 + +b_cre6 stx flname ; save filename length + jsr print + db cr,cr + asc 'Make sure ',00 + lda drvspec + clc + adc #'A' + jsr cout + jsr print + asc ': is on-line.',00 + +b_cre7 jsr getg + lda drvspec + jsr logspec ; log to drive + bcs b_cre7 ; opps, try again + + ldx #flname ; see if file exists + ldy #0 + jsr open + php + jsr close + plp + bcc *+5 + jmp b_cre7a ; nope file by that name + + jsr cls + jsr print + db 1,7,0 + asc 'There is already a bulletin storage',0d + asc 'file with this name. If you proceed,',0d + asc 'the bulletins in that file will be',0d + asc 'destroyed.',0d,0d + asc 'Do you wish to continue [Y/N] ? ',00 + jsr inpyn + bcc *+5 + jmp do_edit ; abort create + + + ldx #flname + jsr delfile ; delete file in question + +b_cre7a clc + lda crbbs+4 ; round up blocks + adc #127 + sta crbbs+4 + lda crbbs+5 + adc #0 + asl crbbs+4 ; move in bit 7 + rol a + sta bullhdr ; and save + + clc + lda crbbs+2 + adc #31 + sta crbbs+2 ; round up dir's + lda crbbs+3 + adc #0 + lup 3 + asl crbbs+2 ; shift in 3 bits + rol a + --^ + sta bullhdr+1 ; and save + + clc + adc bullhdr + sta drvspec ; save total blocks to write + + ldx #flname + ldy #6 ; use binary file type + jsr create + + ldx #flname + ldy #0 + jsr open + + ldx #bullhdr + ldy #8 ; write out the header + jsr wrpart + + ldx #0 + txa +b_cre8 sta hdrbuf,x ; fill buffer with zero's + inx + bne b_cre8 + +b_cre9 ldx #hdrbuf + ldy #128 + jsr wrpart + dec drvspec ; count down and loop + bne b_cre9 + + jsr close + jmp do_edit + +; --- sub-routines --- + +; open the data2 file +opend2 ldx #data2 + jsr movname ; setup name pointer + jmp open + +data2 str 'DATA2' + +; get number of boards +gnumbd2 lda #1 ; log to system drive + jsr logspec + jsr opend2 ; open data2 + ldx #<1120 ; position to byte 1120 + lda #>1120 + jsr setmark + + ldx #lnbuf+128 + ldy #10 + jsr rdpart + + jsr close ; close file + + ldx #lnbuf+128 ; get # of boards + jsr numin + txa + rts + +; save number of boards +snumbd2 pha + jsr opend2 ; open data2 file + ldx #<1120 + lda #>1120 ; position to byte 1120 + jsr setmark + pla + + pha + jsr bindec8 ; translate to 2 digit + sta lnbuf+128 + stx lnbuf+129 + lda #cr ; add terminator char + sta lnbuf+130 + + ldx #lnbuf+128 + ldy #10 ; write out 10 bytes + jsr wrpart + + jsr close + pla + rts + +; read in a record from the data2 file +readd2 jsr findd2 ; find a record + ldy #128 + jmp rdpart + +; write out a record to the data2 file +writed2 jsr findd2 ; find a record + ldy #128 + jmp wrpart + +; find a record +findd2 pha + txa ; save buffer address + pha + + lda #0 + sta temp3 + tya + clc + adc #8 ; offset 8, 128 byte records + + lsr a + ror temp3 ; records are 128 bytes + ldx temp3 + ldy #0 + jsr setmark ; position there + + pla + tax ; restore & return + pla + rts + + +; insert data into record +chgdata sty temp3 ; save record number + iny + tya + jsr chg9 ; find second entry + txa + pha + + lda temp3 + jsr chg9 ; find actual entry + inx + stx temp3 ; save pointer + pla + tay + + lda #0 ; mark end of data + sta hdrbuf+128 + +chgd2 lda hdrbuf,y ; delete current text + sta hdrbuf,x + inx + iny + asl a + bne chgd2 + + ldx #-1 +chgd3 inx + lda lnbuf,x ; get data + cmp #cr + beq chgd5 ; opps, we are done + + ldy temp3 ; get pointer + inc temp3 ; (do forward order) +chgd4 pha + lda hdrbuf,y + sta temp3+1 ; save byte + pla + sta hdrbuf,y + beq chgd3 + + iny + lda temp3+1 ; restore byte + jmp chgd4 + +chgd5 rts + + +; lookup data within a record +findata jsr chg9 ; find data + inx + lda #>hdrbuf + rts + + +; lookup an entry +chg9 ldx #-1 + ldy #0 + sta x_save ; save counter + asl a + beq chg9b ; we are done + +chg9a inx + lda hdrbuf,x ; get data + cmp delim,y + bne chg9a + + iny + cpy x_save ; we done? + bne chg9a ; nope + +chg9b rts + + +; make sure a number is legal and change it +chgnumb stx temp3 ; save range + sta temp3+1 + sty temp2 + + ldx #lnbuf + jsr numin ; process number + + cmp temp3+1 + beq chgnum0 + bcc chgnum1 + bcs chgnum3 + +chgnum0 cpx temp3 + beq *+4 + bcs chgnum3 + +chgnum1 jsr decmem ; process number + + ldx #5 +chgnum2 lda txtnum+1,x ; copy number + sta lnbuf,x + dex + bpl chgnum2 + + ldx txtnum + lda #cr ; end line + sta lnbuf,x + + ldy temp2 + jmp chgdata + +chgnum3 rts + + +; new board default data +newbd asc 'New Board',0d, + asc 'F:Bxx',0d + asc '1,1',0d + asc '0,',0d + asc '128,0,0',0d +newbdnd db 0 + +; positions on edit template +xyedit db 7,9 + db 8,9 + db 10,11,10,28 + db 12,19 + db 13,19 + db 15,24 + db 16,24 + db 17,24 + db 0,0 + db 0,0 + +; field delimiters within file +delim db cr,cr + asc ',',0d + asc ',',0d + asc ',' + asc ',' + db cr +; toggle for add +gomake db 0 + +; working record number +recnum db 0,0,0 + +; record of bbs stats +crbbs db 0,0,0,0,0,0 + +; drive spec +drvspec db 0,0 + +; bulletin file header +bullhdr db 0,0,0,0,0,0,0,0 + + diff --git a/Source/Config/Clock.S b/Source/Config/Clock.S index 3dc61a7..bcb75aa 100644 --- a/Source/Config/Clock.S +++ b/Source/Config/Clock.S @@ -1 +1,145 @@ - 󍪭 򍍍⠱㠧 󍍪 獪 덪 덍⠱㠧 姬䍠㠧 Ů ȮϮ䍠㠧 Ů 溺䍠㠧 Ů 맬䍠㠧 Ů 맬䍠㠧 맬䍠㠧 맬䍠㠧 맬䍠㠧 䧬䍠㠧 맬䍠㠧 䬰䍠㠧 ۱ 퍍፠፠ᠺᠺ፠𠣴፠𠣶 덠𠣷 占𠣱 𠣱 덠􍍠⠱㠧 忧䍠㠧۱ 퍠፠፠፠፺ᠠ 􍍠⠱㠧 䬰䍠㠧 򧬰䍠㠧 򧬰䬰䍠㠧 ۱ݺ 占퍠𠣱񠺲ᠠ ᠠ 卍 卺ᠨ占堺ᠠ 덠ᠠ 덠 砻 󍍺፠፠덠덍 捍⠱㠧 򍍠堺獍 \ No newline at end of file +*------------------------------- +* reconfigure clocks +*------------------------------- + +gsclock ext ;gs clock driver +serialpro ext ;serialpro driver +thunder ext ;thunderclock/timemaster driver +iicsys ext ;iic system clock +mountain ext ;mountain clock +prodos ext ;standard prodos stuff +nullclk ext ;no clock +noslot ext ;no slot clock +versa ext ;prometheus versacard +ultra ext ;ultra clock driver + + + +re_clk jsr TopBox + jsr print + db 1,3,10 + asc '- Reconfigure Clock -',00 + + jsr cls + +* sec ;remove asteriks to make IIgs +* jsr $fe1f ;clock self-installing +* bcs IIeClk +* jmp gsclk + +IIeClk jsr print + db 1,7,0 + asc ' 1 - Thunderclock Compatible',0d + asc ' 2 - A.E. Timemaster II H.O.',0d + asc ' 3 - A.E. Serial Pro',0d + asc ' 4 - A.E. Ultra Clock',0d + asc ' 5 - A.E. //c System Clock',0d + asc ' 6 - SMT No-Slot Clock',0d + asc ' 7 - ProDOS Compatible Clock',0d + asc ' 8 - Mountain Hardware Clock',0d + asc ' 9 - Prometheus Versacard',0d + asc '10 - IIgs Built-in Clock',0d + asc '11 - No Clock in System',0d,0d + asc 'Which? [1-11] ',00 + + ldx #11 + jsr inpnum + + pha + asl a + tax + lda :clktable,x + sta point0 + inx + lda :clktable,x + sta point0+1 + + pla + cmp #4 ;ultra + beq :noslot + cmp #6 ;no slot clock + beq :noslot + cmp #7 ;prodos compatable + beq :noslot + cmp #10 ;iigs built in + beq :noslot + cmp #11 ;no clock + beq :noslot + + jsr print + db 1,21,0 + asc 'Which slot/port does the clock use?'0d + asc '[1-7] '00 + + ldx #7 ; get slot + jsr inpnum + asl a + asl a + asl a + asl a +:noslot pha ;save slot + + jsr cls + jsr print + db 1,7,0 + asc 'What time format do you want?',0d,0d + asc ' 1 - 12 hour',0d + asc ' 2 - 24 hour',0d,0d + asc 'Which? [1-2]: ',00 + + ldx #2 ; get mode + jsr inpnum + ldx #$80 + cmp #1 + beq :24hr + ldx #$00 + +:24hr txa ;put mode in accum. + pha ;save mode + + + ldy #0 ;move the single page +:loop lda (point0),y ;source + sta clkdrv,y ;destination + iny + bne :loop + + pla ;get the mode back + sta clkdrv+1 + pla ;get the slot back + sta clkdrv + + jsr chinit ; check for init + jmp wrtchg ; write the changes + +:clktable dw 0 + da thunder + da thunder + da serialpro + da ultra + da iicsys + da noslot + da prodos + da mountain + da versa + da gsclock + da nullclk + +*------------------------------- +* IIgs clock is installed by itself + +gsclk jsr print + db 1,7,0 + asc 'IIgs Clock installed automatically...',00 + jsr getcr + + ldy #0 +:loop lda gsclock,y + sta clkdrv,y + iny + bne :loop + + jsr chinit + jmp wrtchg + + diff --git a/Source/Config/Clocks/Iic.S b/Source/Config/Clocks/Iic.S index a409b83..cb6da07 100644 --- a/Source/Config/Clocks/Iic.S +++ b/Source/Config/Clocks/Iic.S @@ -1 +1,202 @@ - 򍪭 捍㍠썠􍍠砤䰰ƠՠҠՠ㰹㰹ṍፍ尳ፍ氰湰湲⠰⠰占󠠻 卍 􍪭頻 썠堻 占 卍占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 덪ᠣ ߲߱㠣߲፠㠣 ߱߳ 獠ፍᠣ 덍߱ ߱򠣤ᠻ 荠 獍߲ ᠣ ߱ 占߲߱ 占썠썠썠 򠣰 占߳ 󍍠፠䠣栻 驍ᠣ፠򠠻 占ᠣ 鍠ᠣ򫲠 򫵍 獠ᠣ󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰㠧 㠧 \ No newline at end of file +*------------------------------- +* //c System Clock - 24 hr +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + lst off + + xc + rel + dsk rel/iicsys + +iicsys ent + + org $0d00 + +lnbuf equ $200 + +ZBUF EQU $41 +PTR EQU $42 + +stat1 equ $c099 +comm1 equ $c09a +stat2 equ $c0a9 +comm2 equ $c0aa + +bytcnt equ $0e03 +nullptr equ $0a + +mli equ $bf00 +date equ $bf90 +time equ $bf92 +get_time equ $82 + + +slot hex 20 +mode db 0 + + bra getdate +timer db 00 + jmp gettime + rts ; jmp setdate + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr mli ; mli call + db get_time ; get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* read time from clock +*------------------------------- +rdtime lda #64 ; read the date and time from clock +init1_1 pha +init1_2 sbc #1 + bne init1_2 + pla + sbc #1 ; give plenty of setup delay + bne init1_1 + + php + sei +init1_3 lda comm1 ; get current setting + pha + + ldy #3 + ldx #22 + lda #8 +init2 sta comm1 ; send init sequence to clock + +init2_1 dex ; intra-bit delay + bne init2_1 + + eor #$0a ; toggle back and forth + ldx #11 + dey + bne init2 ; keep looping + + ldy #4 + ldx #8 + bne init3_2 ; skip initial delay + +init3 lda #$34 + sta timer ; delay while clock sets up +init3_1 dec timer ; to send the date/time + bne init3_1 + +init3_2 lda stat1 ; shift bit data into nibble + rol + rol + rol + ror datestr + dex + bne init3 ; go back to delay + + lda datestr + eor #0 ; save the nibble + sta datestr,y + + ldx #8 + dey + bpl init3 + + pla +init3_3 sta comm1 ; retore uart to initial settings + + ldy #15 + ldx #4 + +init4 lda datestr,x + pha + and #$0f ; process digit (make into ascii) + ora #$30 + sta datestr,y + + dey + pla + lsr + lsr + lsr ; process top of nibble + lsr + ora #$30 ; turn into ascii + sta datestr,y + + dey + dey + dex + bpl init4 + plp + + lda #':' + sta timestr+2 ; put time dividers in + sta timestr+5 + + ldx #timestr + rts + +* convert time to 12hr format +*---------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +datestr asc '00 00 00' +timestr asc '00:00:00 ' diff --git a/Source/Config/Clocks/Iigs.S b/Source/Config/Clocks/Iigs.S index 9135165..605e65b 100644 --- a/Source/Config/Clocks/Iigs.S +++ b/Source/Config/Clocks/Iigs.S @@ -1 +1,166 @@ - 捍㍠㠠 卍썠덍􍍠砤䰰 卪⠰⠰堻 占堻 䩍堻 􍍪 Ӎ氰湰頻  ᠰ堻 퍠嫱 ؍󍍪 卪占占屍屠 獠ᠣ󍍪 덪㠠 占占𠣤 ج ٍᠠ ፠፠፠䰳젤屰 ㍠堠 占ᠠ 㸠 占򫶍򫷍ᠠ 㸠 占򫳍򫴍ᠠ 㸠 占򫱍ᠠ ᠠ 荠ᠠ 荠ᠠ 占ᠠ 덠ᠣ 򫹍򫱰󠠻宮 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰󍍪 ۰ݍ㸠𠣶 ᠣ 𠣱⠻ 卍㠣 ᠻ 㠣 占፠㠣 󠠻 卍 㠧 \ No newline at end of file +*------------------------------- +* GS Clock driver bios +* Written by Andy Nicholas - 07/30/87 +* rewritten by Andy 3/11/88 +*------------------------------- + + lst off + + xc + xc ; goto 65816 mode + + rel + dsk rel/gsclock + +gsclock ent + + org $d00 + +* Jump Table +*------------------------------- + +dow db 0 +mode db 0 + + jmp getdate ;call to get the date + jmp gettime ;call to get the time (formatted) + jmp setdate ;known return point + +* Read Clock from ProDOS +*------------------------------- + +mli equ $bf00 +date equ $bf90 + +getdate jsr mli ;read the clock into + hex 82 ;buffer at $200 + da 0 + + ldx date ;read date in compressed form + lda date+1 ;into A & X +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* read time from clock +*------------------------------- +rdtime clc ;go to native mode + xce + rep #$30 ;and 16 bit A, X, and Y + mx %00 + + pha ;stack space for results + pha + pha + pha + ldx #$0d03 ;ReadTimeHex + jsl $e10000 ;Tool Locater + sec + xce ;emulation mode + mx %11 + + pla ; seconds + jsr bindec8 ; convert to two byte + sta timestr+6 + stx timestr+7 + pla ; minutes + jsr bindec8 ; convert to two byte + sta timestr+3 + stx timestr+4 + pla ; hour + jsr bindec8 ; convert to two byte + sta timestr + stx timestr+1 + pla ; year + pla ; day of month + pla ; month + pla ; unused byte + pla ; day of the week + sta dow + + lda #' ' + sta timestr+9 + sta timestr+10 + + rts ;bye.. + + +* convert time to 12hr format +*---------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +* translate a binary to text [0-99] +*------------------------------- +bindec8 cmp #60 ; put limit of 59 + bcc bin8 + lda #59 + +bin8 ldy #0 ; start 10's counter +bin8a cmp #10 + bcc bin8b ; less than 10, were done + + sbc #10 ; minus 10 + iny ; add 1 to the 10's counter + bne bin8a ; loop + +bin8b adc #'0' ; make 1's into text + tax ; save + tya + adc #'0' ; make 10's into text + rts ; were done + +* '01234567890 +timestr asc '12:00:00 ' diff --git a/Source/Config/Clocks/Mountain.S b/Source/Config/Clocks/Mountain.S index f185196..1a1da85 100644 --- a/Source/Config/Clocks/Mountain.S +++ b/Source/Config/Clocks/Mountain.S @@ -1 +1,155 @@ - 򍪭 捍썠􍍠砤䰰氰湰湲⠰占占卍 􍪭頻 썠堻 占 卍占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 卪덠ᠣ 򫲍򫵍󍍪 덪ᠤ፠ᠤ ፠ᠣ㰍ᠤ 뫲㰰 덠፠ᠤᠠ ᠤ䍠ᠤ 獠䠣捠占󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰󍍻 䠣捠㍠㠣堻 ᠠ 䠣捠㍠㠣㍠堻 ፠󠠻 㠧㠧 \ No newline at end of file +*------------------------------- +* Mountian Hardware Driver +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + lst off + + rel + dsk rel/mountain + +mountain ent + + org $0d00 + +mli equ $bf00 +date equ $bf90 +time equ $bf92 +get_time equ $82 + + +slot hex 40 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr mli ; mli call + db get_time ; get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* get time routine +*------------------- +rdtime jsr rdclock + lda #':' ; clean up format + sta timestr+2 + sta timestr+5 + rts + +* read time from clock +*---------------------- +rdclock lda $38 + pha + lda $39 ; save zp addresses + pha + lda slot + lsr + lsr + lsr + lsr + ora #$c0 + sta $39 ; point to clock entry + sta callclk+2 +callclk jsr $c000 ; call clock + pla + sta $39 + pla ; restore zp + sta $38 + + ldx #$0d + ldy #0 +movtime lda $286,x ; move returned string + and #$7f + sta datestr,y + iny + dex + bpl movtime + rts + +* convert time to 12hr format +*---------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +; convert a 2 byte decimal number to binary +decbin8 and #$7f + sec + sbc #'0' + sta decbyte ; save 10's digit + txa ; move 1's into A + and #$7f + sec + sbc #'0' + + ldy #10 +dec8a clc + adc decbyte ; add the 10's digit, 10 times + dey + bne dec8a + rts ; return with result + +decbyte hex 00 +datestr asc '00/00/00' +timestr asc '00:00:00 ' diff --git a/Source/Config/Clocks/No.Slot.S b/Source/Config/Clocks/No.Slot.S index c8edccc..f9b08c7 100644 --- a/Source/Config/Clocks/No.Slot.S +++ b/Source/Config/Clocks/No.Slot.S @@ -1 +1,189 @@ - 򍪭 捍썠􍍍ƠՠҠՠҠՠȠՠŠՠ٠ՠӠՠӠՠӠՠӠՠРՠư砤䰰⠰Š⠰ ŠРōŠРōˠӍ ϭ ōŠҠˍȍ̠̍̍̍̍̍ҍō؍ҍҠ̍ΠӍ ϭ ōŠҠˍ٠ӍԠō̠ԲͧūؠčÍàčàҍٍŠ΍٠ΠؠЧҠؠūŠԲ٠Բ٠ؠԠĠưҍҍҍҍÍàŬٍٍĠƍàŬٍٍٍ؍Ӭ؍ؠŠԍҠ̍ؠōōӍ Щ̠٠̱ЬٍҬٍٍŠ̱Ӎ ϭ ůōˠ٠ƠƬٍЬٍٍŠƍЍɍððøэҍэҫ٠DZҩٍÍҍDz̍؍ø؍ҍŠDzٍ̠DZؠĠ٠ԠøҍҠҬ؍ٍ̠ԍؠ̠ōҬ؍ĠƍҬ؍ĠưҍҍҍҍٍѠōӠàٍŠӍҵàҬ؍Ҭ؍Š؍̠č̍ӠčðЍĠӍ ϭ ˍѠ⠤ìõìõ ҍŠ⠤⠤⠤ \ No newline at end of file +*------------------------------- +* No Slot Clock - 24 hr +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + lst off + + rel + dsk rel/noslot + + +ZBUF EQU $41 +PTR EQU $42 + +YEAR EQU $44 +MONTH EQU $45 +DATE EQU $46 +DAY EQU $47 +HOURS EQU $48 +MINUTES EQU $49 +SECONDS EQU $4A +MSECONDS EQU $4B +TEMP EQU $2F0 + +noslot ent + org $0d00 + + db 0 +:MODE db 0 ;24 hour format +:GETDATE JMP :FMTDATE +:GETTIME JMP :FMTTIME +:SETCLK RTS +* +* FORMAT NO-SLOT CLOCK DATE +* +:FMTDATE JSR :RDCLOCK + LDA MONTH + ASL + ASL + ASL + ASL + ASL + ROL YEAR + ORA DATE + TAX + LDA YEAR + PHA + JSR :ZRECALL + PLA +:SETRTN RTS +* +* FORMAT NO-SLOT CLOCK TIME +* +:FMTTIME JSR :RDCLOCK + LDY HOURS + BIT :MODE + BPL :FMT24 + LDA #'M' + STA :TIME+10 + LDX #'A' + SED + SEC + TYA + SBC #$12 + CLD + BCC :SETHOUR + TAY + BNE :NOTNOON + LDY #$12 +:NOTNOON LDX #'P' +:SETHOUR STX :TIME+9 + TYA + BNE :FMT24 + LDY #$12 +:FMT24 TYA + LDY #$00 + LDX #$00 +:FMT PHA + AND #$F0 + LSR + LSR + LSR + LSR + CLC + ADC #$30 + STA :TIME,Y + INY + PLA + AND #$0F + ADC #$30 + STA :TIME,Y + INY + INY + INX + LDA HOURS,X + CPX #$03 + BNE :FMT + JSR :ZRECALL +* + LDX #<:TIME + LDA #>:TIME + RTS +* +* RECALL PG ZERO BUFFER (ACCESS VIA JMP) +* +:ZRECALL LDY #$0A +:ZRECALL1 LDA TEMP,Y + STA PTR,Y + DEY + BNE :ZRECALL1 + RTS +* +* READ THE NO-SLOT CLOCK AND RETRIEVE DATE/TIME +* +:RDCLOCK LDY #$0A +:STORBUF LDA ZBUF,Y + STA TEMP,Y + DEY + BNE :STORBUF + PHP + SEI + LDA $C015 + PHA + STA $C007 + LDA $C804 + LDA #<:RECSEQ + STA PTR + LDA #>:RECSEQ + STA PTR+1 + LDY #$07 +:RECOG1 LDA (PTR),Y + SEC + ROR +:RECOG2 PHA + LDA #$00 + ROL + TAX + LDA $C800,X + PLA + LSR + BNE :RECOG2 + DEY + BPL :RECOG1 + LDX #$07 +:NEXTREAD LDY #$07 +:READBIT LDA $C804 + ROR + ROR YEAR,X + DEY + BPL :READBIT + CPX #$03 + BPL :STORDATE + LDA YEAR,X + PHA + AND #$0F + STA YEAR,X + PLA + AND #$F0 + LSR + LSR + LSR + LSR + TAY + BEQ :STORDATE + LDA #$00 +:ADDTENS ADC #$0A + DEY + BNE :ADDTENS +:STOR5 ADC YEAR,X + STA YEAR,X +:STORDATE DEX + BPL :NEXTREAD + PLA + ROL + BCS :RDEND + STA $C006 + PLP +:RDEND RTS +* +* DEFINE RECOGNITION SEQUENCE FOR NO-SLOT CLOCK +* +:RECSEQ dfb $5C,$A3,$3A,$C5,$5C,$A3,$3A,$C5 +* +* TIME OUTPUT BUFFER +* +:TIME dfb $30,$30,$3A + dfb $30,$30,$3A + dfb $30,$30,$20,$20,$20 diff --git a/Source/Config/Clocks/Null.S b/Source/Config/Clocks/Null.S index 581606c..7c8f126 100644 --- a/Source/Config/Clocks/Null.S +++ b/Source/Config/Clocks/Null.S @@ -1 +1,144 @@ - 򍪭 捍썠썍尳ፍ􍍠砤䰰⠰占占卍 􍪭占嫱󍍪 翍 卍 獠򫱍ᠨ ᠨ嫱 򍍠ᠨ ᠨ䠣堻 ᠨ 荠ᠨ䠣 덠썠썠썠썠썠嫱 䍠占堻 󍍪 卪 㸍򫱍 㸍򫳍򫴍 㸍򫶍򫷍 獠ᠣ󍍪 䠣捠㍠㠣堻 ᠠ 䠣捠㍠㠣㍠堻 ፠󠠻 ۰ݍ㸠𠣶 ᠣ 𠣱⠻ 卍㠣 ᠻ 㠣 占፠㠣 󠠻 卍㠧 ԧ \ No newline at end of file +*------------------------------- +* No Clock Driver +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + lst off + + rel + dsk rel/null + +bytcnt equ $0e03 +nullptr equ $0a + + +nullclk ent + + org $0d00 + +*------------------------------- + +slot hex 00 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + +* get the date in prodos/gbbs format +*------------------------------- + +getdate ldx date + lda date+1 + rts + +* set the date manually +*------------------------------- + +setdate cpy #8 ; is it 8 chars long? + bne setdt2 ; nope + + stx nullptr ; point to string + sta nullptr+1 + + ldy #7 + lda (nullptr),y + tax ; process year + dey + lda (nullptr),y + jsr decbin8 + sta date+1 ; save year + + ldy #4 + lda (nullptr),y + tax ; process day + dey + lda (nullptr),y + jsr decbin8 + and #%00011111 + sta date ; save day + + ldy #1 + lda (nullptr),y + tax ; process month + dey + lda (nullptr),y + jsr decbin8 + and #%00001111 ; get rid of extra junk + asl + asl + asl + asl + asl + rol date+1 ; put bit into year field + ora date + sta date ; put rest into day field +setdt2 rts + +* get the current estimated time +*------------------------------- + +gettime lda bytcnt+2 ; show hours + jsr bindec8 + sta timestr + stx timestr+1 + + lda bytcnt+1 ; show minutes + jsr bindec8 + sta timestr+3 + stx timestr+4 + + lda bytcnt+0 ; show seconds + jsr bindec8 + sta timestr+6 + stx timestr+7 + + ldx #timestr + rts + +* convert a 2 byte decimal number to binary +*------------------------------- + +decbin8 and #$7f + sec + sbc #'0' + sta decbyte ; save 10's digit + txa ; move 1's into A + and #$7f + sec + sbc #'0' + + ldy #10 +dec8a clc + adc decbyte ; add the 10's digit, 10 times + dey + bne dec8a + rts ; return with result + +decbyte hex 00 + +* translate a binary to text [0-99] +*------------------------------- + +bindec8 cmp #60 ; put limit of 59 + bcc bin8 + lda #59 + +bin8 ldy #0 ; start 10's counter +bin8a cmp #10 + bcc bin8b ; less than 10, were done + + sbc #10 ; minus 10 + iny ; add 1 to the 10's counter + bne bin8a ; loop + +bin8b adc #'0' ; make 1's into text + tax ; save + tya + adc #'0' ; make 10's into text + rts ; were done + +timestr asc '00:00:00 ET' +date hex 0000 diff --git a/Source/Config/Clocks/OLD/Clk.Iic.Sys.S b/Source/Config/Clocks/OLD/Clk.Iic.Sys.S index eabb722..768a764 100644 --- a/Source/Config/Clocks/OLD/Clk.Iic.Sys.S +++ b/Source/Config/Clocks/OLD/Clk.Iic.Sys.S @@ -1 +1,153 @@ - 򍪭 썠ƠՠҠՠ㰹㰹ṍፍ尳ፍ􍍠砤䰰占占卍 氰 ɍ湰ᠤ湱󍍻 렻 덍ᠣ򫲠 򫵍 獠ᠣ󍍻 𠣤ᠣ ߲ᠣ ߳߳ᠣ߲߱㠣߲፠㠣 ߱߳ 獠ፍᠣ 덍߱ ߱򠣤ᠻ 荠 獍߲ ᠣ ߱ 占߲߱ 占썠썠썠 򠣰 占߳ 󍍠፠䠣栻 驍ᠣ፠򠠻 占ᠣ 鍠㠧 㠧 \ No newline at end of file +*------------------------------- +* //c System Clock - 24 hr +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + rel + dsk rel/iicsys + +lnbuf equ $200 + +ZBUF EQU $41 +PTR EQU $42 + +stat1 equ $c099 +comm1 equ $c09a +stat2 equ $c0a9 +comm2 equ $c0aa + +bytcnt equ $0e03 +nullptr equ $0a + + +iicsys ent + + org $0d00 + +*------------------------------- + +slot hex 20 + + jmp getdate + jmp gettime + jmp setdate + +; get the date in prodos/gbbs format +getdate jsr $bf00 ; read date from MLI + hex 82 + hex 0000 + + ldx $bf90 + lda $bf91 + +setdate rts + +; get the current time +gettime jsr rdclock ; read the clock + + lda #':' + sta timestr+2 ; put time dividers in + sta timestr+5 + + ldx #timestr + rts + +; read the date time from clock +rdclock lda slot + cmp #$10 + beq init1 + + lda # +Hour DS 1 + DS 1 ; + DS 2 ; + DEND + DUMMY $2F0 +NSC_save DS 10 ;Zero-Page save area durning NSC access + DEND + +CLRCXROM = $C006 +SETCXROM = $C007 +RDCXROM = $C015 + +NSC_data = $C800 +NSC_init = $C804 + + TR ADR +noslot ent + ORG $0D00 + HEX 10 ;Clock slot # +HrFormat HEX 80 ;If -; 12 Hr format / If +; 24 Hour format + JMP :GetDate ;GETDATE + JMP :GetTime ;GETTIME + RTS ;SETDATE + +:GetDate JSR :ReadClk ;Read the clock + LDA Month ;Convert Date/Month/Year into ProDOS + ASL ;Strings + ASL + ASL + ASL + ASL + ROL Year + ORA Date + TAX + LDA Year + PHA + JSR :RestZPg ;Restore Zero-Page + PLA + RTS + +:GetTime JSR :ReadClk ;Read the clock + LDY Hour + BIT HrFormat ;24 hour time format ? + BPL :CnvTime ;Yes + LDA #'M' ;No : Setup time sting for 12 hour format + STA :TimeStr+10 + LDX #'A' ; + SED + SEC + TYA ;Is it Afternoon/Evening ? + SBC #$12 + CLD + BCC :SetAMPM ;No + TAY ;Yes: Save "result" hour + BNE :MakePM + LDY #$12 ;....It's the Noon hour.... +:MakePM LDX #'P' +:SetAMPM STX :TimeStr+9 + TYA ;Is it the 12 AM hour ? + BNE :CnvTime + LDY #$12 ;Yes +:CnvTime TYA ;Setup time string + LDY #0 + LDX #0 +:NxtByte PHA ;Split byte into nibbles + AND #$F0 + LSR + LSR + LSR + LSR + CLC + ADC #'0' ;Setup 'Tens' digit + STA :TimeStr,Y + INY ;Setup 'Ones' digit + PLA + AND #$0F + ADC #'0' + STA :TimeStr,Y + INY + INY + INX ;Are we finished (thru Seconds) ? + LDA Hour,X + CPX #4-1 + BNE :NxtByte ;No + JSR :RestZPg ;Yes: Restore Zero-Page + LDX #<:TimeStr ;and return with pointer to time string + LDA #>:TimeStr + RTS + +:RestZPg LDY #10 ;Restore Zero page +:RestZP1 LDA NSC_save,Y + STA NSC_work-1,Y + DEY + BNE :RestZP1 + RTS + +* ReadClk - Read the values from the NSC's memory +:ReadClk LDY #10 ;Save off Zero page that we are using +:SaveZPg LDA NSC_work-1,Y + STA NSC_save,Y + DEY + BNE :SaveZPg + SEI ;Don't allow Interrupts durning NSC access + LDA RDCXROM ;Save CX-ROM state + PHA + STA SETCXROM + LDA NSC_init ;Enable NSC for init string + LDA #<:InitStr ;Setup pointer to init string + STA NSC_Ptr + LDA #>:InitStr + STA NSC_Ptr+1 + LDY #7 ;Send init string +:IntNByt LDA (NSC_Ptr),Y ;Get next NSC inti byte + SEC + ROR +:IntNBit PHA ;Send the bits... + LDA #0 + ROL + TAX + LDA NSC_data,X + PLA + LSR + BNE :IntNBit + DEY + BPL :IntNByt + LDX #7 ;Read in the time from the NSC chip +:NxtOByt LDY #7 +:NxtOBit LDA NSC_init + ROR + ROR NSCoutpt,X + DEY ;More bits to receive ? + BPL :NxtOBit ;Yes + CPX #3 ;Are we down to "Day of Week" ? + BPL :MoreO? ;Yes: Ignore DOW, Date, Month, and Year + LDA NSCoutpt,X ;No : Convert BCD to Hex + PHA + AND #$0F + STA NSCoutpt,X + PLA + AND #$F0 + LSR + LSR + LSR + LSR + TAY + BEQ :MoreO? + LDA #0 +:Cnv2Hex ADC #10 + DEY + BNE :Cnv2Hex + ADC NSCoutpt,X + STA NSCoutpt,X +:MoreO? DEX ;More bytes to read from NSC ? + BPL :NxtOByt ;Yes + PLA ;No : Restore CX-ROM setting + ROL + BCS :ReadDon + STA CLRCXROM +:ReadDon RTS + +:InitStr HEX 5C,A3,3A,C5,5C,A3,3A,C5 +:TimeStr ASC '00:00:00 ' + HEX 00,00 + + diff --git a/Source/Config/Clocks/Prodos.S b/Source/Config/Clocks/Prodos.S index f878ac1..2dd7b39 100644 --- a/Source/Config/Clocks/Prodos.S +++ b/Source/Config/Clocks/Prodos.S @@ -1 +1,139 @@ - 򍪭 捍썠氰湰湲砤䰰⠰⠰占占卍 􍪭頻 썠占 卍占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 󍪭堻 卍嫱 㸠 鍠 򫱍堻 㸠 鍠򫳠 占򫴍ᠣ 퍠򫹍򫱰󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰󍍪 ۰ݍ㸠𠣶 ᠣ 𠣱⠻ 卍㠣 ᠻ 㠣 占፠㠣 󠠻 卍 㠧 \ No newline at end of file +*------------------------------- +* ProDOS Clock Driver +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + lst off + + rel + dsk rel/prodos + +mli equ $bf00 +date equ $bf90 +time equ $bf92 +get_time equ $82 + +prodos ent + org $0d00 + +*------------------------------- + + db 0 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr mli ; mli call + db get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* read time from prodos +*------------------------------- +rdtime jsr getdate ; update time + + lda time+1 ; get current hour + jsr bindec8 ; translate to ascii + sta timestr ; save hour + stx timestr+1 + + lda time ; get minutes + jsr bindec8 ; translate to ascii + sta timestr+3 ; save minute + stx timestr+4 + + lda #' ' ; clear out any possible am/pm + sta timestr+9 + sta timestr+10 + + rts + +* convert time to 12hr format +*---------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +* translate a binary to text [0-99] +*------------------------------- +bindec8 cmp #60 ; put limit of 59 + bcc bin8 + lda #59 + +bin8 ldy #0 ; start 10's counter +bin8a cmp #10 + bcc bin8b ; less than 10, were done + + sbc #10 ; minus 10 + iny ; add 1 to the 10's counter + bne bin8a ; loop + +bin8b adc #'0' ; make 1's into text + tax ; save + tya + adc #'0' ; make 10's into text + rts ; were done + +* '01234567890 +timestr asc '12:00:00 ' diff --git a/Source/Config/Clocks/Serialpro.S b/Source/Config/Clocks/Serialpro.S index 807d8cc..f61bb81 100644 --- a/Source/Config/Clocks/Serialpro.S +++ b/Source/Config/Clocks/Serialpro.S @@ -1 +1,130 @@ - 󍪭捍썠氰湰􍍠砤䰰⠰占占卍 􍪭氰 썠占 卍占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 덪 忍뱠 ᠣ㰠 퍍벫 볫 䍍뱠ᠣᶠ 베㰲 㴲볠㰱䠻 䩍봠봍󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰㠧 ͧ \ No newline at end of file +*------------------------------- +* Serial Pro Driver - 12 hrs +*------------------------------- + + lst off + + rel + dsk rel/serialpro + +lnbuf equ $200 +mli equ $bf00 +date equ $bf90 +get_time equ $82 + + +serialpro ent + + org $0d00 + +*------------------------------- + +slot hex 40 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr $bf00 ; mli call + db get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* read the current time from clock +*------------------------------- +rdtime bit initbyt ; has routine been called before? + bmi clock1 ; yep + + lda slot ; get clock slot + lsr + lsr + lsr + lsr + ora #$c0 ; make into $Cn form + + sta clock2+2 ; modify code for slot + sta clock3+2 + dec initbyt ; show routine has been init'ed + +clock1 lda #$a6 ; use "&" mode +clock2 jsr $c020 ; modified ($c420) +clock3 jsr $c01d ; modified ($c4ld) + + ldy #12 + ldx #0 +clock4 lda lnbuf,y + sta timestr,x + iny + inx + cpx #8 + bne clock4 + rts + +* convert time to 12 hour format +*------------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + +conv and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + + ldx #'M' + stx timestr+10 + rts + +initbyt hex 00 +timestr asc '00:00:00 AM',00 diff --git a/Source/Config/Clocks/Thunder.S b/Source/Config/Clocks/Thunder.S index b008b4f..ca0abcb 100644 --- a/Source/Config/Clocks/Thunder.S +++ b/Source/Config/Clocks/Thunder.S @@ -1 +1,131 @@ - 󍪭 捍썠湰砤䰰⠰占占卍 氰占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 덪 忍뱠 𠴍򍠭ލᠣ㰠 퍍벫 볫 䍍뱠ᠣ 베㰰⠻ 㴰⩍볠㰰 㴰봠櫹 봍ᠣ 獠򫲍򫵍ᠣ 򫹠 򫱰󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰󍍪 ፪㠧 \ No newline at end of file +*------------------------------- +* Thunderclock Driver - 24 hrs +*------------------------------- +* Date Revised: 08/04/87 +*------------------------------- + + lst off + + rel + dsk rel/thunder + +lnbuf equ $200 +date equ $bf90 + +thunder ent + org $d00 + +*------------------------------- + +slot hex 40 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + +; get the date in prodos/gbbs format +getdate jsr $bf00 + hex 82 + hex 0000 + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* read time from clock +*------------------------------- +rdtime bit initbyt ; has routine been called before? + bmi clock1 ; yep + + lda slot ; get clock slot + lup 4 + lsr + --^ + ora #$c0 ; make into $Cn form + + sta clock2+2 ; modify code for slot + sta clock3+2 + dec initbyt ; show routine has been init'ed + +clock1 lda #"#" ; use "&" mode (24 hour) +clock2 jsr $c00b ; modified ($c40b) +clock3 jsr $c008 ; modified ($c408) + + ldy #0 +clock4 lda lnbuf+9,y ; get time from input buffer + sta timestr,y + iny + cpy #8 + bne clock4 + lda #":" ; put colens back into string + sta timestr+2 + sta timestr+5 + lda #' ' + sta timestr+9 ; make sure that the am/pm is reset + sta timestr+10 + rts + +* convert time to 12 hour format +*------------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +* data area +*------------------------- +initbyt hex 00 +timestr asc '00:00:00 ',00 diff --git a/Source/Config/Clocks/Ultra.S b/Source/Config/Clocks/Ultra.S index 1dbfe09..eff9adf 100644 --- a/Source/Config/Clocks/Ultra.S +++ b/Source/Config/Clocks/Ultra.S @@ -1 +1,148 @@ - ڭ 򍪭 捍썠ፍ􍍠砤䰰氰湰⠰⠰占占卍 􍪭頻 썠占 卍占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 덪ᠣ㰶ᠣᠤ㰶䍠ᠤ㰶䍠ᠤ㰶䍠ᠤ㰶䍠䠣占ᠣᠤ㰶䍠ᠤ㰶䍠ᠤ㰶䍠덍ᠤ㰶 䠣ᠣᠤ㰶 䠣ᠣ򫱍ᠤ㰶 占䠣ᠣ򫳍ᠤ㰶 占䠣ᠣ򫴍ᠤ㰶 䠣ᠣ򫶍ᠤ㰶 䠣ᠣ򫷍ᠣᠤ㰶䍠ᠤ㰶䠻 ᠤ㰶䍠󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰󍍍 󍪭㠧 \ No newline at end of file +*------------------------------- +* Z-RAM Ultra 2-3 - 12 hour +*------------------------------- +* Date Revised: 01/30/90 +*------------------------------- + + lst off + + rel + dsk rel/ultra + +ultra ent + + org $0d00 + +*------------------------------- +get_time equ $82 +mli equ $bf00 +date equ $bf90 + + db 00 +mode db 0 + jmp getdate + jmp gettime + jmp setdate + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr mli ; mli call + db get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* read the current time from clock +*------------------------------- +rdtime lda #$c060 +holdclk lda #%00000101 + sta $c06d + sta $c06d + sta $c06d + ldy #30 +loop lda $c06d + and #%00000010 + beq readtime + dey + bne loop + lda #%00000100 + sta $c06d + sta $c06d + sta $c06d + bne holdclk + +readtime lda $c065 ; 10's of hour + and #%00000011 + ora #$30 + sta timestr + lda $c064 ; 1's of hour + and #%00001111 + ora #$30 + sta timestr+1 + lda $c063 ; 10's of minute + and #%00000111 + ora #$30 + sta timestr+3 + lda $c062 ; 1's of minute + and #%00001111 + ora #$30 + sta timestr+4 + lda $c061 ; 10's of seconds + and #%00000111 + ora #30 + sta timestr+6 + lda $c060 ; 1's of seconds + and #%00001111 + ora #$30 + sta timestr+7 + lda #%00000100 + sta $c06d + sta $c06d ; release hold bit + sta $c06d + rts + +* convert time to 12hr format +*---------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + + +* variables +*------------------------------- +timestr asc '00:00:00 ',00 diff --git a/Source/Config/Clocks/Versa.S b/Source/Config/Clocks/Versa.S index 176715c..873da8b 100644 --- a/Source/Config/Clocks/Versa.S +++ b/Source/Config/Clocks/Versa.S @@ -1 +1,175 @@ - 򍪭 捍썠ፍ􍍠砤䰰氰湰⠰占占卍 􍪭頻 썠占 卍占嫱󍍪 卪占占屍屠 獠ᠣ󍍪 卪덠ᠠ 祉䠣ፍ򠠻 ᠣЧ 퍠򫹍򠠻 썍ᠣ 퍠򫹍򫱰󍍪 덪 베 봍볠 ፍ䠣 ᠤ㰸 ፍᠤ㰸 ፠䠣 ፠ᠣ 볠䠣栻 驍베 봠󍍪 􍪭 򫱍䠣捠፠䠣捍㍠㠣㠣𠣱፠ᠣᠣ𠣱㠣Ч𠣱㠣ᠣ򫱍򫹍ͧ򫱰󍍪 䠣捠㍠㠣堻 ᠠ 䠣捠㍠㠣㍠堻 ፠󠠻 󍪭㠧 ͧ㠢㠢㠢 ͢ \ No newline at end of file +*------------------------------- +* Promethus Versacard Driver +*------------------------------- +* Revised Date: 08/02/87 +*------------------------------- + + lst off + + rel + dsk rel/versa + +versa ent + + org $0d00 + +*------------------------------- + +get_time equ $82 +mli equ $bf00 +date equ $bf90 + +slot hex 40 +mode db 0 + + jmp getdate + jmp gettime + jmp setdate + + +* get the date in prodos gbbs format +*------------------------------- +getdate jsr mli ; mli call + db get_time + hex 0000 ; no pramater table + + ldx date + lda date+1 +setdate rts + +* get the current time +*------------------------------- +gettime jsr rdtime + bit mode + bpl gtime1 + jsr convert + +gtime1 ldx #timestr + rts + +* figure the current time +*------------------------------- +rdtime jsr rdclock + lda timestr + pha ; fix hour (remove) am/pm info) + and #%00110011 + sta timestr + pla + + lsr + lsr + lsr ; move am/pm bit into carry + bcc gettim2 ; it is am (default) + + lda #'P' ; change to pm + sta timestr+9 + +gettim2 lsr ; move 12/24 hour bit into carry + bcc gettim3 ; in 12 hour mode, all is well + + lda #' ' ; in 24 hour mode kill am/pm + sta timestr+9 + sta timestr+10 + +gettim3 rts + +* read the date from clock +*---------------------------- +rdclock ldx #0 + ldy slot ; get slot offset +rdclk2 lda clkparm,x ; get function + beq rdclk4 + bmi rdclk3 ; just ascii data + + and #%00111111 ; kill high status info + sta $c082,y ; point to data + + lda $c083,y ; load in data + and #%00001111 ; get rid of extra + ora #'0' ; make into numeric digit +rdclk3 and #$7f ; kill high (from ascii) + sta timestr,x + inx + jmp rdclk2 ; go until out of data +rdclk4 rts + +* convert time to 12hr format +*-------------------------------- +convert lda timestr ;convert to 12 hour + ldx timestr+1 + + and #$0f + tay + txa + and #$0f + + dey + bmi conv2 + clc + adc #10 + dey + bmi conv2 + adc #10 + +conv2 cmp #12 + bne conv2a + lda #24 +conv2a tay + bne conv3 + lda #12 + +conv3 ldx #'A' + cmp #13 + bcc conv4 + + sbc #12 + ldx #'P' + +conv4 ldy #'0' +conv5 cmp #10 + bcc conv6 + + sbc #10 + iny + bne conv5 + +conv6 ora #'0' + sta timestr+1 + sty timestr + stx timestr+9 + ldx #'M' + stx timestr+10 + rts + +* convert a 2 byte decimal number to binary +*-------------------------------- +decbin8 and #$7f + sec + sbc #'0' + sta decbyte ; save 10's digit + txa ; move 1's into A + and #$7f + sec + sbc #'0' + + ldy #10 +dec8a clc + adc decbyte ; add the 10's digit, 10 times + dey + bne dec8a + rts ; return with result + +decbyte hex 00 + +* variables +*------------------------- +timestr asc '00:00:00 AM',00 + +clkparm hex 1514 + asc ":" + hex 1312 + asc ":" + hex 1110 + asc " AM" + hex 00 diff --git a/Source/Config/Config.S b/Source/Config/Config.S index 98cb7bd..0bd6d10 100644 --- a/Source/Config/Config.S +++ b/Source/Config/Config.S @@ -1 +1,29 @@ - 卪썠獍捠占덠덠퍠덠 \ No newline at end of file +******************************** +* * +* GBBS Pro - Config Program * +* * +******************************** + Date +******************************** + + rel + dsk rel/config + + lst off + put equates + put start + put routine + put disk + put pdiskio + put ospjunk + put viddvr + put modem + put video + put clock + put printer + put init + put pfilter + put pstor + put boardedit + put user + put userpurge diff --git a/Source/Config/Disk.S b/Source/Config/Disk.S index 1189f3d..1b71cdb 100644 --- a/Source/Config/Disk.S +++ b/Source/Config/Disk.S @@ -1 +1,103 @@ - 獪 ۱ ݍ ፠ 򍍠堻 ፠ 򍍠ᠨ堺 卍㠠 썺󍍪 덍 ፠፠ 荍ᠨ ፠占堺 卍󍍍 卍𫱠 荠𫲍鍠⠤㶠 򍍠頻 占⠤㷠 荺⠱ 􍍍 덍砻 덠占ᠣ占堻 占 ꧍ 򍍠栻 ᠣ捠 󩍠덠堻 占㍺󍍪 덍砻 덠占ᠣ占堻 占򍍠栻 덠ᠣ捠렻 󩍠占㍺⠰ \ No newline at end of file +*------------------------------- +* Disk stuff for config +*------------------------------- +* Date: 3/11/88 +*------------------------------- + +*------------------------------- +* read in a partial record [1-255 bytes] + +rdpart stx part + sta part+1 ; point to buffer + tya + tax ; save counter + + ldy #0 +:loop jsr rdbyte ; read in data + bcs :error ; error + + sta (part),y + iny + dex + bne :loop ; do next byte + + clc ; all went well +:error rts + +*------------------------------- +* write a partial block of data to disk + +wrpart stx part ; point to data + sta part+1 + tya + tax ; save length + + ldy #0 +:loop lda (part),y ; write out data + jsr wrbyte + iny + dex + bne :loop ; do next byte + + rts + + +*------------------------------- +* verify a that a disk is online + +verify stx verify_p+1 ; point to wanted path + sta verify_p+2 + + jsr mli + db $c6 ; set prefix + dw verify_p + bcs :error + + jsr mli ;get prefix for source volume + db $c7 ;get prefix + dw p_pfx2 ;point to path +:error rts + +verify_p db 1 + dw 0 ;address of path to set + + +*------------------------------- +* load config/acos.obj from disk + +ldacos jsr logprg ; log to the program disk + ldx #gname + jsr movname ; move filename + jsr open ; open 'acos.obj' + bcs :error ; error + + ldx #confbuf + ldy #20 ; read 10 pages (5 blocks) + jsr rdblk + jsr close ; close file + clc +:error rts + +*------------------------------- +* write config/acos.obj back to disk + +svacos jsr logprg ; log to program disk + ldx #gname + jsr movname ; move filename + jsr open + bcs :error + + ldx #confbuf + ldy #20 + jsr wrblk ; write 10 pages (5 blocks) + jsr close + clc +:error rts + +refnum db 0 + + diff --git a/Source/Config/Equates.S b/Source/Config/Equates.S index 14b5f7e..6061ec2 100644 --- a/Source/Config/Equates.S +++ b/Source/Config/Equates.S @@ -1 +1,82 @@ - 捍 沍㰰䰰尰㰍䰍捍氰池㰰尰 卍 ۴ ݍ卍䍍 \ No newline at end of file +******************************** +* * +* Config Program - Equates * +* * +******************************** + +*------------------------------- +* Date: 3/11/88 +*------------------------------- + +bs equ $08 +lf equ $0a +up equ $0b +cr equ $0d +fs equ $15 +can equ $18 +esc equ $1b +del equ $7f + +; memory allocation / buffers + +lnbuf equ $0200 +flname equ $0300 +fltext equ $0301 +reset equ $03f2 +confbuf equ $0800 +filter equ $0805 +devnam equ $0815 +viddrv equ $0900 +prdrv equ $0c00 +clkdrv equ $0d00 +mdmdrv equ $0e00 +cdbyte equ $11bf +ansstr equ $11c0 +initstr equ $11d0 +hdrbuf equ $1200 + +cdtype equ $1ffd +modemtype equ $1ffe +serialtype equ $1fff + +mli equ $bf00 + +initbuf equ $1800 +ansbuf equ $1830 +fbuf1 equ $1c00 +fnam1 equ $1e00 + +sortbuf equ $8000 +copybuf equ $6000 +copymax equ $5800 +; zero page usage + +temp equ $00 +temp2 equ $02 +temp3 equ $04 +temp4 equ $06 +x_save equ $09 +y_save equ $0a +chrptr equ $0b +base equ $0d +maxlen equ $0f +inverse equ $10 +point0 equ $11 +point1 equ $14 +prn equ $16 ; [4 bytes] +numptr equ $1a +psave equ $1c +prnt equ $1e + +ch equ $24 +cv equ $25 + +fmparm equ $60 +doszero equ $62 +dosptr equ $64 +part equ $66 +dosbyt equ $68 + +point3 equ $fd + + diff --git a/Source/Config/Init.S b/Source/Config/Init.S index b8b91b2..50053a9 100644 --- a/Source/Config/Init.S +++ b/Source/Config/Init.S @@ -263,8 +263,8 @@ hard1 ldx # driver +nocar ext ;no carrier driver + +*------------------------------- +* init strings + +usr2400 ext ;init string for usr 2400 +usr9600 ext ;init string for usr 9600 +apl1200 ext +hayes1200 ext +hayes2400 ext +hayes9600 ext +pro2400 ext +generic ext +epic ext +datalink24 ext +ultra9600 ext + +*------------------------------- +* Reconfigure modem +*------------------------------- + +re_mdm bit init + bmi re_mdmx + + ldx #start + jsr escape + jmp re_mdm0 + +re_mdmx ldx #doinit ; setup aux esc handler + jsr escape + +re_mdm0 lda #1 ; set input length at 1 + sta maxlen + lda #%10010000 + sta inpmode + +re_mdm3 jsr TopBox + jsr print + db 1,3,6 + asc '- Reconfigure Modem Driver -',00 + + jsr cls + jsr print + db 1,7,0 + asc ' 1 - No Modem/Local mode',0d,0d + asc ' 2 - Apple-Cat 103 - 300 baud',0d + asc ' 3 - Apple-Cat 212 - 300/1200 baud',0d + asc ' 4 - DC Hayes Micromodem II',0d + asc ' 5 - Zoom Modem IIe',0d,0d + asc ' 6 - Epic 2400 Classic II',0d + asc ' 7 - Applied Engineering DataLink 2400',0d,0d + asc ' 8 - Super Serial Card driver',0d + asc ' 9 - Apple IIgs Serial Port driver',0d + asc '10 - Single Speed SSC driver',0d + asc '11 - Multiple Spd SSC driver (IIc port)',0d + asc '12 - No Carrier SSC driver',0d,0d + asc 'Which? [1-12] ',00 + + ldx #12 ; get serial device + jsr inpnum + sta serialtype ;save the device type + + asl a ;point0 points to the + tax ;serial device driver + lda devtable,x + sta point0 + inx + lda devtable,x + sta point0+1 + + lda #mdmdrv + sta point1+1 + + lda #12 ;default is generic + asl a ;point init string to the + tax ;right place + lda strtable,x + sta point3 + inx + lda strtable,x + sta point3+1 + + lda serialtype ;is it internal? + cmp #8 + bcs getinit ;nope, get an init string + cmp #7 ;was it AE Datalink 2400? + beq :dl24 ;use DL init string + cmp #6 ;was it the Epic internal? + beq :epic24 ;yes, set for epic string + cmp #1 ;nullmodem? + bne :internal ;nope, just internal + pha ;push garbage data + pha + jmp movepage ;move & fix into place + +:internal jmp getslot ;must have been internal, skip next + +:dl24 lda #14 ;datalink string is #14 + hex 2c ;skip next instruction + +:epic24 lda #1 ;default for epic is &s1&d2 + jmp getinit1 ;move init sting into right place + +*------------------------------- +* get the init string for the modem + +getinit jsr cls + jsr print + db 1,7,0 + asc 'Choose Modem:',0d,0d + asc ' 1 - Epic 2400 Plus',0d + asc ' 2 - USRobotics Courier 2400',0d + asc ' 3 - USRobotics Courier HST',0d + asc ' 4 - Apple Modem 1200',0d + asc ' 5 - Prometheus Promodem 1200',0d + asc ' 6 - Prometheus Promodem 2400',0d + asc ' 7 - Novation SmartCat',0d + asc ' 8 - Novation Professional 2400',0d + asc ' 9 - Hayes 1200',0d + asc '10 - Hayes 2400',0d + asc '11 - Hayes V-Series 9600',0d + asc '12 - Hayes Ultra 9600/PP 9600sa'0d + asc !13 - Generic 'AT' Compatible!,0d,0d + asc 'Which? [1-13] ',00 + + ldx #13 + jsr inpnum + sta modemtype + +getinit1 asl a ;point init string to the + tax ;right place + lda strtable,x + sta point3 + inx + lda strtable,x + sta point3+1 + +*------------------------------- + +setinit jsr cls + jsr print + db 1,7,0 + asc 'The init string for this modem is:',0d,0d,00 + + ldy #0 +:loop lda (point3),y + sta initbuf,y + beq :done + jsr cout + iny + bne :loop + +:done jsr print + hex 0d + asc 'Press [RETURN] to accept this as'0d + asc 'default, or enter a new init string.',0d + asc ':',00 + + lda #39 ; only allow 39 chars + sta maxlen + lda #%10100000 + sta inpmode ;ascii + jsr inpln ; get the input + ldy lnbuf + cpy #cr + beq getans ; use default + + ldy #-1 +:loop2 iny ;move the typed init string + lda lnbuf,y + sta initbuf,y + cmp #cr + bne :loop2 + + iny + lda #0 + sta initbuf,y + +*------------------------------- +* get the answer string + +getans jsr cls + jsr print + db 1,7,0 + asc 'The answer string for this modem is:',0d,0d,00 + + ldy #0 +:loop lda atastr,y + sta ansbuf,y + beq :done + jsr cout + iny + bne :loop + +:done jsr print + hex 0d + asc 'Press [RETURN] to accept this, or',0d + asc 'enter a new answer string.',0d + asc ':',00 + + lda #15 ; only allow 15 chars + sta maxlen + jsr inpln ; get the input + ldy lnbuf + cpy #cr + beq getdcd ; use default + + ldy #-1 +:loop2 iny ;move the typed answer string + lda lnbuf,y + sta ansbuf,y + cmp #cr + bne :loop2 + + iny + lda #0 + sta ansbuf,y + +*------------------------------- +* get the dcd drop type + +getdcd jsr print + hex 0d,0d + asc 'What type of carrier detect should'0d + asc 'the modem driver use?',0d,0d + asc ' 1 - DSR Carrier Detect [Normal]',0d + asc ' 2 - DCD Carrier Detect',0d,0d + asc 'Which? [1-2] ',00 + + ldx #2 + jsr inpnum + sta cdtype + +*------------------------------- +* get the proper slot + +getslot jsr cls + lda serialtype + cmp #9 + beq :gsport + + jsr print + db 1,7,0 + asc 'Which slot should the modem driver use?'0d + asc '[1-7] ',00 + ldx #7 + jmp :over + +:gsport jsr print + db 1,7,0 + asc 'Which Serial Port? [1-2] ',00 + + ldx #2 +:over jsr inpnum + pha + + ldx serialtype + cpx #9 ;was it the IIgs serial port? + bne :notgsport ;nope + + cmp #1 ;was it port #1? + bne :port2 ;nope, must be port 2 + + lda #gsport1 + sta point0+1 + jmp :hst + +:port2 lda #gsport2 + sta point0+1 + +* CODE FOR HST GS MODEM PORT! * + +:hst pla ; get back slot # + pha + ldx modemtype + cpx #3 ; did they pick HST? + bne :ultra ; nope so go on + + cmp #1 ;was it port #1? + bne :hst2 + + lda #gs1hst + sta point0+1 + jmp :notgsport + +:hst2 lda #gs2hst + sta point0+1 + jmp :notgsport + +:ultra ldx modemtype + cpx #13 ; did they pick ULTRA/PP? + bne :notgsport ; nope so go on + + cmp #1 ;was it port #1? + bne :ult2 + + lda #ultra1 + sta point0+1 + jmp :notgsport + +:ult2 lda #ultra2 + sta point0+1 + +:notgsport + lda serialtype ;was it an internal? + cmp #7 + bcs :external ;no, init baud needed + jmp :internal ;yes, init spd not needed + +:external jsr print + db 1,10,0 + asc 'At what baud rate should the port/card',0d + asc 'be initialized? (Choose the maximum',0d + asc 'baud rate of your modem)',0d,0d + asc ' 1 - 300 baud',0d + asc ' 2 - 1200 baud',0d + asc ' 3 - 2400 baud',0d + asc ' 4 - 4800 baud',0d + asc ' 5 - 9600 baud',0d + asc ' 6 - 19200 baud',0d + asc ' 7 - 38400 baud (only for v.32 modems)',0d,0d + asc 'Which? [1-6] ',00 + + ldx #7 + jsr inpnum +:internal pha + +movepage ldx #3 ;move 3 illustrious pages +:loop2 ldy #0 +:loop lda (point0),y ;source + sta (point1),y ;destination + iny + bne :loop + inc point0+1 + inc point1+1 + dex + bne :loop2 + + pla ;get init speed + tax + dex ;one less + stx mdmdrv+1 ;save it + + pla ;get the slot + asl a + asl a + asl a + asl a ;a := a*16 + sta mdmdrv ;store the slot + + dec cdtype + lda serialtype + cmp #9 ;was it the gs? + bne :notgs ;nope, go there, SSC + + lda cdtype ;get drop type + bne :notgsdsr ;dcd wanted, so stick it + lda #$20 ;else use dsr drop + sta cdbyte + bne copyans + +:notgsdsr lda #$08 ;setup for dcd drop + sta cdbyte + bne copyans + +:notgs lda cdtype ;ssc + bne :notdsr ;dcd drop wanted, go there + lda #%01000000 ;check only dsr (normal) + sta cdbyte + bne copyans + +:notdsr lda #%00100000 ;otherwise check DCD + sta cdbyte + +*------------------------------- + +copyans ldy #0 +:loop lda ansbuf,y ;copy the answer string + sta ansstr,y + beq copyinit + iny + bne :loop + +copyinit ldy #0 ;copy the init string +:loop lda initbuf,y + sta initstr,y + beq :writeit + iny + bne :loop + +:writeit jsr chinit ; check for init + jmp wrtchg ; write the changes + +*------------------------------- +* modem drivers + +devtable dw 0 ;extra for offset 0 + da nullmdm ;null modem driver + da cat103 ;300 baud cat driver + da cat212 ;1200 baud cat driver + da mm2 ;micromodem II driver + da mm2 ;Zoom Modem + da ssc ;AE DataLink 2400 + da ssc ;epic 2400 classic + da ssc ;super serial driver + da gsport2 ;location for gs port driver + da singlespd ;single speed driver + da multispd ;multi-speed driver + da nocar ;no carrier 300 baud driver + +strtable dw 0 + da epic ;1 + da usr2400 ;2 + da usr9600 ;3 + da apl1200 ;4 + da usr2400 ;5 + da usr2400 ;6 + da hayes2400 ;7 + da pro2400 ;8 + da hayes1200 ;9 + da hayes2400 ;10 + da hayes9600 ;11 + da ultra9600 ;12 + da generic ;13 + da datalink24 ;14 + +atastr asc 'ATA',0d,00 diff --git a/Source/Config/Modems/Cat103.S b/Source/Config/Modems/Cat103.S index 70d5c8a..c387d45 100644 --- a/Source/Config/Modems/Cat103.S +++ b/Source/Config/Modems/Cat103.S @@ -1 +1,265 @@ - ΍捠썠ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸捍􍍠砤尰 卍⠤ ⠰ ⠰ 썍⠰РРР獠РРРРР䍠䍠 󍍪 䍍ɍؠ ٠ 㰸؍ٍ٠ŠӍ 썍  獠٠ 䍠Р䍍 ؠ Ԡ 򿍠ɠᠻĠѠ素獍粠 ĠŠ粍 占 占􍍠 占Ҡ糠 Ҡ􍍠 򿍠ĠŠ絠à 占Š糍Ҡ素à 䍠Ӎ絠 獠ÍӍ ፍ Ӎ 卍ؠ 占Ӎ ፍؠ ؍ؠ ĠÍѠ𲠻 ፍ 占 ፠Íؠ Ӎ ፍؠ à 䍠Š 􍍠䠻 ̠̍̍ ̍̍à Ԡà卍ؠ ؠ􍍠à Ԡà卍ؠ ؠà ؠ􍍠 ĠѠ 占ؠӍ ؠ 򿍠Ѡ䳠卍ؠ ĠѠ䲠 򍍠 ÍӠ䴠 卍䲠à 䳠Í䴠 ؠӍ 󲳲 䍍ؠؠ 䍠 䍍 䍠٠ Ѡ䳠̠䠻 䲠̠䠻 ٍŠ䲠 䍍䳠ؠ Ӎ 卍à ۫ ݍàŠàŠӍ ⠥ ⠰⠰⠰⠤⠤㠧 \ No newline at end of file +*-------------------------- +* Internal - Apple Cat 103 +*-------------------------- +* Date 3/18/88 - AEN +*-------------------------- + + lst off + rel + dsk rel/cat103 + +swbyt EQU $c080 +shbyt EQU $c082 +indata EQU $c08b +spdbyt EQU $c08b +acbyte EQU $c08d +xmtbyt EQU $c08d +outdat EQU $c08e +status1 EQU $c08f + +cat103 ent + + org $e00 + +*------------------------------- +* jump table + +slot dfb $20 ;serial card slot +initspd dfb 0 ;initialize speed +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + JMP init + JMP ringset + JMP ring + JMP answer + JMP hangup + JMP inp + JMP out + JMP chkdcd + jmp setspd + jmp dummy ;raise dtr + jmp dummy ;clear buffer + jmp dummy ;quit + +dummy rts + +*------------------------------- +* init the modem card + +init SEI + LDX slot ;get slot offset + LDY #0 +init2 LDA initbyt,y ;init all 16 bytes + STA $c080,x + INX + INY + CPY #$10 + BNE init2 + RTS + +*------------------------------- +* setup for the call + +ringset LDA #0 ;reset time-on + STA bytcnt + STA bytcnt+1 + STA bytcnt+2 + STA carwait ;reset wait flag + TAY set ;300 baud + JMP setspd + +*------------------------------- +* scan for the ring and handle it + +ring LDX slot ;get offset + BIT carwait ;do they want manual-answer? + BMI ring2a ;yep + + LDA acbyte,x + AND #%00000001 + BEQ ring4 ;nothing + +ring2 LDA acbyte,x ;wait for ring to clear + AND #%00000001 + BNE ring2 + +ring2a LDA #%00000010 ;pick up phone + STA shbyt,x + + LDA #80 ;setup carrier wait time + STA carwait + + LDA #60 ;wait for things to settle + JSR wait + +ring3 LDA #0 ;do big wait... + JSR wait + + LDA swbyt,x ;do we have carrier? + AND #%00100000 + BNE ring5 ;yep + + DEC carwait ;loop until count is done + BNE ring3 + + JSR hangup +ring4 CLC ;nothing happened + RTS + +ring5 LDA #-1 ;reset carrier timing + STA carwait + SEC + RTS + +*------------------------------- +* send ata + +answer LDA #-1 ;signal we want manual-answer + STA carwait + RTS + +*------------------------------- +* hangup phone + +hangup LDX slot ;get offset + LDA #0 + STA shbyt,x ;hang up phone + RTS + +*------------------------------- +* input data + +inp STX save_x ;save X + LDX slot ;get offset + LDA status1,x ;get status + AND #%00001000 + CLC + BEQ inp2 ;no data + + LDA #$20 ;reset char ready byte + STA xmtbyt,x + + LDA indata,x ;get data + SEC +inp2 LDX save_x ;restore & return + RTS + +*------------------------------- +* output data + +out STX save_x ;save x + DEC timecnt ;count down bytes per second + BNE out1 ;not a seconds worth yet + + PHA + LDA callspd ;reset counter + ASL + ASL + ASL ;time count = base.rate * 32 + ASL + ASL + STA timecnt + PLA + + INC bytcnt ;seconds - at 64 yet? + BIT bytcnt + BVC out1 ;nope + + LDX #0 ;reset seconds + STX bytcnt + + INC bytcnt+1 ;minutes - at 64 yet? + BIT bytcnt+1 + BVC out1 ;nope + + LDX #0 ;reset minutes + STX bytcnt+1 + + INC bytcnt+2 ;inc hours + +out1 LDX slot + + PHA +out2 LDA status1,x ;check status + AND #%00010000 + BEQ out2 ;loop until ready + PLA + + STA outdat,x ;output byte + LDX save_x + RTS + +*------------------------------- +* check for carrier + +chkdcd STX save_x ;dont kill any reg's + PHA + + LDA carwait ;do we have carrier? + BEQ chkdcd3 ;nope + + LDX slot + LDA swbyt,x ;check carrier + AND #%00100000 + BEQ chkdcd2 ;no carrier + + LDA #-1 ;buffer carrier detect + STA carwait + SEC + BCS chkdcd4 ;use return routine + +chkdcd2 DEC carwait ;count down +chkdcd3 CLC +chkdcd4 PLA ;restore all & return + LDX save_x + RTS + +*------------------------------- +* set the rs232 speed + +setspd STX save_x + LDX slot ;get offset + LDA speed,y ;get speed + STA spdbyt,x ;set speed + + LDA #1 ;find caller speed (x300) + STA callspd + CPY #0 ;at 300? + BEQ setspd3 ;yep + + ASL callspd ;speed = speed * 2 +setspd2 ASL callspd ;speed = speed * 2 + DEY + BNE setspd2 ;loop until correct speed found + +setspd3 LDX save_x ;restore & return + RTS + +*------------------------------- +* wait routine + +wait SEC ;from apple [+ ref man - pg 147] +wait2 PHA +wait3 SBC #1 + BNE wait3 + PLA + SBC #1 + BNE wait2 + RTS + +*------------------------------- +* variables + +speed dfb %00100010,%00000000 ;handle 300, 1200 + +save_x dfb 0 + +timecnt dfb 0 +carwait dfb 0 + +initbyt dfb $00,$81,$00,$06,$00,$80,$00,$06 + dfb $00,$64,$07,$22,$05,$10,$00,$00 + + asc 'Cat103' diff --git a/Source/Config/Modems/Cat212.S b/Source/Config/Modems/Cat212.S index 9ad4c61..b1156ee 100644 --- a/Source/Config/Modems/Cat212.S +++ b/Source/Config/Modems/Cat212.S @@ -1 +1,315 @@ - 捍썠ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸捍􍍠砤尰 卍⠤ ⠰ ⠰ 썍⠰РРР獠РРРРР䍠䍠 󍍪 䍍ɍؠ ٠ 㰸؍ٍ٠ŠӍ 썍  獠٠ 䍠Р䍍 ؠ Ԡ 򿍠ɠᠻĠѠ素獍粠 ĠŠ粍 占 占􍍠 占Ҡ􍍠 占 占Ҡ糠 Ҡ􍍠 򿍠ĠŠ絠 ĠŠ綠à 占Š糍Ҡ素à 䍠Ӎ絠 ፠ 䍠 䍠Р締 綠 䍠 䍠 䍠 ፠٠ Ҡ䍍締 獠Í Р􍍪 ፍ Ӎ 卍ؠ 占Ӎ ፍؠ ؍ؠ ĠÍѠ𲠻 ፍᠻ 占 ፠Íؠ Ӎ ፍؠ à 䍠Š 􍍠䠻 ̠̍̍ ̍̍à Ԡà卍ؠ ؠ􍍠à Ԡà卍ؠ ؠà ؠ􍍠 ĠѠ 占ؠӍ ؠ 򿍠Ѡ䳠卍ؠ䠻 䍠Р 俍Ѡ䲱 ĠѠ䲠 䱠 ÍӠ䴠 卍䲱 ĠŠ䱠 썍䲠à 䳠Í䴠 ؠӍ 󲳲 䍍ؠؠ 䍠 䍍 䍠٠ Ѡ䳠̠䠻 䲠̠䠻 ٍŠ䲠 䍍䳠ؠ Ӎ 卍à ۫ àŠàŠӍ⠥ ⠰⠰⠰⠰⠤⠤欤㠧 \ No newline at end of file +*-------------------------- +* Internal - Apple Cat 212 +*-------------------------- +* Date 12/09/86 +*-------------------------- + lst off + + rel + dsk rel/cat212 + +swbyt EQU $c080 +byt212 EQU $c080 +squbyt EQU $c081 +shbyt EQU $c082 +indata EQU $c08b +spdbyt EQU $c08b +acbyte EQU $c08d +xmtbyt EQU $c08d +outdat EQU $c08e +status1 EQU $c08f +devbyt EQU $c08f + +cat212 ent + + org $e00 + +*------------------------------- +* jump table + +slot dfb $20 ;serial card slot +initspd dfb 0 ;initialize speed +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + JMP init + JMP ringset + JMP ring + JMP answer + JMP hangup + JMP inp + JMP out + JMP chkdcd + jmp setspd + jmp dummy ;raise dtr + jmp dummy ;clear buffer + jmp dummy ;quit + +dummy rts + +*------------------------------- +* init the modem card + +init SEI + LDX slot ;get slot offset + LDY #0 +init2 LDA initbyt,y ;init all 16 bytes + STA $c080,x + INX + INY + CPY #$10 + BNE init2 + RTS + +*------------------------------- +* setup for call + +ringset LDA #0 ;reset time-on + STA bytcnt + STA bytcnt+1 + STA bytcnt+2 + STA carwait ;reset wait flag + TAY ;set 300 baud + JMP setspd + +*------------------------------- +* scan for ring and handle it + +ring LDX slot ;get offset + BIT carwait ;do they want manual-answer? + BMI ring2a ;yep + + LDA acbyte,x + AND #%00000001 + BEQ ring4 ;nothing + +ring2 LDA acbyte,x ;wait for ring to clear + AND #%00000001 + BNE ring2 + +ring2a LDA #%00000010 ;pick up phone + STA shbyt,x + + LDA #80 ;setup carrier wait time + STA carwait + + LDA #%10000001 ;disable 212 mode + STA squbyt,x + + LDA #128 ;wait + JSR wait + + LDA #%00000001 ;enable 212 mode + STA squbyt,x + + LDA #60 ;wait for things to settle + JSR wait + +ring3 LDA #0 ;do big wait... + JSR wait + + LDA swbyt,x ;do we have carrier? + AND #%00100000 + BNE ring5 ;yep + + LDA acbyte,x ;do we have 212 carrier + AND #%00000100 + BNE ring6 ;yep + + DEC carwait ;loop until count is done + BNE ring3 + + JSR hangup +ring4 CLC ;nothing happened + RTS + +ring5 LDA #%00010000 ;reset xmtbyt + STA xmtbyt,x + STA xmtdata + LDA #%10000001 ;disable 212 card + STA squbyt,x + LDA #%00000000 ;send uart to 103 board + STA devbyt,x + JMP ring7 ;finish connect + +ring6 LDA #%00000101 ;reset 212 card + STA byt212,x + LDA #%00000001 ;re-enable 212 card + STA squbyt,x + LDA #%00001010 ;send uart to 212 card + STA devbyt,x + LDA #%00011111 ;reset xmtbyt + STA xmtbyt,x + STA xmtdata + LDY #1 ;set speed to 1200 + JSR setspd + +ring7 LDA #-1 ;reset carrier timing + STA carwait + SEC + LDA #0 ;do delay last + JMP wait + +*------------------------------- +* send ata + +answer LDA #-1 ;signal we want manual-answer + STA carwait + RTS + +*------------------------------- +* hangup phone + +hangup LDX slot ;get offset + LDA #%00011111 + STA xmtbyt,x ;turn off 103 carrier + LDA #%10000001 + STA squbyt,x ;turn off 212 carrier + LDA #0 + STA shbyt,x ;hang up phone + RTS + +*------------------------------- +* input data + +inp STX save_x ;save X + LDX slot ;get offset + LDA status1,x ;get status + AND #%00001000 + CLC + BEQ inp2 ;no data + + LDA xmtdata ;reset char ready byte + STA xmtbyt,x + + LDA indata,x ;get data + SEC +inp2 LDX save_x ;restore & return + RTS + +*------------------------------- +* output data + +out STX save_x ;save x + DEC timecnt ;count down bytes per second + BNE out1 ;not a seconds worth yet + + PHA + LDA callspd ;reset counter + ASL + ASL + ASL ;time count = base.rate * 32 + ASL + ASL + STA timecnt + PLA + + INC bytcnt ;seconds - at 64 yet? + BIT bytcnt + BVC out1 ;nope + + LDX #0 ;reset seconds + STX bytcnt + + INC bytcnt+1 ;minutes - at 64 yet? + BIT bytcnt+1 + BVC out1 ;nope + + LDX #0 ;reset minutes + STX bytcnt+1 + + INC bytcnt+2 ;inc hours + +out1 LDX slot + + PHA +out2 LDA status1,x ;check status + AND #%00010000 + BEQ out2 ;loop until ready + PLA + + STA outdat,x ;output byte + LDX save_x + RTS + +*------------------------------- +* check for carrier + +chkdcd STX save_x ;dont kill any reg's + PHA + + LDA carwait ;do we have carrier? + BEQ chkdcd3 ;nope + + LDX slot + LDA callspd ;check calling speed + CMP #4 ;at 1200 baud? + BEQ dcd212 ;yep + + LDA swbyt,x ;check carrier + AND #%00100000 + BEQ chkdcd2 ;no carrier + +chkdcd1 LDA #-1 ;buffer carrier detect + STA carwait + SEC + BCS chkdcd4 ;use return routine + +dcd212 LDA acbyte,x ;check 212 carrier + AND #%00000100 + BNE chkdcd1 ;all is well + +chkdcd2 DEC carwait ;count down +chkdcd3 CLC +chkdcd4 PLA ;restore all & return + LDX save_x + RTS + +*------------------------------- +* set the rs232 speed + +setspd STX save_x + LDX slot ;get offset + LDA speed,y ;get speed + STA spdbyt,x ;set speed + + LDA #1 ;find caller speed (x300) + STA callspd + CPY #0 ;at 300? + BEQ setspd3 ;yep + + ASL callspd ;speed = speed * 2 +setspd2 ASL callspd ;speed = speed * 2 + DEY + BNE setspd2 ;loop until correct speed found + +setspd3 LDX save_x ;restore & return + RTS + +*------------------------------- +* wait routine + +wait SEC ;from apple ][+ ref man - pg 147 +wait2 PHA +wait3 SBC #1 + BNE wait3 + PLA + SBC #1 + BNE wait2 + RTS + +*------------------------------- + +speed dfb %00100010,%00000000 ;handle 300, 1200 + +save_x dfb 0 + +timecnt dfb 0 +carwait dfb 0 +xmtdata dfb 0 + +initbyt dfb $04,$81,$00,$06,$04,$80,$00,$06 + dfb $00,$64,$07,$22,$05,$1f,$00,$00 + + asc 'Cat212' diff --git a/Source/Config/Modems/Gsport.Hst.S b/Source/Config/Modems/Gsport.Hst.S index 35c356f..7cbe22c 100644 --- a/Source/Config/Modems/Gsport.Hst.S +++ b/Source/Config/Modems/Gsport.Hst.S @@ -1 +1,567 @@ - ׍ 䍪 ō 䍪 ׍ 󍪍 ԍ 䍪捍ÍҍҠҍԠĠ ΰԪΠԡðҠԡðǠԭҠƠፍҠİҠðŠƍҠǍ占 卪ǠŰ͠ ΰ Ġ  퍍Ġ  썍Ԡ РԍРԍРǍРǍРЍРР 占РԠ 占РҠ 忍РĠ РэРҠ ԠРҍĠРҍŠРҍӠРҍԠРҍ Ơԍؠԍ٠Ѡԍ 䍪Р 𩍍Ҡōԍؠԍ٠Ѡԍ 󍪭ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫӍ ፪Рؠ ٍؠΠ ٠ΰҠӍàв 􍍠ؠΠ 䍠٠ΰҠčÍбٍؠ Ӎвб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍ ҠԍҠԍҠҍ٠Ġ 䍠Ġ栻 Ҡč ҠԍؠԲؠ ㍠Ҭؠ 獠ѠԳ 卍ҠԠԲ ڭ ԳύɍԴ٠ԵٍѠԍҠЍàԵĠƍР 㩍ѠōŠԵԠàύŠԴàɍŠԴѠԍŠҠР àōҠƍԠ ԫԫÍӠ ǠҠР ӠDZ 占РǠ 卍DZĠƠ 荠Р 秿 㩍ŠǠ 󍍪ҠҠР àҍӠǍǠР ѠŠ Р ŠǠ卍ŠōҠҠР 占àҍĠƠ 荠РҠ 򾍠Šč٠ ōРѠdzٍР Ѡdz 獠ŠǍĠū٠ 䍍Š Р 占ŠǠ 獍ū РѠdzٍР ѠdzٍР Ѡdz٠Р 񿍠ѠѠ󍍠ٍР 񿍠ѠѠ󍍠ٍР 񿍠ѠѠ󍍠ٍР 񿍠ѠѠ󍍠ٍР 񿍠ŠǠ卍Ѡč čdzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍǠÍӍǠҠҠ ÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ҡ؍ٍԍؠԍ٠ҠԍÍӍĠōѠҍÍҠٍ؍Ӎ 卪ҠҠԍؠҲ؍Ҭؠ Ѡҳ 卍ҠԠ ҲҳӍ 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍٠Ġ ̠čѠĠ Ġ栻 Ġ 獠Šٱؠ³³čٱРŠٲؠ±±čٲРŠٴؠ²²čٴРŠٹؠ´´čٹРŠұؠ¹¹čұؠ±±Ġؠīīؠ΍٠ΰҠԍؠĠ؍ѠȍҠԍ؍čȠؠРԬ؍ѠōҠԍ؍ЍŠƍؠƍ٠Ҡԍ؍Ӎ 卍ѠӍ Ҡ؍ٍҠҍٍ؍Ӎ 捪ɠ Ϡ ³ à§ ± à§ ² à§ ´ à§ ¹ à§ ± à§ 䍍Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍍪Ơ  占  ̠Ҡ 占 󍍪Ԡ    Ӡ 卍Ԡ     ҍŠ ҍԠ  占 ŠӠ 퍍à ԡà ŧ \ No newline at end of file +* GS Port Driver Bios +* written by Andy Nicholas on July 26, 1987 +* +* History: +* +* 11/07/89 AMW +* 1. History section added +* 2. Checked and or modified for LLUCE +* 3. Section titles added +* +* 11/10/89 AMW +* Added interrupt buffers +* +* 05/01/90 LPT +* Added locking DTE when ARQ connected +*-------------------------- + + lst off + + XC + TR + TR ADR + + rel +SLOT KBD 'Slot to assemble for (1/2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 +FLAG = SLOT-1 + +CR = $0d +LF = $0a + +INITSTR = $11D0 +ANSSTR = $11C0 +CDBYTE = $11BF +BUFFER = $11A0 + + do FLAG + dsk rel/gsport2.hst +gs2hst ent + else + dsk rel/gsport1.hst +gs1hst ent + fin + +* Jump Table +*------------------------------- + + ORG $E00 + +MODEM DB N0 ;serial card slot * 16 +INITSPD DB 0 ;init speed for modem + +CALLSPD DB 0 ;Speed of current call + +BYTCNT DB 0,0,0 + + JMP INIT + JMP RINGSET + JMP RING + JMP ANSRING + JMP HANGUP + JMP INP ;get a byte + JMP OUT ;send a byte + JMP GETCARR ;caller there? + JMP SETSPEED ;speed of port + JMP SETIRQ + JMP RAISEDTR ;raise dtr + +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR + +*------------------------------- +* clear the input buffer + +CLRBUFF LDA #FLUSHLST + LDY #0 + BEQ DOEXT + +* set DTR on GS Serial Port, and hangup if needed +*------------------------------- + +HANGUP LDA #$80 ;blow 'em off (hangup) + +GSDTR STA DTRSTATE + + LDA #DTRLST + LDY #0 + BEQ DOEXT + +* init the serial port pascal locations +*------------------------------- + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + + RTS + +* input data +*------------------------------- + +INP PHX ;Save x + PHY + LDX #CN ;are we ready? + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC :INP2 ;nope, exit + + LDX #CN ;yes, read + LDY #N0 + JSR DOREAD + + SEC +:INP1 PLY + PLX ;Restore & return + RTS + +:INP2 LDA #0 + BRA :INP1 + +* output data +*------------------------------- + +OUT PHX ;Save x + PHY ;Save y + PHA ;Save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;Get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;Get y + PLX ;Get x + RTS + +* init modem for ring +*------------------------------- + +RINGSET JSR HANGUP + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + LDA #0 + JSR GSDTR + + LDY INITSPD ;set init speed + AND #$7f ;strip off any high bit + JSR SETSPEED + + LDA #0 ;slight delay (let modem do init) + JSR WAIT + + LDX #-1 +:RSET2 INX ;Do pre-inc + LDA INITSTR,X ;get modem init string + BEQ :RSET3 ;we are done + + JSR OUT ;output + BRA :RSET2 ;loop (Z-bit set after wait) + +:RSET3 LDA #6 + STA COUNTLO + STA COUNTHI + +:RSET4 LDY #-1 +:RSET5 DEY + BEQ :DECOUNT + + JSR INP + BCC :RSET5 + AND #$7F + CMP #'0' ;check for "0" (numeric) + BEQ :LEAVE + BNE :RSET5 + +:DECOUNT DEC COUNTLO + BNE :RSET4 + DEC COUNTHI + BNE :RSET4 + BEQ RINGSET + +:LEAVE JSR INP ;grab the off the tail end of the "0" + BCC :LEAVE + + JSR CLRBUFF + + LDA #0 + STA BYTCNT ;reset byte counter + STA BYTCNT+1 + STA BYTCNT+2 + CLC + RTS ;return + +*------------------------------- +* test for a ring and handle it + +RING JSR INP ;check for a char + BCS :RING1 ;got one + JMP :NORING ;no char there + +:RING1 AND #$7F ;strip high + CMP #'2' ;is it a 'ring'? (numeric) + BNE :NOTRING ;nope, check for connect messages + +*------------------------------- + +:GRABCR JSR INP ;grab the off the tail end of the "2" + BCC :GRABCR + BCS ANSRING + +*=============================== + +:NOTRING CMP #'1' ;is it a '1' or '10' or '13' or '18'? + BEQ :GOTCODE ;yes, save it + CMP #'5' ;is it connect 1200? + BNE :NORING ;nope + +:GOTCODE STA CODE + +:2NDCHAR JSR INP ;second character will ALWAYS be there + BCC :2NDCHAR + + AND #$7F ;strip high + CMP #CR ;but might be a + BNE :MULTCOD + +*=============================== + + LDY #0 ;connect 300? + LDA CODE + CMP #'1' + BEQ :RING3 + + INY + CMP #'5' ;connect 1200? + BEQ :RING3 ;nope, unknown code, keep checking + BNE :NORING + +*=============================== + +:MULTCOD STA CODE+1 + + LDY #2 ;def = 2400 baud + + LDA CODE ;get the first code char + CMP #'1' ;must be a one + BNE :NORING ;if not, then keep trying + + LDA CODE+1 ;is it 2400? + CMP #'0' + BEQ :RING3 + + INY + CMP #'8' ;is it 4800? + BEQ :RING3 + + INY + CMP #'3' ;is it 9600 + BEQ :RING3 + + LDY #0 + CMP #'4' ;is it 300/arq? + BEQ :ARQ ;yes + + INY + CMP #'5' ;is it 1200/arq? + BEQ :ARQ ;yes + + INY + CMP #'6' ;is it 2400/arq? + BEQ :ARQ ;yes + + INY + CMP #'8' ;is it 4800/arq? + BEQ :ARQ ;yes + + INY + CMP #'7' ;is it 9600/arq? + BNE :NORING ;nope + +:ARQ PHA + LDA INITSPD + ORA #$80 ;set high bit for ARQ connection + STA INITSPD + PLA + +*=============================== + +:RING3 JSR SETSPEED ;set the correct speed + + LDY #5 +:RING4 LDA #0 ;let carrier's settle + JSR WAIT + DEY + BNE :RING4 + + JSR CLRBUFF + SEC ;we have a connection! + RTS + +:NORING CLC + RTS + +ANSRING JSR ANSWER ;the phone rang, so send 'ATA' + + CLC + RTS + +* wait routine +*------------------------------- + +WAIT SEC ;from apple ][+ ref man - pg 147 +:WAIT2 PHA +:WAIT3 SBC #1 + BNE :WAIT3 + PLA + SBC #1 + BNE :WAIT2 + RTS + +* Check for carrier using Get_Port_Stat routine +*------------------------------- + +GETCARR PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ :NOCARR + SEC +:NOCARR PLY + PLX + RTS + +* send ata to phone +*------------------------------- + +ANSWER LDA #$80 + JSR WAIT + + LDX #-1 +:ANSWER2 INX + LDA ANSSTR,X ;get text + BEQ :ANSWER3 ;we are done + + JSR OUT ;send it + BRA :ANSWER2 + +:ANSWER3 RTS + +* set the rs-232 speed [speed offset in Y] +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +*------------------------------- + +SETSPEED PHX + PHY + + LDA #1 ;find caller speed (x300) + STA CALLSPD + CPY #0 ;at 300? + BEQ :DO_BAUD ;yep + + ASL CALLSPD ;speed = speed * 2 +:SETSPD2 ASL CALLSPD ;speed = speed * 2 + DEY + BNE :SETSPD2 ;loop until correct speed found + + LDY INITSPD ;do we have an arq connection? + BPL :DO_BAUD + +:ARQ PLA + LDA INITSPD ;get speed to lock port at + AND #$7f ;strip off high bit + PHA + +:DO_BAUD PLA ;get y-reg + BNE :TRY1200 + LDX #B300 + BRA :SETBAUD + +:TRY1200 CMP #1 + BNE :TRY2400 + LDX #B1200 + BRA :SETBAUD + +:TRY2400 CMP #2 + BNE :TRY4800 + LDX #B2400 + BRA :SETBAUD + +:TRY4800 CMP #3 + BNE :TRY9600 + LDX #B4800 + BRA :SETBAUD + +:TRY9600 CMP #4 + BNE :TR19200 + LDX #B9600 + BRA :SETBAUD + +:TR19200 LDX #B19200 + +:SETBAUD STX :BAUDRD+1 + STA :BAUDRD+2 + + LDX #CN + LDY #N0 + JSR DOINIT + + LDX #0 +:BAUDRD LDA -1,X + BEQ :FINISH + JSR OUT + INX + BRA :BAUDRD + +:FINISH LDX #0 +:LOOP LDA PORTINIT,X + BEQ :DONE + JSR OUT + INX + BRA :LOOP + +:DONE LDA #OUT_BUF + LDY #0 + JSR DOEXT + + PLX + RTS + +*------------------------------- +* setup interupt routine + +SETIRQ RTS + +*------------------------------- +* raise dtr + +RAISEDTR LDA #0 + PHX + PHY + + JSR GSDTR + + PLY + PLX + RTS + +* Table of Speeds and other important stuff +*------------------------------- + +COUNTHI DB 0 +COUNTLO DB 0 + +B300 DB 1 + ASC '6B'00 ;accept 300 Baud +B1200 DB 1 + ASC '8B'00 ;accept 1200 Baud +B2400 DB 1 + ASC '10B'00 ;accept 2400 Baud +B4800 DB 1 + ASC '12B'00 ;accept 4800 Baud +B9600 DB 1 + ASC '14B'00 ;accept 9600 Baud +B19200 DB 1 + ASC '15B'00 ;accept 19200 baud + +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters + +*------------------------------- + +OUT_BUF DB 4 ;Parameters to set the + DB $13 ;Output buffer + DA 0 + ADRL BUFFER ;Buffer it where + DA 2 ;Buffer 2 bytes + +*------------------------------- + +CARRLIST DB 3 ;Parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;Carrier status here + +*------------------------------- + +DTRLST DB 3 ;Parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;Bit 7 affects DTR + +*------------------------------- + +FLUSHLST DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 + +*------------------------------- + +CODE DS 2 ;2 byte code returned by modem + + ASC 'GSPort' + DB SLOT!$30 + ASC '/HST LockDTE' diff --git a/Source/Config/Modems/Gsport.S b/Source/Config/Modems/Gsport.S index 48ee91f..dc48ad1 100644 --- a/Source/Config/Modems/Gsport.S +++ b/Source/Config/Modems/Gsport.S @@ -1 +1,532 @@ - ׍ 䍪 ō 䍪 ׍ 󍪭捍ÍҍҠҍԠĠ ΰԪΠԡðҠԡðǠԭҠƠፍҠİҠðŠƍҠǍ占 卪ǠŰ͠ ΰ Ġ  퍍Ġ  썍Ԡ РԍРԍРǍРǍРЍРР 占РԠ 占РҠ 忍РĠ РэРҠ ԠРҍĠРҍŠРҍӠРҍԠРҍ Ơԍؠԍ٠Ѡԍ 䍪Р 𩍍Ҡōԍؠԍ٠Ѡԍ 󍪭ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫӍ ፪Рؠ ٍؠΠ ٠ΰҠӍàв 􍍠ؠΠ 䍠٠ΰҠčÍбٍؠ Ӎвб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍ ҠԍҠԍҠҍ٠Ġ 䍠Ҡč ҠԍؠԲؠ ㍠Ҭؠ 獠ѠԳ 卍ҠԠԲ ڭ ԳύɍԴ٠ԵٍѠԍҠЍàԵĠƍР 㩍ѠōŠԵԠàύŠԴàɍŠԴѠԍŠҠР àōҠƍԠ ԫԫÍӠ ǠҠР àǠ宮ĠƠ 荠Р 秿 㩍ŠǠ 󍍪ҠҠР àҍӠǍǠР ѠŠ Р ŠǠ卍ŠōҠҠР 占àҍĠƠ 荠РҠ 򾍠Šč٠ ōРѠdzٍР Ѡdz 獠ŠǍĠū٠ 䍍Š Р 占ŠǠ 獍ū РѠdzٍР ѠdzٍР ѠdzٍР ѠdzŠǍdzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍǠÍӍǠҠҠ ÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ҡ؍ٍԍؠԍ٠ҠԍÍӍĠōѠҍÍҠٍ؍Ӎ 卪ҠҠԍؠҲ؍Ҭؠ Ѡҳ 卍ҠԠ ҲҳӍ 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 獠Šٱؠ³³čٱРŠٲؠ±±čٲРŠٴؠ²²čٴРŠٹؠ´´čٹРŠұؠ¹¹čұؠ±±Ġؠīīؠ΍٠ΰҠԍؠĠ؍ѠȍҠԍ؍čȠؠРԬ؍ѠōҠԍ؍ЍŠƍؠƍ٠Ҡԍ؍Ӎ 卍ѠӍ Ҡ؍ٍҠҍٍ؍Ӎ 捪ɠ Ϡ ³ à§ ± à§ ² à§ ´ à§ ¹ à§ ± à§ 䍍Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍍪Ơ  占  ̠Ҡ 占 󍍪Ԡ    Ӡ 卍Ԡ     ҍŠ ҍԠ  占 ŠӠ 퍍à ԡ \ No newline at end of file +* GS Port Driver Bios +* written by Andy Nicholas on July 26, 1987 +* +* History: +* +* 11/07/89 AMW +* 1. History section added +* 2. Checked and or modified for LLUCE +* 3. Section titles added +* +* 11/10/89 AMW +* Added interrupt buffers +*-------------------------- + + lst off + + XC + TR + TR ADR + + rel +SLOT KBD 'Slot to assemble for (1/2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 +FLAG = SLOT-1 + +CR = $0d +LF = $0a + +INITSTR = $11D0 +ANSSTR = $11C0 +CDBYTE = $11BF +BUFFER = $11A0 + + do FLAG + dsk rel/gsport2 +gsport2 ent + else + dsk rel/gsport1 +gsport1 ent + fin + +* Jump Table +*------------------------------- + + ORG $E00 + +MODEM DB N0 ;serial card slot * 16 +INITSPD DB 0 ;init speed for modem + +CALLSPD DB 0 ;Speed of current call + +BYTCNT DB 0,0,0 + + JMP INIT + JMP RINGSET + JMP RING + JMP ANSRING + JMP HANGUP + JMP INP ;get a byte + JMP OUT ;send a byte + JMP GETCARR ;caller there? + JMP SETSPEED ;speed of port + JMP SETIRQ + JMP RAISEDTR ;raise dtr + +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR + +*------------------------------- +* clear the input buffer + +CLRBUFF LDA #FLUSHLST + LDY #0 + BEQ DOEXT + +* set DTR on GS Serial Port, and hangup if needed +*------------------------------- + +HANGUP LDA #$80 ;blow 'em off (hangup) + +GSDTR STA DTRSTATE + + LDA #DTRLST + LDY #0 + BEQ DOEXT + +* init the serial port pascal locations +*------------------------------- + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + + RTS + +* input data +*------------------------------- + +INP PHX ;Save x + PHY + LDX #CN ;are we ready? + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC :INP2 ;nope, exit + + LDX #CN ;yes, read + LDY #N0 + JSR DOREAD + + SEC +:INP1 PLY + PLX ;Restore & return + RTS + +:INP2 LDA #0 + BRA :INP1 + +* output data +*------------------------------- + +OUT PHX ;Save x + PHY ;Save y + PHA ;Save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;Get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;Get y + PLX ;Get x + RTS + +* init modem for ring +*------------------------------- + +RINGSET JSR HANGUP + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + LDA #0 + JSR GSDTR + + LDY INITSPD ;set init speed + JSR SETSPEED + + LDA #0 ;slight delay (let modem do init) + JSR WAIT + + LDX #-1 +:RSET2 INX ;Do pre-inc + LDA INITSTR,X ;get modem init string + BEQ :RSET3 ;we are done + + JSR OUT ;output + BRA :RSET2 ;loop (Z-bit set after wait) + +:RSET3 LDA #6 + STA COUNTLO + STA COUNTHI + +:RSET4 LDY #-1 +:RSET5 DEY + BEQ :DECOUNT + + JSR INP + BCC :RSET5 + AND #$7F + CMP #'0' ;check for "0" (numeric) + BEQ :LEAVE + BNE :RSET5 + +:DECOUNT DEC COUNTLO + BNE :RSET4 + DEC COUNTHI + BNE :RSET4 + BEQ RINGSET + +:LEAVE JSR INP ;grab the off the tail end of the "0" + BCC :LEAVE + + JSR CLRBUFF + + LDA #0 + STA BYTCNT ;reset byte counter + STA BYTCNT+1 + STA BYTCNT+2 + CLC + RTS ;return + +*------------------------------- +* test for a ring and handle it + +RING JSR INP ;check for a char + BCC :NORING ;nope... + + AND #$7F ;strip high + CMP #'2' ;is it a 'ring'? (numeric) + BNE :NOTRING ;nope, check for connect messages + +*------------------------------- + +:GRABCR JSR INP ;grab the off the tail end of the "2" + BCC :GRABCR + BCS ANSRING + +*=============================== + +:NOTRING CMP #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + BEQ :GOTCODE ;yes, save it + CMP #'5' ;is it connect 1200? + BNE :NORING ;nope + +:GOTCODE STA CODE + +:2NDCHAR JSR INP ;second character will ALWAYS be there + BCC :2NDCHAR + + AND #$7F ;strip high + CMP #CR ;but might be a + BNE :MULTCOD + +*=============================== + + LDY #0 ;connect 300? + LDA CODE + CMP #'1' + BEQ :RING3 + + INY + CMP #'5' ;connect 1200? + BEQ :RING3 ;nope, unknown code, keep checking + BNE :NORING + +*=============================== + +:MULTCOD STA CODE+1 + + LDY #2 ;def = 2400 baud + + LDA CODE ;get the first code char + CMP #'1' ;must be a one + BNE :NORING ;if not, then keep trying + + LDA CODE+1 ;is it 2400? + CMP #'0' + BEQ :RING3 + + INY + CMP #'1' ;is it 4800? + BEQ :RING3 + + INY + CMP #'2' ;is it 9600 + BEQ :RING3 + + INY + CMP #'4' ;is it 19200? + BEQ :RING3 + BNE :NORING + +*=============================== + +:RING3 JSR SETSPEED ;set the correct speed + + LDY #5 +:RING4 LDA #0 ;let carrier's settle + JSR WAIT + DEY + BNE :RING4 + + JSR CLRBUFF + SEC ;we have a connection! + RTS + +:NORING CLC + RTS + +ANSRING JSR ANSWER ;the phone rang, so send 'ATA' + + CLC + RTS + +* wait routine +*------------------------------- + +WAIT SEC ;from apple ][+ ref man - pg 147 +:WAIT2 PHA +:WAIT3 SBC #1 + BNE :WAIT3 + PLA + SBC #1 + BNE :WAIT2 + RTS + +* Check for carrier using Get_Port_Stat routine +*------------------------------- + +GETCARR PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ :NOCARR + SEC +:NOCARR PLY + PLX + RTS + +* send ata to phone +*------------------------------- + +ANSWER LDA #$80 + JSR WAIT + + LDX #-1 +:ANSWER2 INX + LDA ANSSTR,X ;get text + BEQ :ANSWER3 ;we are done + + JSR OUT ;send it + BRA :ANSWER2 + +:ANSWER3 RTS + +* set the rs-232 speed [speed offset in Y] +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +*------------------------------- + +SETSPEED PHX + PHY + + LDA #1 ;find caller speed (x300) + STA CALLSPD + CPY #0 ;at 300? + BEQ :DO_BAUD ;yep + + ASL CALLSPD ;speed = speed * 2 +:SETSPD2 ASL CALLSPD ;speed = speed * 2 + DEY + BNE :SETSPD2 ;loop until correct speed found + +:DO_BAUD PLA ;get y-reg + BNE :TRY1200 + LDX #B300 + BRA :SETBAUD + +:TRY1200 CMP #1 + BNE :TRY2400 + LDX #B1200 + BRA :SETBAUD + +:TRY2400 CMP #2 + BNE :TRY4800 + LDX #B2400 + BRA :SETBAUD + +:TRY4800 CMP #3 + BNE :TRY9600 + LDX #B4800 + BRA :SETBAUD + +:TRY9600 CMP #4 + BNE :TR19200 + LDX #B9600 + BRA :SETBAUD + +:TR19200 LDX #B19200 + +:SETBAUD STX :BAUDRD+1 + STA :BAUDRD+2 + + LDX #CN + LDY #N0 + JSR DOINIT + + LDX #0 +:BAUDRD LDA -1,X + BEQ :FINISH + JSR OUT + INX + BRA :BAUDRD + +:FINISH LDX #0 +:LOOP LDA PORTINIT,X + BEQ :DONE + JSR OUT + INX + BRA :LOOP + +:DONE LDA #OUT_BUF + LDY #0 + JSR DOEXT + + PLX + RTS + +*------------------------------- +* setup interupt routine + +SETIRQ RTS + +*------------------------------- +* raise dtr + +RAISEDTR LDA #0 + PHX + PHY + + JSR GSDTR + + PLY + PLX + RTS + +* Table of Speeds and other important stuff +*------------------------------- + +COUNTHI DB 0 +COUNTLO DB 0 + +B300 DB 1 + ASC '6B'00 ;accept 300 Baud +B1200 DB 1 + ASC '8B'00 ;accept 1200 Baud +B2400 DB 1 + ASC '10B'00 ;accept 2400 Baud +B4800 DB 1 + ASC '12B'00 ;accept 4800 Baud +B9600 DB 1 + ASC '14B'00 ;accept 9600 Baud +B19200 DB 1 + ASC '15B'00 ;accept 19200 baud + +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters + +*------------------------------- + +OUT_BUF DB 4 ;Parameters to set the + DB $13 ;Output buffer + DA 0 + ADRL BUFFER ;Buffer it where + DA 2 ;Buffer 2 bytes + +*------------------------------- + +CARRLIST DB 3 ;Parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;Carrier status here + +*------------------------------- + +DTRLST DB 3 ;Parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;Bit 7 affects DTR + +*------------------------------- + +FLUSHLST DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 + +*------------------------------- + +CODE DS 2 ;2 byte code returned by modem + + ASC 'GSPort' + DB SLOT!$30 diff --git a/Source/Config/Modems/HAYES.NEW.S b/Source/Config/Modems/HAYES.NEW.S index 3761b5d..47415e2 100644 --- a/Source/Config/Modems/HAYES.NEW.S +++ b/Source/Config/Modems/HAYES.NEW.S @@ -1 +1,744 @@ -̠ 򧍠Ǎ 󍪍 䍪 򍪭捍Íà 占썍ԠĠ ΰԪΠԡðҠԡðϠԯ᲍Რ占ᱍᱠŠ栻 Ҡ㰠 Ҡ䰍ϠԯǠðōǠð΍ 󍪭ҠɠưԠˠ ˧ 砽 ǧ򠽠 ҧ      򰳠 򱲠 򲴠 򴸠 򹶠 е κ ִ󠽠 κ ֮ӧà κ çŠ κ ŧ堽 ̺ ŧԠ ̺ ԧ̠Ƞ 卪ǠŰ͍ ΰ čĠ  Ġ  썍Ԡ ԠРԍԠРԍǠРǍӠРҍǠРЍΠРЍԠРԍĠРčĠРčҠРҠ ȠРƍԠԍ 򍪭Ơэؠэ٠Рԍ 䍪РҠōԍؠԍ٠Рԍ 󍪍 捪 ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫ 􍪍 􍍠㍠占𠣤፠ᠤ 젤屰 č፪ č፠፠ᠰᠤ 덠ᠠ 䍠ᠤ㰱 ᠰ 䩍ᠰ 젤屰 占፠ᠰ 򩍠占፠ᠲ嫲۰ݠ ۰ݬ櫴櫴ᠣ 덠櫸㍠卍􍍪 櫴 捠捍ؠРԬ؍ѠōҠԍ؍ЍōÍӍ 䍪 덪 䮍 󍪍 䍪 󍪭ԍ 󍪺 򫴬 櫴 򫴬 櫴 𱍪 捍􍍠㍠占𠣤嫲፠占፠젤屰 卍㍠卍 퍪 ҍ ҍ ЍؠΠ ٠ΰРԍ捠ᠣ栻 捠ԍ捠ᠣ栻 捠ԍ ፪Рؠ ٍؠ΍٠ΰҠӍàвؠ΍٠ΰҠčÍб٠ ؍Ӎвб 卪Ġ؍ٍԍؠԍ٠ҠԍÍӍĠōѠбÍҠб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍڠ 捠ڠ썠ڠڠ􍍠 ҠԍҠԍҠҍ٠Ġ 䍠Ҡč ҠԍҠƍҠ 퍠ؠҍ٠ҠҍԳύɍԴ٠ԵٍŠàύŠԴàɍŠԴѠԍҠàԵŠԵڠԠ ڠԫڠԫҠƍÍӠ 􍪭ǠҠ àᠻ宮Рˠ ˧ 㩍Ѡ籍Р砻 秿 㩍Ѡ籍Р 㩍Š 籠Рᠻ Ҡ򍍠Ӡà፠Ӡ􍪭Ҡ獍Р占à 젻 Ӡ􍍺Реà  ӍӠ􍍺Р򰳠 忍à 占Ӡ􍍺٠ٍɠ Р٠ 忍Š 獍 Ӎ٠ 䍍dzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍҠԍÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ҡҍؠҍ٠Рҍ 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ Ѡ䱠 ٠ٍѠ䱠 Р٠ 忍Š򱠻 獍٠ 䍍٠à䱍٠ 䍠ٍ䱠 č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 덠̠ ٠ 獠̍ǍǍٍȍǍǍŠ؍Ӎ 򍪭Ҡҍ󍍪 ᠣ卺堻 占㠺堻 ҍ堻 占㠺䍠􍍠㍠堻 堺፠卍ҠЍ㠺ҍ占Šˍڠ썠򰳍ᠣˠ󍍪  䍪 䍪 Ҿ 䍺ҠЍ㠺占䠣捠𠣧 㠺占𠣧㠺占𠣧占򠣧㍺卺Ӎ 퍪 獪 ҠҍؠҫҠԍ٠ٍҩ٠ Ѡ 卍ҠԠ ÍӍ 捍ԠРҍĠРҍŠРҍӠРҍԠРҍ󠴍ɠ Ϡ   Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍪭Ԡ    Ӡ 卪Ԡ     ҍŠ ҍѠ  占   򰳬򱲬򲴬򴸬򹶍 捍 荍 占 ᠰ 占 󍍪 荍 占 ᠰ󠴠 򩍠 덍ӠⰭ͍ӠӠӠӠӠ 䩍 İ Χ ȍ ڧİ Χ ȍ ӰӲñIJ˳Ӱױİ Χ ȍ \ No newline at end of file + TTL 'Hayes Ultra - GS port driver' + PAG + +*------------------------------------------------- +* GS Port Driver Bios +* +* History: +* +* July 26, 1987, written by andy +* +* May, 1991, andy, changed to allocate a 16k input buffer instead +* of using the normal 2k input buffer +*------------------------------------------------- + lst off + + XC + XC ;uses 65816 code + rel + +SLOT KBD 'Assemble for what slot (1,2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 + + DO SLOT/2 + dsk rel/ultra2 +ultra2 ent + else + dsk rel/ultra1 +ultra1 ent + fin + +CDBYTE equ $11bf ;comment these out and uncomment the stuff at the +ANSSTR equ $11c0 ;end to make this a "bloadable" driver +INITSTR equ $11d0 + + DO SLOT/2 +MODEMREG = $C038 + ELSE +MODEMREG = $C0A8 + FIN + +*------------------------------- +* Equates +*------------------------------- + +PTR = $A +MLI = $BF00 +ALLOC_INT = $40 + +Return = 13 +SM_OK = 0 ;Modem 'OK' +SM_Con03 = 1 ;Modem 'CONNECT 300' +SM_Ring = 2 ;Modem 'RING' +SM_NoCar = 3 ;Modem 'NO CARRIER' +SM_Con12 = 4 ;Modem 'CONNECT 1200' +SM_Con24 = 10 ;Modem 'CONNECT 2400' +SM_Con48 = 11 ;Modem 'CONNECT 4800' +SM_Con96 = 12 ;Modem 'CONNECT 9600' +SM_Con19 = 14 ;Modem 'CONNECT 19200' +SM_Con38 = 28 ;Modem 'CONNECT 38400' + +SM_Car03 = 40 ;Modem 'CARRIER 300' +SM_Car12 = 46 ;Modem 'CARRIER 1200' +SM_Car24 = 47 ;Modem 'CARRIER 2400' +SM_Car48 = 48 ;Modem 'CARRIER 4800' +SM_Car96 = 50 ;Modem 'CARRIER 9600' + +Comp_MNP5 = 66 ;Modem 'COMPRESSION: CLASS 5' +Comp_V42bis = 67 ;Modem 'COMPRESSION: V.42BIS' +Comp_ADC = 68 ;Modem 'COMPRESSION: ASC' +Comp_NONE = 69 ;Modem 'COMPRESSION: NONE' + +Prot_None = 70 ;Modem 'PROTOCOL: NONE' +Prot_ALT = 80 ;Modem 'PROTOCOL: ALT' + +PrtSpdL = 12 +PrtSpdH = 13 + +*------------------------------- +* Jump Table +*------------------------------- + ORG $0E00 +MODEM + DB N0 ;serial card slot +MDMSPEED +INITSPD DB 5 ;initialize speed +CALLSPD DB 0 ;speed of call + +Buffer +BYTCNT DB 0,0,0 + +MDMINIT JMP INIT +MDMRSET JMP RESET +MDMRING JMP RING +MDMANS JMP ANSWER +MDMHANG JMP HANGUP +MDMIN JMP INP +MDMOUT JMP OUT +MDMDCD JMP M_CHKDCD +MDMSSPD JMP SETSPD +MDMDTR JMP RAISEDTR ;raise dtr +MDMFLUSH JMP CLRBUFF +MDMQUIT jmp QUIT + +* clear the input buffer +*------------------------------- + +CLRBUFF LDA #FlushInQ + LDY #0 + JMP DOEXT + +* Hang up the modem if needed +*------------------------------- +HANGUP LDA #$80 +GSDTR STA DTRSTATE + LDA #DTRLIST + LDY #0 + JMP DOEXT + +*------------------------------------------------- +* init the serial port pascal locations +* +* this should only ever be called once during the lifetime of +* acos + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + +* lda #GetOutBuffer +* ldy #0 +* jsr doext +* +* lda #GetInBuffer +* ldy #0 +* jsr doext + + clc + xce + rep #$30 + mx %00 + + pha + pea $1000 ;type 1, application, auxID = 0 + ldx #$2003 + jsl $e10000 +* _GetNewID + pla +* sta ourID + + pha + pha + pea 0 + pea $4000 ;want 16k + pha ;our user id + pea $c018 ;locked, fixed, NO special memory, noCross + pea 0 ;(if we use special memory, acos gets clobbered) + pea 0 ;no fixed location + ldx #$0902 + jsl $e10000 +* _NewHandle + pla + sta 0 ;get the handle (better not get an error) + sta OurHandle + pla + sta 2 + sta OurHandle+2 + + lda [0] ;deref the handle and put the address + tax + ldy #2 + lda [0],y + sta In_Buf+4+2 + stx In_Buf+4 + + lda #$4000 ;how big, 16k + sta In_Buf+8 + + mx %11 + sec + xce + + jsr initPort + +* ldx #5 +*:oloop lda OutDefaults,x +* sta Out_Buf+4,x +* dex +* bpl :oloop + + jsr resetInBuf + jsr resetOutBuf + + LDX #0 +:LOOP LDA PORTINIT,X + BEQ :DONE + JSR OUT + INX + BRA :LOOP + +:DONE + CLC + RTS + +*------------------------------------------------- +* shutDown -- reset the port buffer to its old buffer size and +* address, and kill the memory we allocated for the 16k +* buffer which we used. +* +* We do this for both the input and output buffers +* +* The port buffers aren't restored, instead the port is re-init'd +* before we through away the extra memory which we needed. This works +* on the assumption that initport will reset our buffers +*------------------------------- + +QUIT +* ldx #5 ;move 6 bytes +*:loop1 lda GetOutBuffer+4,x +* sta Out_Buf+4,x +* lda GetInBuffer+4,x +* sta In_Buf+4,x +* dex +* bpl :loop1 +* +* jsr resetInBuf + + jsr initPort + + clc + xce + rep #$30 + mx %00 + + lda OurHandle+2 + pha + lda OurHandle + pha + ldx #$1002 + jsl $e10000 +* _DisposeHandle + + mx %11 + sec + xce + +:noInputBuffer +* LDA #>QUITSTR ;send the init string to the modem +* LDX #Out_Buf + ldy #0 + jmp DOEXT + +*------------------------------- +resetInBuf + lda #In_Buf + ldy #0 + jmp DOEXT + +* input data +*------------------------------- +INP PHX ;save x + PHY + + LDX #CN + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC INP2 + + LDX #CN + LDY #N0 + JSR DOREAD + + SEC +INP1 PLY ;restore & return + PLX + RTS + +INP2 LDA #0 + BRA INP1 + +* Check for carrier using Get_Port_Stat routine +*------------------------------- +M_CHKDCD PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ INP1 + SEC +:NOCARR BRA INP1 + +* output data +*------------------------------- + +OUT PHX ;save x + PHY ;save y + PHA ;save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;get y + PLX ;get x + RTS + +* init modem for ring +*------------------------------- + +RESET JSR HANGUP + + STZ Carrier ;clear previous stuff + STZ Protocol + STZ Compression + STZ Connect + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + JSR RAISEDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #0 ;slight delay (let modem do init) + JSR WAIT + JSR CLRBUFF + + LDA #>INITSTR ;send the init string to the modem + LDX #ANSSTR + LDX # recieved +:GetByte JSR INP + clv + bcc :Done + and #$7f + cmp #Return + beq :DatExit + cmp #' ' + bcc :GetByte + cmp #'0' + bcc :GetByte + cmp #'9'+1 + bcs :GetByte + eor #'0' + clc +:DatExit bit :Done +:Done rts + +RingHung RTS + +* Send string to modem +* +* A&X point to string +* Y is time for wait loop +*------------------------------- +SENDSTR STA PTR + STX PTR+1 + + TYA + JSR WAIT + + LDY #-1 +:Xmit2 INY + LDA (PTR),Y ;get text + BEQ :Xmit3 ;we are done + + JSR OUT ;send it + BRA :Xmit2 + + CLC +:Xmit3 RTS + +*------------------------------------------------- +* Table of Speeds and other important stuff + +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR + +OurHandle ds 4 + +COUNTHI DB 0 +COUNTLO DB 0 + +*------------------------------------------------- +PrtSpd DB 126,1,94,0,46,0,22,0,10,0,4,0,1,0 ;speeds 300-38400 +*------------------------------------------------- +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters +*------------------------------- +CARRLIST DB 3 ;parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;carrier status here +*------------------------------- +DTRLIST DB 3 ;parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;bit 7 affects DTR +*------------------------------- +FlushInQ DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 +*------------------------------- +Tbl_Conn DFB 8,SM_Con03,SM_Con12,SM_Con24,SM_Con48,SM_Con96,SM_Con19,SM_Con38 +Tbl_Carr DFB 6,SM_Car03,SM_Car12,SM_Car24,SM_Car48,SM_Car96 +DecByte hex 00 +*------------------------------------------------- +* These get copied to Out_Buf + +*OutDefaults +* adrl Buffer +* dw 3 + +*------------------------------------------------- +*GetOutBuffer +* hex 04 +* hex 11 +* dw 0 ;result +* ds 4 ;address +* dw 0 ;length + +*------------------------------------------------- +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl Buffer ;Buffer it where + dw 3 ;buffer 3 bytes + +*------------------------------------------------- +*GetInBuffer +* hex 04 +* hex 10 +* dw 0 ;result +* ds 4 ;address +* dw 0 ;length + +*------------------------------------------------- +In_Buf hex 04 ;Parameters to set the + hex 12 ;Output buffer + da 0 + ds 4 ;Buffer it where (modified later) + dw $4000 ;buffer 16k + + DS $3b0-*+MODEM + + DS 11 +Carrier DS 1 +Protocol DS 1 +Compression DS 1 +Connect DS 1 + +*CDBYTE DB %00001000 ;mask DCD only (0=connected) + +*ANSSTR ASC 'ATA'0D00 +* DS $8-*+ANSSTR ;DON'T TOUCH + +*QUITSTR ASC 'ATZ'0D00 +* DS $8-*+QUITSTR ;DON'T TOUCH + +*INITSTR ASC 'ATS0=1S2=128&C1&D2&K3&S0VEMW1'0D00 +* DS $30-*+INITSTR ;DON'T TOUCH diff --git a/Source/Config/Modems/HAYES.SSC.S b/Source/Config/Modems/HAYES.SSC.S index c56a0ea..3cfec22 100644 --- a/Source/Config/Modems/HAYES.SSC.S +++ b/Source/Config/Modems/HAYES.SSC.S @@ -1 +1,576 @@ - é ፪捠㍍썠㍍ፍ㰸㰸㰸㰸⍍Ҡ䰠 㰍捍Ԡˠ ˧ 砽 ǧ򠽠 ҧ      򰳠 򱲠 򲴠 򴸠 򹶠 е κ ִ󠽠 κ ֮ӧà κ çŠ κ ŧ堽 ̺ ŧԠ ̺ ԧ̠Ƞ堽􍍠砤尰퍍 卍 Ġ⠰ 썍Ԡ⠰獠䍠䍠荠 卍ᠣ 䍍㍠፠㠣፠㫱 卍ᠣ䠻 썍氰⠤󍍠󫱍󫱍頠 ⠲⠰􍍪  䍪  ƍᠣ ƍ氰⠤⠱⠰ 獍Ҡڠ 捠ڠ썠ڠڠ􍍠 ҠҠ􍍠Ҡ򍍠٠Ġ 䍠Ҡ䍍 Ҡ􍍠ؠԲؠ ㍠Ҭؠ 獠ѠԳ 卍ҠԲ ڭ ԳύɍԴ٠ԵٍŠàύŠԴàɍŠԴѠ􍍺ҠàԵŠԵᠣԠ ԫԫҠ荍ÍӠ 􍪭Ҡ àᠻ宮Рˠ ˧ 㩍Ѡ籍Р砻 秿 㩍Ѡ籍Р 㩍Š 籠Рᠻ Ҡ򍍠Ӡà ፠Ӡ􍪭Ҡ獍Р占à 젻 Ӡ􍍺Реà  ӍӠ􍍺Р򰳠 忍à 占Ӡ􍍺٠ٍɠ Р٠ 忍Š 獍 Ӎ٠ 䍍dzҠ䠻 䍍٠Ǵ 占ҠٍŠǴҠ荠à ӍҠÍӍ 卍 򳠻 卍 􍍠ᠣ􍍠򲠻󍍪 卍 ᠣ 占󍍪 獪 卪 卪 卪 衍䠠 󍍠 翍䠣堺፠㍠󠠻 􍍪 占䠣򍍺䠣 卍䍠 䍠 󍍠썠 䍠䠻 獍㍠󍍪 卪 􍪭썠䍠䠻 򍍠 젻 򍍺㍠󍍺ᠣ㍠󍍪 ፍ፠ 䠣獍鍠獠፠䠣 ፍᠻ 䍠󍍪 䍍鍠ᠣ䍠썠󍍪 ፠ 䠣獍鍠獠፠堻 ㍠䲍䲠ᠠ 󍍪 󭲳 獍䍠 䍠 䍍ᠣ 䍠 䳠䠻 䲠䠻 䲠 䍍䳍󍍪 ᠣ Ҭ Ӭ ΍󍍪 卍㠣፠㠣󍍪 ᠣ卺堻 占㠺堻 ҍ堻 占㠺䍠􍍠㍠堻 堺፠卍Ҡ፠㠺ҍ占Šˍڠ썠򰳍ᠣˠ󍍪  䍪 䍪 Ҿ 䍺Ҡ፠㠺占䠣捠𠣧 㠺占𠣧㠺占𠣧占򠣧㍺卺󍍺Ӎ 捍⠰⠰ ⠰⠥⠥⠥⠥⠥⠥ɠ Ϡ 󠴍  򰳬򱲬򲴬򴸬򹶍󠲵Ӡ°퍍ӠӠӠӠӠ 䩍 İ Χ ȍ ӰӲӹñIJ˳Ӱױİ Χ ȍ \ No newline at end of file +*------------------------------------------------- +* Super Serial Card (SSC) Driver +* January 19, 1988 +* +* History: +* +* May 1991, andy, changed to support interrupts +* Memorial Day 1991, andy, support hayes ultra +*------------------------------------------------- + + lst off + xc + + rel + dsk rel/ssc + +cr equ $0d +lf equ $0a + +data equ $c088 +status equ $c089 +command equ $c08a +control equ $c08b + +INITSTR equ $11d0 ;uncomment these +ansstr equ $11c0 +cdbyte equ $11bf + +*------------------------------------------------- + +VIDCOUT = $0906 + +Return = 13 +SM_OK = 0 ;Modem 'OK' +SM_Con03 = 1 ;Modem 'CONNECT 300' +SM_Ring = 2 ;Modem 'RING' +SM_NoCar = 3 ;Modem 'NO CARRIER' +SM_Con12 = 4 ;Modem 'CONNECT 1200' +SM_Con24 = 10 ;Modem 'CONNECT 2400' +SM_Con48 = 11 ;Modem 'CONNECT 4800' +SM_Con96 = 12 ;Modem 'CONNECT 9600' +SM_Con19 = 14 ;Modem 'CONNECT 19200' +SM_Con38 = 28 ;Modem 'CONNECT 38400' + +SM_Car03 = 40 ;Modem 'CARRIER 300' +SM_Car12 = 46 ;Modem 'CARRIER 1200' +SM_Car24 = 47 ;Modem 'CARRIER 2400' +SM_Car48 = 48 ;Modem 'CARRIER 4800' +SM_Car96 = 50 ;Modem 'CARRIER 9600' + +Comp_MNP5 = 66 ;Modem 'COMPRESSION: CLASS 5' +Comp_V42bis = 67 ;Modem 'COMPRESSION: V.42BIS' +Comp_ADC = 68 ;Modem 'COMPRESSION: ASC' +Comp_NONE = 69 ;Modem 'COMPRESSION: NONE' + +Prot_None = 70 ;Modem 'PROTOCOL: NONE' +Prot_ALT = 80 ;Modem 'PROTOCOL: ALT' + +PrtSpdL = 12 +PrtSpdH = 13 +Escape = 43 + +ssc ent + + org $e00 +modem + +*------------------------------------------------- +* jump table + +slot hex 20 ;serial card slot*16 +INITSPD hex 00 + +callspd dfb 0 ;speed of call + +BYTCNT dfb 0,0,0 + + jmp init + jmp reset + jmp ring + jmp answer + jmp hangup + jmp inp + jmp out + jmp chkdcd + jmp setspd + jmp raisedtr + jmp flush + jmp shutDown + +*------------------------------------------------- +* init the serial card -- I hope this is only ever called once + +init lda #0 ;reset bytes + ldx slot + sta status,x ;reset uart + sta command,x ;reset command + + clc + txa + adc # recieved +:GetByte JSR :GetData + clv + bcc :Done + and #$7f + cmp #Return + beq :DatExit + cmp #' ' + bcc :GetByte + cmp #'0' + bcc :GetByte + cmp #'9'+1 + bcs :GetByte + eor #'0' + clc +:DatExit bit :Done +:Done rts + +:GetData jsr inp +RingHung RTS + +*------------------------------- +* Table of Speeds and other important stuff + +save_x dfb 0 + +head dfb 00 ;start and end at the same place +tail dfb 00 + +speed dfb %00010110 ;300 + dfb %00011000 ;1200 + dfb %00011010 ;2400 + dfb %00011100 ;4800 + dfb %00011110 ;9600 + dfb %00011111 ;19200 + +COUNTHI DB 0 +COUNTLO DB 0 + +TmpField ds 4 +Tbl_Conn DFB 7,SM_Con03,SM_Con12,SM_Con24,SM_Con48,SM_Con96,SM_Con19 +Tbl_Carr DFB 6,SM_Car03,SM_Car12,SM_Car24,SM_Car48,SM_Car96 +DecByte hex 00 + +buffer ds 256 + + DS $3B0-*+modem + + DS 11 +Carrier DS 1 +Protocol DS 1 +Compression DS 1 +Connect DS 1 + +*CDBYTE DB %00001000 ;mask DCD only (0=connected) +* +*ANSSTR ASC 'ATA'0D00 +* DS $10-*+ANSSTR ;DON'T TOUCH +* +*INITSTR ASC 'ATS0=1S2=128S95=44&C1&D2&K3&S0VEMW1'0D00 +* DS $30-*+INITSTR ;DON'T TOUCH diff --git a/Source/Config/Modems/Mm2.S b/Source/Config/Modems/Mm2.S index 4b4102d..6279ab3 100644 --- a/Source/Config/Modems/Mm2.S +++ b/Source/Config/Modems/Mm2.S @@ -1 +1,239 @@ - 卪 捍썠ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸ՠ㰸􍍠砤尰 卍⠤ ⠰ ⠰ 썍⠰РРР獠РРРРР䍠䍠 󍍪 䍍鍠ؠ Ӎ 썍  獠٠ 䍠Р䍍 ؠ Ԡ 򿍠ɠᠻ 獠ĠŠ素獍粠 ĠѠ粍  퍠 ݍ 占􍍠㠻 占Ҡ糠 Ҡ􍍠 獠 򿍠ĠѠ絠à 占Š糍Ҡ素à 䍠Ӎ絠 獠ÍӍ 卍 Ӎ 卍ؠ 占Ӎ ፍؠ ؍ؠ ĠÍѠ𲠻 ፍ ፠Íؠ Ӎ ፍؠ à 䍠Š 􍍠䠻 ̠̍̍ ̍̍à Ԡà卍ؠ ؠ􍍠à Ԡà卍ؠ ؠà ؠ􍍠 ĠѠ 占ؠӍ ؠ ؠ 獠 ĠÍŠ䲠 򍍠à 䲠 ؠӍ 󭲳 ݍ 䍠Ӎ 卍à ۫ àŠàŠӍ ⠰⠰⠰㠧Ͳ \ No newline at end of file +*-------------------------- +*Internal Micromodem ][ //e +*-------------------------- +* Date 12/09/86 +*-------------------------- + + lst off + + rel + dsk rel/mm2 + +data EQU $c087 +status EQU $c086 +cr1 EQU $c086 +ringin EQU $c085 +cr2 EQU $c085 +cr3 EQU $c083 + +mm2 ent + + org $e00 + +*------------------------------- +* jump table + +slot dfb $20 ;serial card slot + dfb 0 ;transmit / receive +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + JMP init + JMP ringset + JMP ring + JMP answer + JMP hangup + JMP inp + JMP out + JMP chkdcd + jmp setspd + jmp dummy ;raise dtr + jmp dummy ;clear buffer + jmp dummy ;quit + +dummy rts + +*------------------------------- +* init the modem card + +init sei + LDX slot ;get slot offset + LDA %00000000 ;reset tone/speaker + STA cr3,x + RTS + +*------------------------------- +* setup for call + +ringset LDA #0 ;reset time-on + STA bytcnt + STA bytcnt+1 + STA bytcnt+2 + STA carwait ;reset wait flag + TAY set ;300 baud + JMP setspd + +*------------------------------- +* scna for ring and handle it + +ring LDX slot ;get offset + BIT carwait ;do they want manual-answer? + BMI ring2a ;yep + + LDA ringin,x ;check for ring + AND %10000000 + BNE ring4 ;nothing + +ring2 LDA ringin,x ;wait for ring to clear + AND %10000000 + BEQ ring2 + +ring2a LDA %00000011 ;reset uart + STA cr1,x + LDA %00010101 ;set for 8n1 + STA cr1,x + + LDA %00000000 ;reset modem + STA cr2,x + LDA %10001011 ;pick up phone [enable carrier] + STA cr2,x + + LDA #$50 ;setup carrier wait time + STA carwait + + LDA #$3c ;wait for things to settle + JSR wait + +ring3 LDA #0 ;do big wait... + JSR wait + + LDA data,x + LDA status,x ;reset carrier flag + LDA status,x ;do we have carrier? + AND %00000100 + BEQ ring5 ;yep + + DEC carwait ;loop until count is done + BNE ring3 + + JSR hangup +ring4 CLC ;nothing happened + RTS + +ring5 LDA #-1 ;reset carrier timing + STA carwait + SEC + RTS + +*------------------------------- +* send ata to phone + +answer LDA #-1 ;signal we want manual-answer + STA carwait + RTS + +*------------------------------- +* hangup phone + +hangup LDX slot ;get offset + LDA %00000001 + STA cr2,x ;hang up phone + RTS + +*------------------------------- +* input data + +inp STX save_x ;save X + LDX slot ;get offset + LDA status,x ;get status + AND %00000001 + CLC + BEQ inp2 ;no data + + LDA data,x ;get data + SEC +inp2 LDX save_x ;restore & return + RTS + +*------------------------------- +* output data + +out STX save_x ;save x + DEC timecnt ;count down bytes per second + BNE out1 ;not a seconds worth yet + + PHA + LDA callspd ;reset counter + ASL + ASL + ASL ;time count = base.rate * 32 + ASL + ASL + STA timecnt + PLA + + INC bytcnt ;seconds - at 64 yet? + BIT bytcnt + BVC out1 ;nope + + LDX #0 ;reset seconds + STX bytcnt + + INC bytcnt+1 ;minutes - at 64 yet? + BIT bytcnt+1 + BVC out1 ;nope + + LDX #0 ;reset minutes + STX bytcnt+1 + + INC bytcnt+2 ;inc hours + +out1 LDX slot + + PHA +out2 LDA status,x ;check status + AND %00000110 + BEQ out2 ;loop until ready + PLA + + STA data,x ;output byte + LDX save_x + RTS + +*------------------------------- +* check for carrier + +chkdcd STX save_x ;dont kill any reg's + PHA + + LDX slot + LDA status,x ;reset carrier flag + LDA status,x ;check carrier + AND %00000100 + CLC + BNE chkdcd2 ;opps, no carrier + + SEC ;sec = we have carrier +chkdcd2 PLA ;restore & return + LDX save_x + RTS + +*------------------------------- +* set the rs-232 speed [speed offset in Y] + +setspd LDA #1 ;find caller speed (x300) + STA callspd + RTS + +*------------------------------- +* wait routine + +wait SEC ;from apple ][+ ref man - pg 147 +wait2 PHA +wait3 SBC #1 + BNE wait3 + PLA + SBC #1 + BNE wait2 + RTS + +*------------------------------- +* available speeds + +save_x dfb 0 + +timecnt dfb 0 +carwait dfb 0 + + asc 'MM2' diff --git a/Source/Config/Modems/Multispd.S b/Source/Config/Modems/Multispd.S index 28c8836..6c7eb82 100644 --- a/Source/Config/Modems/Multispd.S +++ b/Source/Config/Modems/Multispd.S @@ -1 +1,352 @@ - 򍪭 ΍捍썠䍍ՠՠፍ㰸㰸㰸㰸⍍䰍㰍捍砤尰 卍⠤ ⠰ ⠰ 썍⠰РРР獠РРРРР䍠䍠󍍪 䍍 ؠ 䍍㍠፠㠣፠㫱 占󍍪 썍ؠ Ҭ Ӎ Ҡ􍍠 Ҭ Ӎ頠 󍍠٠䠻 䍠Ҡ䍍 卍ᠣ 􍍠ؠ ؠ㍠ 獠Ѡ 卍Ҡ􍍠ᠣᠣ鍍ƍ􍍠䠣捠𠣧˧ ˢ占鍠ᠣ ㍠󠠻 󡡍 ؠ 򿍠Ġ占ÍŠ糠卍 󩍠 占ፍ٠ 籠Ҡ䍍粠 Ġ占Š砻卍 翍ĠѠ粠 򍍠 獠ĠŠ素 򍍠 򩍠ᠻ ፠Ġ捠Р Ѡᠻ 䍍Ġ 䍠РѠ絠 荠Р粠 덍à젻 糠Ӎ素 ᠻ 占Ġ РѠ絠 䍍٠䠻 䍠Ѡ粠 ٍР籠 絠٠䠻 ٠䠻 ᅪѠ粠 򍍠ٍР籠 荍 卍ؠ Ѡ򳠻 Ҡ 􍍠ᠣ􍍠؍Š򲠻Ӎ 卍ؠ 占Ӎ ፍؠ ؍ؠ ĠÍѠ𲠻 ፍÍؠ Ӎ ፍؠ à Šà Ԡàؠ ؠ􍍠à Ԡàؠ ؠà ؠ􍍠 ĠѠ ᠻ 占ؠӍ ؠ ؠ Ġ堻 ÍŠ䲍Í䲠堻 ؠӍ 󭲳 ݍ٠䠻 䍠ؠؠ 䍠 䍍 䍠٠ Ѡ䳠̠䠻 䲠̠䠻 ٍŠ䲠 䍍䳠ؠ Ӎ 􍍠ᠣ Ҭ Ӎ頠卍󍍪 卍à ۫ àŠàŠӍ ⠥⠥⠥⠥⠥⠥⠰⠰⠰ 䍍⠰ ⠰ ⠰䍍㠧䧍 \ No newline at end of file + +*------------------------------- +* Multiple Speed Modem Driver +*------------------------------- +* 3/18/88 AEN +*------------------------------- + lst off + + rel + dsk rel/multispd + +cr EQU $0d +lf EQU $0a + +data equ $c088 +status equ $c089 +command equ $c08a +control equ $c08b + +initstr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf + +multispd ent ;(Start) + org $e00 + +*------------------------------- +* jump table + +slot dfb $20 ;serial card slot +initspd db 0 ;init speed +callspd db 0 ;speed of call + +bytcnt db 0,0,0 + + JMP init + JMP ringset + JMP ring + JMP answer + JMP hangup + JMP inp + JMP out + JMP chkdcd + jmp setspd + jmp raisedtr + jmp dummy + jmp dummy + +dummy rts + +*------------------------------- +* init the serial card + +init LDA #0 ;reset bytes + LDX slot + STA status,x ;reset uart + STA command,x ;reset command + + clc + txa + adc #GetOutBuffer + ldy #0 + jsr doext + + lda #GetInBuffer + ldy #0 + jsr doext + + clc + xce + rep #$30 + mx %00 + + pha + pea $1000 ;type 1, application, auxID = 0 + ldx #$2003 + jsl $e10000 +* _GetNewID + pla + sta OurID + + pha + pha + pea 0 + pea $4000 ;want 16k + pha ;our user id + pea $c018 ;locked, fixed, noSpecial memory, noCross + pea 0 ;(if we use special memory, acos gets clobbered) + pea 0 ;no fixed location + ldx #$0902 + jsl $e10000 +* _NewHandle + bcc :good + + pla + pla + lda #$eaea ;put no-ops over the input buffer change + sta patchIn ;JSR if we couldn't get any memory + sta patchIn+1 + bra :done + +:good pla + sta 0 ;get the handle + sta OurHandle + pla + sta 2 + sta OurHandle+2 + + lda [0] ;deref the handle and put the address + tax + ldy #2 + lda [0],y + sta In_Buf+4+2 + stx In_Buf+4 + + lda #$4000 ;how big, 16k + sta In_Buf+8 + + mx %11 +:done sec + xce + rts + +*------------------------------------------------- +* shutDown -- reset the port buffer to its old buffer size and +* address, and kill the memory we allocated for the 16k +* buffer which we used. +* +* We do this for both the input and output buffers + +shutDown + ldx #5 ;move 6 bytes +:loop lda GetOutBuffer+4,x + sta Out_Buf+4,x + dex + bpl :loop + + ldx #5 ;move 6 bytes +:loop2 lda GetInBuffer+4,x + sta In_Buf+4,x + dex + bpl :loop2 + + lda patchIn ;did the allocate succeed? + cmp #$ea ;if this is patched out, it didn't so don't + beq :noInputBuffer ;reset the input buffer and dispose memory + + lda #In_Buf + ldy #0 + jsr doext + + clc + xce + rep #$30 + mx %00 + + lda OurHandle+2 + pha + lda OurHandle + pha + ldx #$1002 + jsl $e10000 +* _DisposeHandle + + mx %11 + sec + xce + +:noInputBuffer + + lda #Out_Buf + ldy #0 + jmp doext + +*------------------------------------------------- +* input data + +inp phx ;save x + phy + ldx #$c1 ;are we ready? + ldy #$10 + lda #1 + jsr dostatus + bcc inp2 ;nope, exit + + ldx #$c1 ;yes, read + ldy #$10 + jsr doread + + sec + ply + plx ;restore & return + rts + +inp2 lda #0 + clc + ply + plx ;restore & return + rts + +*------------------------------------------------- +* Check for carrier using Get_Port_Stat routine + +getcarr phx + phy + + lda #Carrlist + ldx #>Carrlist + ldy #0 + jsr doext + + lda carrbits + and cdbyte + beq inp2 ;do a dirty and use common exit routines + + sec + ply + plx ;restore & return + rts + +*------------------------------------------------- +* raise dtr + +raisedtr lda #0 + phx + phy + + jsr gsdtr + + ply + plx ;restore & return + rts + +*------------------------------------------------- +* output data + +out phx ;save x + phy ;save y + pha ;save a + +out1 ldx #$c1 ;ready for send? + ldy #$10 + lda #$00 + jsr dostatus + bcc out1 ;nope + + pla ;get a + ldx #$c1 + ldy #$10 + jsr dowrite ;send it + + ply + plx ;restore & return + rts + +*------------------------------------------------- +* setup for call + +ringset jsr hangup + + lda #0 ;let modem reset + jsr wait + jsr wait + + lda #$00 + jsr gsdtr + + ldy initspd ;set init speed + jsr setspeed + + lda #0 ;slight delay (let modem do init) + jsr wait + + ldx #$FF +rset2 inx ;do pre-inc + lda initstr,x ;get modem init string + beq rset3 ;we are done + + jsr out ;output + bra rset2 ;loop (Z-bit set after wait) + +rset3 ldx #6 + stx count + +rset4 ldy #$FF +rset5 dey + beq decount + + jsr inp + bcc rset5 + and #$7f + cmp #'0' ;check for "0" result + beq leave + jmp rset5 + +decount dex + bne rset4 + dec count + bne rset4 + jmp ringset + +leave jsr inp ;grab the off the tail end of the "0" + bcc leave + + jsr flush + + lda #0 + sta bytcnt ;reset byte counter + sta bytcnt+1 + sta bytcnt+2 + clc + rts ;return + +*------------------------------- +* test for a ring and handle it + +ring jsr inp ;check for a char + bcc noRing ;nope... + + and #$7f ;strip high + cmp #'2' ;is it a 'ring'? (numeric) + bne notRing ;nope, check for connect messages + +******************************** +grabCR jsr inp ;grab the off the tail end of the "2" + bcc grabCR + +answerRing jsr answer ;the phone rang, so send 'ATA' + +noRing clc + rts + +******************************** +notRing + cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + beq gotCode ;yes, save it + cmp #'5' ;is it connect 1200? + bne noRing ;nope + +gotCode sta code + +secondChar jsr inp ;second character will ALWAYS be there + bcc secondChar + + and #$7f ;strip high + cmp #cr ;but might be a + bne multiCode + +******************************** +singleCode ldy #0 ;connect 300? + lda code + cmp #'1' + beq ring3 + + iny + cmp #'5' ;connect 1200? + beq ring3 ;nope, unknown code, keep checking + jmp noRing + +******************************** +multiCode + sta code+1 + + lda code ;get the first code char + cmp #'1' ;must be a one + bne noRing ;if not, then keep trying + + ldx #rCodesEnd-rCodes-1 + lda code+1 +:loop cmp rCodes,x + beq :bingo + dex + bpl :loop + jmp noRing + +:bingo lda sCodes,x + tay +ring3 jsr setspeed ;set the correct speed + + ldy #5 +ring4 lda #0 ;let carrier's settle + jsr wait + dey + bne ring4 + + jsr flush ;remove any garbage + sec ;we have a connection! + rts + +*------------------------------- +* clear the input buffer + +flush + phx + phy + + lda #Flush_List + ldx #>Flush_List + ldy #0 + jsr doext + + ply + plx + rts + +*------------------------------------------------- +* set DTR on GS Serial Port, and hangup if needed + +hangup lda #$80 ;blow 'em off (hangup) +gsdtr sta DTRstate + + lda #DTR_List + ldx #>DTR_List + ldy #0 + jmp doext + +*------------------------------------------------- +* wait routine + +wait sec ;from apple ][+ ref man - pg 147 +wait2 pha +wait3 sbc #1 + bne wait3 + pla + sbc #1 + bne wait2 + rts + +*------------------------------------------------- +* send ata to phone + +answer lda #$80 + jsr wait + + ldx #$ff +answer2 inx + lda ansstr,x ;get text + beq answer3 ;we are done + + jsr out ;send it + bra answer2 + +answer3 rts + +*------------------------------------------------- +* set the rs-232 speed, speed offset in Y +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +*------------------------------------------------- + +setspeed phx + phy + + lda #1 ;find caller speed (x300) + sta callspd + cpy #0 ;at 300? + beq Do_Baud ;yep + + asl callspd ;speed = speed * 2 +setspeed2 asl callspd ;speed = speed * 2 + dey + bne setspeed2 ;loop until correct speed found + +Do_Baud pla ;get y-reg + asl a + tay + lda baudAddresses,y + sta Baudread+1 + lda baudAddresses+1,y + sta Baudread+2 + +SetBaud ldx #$c1 + ldy #$10 + jsr doinit + + lda #$01 ;firmware attention character + jsr out + + ldx #0 +Baudread lda $ffff,x + pha + jsr out + pla + cmp #'B' ;finish -after- we get a 'B' + beq Fin_Init + inx + bra Baudread + +Fin_Init ldx #0 +Init_Loop lda Port_Init,x + beq doneBaud + jsr out + inx + bra Init_Loop + +doneBaud + ldx #5 +:loop lda OutDefaults,x + sta Out_Buf+4,x + dex + bpl :loop + + lda #Out_Buf + ldy #0 + jsr doext + +patchIn jsr inbuff ;set the input buffer, can be self-modified + + plx + rts + +******************************** +baudAddresses + da Baud300 + da Baud1200 + da Baud2400 + da Baud4800 + da Baud9600 + da Baud19200 + +inbuff + lda #In_Buf ;reset the input buffer + ldx #>In_Buf + ldy #0 + jmp doext + +*------------------------------------------------- +* globals + +doinit jmp $c100 +doread jmp $c100 +dowrite jmp $c100 +dostatus jmp $c100 +doext jmp $c100 + +rCodes asc '0' ;2400 + asc '1' ;4800 + asc '2' ;9600 + asc '4' ;19200 + asc '5' ;1200/ARQ + asc '6' ;2400/ARQ + asc '7' ;9600/ARQ +rCodesEnd + +sCodes dfb 2 ;2400 + dfb 3 ;4800 + dfb 4 ;9600 + dfb 5 ;19200 + dfb 1 ;1200/ARQ + dfb 2 ;2400/ARQ + dfb 4 ;9600/ARQ + +OurID ds 2 +OurHandle ds 4 +count db 0 +code ds 2 ;2 byte code returned by modem + +Baud300 asc '6B' +Baud1200 asc '8B' +Baud2400 asc '10B' +Baud4800 asc '12B' +Baud9600 asc '14B' +Baud19200 asc '15B' + +Port_Init + hex 01 + asc '0D' ;8 bits + hex 01 + asc '2P' ;no parity + hex 01 + asc 'AD' ;auto-tabbing + hex 01 + asc 'XD' ;no xoff recognition + hex 01 + asc 'FD' ;no find keyboard + hex 01 + asc 'CD' ;no column overflow + hex 01 + asc 'ED' ;echo disabled + hex 01 + asc 'MD' ;no lf masking + hex 01 + asc 'BE' ;buffering enabled + hex 01 + asc 'Z' + hex 00 + +*------------------------------------------------- +* These get copied to Out_Buf + +OutDefaults + adrl buffer + dw 3 + +*------------------------------------------------- +GetOutBuffer + hex 04 + hex 11 + dw 0 ;result + ds 4 ;address + dw 0 ;length + +*------------------------------------------------- +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl buffer ;Buffer it where + dw 3 ;buffer 3 bytes + +*------------------------------------------------- +GetInBuffer + hex 04 + hex 10 + dw 0 ;result + ds 4 ;address + dw 0 ;length + +*------------------------------------------------- +In_Buf hex 04 ;Parameters to set the + hex 12 ;Output buffer + da 0 + adrl buffer ;Buffer it where (modified later) + dw $4000 ;buffer 16k + +*------------------------------------------------- +Carrlist hex 03 ;Parameter list for + hex 06 ;detecting carrier drop + da 0 +carrbits da 0 Carrier + +*------------------------------------------------- +DTR_List hex 03 ;Parameter list for + hex 0b ;setting DTR + da 0 +DTRstate da 0 bit + +*------------------------------------------------- +Flush_List hex 02 ;parameter list for flushing input queue + hex 14 + da 0 + +buffer ds 3 + + diff --git a/Source/Config/Modems/OLD/GSPORT.NEW2.S b/Source/Config/Modems/OLD/GSPORT.NEW2.S index c03dbbd..9a41d48 100644 --- a/Source/Config/Modems/OLD/GSPORT.NEW2.S +++ b/Source/Config/Modems/OLD/GSPORT.NEW2.S @@ -1 +1,660 @@ - ㍠㍠썠ፍ䰍㰍捍􍍪 卍砤尰 ⠰ 썍⠰獠獠䍠蠻荠 ᠤ㲰䠻 ᠤ㲰堻 䫱ᠤ㲰栻 嫱ᠤ㲱 󫱍ᠤ㲱ᠣ􍍠ᠣ􍍠㍠占𠣤፠ᠤ 젤屰 č፠č፠፠ᠰᠤ 덠ᠠ 䍠ᠤ㰱 ᠰ 䩍ᠰ 젤屰 占㠺䍍፠፠ᠣᠻ 占 ᠺ卍፠ᠰ 占占፠ᠲ嫲۰ݠ ۰ݬ櫴櫴ᠣ 덠櫸㍠占󍍪 䍪 덪 䮍  򫴬櫴젺 򫴬櫴젺𲍍 俍𠣤ᠻ ᠣ栻 捠􍍠㍠占𠣤嫲፠占፠젤屰 卍㍠卍򍍠ᠣ栻 捠􍍪 ፍ 㲠 ᠣ𲠻 􍍠㲠 䍠䍍㍠ ᠣ㍠ 󍍪 卍ᠣ􍍠占𲠻 󍍠㍠ 󍍪 ᠣ򍍠 󍍪 ፍ ᠠ ፍ㲠 俍ᠣ卍ᠠ ፠㲍堻 􍍠 󍍪 썍ᠣ 􍍠ᠣ򍍠䠻 䍠䍍ᠣ 􍍠ƍ ㍠ 獠 卍 ڭ ƍ􍍠䠣捠𠣧 占 卍荍ᠣ ㍠󠠻 砻宮䠣栻 荠𠣧 秿 㩍砻 󍍪Ҡ ҍ ㍠󍍪獠𠣧 堻 𠣧 砻卍卍 占򍍠䠣栻 荠 򾍠卍 占𠣧糍𠣧 糠 獠獍占嫱堻 𠣧 占砻 獍󭱍嫱젺獍糠䠻 䍍素ᠣ 占納蠻 占㠠 󍍪 荠ᠣ􍍠󍍪 䍍ᠣ 卍ᠣ􍍪 卍㠠 ۫ 㠣፠㠣󍍪 卍ᠣ􍍠 򳠻 卍 򲍍󍍪 󭲳 ٍ 䍪 䍪 䍪 䍪 䍪 䍪ᠣ 䍠 䠻䠻 䲠䠻 䲠 䍍ᠠ 獠፠䫱󫱬䫲㲍􍍠ᠣ 􍍠ᠤ፠፠𠣧§ §䍍䍠䍠櫴젺ᠣ捠捠栻 䍍󍍪䳰䱲䲴䴸乶䱹捠ᠣ栻 捠􍍪 㲰㲰㲰㲰㲰㠧㠧㠧㠧㠧э㠧э㠧э䍍⠲⠳⠴⠵⠱э⠲э⠴эĠ󠲍󠴍⠰󠲠 퍍䳰㠧§䱲㠧§䲴㠧§䴸㠧§乶㠧§䱹㠧§㠧ħ 㠧Ч 㠧ħ獠㠧ħ 㠧ħ 䍠㠧ħ 㠧ħ 䍠㠧ħ 獠㠧ŧ 䍠㠧ڧ 捍󠴠荍 占 ᠰ 占 󍍪󠴠荍 占 ᠰ 򩍠 덍 ᠰᠰ򍍪 ⠻ ҍᠰᠰ􍍪 占ᠰ󠳍 \ No newline at end of file + +*------------------------------------------------- +* GS Port Driver Bios -- Slot #2 +* +* written by Andy Nicholas on July 26, 1987 +* +* History: +* +* Modified to use an 16k buffer May, 1991 by andy +*------------------------------------------------- + + xc + xc + rel + dsk rel/gsport2 + +cr equ $0d +lf equ $0a + +initstr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf + +*------------------------------------------------- + +gsport2 ent + +*------------------------------------------------- +* Jump Table + + org $e00 + + hex 20 ;serial card slot * 16 +initspd hex 00 + +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + jmp init + jmp ringset + jmp ring + jmp answerRing + jmp hangup + jmp inp + jmp out + jmp getcarr + jmp setspeed + jmp raisedtr + jmp flush ;mdmFlush + jmp shutDown ;shutdown + +*------------------------------------------------- +* init the serial port pascal locations + +init lda $c20d ;get init address + sta doinit+1 + lda $c20e ;get read address + sta doread+1 + lda $c20f ;get write address + sta dowrite+1 + lda $c210 ;get status address + sta dostatus+1 + lda $c212 + sta doext+1 + + lda #GetOutBuffer + ldy #0 + jsr doext + + lda #GetInBuffer + ldy #0 + jsr doext + + clc + xce + rep #$30 + mx %00 + + pha + pea $1000 ;type 1, application, auxID = 0 + ldx #$2003 + jsl $e10000 +* _GetNewID + pla + sta OurID + + pha + pha + pea 0 + pea $4000 ;want 16k + pha ;our user id + pea $c018 ;locked, fixed, NO special memory, noCross + pea 0 ;(if we use special memory, acos gets clobbered) + pea 0 ;no fixed location + ldx #$0902 + jsl $e10000 +* _NewHandle + bcc :good + + pla + pla + lda #$eaea ;put no-ops over the input buffer change + sta patchIn ;JSR if we couldn't get any memory + sta patchIn+1 + bra :done + +:good pla + sta 0 ;get the handle + sta OurHandle + pla + sta 2 + sta OurHandle+2 + + lda [0] ;deref the handle and put the address + tax + ldy #2 + lda [0],y + sta In_Buf+4+2 + stx In_Buf+4 + + lda #$4000 ;how big, 16k + sta In_Buf+8 + + mx %11 +:done sec + xce + rts + +*------------------------------------------------- +* shutDown -- reset the port buffer to its old buffer size and +* address, and kill the memory we allocated for the 16k +* buffer which we used. +* +* We do this for both the input and output buffers + +shutDown + ldx #5 ;move 6 bytes +:loop lda GetOutBuffer+4,x + sta Out_Buf+4,x + dex + bpl :loop + + ldx #5 ;move 6 bytes +:loop2 lda GetInBuffer+4,x + sta In_Buf+4,x + dex + bpl :loop2 + + lda patchIn ;did the allocate succeed? + cmp #$ea ;if this is patched out, it didn't so don't + beq :noInputBuffer ;reset the input buffer and dispose memory + + lda #In_Buf + ldy #0 + jsr doext + + clc + xce + rep #$30 + mx %00 + + lda OurHandle+2 + pha + lda OurHandle + pha + ldx #$1002 + jsl $e10000 +* _DisposeHandle + + mx %11 + sec + xce + +:noInputBuffer + + lda #Out_Buf + ldy #0 + jmp doext + +*------------------------------------------------- +* input data + +inp phx ;save x + phy + ldx #$c2 ;are we ready? + ldy #$20 + lda #1 + jsr dostatus + bcc inp2 ;nope, exit + + ldx #$c2 ;yes, read + ldy #$20 + jsr doread + + sec + ply + plx ;restore & return + rts + +inp2 lda #0 + clc + ply + plx ;restore & return + rts + +*------------------------------------------------- +* Check for carrier using Get_Port_Stat routine + +getcarr phx + phy + + lda #Carrlist + ldx #>Carrlist + ldy #0 + jsr doext + + lda carrbits + and cdbyte + beq inp2 ;do a dirty and use common exit routines + + sec + ply + plx ;restore & return + rts + +*------------------------------------------------- +* raise dtr + +raisedtr lda #0 + phx + phy + + jsr gsdtr + + ply + plx ;restore & return + rts + +*------------------------------------------------- +* output data + +out phx ;save x + phy ;save y + pha ;save a + +out1 ldx #$c2 ;ready for send? + ldy #$20 + lda #$00 + jsr dostatus + bcc out1 ;nope + + pla ;get a + ldx #$c2 + ldy #$20 + jsr dowrite ;send it + + ply + plx ;restore & return + rts + +*------------------------------------------------- +* setup for call + +ringset jsr hangup + + lda #0 ;let modem reset + jsr wait + jsr wait + + lda #$00 + jsr gsdtr + + ldy initspd ;set init speed + jsr setspeed + + lda #0 ;slight delay (let modem do init) + jsr wait + + ldx #$FF +rset2 inx ;do pre-inc + lda initstr,x ;get modem init string + beq rset3 ;we are done + + jsr out ;output + bra rset2 ;loop (Z-bit set after wait) + +rset3 ldx #6 + stx count + +rset4 ldy #$FF +rset5 dey + beq decount + + jsr inp + bcc rset5 + and #$7f + cmp #'0' ;check for "0" result + beq leave + jmp rset5 + +decount dex + bne rset4 + dec count + bne rset4 + jmp ringset + +leave jsr inp ;grab the off the tail end of the "0" + bcc leave + + jsr flush + + lda #0 + sta bytcnt ;reset byte counter + sta bytcnt+1 + sta bytcnt+2 + clc + rts ;return + +*------------------------------- +* test for a ring and handle it + +ring jsr inp ;check for a char + bcc noRing ;nope... + + and #$7f ;strip high + cmp #'2' ;is it a 'ring'? (numeric) + bne notRing ;nope, check for connect messages + +******************************** +grabCR jsr inp ;grab the off the tail end of the "2" + bcc grabCR + +answerRing jsr answer ;the phone rang, so send 'ATA' + +noRing clc + rts + +******************************** +notRing + cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + beq gotCode ;yes, save it + cmp #'5' ;is it connect 1200? + bne noRing ;nope + +gotCode sta code + +secondChar jsr inp ;second character will ALWAYS be there + bcc secondChar + + and #$7f ;strip high + cmp #cr ;but might be a + bne multiCode + +******************************** +singleCode ldy #0 ;connect 300? + lda code + cmp #'1' + beq ring3 + + iny + cmp #'5' ;connect 1200? + beq ring3 ;nope, unknown code, keep checking + jmp noRing + +******************************** +multiCode + sta code+1 + + lda code ;get the first code char + cmp #'1' ;must be a one + bne noRing ;if not, then keep trying + + ldx #rCodesEnd-rCodes-1 + lda code+1 +:loop cmp rCodes,x + beq :bingo + dex + bpl :loop + jmp noRing + +:bingo lda sCodes,x + tay +ring3 jsr setspeed ;set the correct speed + + ldy #5 +ring4 lda #0 ;let carrier's settle + jsr wait + dey + bne ring4 + + jsr flush ;remove any garbage + sec ;we have a connection! + rts + +*------------------------------- +* clear the input buffer + +flush + phx + phy + + lda #Flush_List + ldx #>Flush_List + ldy #0 + jsr doext + + ply + plx + rts + +*------------------------------------------------- +* set DTR on GS Serial Port, and hangup if needed + +hangup lda #$80 ;blow 'em off (hangup) +gsdtr sta DTRstate + + lda #DTR_List + ldx #>DTR_List + ldy #0 + jmp doext + +*------------------------------------------------- +* wait routine + +wait sec ;from apple ][+ ref man - pg 147 +wait2 pha +wait3 sbc #1 + bne wait3 + pla + sbc #1 + bne wait2 + rts + +*------------------------------------------------- +* send ata to phone + +answer lda #$80 + jsr wait + + ldx #$ff +answer2 inx + lda ansstr,x ;get text + beq answer3 ;we are done + + jsr out ;send it + bra answer2 + +answer3 rts + +*------------------------------------------------- +* set the rs-232 speed, speed offset in Y +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +*------------------------------------------------- + +setspeed phx + phy + + lda #1 ;find caller speed (x300) + sta callspd + cpy #0 ;at 300? + beq Do_Baud ;yep + + asl callspd ;speed = speed * 2 +setspeed2 asl callspd ;speed = speed * 2 + dey + bne setspeed2 ;loop until correct speed found + +Do_Baud pla ;get y-reg + asl a + tay + lda baudAddresses,y + sta Baudread+1 + lda baudAddresses+1,y + sta Baudread+2 + +SetBaud ldx #$c2 + ldy #$20 + jsr doinit + + lda #$01 ;firmware attention character + jsr out + + ldx #0 +Baudread lda $ffff,x + pha + jsr out + pla + cmp #'B' ;finish -after- we get a 'B' + beq Fin_Init + inx + bra Baudread + +Fin_Init ldx #0 +Init_Loop lda Port_Init,x + beq doneBaud + jsr out + inx + bra Init_Loop + +doneBaud + ldx #5 +:loop lda OutDefaults,x + sta Out_Buf+4,x + dex + bpl :loop + + lda #Out_Buf + ldy #0 + jsr doext + +patchIn jsr inbuff ;set the input buffer, can be self-modified + + plx + rts + +******************************** +baudAddresses + da Baud300 + da Baud1200 + da Baud2400 + da Baud4800 + da Baud9600 + da Baud19200 + +inbuff + lda #In_Buf + ldy #0 + jmp doext + +*------------------------------------------------- +* globals + +doinit jmp $c200 +doread jmp $c200 +dowrite jmp $c200 +dostatus jmp $c200 +doext jmp $c200 + +rCodes asc '0' ;2400 + asc '1' ;4800 + asc '2' ;9600 + asc '4' ;19200 + asc '5' ;1200/ARQ + asc '6' ;2400/ARQ + asc '7' ;9600/ARQ +rCodesEnd + +sCodes dfb 2 ;2400 + dfb 3 ;4800 + dfb 4 ;9600 + dfb 5 ;19200 + dfb 1 ;1200/ARQ + dfb 2 ;2400/ARQ + dfb 4 ;9600/ARQ + +OurID ds 2 +OurHandle ds 4 +count db 0 +code ds 2 ;2 byte code returned by modem + +Baud300 asc '6B' +Baud1200 asc '8B' +Baud2400 asc '10B' +Baud4800 asc '12B' +Baud9600 asc '14B' +Baud19200 asc '15B' + +Port_Init + hex 01 + asc '0D' ;8 bits + hex 01 + asc '2P' ;no parity + hex 01 + asc 'AD' ;auto-tabbing + hex 01 + asc 'XD' ;no xoff recognition + hex 01 + asc 'FD' ;no find keyboard + hex 01 + asc 'CD' ;no column overflow + hex 01 + asc 'ED' ;echo disabled + hex 01 + asc 'MD' ;no lf masking + hex 01 + asc 'BE' ;buffering enabled + hex 01 + asc 'Z' + hex 00 + +*------------------------------------------------- +* These get copied to Out_Buf + +OutDefaults + adrl buffer + dw 3 + +*------------------------------------------------- +GetOutBuffer + hex 04 + hex 11 + dw 0 ;result + ds 4 ;address + dw 0 ;length + +*------------------------------------------------- +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl buffer ;Buffer it where + dw 3 ;buffer 3 bytes + +*------------------------------------------------- +GetInBuffer + hex 04 + hex 10 + dw 0 ;result + ds 4 ;address + dw 0 ;length + +*------------------------------------------------- +In_Buf hex 04 ;Parameters to set the + hex 12 ;Output buffer + da 0 + adrl buffer ;Buffer it where (modified later) + dw $4000 ;buffer 16k + +*------------------------------------------------- +Carrlist hex 03 ;Parameter list for + hex 06 ;detecting carrier drop + da 0 +carrbits da 0 Carrier + +*------------------------------------------------- +DTR_List hex 03 ;Parameter list for + hex 0b ;setting DTR + da 0 +DTRstate da 0 bit + +*------------------------------------------------- +Flush_List hex 02 ;parameter list for flushing input queue + hex 14 + da 0 + +buffer ds 3 + + diff --git a/Source/Config/Modems/OLD/Gsport.Hst2.S b/Source/Config/Modems/OLD/Gsport.Hst2.S index c565a06..c8bcfff 100644 --- a/Source/Config/Modems/OLD/Gsport.Hst2.S +++ b/Source/Config/Modems/OLD/Gsport.Hst2.S @@ -1 +1,529 @@ -ÍҍҠҍ ׍ 䍪 ō 䍪 ׍ 󍪭ԠĠ ΰԪΠԡðҠԡðǠԭҠƠፍҠİҠðŠƍҠǍ占 卪ǠŰ͠ ΰ Ġ  퍍Ġ  썍Ԡ РԍРԍРǍРǍРЍРР 占РԠ 占РҠ 忍РĠ РэРҠ РٍРٍԠРҍĠРҍŠРҍӠРҍԠРҍ Ơԍؠԍ٠Ѡԍ 䍪Р 𩍍Ҡōԍؠԍ٠Ѡԍ 󍪭ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫ٠Ӎ ፪Рؠ ٍؠΠ ٠ΰҠӍàв 􍍠ؠΠ 䍠٠ΰҠčÍбٍؠ Ӎвб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍ ҠԍҠԍҠҍ٠Ġ 䍠Ҡč ҠԍؠԲؠ ㍠Ҭؠ 獠ѠԳ 卍ҠԠԲ ڭ ԳύɍԴ٠ԵٍѠԍҠЍàԵĠƍР 㩍ѠōŠԵԠàύŠԴàɍŠԴѠԍŠҠР àōҠƍԠ ԫԫÍӠ ǠҠР àǠ宮ĠƠ 荠Р 秿 㩍ŠǠ 󍍪ҠҠР àҍӠǍǠР ѠŠ Р ŠǠ卍ŠōҠҠР 占àҍĠƠ 荠РҠ 򾍠Šč٠ ōРѠdzٍР Ѡdz 獠ŠǍĠū٠ 䍍Š Р 占ŠǠ 獍ū РѠdzٍР ѠdzٍР ѠdzdzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍǠÍӍǠҠҠ ÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ҡ؍ٍԍؠԍ٠ҠԍÍӍĠōѠҍÍҠٍ؍Ӎ 卪ҠҠԍؠҲ؍Ҭؠ Ѡҳ 卍ҠԠ ҲҳӍ 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 獠Šٱؠ³³čٱРŠٲؠ±±čٲРŠٴؠ²²čٴРŠٹؠ´´čٹРŠұؠ¹¹čұؠ±±Ġؠīīؠ΍٠ΰҠԍؠĠ؍ѠȍҠԍ؍čȠؠРԬ؍ѠōҠԍ؍ЍŠƍؠƍ٠Ҡԍ؍Ӎ 卍ѠӍ Ҡ؍ٍҠҍٍ؍Ӎ 捪ɠ Ϡ ³ à§ ± à§ ² à§ ´ à§ ¹ à§ ± à§ 䍍Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍍪Ơ  占  ̠Ҡ 占 󍍪Ԡ    Ӡ 卍Ԡ     ҍŠ ҍԠ  占 ŠӠ 퍍à ԡàԧ \ No newline at end of file + XC + TR + TR ADR + +* GS Port Driver Bios +* written by Andy Nicholas on July 26, 1987 +* +* History: +* +* 11/07/89 AMW +* 1. History section added +* 2. Checked and or modified for LLUCE +* 3. Section titles added +* +* 11/10/89 AMW +* Added interrupt buffers +*-------------------------- + rel +SLOT KBD 'Slot to assemble for (1/2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 +FLAG = SLOT-1 + +CR = $0d +LF = $0a + +INITSTR = $11D0 +ANSSTR = $11C0 +CDBYTE = $11BF +BUFFER = $11A0 + + do FLAG + dsk rel/gsport2.hst +gs2hst ent + else + dsk rel/gsport1.hst +gs1hst ent + fin + +* Jump Table +*------------------------------- + + ORG $E00 + +MODEM DB N0 ;serial card slot * 16 +INITSPD DB 0 ;init speed for modem + +CALLSPD DB 0 ;Speed of current call + +BYTCNT DB 0,0,0 + + JMP INIT + JMP RINGSET + JMP RING + JMP ANSRING + JMP HANGUP + JMP INP ;get a byte + JMP OUT ;send a byte + JMP GETCARR ;caller there? + JMP SETSPEED ;speed of port + JMP SETIRQ + JMP RAISEDTR ;raise dtr + JMP DUMMY + JMP DUMMY + +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR + +*------------------------------- +* clear the input buffer + +CLRBUFF LDA #FLUSHLST + LDY #0 + BEQ DOEXT + +* set DTR on GS Serial Port, and hangup if needed +*------------------------------- + +HANGUP LDA #$80 ;blow 'em off (hangup) + +GSDTR STA DTRSTATE + + LDA #DTRLST + LDY #0 + BEQ DOEXT + +* init the serial port pascal locations +*------------------------------- + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + +DUMMY RTS + +* input data +*------------------------------- + +INP PHX ;Save x + PHY + LDX #CN ;are we ready? + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC :INP2 ;nope, exit + + LDX #CN ;yes, read + LDY #N0 + JSR DOREAD + + SEC +:INP1 PLY + PLX ;Restore & return + RTS + +:INP2 LDA #0 + BRA :INP1 + +* output data +*------------------------------- + +OUT PHX ;Save x + PHY ;Save y + PHA ;Save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;Get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;Get y + PLX ;Get x + RTS + +* init modem for ring +*------------------------------- + +RINGSET JSR HANGUP + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + LDA #0 + JSR GSDTR + + LDY INITSPD ;set init speed + JSR SETSPEED + + LDA #0 ;slight delay (let modem do init) + JSR WAIT + + LDX #-1 +:RSET2 INX ;Do pre-inc + LDA INITSTR,X ;get modem init string + BEQ :RSET3 ;we are done + + JSR OUT ;output + BRA :RSET2 ;loop (Z-bit set after wait) + +:RSET3 LDA #6 + STA COUNTLO + STA COUNTHI + +:RSET4 LDY #-1 +:RSET5 DEY + BEQ :DECOUNT + + JSR INP + BCC :RSET5 + AND #$7F + CMP #'0' ;check for "0" (numeric) + BEQ :LEAVE + BNE :RSET5 + +:DECOUNT DEC COUNTLO + BNE :RSET4 + DEC COUNTHI + BNE :RSET4 + BEQ RINGSET + +:LEAVE JSR INP ;grab the off the tail end of the "0" + BCC :LEAVE + + JSR CLRBUFF + + LDA #0 + STA BYTCNT ;reset byte counter + STA BYTCNT+1 + STA BYTCNT+2 + CLC + RTS ;return + +*------------------------------- +* test for a ring and handle it + +RING JSR INP ;check for a char + BCC :NORING ;nope... + + AND #$7F ;strip high + CMP #'2' ;is it a 'ring'? (numeric) + BNE :NOTRING ;nope, check for connect messages + +*------------------------------- + +:GRABCR JSR INP ;grab the off the tail end of the "2" + BCC :GRABCR + BCS ANSRING + +*=============================== + +:NOTRING CMP #'1' ;is it a '1' or '10' or '13' or '18'? + BEQ :GOTCODE ;yes, save it + CMP #'5' ;is it connect 1200? + BNE :NORING ;nope + +:GOTCODE STA CODE + +:2NDCHAR JSR INP ;second character will ALWAYS be there + BCC :2NDCHAR + + AND #$7F ;strip high + CMP #CR ;but might be a + BNE :MULTCOD + +*=============================== + + LDY #0 ;connect 300? + LDA CODE + CMP #'1' + BEQ :RING3 + + INY + CMP #'5' ;connect 1200? + BEQ :RING3 ;nope, unknown code, keep checking + BNE :NORING + +*=============================== + +:MULTCOD STA CODE+1 + + LDY #2 ;def = 2400 baud + + LDA CODE ;get the first code char + CMP #'1' ;must be a one + BNE :NORING ;if not, then keep trying + + LDA CODE+1 ;is it 2400? + CMP #'0' + BEQ :RING3 + + INY + CMP #'8' ;is it 4800? + BEQ :RING3 + + INY + CMP #'3' ;is it 9600 + BEQ :RING3 + +*=============================== + +:RING3 JSR SETSPEED ;set the correct speed + + LDY #5 +:RING4 LDA #0 ;let carrier's settle + JSR WAIT + DEY + BNE :RING4 + + JSR CLRBUFF + SEC ;we have a connection! + RTS + +:NORING CLC + RTS + +ANSRING JSR ANSWER ;the phone rang, so send 'ATA' + + CLC + RTS + +* wait routine +*------------------------------- + +WAIT SEC ;from apple ][+ ref man - pg 147 +:WAIT2 PHA +:WAIT3 SBC #1 + BNE :WAIT3 + PLA + SBC #1 + BNE :WAIT2 + RTS + +* Check for carrier using Get_Port_Stat routine +*------------------------------- + +GETCARR PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ :NOCARR + SEC +:NOCARR PLY + PLX + RTS + +* send ata to phone +*------------------------------- + +ANSWER LDA #$80 + JSR WAIT + + LDX #-1 +:ANSWER2 INX + LDA ANSSTR,X ;get text + BEQ :ANSWER3 ;we are done + + JSR OUT ;send it + BRA :ANSWER2 + +:ANSWER3 RTS + +* set the rs-232 speed [speed offset in Y] +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +*------------------------------- + +SETSPEED PHX + PHY + + LDA #1 ;find caller speed (x300) + STA CALLSPD + CPY #0 ;at 300? + BEQ :DO_BAUD ;yep + + ASL CALLSPD ;speed = speed * 2 +:SETSPD2 ASL CALLSPD ;speed = speed * 2 + DEY + BNE :SETSPD2 ;loop until correct speed found + +:DO_BAUD PLA ;get y-reg + BNE :TRY1200 + LDX #B300 + BRA :SETBAUD + +:TRY1200 CMP #1 + BNE :TRY2400 + LDX #B1200 + BRA :SETBAUD + +:TRY2400 CMP #2 + BNE :TRY4800 + LDX #B2400 + BRA :SETBAUD + +:TRY4800 CMP #3 + BNE :TRY9600 + LDX #B4800 + BRA :SETBAUD + +:TRY9600 CMP #4 + BNE :TR19200 + LDX #B9600 + BRA :SETBAUD + +:TR19200 LDX #B19200 + +:SETBAUD STX :BAUDRD+1 + STA :BAUDRD+2 + + LDX #CN + LDY #N0 + JSR DOINIT + + LDX #0 +:BAUDRD LDA -1,X + BEQ :FINISH + JSR OUT + INX + BRA :BAUDRD + +:FINISH LDX #0 +:LOOP LDA PORTINIT,X + BEQ :DONE + JSR OUT + INX + BRA :LOOP + +:DONE LDA #OUT_BUF + LDY #0 + JSR DOEXT + + PLX + RTS + +*------------------------------- +* setup interupt routine + +SETIRQ RTS + +*------------------------------- +* raise dtr + +RAISEDTR LDA #0 + PHX + PHY + + JSR GSDTR + + PLY + PLX + RTS + +* Table of Speeds and other important stuff +*------------------------------- + +COUNTHI DB 0 +COUNTLO DB 0 + +B300 DB 1 + ASC '6B'00 ;accept 300 Baud +B1200 DB 1 + ASC '8B'00 ;accept 1200 Baud +B2400 DB 1 + ASC '10B'00 ;accept 2400 Baud +B4800 DB 1 + ASC '12B'00 ;accept 4800 Baud +B9600 DB 1 + ASC '14B'00 ;accept 9600 Baud +B19200 DB 1 + ASC '15B'00 ;accept 19200 baud + +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters + +*------------------------------- + +OUT_BUF DB 4 ;Parameters to set the + DB $13 ;Output buffer + DA 0 + ADRL BUFFER ;Buffer it where + DA 2 ;Buffer 2 bytes + +*------------------------------- + +CARRLIST DB 3 ;Parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;Carrier status here + +*------------------------------- + +DTRLST DB 3 ;Parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;Bit 7 affects DTR + +*------------------------------- + +FLUSHLST DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 + +*------------------------------- + +CODE DS 2 ;2 byte code returned by modem + + ASC 'GSPort' + DB SLOT!$30 + ASC '/HST' + + diff --git a/Source/Config/Modems/OLD/Gsport.Slot1.S b/Source/Config/Modems/OLD/Gsport.Slot1.S index 3fb2af2..b4e98d1 100644 --- a/Source/Config/Modems/OLD/Gsport.Slot1.S +++ b/Source/Config/Modems/OLD/Gsport.Slot1.S @@ -1 +1,513 @@ - 썠ፍ䰍㰍ᰍ 썪􍍪 卪砤尰 퍍⠰䍍⠰獠獠 占 占 忍䠻 㱰㱰㱰㱰㱰 󍪭ᠤ㱰䠻 ᠤ㱰堻 䫱ᠤ㱰栻 嫱ᠤ㱱 󫱍ᠤ㱱󍍪 ፪堻㱠 ᠣ𲠻 􍍠㱠 䍠䍍㍠堻 ᠣ㍠󍍪 ፪堻堻堻ፍ㱠 俍ᠣ卍፠㱍堻 􍍠󍍪 獪ᠣ 􍍠ᠣ򍍠䠻 䍠䍍ᠣ 􍍠ƍ㍠ 獠 卍 ڭ ᠣ鍍ƍ􍍠䠣捠𠣧 㩍占鍠 卍򍍠ᠣ ㍠󠠻 砻宮䠣栻 荠𠣧 秿 㩍砻 󍍪Ҡ ҍ ㍠󍍪獠𠣧 堻 𠣧 砻卍卍 占򍍠䠣栻 荠 򾍠卍 占𠣧糍𠣧 糠 獠獍占嫱 䍍堻 𠣧 占砻 獍嫱 𠣧糍𠣧 糍𠣧 糍𠣧 糍獍糠䠻 䍍素ᠣ 占納㠠 ㍠󍍪 ᠣ􍍪 䍪ᠣ 𩍍卍ᠣ􍍪 卪㠠 ۫ 㠣፠㠣󍍪 卪ᠣ􍍠占㍠㍠󍍪 卪 򳠻 卍 򲍍󍍪 󭲳 ݍᠣ 䍠 䠻䠻 䲠䠻 䲠 䍍ᠠ 獠ᠣ䳰䫱ᠣ䳰䫲䍍𠣱ᠣ䱲䫱ᠣ䱲䫲䍍𠣲ᠣ䲴䫱ᠣ䲴䫲䍍𠣳ᠣ䴸䫱ᠣ䴸䫲䍍𠣴ᠣ乶䫱ᠣ乶䫲䍍ᠣ䱹䫱ᠣ䱹䫲㱍􍍠ᠤ䍍䍠ᠣ捠捠􍍠󍍪 ᠣ򍍠󍍪 捪⠰⠰䳰㠧§ 䱲㠧§ 䲴㠧§ 䴸㠧§ 乶㠧§ 䱹㠧⧍ 䍍㠧ħ 㠧Ч 㠧ħ獠㠧ħ 㠧ħ 䍠㠧ħ 㠧ħ 䍠㠧ħ 獠㠧ŧ 䍠㠧ڧ 󍍪 占 ᠰ 占ᠲ򍍪 ᠰᠰ򍍪 ⠻ ҍᠰᠰ􍍪 占ᠰ󠲍㠧 \ No newline at end of file +* GS Port Driver Bios - Slot #1 +* written by Andy Nicholas on July 26, 1987 +*------------------------------- + + rel + dsk rel/gsport1 + +cr equ $0d +lf equ $0a + +initstr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf +Buffer equ $11a0 + +* setup for call +*------------------------------- + +gsport1 ent + +* Jump Table +*------------------------------- + + org $e00 + + hex 10 ;serial card slot * 16 +initspd hex 00 ;init speed for modem + +callspd dfb 0 speed + +bytcnt dfb 0,0,0 + + jmp init + jmp ringset + jmp ring + jmp answerRing + jmp hangup + jmp inp ;get a byte + jmp out ;send a byte + jmp getcarr ;caller there? + jmp setspeed ;speed of port + jmp raisedtr ;raise dtr + +doinit jmp $c100 +doread jmp $c100 +dowrite jmp $c100 +dostatus jmp $c100 +doext jmp $c100 + +* init the serial port pascal locations +*------------------------------- + +init lda $c10d ;get init address + sta doinit+1 + lda $c10e ;get read address + sta doread+1 + lda $c10f ;get write address + sta dowrite+1 + lda $c110 ;get status address + sta dostatus+1 + lda $c112 + sta doext+1 + + rts + +* input data +*------------------------------- + +inp phx save ;x + phy + ldx #$c1 ;are we ready? + ldy #$10 + lda #1 + jsr dostatus + bcc inp2 ;nope, exit + + ldx #$c1 ;yes, read + ldy #$10 + jsr doread + + sec + ply + plx restore ;& return + rts + +inp2 lda #0 + clc + ply + plx + rts + +* output data +*------------------------------- + +out phx save ;x + phy save ;y + pha save ;a + +out1 ldx #$c1 ;ready for send? + ldy #$10 + lda #$00 + jsr dostatus + bcc out1 ;nope + + pla get ;a + ldx #$c1 + ldy #$10 + jsr dowrite ;send it + + ply get ;y + plx get ;x + rts + +* init modem for ring +*------------------------------- + +ringset jsr hangup + + lda #0 ;let modem reset + jsr wait + jsr wait + + lda #$00 + jsr gsdtr + + ldy initspd ;set init speed + jsr setspeed + + lda #0 ;slight delay (let modem do init) + jsr wait + + ldx #$FF +rset2 inx do ;pre-inc + lda initstr,x ;get modem init string + beq rset3 ;we are done + + jsr out ;output + bra rset2 ;loop (Z-bit set after wait) + +rset3 lda #6 + sta countlo + sta counthi + +rset4 ldy #$FF +rset5 dey + beq decount + + jsr inp + bcc rset5 + and #$7f + cmp #'0' ;check for "0" (numeric) + beq leave + jmp rset5 + +decount dec countlo + bne rset4 + dec counthi + bne rset4 + jmp ringset + +leave jsr inp ;grab the off the tail end of the "0" + bcc leave + + jsr clearBuffer + + lda #0 + sta bytcnt ;reset byte counter + sta bytcnt+1 + sta bytcnt+2 + clc + rts ;return + +*------------------------------- +* test for a ring and handle it + +ring jsr inp ;check for a char + bcc noRing ;nope... + + and #$7f ;strip high + cmp #'2' ;is it a 'ring'? (numeric) + bne notRing ;nope, check for connect messages + +******************************** +grabCR jsr inp ;grab the off the tail end of the "2" + bcc grabCR + +answerRing jsr answer ;the phone rang, so send 'ATA' + + clc + rts + +******************************** +notRing + cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + beq gotCode ;yes, save it + cmp #'5' ;is it connect 1200? + bne noRing ;nope + +gotCode sta code + +secondChar jsr inp ;second character will ALWAYS be there + bcc secondChar + + and #$7f ;strip high + cmp #cr ;but might be a + bne multiCode + +******************************** +singleCode ldy #0 ;connect 300? + lda code + cmp #'1' + beq ring3 + + iny + cmp #'5' ;connect 1200? + beq ring3 ;nope, unknown code, keep checking + jmp noRing + +******************************** +multiCode + sta code+1 + + ldy #2 ;def = 2400 baud + + lda code ;get the first code char + cmp #'1' ;must be a one + bne noRing ;if not, then keep trying + + lda code+1 ;is it 2400? + cmp #'0' + beq ring3 + + iny + cmp #'1' ;is it 4800? + beq ring3 + + iny + cmp #'2' ;is it 9600 + beq ring3 + + iny + cmp #'4' ;is it 19200? + beq ring3 + jmp noRing + +******************************** +ring3 jsr setspeed ;set the correct speed + + ldy #5 +ring4 lda #0 ;let carrier's settle + jsr wait + dey + bne ring4 + + jsr clearBuffer + sec ;we have a connection! + rts + +noRing clc + rts + +*------------------------------- +* clear the input buffer + +clearBuffer + lda #Flush_List + ldx #>Flush_List + ldy #0 + jmp doext + +* set DTR on GS Serial Port, and hangup if needed +*------------------------------- + +hangup lda #$80 ;blow 'em off (hangup) + +gsdtr sta DTRstate + + lda #DTR_List + ldx #>DTR_List + ldy #0 + jmp doext + +* wait routine +*------------------------------- + +wait sec ;from apple ][+ ref man - pg 147 +wait2 pha +wait3 sbc #1 + bne wait3 + pla + sbc #1 + bne wait2 + rts + +* Check for carrier using Get_Port_Stat routine +*------------------------------- + +getcarr phx + phy + + lda #carrlist + ldx #>carrlist + ldy #0 + jsr doext + + lda carrbits + and cdbyte + beq nocarr + sec + ply + plx + rts + +nocarr clc + ply + plx + rts + +* send ata to phone +*------------------------------- + +answer ldx #$ff +answer2 inx + lda ansstr,x ;get text + beq answer3 ;we are done + + jsr out ;send it + bra answer2 + +answer3 rts + +* set the rs-232 speed [speed offset in Y] +*------------------------------- + +setspeed phx + phy + + lda #1 ;find caller speed (x300) + sta callspd + cpy #0 ;at 300? + beq Do_Baud ;yep + + asl callspd ;speed = speed * 2 +setspeed2 asl callspd ;speed = speed * 2 + dey + bne setspeed2 ;loop until correct speed found + +Do_Baud pla ;get y-reg + bne Try1200 + lda #Baud300 + sta Baudread+2 + bra SetBaud + +Try1200 cmp #1 + bne Try2400 + lda #Baud1200 + sta Baudread+2 + bra SetBaud + +Try2400 cmp #2 + bne Try4800 + lda #Baud2400 + sta Baudread+2 + bra SetBaud + +Try4800 cmp #3 + bne Try9600 + lda #Baud4800 + sta Baudread+2 + bra SetBaud + +Try9600 cmp #4 + bne Try19200 + lda #Baud9600 + sta Baudread+2 + bra SetBaud + +Try19200 lda #Baud19200 + sta Baudread+2 + +SetBaud ldx #$c1 + ldy #$10 + jsr doinit + + ldx #0 +Baudread lda $ffff,x + beq Fin_Init + jsr out + inx + bra Baudread + +Fin_Init ldx #0 +Init_Loop lda Port_Init,x + beq donebaud + jsr out + inx + bra Init_Loop + +donebaud lda #Out_Buf + ldx #>Out_Buf + ldy #0 + jsr doext + + plx + rts + +*------------------------------- +* raise dtr + +raisedtr lda #0 + phx + phy + + jsr gsdtr + + ply + plx + rts + +* Table of Speeds and other important stuff +*------------------------------- + +counthi db 0 +countlo db 0 + +Baud300 hex 01 + asc '6B' + hex 00 ;accept 300 Baud +Baud1200 hex 01 + asc '8B' + hex 00 ;accept 1200 Baud +Baud2400 hex 01 + asc '10B' + hex 00 ;accept 2400 Baud +Baud4800 hex 01 + asc '12B' + hex 00 ;accept 4800 Baud +Baud9600 hex 01 + asc '14B' + hex 00 ;accept 9600 Baud +Baud19200 hex 01 + asc '15b' + hex 00 ;accept 19200 baud + +Port_Init ; + hex 01 + asc '0D' ;8 bits + hex 01 + asc '2P' ;no parity + hex 01 + asc 'AD' ;auto-tabbing + hex 01 + asc 'XD' ;no xoff recognition + hex 01 + asc 'FD' ;no find keyboard + hex 01 + asc 'CD' ;no column overflow + hex 01 + asc 'ED' ;echo disabled + hex 01 + asc 'MD' ;no lf masking + hex 01 + asc 'BE' ;buffering enabled + hex 01 + asc 'Z' + hex 00 ;no more control characters + +*------------------------------- + +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl Buffer ;Buffer it where + da 2 buffer + +*------------------------------- + +carrlist hex 03 ;Parameter list for + hex 06 ;detecting carrier drop + da 0 +carrbits da 0 Carrier + +*------------------------------- + +DTR_List hex 03 ;Parameter list for + hex 0b ;setting DTR + da 0 +DTRstate da 0 bit + +*------------------------------- + +Flush_List hex 02 ;parameter list for flushing input queue + hex 14 + da 0 + +*------------------------------- + +code ds 2 + asc 'GSPort1' + + diff --git a/Source/Config/Modems/OLD/Gsport.Slot2.S b/Source/Config/Modems/OLD/Gsport.Slot2.S index 3724a73..51773e2 100644 --- a/Source/Config/Modems/OLD/Gsport.Slot2.S +++ b/Source/Config/Modems/OLD/Gsport.Slot2.S @@ -1 +1,522 @@ - 썠ፍ䰍㰍ᰍ􍍍 卪砤尰 ⠰ 썍⠰獠獠䍠㲰㲰㲰㲰㲰 󍪭ᠤ㲰䠻 ᠤ㲰堻 䫱ᠤ㲰栻 嫱ᠤ㲱 󫱍ᠤ㲱󍍪 ፪堻㲠 ᠣ𲠻 􍍠㲠 䍠䍍㍠堻 ᠣ㍠󍍪 ፪ ᠠ ፍ㲠 俍ᠣ卍፠㲍堻 􍍠󍍪 썪ᠣ 􍍠ᠣ򍍠䠻 䍠䍍ᠣ 􍍠ƍ㍠ 獠 卍 ڭ ᠣ鍍ƍ􍍠䠣捠𠣧 占鍠 卍򍍠ᠣ ㍠󠠻 砻宮䠣栻 荠𠣧 秿 㩍砻 󍍪Ҡ ҍ ㍠󍍪獠𠣧 堻 𠣧 砻卍卍 占򍍠䠣栻 荠 򾍠卍 占𠣧糍𠣧 糠 獠獍占嫱 䍍堻 𠣧 占砻 獍嫱 𠣧糍𠣧 糍𠣧 糍𠣧 糍獍糠䠻 䍍素ᠣ 占納 占㠠 ㍠󍍪 ᠣ􍍪 䍪ᠣ 卍ᠣ􍍪 卪㠠 ۫ 㠣፠㠣󍍪 卪ᠣ􍍠占㍠㍠󍍪 卪ᠣ􍍠 򳠻 卍 򲍍󍍪 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪ᠣ 䍠 䠻䠻 䲠䠻 䲠 䍍ᠠ 獠ᠣ䳰䫱ᠣ䳰䫲䍍𠣱ᠣ䱲䫱ᠣ䱲䫲䍍𠣲ᠣ䲴䫱ᠣ䲴䫲䍍𠣳ᠣ䴸䫱ᠣ䴸䫲䍍𠣴ᠣ乶䫱ᠣ乶䫲䍍ᠣ䱹䫱ᠣ䱹䫲㲍􍍠ᠤ䍍䍠ᠣ捠捠􍍠󍍪 ᠣ򍍠󍍪 󍪭⠰⠰䳰㠧§ 䱲㠧§ 䲴㠧§ 䴸㠧§ 乶㠧§ 䱹㠧§ 䍍㠧ħ 㠧Ч 㠧ħ獠㠧ħ 㠧ħ 䍠㠧ħ 㠧ħ 䍠㠧ħ 獠㠧ŧ 䍠㠧ڧ 󍍪 占 ᠰ 占ᠲ򍍪 ᠰᠰ򍍪 ⠻ ҍᠰᠰ􍍪 占ᠰ󠲠 퍠㠧 \ No newline at end of file +* GS Port Driver Bios - Slot #2 +* written by Andy Nicholas on July 26, 1987 +*------------------------------- + + rel + dsk rel/gsport2 + +cr equ $0d +lf equ $0a + +initstr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf +Buffer equ $11a0 + +*------------------------------- + +gsport2 ent + + +* Jump Table +*------------------------------- + + org $e00 + + hex 20 ;serial card slot * 16 +initspd hex 00 + +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + jmp init + jmp ringset + jmp ring + jmp answerRing + jmp hangup + jmp inp + jmp out + jmp getcarr + jmp setspeed + jmp raisedtr + +doinit jmp $c200 +doread jmp $c200 +dowrite jmp $c200 +dostatus jmp $c200 +doext jmp $c200 + +* init the serial port pascal locations +*------------------------------- + +init lda $c20d ;get init address + sta doinit+1 + lda $c20e ;get read address + sta doread+1 + lda $c20f ;get write address + sta dowrite+1 + lda $c210 ;get status address + sta dostatus+1 + lda $c212 + sta doext+1 + + rts + +* input data +*------------------------------- + +inp phx save ;x + phy + ldx #$c2 ;are we ready? + ldy #$20 + lda #1 + jsr dostatus + bcc inp2 ;nope, exit + + ldx #$c2 ;yes, read + ldy #$20 + jsr doread + + sec + ply + plx restore ;& return + rts + +inp2 lda #0 + clc + ply + plx + rts + +* output data +*------------------------------- + +out phx ;save x + phy ;save y + pha ;save a + +out1 ldx #$c2 ;ready for send? + ldy #$20 + lda #$00 + jsr dostatus + bcc out1 ;nope + + pla get ;a + ldx #$c2 + ldy #$20 + jsr dowrite ;send it + + ply get ;y + plx get ;x + rts + +* setup for call +*------------------------------- + +ringset jsr hangup + + lda #0 ;let modem reset + jsr wait + jsr wait + + lda #$00 + jsr gsdtr + + ldy initspd ;set init speed + jsr setspeed + + lda #0 ;slight delay (let modem do init) + jsr wait + + ldx #$FF +rset2 inx do ;pre-inc + lda initstr,x ;get modem init string + beq rset3 ;we are done + + jsr out ;output + bra rset2 ;loop (Z-bit set after wait) + +rset3 lda #6 + sta countlo + sta counthi + +rset4 ldy #$FF +rset5 dey + beq decount + + jsr inp + bcc rset5 + and #$7f + cmp #'0' ;check for "0" result + beq leave + jmp rset5 + +decount dec countlo + bne rset4 + dec counthi + bne rset4 + jmp ringset + +leave jsr inp ;grab the off the tail end of the "0" + bcc leave + + jsr clearBuffer + + lda #0 + sta bytcnt ;reset byte counter + sta bytcnt+1 + sta bytcnt+2 + clc + rts ;return + +*------------------------------- +* test for a ring and handle it + +ring jsr inp ;check for a char + bcc noRing ;nope... + + and #$7f ;strip high + cmp #'2' ;is it a 'ring'? (numeric) + bne notRing ;nope, check for connect messages + +******************************** +grabCR jsr inp ;grab the off the tail end of the "2" + bcc grabCR + +answerRing jsr answer ;the phone rang, so send 'ATA' + + clc + rts + +******************************** +notRing + cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + beq gotCode ;yes, save it + cmp #'5' ;is it connect 1200? + bne noRing ;nope + +gotCode sta code + +secondChar jsr inp ;second character will ALWAYS be there + bcc secondChar + + and #$7f ;strip high + cmp #cr ;but might be a + bne multiCode + +******************************** +singleCode ldy #0 ;connect 300? + lda code + cmp #'1' + beq ring3 + + iny + cmp #'5' ;connect 1200? + beq ring3 ;nope, unknown code, keep checking + jmp noRing + +******************************** +multiCode + sta code+1 + + ldy #2 ;def = 2400 baud + + lda code ;get the first code char + cmp #'1' ;must be a one + bne noRing ;if not, then keep trying + + lda code+1 ;is it 2400? + cmp #'0' + beq ring3 + + iny + cmp #'1' ;is it 4800? + beq ring3 + + iny + cmp #'2' ;is it 9600 + beq ring3 + + iny + cmp #'4' ;is it 19200? + beq ring3 + jmp noRing + +******************************** +ring3 jsr setspeed ;set the correct speed + + ldy #5 +ring4 lda #0 ;let carrier's settle + jsr wait + dey + bne ring4 + + jsr clearBuffer ;remove any garbage + sec ;we have a connection! + rts + +noRing clc + rts + +*------------------------------- +* clear the input buffer + +clearBuffer + lda #Flush_List + ldx #>Flush_List + ldy #0 + jmp doext + +* set DTR on GS Serial Port, and hangup if needed +*------------------------------- + +hangup lda #$80 ;blow 'em off (hangup) +gsdtr sta DTRstate + + lda #DTR_List + ldx #>DTR_List + ldy #0 + jmp doext + +* wait routine +*------------------------------- + +wait sec ;from apple ][+ ref man - pg 147 +wait2 pha +wait3 sbc #1 + bne wait3 + pla + sbc #1 + bne wait2 + rts + +* Check for carrier using Get_Port_Stat routine +*------------------------------- + +getcarr phx + phy + + lda #carrlist + ldx #>carrlist + ldy #0 + jsr doext + + lda carrbits + and cdbyte + beq nocarr + sec + ply + plx + rts + +nocarr clc + ply + plx + rts + +* send ata to phone +*------------------------------- + +answer lda #$80 + jsr wait + + ldx #$ff +answer2 inx + lda ansstr,x ;get text + beq answer3 ;we are done + + jsr out ;send it + bra answer2 + +answer3 rts + +* set the rs-232 speed [speed offset in Y] +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +*------------------------------- + +setspeed phx + phy + + lda #1 ;find caller speed (x300) + sta callspd + cpy #0 ;at 300? + beq Do_Baud ;yep + + asl callspd ;speed = speed * 2 +setspeed2 asl callspd ;speed = speed * 2 + dey + bne setspeed2 ;loop until correct speed found + +Do_Baud pla ;get y-reg + bne Try1200 + lda #Baud300 + sta Baudread+2 + bra SetBaud + +Try1200 cmp #1 + bne Try2400 + lda #Baud1200 + sta Baudread+2 + bra SetBaud + +Try2400 cmp #2 + bne Try4800 + lda #Baud2400 + sta Baudread+2 + bra SetBaud + +Try4800 cmp #3 + bne Try9600 + lda #Baud4800 + sta Baudread+2 + bra SetBaud + +Try9600 cmp #4 + bne Try19200 + lda #Baud9600 + sta Baudread+2 + bra SetBaud + +Try19200 lda #Baud19200 + sta Baudread+2 + +SetBaud ldx #$c2 + ldy #$20 + jsr doinit + + ldx #0 +Baudread lda $ffff,x + beq Fin_Init + jsr out + inx + bra Baudread + +Fin_Init ldx #0 +Init_Loop lda Port_Init,x + beq donebaud + jsr out + inx + bra Init_Loop + +donebaud lda #Out_Buf + ldx #>Out_Buf + ldy #0 + jsr doext + + plx + rts + +*------------------------------- +* raise dtr + +raisedtr lda #0 + phx + phy + + jsr gsdtr + + ply + plx + rts + +* globals +*------------------------------- + +counthi db 0 +countlo db 0 + +Baud300 hex 01 + asc '6B' + hex 00 ;accept 300 Baud +Baud1200 hex 01 + asc '8B' + hex 00 ;accept 1200 Baud +Baud2400 hex 01 + asc '10B' + hex 00 ;accept 2400 Baud +Baud4800 hex 01 + asc '12B' + hex 00 ;accept 4800 Baud +Baud9600 hex 01 + asc '14B' + hex 00 ;accept 9600 Baud +Baud19200 hex 01 + asc '15B' + hex 00 ;accept 19200 baud + +Port_Init + hex 01 + asc '0D' ;8 bits + hex 01 + asc '2P' ;no parity + hex 01 + asc 'AD' ;auto-tabbing + hex 01 + asc 'XD' ;no xoff recognition + hex 01 + asc 'FD' ;no find keyboard + hex 01 + asc 'CD' ;no column overflow + hex 01 + asc 'ED' ;echo disabled + hex 01 + asc 'MD' ;no lf masking + hex 01 + asc 'BE' ;buffering enabled + hex 01 + asc 'Z' + hex 00 ;no more control characters + +*------------------------------- + +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl Buffer ;Buffer it where + da 2 buffer + +*------------------------------- + +carrlist hex 03 ;Parameter list for + hex 06 ;detecting carrier drop + da 0 +carrbits da 0 Carrier + +*------------------------------- + +DTR_List hex 03 ;Parameter list for + hex 0b ;setting DTR + da 0 +DTRstate da 0 bit + +*------------------------------- + +Flush_List hex 02 ;parameter list for flushing input queue + hex 14 + da 0 + +*------------------------------- + +code ds 2 ;2 byte code returned by modem + asc 'GSPort2' + + diff --git a/Source/Config/Modems/OLD/HAYES.NEW2.S b/Source/Config/Modems/OLD/HAYES.NEW2.S index 34f8af5..b0887a5 100644 --- a/Source/Config/Modems/OLD/HAYES.NEW2.S +++ b/Source/Config/Modems/OLD/HAYES.NEW2.S @@ -1 +1,744 @@ -̠ 򧍠Ǎ 󍪍 䍪 򍪭Íà 占썍ԠĠ ΰԪΠԡðҠԡðϠԯᲠ占ᱠŠ栻 Ҡ㰠 Ҡ䰍ϠԯǠðōǠð΍ 󍪭ҠɠưԠˠ ˧ 砽 ǧ򠽠 ҧ      򰳠 򱲠 򲴠 򴸠 򹶠 е κ ִ󠽠 κ ֮ӧà κ çŠ κ ŧ堽 ̺ ŧԠ ̺ ԧ̠Ƞ 卪ǠŰ͍ ΰ čĠ  Ġ  썍Ԡ ԠРԍԠРԍǠРǍӠРҍǠРЍΠРЍԠРԍĠРčĠРčҠРҠ ȠРƍԠԍ 򍪭Ơэؠэ٠Рԍ 䍪РҠōԍؠԍ٠Рԍ 󍪍 捪 ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫ 􍪍 􍍠㍠占𠣤፠ᠤ 젤屰 č፪ č፠፠ᠰᠤ 덠ᠠ 䍠ᠤ㰱 ᠰ 䩍ᠰ 젤屰 占፠ᠰ 򩍠占፠ᠲ嫲۰ݠ ۰ݬ櫴櫴ᠣ 덠櫸㍠卍􍍪 櫴 捠捍ؠРԬ؍ѠōҠԍ؍ЍōÍӍ 䍪 덪 䮍 󍪍 䍪 󍪭ԍ 󍪺 򫴬 櫴 򫴬 櫴 𱍪 捍􍍠㍠占𠣤嫲፠占፠젤屰 卍㍠卍 퍪 ҍ ҍ ЍؠΠ ٠ΰРԍ捠ᠣ栻 捠ԍ捠ᠣ栻 捠ԍ ፪Рؠ ٍؠ΍٠ΰҠӍàвؠ΍٠ΰҠčÍб٠ ؍Ӎвб 卪Ġ؍ٍԍؠԍ٠ҠԍÍӍĠōѠбÍҠб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍڠ 捠ڠ썠ڠڠ􍍠 ҠԍҠԍҠҍ٠Ġ 䍠Ҡč ҠԍҠƍҠ 퍠ؠҍ٠ҠҍԳύɍԴ٠ԵٍŠàύŠԴàɍŠԴѠԍҠàԵŠԵڠԠ ڠԫڠԫҠƍÍӠ 􍪭ǠҠ àᠻ宮Рˠ ˧ 㩍Ѡ籍Р砻 秿 㩍Ѡ籍Р 㩍Š 籠Рᠻ Ҡ򍍠Ӡà፠Ӡ􍪭Ҡ獍Р占à 젻 Ӡ􍍺Реà  ӍӠ􍍺Р򰳠 忍à 占Ӡ􍍺٠ٍɠ Р٠ 忍Š 獍 Ӎ٠ 䍍dzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍҠԍÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ҡҍؠҍ٠Рҍ 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ Ѡ䱠 ٠ٍѠ䱠 Р٠ 忍Š򱠻 獍٠ 䍍٠à䱍٠ 䍠ٍ䱠 č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 덠̠ ٠ 獠̍ǍǍٍȍǍǍŠ؍Ӎ 򍪭Ҡҍ󍍪 ᠣ卺堻 占㠺堻 ҍ堻 占㠺䍠􍍠㍠堻 堺፠卍ҠЍ㠺ҍ占Šˍڠ썠򰳍ᠣˠ󍍪  䍪 䍪 Ҿ 䍺ҠЍ㠺占䠣捠𠣧 㠺占𠣧㠺占𠣧占򠣧㍺卺Ӎ 퍪 獪 ҠҍؠҫҠԍ٠ٍҩ٠ Ѡ 卍ҠԠ ÍӍ 捍ԠРҍĠРҍŠРҍӠРҍԠРҍ󠴍ɠ Ϡ   Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍪭Ԡ    Ӡ 卪Ԡ     ҍŠ ҍѠ  占   򰳬򱲬򲴬򴸬򹶍 捍 荍 占 ᠰ 占 󍍪 荍 占 ᠰ󠴠 򩍠 덍ӠⰭ͍ӠӠӠӠӠ 䩍 İ Χ ȍ ڧİ Χ ȍ ӰӲӹӳñIJ˳Ӱױİ Χ ȍ \ No newline at end of file + TTL 'Hayes Ultra - GS port driver' + PAG + +*------------------------------------------------- +* GS Port Driver Bios +* +* History: +* +* July 26, 1987, written by andy +* +* May, 1991, andy, changed to allocate a 16k input buffer instead +* of using the normal 2k input buffer +*------------------------------------------------- + XC + XC ;uses 65816 code + rel + +SLOT KBD 'Assemble for what slot (1,2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 + + DO SLOT/2 + dsk rel/gsport2 +ultra2 ent + else + dsk rel/gsport1 +ultra1 ent + fin + +CDBYTE equ $11bf ;comment these out and uncomment the stuff at the +ANSSTR equ $11c0 ;end to make this a "bloadable" driver +INITSTR equ $11d0 + + DO SLOT/2 +MODEMREG = $C038 + ELSE +MODEMREG = $C0A8 + FIN + +*------------------------------- +* Equates +*------------------------------- + +PTR = $A +MLI = $BF00 +ALLOC_INT = $40 + +Return = 13 +SM_OK = 0 ;Modem 'OK' +SM_Con03 = 1 ;Modem 'CONNECT 300' +SM_Ring = 2 ;Modem 'RING' +SM_NoCar = 3 ;Modem 'NO CARRIER' +SM_Con12 = 4 ;Modem 'CONNECT 1200' +SM_Con24 = 10 ;Modem 'CONNECT 2400' +SM_Con48 = 11 ;Modem 'CONNECT 4800' +SM_Con96 = 12 ;Modem 'CONNECT 9600' +SM_Con19 = 14 ;Modem 'CONNECT 19200' +SM_Con38 = 28 ;Modem 'CONNECT 38400' + +SM_Car03 = 40 ;Modem 'CARRIER 300' +SM_Car12 = 46 ;Modem 'CARRIER 1200' +SM_Car24 = 47 ;Modem 'CARRIER 2400' +SM_Car48 = 48 ;Modem 'CARRIER 4800' +SM_Car96 = 50 ;Modem 'CARRIER 9600' + +Comp_MNP5 = 66 ;Modem 'COMPRESSION: CLASS 5' +Comp_V42bis = 67 ;Modem 'COMPRESSION: V.42BIS' +Comp_ADC = 68 ;Modem 'COMPRESSION: ASC' +Comp_NONE = 69 ;Modem 'COMPRESSION: NONE' + +Prot_None = 70 ;Modem 'PROTOCOL: NONE' +Prot_ALT = 80 ;Modem 'PROTOCOL: ALT' + +PrtSpdL = 12 +PrtSpdH = 13 + +*------------------------------- +* Jump Table +*------------------------------- + ORG $0E00 +MODEM + DB N0 ;serial card slot +MDMSPEED +INITSPD DB 5 ;initialize speed +CALLSPD DB 0 ;speed of call + +Buffer +BYTCNT DB 0,0,0 + +MDMINIT JMP INIT +MDMRSET JMP RESET +MDMRING JMP RING +MDMANS JMP ANSWER +MDMHANG JMP HANGUP +MDMIN JMP INP +MDMOUT JMP OUT +MDMDCD JMP M_CHKDCD +MDMSSPD JMP SETSPD +MDMDTR JMP RAISEDTR ;raise dtr +MDMFLUSH JMP CLRBUFF +MDMQUIT jmp QUIT + +* clear the input buffer +*------------------------------- + +CLRBUFF LDA #FlushInQ + LDY #0 + JMP DOEXT + +* Hang up the modem if needed +*------------------------------- +HANGUP LDA #$80 +GSDTR STA DTRSTATE + LDA #DTRLIST + LDY #0 + JMP DOEXT + +*------------------------------------------------- +* init the serial port pascal locations +* +* this should only ever be called once during the lifetime of +* acos + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + +* lda #GetOutBuffer +* ldy #0 +* jsr doext +* +* lda #GetInBuffer +* ldy #0 +* jsr doext + + clc + xce + rep #$30 + mx %00 + + pha + pea $1000 ;type 1, application, auxID = 0 + ldx #$2003 + jsl $e10000 +* _GetNewID + pla +* sta ourID + + pha + pha + pea 0 + pea $4000 ;want 16k + pha ;our user id + pea $c018 ;locked, fixed, NO special memory, noCross + pea 0 ;(if we use special memory, acos gets clobbered) + pea 0 ;no fixed location + ldx #$0902 + jsl $e10000 +* _NewHandle + pla + sta 0 ;get the handle (better not get an error) + sta OurHandle + pla + sta 2 + sta OurHandle+2 + + lda [0] ;deref the handle and put the address + tax + ldy #2 + lda [0],y + sta In_Buf+4+2 + stx In_Buf+4 + + lda #$4000 ;how big, 16k + sta In_Buf+8 + + mx %11 + sec + xce + + jsr initPort + +* ldx #5 +*:oloop lda OutDefaults,x +* sta Out_Buf+4,x +* dex +* bpl :oloop + + jsr resetInBuf + jsr resetOutBuf + + LDX #0 +:LOOP LDA PORTINIT,X + BEQ :DONE + JSR OUT + INX + BRA :LOOP + +:DONE + CLC + RTS + +*------------------------------------------------- +* shutDown -- reset the port buffer to its old buffer size and +* address, and kill the memory we allocated for the 16k +* buffer which we used. +* +* We do this for both the input and output buffers +* +* The port buffers aren't restored, instead the port is re-init'd +* before we through away the extra memory which we needed. This works +* on the assumption that initport will reset our buffers +*------------------------------- + +QUIT +* ldx #5 ;move 6 bytes +*:loop1 lda GetOutBuffer+4,x +* sta Out_Buf+4,x +* lda GetInBuffer+4,x +* sta In_Buf+4,x +* dex +* bpl :loop1 +* +* jsr resetInBuf + + jsr initPort + + clc + xce + rep #$30 + mx %00 + + lda OurHandle+2 + pha + lda OurHandle + pha + ldx #$1002 + jsl $e10000 +* _DisposeHandle + + mx %11 + sec + xce + +:noInputBuffer +* LDA #>QUITSTR ;send the init string to the modem +* LDX #Out_Buf + ldy #0 + jmp DOEXT + +*------------------------------- +resetInBuf + lda #In_Buf + ldy #0 + jmp DOEXT + +* input data +*------------------------------- +INP PHX ;save x + PHY + + LDX #CN + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC INP2 + + LDX #CN + LDY #N0 + JSR DOREAD + + SEC +INP1 PLY ;restore & return + PLX + RTS + +INP2 LDA #0 + BRA INP1 + +* Check for carrier using Get_Port_Stat routine +*------------------------------- +M_CHKDCD PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ INP1 + SEC +:NOCARR BRA INP1 + +* output data +*------------------------------- + +OUT PHX ;save x + PHY ;save y + PHA ;save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;get y + PLX ;get x + RTS + +* init modem for ring +*------------------------------- + +RESET JSR HANGUP + + STZ Carrier ;clear previous stuff + STZ Protocol + STZ Compression + STZ Connect + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + JSR RAISEDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #0 ;slight delay (let modem do init) + JSR WAIT + JSR CLRBUFF + + LDA #>INITSTR ;send the init string to the modem + LDX #ANSSTR + LDX # recieved +:GetByte JSR INP + clv + bcc :Done + and #$7f + cmp #Return + beq :DatExit + cmp #' ' + bcc :GetByte + cmp #'0' + bcc :GetByte + cmp #'9'+1 + bcs :GetByte + eor #'0' + clc +:DatExit bit :Done +:Done rts + +RingHung RTS + +* Send string to modem +* +* A&X point to string +* Y is time for wait loop +*------------------------------- +SENDSTR STA PTR + STX PTR+1 + + TYA + JSR WAIT + + LDY #-1 +:Xmit2 INY + LDA (PTR),Y ;get text + BEQ :Xmit3 ;we are done + + JSR OUT ;send it + BRA :Xmit2 + + CLC +:Xmit3 RTS + +*------------------------------------------------- +* Table of Speeds and other important stuff + +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR + +OurHandle ds 4 + +COUNTHI DB 0 +COUNTLO DB 0 + +*------------------------------------------------- +PrtSpd DB 126,1,94,0,46,0,22,0,10,0,4,0,1,0 ;speeds 300-38400 +*------------------------------------------------- +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters +*------------------------------- +CARRLIST DB 3 ;parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;carrier status here +*------------------------------- +DTRLIST DB 3 ;parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;bit 7 affects DTR +*------------------------------- +FlushInQ DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 +*------------------------------- +Tbl_Conn DFB 8,SM_Con03,SM_Con12,SM_Con24,SM_Con48,SM_Con96,SM_Con19,SM_Con38 +Tbl_Carr DFB 6,SM_Car03,SM_Car12,SM_Car24,SM_Car48,SM_Car96 +DecByte hex 00 +*------------------------------------------------- +* These get copied to Out_Buf + +*OutDefaults +* adrl Buffer +* dw 3 + +*------------------------------------------------- +*GetOutBuffer +* hex 04 +* hex 11 +* dw 0 ;result +* ds 4 ;address +* dw 0 ;length + +*------------------------------------------------- +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl Buffer ;Buffer it where + dw 3 ;buffer 3 bytes + +*------------------------------------------------- +*GetInBuffer +* hex 04 +* hex 10 +* dw 0 ;result +* ds 4 ;address +* dw 0 ;length + +*------------------------------------------------- +In_Buf hex 04 ;Parameters to set the + hex 12 ;Output buffer + da 0 + ds 4 ;Buffer it where (modified later) + dw $4000 ;buffer 16k + + DS $3b0-*+MODEM + + DS 11 +Carrier DS 1 +Protocol DS 1 +Compression DS 1 +Connect DS 1 + +*CDBYTE DB %00001000 ;mask DCD only (0=connected) +* +*ANSSTR ASC 'ATA'0D00 +* DS $8-*+ANSSTR ;DON'T TOUCH +* +*QUITSTR ASC 'ATZ'0D00 +* DS $8-*+QUITSTR ;DON'T TOUCH +* +*INITSTR ASC 'ATS0=1S2=128S95=44S36=5&C1&D2&K3&S0VEMW1'0D00 +* DS $30-*+INITSTR ;DON'T TOUCH + + diff --git a/Source/Config/Modems/OLD/HAYES.ULTRA.S b/Source/Config/Modems/OLD/HAYES.ULTRA.S index 27ea622..af8682e 100644 --- a/Source/Config/Modems/OLD/HAYES.ULTRA.S +++ b/Source/Config/Modems/OLD/HAYES.ULTRA.S @@ -1 +1,748 @@ -̠ 򧍠Ǎ 󍪍 䍪 򍪭Íà 卪 썍ԠĠ ΰԪΠԡðҠԡð 卪  卪 䰍ϠԯǠðōǠð΍ 󍪭ҠɠưԠˠ ˧ 砽 ǧ򠽠 ҧ      򰳠 򱲠 򲴠 򴸠 򹶠 е κ ִ󠽠 κ ֮ӧà κ çŠ κ ŧ堽 ̺ ŧԠ ̺ ԧ̠Ƞԯ 卪ǠŰ͍ ΰ čĠ  Ġ  썍Ԡ ԠРԍԠРԍǠРǍӠРҍǠРЍΠРЍԠРԍĠРčĠРčҠРҠ ȠРƍԠԍ 򍪭Ơэؠэ٠Рԍ 䍪РҠōԍؠԍ٠Рԍ 󍪍 捪 ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫ 􍪍 􍍠㍠占𠣤፠ᠤ 젤屰 č፪ č፠፠ᠰᠤ 덠ᠠ 䍠ᠤ㰱 ᠰ 䩍ᠰ 젤屰 占፠ᠰ 򩍠占፠ᠲ嫲۰ݠ ۰ݬ櫴櫴ᠣ 덠櫸㍠卍􍍪 櫴 捠捍ؠРԬ؍ѠōҠԍ؍ЍōÍӍ 䍪 덪 䮍 󍪍 䍪 󍪭ԍ 󍪺 򫴬 櫴 򫴬 櫴 𱍪 捍􍍠㍠占𠣤嫲፠占፠젤屰 卍㍠卍Ҡ 퍠ؠҍ٠ҠҍРЍؠΠ ٠ΰРԍ捠ᠣ栻 捠ԍ捠ᠣ栻 捠ԍ ፪Рؠ ٍؠ΍٠ΰҠӍàвؠ΍٠ΰҠčÍб٠ ؍Ӎвб 卪Ġ؍ٍԍؠԍ٠ҠԍÍӍĠōѠбÍҠб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍڠ 捠ڠ썠ڠڠ􍍠 ҠԍҠԍҠҍ٠Ġ 䍠Ҡč ҠԍҠƍҠ 퍠ؠҍ٠ҠҍԳύɍԴ٠ԵٍŠàύŠԴàɍŠԴѠԍҠàԵŠԵڠԠ ڠԫڠԫҠƍÍӠ 􍪭ǠҠ àᠻ宮Рˠ ˧ 㩍Ѡ籍Р砻 秿 㩍Ѡ籍Р 㩍Š 籠Рᠻ Ҡ򍍠Ӡà፠Ӡ􍪭Ҡ獍Р占à 젻 Ӡ􍍺Реà  ӍӠ􍍺Р򰳠 忍à 占Ӡ􍍺٠ٍɠ Р٠ 忍Š 獍 Ӎ٠ 䍍dzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍҠԍÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ҡҍؠҍ٠Рҍ 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ Ѡ䱠 ٠ٍѠ䱠 Р٠ 忍Š򱠻 獍٠ 䍍٠à䱍٠ 䍠ٍ䱠 č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 덠̠ ٠ 獠̍ǍǍٍȍǍǍŠ؍Ӎ 򍪭Ҡҍ󍍪 ᠣ卺堻 占㠺堻 ҍ堻 占㠺䍠􍍠㍠堻 堺፠卍ҠЍ㠺ҍ占Šˍڠ썠򰳍ᠣˠ󍍪  䍪 䍪 Ҿ 䍺ҠЍ㠺占䠣捠𠣧 㠺占𠣧㠺占𠣧占򠣧㍺卺Ӎ 퍪 獪 ҠҍؠҫҠԍ٠ٍҩ٠ Ѡ 卍ҠԠ ÍӍ 捍ԠРҍĠРҍŠРҍӠРҍԠРҍ󠴍ɠ Ϡ   Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍪭Ԡ    Ӡ 卪Ԡ     ҍŠ ҍѠ  占   򰳬򱲬򲴬򴸬򹶍 捍 荍 占 ᠰ 占 󍍪 荍 占 ᠰ󠴠 򩍠 덍ӠⰭ͍ӠӠӠӠӠŠ  䩍ҠàİӠҠΧ ȍҠàڧİӠҠΧ ȍҠàӰӲӹӳñIJ˳ӰױİӠҠΧ ȍ \ No newline at end of file + TTL 'Hayes Ultra - GS port driver' + PAG + +*------------------------------------------------- +* GS Port Driver Bios +* +* History: +* +* July 26, 1987, written by andy +* +* May, 1991, andy, changed to allocate a 16k input buffer instead +* of using the normal 2k input buffer +*------------------------------------------------- + XC + XC ;uses 65816 code +* rel + +SLOT KBD 'Assemble for what slot (1,2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 + +* DO slot/2 +* dsk rel/gsport2 +* else +* dsk rel/gsport1 +* fin + +*cdbyte equ $11bf ;comment these out and uncomment the stuff at the +*ansstr equ $11c0 ;end to make this a "bloadable" driver +*initstr equ $11d0 + + DO SLOT/2 +MODEMREG = $C038 + ELSE +MODEMREG = $C0A8 + FIN + +*------------------------------- +* Equates +*------------------------------- + +PTR = $A +MLI = $BF00 +ALLOC_INT = $40 + +Return = 13 +SM_OK = 0 ;Modem 'OK' +SM_Con03 = 1 ;Modem 'CONNECT 300' +SM_Ring = 2 ;Modem 'RING' +SM_NoCar = 3 ;Modem 'NO CARRIER' +SM_Con12 = 4 ;Modem 'CONNECT 1200' +SM_Con24 = 10 ;Modem 'CONNECT 2400' +SM_Con48 = 11 ;Modem 'CONNECT 4800' +SM_Con96 = 12 ;Modem 'CONNECT 9600' +SM_Con19 = 14 ;Modem 'CONNECT 19200' +SM_Con38 = 28 ;Modem 'CONNECT 38400' + +SM_Car03 = 40 ;Modem 'CARRIER 300' +SM_Car12 = 46 ;Modem 'CARRIER 1200' +SM_Car24 = 47 ;Modem 'CARRIER 2400' +SM_Car48 = 48 ;Modem 'CARRIER 4800' +SM_Car96 = 50 ;Modem 'CARRIER 9600' + +Comp_MNP5 = 66 ;Modem 'COMPRESSION: CLASS 5' +Comp_V42bis = 67 ;Modem 'COMPRESSION: V.42BIS' +Comp_ADC = 68 ;Modem 'COMPRESSION: ASC' +Comp_NONE = 69 ;Modem 'COMPRESSION: NONE' + +Prot_None = 70 ;Modem 'PROTOCOL: NONE' +Prot_ALT = 80 ;Modem 'PROTOCOL: ALT' + +PrtSpdL = 12 +PrtSpdH = 13 + + do SLOT/2 +gsport2 ent + else +gsport1 ent + fin + +*------------------------------- +* Jump Table +*------------------------------- + ORG $0E00 +MODEM + DB N0 ;serial card slot +MDMSPEED +INITSPD DB 5 ;initialize speed +CALLSPD DB 0 ;speed of call + +Buffer +BYTCNT DB 0,0,0 + +MDMINIT JMP INIT +MDMRSET JMP RESET +MDMRING JMP RING +MDMANS JMP ANSWER +MDMHANG JMP HANGUP +MDMIN JMP INP +MDMOUT JMP OUT +MDMDCD JMP M_CHKDCD +MDMSSPD JMP SETSPD +MDMDTR JMP RAISEDTR ;raise dtr +MDMFLUSH JMP CLRBUFF +MDMQUIT jmp QUIT + +* clear the input buffer +*------------------------------- + +CLRBUFF LDA #FlushInQ + LDY #0 + JMP DOEXT + +* Hang up the modem if needed +*------------------------------- +HANGUP LDA #$80 +GSDTR STA DTRSTATE + LDA #DTRLIST + LDY #0 + JMP DOEXT + +*------------------------------------------------- +* init the serial port pascal locations +* +* this should only ever be called once during the lifetime of +* acos + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + +* lda #GetOutBuffer +* ldy #0 +* jsr doext +* +* lda #GetInBuffer +* ldy #0 +* jsr doext + + clc + xce + rep #$30 + mx %00 + + pha + pea $1000 ;type 1, application, auxID = 0 + ldx #$2003 + jsl $e10000 +* _GetNewID + pla +* sta ourID + + pha + pha + pea 0 + pea $4000 ;want 16k + pha ;our user id + pea $c018 ;locked, fixed, NO special memory, noCross + pea 0 ;(if we use special memory, acos gets clobbered) + pea 0 ;no fixed location + ldx #$0902 + jsl $e10000 +* _NewHandle + pla + sta 0 ;get the handle (better not get an error) + sta OurHandle + pla + sta 2 + sta OurHandle+2 + + lda [0] ;deref the handle and put the address + tax + ldy #2 + lda [0],y + sta In_Buf+4+2 + stx In_Buf+4 + + lda #$4000 ;how big, 16k + sta In_Buf+8 + + mx %11 + sec + xce + + jsr initPort + +* ldx #5 +*:oloop lda OutDefaults,x +* sta Out_Buf+4,x +* dex +* bpl :oloop + + jsr resetInBuf + jsr resetOutBuf + + LDX #0 +:LOOP LDA PORTINIT,X + BEQ :DONE + JSR OUT + INX + BRA :LOOP + +:DONE + CLC + RTS + +*------------------------------------------------- +* shutDown -- reset the port buffer to its old buffer size and +* address, and kill the memory we allocated for the 16k +* buffer which we used. +* +* We do this for both the input and output buffers +* +* The port buffers aren't restored, instead the port is re-init'd +* before we through away the extra memory which we needed. This works +* on the assumption that initport will reset our buffers +*------------------------------- + +QUIT +* ldx #5 ;move 6 bytes +*:loop1 lda GetOutBuffer+4,x +* sta Out_Buf+4,x +* lda GetInBuffer+4,x +* sta In_Buf+4,x +* dex +* bpl :loop1 +* +* jsr resetInBuf + + jsr initPort + + clc + xce + rep #$30 + mx %00 + + lda OurHandle+2 + pha + lda OurHandle + pha + ldx #$1002 + jsl $e10000 +* _DisposeHandle + + mx %11 + sec + xce + +:noInputBuffer + LDA #>QUITSTR ;send the init string to the modem + LDX #Out_Buf + ldy #0 + jmp DOEXT + +*------------------------------- +resetInBuf + lda #In_Buf + ldy #0 + jmp DOEXT + +* input data +*------------------------------- +INP PHX ;save x + PHY + + LDX #CN + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC INP2 + + LDX #CN + LDY #N0 + JSR DOREAD + + SEC +INP1 PLY ;restore & return + PLX + RTS + +INP2 LDA #0 + BRA INP1 + +* Check for carrier using Get_Port_Stat routine +*------------------------------- +M_CHKDCD PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ INP1 + SEC +:NOCARR BRA INP1 + +* output data +*------------------------------- + +OUT PHX ;save x + PHY ;save y + PHA ;save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;get y + PLX ;get x + RTS + +* init modem for ring +*------------------------------- + +RESET JSR HANGUP + + STZ Carrier ;clear previous stuff + STZ Protocol + STZ Compression + STZ Connect + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + JSR RAISEDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #0 ;slight delay (let modem do init) + JSR WAIT + JSR CLRBUFF + + LDA #>INITSTR ;send the init string to the modem + LDX #ANSSTR + LDX # recieved +:GetByte JSR INP + clv + bcc :Done + and #$7f + cmp #Return + beq :DatExit + cmp #' ' + bcc :GetByte + cmp #'0' + bcc :GetByte + cmp #'9'+1 + bcs :GetByte + eor #'0' + clc +:DatExit bit :Done +:Done rts + +RingHung RTS + +* Send string to modem +* +* A&X point to string +* Y is time for wait loop +*------------------------------- +SENDSTR STA PTR + STX PTR+1 + + TYA + JSR WAIT + + LDY #-1 +:Xmit2 INY + LDA (PTR),Y ;get text + BEQ :Xmit3 ;we are done + + JSR OUT ;send it + BRA :Xmit2 + + CLC +:Xmit3 RTS + +*------------------------------------------------- +* Table of Speeds and other important stuff + +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR + +OurHandle ds 4 + +COUNTHI DB 0 +COUNTLO DB 0 + +*------------------------------------------------- +PrtSpd DB 126,1,94,0,46,0,22,0,10,0,4,0,1,0 ;speeds 300-38400 +*------------------------------------------------- +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters +*------------------------------- +CARRLIST DB 3 ;parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;carrier status here +*------------------------------- +DTRLIST DB 3 ;parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;bit 7 affects DTR +*------------------------------- +FlushInQ DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 +*------------------------------- +Tbl_Conn DFB 8,SM_Con03,SM_Con12,SM_Con24,SM_Con48,SM_Con96,SM_Con19,SM_Con38 +Tbl_Carr DFB 6,SM_Car03,SM_Car12,SM_Car24,SM_Car48,SM_Car96 +DecByte hex 00 +*------------------------------------------------- +* These get copied to Out_Buf + +*OutDefaults +* adrl Buffer +* dw 3 + +*------------------------------------------------- +*GetOutBuffer +* hex 04 +* hex 11 +* dw 0 ;result +* ds 4 ;address +* dw 0 ;length + +*------------------------------------------------- +Out_Buf hex 04 ;Parameters to set the + hex 13 ;Output buffer + da 0 + adrl Buffer ;Buffer it where + dw 3 ;buffer 3 bytes + +*------------------------------------------------- +*GetInBuffer +* hex 04 +* hex 10 +* dw 0 ;result +* ds 4 ;address +* dw 0 ;length + +*------------------------------------------------- +In_Buf hex 04 ;Parameters to set the + hex 12 ;Output buffer + da 0 + ds 4 ;Buffer it where (modified later) + dw $4000 ;buffer 16k + + DS $3b0-*+MODEM + + DS 11 +Carrier DS 1 +Protocol DS 1 +Compression DS 1 +Connect DS 1 + +CDBYTE DB %00001000 ;mask DCD only (0=connected) + +ANSSTR ASC 'ATA'0D00 + DS $8-*+ANSSTR ;DON'T TOUCH + +QUITSTR ASC 'ATZ'0D00 + DS $8-*+QUITSTR ;DON'T TOUCH + +INITSTR ASC 'ATS0=1S2=128S95=44S36=5&C1&D2&K3&S0VEMW1'0D00 + DS $30-*+INITSTR ;DON'T TOUCH + + diff --git a/Source/Config/Modems/OLD/HAYES.ULTRA1.S b/Source/Config/Modems/OLD/HAYES.ULTRA1.S index 538237a..4327d34 100644 --- a/Source/Config/Modems/OLD/HAYES.ULTRA1.S +++ b/Source/Config/Modems/OLD/HAYES.ULTRA1.S @@ -1 +1,613 @@ -̠ 򧍠Ǎ Íà 卍ԠĠ ΰԪΠԡðҠԡðǠðϠԯǠðǠðōǠðǠð΍ 󍪭ԠҠɠưԠˠ ˧ 砽 ǧ򠽠 ҧ      򰳠 򱲠 򲴠 򴸠 򹶠 е κ ִ󠽠 κ ֮ӧà κ çŠ κ ŧ堽 ̺ ŧԠ ̺ ԧ̠Ƞ堽 卪ǠŰ͍ ΰ čĠ  Ġ  썍Ԡ ԠРԍԠРԍǠРǍӠРǍǠРЍΠРЍԠРԍĠРčĠРčҠРҠ ƠРƍԠРԍ ҍ ҍ ҍ ҍ ҍ 򍪭ƠڠӍڠōӍ 䍪РҠ٠РǍ 󍪭ԠɍڠӍڠōҠɍ ԍ󍍠ǍؠɠǍ؍Ǎ؍ɍӍ ҫ ԫ ҫ ī ҫ ū ҫ ӫ ҫ ԫ ΰ ԍ 獪 ԍ 󍪭Ġ 򍍺٠ ٠Ǡ Ǡ ؍Ġ 翍Ѡ󍍺٠ҰҠǍĠѠ􍍠٠ҠǍ؍ĠѠčĠ Ѡ䍍Ǡ ፠ ῍٠Ұ 䍠ҠǍ􍍺ĠǍؠōàōؠӍؠōŠàō􍍺ÍӍÍӍ ӍԠ ҍҠҍ٠Ġ 䍠Ҡčҍؠҍ٠Ҡ򍍠РР ҍ ፪РǍĠ 忍Ѡ፠ǍÍӍÍӍ ፪Ԡ ፍԱǍĠ ѠԱ 􍍺ԲǍĠˠ 忍ѠԲ ፠Ǡ Ӎ 獪ԠҠЍڠ 捠ڠ썠ڠڠ􍍠 ҠԍҠԍ ҍҠҍ٠Ġ 䍠ҠčҠ 獠ؠҍ٠Ҡ 獍ύɍԴ٠ԵٍŠàύŠԴàɍŠԴѠԍҠàԵŠԵڠԠ ڠԫڠԫҠƍÍӠ 􍪭ǠҠ àᠻ宮Рˠ ˧ 㩍Ѡ籍Р砻 秿 㩍Ѡ籍Р 㩍Š 籠Рᠻ Ҡ򍍠Ӡà ፠Ӡ􍪭Ҡ獍Р占à 젻 Ӡ􍍺Реà  ӍӠ􍍺Р򰳠 忍à 占Ӡ􍍺٠ٍɠ Р٠ 忍Š 獍 Ӎ٠ 䍍dzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍҠԍÍӍ 卪ĠǍĠˠ 忍ÍѠҠ ÍҠӍ 卪ǠҠҠ 獠ÍӍҠҠ 獠ؠҍ٠Р 獍 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ Ѡč٠ٍѠ䱠 Р٠ 忍Š򱠻 獍٠ 䍍٠à䱍٠ 䍠ٍ䱠 č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 덠̠ ٠ 獠ٍ٠̍ҠǍٍٍ٠ȍҠǍŠ؍Ӎ 퍪 獪 ҍؠҫҠԍ٠ٍҩ٠ Ѡ 卍ҠԠ ÍӍ ᠣ卺堻 占㠺堻 ҍ堻 占㠺䍠􍍠㍠堻 堺፠卍Ҡ፠㠺ҍ占Šˍڠ썠򰳍ᠣˠ󍍪  䍪 䍪 Ҿ 䍺Ҡ፠㠺占䠣捠𠣧 㠺占𠣧㠺占𠣧占򠣧㍺卺󍍺Ѝ㠺翍̠卍፠堺ᠣ Ҡԍ፺ЍӍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ ٽ 婍Ǡ٠ǍǍӍ ٽ 䩍Ǡ٠ǍǍӍ 捪ɠ Ϡ     쩍    䍠  Í ⬣ Ǎ 嬣 덠 嬣          Ơ 塍 󠰠썪  򰳬򱲬򲴬򴸬򹶍翠Ӡ󠱍Š󠱍󠱲Ӡ͍ӠӠӠӠ 䮮ˠ  ˠ  䩍ҠàİӠҠΧ ȍҠàڧİӠҠΧ ȍҠàӰӲñIJ˳ӰͧİӠҠΧ ȍ \ No newline at end of file + TTL 'Hayes Ultra - GS port driver' + PAG + +*------------------------------- +* GS Port Driver Bios +* written by Andy Nicholas on July 26, 1987 +*------------------------------- + XC + XC ;uses 65816 code + +SLOT KBD 'Assemble for what slot (1,2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 +INTREG = $C039 + + DO SLOT/2 +CMDREG = $C038 +DATAREG = $C03A + ELSE +CMDREG = $C039 +DATAREG = $C03B + FIN +* Equates +*------------------------------- + +VIDCOUT = $0906 +PTR = $A +MLI = $BF00 +ALLOC_INT = $40 + +Return = 13 +SM_OK = 0 ;Modem 'OK' +SM_Con03 = 1 ;Modem 'CONNECT 300' +SM_Ring = 2 ;Modem 'RING' +SM_NoCar = 3 ;Modem 'NO CARRIER' +SM_Con12 = 4 ;Modem 'CONNECT 1200' +SM_Con24 = 10 ;Modem 'CONNECT 2400' +SM_Con48 = 11 ;Modem 'CONNECT 4800' +SM_Con96 = 12 ;Modem 'CONNECT 9600' +SM_Con19 = 14 ;Modem 'CONNECT 19200' +SM_Con38 = 28 ;Modem 'CONNECT 38400' + +SM_Car03 = 40 ;Modem 'CARRIER 300' +SM_Car12 = 46 ;Modem 'CARRIER 1200' +SM_Car24 = 47 ;Modem 'CARRIER 2400' +SM_Car48 = 48 ;Modem 'CARRIER 4800' +SM_Car96 = 50 ;Modem 'CARRIER 9600' + +Comp_MNP5 = 66 ;Modem 'COMPRESSION: CLASS 5' +Comp_V42bis = 67 ;Modem 'COMPRESSION: V.42BIS' +Comp_ADC = 68 ;Modem 'COMPRESSION: ASC' +Comp_NONE = 69 ;Modem 'COMPRESSION: NONE' + +Prot_None = 70 ;Modem 'PROTOCOL: NONE' +Prot_ALT = 80 ;Modem 'PROTOCOL: ALT' + +PrtSpdL = 12 +PrtSpdH = 13 +Escape = 43 + + +* Jump Table +*------------------------------- + ORG $0E00 +MODEM + DB N0 ;serial card slot +MDMSPEED +INITSPD DB 5 ;initialize speed +CALLSPD DB 0 ;speed of call + +BYTCNT DB 0,0,0 + +MDMINIT JMP INIT +MDMRSET JMP RESET +MDMRING JMP RING +MDMANS JMP ANSRING +MDMHANG JMP HANGUP +MDMIN JMP INP +MDMOUT JMP OUT +MDMDCD JMP M_CHKDCD +MDMSSPD JMP SETSPD +MDMDTR JMP RAISEDTR ;raise dtr +MDMCBUF JMP CLR_BUFF +MDMQUIT JMP QUIT + +*DOINIT JMP SLTADR +*DOREAD JMP SLTADR +*DOWRITE JMP SLTADR +*DOSTATUS JMP SLTADR +*DOEXT JMP SLTADR + +* clear the input buffer +*------------------------------- +CLR_BUFF STZ BufS + STZ BufE + RTS + +* Hang up the modem if needed +*------------------------------- +HANGUP LDA #%11100000 +RAISEDTR LDY #$05 + JMP WRITEREG + +* init the serial port pascal locations +*------------------------------- +INIT SEI + + STZ BufS + STZ BufE + JSR MLI + DB ALLOC_INT + DA Alloc_Parms + + LDA CMDREG + LDX #$00 +:loop LDA PortTbl,x + BMI :Init1 + STA CMDREG + INX + LDA PortTbl,x + STA CMDREG + INX + BRA :loop + +:Init1 CLI + RTS + +*INIT LDA SLTADR+$D ;get init address +* STA DOINIT+1 +* LDA SLTADR+$E ;get read address +* STA DOREAD+1 +* LDA SLTADR+$F ;get write address +* STA DOWRITE+1 +* LDA SLTADR+$10 ;get status address +* STA DOSTATUS+1 +* LDA SLTADR+$12 +* STA DOEXT+1 +* +* LDX #CN ;setup modem port +* LDY #N0 +* JSR DOINIT +* +* LDA #PORTINIT +* LDY #$0 +* JMP XmitStr ;send it! + +* Handle an interrupt if it's ours +*------------------------------- +Int_Hndl CLD ;it's a valid handler + +:GetInt LDY #3 ;we want register 3 + STY INTREG ;tell it which register we want + LDA INTREG ;get the register status + TAX + AND #%00000100 ;is there a RX or EXT int pending? + BEQ :NotOurs + +:RxInt LDY #0 ;RR0 + JSR READREG + AND #%00000001 + BEQ :GetInt + + LDY #1 + JSR READREG + TAX + AND #%01110000 + BEQ :GOOD + + TXA + AND #%01000000 ;test for framing error + BEQ :Latched + + LDA DATAREG ;eat the bad data + BRA :RxInt ;any more data? + +:Latched LDY #0 ;WR0 + LDA #%00110000 ;issue error reset command + JSR WRITEREG + BRA :RxInt + +:GOOD LDA DATAREG + LDX BufE + STA Buffer,x + INC BufE + LDX BufS + CPX BufE + BNE :RxInt + DEC BufE + BRA :RxInt + +:Ours CLC + RTS + +:NotOurs SEC + RTS + +* Reset modem before quitting ACOS +*------------------------------- +QUIT LDA #%01101010 ;raise DTR + JSR RAISEDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #QUITSTR + LDY #$80 + JSR XmitStr + + JMP HANGUP ;drop DTR + +* input data +*------------------------------- +INP LDA CMDREG + AND #%00000001 ;is there a character available? + BEQ :nodata + LDA DATAREG + SEC + RTS +:nodata CLC + RTS + +* output data +*------------------------------- + +OUT PHA ;save a + +:OUT1 LDA CMDREG + AND #%00000100 ;is the TX buffer empty? + BEQ :OUT1 ;nope, wait + +:OUT2 LDA CMDREG + AND HSMASK ;is modem able to recieve? + BEQ :OUT2 + + PLA ;get back data + STA DATAREG ;and send it + RTS + +* init modem for ring +*------------------------------- + +RESET JSR HANGUP + + +:Reset1 STZ Carrier ;clear previous stuff + STZ Protocol + STZ Compression + STZ Connect + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + LDA #%01101010 ;raise DTR + JSR RAISEDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #INITSTR + LDY #0 + JSR XmitStr ;transmit init string + + LDA #6 + STA COUNTLO + STA COUNTHI + +:RSET4 LDY #-1 +:RSET5 DEY + BNE :Result? + + DEC COUNTLO + BNE :RSET4 + DEC COUNTHI + BNE :RSET4 + BEQ RESET + +:Result? JSR GetNumber + BCC :RSET5 + BNE :RSET5 + + STZ BYTCNT ;reset byte counter + STZ BYTCNT+1 + STZ BYTCNT+2 + + JSR CLR_BUFF + + CLC + RTS ;return + +* test for a ring and handle it +*------------------------------- +RING JSR GetNumber ;check for a char + BCC :NoData ;nope... + + CMP #SM_OK ;is it a 'OK'? (numeric) + BEQ :Ring1 + CMP #SM_Ring ;is it a 'ring'? (numeric) + BEQ :Ring1 + CMP #SM_NoCar ;is it a 'no carrier'? (numeric) + BNE :IsCnct? ;nope, check for connect messages +:Ring1 JMP :NoData ;yes, ignore it! + +:Result JSR GetNumber + + BVS :IsCnct? + BCC :Result +* BCC :NoData + BCS :DropIt +*------------------------------- +:IsCnct? JSR RingHung + + CMP #Prot_None + BCC :TstComp ;it's not 70 or greater + STA Protocol ;save it so we can look at it in acos + BCS :Result + +:TstComp CMP #Comp_MNP5 + BCC :TstCarr ;is not 66 or greater + STA Compression ;save it so we can look at it in ACOS + BCS :Result + +:TstCarr CMP #SM_Car03 ;Carrier message? + BCC :TstConn ;No, test for connect message + STA Carrier + BCS :Result + +:TstConn LDY Tbl_Conn +:TstCon1 DEY + BMI :Result ;no more to check, so go back and wait + CMP Tbl_Conn,Y ;is it a valid code? + BNE :TstCon1 ;nope, keep checking + + STA Connect ;save it so we can look at it in ACOS + DEY ;reduce it one for setbaud + +:RING3 JSR SETSPD ;set the correct speed + + LDY #5 +:RING4 LDA #0 ;let carrier's settle + JSR WAIT + DEY + BNE :RING4 + +:Connect JSR CLR_BUFF + SEC ;we have a connection! + RTS +:DropIt JSR RESET +:NoData CLC + RTS + +* Check for carrier using Get_Port_Stat routine +*------------------------------- +M_CHKDCD LDA CMDREG + AND CDMASK ;is carrier there? + CLC + BEQ :NOCARR ;Nope, so return with carry clear + SEC +:NOCARR RTS + +* send ata to phone +*------------------------------- +ANSRING JSR ANSWER ;the phone rang so send answer string + CLC + RTS + +ANSWER LDA #ANSSTR + LDY #$80 + JMP XmitStr ;transmit init string + +* set the rs-232 speed [speed offset in Y] +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +* 6 = 38400 baud +*------------------------------- + +SETSPD PHX + PHY + + LDA Carrier ;no carrier speed so ignore it + BEQ :DO_BAUD + +:FndCarr LDY Tbl_Carr +:FndCar1 DEY + BEQ :setspd1 ;This had better NEVER happen + CMP Tbl_Carr,Y ;is it a valid code? + BNE :FndCar1 ;nope, keep checking + + DEY ;reduce it one for callspd + + CPY #4 + BCC :setspd1 + + PLY ;get back original speed + PHY + + +:setspd1 LDA #1 ;find caller speed (x300) + STA CALLSPD + CPY #0 ;at 300? + BEQ :DO_BAUD ;yep + + ASL CALLSPD ;speed = speed * 2 +:SETSPD2 ASL CALLSPD ;speed = speed * 2 + DEY + BNE :SETSPD2 ;loop until correct speed found + +:DO_BAUD PLA ;get desired speed off stack + ASL ;shift in one for index + TAY ;transfer for Y for indexing + PHY + LDA PrtSpd,y + LDY #PrtSpdL + JSR WRITEREG + PLY + INY + LDA PrtSpd,y + LDY #PrtSpdH + JSR WRITEREG + +:DONE PLX + RTS + +* Send string to modem +* +* A&X point to string +* Y is time for wait loop +*------------------------------- +XmitStr STA PTR + STX PTR+1 + + TYA + JSR WAIT + + LDY #-1 +:Xmit2 INY + LDA (PTR),Y ;get text + BEQ :Xmit3 ;we are done + + JSR OUT ;send it + BRA :Xmit2 + + CLC +:Xmit3 RTS + + +* Get the two digit result code in one byte (Hex Format) +*------------------------------- +GetNumber lda #-1 + sta DecByte +:get1st jsr :GetByte ;get the first byte + bvc :exit + bcs :get1st + sta DecByte ;and incase the next byte is a CR + +:get2nd jsr :GetByte ;get the second byte + bvc :get2nd + bcs :exit + + ldy #10 +:dec8a clc + adc DecByte ; add the 10's digit, 10 times + dey + bne :dec8a + sta DecByte + +:getCR jsr :GetData + bcc :getCR + +:exit lda DecByte + php + cmp #SM_NoCar + BNE :getDaOK + STZ Protocol + LDA #SM_Car03 + sta Carrier + lda #SM_Con03 + +:getDaOK plp + rts + +* Flags on Exit: +* Overflow Carry Condidtion +* -------- ----- ---------- +* Clear Clear No data recieved +* Set Clear Number recieved +* Set Set recieved +:GetByte JSR :GetData + clv + bcc :Done + and #$7f + cmp #Return + beq :DatExit + cmp #' ' + bcc :GetByte + cmp #'0' + bcc :GetByte + cmp #'9'+1 + bcs :GetByte + eor #'0' + clc +:DatExit bit :Done +:Done rts + +:GetData jsr INP + bcc :GD_Exit + php + bit DeBug? + BPL :GD_Done + + pha + phx + phy + cmp #Return + bne :Getshow + lda #' ' +:Getshow JSR VIDCOUT + ply + plx + pla +:GD_Done PLP +:GD_Exit RTS + +RingHung RTS + +* wait routine +*------------------------------- + +WAIT SEC ;from apple ][+ ref man - pg 147 +:WAIT2 PHA +:WAIT3 SBC #1 + BNE :WAIT3 + PLA + SBC #1 + BNE :WAIT2 + RTS + +* write to a SCC Register (Y=Reg to write, A=Data to Write) +*------------------------------- +WRITEREG STY CMDREG + STA CMDREG + RTS +* Read a SCC Register (Y=Reg to read, A=Data read) +*------------------------------- +READREG STY CMDREG + LDA CMDREG + RTS + +* Table of Speeds and other important stuff +*------------------------------- +COUNTHI DB 0 +COUNTLO DB 0 +*------------------------------- +PrtSpd DB 126,1,94,0,46,0,22,0,10,0,4,0,1,0 ;speeds 300-38400 +*------------------------------- +PortTbl DFB #$09,#%01000010 ;Chanel B Reset (Optional) + DFB #$04,#%01000100 ;x16clk, 1 stop bit, no parity + DFB #$03,#%11000000 ;8 data bits, reviever disabled + DFB #$05,#%01100010 ;DTR High, 8 data bits, RTS off, NO SDLC + DFB #$0b,#%01010000 ;clocks based on BRG + DFB #$0e,#%00000000 ;null cmd, no loopback + DFB #$0e,#%00000001 ;enable BR gen. + DFB #$03,#%11000001 ;enable Rx + DFB #$05,#%01101010 ;enable Tx + DFB #$01,#%00010000 ;allow int on Rx only + DFB #$09,#%00001010 ;reenable master interrupt + DFB #$FF ;we are done! +*------------------------------- +Alloc_Parms DB 02 + ds 0 ;priority + da Int_Hndl +*------------------------------- +Tbl_Conn DFB 8,SM_Con03,SM_Con12,SM_Con24,SM_Con48,SM_Con96,SM_Con19,SM_Con38 +Tbl_Carr DFB 6,SM_Car03,SM_Car12,SM_Car24,SM_Car48,SM_Car96 +DecByte hex 00 +DeBug? hex 80 + +BufS ds 1 +BufE ds 1 +Buffer ds 128 + + DS $3BA-*+MODEM + +Carrier DS 1 +Protocol DS 1 +Compression DS 1 +Connect DS 1 + + +*These may need to be reversed... +HSMASK DB %00001000 ;mask for hardware handshake +CDMASK DB %00100000 ;mask DCD only (0=connected) + +ANSSTR ASC 'ATA'0D00 + DS $8-*+ANSSTR ;DON'T TOUCH + +QUITSTR ASC 'ATZ'0D00 + DS $8-*+QUITSTR ;DON'T TOUCH + +INITSTR ASC 'ATS0=1S2=128&C1&D2&K3&S0VEM'0D00 + DS $30-*+INITSTR ;DON'T TOUCH + + diff --git a/Source/Config/Modems/OLD/HAYES.ULTRA2.S b/Source/Config/Modems/OLD/HAYES.ULTRA2.S index 74276ae..1b73c11 100644 --- a/Source/Config/Modems/OLD/HAYES.ULTRA2.S +++ b/Source/Config/Modems/OLD/HAYES.ULTRA2.S @@ -1 +1,688 @@ -̠ 򧍠Ǎ Íà 卍ԠĠ ΰԪΠԡðҠԡðϠԯǠðōǠð΍翠 󍪭 ҠɠưԠˠ ˧ 砽 ǧ򠽠 ҧ      򰳠 򱲠 򲴠 򴸠 򹶠 е κ ִ󠽠 κ ֮ӧà κ çŠ κ ŧ堽 ̺ ŧԠ ̺ ԧ̠Ƞ堽 卪ǠŰ͍ ΰ čĠ  Ġ  썍Ԡ ԠРԍԠРԍǠРǍӠРǍǠРЍΠРЍԠРԍĠРčĠРčҠРҠ ƠРƍԠРԍ 󍪭ԠҫĠ ԫҫŠ īҫƠ ūҫ ӫҫԫؠΠ ٠ΰҠԍԠ 獠ؠԍ٠Р ؠ٠Ҡԍؠ٠ҠԍÍōРؠ čؠ̠屰 čč 덠㰱 썠ؠ̠屰 占à䍍ᠻ  卍 占占嫲۰ݍ؍٠۰ݬ櫴ؠ櫴ؠ櫸ؠÍōӍ󠲍ƠӍ ӍԠ ҍҠҍ٠Ġ 䍠Ҡčҍؠҍ٠Ҡ򍍠РР ҍ 򍪭Ơэؠэ٠Рԍ 䍪РҠōԍؠԍ٠Рԍ ፪Рؠ ٍؠ΍٠ΰҠӍàвؠ΍٠ΰҠčÍб٠ ؍Ӎвб ፪Ԡؠ ٠ ፍԱؠΠ 俍٠ΰҠӍàԱ卍 ፠ؠ΍٠ΰҠŠ 􍍠٠ ؠ Ӎ 獪ԠҠЍڠ 捠ڠ썠ڠڠ􍍠 ҠԍҠԍ ҍҠҍ٠Ġ 䍠ҠčҠ 獠ؠҍ٠Ҡ 獍ύɍԴ٠ԵٍŠàύŠԴàɍŠԴѠԍҠàԵŠԵڠԠ ڠԫڠԫҠƍÍӠ 􍪭ǠҠ àᠻ宮Рˠ ˧ 㩍Ѡ籍Р砻 秿 㩍Ѡ籍Р 㩍Š 籠Рᠻ Ҡ򍍠Ӡà ፠Ӡ􍪭Ҡ獍Р占à 젻 Ӡ􍍺Реà  ӍӠ􍍺Р򰳠 忍à 占Ӡ􍍺٠ٍɠ Р٠ 忍Š 獍 Ӎ٠ 䍍dzҠĠ 䍍٠Ǵ 占ҠԍٍŠǴҠƍà ӍҠԍÍӍ 卪Ԡà ۫ ԲԳàŠԳàŠԲӍ 卪Ġ؍ٍԍؠԍ٠ҠԍÍӍĠōѠҍÍҠٍ؍Ӎ 卪ǠҠҠ 獠ÍӍҠҠ 獠ؠҍ٠Р 獍 󭲳 ݍ 䍪 䍪 䍪 䍪 䍪 䍪 䍪Ġ؍ٍ Ѡč٠ٍѠ䱠 Р٠ 忍Š򱠻 獍٠ 䍍٠à䱍٠ 䍠ٍ䱠 č٠ ѠĠ̠Ġ IJ̠Ġ ٍŠIJ 䍍Ġ 덠̠ ٠ 獠̍ǍǍٍȍǍǍŠ؍Ӎ 򍪭Ҡ؍ٍҠҍٍ؍Ӎ 퍪 獪 ҍؠҫҠԍ٠ٍҩ٠ Ѡ 卍ҠԠ ÍӍ ᠣ卺堻 占㠺堻 ҍ堻 占㠺䍠􍍠㍠堻 堺፠卍ҠР፠㠺ҍ占Šˍڠ썠򰳍ᠣˠ󍍪  䍪 䍪 Ҿ 䍺ҠР፠㠺占䠣捠𠣧 㠺占𠣧㠺占𠣧占򠣧㍺卺󍍪 Ѝ 翍 卪 ፪  ԍ ፪ Ѝ ӍӍ 捪ԠРҍĠРҍŠРҍӠРҍԠРҍ  Ġ󠲍󠴍ɠ Ϡ Ԡ àħ  àЧ  àħ獠 àħ  àħ 䍠 àħ  àħ 䍠 àħ 獠 àŧ 䍠 àڧ  󍪭Ԡ    Ӡ 卪Ԡ     ҍŠ ҍѠ  占 ؠؠנӠ󠴍ؠؠ̠נؠؠ̠򍪭  򰳬򱲬򲴬򴸬򹶍Ӡ°͍ӠӠӠӠӠŠ  䩍ҠàİӠҠΧ ȍҠàڧİӠҠΧ ȍҠàӰӲñIJ˳ӰͧİӠҠΧ ȍ \ No newline at end of file + TTL 'Hayes Ultra - GS port driver' + PAG + +*------------------------------- +* GS Port Driver Bios +* written by Andy Nicholas on July 26, 1987 +*------------------------------- + XC + XC ;uses 65816 code + +SLOT KBD 'Assemble for what slot (1,2)' +N0 = SLOT*16 +CN = SLOT!$C0 +SLTADR = SLOT!$C0*256 + + DO SLOT/2 +MODEMREG = $C038 + ELSE +MODEMREG = $C0A8 + FIN + +DeBug? = 80 + + +* Equates +*------------------------------- + +*VIDCOUT = $0906 +PTR = $A +MLI = $BF00 +ALLOC_INT = $40 + +Return = 13 +SM_OK = 0 ;Modem 'OK' +SM_Con03 = 1 ;Modem 'CONNECT 300' +SM_Ring = 2 ;Modem 'RING' +SM_NoCar = 3 ;Modem 'NO CARRIER' +SM_Con12 = 4 ;Modem 'CONNECT 1200' +SM_Con24 = 10 ;Modem 'CONNECT 2400' +SM_Con48 = 11 ;Modem 'CONNECT 4800' +SM_Con96 = 12 ;Modem 'CONNECT 9600' +SM_Con19 = 14 ;Modem 'CONNECT 19200' +SM_Con38 = 28 ;Modem 'CONNECT 38400' + +SM_Car03 = 40 ;Modem 'CARRIER 300' +SM_Car12 = 46 ;Modem 'CARRIER 1200' +SM_Car24 = 47 ;Modem 'CARRIER 2400' +SM_Car48 = 48 ;Modem 'CARRIER 4800' +SM_Car96 = 50 ;Modem 'CARRIER 9600' + +Comp_MNP5 = 66 ;Modem 'COMPRESSION: CLASS 5' +Comp_V42bis = 67 ;Modem 'COMPRESSION: V.42BIS' +Comp_ADC = 68 ;Modem 'COMPRESSION: ASC' +Comp_NONE = 69 ;Modem 'COMPRESSION: NONE' + +Prot_None = 70 ;Modem 'PROTOCOL: NONE' +Prot_ALT = 80 ;Modem 'PROTOCOL: ALT' + +PrtSpdL = 12 +PrtSpdH = 13 +Escape = 43 + + +* Jump Table +*------------------------------- + ORG $0E00 +MODEM + DB N0 ;serial card slot +MDMSPEED +INITSPD DB 6 ;initialize speed +CALLSPD DB 0 ;speed of call + +BYTCNT DB 0,0,0 + +MDMINIT JMP INIT +MDMRSET JMP RESET +MDMRING JMP RING +MDMANS JMP ANSRING +MDMHANG JMP HANGUP +MDMIN JMP INP +MDMOUT JMP OUT +MDMDCD JMP M_CHKDCD +MDMSSPD JMP SETSPD +MDMDTR JMP RAISEDTR ;raise dtr +MDMCBUF JMP CLEAR_BUF +MDMQUIT JMP QUIT + +* init the serial port pascal locations +*------------------------------- + +INIT LDA SLTADR+$D ;get init address + STA DOINIT+1 + LDA SLTADR+$E ;get read address + STA DOREAD+1 + LDA SLTADR+$F ;get write address + STA DOWRITE+1 + LDA SLTADR+$10 ;get status address + STA DOSTATUS+1 + LDA SLTADR+$12 + STA DOEXT+1 + + LDX #CN ;setup modem port + LDY #N0 + JSR DOINIT + + LDA #PORTINIT + LDY #$0 + JMP XmitStr ;send it! + + LDA #GetOutBuffer + LDY #0 + JSR DOEXT + + LDA #GetInBuffer + LDY #0 + JSR DOEXT + + CLC + XCE + REP #$30 + MX %00 + + PHA + PEA $1000 ;type 1, application, auxID + LDX #$2003 + JSL $e10000 +* _GetNewID + PLA + STA OurID + + PHA + PHA + PEA 0 + PEA $4000 ;we want 16k + PHA + PEA $c018 ;locked, fixed, no special + PEA 0 + PEA 0 + LDX #$0902 + JSL $e10000 +* _NewHandle + BCC :good + + PLA + PLA + LDA #$eaea ;put no-ops over the input buffer + sta patchIn ;JSR if we could not get any memory + sta patchIn+1 + BRA :done + +:good PLA + STA 0 ;get the handle + STA OurHandle + PLA + STA 2 + STA OurHandle+2 + + LDA [0] + TAX + LDY #2 + LDA [0],y + STA In_Buf+4+2 + STX In_Buf+4 + + LDX #$4000 + STA In_Buf+8 + + MX %11 +:done SEC + XCE + RTS + +patchIn ds 2 +CLEAR_BUF RTS + +* Reset modem before quitting ACOS +*------------------------------- +QUIT LDA #0 ;raise DTR + JSR GSDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #QUITSTR + LDY #$80 + JSR XmitStr + + JMP HANGUP ;drop DTR + +* clear the input buffer +*------------------------------- + +CLRBUFF LDA #FlushInQ + LDY #0 + JMP DOEXT + +* Hang up the modem if needed +*------------------------------- +HANGUP LDA #$80 +GSDTR STA DTRSTATE + LDA #DTRLIST + LDY #0 + JMP DOEXT + + +* input data +*------------------------------- +INP PHX ;save x + PHY + + LDX #CN + LDY #N0 + LDA #1 + JSR DOSTATUS + BCC :INP2 + + LDX #CN + LDY #N0 + JSR DOREAD + + SEC +:INP1 PLY ;restore & return + PLX + RTS + +:INP2 LDA #0 + BRA :INP1 + +* output data +*------------------------------- + +OUT PHX ;save x + PHY ;save y + PHA ;save a + +:OUT1 LDX #CN ;ready for send? + LDY #N0 + LDA #0 + JSR DOSTATUS + BCC :OUT1 ;nope + + PLA ;get a + LDX #CN + LDY #N0 + JSR DOWRITE ;send it + + PLY ;get y + PLX ;get x + RTS + +* init modem for ring +*------------------------------- + +RESET JSR HANGUP + + STZ Carrier ;clear previous stuff + STZ Protocol + STZ Compression + STZ Connect + + LDA #0 ;let modem reset + JSR WAIT + JSR WAIT + + LDA #0 ;raise DTR + JSR GSDTR + + LDY INITSPD ;set init speed + JSR SETSPD + + LDA #INITSTR + LDY #0 + JSR XmitStr ;transmit init string + + LDA #6 + STA COUNTLO + STA COUNTHI + +:RSET4 LDY #-1 +:RSET5 DEY + BNE :Result? + + DEC COUNTLO + BNE :RSET4 + DEC COUNTHI + BNE :RSET4 + BEQ RESET + +:Result? JSR GetNumber + BCC :RSET5 + BNE :RSET5 + + STZ BYTCNT ;reset byte counter + STZ BYTCNT+1 + STZ BYTCNT+2 + + JSR CLRBUFF + + CLC + RTS ;return + +* test for a ring and handle it +*------------------------------- +RING JSR GetNumber ;check for a char + BCC :NoData ;nope... + + CMP #SM_OK ;is it a 'OK'? (numeric) + BEQ :Ring1 + CMP #SM_Ring ;is it a 'ring'? (numeric) + BEQ :Ring1 + CMP #SM_NoCar ;is it a 'no carrier'? (numeric) + BNE :IsCnct? ;nope, check for connect messages +:Ring1 JMP :NoData ;yes, ignore it! + +:Result JSR GetNumber + + BVS :IsCnct? + BCC :Result +* BCC :NoData + BCS :DropIt +*------------------------------- +:IsCnct? JSR RingHung + + CMP #Prot_None + BCC :TstComp ;it's not 70 or greater + STA Protocol ;save it so we can look at it in acos + BCS :Result + +:TstComp CMP #Comp_MNP5 + BCC :TstCarr ;is not 66 or greater + STA Compression ;save it so we can look at it in ACOS + BCS :Result + +:TstCarr CMP #SM_Car03 ;Carrier message? + BCC :TstConn ;No, test for connect message + STA Carrier + BCS :Result + +:TstConn LDY Tbl_Conn +:TstCon1 DEY + BMI :Result ;no more to check, so go back and wait + CMP Tbl_Conn,Y ;is it a valid code? + BNE :TstCon1 ;nope, keep checking + + STA Connect ;save it so we can look at it in ACOS + DEY ;reduce it one for setbaud + +:RING3 JSR SETSPD ;set the correct speed + + LDY #5 +:RING4 LDA #0 ;let carrier's settle + JSR WAIT + DEY + BNE :RING4 + +:Connect JSR CLRBUFF + SEC ;we have a connection! + RTS +:DropIt JSR RESET +:NoData CLC + RTS + +* wait routine +*------------------------------- + +WAIT SEC ;from apple ][+ ref man - pg 147 +:WAIT2 PHA +:WAIT3 SBC #1 + BNE :WAIT3 + PLA + SBC #1 + BNE :WAIT2 + RTS + +* Check for carrier using Get_Port_Stat routine +*------------------------------- +M_CHKDCD PHX + PHY + + LDA #CARRLIST + LDY #0 + JSR DOEXT + + CLC + LDA CARRBITS + AND CDBYTE + BEQ :NOCARR + SEC +:NOCARR PLY + PLX + RTS + +* send ata to phone +*------------------------------- +ANSRING JSR ANSWER ;the phone rang so send answer string + CLC + RTS + +ANSWER LDA #ANSSTR + LDY #$80 + JMP XmitStr ;transmit init string + +* set the rs-232 speed [speed offset in Y] +* +* 0 = 300 baud +* 1 = 1200 baud +* 2 = 2400 baud +* 3 = 4800 baud +* 4 = 9600 baud +* 5 = 19200 baud +* 6 = 38400 baud +*------------------------------- + +SETSPD PHX + PHY + + LDA Carrier ;no carrier speed so ignore it + BEQ :DO_BAUD + +:FndCarr LDY Tbl_Carr +:FndCar1 DEY + BEQ :setspd1 ;This had better NEVER happen + CMP Tbl_Carr,Y ;is it a valid code? + BNE :FndCar1 ;nope, keep checking + + DEY ;reduce it one for callspd + + CPY #4 + BCC :setspd1 + + PLY ;get back original speed + PHY + + +:setspd1 LDA #1 ;find caller speed (x300) + STA CALLSPD + CPY #0 ;at 300? + BEQ :DO_BAUD ;yep + + ASL CALLSPD ;speed = speed * 2 +:SETSPD2 ASL CALLSPD ;speed = speed * 2 + DEY + BNE :SETSPD2 ;loop until correct speed found + +:DO_BAUD PLA ;get desired speed off stack + ASL ;shift in one for index + TAY ;transfer for Y for indexing + LDA #PrtSpdL + STA MODEMREG + LDA PrtSpd,y + STA MODEMREG + INY + LDA #PrtSpdH + STA MODEMREG + LDA PrtSpd,y + STA MODEMREG + +:DONE PLX + RTS + + +* raise dtr +*------------------------------- + +RAISEDTR PHX + PHY + + LDA #0 + JSR GSDTR + + PLY + PLX + RTS + +* Send string to modem +* +* A&X point to string +* Y is time for wait loop +*------------------------------- +XmitStr STA PTR + STX PTR+1 + + TYA + JSR WAIT + + LDY #-1 +:Xmit2 INY + LDA (PTR),Y ;get text + BEQ :Xmit3 ;we are done + + JSR OUT ;send it + BRA :Xmit2 + + CLC +:Xmit3 RTS + + +* Get the two digit result code in one byte (Hex Format) +*------------------------------- +GetNumber lda #-1 + sta DecByte +:get1st jsr :GetByte ;get the first byte + bvc :exit + bcs :get1st + sta DecByte ;and incase the next byte is a CR + +:get2nd jsr :GetByte ;get the second byte + bvc :get2nd + bcs :exit + + ldy #10 +:dec8a clc + adc DecByte ; add the 10's digit, 10 times + dey + bne :dec8a + sta DecByte + +:getCR jsr INP ;:GetData + bcc :getCR + +:exit lda DecByte + php + cmp #SM_NoCar + BNE :getDaOK + STZ Protocol + LDA #SM_Car03 + sta Carrier + lda #SM_Con03 + +:getDaOK plp + rts + +* Flags on Exit: +* Overflow Carry Condidtion +* -------- ----- ---------- +* Clear Clear No data recieved +* Set Clear Number recieved +* Set Set recieved +:GetByte JSR INP ;:GetData + clv + bcc :Done + and #$7f + cmp #Return + beq :DatExit + cmp #' ' + bcc :GetByte + cmp #'0' + bcc :GetByte + cmp #'9'+1 + bcs :GetByte + eor #'0' + clc +:DatExit bit :Done +:Done rts + +*:GetData jsr INP +* bcc :GD_Exit +* php +* bit DeBug? +* BPL :GD_Done +* +* pha +* phx +* phy +* cmp #Return +* bne :Getshow +* lda #' ' +*:Getshow JSR VIDCOUT +* ply +* plx +* pla +*:GD_Done PLP +*:GD_Exit RTS + +RingHung RTS + +* Table of Speeds and other important stuff +*------------------------------- +DOINIT JMP SLTADR +DOREAD JMP SLTADR +DOWRITE JMP SLTADR +DOSTATUS JMP SLTADR +DOEXT JMP SLTADR +*------------------------------- +PrtSpd DB 126,1,94,0,46,0,22,0,10,0,4,0,1,0 ;speeds 300-38400 +*------------------------------- +OurID ds 2 +OurHandle ds 4 +COUNTHI DB 0 +COUNTLO DB 0 +*------------------------------- +PORTINIT DB 1 + ASC '0D' ;8 bits + DB 1 + ASC '2P' ;no parity + DB 1 + ASC 'AD' ;auto-tabbing + DB 1 + ASC 'XD' ;no xoff recognition + DB 1 + ASC 'FD' ;no find keyboard + DB 1 + ASC 'CD' ;no column overflow + DB 1 + ASC 'ED' ;echo disabled + DB 1 + ASC 'MD' ;no lf masking + DB 1 + ASC 'BE' ;buffering enabled + DB 1 + ASC 'Z' + DB 0 ;no more control characters +*------------------------------- +CARRLIST DB 3 ;parameter list for + DB 6 ;detecting carrier drop + DA 0 +CARRBITS DA 0 ;carrier status here +*------------------------------- +DTRLIST DB 3 ;parameter list for + DB $B ;setting DTR + DA 0 +DTRSTATE DA 0 ;bit 7 affects DTR +*------------------------------- +FlushInQ DB 2 ;parameter list for flushing input queue + DB $14 + DA 0 +*------------------------------- +GetInBuffer + HEX 04 + HEX 10 + DW 0 + DS 4 + dw 0 +*------------------------------- +GetOutBuffer + hex 04 + hex 11 + dw 0 + ds 4 + dw 0 +*------------------------------- +In_Buf HEX 04 + HEX 12 + DA 0 + ADRL buffer + DW $4000 +*------------------------------- +Out_Buf HEX 04 + HEX 13 + DA 0 + ADRL buffer + dw 3 +*------------------------------- +buffer +*------------------------------- +Tbl_Conn DFB 8,SM_Con03,SM_Con12,SM_Con24,SM_Con48,SM_Con96,SM_Con19,SM_Con38 +Tbl_Carr DFB 6,SM_Car03,SM_Car12,SM_Car24,SM_Car48,SM_Car96 +DecByte hex 00 + + DS $3B0-*+MODEM + + DS 11 +Carrier DS 1 +Protocol DS 1 +Compression DS 1 +Connect DS 1 + +CDBYTE DB %00001000 ;mask DCD only (0=connected) + +ANSSTR ASC 'ATA'0D00 + DS $8-*+ANSSTR ;DON'T TOUCH + +QUITSTR ASC 'ATZ'0D00 + DS $8-*+QUITSTR ;DON'T TOUCH + +INITSTR ASC 'ATS0=1S2=128&C1&D2&K3&S0VEM'0D00 + DS $30-*+INITSTR ;DON'T TOUCH + + diff --git a/Source/Config/Modems/OLD/SSC.INT.S b/Source/Config/Modems/OLD/SSC.INT.S index a880c54..d14e8c7 100644 --- a/Source/Config/Modems/OLD/SSC.INT.S +++ b/Source/Config/Modems/OLD/SSC.INT.S @@ -1 +1,504 @@ - 󍪭㍍ 썪 ㍍ፍ㰸㰸㰸㰸⍍䰍㰍捍􍍠砤尰 卍 ⠰ 썍⠰獠䍠䍠ҍ荠 卍ᠣ 䍍㍠፠㠣፠㫱 卍ᠣ䠻 썍氰⠤󍍠󫱍󫱍頠 ⠲⠰􍍪  䍪  ƍᠣ ƍ氰⠤⠱⠰ 썪 􍍠ᠣ Ҭ ᠣ 􍍠ᠣ ΍䠻 䍠䍍蠻 򍍠ᠣ 􍍠ᠣ 獠堺ƍ􍍠䠣捠𠣧 ˩ 占占荍ᠣ ㍠󠠻 砻宮䠣栻 荠獪 秿 㩍 󍍪 ҍ ㍠󍍪獠𠣧 堻 𠣧 砻卍卍 占򍍠䠣栻 荠 򾍠卍 占𠣧糍𠣧 糠 獠獍占嫱堻 𠣧 占砻 獍󭱍嫱젺獍糠䠻 䍍素ᠣ 占納荍㠠 󍍪 卍 򳠻 卍 􍍠ᠣ􍍠򲠻󍍪 卍 ᠣ 占󍍪 獪 卪 卪 卪 衍䠠 󍍠 翍䠣堺፠㍠󠠻 􍍪 占䠣򍍺䠣 卍䍠 䍠 󍍠썠 䍠䠻 獍㍠󍍪 卪 􍪭썠䍠䠻 򍍠 젻 򍍺㍠󍍺ᠣ㍠󍍪 ፍ፠ 䠣獍鍠獠፠䠣 ፍᠻ 䍠󍍪 䍍鍠ᠣ䍠썠󍍪 ፠ 䠣獍鍠獠፠堻 ㍠䲍䲠ᠠ 󍍪 󭲳 獍䍠 䍠 䍍ᠣ 䍠 䳠䠻 䲠䠻 䲠 䍍䳍󍍪 ҍ ᠣ Ҭ Ӭ ΍󍍪 卍㠣፠㠣󍍪 ፍ ⠰⠤ƍ⠰ ⠰⠥⠥⠥⠥⠥⠥㠧㠧㠧㠧㠧э㠧э㠧э䍍⠲⠳⠴⠵⠱э⠲э⠴э󠲵㠧ï򧍍 \ No newline at end of file + +*------------------------------------------------- +* USRobotics 2400 driver written by Andy Nicholas +* January 19, 1988 +* +* History: +* +* May 1991, andy, changed to support interrupts +*------------------------------------------------- + + xc + +* rel +* dsk rel/ssc + +cr equ $0d +lf equ $0a + +data equ $c088 +status equ $c089 +command equ $c08a +control equ $c08b + +InitStr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf + +*------------------------------------------------- + +ssc ent + + org $e00 + +*------------------------------------------------- +* jump table + +slot hex 20 ;serial card slot*16 +initspd hex 00 + +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + jmp init + jmp ringset + jmp ring + jmp answer + jmp hangup + jmp inp + jmp out + jmp chkdcd + jmp setspd + jmp RaiseDTR + jmp flush + jmp shutDown + +*------------------------------------------------- +* init the serial card -- I hope this is only ever called once + +init lda #0 ;reset bytes + ldx slot + sta status,x ;reset uart + sta command,x ;reset command + + clc + txa + adc # off the tail end of the "2" +* bcc grabCR + +*answerRing jsr answer ;the phone rang, so send 'ATA' + +noRing clc + rts + +******************************** +notRing + cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + beq gotCode ;yes, save it + cmp #'5' ;is it connect 1200? + bne noRing ;nope + +gotCode sta code + +secondChar jsr inp ;second character will ALWAYS be there + bcc secondChar + + and #$7f ;strip high + cmp #cr ;but might be a + bne multiCode + +******************************** +singleCode ldy #0 ;connect 300? + lda code + cmp #'1' + beq ring3 + + iny + cmp #'5' ;connect 1200? + beq ring3 ;nope, unknown code, keep checking + jmp noRing + +******************************** +multiCode + sta code+1 + + lda code ;get the first code char + cmp #'1' ;must be a one + bne noRing ;if not, then keep trying + + ldx #rCodesEnd-rCodes-1 + lda code+1 +:loop cmp rCodes,x + beq :bingo + dex + bpl :loop + jmp noRing + +:bingo lda sCodes,x + tay +ring3 jsr setspd ;set the correct speed + + ldy #5 +ring4 lda #0 ;let carrier's settle + jsr wait + dey + bne ring4 + + jsr flush + + sec ;we have a connection! + rts + +*------------------------------------------------- +* send ata to phone + +answer ldx #0 +answer2 lda ansstr,x ;get text + beq answer3 ;we are done + + jsr out ;send it + + lda #$80 + jsr wait + + inx + bne answer2 ;loop + +answer3 rts + +*------------------------------------------------- +* hangup phone + +hangup ldx slot ;get offset + lda #0 + sta command,x ;hang up phone + rts + +*------------------------------------------------- +* int -- someone hit us with an interrupt +* service it or pass it along +* +* interrupts are disabled when they hit this routine +* +* registers don't need to be preserved by this routine +* +* And, believe it or not, reading the status register CLEARS the +* interrupt status flag on the 6551. Augh! +*------------------------------------------------- + +int + cld ;needed for all ProDOS interrupt handlers + + ldx slot + lda status,x ;do we have data waiting, or are we interrupting? + and #%10001000 + bne :data + sec + rts ;otherwise, it wasn't our interrupt + +*------------------------------------------------- + +:loop ldx slot ;check for another character's arrival, just + lda status,x ;in case + and #%10001000 + beq :noError + +:data and #%00001000 + beq :error ;if we were interrupting, but there's no character + lda data,x ;waiting, then something screwed up, so leave + + ldx head + sta buffer,x ;save our character at the head + inx ;next pos + + cpx tail + beq :loop ;if it will, then don't move the head + stx head ;if it won't, then keep moving the head up + jmp :loop + +*------------------------------------------------- +:error lda status,x ;Read status twice in a row to clear the interrupt + lda status,x ;pending flag + +:noError clc + rts + +*------------------------------------------------- +* inp -- get a character from the buffer, maybe +* SEC if we got a char in (A) +* CLC if not +*------------------------------------------------- + +inp stx save_x + + ldx tail + cpx head + beq :bad ;if they are the same, nothing in the buffer + + lda buffer,x ;get the byte first, then bump up our tail pointer + inc tail ;point to potential next character + +:good ldx save_x + sec + rts + +:bad lda #0 + ldx save_x + clc + rts + +*------------------------------------------------- +* output data + +out + pha + stx save_x + +out2 ldx slot + lda status,x ;check status + tax + and #%00001000 + beq :noIncoming + + php + sei + jsr int + plp + jmp out2 + +:noIncoming + txa + and #%00010000 + beq out2 ;loop until ready + pla + +dataloc sta data ;self modified + ldx save_x + rts + +*------------------------------------------------- +* flush -- (A) is destroyed, all regs preserved + +flush php + sei + lda #0 + sta head + sta tail + plp + rts + +*------------------------------------------------- +* check for carrier + +chkdcd pha + stx save_x + +:loop ldx slot ;get offset + lda status,x + tax + and #%00001000 + beq :noIncoming + + php + sei + jsr int + plp + jmp :loop + +:noIncoming + txa + and cdbyte ;check carrier + clc + bne chkdcd2 + + sec +chkdcd2 pla ;restore all & return + ldx save_x + rts + +*------------------------------------------------- +* set the rs-232 speed/speed in Y reg + +setspd + stx save_x + + ldx slot ;get offset + lda speed,y ;get speed + sta control,x ;set speed + + lda #1 ;find caller speed (x300) + sta callspd + cpy #0 ;at 300? + beq setspd3 ;yep + + asl callspd ;speed = speed * 2 +setspd2 asl callspd ;speed = speed * 2 + dey + bne setspd2 ;loop until correct speed found + +setspd3 + ldx save_x + rts + +*------------------------------------------------- +* turn on dtr/rts + +RaiseDTR + stx save_x + + ldx slot ;get offset + lda #%00001001 ;turn on DTR, RTS, interrupts ON + sta command,x + + ldx save_x + rts + +*------------------------------------------------- +* wait routine + +wait sec +wait2 pha +wait3 sbc #1 + bne wait3 + pla + sbc #1 + bne wait2 + rts + +*------------------------------------------------- +* global data area + +code dw 0 ;2 byte code from modem +save_x dfb 0 +count dfb $FF + +head dfb 00 ;start and end at the same place +tail dfb 00 + +speed dfb %00010110 ;300 + dfb %00011000 ;1200 + dfb %00011010 ;2400 + dfb %00011100 ;4800 + dfb %00011110 ;9600 + dfb %00011111 ;19200 + +rCodes asc '0' ;2400 + asc '1' ;4800 + asc '2' ;9600 + asc '4' ;19200 + asc '5' ;1200/ARQ + asc '6' ;2400/ARQ + asc '7' ;9600/ARQ +rCodesEnd + +sCodes dfb 2 ;2400 + dfb 3 ;4800 + dfb 4 ;9600 + dfb 5 ;19200 + dfb 1 ;1200/ARQ + dfb 2 ;2400/ARQ + dfb 4 ;9600/ARQ + +buffer ds 256 + asc 'SSC/Interrupt/AutoAnswer' + + diff --git a/Source/Config/Modems/OLD/SSC.INTERRUPT.S b/Source/Config/Modems/OLD/SSC.INTERRUPT.S index fc4240b..f0ea547 100644 --- a/Source/Config/Modems/OLD/SSC.INTERRUPT.S +++ b/Source/Config/Modems/OLD/SSC.INTERRUPT.S @@ -1 +1,502 @@ - 󍪭㍍썠㍍ፍ㰸㰸㰸㰸⍍䰍㰍捍􍍠砤尰 卍 ⠰ 썍⠰獠䍠䍠ҍ荠 卍ᠣ 䍍㍠፠㠣፠㫱 卍ᠣ䠻 썍氰⠤󍍠󫱍󫱍頠 ⠲⠰􍍪  䍪  ƍᠣ ƍ氰⠤⠱⠰ 썪 􍍠ᠣ Ҭ ᠣ 􍍠ᠣ ΍䠻 䍠䍍蠻 򍍠ᠣ 􍍠ᠣ 獠堺ƍ􍍠䠣捠𠣧 ˩ 占占荍ᠣ ㍠󠠻 砻宮䠣栻 荠𠣧 秿 㩍砻 󍍪Ҡ ҍ ㍠󍍪獠𠣧 堻 𠣧 砻卍卍 占򍍠䠣栻 荠 򾍠卍 占𠣧糍𠣧 糠 獠獍占嫱堻 𠣧 占砻 獍󭱍嫱젺獍糠䠻 䍍素ᠣ 占納荍㠠 󍍪 卍 򳠻 卍 􍍠ᠣ􍍠򲠻󍍪 卍 ᠣ 占󍍪 獪 卪 卪 卪 衍䠠 󍍠 翍䠣堺፠㍠󠠻 􍍪 占䠣򍍺䠣 卍䍠 䍠 󍍠썠 䍠䠻 獍㍠󍍪 卪 􍪭썠䍠䠻 򍍠 젻 򍍺㍠󍍺ᠣ㍠󍍪 ፍ፠ 䠣獍鍠獠፠䠣 ፍᠻ 䍠󍍪 䍍鍠ᠣ䍠썠󍍪 ፠ 䠣獍鍠獠፠堻 ㍠䲍䲠ᠠ 󍍪 󭲳 獍䍠 䍠 䍍ᠣ 䍠 䳠䠻 䲠䠻 䲠 䍍䳍󍍪 ҍ ᠣ Ҭ Ӭ ΍󍍪 卍㠣፠㠣󍍪 ፍ ⠰⠤ƍ⠰ ⠰⠥⠥⠥⠥⠥⠥㠧㠧㠧㠧㠧э㠧э㠧э䍍⠲⠳⠴⠵⠱э⠲э⠴э󠲵 \ No newline at end of file + +*------------------------------------------------- +* USRobotics 2400 driver written by Andy Nicholas +* January 19, 1988 +* +* History: +* +* May 1991, andy, changed to support interrupts +*------------------------------------------------- + + xc + + rel + dsk rel/ssc + +cr equ $0d +lf equ $0a + +data equ $c088 +status equ $c089 +command equ $c08a +control equ $c08b + +InitStr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf + +*------------------------------------------------- + +ssc ent + + org $e00 + +*------------------------------------------------- +* jump table + +slot hex 20 ;serial card slot*16 +initspd hex 00 + +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + jmp init + jmp ringset + jmp ring + jmp answer + jmp hangup + jmp inp + jmp out + jmp chkdcd + jmp setspd + jmp RaiseDTR + jmp flush + jmp shutDown + +*------------------------------------------------- +* init the serial card -- I hope this is only ever called once + +init lda #0 ;reset bytes + ldx slot + sta status,x ;reset uart + sta command,x ;reset command + + clc + txa + adc # off the tail end of the "2" + bcc grabCR + +answerRing jsr answer ;the phone rang, so send 'ATA' + +noRing clc + rts + +******************************** +notRing + cmp #'1' ;is it a '1' or '10' or '11' or '12' or '14'? + beq gotCode ;yes, save it + cmp #'5' ;is it connect 1200? + bne noRing ;nope + +gotCode sta code + +secondChar jsr inp ;second character will ALWAYS be there + bcc secondChar + + and #$7f ;strip high + cmp #cr ;but might be a + bne multiCode + +******************************** +singleCode ldy #0 ;connect 300? + lda code + cmp #'1' + beq ring3 + + iny + cmp #'5' ;connect 1200? + beq ring3 ;nope, unknown code, keep checking + jmp noRing + +******************************** +multiCode + sta code+1 + + lda code ;get the first code char + cmp #'1' ;must be a one + bne noRing ;if not, then keep trying + + ldx #rCodesEnd-rCodes-1 + lda code+1 +:loop cmp rCodes,x + beq :bingo + dex + bpl :loop + jmp noRing + +:bingo lda sCodes,x + tay +ring3 jsr setspd ;set the correct speed + + ldy #5 +ring4 lda #0 ;let carrier's settle + jsr wait + dey + bne ring4 + + jsr flush + + sec ;we have a connection! + rts + +*------------------------------------------------- +* send ata to phone + +answer ldx #0 +answer2 lda ansstr,x ;get text + beq answer3 ;we are done + + jsr out ;send it + + lda #$80 + jsr wait + + inx + bne answer2 ;loop + +answer3 rts + +*------------------------------------------------- +* hangup phone + +hangup ldx slot ;get offset + lda #0 + sta command,x ;hang up phone + rts + +*------------------------------------------------- +* int -- someone hit us with an interrupt +* service it or pass it along +* +* interrupts are disabled when they hit this routine +* +* registers don't need to be preserved by this routine +* +* And, believe it or not, reading the status register CLEARS the +* interrupt status flag on the 6551. Augh! +*------------------------------------------------- + +int + cld ;needed for all ProDOS interrupt handlers + + ldx slot + lda status,x ;do we have data waiting, or are we interrupting? + and #%10001000 + bne :data + sec + rts ;otherwise, it wasn't our interrupt + +*------------------------------------------------- + +:loop ldx slot ;check for another character's arrival, just + lda status,x ;in case + and #%10001000 + beq :noError + +:data and #%00001000 + beq :error ;if we were interrupting, but there's no character + lda data,x ;waiting, then something screwed up, so leave + + ldx head + sta buffer,x ;save our character at the head + inx ;next pos + + cpx tail + beq :loop ;if it will, then don't move the head + stx head ;if it won't, then keep moving the head up + jmp :loop + +*------------------------------------------------- +:error lda status,x ;Read status twice in a row to clear the interrupt + lda status,x ;pending flag + +:noError clc + rts + +*------------------------------------------------- +* inp -- get a character from the buffer, maybe +* SEC if we got a char in (A) +* CLC if not +*------------------------------------------------- + +inp stx save_x + + ldx tail + cpx head + beq :bad ;if they are the same, nothing in the buffer + + lda buffer,x ;get the byte first, then bump up our tail pointer + inc tail ;point to potential next character + +:good ldx save_x + sec + rts + +:bad lda #0 + ldx save_x + clc + rts + +*------------------------------------------------- +* output data + +out + pha + stx save_x + +out2 ldx slot + lda status,x ;check status + tax + and #%00001000 + beq :noIncoming + + php + sei + jsr int + plp + jmp out2 + +:noIncoming + txa + and #%00010000 + beq out2 ;loop until ready + pla + +dataloc sta data ;self modified + ldx save_x + rts + +*------------------------------------------------- +* flush -- (A) is destroyed, all regs preserved + +flush php + sei + lda #0 + sta head + sta tail + plp + rts + +*------------------------------------------------- +* check for carrier + +chkdcd pha + stx save_x + +:loop ldx slot ;get offset + lda status,x + tax + and #%00001000 + beq :noIncoming + + php + sei + jsr int + plp + jmp :loop + +:noIncoming + txa + and cdbyte ;check carrier + clc + bne chkdcd2 + + sec +chkdcd2 pla ;restore all & return + ldx save_x + rts + +*------------------------------------------------- +* set the rs-232 speed/speed in Y reg + +setspd + stx save_x + + ldx slot ;get offset + lda speed,y ;get speed + sta control,x ;set speed + + lda #1 ;find caller speed (x300) + sta callspd + cpy #0 ;at 300? + beq setspd3 ;yep + + asl callspd ;speed = speed * 2 +setspd2 asl callspd ;speed = speed * 2 + dey + bne setspd2 ;loop until correct speed found + +setspd3 + ldx save_x + rts + +*------------------------------------------------- +* turn on dtr/rts + +RaiseDTR + stx save_x + + ldx slot ;get offset + lda #%00001001 ;turn on DTR, RTS, interrupts ON + sta command,x + + ldx save_x + rts + +*------------------------------------------------- +* wait routine + +wait sec +wait2 pha +wait3 sbc #1 + bne wait3 + pla + sbc #1 + bne wait2 + rts + +*------------------------------------------------- +* global data area + +code dw 0 ;2 byte code from modem +save_x dfb 0 +count dfb $FF + +head dfb 00 ;start and end at the same place +tail dfb 00 + +speed dfb %00010110 ;300 + dfb %00011000 ;1200 + dfb %00011010 ;2400 + dfb %00011100 ;4800 + dfb %00011110 ;9600 + dfb %00011111 ;19200 + +rCodes asc '0' ;2400 + asc '1' ;4800 + asc '2' ;9600 + asc '4' ;19200 + asc '5' ;1200/ARQ + asc '6' ;2400/ARQ + asc '7' ;9600/ARQ +rCodesEnd + +sCodes dfb 2 ;2400 + dfb 3 ;4800 + dfb 4 ;9600 + dfb 5 ;19200 + dfb 1 ;1200/ARQ + dfb 2 ;2400/ARQ + dfb 4 ;9600/ARQ + +buffer ds 256 + + diff --git a/Source/Config/Modems/Singlespd.S b/Source/Config/Modems/Singlespd.S index 9bf2f7a..d6e5ccd 100644 --- a/Source/Config/Modems/Singlespd.S +++ b/Source/Config/Modems/Singlespd.S @@ -1 +1,301 @@ - 썪 Ů 󍪭捍썠䍍ፍ㰸㰸㰸㰸⍍䰍㰍捍砤尰 卍⠤ ⠰ ⠰ 썍⠰РРР獠РРРРР䍠䍠󍍪 䍍ؠ 䍍㍠፠㠣፠㫱 占󍍪 썍ؠ Ҭ Ӎ頠 󍍠٠䠻 䍠Ҡ䍍 卍 Ҡ􍍠ؠ ؠ ㍠ᠣ 獠Ѡ 占ᠣ鍍ƍ􍍠䠣捠𠣧˧ ˢ占鍠ᠣ ㍠󠠻 ؠ Ġ堻 占ÍŠ糠獍à ؠ粠 占Ҡ؍Š粍Ҡ ፠Í糠Ӎ 卍ؠ Ѡ򳠻 Ҡ 􍍠ᠣ 占􍍠؍Š򲠻Ӎ 卍ؠ 占Ӎ ፍؠ ؍ؠ ĠÍѠ𲠻 ፍÍؠ Ӎ ፍؠ à 䍠Š 􍍠䠻 ̠̍̍ ̍̍à Ԡà卍ؠ ؠ􍍠à Ԡà卍ؠ ؠà ؠ􍍠 ĠѠ ᠻ䍠ؠӍ ؠ ؠ Ġ堻 ÍŠ䲍Í䲠堻 ؠӍ 󭲳 ݍؠؠ 䍠 䍍 䍠٠ Ѡ䳠̠䠻 䲠̠䠻 ٍŠ䲠 䍍䳠ؠ Ӎ 􍍠ᠣ Ҭ Ӎ頠卍󍍪 卍à ۫ àŠàŠӍ ⠥⠥⠥⠥⠥⠥⠰⠰⠰⠰㠧䧍 \ No newline at end of file +*------------------------------- +* Single Speed External +*------------------------------- +* 3/19/88 Andrew E. Nicholas +*------------------------------- + lst off + + rel + dsk rel/singlespd + +cr equ $0d +lf equ $0a + +data equ $c088 +status equ $c089 +command equ $c08a +control equ $c08b + +initstr equ $11d0 +ansstr equ $11c0 +cdbyte equ $11bf + +singlespd ent ;(Start) + org $e00 + +*------------------------------- +* jump table + +slot dfb $20 ;serial card slot +initspd dfb 0 ;transmit / receive +callspd dfb 0 ;speed of call + +bytcnt dfb 0,0,0 + + JMP init + JMP ringset + JMP ring + JMP answer + JMP hangup + JMP inp + JMP out + JMP chkdcd + jmp setspd + jmp raisedtr + jmp dummy + jmp dummy + +dummy rts + +*------------------------------- +* init the serial card + +init LDA #0 ;reset + LDX slot + STA status,x ;reset uart + STA command,x ;reset command + + clc + txa + adc #begin + jsr escape + + jsr cls + + lda #30 + sta maxlen + lda #%00000000 + sta inpmode + + jsr print + asc 'What are you going to call your system?',0d + asc ':',00 + jsr inpln + + ldx #datadef + ldy #cr + jsr copyinp ; copy name into file + stx temp4 + sta temp4+1 + + lda #20 ; limit length + sta maxlen + + jsr print + hex 0d + asc 'Enter your FULL name. (20 chars max)',0d + asc ':',00 + jsr inpln ; get name + + ldx #user + ldy #cr + jsr ucopyinp + ldy #cr + jsr copyinp ; copy the line + stx temp3 + sta temp3+1 + + ldx temp4 + lda temp4+1 + ldy #cr + jsr copyinp + stx temp4 + sta temp4+1 + + ldy #0 +init1d lda user,y + iny + cmp #$20 + bne init1d + dey + lda #',' + sta user,y + +init2 lda #%11000000 + sta inpmode + + jsr print + hex 0d + asc 'Enter your telephone number',0d + asc '(XXX-XXX-XXXX): ',00 + + jsr inpln ; get tele number + cpy #12 + bne init2 + + ldx #usrtele + ldy #0 + jsr copyinp ; copy the line + + lda #16 + sta maxlen ; set length for city + + jsr print + hex 0d + asc 'What city do you call from? (16 char)',0d + asc ':',00 + + jsr inpln ; get where from + ldx temp3 + lda temp3+1 + ldy #',' + jsr copyinp ; copy the input + stx temp2 + sta temp2+1 + + lda #2 + sta maxlen ;set length for state + +init2a jsr print + hex 0d + asc 'What state do you call from? (XX):',00 + + jsr inpln ;get state + cpy #2 + bne init2a + ldx temp2 + lda temp2+1 + ldy #cr + jsr copyinp ;copy to date area + + + + lda #8 + sta maxlen + +init3 jsr cls + jsr print + asc 'Enter a 4-8 char password:',00 + + jsr inpln + cpy #4 + bcc init3 + + ldx #usrpass + ldy #0 + jsr copyinp ; copy the line + + lda #20 + sta maxlen + + jsr print + hex 0d + asc 'Enter a second password for remote'0d + asc 'sysop access (1-20 chars)'0d + asc ':',00 + + jsr inpln ; get second password + ldx temp4 + lda temp4+1 + ldy #cr + jsr copyinp ; copy password into data file + stx temp4 + sta temp4+1 ; save new pointers + + ldy #0 +init3a lda xdata,y ; copy rest of the data file + sta (temp4),y + iny + cmp #0 + bne init3a + + jsr cls ; clear screen + jsr print + db 1,7,5 + asc '- System Information -',0d,0d + asc 'System Name: ',00 + + ldx #datadef + ldy #cr+128 + jsr prstr ; show system name + stx temp4 + sta temp4+1 + + jsr print + hex 0d,0d + asc 'Sysop Name: ',00 + + ldx temp4 + lda temp4+1 + ldy #cr+128 + jsr prstr ; show sysop name + stx temp4 + sta temp4+1 + + jsr print + hex 0d,0d + asc 'Sysop Phone Number: ',00 + + ldx #usrtele + ldy #13 + jsr prstr ; show tele number + + jsr print + hex 0d,0d + asc 'Sysop is From: ',00 + + ldx temp3 + lda temp3+1 + ldy #cr+128 + jsr prstr ; show where from + + jsr print + hex 0d,0d + asc 'Logon Password: ',00 + + ldx #usrpass + ldy #9 + jsr prstr ; show main password + + jsr print + hex 0d,0d + asc 'Remote Password: ',00 + + ldx temp4 + lda temp4+1 + ldy #cr+128 + jsr prstr ; show remote password + + jsr print + hex 0d,0d + asc 'Is this information correct? [Y/N] ',00 + + jsr inpyn + bcc init4 + jmp doinit + +*------------------------------- + +init4 lda #-1 + sta init ; set init mode + +einit1 jsr re_mdm +einit2 ldx #einit1 ; if esc, go back 1 level + jsr escape + jsr re_pr +einit3 ldx #einit2 + jsr escape + jsr re_clk + +*------------------------------- + + ldy #einit3 ; backup 1 level + jsr escape + + jsr TopBox + jsr print + db 1,2,2 + asc '- Copy Files to Mass Storage Device -'00 + + jsr cls + jsr print + asc 'Please enter the slot and drive of your'0d + asc 'mass storage device. If your media is',0d,0d + asc 'removable, then please make sure there'0d + asc 'is formatted media in place.',0d,0d,0d + asc ' Slot? [1-7] ',00 + ldx #7 + jsr inpnum + sta slot ; save the slot + + jsr print + hex 0d + asc ' Drive? [1-2] ',00 + ldx #2 + jsr inpnum + sta drive ; save the drive + dec drive ; make into [0-1] range + + jsr print + hex 0d,0d,0d + asc 'Is the above correct [Y/N] ? ',00 + jsr inpyn + bcc *+5 + jmp hard1 ;nope + + jsr cls + jsr print + asc 'If you continue, 2 subdirectories will'0d + asc ' be created on your mass storage',0d + asc 'device. (GPRO.SEGS and GPRO.SYS) All'0d + asc ' needed files will be copied into',0d + asc 'these subdirectories. No existing'0d + asc 'files will be destroyed.'00 + jsr getcr + + lda #0 ; no more turning away.. + jsr escape ; [p. floyd] + + jsr chkspc ; check drive space + cmp #3 ; are there are at least 768 blocks free? + bcc *+5 ; not enough room + jmp hard2 + + jsr cls + jsr print + asc 'The storage device checked does not'0d + asc 'contain enough storage space to run',0d + asc 'the system. You need to make some'0d + asc 'more room on the device, or choose',0d + asc 'another device.',00 + + jsr getcr + jmp hard1 ; goto hard/floppy question + +hard2 jsr cls + jsr print + asc 'Should the GBBS Pro transfer system'0d + asc 'be installed onto this device? [Y/N] '00 + + jsr inpyn + bcc :trans + lda #0 + sta settrans + sta superlist ;mark the end of the supertac list as such + jmp :notrans + +:trans lda #1 + sta settrans + + jsr print + hex 0d0d0d + asc 'Please enter the number of volumes that'0d + asc 'should be allocated to the GBBS Pro',0d + asc 'file transfer system.',0d,0d,0d + asc 'Number of volumes? [1-99] ',00 + + ldx #99 ;max is 99 + jsr inpnum + sta volumes + + jsr bindec8 + sta stacacc+2 ;sysop high (10's) + stx stacacc+3 ;sysop high (1's) + sta stacacc+7 ;user high + stx stacacc+8 ;user high + sta stacacc+12 + stx stacacc+13 ;elite high + sta stacacc+17 + stx stacacc+18 ;priv high + sta stacacc+22 + stx stacacc+23 ;board manager high + +:notrans jsr setspec + jsr chkspc ;reset + + jsr cls + jsr print + asc 'The configuration program is now going'0d + asc 'to copy all the files needed to run',0d + asc 'GBBS Pro onto your mass storage device.',00 + + jsr getg ; get permission + jsr cls + + jsr setdrv ;create & log xxx/mpro.segs + jsr make1 ;do copy in 3 parts + jsr make2 + + jsr chkspc ;reset path to original drive + + jsr setsys ;create & log xxx/mpro.sys + jsr make3 + + lda settrans ;did they want a transfer system? + bne :doit ;yes, set it up + jmp noxfer ;nope, skip the next step + +:doit jsr settac ;create & log xxx/mpro.sys/transfer/vol. + jsr make4 + +*------------------------------- +* setup supertac volumes + + jsr chkspc ;reset path to /xxx/ + jsr makesys ;add /xxx/mpro.sys/ + jsr maketac1 ;add /xxx/mpro.sys/stac + jsr maketac2 ;add /xxx/mpro.sys/stac/vol. + + lda #0 + sta curvol ;start at volume 1 + inc dstpfx ;add one to length of destination prefix + +:loop inc curvol ;++current volume + lda curvol ;which volume are we at? + cmp #10 ;did we do 10 yet? + bcc :less10 ;nope, we have less than 10 + cmp #11 ;more than 9, but how much more? + bcs :over10 ;>= 11, so we not right on 10 + inc dstpfx ;smack dab on 10, so length is one greater + +:over10 jsr bindec8 ;convert volume we're on to decimal + + ldy dstpfx ;get current length + dey ;character before the end + sta dstpfx,y ;store 10's + txa ;get 1's + iny ;next character forward + sta dstpfx,y ;store 1's + + jsr mli ; create /xxx/mpro.sys/stac/vol.XX + db $c0 ; create new path + dw p_crpth + jmp :over + +:less10 ldx dstpfx ;add single number to end of prefix + clc + adc #'0' ;make it ascii + sta dstpfx,x + + jsr mli ; create /xxx/mpro.sys/stac/vol.X + db $c0 ; create new path + dw p_crpth + +:over lda curvol ;how many volumes done + cmp volumes ;done 'em all yet? + bne :loop ;nope, do some more + + +*------------------------------- + +noxfer jsr cls + jsr print + asc 'Your system is now configured and is'0d + asc 'ready to run. To bring up your system',0d + asc 'for operation, do the following:',0d,0d + asc 'Boot up your mass storage device and'0d + asc 'type "PREFIX GPRO.SEGS".',0d,0d + asc 'Type "-ACOS" to start your system',0d + asc 'running.'0d + + jsr getcr + jmp do_quit + +volumes db 00 +curvol db 00 + +*------------------------------- +* copy boot stuff over +*------------------------------- + +make1 ldx #disk1 + jsr verify + bcc :online ; yes, it is + + jsr cls + jsr print + asc 'Please place GBBS Pro Disk #1, /CONFIG,'0d + asc 'online.'00 + + jsr getg ; wait for ok + jmp make1 ;check it to make sure + +:online jsr cls + jsr print + asc 'Copying GBBS Pro...',00 + + ldx #list1 + jsr copy + +*------------------------------- + + jsr logdst ; log to destination + ldx #gname2 ; open file + jsr movname + jsr open + + ldx #confbuf ; write configured system out + ldy #18 ; write 9 pages (16.5 blocks) + jsr wrblk + jsr close ; close file + + ldx #program ; create file named "PROGRAM" + jsr movname + ldy #$f5 ; make into special type + jmp create + +*------------------------------- +* copy second set of files into XXX/GPRO.SEGS + +make2 ldx #disk2 + jsr verify + bcc :online ; yes, it is + + jsr cls + jsr print + asc 'Please place GBBS Pro Disk #2,',00 + asc '/SEGS, online.'00 + + jsr getg ; wait for ok + jmp make2 + +:online jsr cls + jsr print + asc 'Copying GBBS Pro program segments...',00 + + ldx #list2 + jmp copy + +*------------------------------- +* make main part of disk in XXX/GPRO.SYS + +make3 ldx #disk3 + jsr verify + bcc :online ; yes, it is + + jsr cls + jsr print + asc 'Please place GBBS Pro Disk #3, /FILE,'0d + asc 'online.'00 + + jsr getg ; wait for ok + jmp make3 + +:online jsr cls + jsr print + asc 'Copying GBBS Pro system files...',00 + + ldx #list3 + jsr copy + + jsr logdst ; log to seg sub + ldx #usrname + jsr movname + jsr open + + ldx #user-128 + ldy #2 ; write 1 page (2 blocks) + jsr wrblk + + jsr close ; finish up + + ldx #dtanam1 ; open data1 file + jsr movname + jsr open + + ldx #datadef + ldy #4 ; write 2 pages (4 blocks) + jsr wrblk + jsr close + jmp logcon ; log back + +*------------------------------- +* make supertac segments + +make4 ldx #list4 ;and xdos + jsr copy + +:loop ldx #disk4 + jsr verify + bcc :online ; yes, it is + + jsr cls + jsr print + asc 'Please place GBBS Pro Disk #4,'0d + asc '/STAC, online.'00 + + jsr getg ; wait for ok + jmp :loop + +:online jsr cls + jsr print + asc 'Copying GBBS Pro transfer system files.',00 + + ldx #list5 + jsr copy + +* copy the access file to the supertac stuff + + jsr logdst ;log to supertac seg parts + ldx #access + jsr movname + jsr open + + ldx #stacacc + ldy #1 ;write 128 bytes + jsr wrblk + + jsr close ;finish up + jsr logcon ;log back to config + rts ;oi, we be done! + +*------------------------------- +* print the slot or drive + +prslot lda slot + clc + adc #'0' ; print slot + jmp cout + +prdriv lda drive + clc ; print drive + adc #'1' + jmp cout + +*------------------------------- +* variables +*------------------------------- + +diskid db $a2,$20,$a0,$00 + +gname2 str 'ACOS.OBJ' +program str 'PROGRAM' +access str 'ACCESS' +slot db 0 +drive db 0 +dtanam1 str 'DATA1' + +user ds 70,0 +usrpass asc ' ' +usrtele asc 'xxx-xxx-xxxx' + dw 0 ;when$ + db %11111110,%11111111,%11111111 + db %11111111,%00000111 + db $50,$00,$00,$00,$00,$00,$00,$00,$00,$00 + ds 20,0 ;bytes + +datadef asc 'System Name',0d + asc 'Sysop Name',0d + asc 'Second Password',0d + + ds 120,0 + +xdata asc '---------------------------------------',0d + asc 'Ctrl-S Stop/Start Spacebar to Exit',0d + asc 'Press N for Next Bulletin',0d + asc '1,0',0d + db 0 + +condata asc ' ' + asc 'N' + db 2 + db 32,40,64,80 + +stacacc asc '1',0d ;sysop low access + asc '50',0d ;sysop high access + asc '1',0d ;user low access + asc '50',0d ;user high access + asc '1',0d ;elite low access + asc '50',0d ;elite high access + asc '1',0d ;priv low access + asc '50',0d ;priv high access + asc '1',0d ;board manager low access + asc '50',0d ;board manager high access + hex 0d0d + +*------------------------------- +* lists for identifying files + +disk1 str '/CONFIG',00 +disk2 str '/SEGS',00 +disk3 str '/FILE',00 +disk4 str '/STAC',00 + +list1 asc 'acos',00 + asc 'acos.obj',00 + db 00 + +list2 asc 'logon.seg.s',00 + asc 'main.seg.s',00 + asc 'msg.seg.s',00 + asc 'system.seg.s',00 + asc 'maint.seg.s',00 + asc 'mail.seg.s',00 + +* supertac segments +* a 00 is placed here if they don't want to include the +* transfer system's segments + +superlist asc 'supertac.s',00 + asc 'supertac.sys.s',00 + asc 'supertac.aux.s',00 + asc 'purge.seg.s',00 + db 00 + +list3 asc 'bbs',00 + asc 'data',00 + asc 'data1',00 + asc 'data2',00 + asc 'g1',00 + asc 'g1.1',00 + asc 'g1.2',00 + asc 'g1.3',00 + asc 'hlp.edit',00 + asc 'hlp.main',00 + asc 'hlp.msg',00 + asc 'hlp.user',00 + asc 'mnu.val.40',00 + asc 'mnu.val.80',00 + asc 'mnu.new',00 + asc 'sys.newinfo',00 + asc 'sys.news',00 + asc 'sys.info',00 + asc 'sys.questions',00 + asc 'users',00 + asc 'v1.1',00 + asc 'v1.2',00 + asc 'v1.3',00 + asc 'v1.4',00 + asc 'b1',00 +list4 asc 'protocol.up',00 + asc 'protocol.down',00 + asc 'xdos',00 + db 00 + +list5 asc 'access',00 + asc 'xshow',00 + asc 'xcat',00 + asc 'menu.supertac',00 + asc 'menu.sysop',00 + asc 'menu.aux',00 + asc 'menu.batch',00 + db 00 + + diff --git a/Source/Config/Pdiskio.S b/Source/Config/Pdiskio.S index dbf1c76..816941c 100644 --- a/Source/Config/Pdiskio.S +++ b/Source/Config/Pdiskio.S @@ -1 +1,284 @@ - ɯ 岠 占鍠⠤㰍󍍍 鍠⠤㸠  퍠퍠㍠ᠣ 썠퍠㍠⠾汬沬捍 퍠嫱鍠⠤㠻 占占 퍠嫱鍠⠤䠻 荠占󍍍 퍠 퍠鍠⠤㹠 占󍍍 鍠⠤ᠻ 䍠岠 򍍠 忍歱䠣捠岠 捠㍠岠ᠣ 占捠㠠 捠󍍍 퍠岍鍠⠤ᠻ 占岍堻 占㠠 占岠ᠣ ፠㍠󍍍 ፠ᠣ⠻ 썠堻 ፠덍 ፠ᠣᠻ 썠堻 ፍ뫲뫳 󍍠ᠣ뫴뫵 䍍뫵 뫴 퍠뫱頻 ⠤ᠻ 덠󍍍 堻 ፠፠퍠岠 퍍鍠⠤⠻ 占㠠 썠峍岠㠠 峠ᠠ ፠󍍍 栻 퍠퍍ᠻ ٬ 占፠፠፠ᠣ፠፠󍍍 퍠뫱鍠⠤䱠 捠덠뫲뫳 荠뫴󍍻 뫲뫳 뫴퍠뫱 퍍鍠⠤堻 덠덠𠣤䠻 占󳍍鍠⠤䰠 捠덠󲠻 󍍍 퍠뫱鍠⠤栻 덠덠㍠베 򍍠㍠뫲 썠뫳베鍠⠤㱠 占썠󍍻 ⠳占汍⠰⠱⠰⠴⠰占⠰⠲⠰⠰⠳⠰⠰⠰⠳⠰⠤捠⠤䍍⠴⠰捠捠⠴⠰⠱卍⠷占⠤㳍⠰⠤ \ No newline at end of file +******************************** +* * +* Config - ProDOS disk I/O * +* * +******************************** + +*------------------------------- +* Date: 3/11/88 +*------------------------------- + +create2 equ * ; entry for external files +create sty p_creat+4 ; save filetype + jsr mli + db $c0 + dw p_creat + rts + + +open ldy #0 +bfopen lda bufadr,y ; point at buffer + sta p_open+4 + + jsr mli + db $c8 ; open + dw p_open + bne open2 + + lda p_open+5 ; save refnum + sta refnum + clc + rts + +open2 lda #-1 ; make sure refnum is illegal + sta refnum + sec + rts + +bufadr db >fbuf1,>fbuf2,>msgbuf + + +close lda refnum ; use refnum + sta p_close+1 + jsr mli + db $cc ; close + dw p_close + rts + +flush lda refnum ; use refnum + sta p_close+1 + jsr mli + db $cd ; flush + dw p_close + rts + + +; setup for single line read +rdlnset lda refnum + sta p_new0+1 ; save refnum + sta p_new1+1 + sta p_rdln+1 + + jsr mli + db $c9 ; enable newline + dw p_new1 + rts + + +; read a line from a file +rdline jsr mli + db $ca ; read + dw p_rdln + bne rdline2 ; read error + + ldx p_rdln+6 ; is there a cr at end of line? + lda lnbuf-1,x + and #$7f + cmp #cr + bne rdline2 ; no more stuff + clc + rts + +rdline2 lda #0 ; no data in line + sta lnbuf + sec ; eof + rts + + +; read a single byte +rdbyte lda refnum ; save refnum + beq rdbyte2 + + sta p_rbyt+1 + jsr mli + db $ca ; read 1 byte + dw p_rbyt + bne rdbyte2 + + lda p_byte ; get byte + clc ; were done + rts + +rdbyte2 lda #0 ; fake data + sec + rts + + +; write a block for the msg routines +wrblk pha + lda #$cb ; use write call + sta rwtype ; --- does modify + pla + jmp rwblk + +; read a block for the msg routines +rdblk pha + lda #$ca ; use read call + sta rwtype ; --- does modify + pla + +rwblk stx p_rdblk+2 + sta p_rdblk+3 ; save read address + + lda #0 + sta p_rdblk+4 + sty p_rdblk+5 ; save number of blocks to read + + lsr p_rdblk+5 ; divide by 2 + ror p_rdblk+4 + + lda refnum ; get refnum + sta p_rdblk+1 + + jsr mli ; call mli +rwtype db $ca ; *** modified *** + dw p_rdblk + rts + + +; write a byte of data +wrbyte sta p_byte ; save data + pha + lda refnum + beq wrbyte2 ; if no refnum + + sta p_rbyt+1 + jsr mli + db $cb ; write byte + dw p_rbyt + clc ; all is well + beq wrbyte3 + +wrbyte2 sec ; opps, problem +wrbyte3 pla ; get back data + rts + + +; position file +posmsg ldy msgref ; save refnum + sty refnum + + lsr a ; setup Y,A,X w/exact byte + tay + txa + ror a + pha + lda #16 + ror a + tax + pla + jmp setpos + + +; find the end of file +geteof lda refnum ; save refnum + sta p_mark+1 + jsr mli + db $d1 ; get eof + dw p_mark + ldx p_mark+2 + lda p_mark+3 ; get length + ldy p_mark+4 + rts + +; set a mark into a file +setmark ldy #0 + +; do actual position set within file +setpos stx p_mark+2 + sta p_mark+3 ; point to new location + sty p_mark+4 + + lda refnum + sta p_mark+1 ; save refnum + +setpos2 jsr mli + db $ce ; set mark + dw p_mark + cmp #$4d ; check for out-of-range + bne setpos3 + + jsr mli + db $d0 ; set eof + dw p_mark + beq setpos2 ; position again + +setpos3 rts + + +; get current file marker +getmark lda refnum ; save refnum + sta p_mark+1 + jsr mli + db $cf ; get mark + dw p_mark + sec + bne getmrk2 ; opps, error + + clc + ldx p_mark+2 ; all is well + lda p_mark+3 +getmrk2 rts + +delfile jsr mli + db $c1 ; delete file + dw p_del + rts + +; ------ parms ------ + +p_open db 3 + dw flname + dw fbuf1 + db 0 + +p_close db 1 + db 0 + +p_rbyt db 4 + db 0 + dw p_byte + dw 1 + dw 0 + +p_byte db 0 + +p_mark db 2 + db 0 + db 0,0,0 + +p_new0 db 3 + db 0 + db 0 + db 0 + +p_new1 db 3 + db 0 + db $7f + db $0d + +p_rdln db 4 + db 0 + dw lnbuf + dw $00ff + dw $0000 + +p_rdblk db 4 + db 0 + dw $0000 + dw $0080 + dw $0000 + +p_del db 1 + dw flname + +p_creat db 7 + dw flname + db $c3 + db 0 + dw 0 + db $01 + dw $0000 + dw $0000 + + diff --git a/Source/Config/Pfilter.S b/Source/Config/Pfilter.S index 3b305a9..cb833d3 100644 --- a/Source/Config/Pfilter.S +++ b/Source/Config/Pfilter.S @@ -1 +1,259 @@ - 򍪭 멍砻 占占ᠣ堻 占占 卍 占덍捠ᠣ捠 󩍠덠堻 ⠱㠧 󍍠ᠣ 𲍍𲠻 䠻 䍠 卍蠻 ፍ𲠻 ㍠㠣𲠻 󍍠ᠣ 蠻 卍 ፠ ፠ 獍፠㍠㠣蠻 ᠣ 占⠱㠧 Ľ ѽ ᠣ 䍠ᠣ占捠𠣧堺䍠䍺𠣧ħ썺𠣧ѧ􍍪 占⠱㠧 ㍠𲍠㠣 卍㠧 ᠣ堻 卍 ፠捠𠣧 򍍠㍠㠣 ۰ 占𲍠㠪 卍፠䠻 䍠𲫱 ፠䠻 䍠𲫱 䍍철 ፠철  占⠱㠧 ᠣ 荠ᠣ堻 卍 ፠捠𠣧䴠 􍍠𲠻 䍠䠻 䍠𲫱 䍍䲠𠣧䳍 占䲠 ᠣ𲫱 占⠱㠧 䴠 ፍ䳠ᠣ 占 ᠣ 卍 ⠱㠧 ٯ 占 塍砻 占占ᠣ堻 占 卍 占덍捠ᠣ捠 󩍠덠堻 􍍍 ݍ 忍䲠 䱠 䍠䴠 卍 占ᠻ 䱍 䱍䲠䴠 䳠㍠󠠻 卍䴠㠠 占󍍪 􍪭 㵸 ᠤ㰵 卍ᠣ栻 獠ᠤ鍠⠤ 󍍍⠴⠰⠰ \ No newline at end of file +* Date: 3/11/88 +*------------------------------- + +*------------------------------- +* profanity filter +*------------------------------- + ; change profanity filter (yuk) +do_filt jsr logprg ; log to 'acos.obj' drive + ldx #gname ; point to filename + jsr movname + jsr open ; open file + + ldx #00 + lda filter ; point at filter table + jsr setmark + + ldx #hdrbuf + ldy #2 ; read 1 page (2 blocks) + jsr rdblk + jsr close ; thats it for now + +filt2 jsr TopBox + jsr print + db 1,3,7 + asc '- Edit Profanity Filter -',00 + jsr cls + + lda #0 ; start at #1 + sta temp2 + +filt3 ldx temp2 ; get entry number + jsr fndword ; find the word + bcs filt5 ; opps, end of table + + lda ch ; save current horiz + pha + + lda temp2 ; print entry letter + clc + adc #'A' + jsr cout + inc temp2 ; goto next entry next pass + + lda #')' ; show a border + jsr cout + inc ch ; move over 1 space + +filt4 lda hdrbuf,y ; get data + php + jsr cout ; print data + iny + plp + bpl filt4 ; keep showing + + pla + clc + adc #19 + sta ch ; move over horiz position + + lda #' ' ; either wrap or move 1 space + jsr cout + jmp filt3 + +filt5 jsr print + db 1,20,0 + asc 'Cmd: A=Add, D=Delete, Q=Quit ? ',00 + + lda #1 + sta maxlen ; get command + lda #%10000000 + sta inpmode + jsr inpln + + lda lnbuf + cmp #'A' + bne :tryd + jmp fl_add +:tryd cmp #'D' + beq fl_del +:tryq cmp #'Q' + bne filt5 + jmp fl_quit + +*------------------------------- +* delete a word from list + +fl_del ldx #20 + jsr cleos ; clear line + jsr print + db 1,20,0 + asc 'Delete [A-',00 + + clc + lda temp2 + adc #'@' + jsr cout ; print range + + jsr print + asc '] ? ',00 + + lda #%10000000 + sta inpmode ; set mode + + jsr inpln ; get data + lda lnbuf + cmp #'A' + bcc filt5 ; move back, error + + sec + sbc #'A' ; make into [0-xxx] range + cmp temp2 + bcc *+5 + jmp filt5 ; out of range + + pha + tax + inx + jsr fndword ; locate second word + sty temp2+1 ; save offset + pla + tax + jsr fndword ; locate first word + ldx temp2+1 ; point to second word + +fl_del2 lda hdrbuf,x ; move data + sta hdrbuf,y + iny + inx + bne fl_del2 ; loop + jmp filt2 ; show new screen + +; add a word to list +fl_add ldx #20 + jsr cleos ; clear line + jsr print + db 1,20,0 + asc 'Enter new word: ',00 + + lda #16 ; 16 chars max length + sta maxlen + lda #%10000000 + sta inpmode ; set input mode + + jsr inpln ; get the data + lda lnbuf + cmp #'A' + bcc fl_add4 ; abort + + ldx temp2 ; get last word + jsr fndword ; find end + sty temp2+1 ; save current end + + ldx #0 +fl_add2 lda lnbuf,x + cmp #'A' + bcc fl_add3 + + sta hdrbuf,y ; add byte + inx + iny + bne fl_add2 ; and loop + + lda #0 + ldy temp2+1 ; mark old end of table + sta hdrbuf,y + + jsr print + db 1,20,0 + asc 'Error: Filter Table Overrun. Press [RETURN] ',00 + jsr getcr ; wait for cr +fl_add4 jmp filt5 ; get new data + +fl_add3 lda #0 ; mark end of table + sta hdrbuf,y + dey + lda hdrbuf,y ; mark as last char + ora #$80 + sta hdrbuf,y + jmp filt2 ; show new table + +; quit from filter changer +fl_quit ldx #20 + jsr cleos ; clear bottom of screen + jsr print + db 1,20,0 + asc 'Is the above table correct [Y/N] ? ',00 + jsr inpyn + bcc fl_save + jmp start ; nope! + +fl_save jsr logprg ; log to 'acos.obj' drive + ldx #gname ; setup name buffer + jsr movname + jsr open ; open file + + ldx #00 + lda filter ; position to filter table + jsr setmark + + ldx #hdrbuf + ldy #2 ; write 1 page (2 blocks) + jsr wrblk + jsr close ; thats it for now + jmp start + + +; locate a word [indexed by x] +fndword ldy #0 + cpx #0 ; we done? + beq fndwd2 ; yep + +fndwd1 lda hdrbuf,y ; loop until next word + beq fndwd4 ; end of table + + iny ; goto next byte + asl a ; check high bit + bcc fndwd1 + + dex ; count down entries + bne fndwd1 + +fndwd2 lda hdrbuf,y + beq fndwd4 ; opps, that is end marker + +fndwd3 clc + rts ; we are done + +fndwd4 sec ; opps, end of table + rts + +*------------------------------- +* Quit +*------------------------------- + +; quit the program +do_quit jsr $fc58 ; clear screen + sta $c051 ; goto text mode + + lda #$ff ; reset inverse flag + sta $32 + + + jsr mli + db $65 ; quit + dw p_quit + rts + + +p_quit db 4 + db 0 + dw 0 + db 0 + dw 0 + + diff --git a/Source/Config/Printer.S b/Source/Config/Printer.S index 9a5bd36..10dfa8f 100644 --- a/Source/Config/Printer.S +++ b/Source/Config/Printer.S @@ -1 +1,89 @@ -  ⠱㠧 ᠣ卍⠱㠧 䍠㠧 é䍠㠧 䍠㠧 򧬰䍠㠧 򧬰䍠㠧 䧬䍠㠧 姬䍠㠧 䧬䍠㠧 䧬䍠㠧 姬䍠㠧 䬰䍠㠧 ۱ 퍍𠣵썠𠣷𠣱썍ᠣᠣ􍍺ᠣ썠썠􍍺ᠣ􍍺ᠣ썠썍⠱㠧 򧬰䍠㠧 ۱ 퍠፠፠፠፺ᠠ 􍍠 卺ᠨ占堺ᠠ 덠 砻 󍍍 \ No newline at end of file +* Printer re-configuration +*------------------------------- + +nullprint ext ;null printer driver +serial ext ;serial/cout printer driver +grappler ext ;parallel grappler printer driver +parallel ext ;parallel printer driver + +re_pr jsr TopBox + jsr print + db 1,3,10 + asc '- Printer Interfaces -',00 + + jsr cls + ldx #start + jsr escape + + jsr print + db 1,7,0 + asc ' 1 - Apple //c built-in port',0d + asc ' 2 - Apple Super Serial Card (SSC)',0d + asc ' 3 - Apple IIgs built-in port',0d + asc ' 4 - Generic Printer Driver',0d + asc ' 5 - Star Micronics Grafstar',0d + asc ' 6 - Orange Micro Grappler card',0d + asc ' 7 - Apple Parallel interface',0d + asc ' 8 - Epson APL printer card',0d + asc ' 9 - Appricorn Parallel card',0d + asc '10 - Tyvec Printer Interface',0d + asc '11 - No Printer in system',0d,0d + asc 'Which? [1-11] ',00 + + ldx #11 ;get printer # + jsr inpnum + + cmp #5 + blt :serial + cmp #7 + blt :grappler + cmp #11 + blt :parallel + +:null lda #nullprint + sta point0+1 + jmp :noslot + +:serial lda #serial + jmp :getslot + +:grappler lda #grappler + jmp :getslot + +:parallel lda #parallel + +:getslot sta point0 + stx point0+1 + + jsr print + db 1,20,0 + asc 'Which slot/port does your printer',0d + asc 'use? [1-7] ',00 + + ldx #7 ; get slot + jsr inpnum + asl a + asl a + asl a + asl a +:noslot pha ;save slot + + ldy #0 ;move the single page +:loop lda (point0),y ;source + sta prdrv,y ;destination + iny + bne :loop + + pla ;get the slot back + sta prdrv + + jsr chinit ; check for init + jmp wrtchg ; write the changes + + diff --git a/Source/Config/Printers/Grappler.S b/Source/Config/Printers/Grappler.S index f07cf58..371f4bf 100644 --- a/Source/Config/Printers/Grappler.S +++ b/Source/Config/Printers/Grappler.S @@ -1 +1,68 @@ - 捍썠ፍ􍍪砤㰰 ⠤򍍪 󠠻 䍍 ፠ᠤ㰸 䠣 򠣥 捠 ፠፠䠣捠ᠤ㰸 ፠ᠣ栻 ፠󍍪 婍󍍍⠰ \ No newline at end of file +******************************** +* * +* Grappler Printer Driver * +* * +******************************** + +*------------------------------- +* Date: 12/07/86 +*------------------------------- + lst off + + rel + dsk rel/grappler + +cr equ $0d +lf equ $0a + +grappler ent + +*------------------------------- + + org $c00 +; jump table +slot db $10 + + jmp init + jmp print + jmp clear + +*------------------------------- +* init printer + +init rts ; no init code needed + +*------------------------------- +* print character: A = character + +print pha + stx save_x + + ldx slot +print2 lda $c080,x ; check printer status + and #%00000111 ; check busy/wait bits + eor #%00000011 ; turn all bits off + bne print2 ; wait to come ready + + pla + pha + and #$7f + sta $c080,x ; print data + cmp #cr + bne print3 + + lda #lf ; add lf to cr + ldx save_x + jsr print + +print3 ldx save_x ; finish up + pla + rts + +*------------------------------- +* clear print buffer (not available) + +clear rts + + +save_x db 0 diff --git a/Source/Config/Printers/Null.S b/Source/Config/Printers/Null.S index 36fc0ae..1863778 100644 --- a/Source/Config/Printers/Null.S +++ b/Source/Config/Printers/Null.S @@ -1 +1,32 @@ - 捍썠썍􍍠砤㰰 ⠤򍍻 󍍻 󍍻 婍 \ No newline at end of file +******************************** +* * +* No Printer Driver * +* * +******************************** + +*------------------------------- +* Date: 01/03/86 +*------------------------------- + lst off + + rel + dsk rel/null + +nullprint ent + + org $c00 +; jump table +slot db $10 + + jmp init + jmp print + jmp clear + +; init printer +init rts + +; print character: A = character +print rts + +; clear print buffer (not available) +clear rts diff --git a/Source/Config/Printers/OLD/Printers.S b/Source/Config/Printers/OLD/Printers.S index 35fc511..1ac9a9d 100644 --- a/Source/Config/Printers/OLD/Printers.S +++ b/Source/Config/Printers/OLD/Printers.S @@ -1 +1,68 @@ - ﺍ ᰰ ⰰ 㰰 䰰 砤 ፍ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠤㠧 ⠰܍砤ᰰ砤㰰썠܍砤ⰰ砤㰰܍砤㰰砤㰰썠܍砤䰰砤㰰썍󍍍 \ No newline at end of file +******************************** +* * +* Printer Header Block * +* * +******************************** + +*------------------------------- +* Date: 01/06/87 +*------------------------------- +* +* load info: +* +* $800 = header ;offset +* $a00 = parallel printer ;2 +* $b00 = grappler ;3 +* $c00 = cout based ;4 +* $d00 = no printer ;5 + + org $0800 + +* Equates +* ~~~~~~~ + +cr equ $0d +lf equ $0a + + db $04,$01 + asc 'Apple //c Printer Port ' + db $02,$01 + asc 'Apple Parallel Interface ' + db $04,$01 + asc 'Apple Super Serial Card ' + db $02,$01 + asc 'Epson APL Printer Card ' + db $02,$01 + asc 'Tyvec Printer Interface ' + db $02,$01 + asc 'Appricorn Parallel Card ' + db $03,$01 + asc 'Star Micronics Grafstar ' + db $03,$01 + asc 'Orange Micro Grapler Card ' + db $04,$01 + asc 'Generic Printer Driver ' + db $85,$01 + asc 'No Printer in System ' + db 00,00 + ds \ + + org $0a00 + org $0c00 + put /merlin/gbbs/printer/parallel + ds \ + org $0b00 + org $0c00 + put /merlin/gbbs/printer/grappler + ds \ + org $0c00 + org $0c00 + put /merlin/gbbs/printer/serial + ds \ + org $0d00 + org $0c00 + put /merlin/gbbs/printer/null + + sav /gbbs.pro/printers + + diff --git a/Source/Config/Printers/Parallel.S b/Source/Config/Printers/Parallel.S index eac1189..8eb76e7 100644 --- a/Source/Config/Printers/Parallel.S +++ b/Source/Config/Printers/Parallel.S @@ -1 +1,70 @@ - 捍썠썍ፍ􍍪砤㰰⠤򍍪𠴍፠ލ㍠㠣㰠 占󍍪 ፠ᠤ㱠 卍፠፠ 䠣捠ᠤ㰸 ፠ᠣ栻 ፠󍍪⠰ \ No newline at end of file +******************************** +* * +* Parallel Printer Driver * +* * +******************************** + +*------------------------------- +* Date: 12/07/86 +*------------------------------- + lst off + + rel + dsk rel/parallel + +cr equ $0d +lf equ $0a + + +parallel ent + +*------------------------------- + + org $c00 + +slot db $10 + + jmp init + jmp print + jmp clear + +*------------------------------- + +init lda slot + lup 4 + lsr a + --^ + clc + adc #$c0 ; get $Cx value + sta print2+2 + rts + +*------------------------------- +* print character: A = character + +print pha + stx save_x +print2 lda $c1c1 ; is printer ready? + bmi print2 ; nope + + pla + pha + ldx slot ; get offset + and #$7f + sta $c080,x ; print data + cmp #cr + bne print3 + + lda #lf ; add lf to cr + ldx save_x + jsr print + +print3 ldx save_x ; finish up + pla + rts + +*------------------------------- + +clear rts + +save_x db 0 diff --git a/Source/Config/Printers/Serial.S b/Source/Config/Printers/Serial.S index 5e9db25..d638c6f 100644 --- a/Source/Config/Printers/Serial.S +++ b/Source/Config/Printers/Serial.S @@ -1 +1,124 @@ - 捍썠썍ፍ􍍠砤㰰 ⠤򍍪 ፠ᠣ 䍠獠፠󍍪 𠠻 鍠ᠠ ᠤ㰸 󍍠ᠤ 捠砻 俍 ᠤ 䍠𠴍ᠻ 􍠭ލ㍠㠣㰍ᠤ 㱰ᠣ 䍠ᠤ ᠤ ᠤ㱰ᠤ 占ᠤ砻 􍍠ᠣɧ ᠣᠣᠣΧᠣᠣ ᠤᠠ ፠􍍠 占ᠤᠤ㰸 䍠ᠤ㰸 ፠𠠻 ᠣ 㰰 卍 婍󍍍⠰⠰⠰󠤱 \ No newline at end of file +******************************** +* * +* Serial Printer Driver * +* * +******************************** + +*------------------------------- +* Date: 12/07/86 +*------------------------------- + lst off + + rel + dsk rel/serial + +cr equ $0d +lf equ $0a + +serial ent + + org $c00 + +*------------------------------- +; jump table +slot db $10 + + jmp init + jmp print + jmp clear + +*------------------------------- +* flag init status for output + +init pha + lda #0 ; signal that printer not init'ed + sta initflg + pla + rts + +*------------------------------- +* print character: A = character + +print php ; disable int's + sei + pha ; save all reg's + stx save_x + sty save_y + lda $c082 ; enable roms + + ldx #$13 +print1 lda $24,x ; save zero page stuff + sta zero,x + dex + bpl print1 + + bit initflg ; has printer been used? + bmi print3 ; yep + + lda slot + sta $26 ; save slot for card + lup 4 + lsr a ; move down slot + --^ + clc + adc #$c0 + sta print2+2 + sta $37 ; point ($0036) at $c100 + + lda #0 ; init printer card + tax + tay + sta $24 ; zero horiz offset + sta $27 ; zero character buffer + sta $36 +print2 jsr $c100 + lda $36 ; point to output routine + sta jprint+1 + lda $37 + sta jprint+2 + dec initflg ; show we have done init + + lda #'I'-$40 ; send ctrl-I 80 n + jsr doprint + lda #'8' + jsr doprint + lda #'0' + jsr doprint + lda #'N' + jsr doprint + lda #cr + jsr doprint + +print3 lda #0 ; set ch over to border + sta $24 + pla ; get byte to print + pha + jsr doprint + + ldx #$13 +print4 lda zero,x ; restore zero page + sta $24,x + dex + bpl print4 + + lda $c083 ; enable ram card + lda $c083 + ldx save_x ; restore reg's + ldy save_y + pla + plp ; restore int status + rts + +doprint ora #$80 ; print with high-bit set +jprint jmp $c000 ; do output routine + + +; clear print buffer (not available) +clear rts + + +save_x db 0 +save_y db 0 +initflg db 0 + +zero ds $14 diff --git a/Source/Config/Pstor.S b/Source/Config/Pstor.S index f1dcec2..442bde8 100644 --- a/Source/Config/Pstor.S +++ b/Source/Config/Pstor.S @@ -1 +1,250 @@ - ᠣ捠ᠣ捠𫱍 𲠻 𲫱 占ᠨ𲫱򳍍㍠ 㠣𫱍㠣𫱍𲠻 𲍠𠣱 򲠻 卍⠱㠧 󍍠 占ᠣ 占򵠻 ⠱㠧 ѽ ᠣ堻 ᠣ  捠𠣧ѧ 򷠻 򹠻 ㍠㠣 占𠣱 뿍򶠻 卍፠  卍 荍፠㍠㠣 㠧 ᠣ 썠ᠣ卍歱𠣧 荠捍ᠣ 荠歱栻 򸠻卍⠱㠧 ٯ  ᠻ 卍ᠠ ᠨ𴩬򴠻 占ᠨ𴩬ፍ 荠፠ᠨ𴩬ᠣ 荠ᠨ𴩬򴠻 󍍍 퍠⠱㠧 ٯ ᠻ 卍ᠣ捠 ᠣ捠𫱍𲠻 ᠨ𲫱 荍ᠨ ፠氠 뿍䠻 獍𲫱 荠㍍㍠㠣 䍠𫱍㠣𫱍 䍠𲍠𲠻 𠣱⠻ 砻 덍㠧 䬰䍠㠧 㠧 䬰䍠㠧 宧⠱㠧 宮 占򴠻 捍 ᠣ 𴍠፠፠𴠻 ㍠㠣捠𴫱 荠󍍍 ፠㍠㠣 占􍍠ᠣ 􍍠ᠣ 占􍍠 ፠ᠨ𴩬𲫱 ᠨ𴩬 占 𲫱 獍㍠㠠 ፠󍍍 \ No newline at end of file +******************************** +* * +* GBBS Config - Prodos Storage * +* * +******************************** + +*------------------------------- +* Date: 3/11/88 +*------------------------------- + +re_stor jsr cls ; clear screen + + lda #hdrbuf + sta temp+1 + + ldx #0 ; start pointers + ldy #0 + sty temp2 ; set device count at zero +stor2 lda devnam,x ; get drive info + sta temp2+1 + +stor3 lda devnam,x ; copy pathname + sta (temp),y + inx + iny + dec temp2+1 + bpl stor3 + + clc + lda temp ; go to next address + adc #128 + sta temp + lda temp+1 + adc #0 + sta temp+1 + + ldy #0 + inc temp2 ; inc number of pathnames + lda temp2 + cmp #12 ; done all 12? + bne stor2 ; nope + +stor4 jsr TopBox + jsr print + db 1,3,2 + asc '- Edit Drive Specifier Allocation -',00 + jsr cls + + ldx #-1 +stor5 inx + jsr shwpfx ; show drive + lda #cr ; add end of line + jsr cout + cpx #11 + bcc stor5 ; show all 12 entries + +stor6 jsr print + db 1,20,0 + asc 'Edit: [A-L] or Q=Quit ? ',00 + + lda #%10000000 + sta inpmode ; set mode 0 + lda #1 + sta maxlen ; set length to 1 + + jsr inpln ; get input + lda lnbuf + cmp #'Q' ; quit? + bne stor7 ; yep + + jmp stor9 ; handle quit + +stor7 sec + sbc #'A' ; make into range + cmp #12 ; is it ok? + bcs stor6 ; nope + + pha + tax + jsr finddrv ; find the drive location + + ldx #20 + jsr cleos ; claer last line + + ldx #20 ; position + stx cv + ldx #0 + stx ch + + pla + clc + adc #'A' ; show drive specifier + jsr cout + jsr print + asc ': /',00 + + lda #30 ; make max length 32 total + sta maxlen + lda #%10100001 + sta inpmode + + jsr inpln + lda lnbuf-1,y + cmp #'/' ; check for ending slash + bne stor7f + + lda #cr ; delete ending slash + sta lnbuf-1,y + +stor7f lda lnbuf ; did they just do a return? + cmp #cr + bne stor8 ;nope + + jsr print + db 1,20,0 + asc 'Clear contents of this line [Y/N] ? ',00 + + jsr inpyn ; get answer + bcs stor7a ; nope + + ldy #0 + tya ; nullify an entry + sta (temp4),y +stor7a jmp stor4 ; do another + +stor8 ldx #0 + ldy #2 +stor8a lda lnbuf,x ; copy pathname + sta (temp4),y + inx + iny + cmp #cr + bne stor8a + + ldy #0 ; save length + txa + sta (temp4),y + iny + lda #'/' ; add leading slash + sta (temp4),y + jmp stor4 ; show results + + +stor9a jmp start ; abort out + +stor9 ldx #20 + jsr cleos ; clear bottom + jsr print + db 1,20,0 + asc 'Is the above correct [Y/N] ? ',00 + jsr inpyn + bcs stor9a ; nope + + lda #hdrbuf + sta temp+1 + + ldx #0 + ldy #0 + sty temp2 ; start with drive A: +stor9b lda (temp),y + sta temp2+1 ; save length + +stor9c lda (temp),y ; get data + sta devnam,x + inx + cpx #$f0 ; is table ok? + beq stor9d ; nope, it is too big + + iny + dec temp2+1 ; count down length + bpl stor9c + + clc + lda temp + adc #$80 ; go to next field + sta temp + lda temp+1 + adc #0 + sta temp+1 + + ldy #0 ; reset pointer within field + inc temp2 + lda temp2 ; done all 12 yet? + cmp #12 + bne stor9b ; nope, loop + jmp wrtchg ; write changes to disk + +stor9d jsr cls + jsr print + asc 'ERROR !',0d,0d + asc 'Overflow error. Too much data within ' + asc 'drive table. Cut down on the amount',0d,0d + asc 'of data within the table.' + db 1,20,0 + asc 'Press [RETURN] to continue... ',00 + +stor9e jsr rdkey ; wait for a return + cmp #cr + bne stor9e + jmp stor4 ; get new stuff + + +; point to the pathname of a device +finddrv lda #0 ; set lower to 0 + sta temp4 + txa + lsr a + ror temp4 ; put extra into low + clc + adc #>hdrbuf + sta temp4+1 ; setup high + rts + + +; show a pathname of a device +shwpfx jsr finddrv ; position + txa + clc + adc #'A' ; show drive name + jsr cout + + lda #':' ; add colon + jsr cout + + lda #' ' ; put in space + jsr cout + + ldy #0 ; check for data + lda (temp4),y + sta temp2+1 + beq prdrv3 ; nope, there isnt any + +prdrv2 iny + lda (temp4),y ; get byte of name + jsr conv + jsr cout ; show it + dec temp2+1 + bne prdrv2 ; keep going + + clc + rts + +prdrv3 sec ; no data + rts + + diff --git a/Source/Config/Routine.S b/Source/Config/Routine.S index 7beab7d..6df731f 100644 --- a/Source/Config/Routine.S +++ b/Source/Config/Routine.S @@ -1 +1,720 @@ - 􍪭堻 嫱፠ ፠፠ ᠨ ፠𠣱ፍ 荠፠ ፠ 獍占嫱 󍪭ᠨ𲍠󍍪 堻 占ᠣ捠 䍍ᠤ㰰 ᠤ㰱 獠䠣捠𠣱 忍 卍獠򠣤栻 獠獠 𠣧˧ 占ᠣۧ 𠣧̧ 占ᠣܧ 詍𠣧ϧ 占ᠣ栻 婍砻 忍 卍𠣧 쿍 𠣤  婍 㠠 㠣ᠤ㰳ᠤ㰳 덍፠ᠣ ፠占占峠 占⠰ 􍪭   占 썠젻 占 𿍠 卍፠ 占 ፠ 썠 獠𠣧 򮮮 荠堻 ᠻ 卍 堻 占𠣧 ፠𠣧  占 占  ᠣ   卍堻 忍䠣  堻 򿍠䠣 卍ᠣ 󍍍⠥ ۱ ᠣ 荠 ᠣ堻  占ᠣ 栻 ፠㍠㠣𠣱 忍 卍 썍櫱 ፠㍠㠣𠣱 忍 卍 ㍠㠣 퍍 忍 졍荠 ⠰ 卪ᠣ 占ᠣ ᠣ􍍪 ᠣ 蠻 𫱍ᠣ卍 占捠𠣧٧ ӧ ㍠ 𠣧Χ ϧ ㍠ 荠𫱠 忍 󍍪 卪䠣栻 荠𠣧᧠ ᧿ 𠣧 㠣栻 󍍪 𫱍፠ᠠ 卍  占 忍 ᠨ 𫱍ᠠ 占 卍ᠨ 占 𫱍 𫱍󍍪 卪 𫱍፠ᠠ 卍  占 忍 占ᠨ 𫱍ᠠ 占 卍ᠨ 占 𫱍 𫱍󍍪 ؍ 𫱠 ፠𲍠፠䠣栻 𲫱 荍ᠨ ፠䠣栻 荠𲠻 忍򳠻 卍𲫱 忍򴠻 򲍍𲠻 忍򴠻 򲍍፠㍠ ᠣ𫱍󍍪 ؍ 𫱠 ፠𲍠፠䠣栻 𲫱 荍ᠨ ፠䠣栻 荠𲠻 忍򳠻 卍𲫱 忍򴠻 򲍍𲠻 忍򲠻 卍፠㍠ ᠣ𫱍󍍪 􍪭ᠨ𴩬 忍㍠ᠨ𴩬 占嫱𠣰堻 荍፠㍠𴠻 荠𴍠𴫱㠣𴫱󍍪 ۰ݍ㸠 𠣱ᠻ 卍㠣  㠣 占፠㠣 󠠻 卍 ۰ݍ𠣧 ᅪፍ ፠ 󍍪 ح ݍ 򫱍ᠣ ᠨ 䠣栻 荠㍠㠣 占𠣧 卍 占堪򫱍 ᠣ㠠 퍠 퍠  占󍍪 ۰ ݍ ᠣ䍠 퍠  䠠 썠 䠣捠 ᅪ ᅪ ㍠㠣 占 荠퍠⠰⠰ 򍪭 𠣰 򿍠岠 򫱠 򫲍򫳠 ᠣ 岠󍍻 峠 俍嵠 卍፠䠣栻 򿍠㍠崠 卍򫱠 򫲍𫱍򫳍󠠻 덠፠ᠠ 덠𩠻 썍崠嵠⠰ 򍪭 ᠣ퍠 򍍪 ⠱㠧 宮堺󍍪 卪⠱㠧 宧粠 种𠣧ǧ糍𠣧粍糠󍍪 卪 덠􍍪 卪 忍 卍ᠠ 占󠠻 򍍍 \ No newline at end of file +******************************** +* * +* Config Program - Routine * +* * +******************************** + +*------------------------------- +* Date: 3/11/88 +*------------------------------- + + +*------------------------------- +* print a line of text +*------------------------------- + +print sta psave ; save all reg's + sty psave+1 + pla + sta prnt ; point to address of data + pla + sta prnt+1 + +print2 inc prnt ; inc address + bne print3 + inc prnt+1 + +print3 ldy #0 + lda (prnt),y ; get data + cmp #1 + bne pr3a + +pr3v jsr gettmp + jsr gettmp ; get horiz/vert address + sta cv + jsr gettmp + sta ch + jmp print3 + +pr3a pha + jsr cout ; display it + pla + bne print2 ; keep going + + jsr gettmp + lda psave + ldy psave+1 + jmp (prnt) + +*------------------------------- +* get a byte from temp and advance pointers +*------------------------------- + +gettmp ldy #0 + lda (prnt),y + inc prnt + bne gettmp2 + inc prnt+1 +gettmp2 rts + +*------------------------------- +* put a cursor, get a key, remove cursor, return +*------------------------------- + +rdkey stx x_save ; save x & y + sty y_save + lda #$5f + jsr plotchr ; bypass cout for speed + +rdkey2 lda $c000 ; check for a key + bpl rdkey2 + sta $c010 ; reset flag + and #$7f + cmp #1 ; case toggle? + bne rdkey3 ; nope + + lda caseflg + eor #$ff ; toggle case flag + sta caseflg + jmp rdkey2 ; get another key + +rdkey3 cmp #'K'-$40 ; ctrl-k ? + bne rdkey4 ; nope + lda #'[' ; translate (backbracket) + +rdkey4 cmp #'L'-$40 ; ctrl-l ? + bne rdkey5 ; nope + lda #'\' ; translate (backslash) + +rdkey5 cmp #'O'-$40 ; ctrl-o ? + bne rdkey6 ; nope + lda #$df ; translate (underscrore) + +rdkey6 bit caseflg ; change case? + bpl rdkey7 ; nope + + cmp #'@' ; control or special? + bcc rdkey7 ; yep + + cmp #$5B ; out of range? (real lower case) + bcs rdkey7 ; yep + + clc ; put into lower group + adc #$20 + +rdkey7 sta $c030 + sta $c030 ; audio feedback + + pha + lda #' ' ; remove cursor + jsr plotchr + pla + ldx x_save + ldy y_save + jsr escape3 ; check for escape + rts + +caseflg db 0 + +*------------------------------- +* get a line of input +*------------------------------- + +inpln ldy #0 ; start at first byte +inpln1 jsr rdkey ; get data +inpln1a cmp #cr ; return + beq inpln6 + cmp #bs ; back space + beq inpln2 + cmp #can ; ctrl-x / cancel + beq inpln2 + cmp #del ; delete + bne inpln3 + +inpln2 cpy #0 ; can we back up? + beq inpln1 ; nope + + pha + jsr prbs ; backspace w/delete + dey ; decrease line count + pla + cmp #can ; if its a cancel + beq inpln2 ; keep going + bne inpln1 + +inpln3 cmp #' ' ; if its a control char... + bcc inpln1 + + cpy maxlen ; check for max length + bne inpln4 + jmp inpln1 + +inpln4 bit inpmode ; do we convert? + bpl inpln4a ; nope + + jsr conv ; convert to upper + +inpln4a bit inpmode ; check the inpmode + bvc inpln5 + + cmp #',' ; dont accept a comma + beq inpln1 + cmp #' ' + bne inpln5 ; dont accept a space + cpy #0 ; for first char of the line + beq inpln1 + +inpln5 sta lnbuf,y ; save char + iny + jsr cout ; print it + jmp inpln1 ; loop + +inpln6 lda #cr + sta lnbuf,y ; save the return + cpy #0 ; was is just a return? + bne inpln7 ; nope + + lda inpmode ; can we accept a blank line? + and #$20 + bne inpln7 ; yep + + jmp inpln ; dont take, cr, start over + +inpln7 lda inpmode ; do cr? + and #$10 + bne inpln8 ; nope + + lda #cr + jmp cout ; print the return and exit + +inpln8 rts + + +inpmode db %00000000 + +*------------------------------- +* input a number in the range [1-x] where x={1-99} +*------------------------------- + +inpnum stx maxnum ; save maximum number + lda #2 + sta maxlen ; set length at 2 + lda ch + sta prnt+1 ; record currnt horiz offset + lda #%00010000 + sta inpmode ; use input mode 0 + +inpnum2 jsr inpln ; get line + lda #0 + sta prnt ; make number init to 0 + + lda lnbuf ; get data + sec + sbc #'0' + cmp #10 ; in range? + bcs inpnum5 ; nope, we are done + + sta prnt ; update total + + lda lnbuf+1 ; get more data + sec + sbc #'0' + cmp #10 ; in range? + bcs inpnum5 ; nope + +inpnum3 dec prnt ; count down 10's + bmi inpnum4 + + clc + adc #10 ; add 10 and loop + bcc inpnum3 + +inpnum4 sta prnt ; save new total +inpnum5 lda prnt + beq inpnum7 ; opps, problem + + cmp maxnum ; is it in range? + bcc inpnum8 + beq inpnum8 ; all is well! + +inpnum7 lda ch + cmp prnt+1 ; at original spot? + beq inpnum2 ; yep + + jsr prbs ; backup + jmp inpnum7 + +inpnum8 rts + +maxnum db 0 + +*------------------------------- +* print a backspace +*------------------------------- + +prbs lda #bs ; do a backspace w/delete + jsr cout + lda #' ' + jsr cout + lda #bs + jmp cout + +*------------------------------- +* input a 'y' or a 'n' for a yes/no situation +*------------------------------- + +inpyn lda #1 ; max length 1 + sta maxlen + lda ch ; save horiz position + sta temp+1 + lda #%10010000 + sta inpmode + +inpyn2 jsr inpln ; get the line + lda lnbuf + cmp #'Y' ; did they say 'YES' ? + clc + beq inpyn3 ; yep + + cmp #'N' ; did they say 'NO' ? + sec + beq inpyn3 ; yep + + lda ch + cmp temp+1 ; are they the same? + beq inpyn2 + + jsr prbs ; backup + jmp inpyn2 + +inpyn3 rts + +*------------------------------- +* convert a character to uppercase +*------------------------------- + +conv and #$7f ; strip high + cmp #'a' ; below 'a'? + bcc conv2 ; yep + + cmp #'z'+1 ; above 'z'? + bcs conv2 ; yep + + sbc #$1f ; use clear carry for sbc $20 +conv2 rts + +*------------------------------- + +copyinp stx temp ; point to dest + sta temp+1 + tya + pha ; save ending byte + + ldx #0 ; start offsets + ldy #0 +copyin2 lda lnbuf,x ; get byte + inx + cmp #cr ; we done? + beq copyin3 ; yep + + sta (temp),y ; copy and inc pointers + inc temp + bne copyin2 + inc temp+1 + bne copyin2 + +copyin3 pla ; get back ending byte + beq copyin4 ; opps, there wasnt one + + sta (temp),y ; save ending byte + inc temp + bne copyin4 ; inc pointers + inc temp+1 + +copyin4 ldx temp ; return pointers + lda temp+1 + rts + +*------------------------------- +* copy a line of input to some location uppercase +*------------------------------- + +ucopyinp stx temp ; point to dest + sta temp+1 + tya + pha ; save ending byte + + ldx #0 ; start offsets + ldy #0 +ucopyin2 lda lnbuf,x ; get byte + inx + cmp #cr ; we done? + beq ucopyin3 ; yep + + jsr conv ; convert to uppercase + sta (temp),y ; copy and inc pointers + inc temp + bne ucopyin2 + inc temp+1 + bne ucopyin2 + +ucopyin3 pla ; get back ending byte + beq ucopyin4 ; opps, there wasnt one + + sta (temp),y ; save ending byte + inc temp + bne ucopyin4 ; inc pointers + inc temp+1 + +ucopyin4 ldx temp ; return pointers + lda temp+1 + rts + +*------------------------------- +* print a string pointed by A & X +* if y<128, use length = y +* if y>127, stop at chr$(y) +*------------------------------- + +prstr stx temp + sta temp+1 ; point to data + sty temp2 + tya + and #$7f ; (was $7d ???) + sta temp2+1 ; save possible length + + ldy #0 +prstr2 lda (temp),y ; get data + and #$7f ; clear high + iny + + bit temp2 ; use which compare? + bpl prstr3 ; other one + + cmp temp2+1 ; are we done? + beq prstr4 ; yep + + jsr cout ; show and loop + jmp prstr2 + +prstr3 cpy temp2 ; done? + beq prstr4 ; yep + + jsr cout + jmp prstr2 + +prstr4 tya + clc + adc temp ; compute next address + tax + lda #0 + adc temp+1 + rts + +*------------------------------- +* skip a string pointed by A & X +* if y<128, use length = y +* if y>127, stop at chr$(y) +*------------------------------- + +skipstr stx temp + sta temp+1 ; point to data + sty temp2 + tya + and #$7f ; (was $7d ???) + sta temp2+1 ; save possible length + + ldy #0 +skstr2 lda (temp),y ; get data + and #$7f ; clear high + iny + + bit temp2 ; use which compare? + bpl skstr3 ; other one + + cmp temp2+1 ; are we done? + beq skstr4 ; yep + + jmp skstr2 + +skstr3 cpy temp2 ; done? + bne skstr2 ; nope + +skstr4 tya + clc + adc temp ; compute next address + tax + lda #0 + adc temp+1 + rts + +*------------------------------- +* get names from a list +*------------------------------- + +getname ldy #0 + lda (temp4),y ; we done? + sec + beq getnam3 + +getnam2 lda (temp4),y ; copy name + sta flname+1,y + iny + cmp #0 + bne getnam2 + + dey + sty flname ; save length + + tya + sec + adc temp4 ; update length + sta temp4 + lda temp4+1 + adc #0 + sta temp4+1 + clc +getnam3 rts + +*------------------------------- +* translate a binary to text [0-99] +*------------------------------- + +bindec8 ldy #0 ; start 10's counter +bin8 cmp #10 + bcc bin8a ; less than 10, were done + + sbc #10 ; minus 10 + iny ; add 1 to the 10's counter + bne bin8 ; loop + +bin8a adc #'0' ; make 1's into text + tax ; save + tya + adc #'0' ; make 10's into text + rts ; were done + +*------------------------------- +* print out a translated binary [0-99] +*------------------------------- + +decout8 cmp #'0' ; are 10's zero? + beq out8a + + jsr cout ; print it +out8a txa + jmp cout ; print 1's + +*------------------------------- +* input a number [X-A point to text] +*------------------------------- + +numin stx numptr ; point to text + sta numptr+1 + lda #0 + sta num ; zero totals + sta num+1 + +numin2 ldy #0 + lda (numptr),y ; get digit + and #$7f ; clear high + sec + sbc #'0' ; make in 0-9 range + cmp #'9'+1 + bcs numin4 ; opps, we are done + + inc numptr ; point to next byte + bne *+4 + inc numptr+1 + + sta num+2 ; save digit + lda #0 + sta num+3 + + ldx #10 +numin3 clc ; num = num + num2 + lda num + adc num+2 + sta num+2 + lda num+1 + adc num+3 + sta num+3 + dex + bne numin3 ; num = num * 10 + + lda num+2 ; move result + sta num + lda num+3 + sta num+1 + jmp numin2 ; loop + +numin4 ldx num ; return value + lda num+1 + rts + +*------------------------------- +* display a decimal number [0 to 65535] +*------------------------------- + +decmem stx num ; save number + sta num+1 + + lda #0 + sta num+2 + sta num+3 + sta num+5 + sta num+6 + + sed + ldy #$10 ; use decimal mode +decmem2 asl num + rol num+1 + lda num+2 + adc num+2 ; do actual 'woz' conversion + sta num+2 + lda num+3 + adc num+3 + sta num+3 + rol num+4 + dey ; loop down + bne decmem2 + + cld ; done with decimal + ldy #4 ; print 5 digits + +decmem3 lda num+4 ; get digit + and #$0f + bne decmem4 ; is it zero? + + bit num+5 ; is this a leading zero? + bpl decmem5 ; yep + +decmem4 dec num+5 + clc + adc #'0' ; print digit + ldx num+6 + sta txtnum+1,x ; save number to memory + inc num+6 + +decmem5 ldx #3 ; move up next digit +decmem6 asl num+1 + rol num+2 + rol num+3 + rol num+4 + dex + bpl decmem6 + + dey ; count down digits + bmi decmem7 + bne decmem3 + + stx num+5 ; print last zero for sure + bpl decmem3 +decmem7 lda num+6 ; save number length + sta txtnum + rts + +num db 0,0,0,0,0,0,0 +txtnum db 0,0,0,0,0,0 + +*------------------------------- +* escape handler +*------------------------------- + +escape sta escadr ; possible reset + cmp #0 ; turn off handler? + beq escape2 ; yep + + stx escadr+1 ; save escape address + sta escadr+2 + tsx + stx escadr+3 ; save stack location + lda #-1 + sta escadr ; turn on handler +escape2 rts + +; check for esc and handle if needed +escape3 bit escadr ; is handler enabled? + bpl escape5 ; nope + + pha + and #$7f ; did escape occur? + cmp #esc + bne escape4 ; nope + + lda escadr+1 ; setup jump location + sta temp + lda escadr+2 + sta temp+1 + ldx escadr+3 + txs ; reset stack + pla + pla ; restore stack + jmp (temp) ; change program control + +escape4 pla +escape5 rts + +escadr db 0,0,0,0 + +*------------------------------- +* print a number +*------------------------------- + +prnumb jsr decmem ; convert number + ldx #txtnum+1 + ldy txtnum + iny ; display it + jmp prstr + +*------------------------------- +* wait for a return +*------------------------------- + +getcr jsr print + db 1,22,0 + asc 'Press [RETURN] to continue...',00 + +:loop jsr rdkey + cmp #cr + bne :loop + rts + +*------------------------------- +* wait for a 'g'o message +*------------------------------- + +getg jsr print + db 1,20,0 + asc 'Press [G] when diskette is online.',00 + +getg2 jsr rdkey ; wait for 'g' + jsr conv + cmp #'G' + beq getg3 + cmp #'*' + bne getg2 + brk +getg3 rts + +*------------------------------- +* write the changes back into the 'g' file +*------------------------------- + +wrtchg jsr cls + jsr svacos ; write configuration back to disk + jmp start + +*------------------------------- +* check to see if in init mode +*------------------------------- + +chinit bit init ; in init mode? + bpl chinit2 ; nope + + pla ; return to init routine + pla +chinit2 rts ; return to caller + + diff --git a/Source/Config/Start.S b/Source/Config/Start.S index 7bc456d..bf6fb70 100644 --- a/Source/Config/Start.S +++ b/Source/Config/Start.S @@ -1 +1,126 @@ - ᠤ㰵 占ᠤðŠ 捠ðᠣ ᠣ򠣤ư 덠󍍠 򍍍 獍 ⠱㠧 짬䍠㠧 䧬䍠㠧 䬰䍠㠧 ԧ䬰䬰䍠㠧 忧䍠㠧ٯ  獍 占 獍砻 ᠣ 퍠占堻  㠧 䬰䍠㠧 䍠㠧 溺䍠㠧 򧬰䍠㠧 맬䍠㠧 姬䍠㠧 򧬰䍠㠧 溺䍠㠧 䍠㠧 䍠㠧 姬䬰䍍㠧 ۱ ۱ݍ퍍፠ᠣ堻 占፠፠ 퍠䍠덠썠􍍪 ⠱㠧 ⠱㠧 䧬󍍪⠰⠵㠧ӧ⠸㠧Ӯʧ \ No newline at end of file +******************************** +* * +* Config Program - Start * +* * +******************************** + +*------------------------------- +* Date: 5/29/91 +*------------------------------- + +begin sta $c051 ;text mode + sta $C00E ;Turn MouseText off + bit $C082 + + lda #do_quit + sta reset+1 + eor #$A5 + sta reset+2 + + ldx #$F0 ;reset stack + txs + + jsr findcon ;find the config disk,logit + jsr VideoStartup ; Init the video driver + + + jsr do_main + +* jmp loadg ;force to reconfig + + jsr cls ; clear screen + jsr print + db 1,7,0 + asc 'When you do an initial configure, all',0d + asc 'previous data will be destroyed and',0d + asc 'replaced with the new configuration.',0d + asc 'All old data will be lost.',0d,0d,0d + asc 'Do you want to do an Initial Configure?',0d + asc '[Y/N] ',00 + + jsr inpyn ; input yes/no + bcs loadg + + jsr ldacos ; load in acos file + jmp doinit ; do initial config + +*------------------------------- + +loadg jsr ldconfg ; load config segment + +start lda #0 ; turn off escape handler + sta refnum + jsr escape + jsr close ; close all files + jsr logcon + + jsr do_main + + jsr cls ; clear screen + jsr print + asc 'Select an Option:',0d,0d + asc ' 1 - Reconfigure Modem',0d + asc ' 2 - Reconfigure Video',0d + asc ' 3 - Reconfigure Printer',0d + asc ' 4 - Reconfigure Clock',0d + asc ' 5 - Reconfigure Storage',0d + asc ' 6 - Edit Profanity Filter',0d + asc ' 7 - Edit Bulletin Board Info',0d + asc ' 8 - Sort and Print Userlist',0d + asc ' 9 - Purge Users From System',0d + asc ' 10 - Exit Configure',0d,0d + + asc 'Which? [1-10] ',00 + + ldx #10 ; get a number [1-6] + jsr inpnum + + pha + ldx #start + jsr escape ;esc goes back to here + pla + asl a + tax + + lda jumptable,x + sta prn + inx ;push low + lda jumptable,x + sta prn+1 + jmp (prn) + +jumptable dw 0 + da re_mdm + da re_vid + da re_pr + da re_clk + da re_stor + da do_filt + da brdedit + da usrlist + da usrkill + da do_quit + +*------------------------------- +* print the top box + +do_main jsr TopBox + jsr print + db 1,2,3 + asc 'GBBS Config Program - Version 2.2',00 + jsr print + db 1,4,2 + asc 'Copyright 1986-2019 Kevin Smallwood',00 + rts + +*------------------------------- + +init db 0 + +usrname db 5 + asc 'USERS' +gname db 8 + asc 'ACOS.OBJ' diff --git a/Source/Config/User.S b/Source/Config/User.S index fbb2c3f..fdc0e42 100644 --- a/Source/Config/User.S +++ b/Source/Config/User.S @@ -1 +1,757 @@ - ᠣ 卍⠱㠧 ⠱㠧 姬䍠㠧 򧬰䍠㠧 䧬䍠㠧 򧬰䍠㠧 䍠㠧 짬䍠㠧 䬰䍠㠧 ۱ 占퍠𠣷 堺􍍺 ᠣ卍䍠㠧 󺧬䬰䍠㠧۰ 󧬰䍠㠧۱ 󧬰䍠㠧۳ 󧬰䍠㠧 󧬰䬰䍠㠧 Ҭݺ ᠣ堻 占ᠣ 荍ᠣ 썠 占捠 󿍠ᠻ 󍍠栻 ᠣ捠젻 썠ᠻ 占䍠㠧 ٯ ᠣ፠ 󍍠䬰䍠㠧 䧰䍠㠧 ᠣ 덠㍠ 򍍠 ⠱㠧 ᮮ堻 占ᠣ占卍 𫱍ᠣ捠𲠻 ᠣ捠𲫱 占ᠻ 썍占㠧 ӧ 栻 ᠣ捠 ߲ᠣ 捠捠ᠣ栻 㠻 卍捠䠣捠㠻 󍍠𠣧 ᠻ 􍍠젻 󿍠堻 䠻 䍍፠፠ᠻ ፠ ፠䠣 櫹 占 ᠻ 堻 櫹 䍠䠣ᠻ ߵ 荍堪 𫱍߲ ᠠ ᠨ𲩬栻 栻 ፍ堻 占㠧 󧬰 櫱 砻 ⠱ 㠧 ፍ⠱㠧 ᮮᠣ栻 ፠𲍠ᠣ捠𲫱ᠣ ߳ᠨ𲩬ߴ 􍍠ᠨ𲩬 櫱ᠨ𲩬櫱 ፠򍍠捠ᠣ栻 䍠􍍠 󿍠⠻ ᠣ櫷 ፍ ፍ㍠𲍠㠣𲠻 䍠𲫱㠣𲫱߳ ߴ堻 ⍍ᠣ 占ፍᠣ 卍 ߵᠣ 櫤 占捍⠻ 퍍 𫱍ᠨ𲩬ᠨ𲩬櫤 ፠ᠨ𲩬ፍ㍠𲠻 䍠㠣𲍠𲫱㠣𲫱⠰፠堻 占 䍠堻 堻 㠻 썍岠 䠣捠𠣧 򿍠 𠣧岍峠 占櫤䠣捠𠣧 峠 荍崠 占櫤䠣捠𠣧 忍崠 卍󠠻 櫷 䍠櫤󲍠岠櫷 櫤堪 堪 忍岠 占櫹 䍠櫤櫹櫤㲠櫹 櫤㲍󍍍 ᠣ捠 ᠣ捠𫱍ᠣ櫱𲠻 ᠣ櫱𲫱ᠨ 占𲩬 䍠㠻 썠占䠻 ⠻ 卍㍠ 㠣𫱍㠣𫱍㍠𲠻 㠣𲍠𲫱㠣𲫱 忍ᠨ ᠨ𲩬 忍ᠻ ᠨ፠ᠨ𲩬 ፠ᠨ፠ᠨ𲩬栻 󍍠𫱍𠣾栻 砻 卍𠣼栻 蠻 ㍠ 㠣𫱍㠣𫱍㍠𲠻 㠣𲍠𲫱㠣𲫱ፍ 򰍠򱍍ᠣ 占ᠣ ፍ𠴍፠ލ፠򳍍 썍򲠻 ᠣ򲍠ፍᠣ 栻 ፠ᠣ捠 占፠ ᠣ 􍍠 򫱲 占ፍ 썍櫷 ፠ᠣ櫷ᠻ 򍍠櫱櫱 퍍㍠ᠣ 썍퍠ᠣᠻ 򍍠ᠣ 荠􍍠櫷 ፠ᠣ櫷ᠻ 䍍 썍櫹ᠻ 獠፠፠ᠣ 㠣፠ 򲍍 썍櫹 荠櫹 ᠻ 𠴍፠ލ㸍㸠 ᠣ􍍠櫹䠣 㸍㸠 ᠣ􍍠櫹 㸍㸍櫹䠣 ᠣ퍍㍠ᠣ 썍퍠ᠣᠻ 􍍠ᠣ ᠣ ፠􍍍  ፠  荍Რᠨ ፠堪 占ᠣ 덠 忍᳠ ፠ 荠Რ 獍᳠ 󍍍  철젻 忍쳠 ᠣ 占철 獍쳠󍍍 ݍ㸠 썠ᠠ ᠠ ᠤ 捠 俍 ᠣᠤ ᠣ㱍ᠤ 㱰ᠣ 䍠젻 ᠤᠤ ᠤ㱰ᠤ 占ᠤ 􍍠ᠣɧ ᠣᠣᠣΧᠣ ᠤ젻 썠ᠠ ፠䠣栻 捠 􍍠 占ᠤ ፠ᠣ㰰 卍⠰⠰⠰󠤱 𫱠 ᠻ 𫱍𫱍 򍍍⠰⠰⠤⠰⠰㠧 㠧 㠧䍠㠧 㠧 ݧ䍠㠧 㠧 ݧ䬰捍㠧 㠧 㠧 㠧 㠧 㠧 짬 \ No newline at end of file +******************************** +* * +* Config - Print Userlist * +* * +******************************** + +*------------------------------- +* Date: 11/29/86 +*------------------------------- + +usrlist ldx #start ; setup esc handler + jsr escape + + jsr TopBox + jsr print + db 1,3,7 + asc '- Sort and Print Userlist -',00 + + jsr cls + jsr print + db 1,7,0 + asc ' 1 - Sort by user name',0d + asc ' 2 - Sort by the user number',0d + asc ' 3 - Sort by user password',0d + asc ' 4 - Sort by phone number',0d + asc ' 5 - Sort by last date on',0d + asc ' 6 - Sort by security level',0d + asc ' 7 - Return to main menu',0d,0d + asc 'Which? [1-7] ',00 + + ldx #7 ; get there choice + jsr inpnum + sta sortyp + cmp #7 ; check for abort + bne :over + jmp start + +:over ldx #usrlist + jsr escape + +list0 jsr cls + jsr print + hex 0d + asc 'Show users with which security flags:',0d,0d + asc '[0] = Un-Verified Users',0d + asc '[1] = Verified Users',0d + asc '[34] = Sysop Status',0d + asc '[RET] = Print all users',0d,0d + asc 'List which users [CR,0-34]: ',00 + + lda #%00100000 + sta inpmode ; set input mode + lda #2 + sta maxlen ; set input length + + lda #-1 ; default to all users + sta seclvl + jsr inpln ; input their choice + lda lnbuf + cmp #cr ; show all users? + beq list0a ; get password status + + ldx #lnbuf + jsr numin + stx seclvl ; save the level + cpx #35 + bcc list0a ; out of range + jmp list0 + +list0a jsr print + hex 0d + asc 'Display Passwords? [Y/N] ',00 + jsr inpyn + lda #0 + ror a + sta shwpass ; save password status + + jsr print + hex 0d,0d + asc 'Make sure printer, config disk, and'0d + asc 'system disk are on-line and ready.',00 +:oops jsr getcr + lda #1 ; log to system disk + jsr logspec + bcs :oops ; opps, error + + jsr cls ; clear screen + jsr print + db 1,8,12 + asc 'Reading data...',00 + + ldx #usrname + jsr movname + + ldx #1 ; start user number at 1 + stx temp + dex + stx temp+1 + + lda #sortbuf + sta temp2+1 + + jsr open ; open userfile + bcc list1a ; all is well + + jsr close + jsr cls + jsr print + asc 'Error: Unable to open file USERS',00 + jsr getcr + jmp usrlist ; start over + +list1a ldx #hdrbuf + ldy #128 ; 128 byte records + jsr rdpart + +list_2 lda #0 ; clear buffer + sta hdrbuf + ldx #hdrbuf ; read in a user + ldy #128 ; 128 byte records + jsr rdpart + bcs list2c ; opps, end of file + + lda hdrbuf + and #$7f + beq list2c ; no more users + + cmp #' ' + bcc list2a ; opps, no user in that slot + + lda seclvl ; show all users? + bmi list2e ; yep + beq list2d ; show non-verified + + pha + lsr a + lsr a ; divide by 8 + lsr a + tax ; and make into byte offset + pla + and #%00000111 + tay ; get bit offset + lda hdrbuf+92,x ; get byte + and secmap,y ; check bit + beq list2a ; nope, dont show + bne list2e ; show it + +list2d lda hdrbuf+92 ; check for non-verified + and #%00000010 + bne list2a ; user is verified, dont show + +list2e jsr list_5 ; handle sort dispatch + +list2a inc temp + bne *+4 ; inc user number + inc temp+1 + jmp list_2 ; loop + +list2c ldy #0 + tya ; mark last entry + sta (temp2),y + + lda sortbuf ; check for no entries + bne list2f ; there is data + + jsr close ; close user file + jsr cls + jsr print + asc 'No users fit parameters',00 + jsr getcr + jmp usrlist ; restart + +list2f lda sortbuf+12 ; only 1 user in list? + beq list2g ; yep + + jsr print + db 1,8,12 ; change on-screen operation + asc 'Sort',00 + jsr list6 ; sort data + +list2g jsr print + db 1,8,12 + asc 'Printing data...',00 + + lda #sortbuf + sta temp2+1 + lda #0 ; count the page display + sta prinit ; set printer to init + sta pagecnt + +list_3 ldy #0 + lda (temp2),y + beq list_4 ; opps, end of list + + ldy #10 + lda (temp2),y ; get user number + sta hdrbuf+128 + tax + iny + lda (temp2),y + sta hdrbuf+129 ; save user number as data + jsr gouser + + ldx #hdrbuf ; read in user record + ldy #128 + jsr rdpart + + bit shwpass ; show passwords? + bpl list3b ; yep + + lda #'*' + ldx #7 +list3a sta hdrbuf+70,x ; cover password with *'s + dex + bpl list3a + +list3b jsr pruser ; print users data + + clc + lda temp2 + adc #12 + sta temp2 ; goto next record + lda temp2+1 + adc #0 + sta temp2+1 + jmp list_3 ; do next user + +list_4 jsr close ; close user file +list4a dec pagecnt ; check page count + beq list4b + + lda #cr ; advance page + jsr prcout + jmp list4a + +list4b lda #cr ; add 4 last lines + jsr prcout + jsr prcout + jsr prcout + jsr prcout + jmp usrlist ; we are done + +*------------------------------- +* handle moving data for sort + +list_5 ldy #9 + lda #' ' +list5f sta hdrbuf+$100,y ; fill with blanks just in case + dey + bpl list5f + + jsr list5b ; get into 10 byte form + + ldy #11 ; save user record number + lda temp+1 + sta (temp2),y + dey + lda temp + sta (temp2),y + + dey +list5a lda hdrbuf+$100,y ; copy over data + sta (temp2),y + dey + bpl list5a + + clc + lda temp2 ; go to next record + adc #12 + sta temp2 + lda temp2+1 + adc #0 + sta temp2+1 + rts + +sortyp db 0 + +*------------------------------- + +list5b lda sortyp + asl a + tax + lda displist,x + sta prn + inx + lda displist,x + sta prn+1 + jmp (prn) + +displist dw 0 + dw sname ; sort user name + dw sunum ; sort by user number + dw spass ; sort by password + dw sfone ; sort by phone number + dw sdate ; sort by last user + dw ssec ; sort by sec level + +*------------------------------- + +sname ldy #-1 +sname2 iny + lda hdrbuf,y ; search for divider + and #$7f + cmp #' ' ; control char? + bcc sunum ; hmm, just blank out + cmp #',' + bne sname2 + + ldx #-1 +sname3 inx + iny + lda hdrbuf,y ; move byte + sta hdrbuf+$100,x + and #$7f + cmp #' ' + bcs sname3 ; loop and finish + + ldy #-1 +sname4 iny + lda hdrbuf,y ; add on first name + sta hdrbuf+$100,x + and #$7f + inx + cmp #',' ; done? + bne sname4 ; nope + +sunum rts ; leave data as blanks + +spass ldy #7 +spass2 lda hdrbuf+70,y ; move password + sta hdrbuf+$100,y + dey + bpl spass2 + rts + +sfone ldx #0 + ldy #0 +sfone2 lda hdrbuf+78,y ; get phone number + sta hdrbuf+$100,x + inx + iny + cpy #3 + bne *+3 ; skip if not at 3 + iny + cpy #7 + bne *+3 + iny + cpy #12 ; done? + bne sfone2 ; nope + rts + +sdate lda hdrbuf+91 ; move date into sort field + sta hdrbuf+$101 + lda hdrbuf+90 + sta hdrbuf+$102 + rts + +ssec ldy #3 +ssec2 lda hdrbuf+92,y ; move sec level in + sta hdrbuf+$101,y + dey + bpl ssec2 + rts + + +; sort all the records into order +list6 lda #sortbuf + sta temp+1 + + lda #sortbuf+12 + sta temp2+1 + +list6a ldy #0 +list6b lda (temp),y ; get first byte + cmp (temp2),y ; check againt second + beq list6c ; all is well + bcs list6e + bcc list6d ; order is correct + +list6c iny ; go to next char + cpy #10 ; there yet? + bne list6b ; nope + +list6d clc + lda temp ; advance pointer #1 + adc #12 + sta temp + lda temp+1 + adc #0 + sta temp+1 + + clc + lda temp2 ; advance pointer #2 + adc #12 + sta temp2 + lda temp2+1 + adc #0 + sta temp2+1 + + ldy #0 ; we done? + lda (temp),y + beq list6q ; yep + + lda (temp2),y ; done? + bne list6a ; nope, do next record +list6q rts + +list6e ldy #11 +list6f lda (temp),y + pha + lda (temp2),y ; swap data + sta (temp),y + pla + sta (temp2),y + dey + bpl list6f ; do 12 bytes + + lda temp+1 + cmp #>sortbuf ; at record #1 ? + bne list6g ; nope + + lda temp + cmp #prthdr + ldy #-1 ; print page header + jsr prdata + + lda sortyp + lup 4 + asl a + --^ + tax +pruser3 lda sortnam-16,x + inx + jsr prcout + asl a + bne pruser3 + + ldx #77 ; move over to col 77 + jsr gocol + + ldx #prthdr2 + ldy #-1 + jsr prdata + + lda #58 + sta pagecnt ; reset page counter + +pruser1 ldx #hdrbuf + ldy #"," ; print first name + jsr prdata + stx prn ; save location + sta prn+1 + + lda #' ' ; put a space between first & last + jsr prcout + + ldx prn ; pick up last location + lda prn+1 + ldy #cr+128 ; print last name + jsr prdata + + ldx #25 ; move over to col 25 + jsr gocol + + ldx #hdrbuf+78 + ldy #12 + jsr prdata ; print phone number + + ldx hdrbuf+128 + lda hdrbuf+129 ; translate number + jsr decmem + + sec + lda #43 + sbc txtnum ; move over to print user number + tax + jsr gocol + + ldy txtnum + ldx #txtnum+1 + jsr prdata ; print user number + + lda #'-' ; add in a dash + jsr prcout + + ldx #hdrbuf+70 + ldy #8 + jsr prdata ; print password + + ldx #54 ; move over to col 54 + jsr gocol + + lda hdrbuf+92 + lsr a ; dont show guest/user flag + ldx #7 +pruser2 lsr a + pha + lda #0 ; show 1 or 0 flag status + adc #'0' + jsr prcout + pla + dex ; print 7 flags + bne pruser2 + + ldx #63 ; move over to col 63 + jsr gocol + + lda hdrbuf+90 ; get most of month + lsr hdrbuf+91 ; shift last bit into carry + ror a ; move bit in + lup 4 + lsr a + --^ + jsr bindec8 + jsr prdec8 ; print it out + lda #'/' + jsr prcout + + lda hdrbuf+90 + and #%00011111 ; strip off month bits + jsr bindec8 + jsr prdec8 ; print out + lda #'/' + jsr prcout + + lda hdrbuf+91 ; get year + jsr bindec8 + jsr prdec8 + + lda hdrbuf+99 + and #%00001111 + tax ; display time limit + lda #0 + jsr decmem + + sec + lda #75 + sbc txtnum ; move over to print time limit + tax + jsr gocol + + ldy txtnum + ldx #txtnum+1 + jsr prdata ; print time limit + + lda #'0' ; add on zero (time * 10) + jsr prcout + lda #cr ; end of line data + jmp prcout + + +; print out selected data +prdata stx prn ; point to data + sta prn+1 + sty prn+2 ; save delimeter + sty prn+3 ; save length + + ldy #0 +prdata2 lda (prn),y ; get data + inc prn + bne *+4 ; goto next byte + inc prn+1 + + ora #$80 ; set high for ascii check + cmp prn+2 ; we done? + beq prdata3 ; yep + + jsr prcout ; print data + dec prn+3 ; count down length + bne prdata2 ; keep going + +prdata3 ldx prn + lda prn+1 ; get new address + rts + + +; go to a specified column +gocol stx prn ; save end address +gocol2 lda prcol ; are we done? + cmp prn + bcs gocol3 ; yep + + lda #' ' ; move over a space + jsr prcout + jmp gocol2 ; keep going + +gocol3 rts + + +; print out a 2 byte number [xx] +prdec8 jsr prcout ; call + txa ; ... fall into ... + +; print character: A = character +prcout pha ; save all reg's + stx prsv_x + sty prsv_y + + ldx #$13 +prcout1 lda $24,x ; save zero page stuff + sta przero,x + dex + bpl prcout1 + + bit prinit ; has printer been used? + bmi prcout3 ; yep + + lda #$10 + sta $26 ; setup slot pointer + lda #$c1 + sta $37 ; point ($0036) at $c100 + lda #0 ; init printer card + sta prcol ; reset column + tax + tay + sta $24 + sta $27 ; zero character buffer + sta $36 + + jsr $c100 + lda $36 ; point to output routine + sta jpcout2+1 + lda $37 + sta jpcout2+2 + dec prinit ; show we have done init + + lda #'I'-$40 ; send ctrl-I 80 n + jsr jpcout + lda #'8' + jsr jpcout + lda #'0' + jsr jpcout + lda #'N' + jsr jpcout + +prcout3 lda #0 ; set ch over to border + sta $24 + inc prcol ; move over 1 col + pla ; get byte to print + pha + and #$7f ; print with high-bit off + cmp #cr + bne prcout5 + + ldx #0 ; reset column + stx prcol +prcout5 jsr jpcout + + ldx #$13 +prcout4 lda przero,x ; restore zero page + sta $24,x + dex + bpl prcout4 + + ldx prsv_x ; restore reg's + ldy prsv_y + pla + rts + +jpcout ora #$80 +jpcout2 jmp $c000 ; do output routine + +prinit db 0 +prsv_x db 0 +prsv_y db 0 +przero ds $14 + + +; position to a user +gouser stx temp+1 ; reset scratch bytes + ldx #0 + stx temp + + lsr a ; do multipication + ror temp+1 + ror temp + ldx temp + tay + lda temp+1 + jmp setpos ; position to user + + +seclvl db 0 +shwpass db 0 +secmap db $01,$02,$04,$08,$10,$20,$40,$80 + +prcol db 0 +pagecnt db 0 + +prthdr asc '** GBBS Pro Userlist - Version 2.20 ' + asc '- List Sorted By: ',ff +prthdr2 asc '**',0d + asc '[Name] [Phone] [User] ' + asc '[Pass] [Sec] [Last] [Time]',0d + asc '[Alias] [Number] [Numb] ' + asc '[Word] [Lvl] [Call] [Limit]',0d,0d,ff + +sortnam asc 'User Name ',00,00 + asc 'User Number ',00,00 + asc 'User Password ',00,00 + asc 'Phone Number ',00,00 + asc 'Last Date On ',00,00 + asc 'Security Level',00,00 diff --git a/Source/Config/Userpurge.S b/Source/Config/Userpurge.S index d922733..721002f 100644 --- a/Source/Config/Userpurge.S +++ b/Source/Config/Userpurge.S @@ -1 +1,584 @@ - ׍ 卍 󺧬䬰 䧬 󩧬䬰 دد 嫱 溺 姬 座䬰 دد 嫴 嫲 嫳 嫱 嫲 덍 姬 㭧 ٯ 嫴 䬰䬰 嫱 卍 嫲 嫳 卍 嫴 卍 㧬 쳍 짬 ٯ  맬 宧  箮  嫶 嫷 嫸 嫹 嫱 嫱 櫱 㰰 㫱 㿍 卍 㰱 ፍ ῍ 卍 䍍 嫴 썍 ٯ 卍 䧬 ḍ 捍 嫶 嫷 嫶 嫷 쩍 嫸 嫹 嫱 쵍 嫱 嫶 嫷 촍 櫱 쿍 卍 썍 䬰䬰 嫶 嫷 ⍍ 嫸 嫹 ⍍ 嫱 嫱 ⍍ 􍍍 櫸 쿍 뿍 嫱 忍 卍 櫹 荪 嫱 썍 櫹 퍍 嫳 忍 嫲 卍 櫹 荪 嫳 썍 櫹 嫲 덍 󍍍 嫶 嫷 ⍍ ፍ ፍ 򫱲 䍍 򫱲 򫱲 썍 櫹 櫹 卍 嫵 忍 𳍍 𳫱 荍 櫶 櫶 𳫱 荍 櫳 櫳 𳫱 ፻ 嫵  𫱍 岍 ݮ 㸍 㸍 𫱍 㸍 􍍍 𫱍 此 此 𲫱 𲫱 𲩬 𲩬 卍 𲩬 𫱍 𲩬 𲫱 𲩬 𲩬 󍍍 䧬䬰 짬䬰 򧬰䬰  챍 짬  𲫱 𲩬 𲩬 𫱍 卍 𫱍 𫱍 덍 櫲 쿍 櫳 卍 櫱 𲫱 첍  덍 ̧ \ No newline at end of file +******************************** +* * +* Config - Userlist Purge * +* * +******************************** + +*------------------------------- +* Date: 01/16/90 - LTW +*------------------------------- + +usrkill ldx #start ; setup esc handler + jsr escape + + jsr TopBox + jsr print + db 1,3,6 + asc '- Purge Users From System -',00 + + jsr cls + jsr print + db 1,7,0 + asc 'Purge a group of users:',0d,0d + asc 'Delete normal users who have not called',0d + asc 'since: (Use [RETURN] to kill no users)',0d,0d + asc '[XX/XX/XX] ? ',00 + + jsr inpdate ; input the date threshold + stx date + sta date+1 + + jsr print + db cr + asc 'Delete special users (those users who',0d + asc 'have a percent (%) sign in their phone',0d + asc 'number) who have not called since:',0d,0d + asc '[XX/XX/XX] ? ',00 + + lda #-1 ; set default to auto-mode + sta date+4 + + jsr inpdate + stx date+2 + sta date+3 + ora date + ora date+1 + ora date+2 + beq kill1 ; just do stat check + + jsr print + db cr + asc 'Wait for Sysop verification before',0d + asc 'killing old users or kill automatic-',0d + asc 'ally? Wait for verification [Y/N] ? ',00 + + jsr inpyn + lda #0 + ror a ; save auto/manual status + sta date+4 + +kill1 jsr cls + jsr print + asc 'Userpurge parameter summary:',0d,0d,0d + asc 'Kill normal before: ',00 + ldx date + lda date+1 ; get normal date + clc + jsr prdate ; show date + + jsr print + db cr,cr + asc 'Kill special before: ',00 + ldx date+2 + lda date+3 ; print date + clc + jsr prdate + + jsr print + db cr,cr + asc 'Program mode: ',00 + bit date+4 + bpl kill2 ; manual mode + + jsr print + asc 'Automatic',00 + jmp kill3 + +kill2 jsr print + asc 'Manual',00 + +kill3 jsr print + db cr,cr,cr + asc 'Is the above correct [Y/N] ? ',00 + jsr inpyn + bcc kill3a + jmp usrkill ; try it again + +kill3a jsr print + db cr,cr + asc 'Make sure both the config disk',0d + asc 'and the system disk are on-line.',00 +kill3b jsr getcr + lda #1 + jsr logspec + bcs kill3b ; opps, try again + + jsr cls + jsr print + asc 'Userpurge: Running...',00 + + ldx #usrname ; open user file + jsr movname + jsr open + + ldx #hdrbuf ; gobble record 0 + ldy #128 + jsr rdpart + + ldx #1 + stx date+6 ; start at user #1 + dex + stx date+7 + stx date+8 ; reset killed count + stx date+9 + stx date+10 ; reset open slots + stx date+11 + stx sortbuf ; reset delmail list + stx sortbuf+1 + +kill4 lda $c000 ; check for keypress + cmp #esc+128 ; did they hit esc? + bne kill4k ; nope + + sta $c010 ; clear key + jmp kill6 ; end the userlist + +kill4k lda #0 + sta hdrbuf + ldx #hdrbuf ; read a user record + ldy #128 + jsr rdpart + bcs kill4z ; no more data + + lda hdrbuf ; is there real data? + bne kill4x ; yep + +kill4z jmp kill6 ; finish up userpurge + +kill4x lda hdrbuf + and #$7f + cmp #' ' ; good user? + bcc kill4b ; nope, killed + + jsr prxuser ; show user + jsr chkill ; kill user? + bcc kill5 ; all is well, keep user + + bit date+4 ; check kill mode + bmi kill4a ; do auto-kill + + jsr print + db cr,cr + asc 'Kill this user [Y/N] ? ',00 + jsr inpyn + bcs kill5 ; nope + +kill4a jsr print + db cr,cr + asc 'User Killed',00 + + lda #0 ; do small delay + jsr $fca8 + lda #cr ; delete user + sta hdrbuf + + ldx date+6 ; position to user record + lda date+7 + jsr gouser + + ldx #hdrbuf ; write out new user record + ldy #128 + jsr wrpart + + ldx date+6 + lda date+7 + jsr delmail ; kill the users mail (mark for kill) + + inc date+8 + bne kill4b ; inc number of deleted users + inc date+9 + +kill4b inc date+10 ; inc number of open slots + bne kill5 + inc date+11 + +kill5 inc date+6 ; loop and do next user + bne kill5a + inc date+7 +kill5a jmp kill4 + +kill6 jsr close ; we are done + lda sortbuf + ora sortbuf+1 ; delete mail? + beq kill7 ; nope + + jsr kilmail ; delete mail + +kill7 jsr cls + jsr print + asc 'Userpurge Result Summary:',0d,0d,0d + asc 'Total number of user slots: ',00 + ldx date+6 + lda date+7 + jsr prnumb + + jsr print + db cr,cr + asc 'Total number of users purged: ',00 + ldx date+8 + lda date+9 + jsr prnumb + + jsr print + db cr,cr + asc 'Total number of free slots: ',00 + ldx date+10 + lda date+11 + jsr prnumb + + jsr getcr + jmp start + + +; check to see if user should be killed +chkill lda hdrbuf+85 ; get phone/kill status + and #$7f + cmp #'*' ; never kill? + beq chkill4 ; yep + + cmp #'%' ; use special check? + beq chkill2 ; yep + + lda date+1 ; check date? + ora date + beq chkill4 ; nope + + lda hdrbuf+91 ; check high +* and #%00011111 + cmp date+1 + bcc chkill3 ; kill him + bne chkill4 ; all is well + + lda hdrbuf+90 ; check low + cmp date + bcs chkill4 ; they are ok + bcc chkill3 ; kill them + +chkill2 lda date+3 ; check date? + ora date+2 + beq chkill4 ; nope + + lda hdrbuf+91 ; check high +* and #%01111111 + cmp date+3 + bcc chkill3 ; kill the sucker + bne chkill4 ; all is well + + lda hdrbuf+90 ; check low + cmp date+2 + bcs chkill4 ; they are ok + +chkill3 sec ; kill user + rts + +chkill4 clc ; save user + rts + + +; print data on user to kill +prxuser ldx #7 ; clear bottom of screen + jsr cleos + lda #7 ; vtab 3 + sta cv + + lda #'#' ; add in prefix + jsr cout + + ldx date+6 + lda date+7 ; compute user-number text + jsr prnumb + + pha + lda #' ' + jsr cout ; move over 1 space + pla + + ldx #hdrbuf + ldy #"," ; display first name + jsr prstr + + pha + lda #' ' + jsr cout ; move over 1 space + pla + + ldy #cr+128 + jsr prstr ; display last name + jsr cleol ; clear to end + + ldy #cr+128 ;skip lowercase name + jsr skipstr + + jsr print + db cr + asc 'of ',00 + + ldy #cr+128 + jsr prstr ; print where from + jsr cleol + + jsr print + db cr,cr + asc 'Last Date On: ',00 + + ldx hdrbuf+90 + lda hdrbuf+91 + sec + jmp prdate ; display date + + +; input a date +inpdate lda #8 ; set length + sta maxlen + lda #%11100000 + sta inpmode + lda ch + sta date+5 + +inpdat1 jsr inpln ; get date + lda lnbuf + cmp #cr ; blank line? + bne inpdat2 ; yep + + ldx #0 ; return no date + txa + rts + +inpdat2 lda #0 ; reset scratch + sta temp3 + + ldx #lnbuf ; get month of year + jsr numin + txa + lsr a + ror temp3 + lsr a + ror temp3 ; do low + lsr a + ror temp3 + sta temp3+1 ; save high + + ldx #lnbuf+6 ; get the year + jsr numin + txa + and #%01111111 + asl a + ora temp3+1 ; add in month + + pha + ldx #lnbuf+3 ; get day of month + jsr numin + txa + and #%00011111 + ora temp3 + tax ; restore day + ora temp3+1 + bne inpdat4 + + pla +; jsr bell ; give them warning +inpdat3 lda ch + cmp date+5 + beq inpdat1 ; get new input + + lda #bs ; backup 1 space + jsr cout + jmp inpdat3 ; start again + +inpdat4 pla + rts + +date ds 12 + + +; print the date to the console +prdate stx temp ; save date + sta temp+1 + ora temp ; check for date + bne prdate2 + bcs prdate1 ; show old user + + jsr print + asc .[ Don't Purge ].,00 + rts + +prdate1 jsr print + asc '00/00/00',00 + rts + +prdate2 txa ; get most of month + lsr temp+1 ; shift last bit into carry + ror a ; move bit in + lsr a + lsr a + lsr a + lsr a ; get into position + jsr bindec8 + jsr decprn8 ; print it out + lda #'/' + jsr cout + + lda temp + and #%00011111 ; translate day + jsr bindec8 + jsr decprn8 ; print out + lda #'/' + jsr cout + + lda temp+1 + and #%01111111 + jsr bindec8 + ; fall through to print year +; print out a 8 bit number +decprn8 jsr cout + txa + jmp cout + + +; delete a users mail +delmail stx temp ; save user number + sta temp+1 + + lda #sortbuf-$100 + sta temp2+1 + ldy #-1 + +delml2 iny ; do a pre-inc + bne *+4 + inc temp2+1 + lda (temp2),y + iny + ora (temp2),y ; check for end of table + bne delml2 ; nope + + dey + lda temp ; save user number + sta (temp2),y + iny + lda temp+1 + sta (temp2),y + iny ; go to next table entry + bne *+4 + inc temp2+1 + + lda #0 ; save end of table marker + sta (temp2),y + iny + sta (temp2),y + rts + + +; kill the users mail +kilmail rts ; remove for now + + jsr cls + jsr print + asc 'Please remove the system disk and',0d,0d + asc 'replace it with the mail disk. All',0d,0d + asc 'deleted users will then have their',0d,0d + asc 'mail marked for deletion.',00 + +kilml1 jsr getcr + lda #4 + jsr logspec + bcs kilml1 + + jsr cls + jsr print + db 1,8,10 + asc 'Deleting Mail',00 + + ldx #mail + ldy #0 ; open the mail file + jsr open + + ldx #lnbuf + ldy #8 ; read in header + jsr rdpart + + lda #sortbuf + sta temp2+1 + +kilml2 ldy #0 + lda (temp2),y ; get user # to kill + sta temp + iny + lda (temp2),y + sta temp+1 + ora temp + beq kilml4 ; we are done + + lda temp+1 + asl temp + rol a + asl temp ; compute dir block + rol a + asl temp + rol a + sta temp+1 + jsr posdir ; position to block + + ldx #hdrbuf + ldy #128 ; read in dir block + jsr rdpart + + lda temp + lsr a ; get offset into block + tax + lda hdrbuf+2,x ; do they have mail? + ora hdrbuf+3,x + beq kilml3 ; nope + + lda #0 ; set marker to 1024 + sta hdrbuf,x + lda #4 + sta hdrbuf+1,x + + lda temp+1 ; position back to block + jsr posdir + + ldx #hdrbuf + ldy #128 ; write out directory block + jsr wrpart + +kilml3 inc temp2 ; inc to next user # + inc temp2 + bne *+4 + inc temp2+1 + jmp kilml2 + +kilml4 jmp close ; close mail and return + + +; position into the directory +posdir lda lnbuf ; get # of bit-maps + sta temp3 + lda #16 + lsr temp3 + ror a ; position into dir file + tax + lda temp3 + ldy #0 + jmp setmark + + +; name of the mail file on disk +mail db 4 + asc 'MAIL' diff --git a/Source/Config/Viddvr.S b/Source/Config/Viddvr.S index d6bebd7..d5ca075 100644 --- a/Source/Config/Viddvr.S +++ b/Source/Config/Viddvr.S @@ -1 +1,253 @@ - 獪 屠㰵岠㰵ᠤ㰰㠻䍠ᠤ㰰썠屍ᠣ 堻 占󍍪ᠣ   ᠻ 占嫱ᠣᰍᠨ婬젺𠣲𲍍ᠣ荠ᠣ󍍪𲍍፠蠻 ፠ፍ철ᠣ 荠철 卍፠ 덠፠荠፠󍍪ፍᠣ占占占占占卍ᠣᠨ婬ᠨ婬፠󍍪卍ᠣᠨ婬ᠣᰍᠨ婬堺ᠣᠨ婬󍍪 卍ᠣƍᠨ婬젺󍍪፠ 占嫱󍍪ᠠ 卍堻 󍍠荍፠ᠣ ᠨ婬 󍍪 堻 獠占ፍ䠣栻 荠捠𠣧 򍍠蠻 占荠 俍 卍 荍 占 忍𠣲 卍 덍፠堻 捠占蠻 썍ᠣ 占荍 𠣰 卍 ḍḍ ḍḍ䰍䰍 䰍䰍 \ No newline at end of file + +*------------------------------- +* video driver for config +*------------------------------- + +*------------------------------- +* Date: 3/11/88 +*------------------------------- + +page1 equ $c054 +page2 equ $c055 + +VideoStartup sta $c00c ;clr80vid + sta $c000 ;clr80col + sta page1 + + lda #0 ; set to page 1 + sta inverse ; set to normal mode + rts + +*------------------------------- + +cls lda #6 ;clear screen + sta cv ;line 6 on down + +clslup2 lda cv ;clear to end of screen + asl a ;cv := cv * 2 + tay + lda LineAddress,y + sta base + iny + lda LineAddress,y + sta base+1 + + ldy #39 + lda #$a0 +:loop sta (base),y + dey + bpl :loop + + inc cv + lda cv + cmp #24 + bne clslup2 + + lda #0 ;0,6 + sta ch + lda #7 + sta cv + rts + +*------------------------------- + +cleos stx cv + jmp clslup2 + +cleol pha + lda ch ; save location of cursor + pha + lda cv + pha + +cleol2 lda #' ' + jsr cout ; put space over char + lda ch + bne cleol2 ; go until it wraps to next line + + pla + sta cv ; put cursor back + pla + sta ch + pla + rts + +*------------------------------- + +TopBox pha + + lda #0 + sta cv + + jsr doILine + inc cv + jsr doEdge + inc cv + jsr doEdge + inc cv + jsr doEdge + inc cv + jsr doEdge + inc cv + jsr doILine + + ldy #39 + lda #$20 + sta (base),y + ldy #0 + sta (base),y + + pla + rts + +*------------------------------- + +doEdge jsr makebase + + ldy #0 + lda #$20 + sta (base),y + + ldy #38 + lda #$a0 +:loop sta (base),y + dey + bne :loop + + ldy #39 + lda #$20 + sta (base),y + rts + +*------------------------------- +* print an inverse line across the screen + +doILine jsr makebase + + ldy #39 + lda #$DF +:loop sta (base),y + dey + bpl :loop + rts + +*------------------------------- + +makebase lda cv + asl a + tay ;setup indirect address + lda LineAddress,y + sta base + iny + lda LineAddress,y + sta base+1 + rts + +*------------------------------- + +plotchr pha ; save + jsr makebase ;setup indirect for screen address + ldy ch + pla + + ora #$80 ;set high bit + +* check for ][ plus + + stx x_save ; save x + ldx $fbb3 + cpx #$ea ;][ plus? + bne plotchr1 ;nope + +* convert everything to uppercase + + cmp #"a" ;lower? + bcc plotchr1 ;nope + cmp #"z"+1 ;lower + bcs plotchr1 ;nope + sbc #$1f ;make upper + +plotchr1 ldx x_save + sta (base),y ;put it onto the screen + rts + +*------------------------------- +* output a character + +cout stx x_save ; save everything + sty y_save + pha + + and #$7f ; clear high + cmp #cr + beq cout2 + cmp #lf + beq cout3 + cmp #bs + beq cout5 + cmp #' ' + bcc cout4 + + jsr plotchr ; plot the sucker + + inc ch ; move over 1 space + ldy ch + cpy #40 ; wrap-around? + bne cout4 ; nope + +cout2 ldy #0 ; reset horiz + sty ch + +cout3 inc cv ; go down 1 line + lda cv ; is it in range? + cmp #24 + bne cout4 ; nope + + dec cv ; put it back + +cout4 pla + ldx x_save ; restore stuff + ldy y_save + rts + +cout5 dec ch ; backup + bpl cout4 ; all is well + + lda #40 ; move to end of line + sta ch + + lda cv ; are we at the top + cmp #0 + beq cout4 ; yep + + dec cv + jmp cout4 ; ok, we are done + +*------------------------------- + +LineAddress dw $400 + dw $480 + dw $500 + dw $580 + dw $600 ;first 1/3 of text screen + dw $680 + dw $700 + dw $780 + + dw $428 + dw $4a8 + dw $528 + dw $5a8 + dw $628 ;second 1/3 of text screen + dw $6a8 + dw $728 + dw $7a8 + + dw $450 + dw $4d0 + dw $550 + dw $5d0 + dw $650 ;last 1/3 of text screen + dw $6d0 + dw $750 + dw $7d0 diff --git a/Source/Config/Video.S b/Source/Config/Video.S index 4f7d7a5..24a83a9 100644 --- a/Source/Config/Video.S +++ b/Source/Config/Video.S @@ -1 +1,73 @@ - 䴰丰䴰⠱㠧 ᠣ卍⠱㠧 ۫ 姬䍠㠧 ۫ 姬䍠㠧 ۫ 짬䍠㠧 姬䍠㠧 姬䍠㠧 姬䍠㠧 姬䍠㠧 姬䍠㠧 姬䬰䍠㠧 ۱ 퍍ᠻ 占 ᠺᠺᠣ ᠣ ᠨ占ᠨ堺堺𲍍 砻 󍍺䴰䴰썠䴰丰䴰丰䴰丰 \ No newline at end of file +* Video Driver re-configuration +*------------------------------- + +vid40 ext +vid80 ext +vid40pl ext +videx ext + +re_vid jsr TopBox + jsr print + db 1,3,7 + asc '- Configure Video Driver -',00 + + jsr cls + ldx #start + jsr escape + + jsr print + db 1,7,0 + asc ' 1 - Apple ][+ w/o lower case',0d + asc ' 2 - Apple ][+ w/ lower case',0d + asc ' 3 - Apple ][+ w/ Videx 80 col',0d + asc ' 4 - Apple //e in 40 col mode',0d + asc ' 5 - Apple //e in 80 col mode',0d + asc ' 6 - Apple //c in 40 col mode',0d + asc ' 7 - Apple //c in 80 col mode',0d + asc ' 8 - Apple IIgs in 40 col mode',0d + asc ' 9 - Apple IIgs in 80 col mode',0d,0d + asc 'Which? [1-9] ',00 + + ldx #9 ;get printer # + jsr inpnum + + asl a ;point0 points to the + tax ;video device driver + lda :vidtable,x + sta point0 + inx + lda :vidtable,x + sta point0+1 + + lda #viddrv + sta point1+1 + + ldx #3 ;move 3 illustrious pages +:loop2 ldy #0 +:loop lda (point0),y ;source + sta (point1),y ;destination + iny + bne :loop + inc point0+1 + inc point1+1 + dex + bne :loop2 + + jsr chinit ; check for init + jmp wrtchg ; write the changes + +:vidtable dw 0 + da vid40 + da vid40pl + da videx + da vid40 + da vid80 + da vid40 + da vid80 + da vid40 + da vid80 + + diff --git a/Source/Config/Video/Vid40.S b/Source/Config/Video/Vid40.S index 763c2d7..38a3f88 100644 --- a/Source/Config/Video/Vid40.S +++ b/Source/Config/Video/Vid40.S @@ -1 +1,418 @@ - 捍썠崰岠䴰砤썠䍠䍠􍍻 ᠤ㳰⍠𠣱堺߲ᠤ㳰㍠𠣤堺߱ᠤ㰵㍠㠺߲߱𠣤堺߲ᠣᠤⲍ߲ᠣ 덠獠ᠣ荠 ᠣ퍍 󮮮堻 ᠣ ᠨ婬 젺󲍍 忍堺󱠻 宮ᠣ 荠 卍 󲠻 ፠፠ᠻ ᠺ 占ᠺ򫱬嫱፠ᠻ 占ፍ󍍻 堻 獠占ፍ䠣栻 荠捠𠣧 㠺 占卍蠻 ᠣ𠣢ᢠ 򿍠㠺 卍𠣢 򿍠 卍㠣栻 򍍺砻 忍젺 卍䠣栻 ᠨ婬 򍍠蠻 占荠 俍堺 卍 荍 占 忍퍠堺 卍 덠썺፠堻 捠占󍍺蠻 젺 썍ᠣ 占荍 卍 卺 썍철堻 占占岠 䍠嫱岫堻 卍 卺쳠ᠨ婬 ᠨ岩젺쳍፠ 忍堺철 卍 宮퍠ᠣ 󍍺፠堻 占ፍᠨ婬 占젺󍍍 卺ᠠ 獠፠ፍᠤ䵬 ᠤ䴬 堺򲍍፠፠፠𠣢ᢠ 򿍠㠺򳠻 卍𠣢 򿍠򳠻 卍㠣栻 򍍺ᠤ淠 ፠󍍍 卺፠堻 ٍ荠ᠣ栻 占婬 忍堺 卍렻 卺ᠨ婬堻 占፠󍍻 卺፠占占堻 卍蠻 荠ᠨ婬렻 占占፠󍍻 卺፠堻 ٍ荠렻 ᠨ婬堻 占፠󍍍 ᠣ堻 堻 ᠣ 堻 堻 ᠣ 󍍍 堻 占ᠨ婬 䠣捠𠣧 󠪫 㠣󍍍 ᠤ㰰󍍍 獺蠻 ፠堻 卍 䍺  蠻 ፠፠፠ ፠ ᠣ砻 占ፍ歱ᠺ 占፠፠젺ᠣ 占獠 占ᠣ卍፠ᠠ 덠󍍺⠰頧 ź ݧ頧 ú ݧ 獠 獠ḍḍḍḍ 獠䰍䰍䰍䰍 \ No newline at end of file +******************************** +* * +* Apple 40 Column Driver * +* * +******************************** + +*------------------------------- +* Date: 01/03/86 +*------------------------------- + lst off + + rel + dsk rel/apple40 + + +cr equ $0d +lf equ $0a +bs equ $08 + +wndlft equ $20 +wndwdth equ $21 +wndtop equ $22 +wndbtm equ $23 +ch equ $24 +cv equ $25 +blink equ $26 +oldcv equ $27 +base equ $28 +base2 equ $2a +x_save equ $2c +y_save equ $2d +invflg equ $32 + +vid40 ent + org $0900 + jmp :init + jmp :cls + jmp :cout + jmp :scroll + jmp :banner + jmp :clrlast + jmp :rdinit + jmp :rdkey + jmp :rdend + jmp :window + jmp :read + jmp :keyin + jmp :xypos + jmp :shchat + +; init 40 col video + +:init lda $c30b + cmp #1 + bne :init_2 + + lda $c30c + cmp #$82 + bne :init_1 + + lda $c058 + clc + bcc :init_2 + +:init_1 cmp #$87 + bne :init_2 + + lda #0 + sta $c0b2 + +:init_2 lda #0 ; reset screen + sta blink + sta wndlft + sta wndtop + sta invflg + lda #40 + sta wndwdth + sta oldcv ; make sure it is different! + lda #24 + sta wndbtm + +; ...fall through to cls... + +:cls ldx wndtop +:cls1 jsr :setbase ; setup base address + ldy #39 + lda #" " +:cls2 sta (base),y ; clear screen + dey + bpl :cls2 + + inx + cpx wndbtm ; is there more? + bne :cls1 ; yep + +; ...fall through to home routine... + +:home lda #0 ; home cursor + sta ch + lda wndtop ; top of window + sta cv + tax + +; ...fall through to setbase routine + +:setbase cpx oldcv ; do we have the base already? + beq :setbas2 ; yep + + pha + txa + asl a ; x = x * 2 + tax + lda :scrnadr,x ; get and save address + sta base + lda :scrnadr+1,x + sta base+1 + txa + lsr a ; x = x / 2 + tax + stx oldcv ; update old cv value + pla + +:setbas2 rts + +; output a character +:cout stx x_save ; save everything + sty y_save + pha + + and #$7f ; clear high + cmp #cr + beq :cout2 + cmp #lf + beq :cout3 + cmp #bs + beq :cout5 + cmp #' ' + bcc :cout4 + + ldx cv ; set base + jsr :setbase + + ldy ch ; get offset + ora #$80 + cmp #"a" ; lower? + bcc :cout0 ; nope + + cmp #"z"+1 ; lower? + bcs :cout0 ; nope + + sbc #$1f ; make upper + +:cout0 bit invflg ; inverse? + bpl :cout1 ; nope + + and #$3f ; inverse upper + +:cout1 sta (base),y ; save character + + inc ch ; move over 1 space + ldy ch + cpy #40 ; wrap-around? + bne :cout4 ; nope + +:cout2 ldy #0 ; reset horiz + sty ch + +:cout3 inc cv ; go down 1 line + lda cv ; is it in range? + cmp wndbtm + bne :cout4 ; nope + + dec cv ; put it back + jsr :scroll +:cout4 pla + ldx x_save ; restore stuff + ldy y_save + rts + +:cout5 dec ch ; backup + bpl :cout4 ; all is well + + lda #39 ; move to end of line + sta ch + + lda cv ; are we at the top + cmp wndtop + beq :cout4 ; yep + + dec cv + jmp :cout4 ; ok, we are done + + +; scroll the screen down 1 line +:scroll ldx wndtop ; get first line to scroll + +:scroll2 jsr :setbase ; get the first base + lda base + sta base2 ; move to second + lda base+1 + sta base2+1 + inx + jsr :setbase ; get other base + + ldy #39 ; copy line +:scroll3 lda (base),y ; move character + sta (base2),y + dey + bpl :scroll3 + + txa + tay + iny + cpy wndbtm ; done? + bne :scroll2 ; nope + +; ...fall through into clear last line routine... + +:clrlast ldx wndbtm + dex + lda #" " ; fill with spaces + +:clrline pha + jsr :setbase ; point to last line + pla + + ldy #39 +:clrlst3 sta (base),y ; clear the line + dey + bpl :clrlst3 + rts + + +; scroll a character across the bottom line +:banner pha ; save eveything + txa + pha + + ldx #0 +:banner2 lda $7d5,x ; move char + sta $7d4,x + inx + cpx #$24 ; do all the chars + bne :banner2 + + pla + tax + pla + pha + cmp #"a" ; lower? + bcc :banner3 ; nope + + cmp #"z"+1 ; lower? + bcs :banner3 ; nope + + sbc #$1f ; make upper + +:banner3 sta $7f7 ; save new char + pla + rts + + +; get a character -- non destructable +:rdkey pha + sty y_save ; save Y + ldy ch + lda #$df ; underline + cmp (base),y ; is it in underline phase? + bne :rdkey2 ; nope, put it there + + lda blink ; put into character phase +:rdkey2 sta (base),y + ldy y_save ; were done + pla + rts + +; init rdkey routine +:rdinit pha + stx x_save + sty y_save + ldx cv + jsr :setbase ; setup base + + ldy ch ; select screen to work with + lda (base),y + sta blink ; save blink character + ldx x_save + ldy y_save + pla + rts + +; finish up rdkey routine +:rdend pha + sty y_save ; save A & Y + ldy ch + lda blink ; put back orig char + sta (base),y + ldy y_save ; restore + pla + rts + + +; set up window for top of screen display +:window ldx #0 + lda #'-' + jsr :clrline ; fill line 1 + ldx #3 + jsr :clrline ; fill line 4 + dex + lda #' ' + jsr :clrline ; fill line 3 + dex + jsr :clrline ; fill line 2 + lda #4 ; set top of window + sta wndtop + rts + + +; read a line of data from the screen +:read jsr :setbase ; setup base + lda (base),y ; get character + and #$7f + cmp #' ' + bcs *+4 ; make into ascii character + adc #'@' + rts + + +; check for local keyin +:keyin lda $c000 + rts + + +; do x-y positioning +:xypos stx ch ; save location + sty cv + tya + tax + jmp :setbase ; reset base + + +; show that chat has been selected +:shchat tax + lda wndtop ; are we full screen? + beq :shchat5 ; yep, dont display + + lda ch ; save location + pha + lda cv + pha + txa + beq :shchat3 ; cover it up + + pha + ldy #0 + ldx #13 ; position cursor + jsr :xypos + lda #-1 + sta invflg ; set inverse mode + pla + + tay + ldx :msgoff-1,y +:shchat2 lda :chatmsg,x ; print chat message + inx + pha + jsr :cout + pla + bpl :shchat2 + + lda #0 ; set normal mode + sta invflg + beq :shchat4 ; finish up + +:shchat3 ldx #0 ; fix top line + lda #'-' + jsr :clrline + +:shchat4 pla + tay + pla ; move back + tax + jsr :xypos +:shchat5 rts + +:msgoff db 0,12 + +:chatmsg dci '[ PAGE: ON ]' + dci '[ EXEC: ON ]' + + +; table of screen address +:scrnadr dw $400 ; first 1/3 decoding + dw $480 + dw $500 + dw $580 + dw $600 + dw $680 + dw $700 + dw $780 + + dw $428 ; second 1/3 decoding + dw $4a8 + dw $528 + dw $5a8 + dw $628 + dw $6a8 + dw $728 + dw $7a8 + + dw $450 ; third 1/3 decoding + dw $4d0 + dw $550 + dw $5d0 + dw $650 + dw $6d0 + dw $750 + dw $7d0 diff --git a/Source/Config/Video/Vid40pl.S b/Source/Config/Video/Vid40pl.S index 5c118ba..79a31b7 100644 --- a/Source/Config/Video/Vid40pl.S +++ b/Source/Config/Video/Vid40pl.S @@ -1 +1,449 @@ - 捍썠崰썍⍍岠䴰砤썠䍠䍠􍍻 ᠤ㳰⍠𠣱߲ᠤ㳰㍠𠣤߱ᠤ㰵㍠߲߱𠣤߲ᠣᠤⲍ߲ᠣ 덠獠ᠣ荠 ᠣ퍍 ߍ堻 ᠣ ᠨ婬 󲍍 忍󱠻 ߍᠣ 荠  卍 󲠻 ፠፠ᠻ 占򫱬嫱፠ᠻ 占ፍ󍍻 堻 獠占ፍ䠣栻 荠捠𠣧 占卍蠻 ᠣ砻 忍 卍𠣢ᢠ 򿍠 卍㠣 䠣栻 ᠨ婬 򍍠蠻 占荠 俍 卍 荍 占 忍퍠 卍 덠፠堻 捠占蠻 썍ᠣ 占荍 卍 썍철堻 占占岠 䍠嫱岫堻 卍 쳠ᠨ婬 ᠨ岩쳍፠ 忍철 卍 ߍ퍠ᠣ ፠堻 占ፍᠨ婬 占󍍍 ᠠ 獠፠ፍᠤ䵬 ᠤ䴬 򲍍፠፠፠𠣢ᢠ 򿍠򳠻 卍𠣢 򿍠򳠻 卍㠣栻 ᠤ淠 ፠󍍍 ፠堻 ٍ荠ᠣ栻 占婬 忍 卍렻 ᠨ婬堻 占፠󍍻 ፠占占堻 卍蠻 荠ᠨ婬렻 占占፠󍍻 ፠堻 ٍ荠렻 ᠨ婬堻 占፠󍍍 ᠣ堻 堻 ᠣ 堻 堻 ᠣ 󍍍 堻 占ᠨ婬 䠣捠𠣧 󠪫 㠣󍍍 ᠤ㰱 卍ᠣ 占ᠤ㰰 䍠 ፍ㫱 忍 卍𠣢 ῍ 卍𠣢 ᠣТ Ѝ𠣢ۢ 쿍 卍𠣢ᢠ 忍 䠣 ΍㰶 䍠 䍍 𠣰 ⠰ 蠻 ፠堻 卍  蠻 ፠፠፠ ፠ ᠣ砻 占ፍ歱 占፠፠ᠣ 占獠 占ᠣ卍፠ᠠ 덠⠰頧 ݧ頧 ݧ 獠 獠ḍḍḍḍ 獠䰍䰍䰍䰍 \ No newline at end of file +* ------------------------------ +* apple 40 col driver +* ------------------------------ + lst off + + rel + dsk rel/apple40pl + +cr equ $0d +lf equ $0a +bs equ $08 +esc equ $1b + +wndlft equ $20 +wndwdth equ $21 +wndtop equ $22 +wndbtm equ $23 +ch equ $24 +cv equ $25 +blink equ $26 +oldcv equ $27 +base equ $28 +base2 equ $2a +x_save equ $2c +y_save equ $2d +invflg equ $32 + +vid40pl ent + org $0900 + + jmp init + jmp cls + jmp cout + jmp scroll + jmp banner + jmp clrlast + jmp rdinit + jmp rdkey + jmp rdend + jmp window + jmp read + jmp keyin + jmp xypos + jmp shchat + +; init 40 col video + +init lda $c30b + cmp #1 + bne init_2 + + lda $c30c + cmp #$82 + bne init_1 + + lda $c058 + clc + bcc init_2 + +init_1 cmp #$87 + bne init_2 + + lda #0 + sta $c0b2 + +init_2 lda #0 ; reset screen + sta blink + sta shift + sta wndlft + sta wndtop + sta invflg + lda #40 + sta wndwdth + sta oldcv ; make sure it is different! + lda #24 + sta wndbtm + +; ___fall through to cls___ + +cls ldx wndtop +cls1 jsr setbase ; setup base address + ldy #39 + lda #" " +cls2 sta (base),y ; clear screen + dey + bpl cls2 + + inx + cpx wndbtm ; is there more? + bne cls1 ; yep + +; ___fall through to home routine___ + +home lda #0 ; home cursor + sta ch + lda wndtop ; top of screen + sta cv + tax + +; ___fall through to setbase routine + +setbase cpx oldcv ; do we have the base already? + beq setbas2 ; yep + + pha + txa + asl a ; x = x * 2 + tax + lda scrnadr,x ; get and save address + sta base + lda scrnadr+1,x + sta base+1 + txa + lsr a ; x = x / 2 + tax + stx oldcv ; update old cv value + pla + +setbas2 rts + +; output a character +cout stx x_save ; save everything + sty y_save + pha + + and #$7f ; clear high + cmp #cr + beq cout2 + cmp #lf + beq cout3 + cmp #bs + beq cout5 + cmp #' ' + bcc cout4 + + ldx cv ; set base + jsr setbase + + ldy ch ; get offset + ora #$80 + + bit invflg ; inverse? + bpl cout1 ; nope + + cmp #"a" ; lower? + bcc cout0 ; nope + + sbc #$20 ; make upper + +cout0 and #$3f ; inverse upper + +cout1 sta (base),y ; save character + + inc ch ; move over 1 space + ldy ch + cpy #40 ; wrap-around? + bne cout4 ; nope + +cout2 ldy #0 ; reset horiz + sty ch + +cout3 inc cv ; go down 1 line + lda cv ; is it in range? + cmp wndbtm + bne cout4 ; nope + + dec cv ; put it back + jsr scroll +cout4 pla + ldx x_save ; restore stuff + ldy y_save + rts + +cout5 dec ch ; backup + bpl cout4 ; all is well + + lda #39 ; move to end of line + sta ch + + lda cv ; are we at the top + cmp wndtop + beq cout4 ; yep + + dec cv + jmp cout4 ; ok, we are done + + +; scroll the screen down 1 line +scroll ldx wndtop ; get first line to scroll + +scroll2 jsr setbase ; get the first base + lda base + sta base2 ; move to second + lda base+1 + sta base2+1 + inx + jsr setbase ; get other base + + ldy #39 ; copy line +scroll3 lda (base),y ; move character + sta (base2),y + dey + bpl scroll3 + + txa + tay + iny + cpy wndbtm ; done? + bne scroll2 ; nope + +; ___fall through into clear last line routine___ + +clrlast ldx wndbtm + dex + lda #" " ; fill with spaces + +clrline pha + jsr setbase ; point to last line + pla + + ldy #39 +clrlst3 sta (base),y ; clear the line + dey + bpl clrlst3 + rts + + +; scroll a character across the bottom line +banner pha ; save eveything + txa + pha + + ldx #0 +banner2 lda $7d5,x ; move char + sta $7d4,x + inx + cpx #$24 ; do all the chars + bne banner2 + + pla + tax + pla + pha + cmp #"a" ; lower? + bcc banner3 ; nope + + cmp #"z"+1 ; lower? + bcs banner3 ; nope + + sbc #$1f ; make upper + +banner3 sta $7f7 ; save new char + pla + rts + + +; get a character -- non destructable +rdkey pha + sty y_save ; save Y + ldy ch + lda #$df ; underline + cmp (base),y ; is it in underline phase? + bne rdkey2 ; nope, put it there + + lda blink ; put into character phase +rdkey2 sta (base),y + ldy y_save ; were done + pla + rts + +; init rdkey routine +rdinit pha + stx x_save + sty y_save + ldx cv + jsr setbase ; setup base + + ldy ch ; select screen to work with + lda (base),y + sta blink ; save blink character + ldx x_save + ldy y_save + pla + rts + +; finish up rdkey routine +rdend pha + sty y_save ; save A & Y + ldy ch + lda blink ; put back orig char + sta (base),y + ldy y_save ; restore + pla + rts + + +; set up window for top of screen display +window ldx #0 + lda #'-' + jsr clrline ; fill line 1 + ldx #3 + jsr clrline ; fill line 4 + dex + lda #' ' + jsr clrline ; fill line 3 + dex + jsr clrline ; fill line 2 + lda #4 ; set top of window + sta wndtop + rts + + +; read a line of data from the screen +read jsr setbase ; setup base + lda (base),y ; get character + and #$7f + cmp #' ' + bcs *+4 ; make into ascii character + adc #'@' + rts + + +; check for local keyin +keyin1 sta $c010 ; reset keyboard strobe + + lda #$60 + eor shift ; toggle shift byte + sta shift + +keyin lda $c000 ; check keyboard + bpl keyin2 ; no data + + cmp #esc+128 ; change case? + beq keyin1 ; nope + + cmp #"@" ; is it alpha? + bcc keyin2 ; nope + + cmp #"@" ; is it a + bne keyin3 + + lda #"P" ; make @ into P + +keyin3 cmp #"[" ; is it a special symbol? + bcc keyin4 ; nope + + cmp #"a" ; is it lower case? + bcs keyin4 ; yep + + and #%11101111 ; make into M or N + +keyin4 bit $c063 ; check shift-key mod + bpl keyin2 ; dont change data, they shifted + + ora shift ; possible shift + +keyin2 cmp #0 ; reset all flags + rts + +shift db 0 + + +; do x-y positioning +xypos stx ch ; save location + sty cv + tya + tax + jmp setbase ; reset base + + +; show that chat has been selected +shchat tax + lda wndtop ; are we full screen? + beq shchat5 ; yep, dont display + + lda ch ; save location + pha + lda cv + pha + txa + beq shchat3 ; cover it up + + pha + ldy #0 + ldx #13 ; position cursor + jsr xypos + lda #-1 + sta invflg ; set inverse mode + pla + + tay + ldx msgoff-1,y +shchat2 lda chatmsg,x ; print chat message + inx + pha + jsr cout + pla + bpl shchat2 + + lda #0 ; set normal mode + sta invflg + beq shchat4 ; finish up + +shchat3 ldx #0 ; fix top line + lda #'-' + jsr clrline + +shchat4 pla + tay + pla ; move back + tax + jsr xypos +shchat5 rts + +msgoff db 0,12 + +chatmsg dci '[ Page: On ]' + dci '[ Exec: On ]' + + +; table of screen address +scrnadr dw $400 ; first 1/3 decoding + dw $480 + dw $500 + dw $580 + dw $600 + dw $680 + dw $700 + dw $780 + + dw $428 ; second 1/3 decoding + dw $4a8 + dw $528 + dw $5a8 + dw $628 + dw $6a8 + dw $728 + dw $7a8 + + dw $450 ; third 1/3 decoding + dw $4d0 + dw $550 + dw $5d0 + dw $650 + dw $6d0 + dw $750 + dw $7d0 + + end diff --git a/Source/Config/Video/Vid80.S b/Source/Config/Video/Vid80.S index a002fd5..de61be4 100644 --- a/Source/Config/Video/Vid80.S +++ b/Source/Config/Video/Vid80.S @@ -1 +1,447 @@ - 捍썠帰岠丰砤썠䍠䍠􍍻 ᠤ㰰䠻 ᠤ㰰 占ᠤ㰰栻 􍍠ᠣ 덠砻 占ᠣ荠 ᠣ퍍 ߍ堻 ᠣ ᠤ㰵 ᠨ婬ᠤ㰵 ᠨ婬󲍍 忍󱠻 ߍᠣ 荠  卍 󲠻 ፠፠ᠻ 占򫱬嫱፠ᠻ 占ፍ󍍻 堻 獠占ፍ䠣栻 荠捠𠣧 占卍ᠣ砻 忍ᠻ 卍䠣栻 쿍𠣧ᠻ 𠣧᧭ 忍ᠻ 䠣栻 㠠 占 蠻 占荠 俍 卍 荍 占 忍퍠 卍 덠፠堻 捠占蠻 썍ᠣ 占荍 卍 ٍ堻 ፠荠ᠻ ٍᠤ㰵㠪 占ᠤ㰵ፍ𠠻 򱠻 ᠨ婬 ᠨ婬ᠤ㰵 堻 ٍ󍍍 썍철堻 占占岠 䍠嫱岫堻 卍 쳠ᠤ㰵 ᠨ婬ᠨ岩ᠤ㰵 ᠨ婬ᠨ岩쳍፠ 忍철 卍 ߍ ᠣ ፠堻 占ፍᠤ㰵 ᠨ婬ᠤ㰵 ᠨ婬󍍍 ፠፠፠ᠤ㰵 ᠤ䲬ᠤ㰵 ᠤ䲬ᠤ䳬ᠤ㰵 ᠤ䲬򲍍፠፠ᠤ淍󍍍 ፠㠠 堻 ፍᠣ栻 占堻 忍 卍렻 ㍠ 占፠󍍍 ፠占 占卍㍠렻 占፠󍍍 ፠렻 ㍠፠󍍍 ᠣ ᠣ 占ᠣ 占󍍍 堻 ؍堻 䍍荠荠蠻 􍍠㍠ 䠣捠𠣧 占䳍㠣 썍䳠蠻 荠占󍍍 ᠤ㰰 󍍍 蠻 ፠堻 卍  蠻 ፠፠፠ ፠ ᠣ砻 占ፍ歱 占፠፠ᠣ 占獠 占ᠣ፠ᠠ 덠⠰頧 ݧ頧 ݧ ፠ᠤ㰹 ᠤṍ፠鍍 獠 獠ḍḍḍḍ 獠䰍䰍䰍䰍 \ No newline at end of file +* ------------------------------ +* apple 80 col driver +* ------------------------------ + lst off + + rel + dsk rel/apple80 + +cr equ $0d +lf equ $0a +bs equ $08 + +wndlft equ $20 +wndwdth equ $21 +wndtop equ $22 +wndbtm equ $23 +ch equ $24 +cv equ $25 +blink equ $26 +oldcv equ $27 +base equ $28 +base2 equ $2a +x_save equ $2c +y_save equ $2d +invflg equ $32 + +vid80 ent + org $900 + + jmp init + jmp cls + jmp cout + jmp scroll + jmp banner + jmp clrlast + jmp rdinit + jmp rdkey + jmp rdend + jmp window + jmp read + jmp keyin + jmp xypos + jmp shchat + +; init 80 col video + +init sta $c00d ; turn on 80 cols + sta $c001 ; turn on 80 store + sta $c00f ; turn on aux chrset + + lda #0 ; reset screen + sta blink + sta wndlft + sta wndtop + sta invflg ; set to 'normal' mode + lda #80 + sta wndwdth + sta oldcv ; make sure it is different! + lda #24 + sta wndbtm + +; ___fall through to cls___ + +cls ldx wndtop +cls1 jsr setbase ; setup base address + ldy #39 + lda #" " +cls2 sta $c055 ; clear screen 1 + sta (base),y + sta $c054 ; clear screen 2 + sta (base),y + dey + bpl cls2 + + inx + cpx wndbtm ; is there more? + bne cls1 ; yep + +; ___fall through to home routine___ + +home lda #0 ; home cursor + sta ch + lda wndtop ; set to top margin + sta cv + tax + +; ___fall through to setbase routine + +setbase cpx oldcv ; do we have the base already? + beq setbas2 ; yep + + pha + txa + asl a ; x = x * 2 + tax + lda scrnadr,x ; get and save address + sta base + lda scrnadr+1,x + sta base+1 + txa + lsr a ; x = x / 2 + tax + stx oldcv ; update old cv value + pla + +setbas2 rts + +; output a character +cout stx x_save ; save everything + sty y_save + pha + + and #$7f ; clear high + cmp #cr + beq cout2 + cmp #lf + beq cout3 + cmp #bs + beq cout5 + cmp #' ' + bcc cout4 + + ldx cv ; set base + jsr setbase + + ora #$80 + bit invflg ; inverse? + bpl cout1a ; nope + + and #$7f ; is it a symbol? + cmp #'@' + bcc cout1a ; yep + + cmp #'a'-1 ; lowercase? + bcs cout1a ; yep + + and #$3f ; put into $00-$1f range if upper + +cout1a sec ; save char + ldy y_save + jsr setscrn ; set proper screen + + inc ch ; move over 1 space + ldy ch + cpy #80 ; wrap-around? + bne cout4 ; nope + +cout2 ldy #0 ; reset horiz + sty ch + +cout3 inc cv ; go down 1 line + lda cv ; is it in range? + cmp wndbtm + bne cout4 ; nope + + dec cv ; put it back + jsr scroll +cout4 pla + ldx x_save ; restore stuff + ldy y_save + rts + +cout5 dec ch ; backup + bpl cout4 ; all is well + + lda #79 ; move to end of line + sta ch + + lda cv ; are we at the top + cmp wndtop + beq cout4 ; yep + + dec cv + jmp cout4 ; ok, we are done + + +; setup the proper screen and setup Y +setscrn sty y_save ; save offset + php + pha + lda ch + lsr a ; get screen offset into Y + tay + sta $c055 + bcc *+5 ; select text page + sta $c054 + pla + + plp ; get command status + bcc setscr1 ; opps, read char + sta (base),y ; save char + bcs setscr2 +setscr1 lda (base),y +setscr2 sta $c054 ; select main memory + ldy y_save ; restore Y + rts + + +; scroll the screen down 1 line +scroll ldx wndtop ; get first line to scroll + +scroll2 jsr setbase ; get the first base + lda base + sta base2 ; move to second + lda base+1 + sta base2+1 + inx + jsr setbase ; get other base + + ldy #39 ; copy line +scroll3 sta $c055 ; do screen 1 + lda (base),y + sta (base2),y + sta $c054 ; do screen 2 + lda (base),y + sta (base2),y + dey + bpl scroll3 + + txa + tay + iny + cpy wndbtm ; done? + bne scroll2 ; nope + +; ___fall through into clear last line routine___ + +clrlast ldx wndbtm ; get line to clear + dex + lda #" " ; clear to spaces + +clrlst2 pha + jsr setbase ; point to last line + pla + + ldy #39 +clrlst3 sta $c055 ; fill screen 1 + sta (base),y + sta $c054 ; fill screen 2 + sta (base),y + dey + bpl clrlst3 + rts + + +; scroll a character across the bottom line +banner pha + txa + pha + ldx #0 + sta $c054 ; start with screen 2 on +banner2 lda $7d2,x + sta $c055 ; turn on screen 1 + sta $7d2,x + + lda $7d3,x + sta $c054 ; turn on screen 2 + sta $7d2,x + + inx + cpx #$26 + bne banner2 + + pla + tax + pla + sta $7f7 + rts + + +; get a character -- non destructable +rdkey pha + clc ; read screen + jsr setscrn + sta y_save ; save data + + lda #$df ; underline + cmp y_save ; is it in underline phase? + bne rdkey2 ; nope, put it there + + lda blink ; put into character phase +rdkey2 sec + jsr setscrn ; put charcter there + pla + rts + + +; init rdkey routine +rdinit pha + stx x_save + ldx cv ; setup vertical base + jsr setbase + + clc + jsr setscrn + sta blink ; save blink character + ldx x_save + pla + rts + + +; finish up rdkey routine +rdend pha + lda blink ; restore old character + sec + jsr setscrn + pla + rts + + +; set up window for top of screen display +window ldx #0 + lda #'-' ; print a line of "-" + jsr clrlst2 + ldx #3 + jsr clrlst2 ; do the other line of "-" + dex + lda #' ' + jsr clrlst2 ; print a blank line + dex + jsr clrlst2 + lda #4 ; print another blank line + sta wndtop + rts + + +; read the data off a line of the screen +read stx x_save ; save X + jsr setbase ; x = line to read + + lda ch + ldx ch + sty ch ; use Y for offset + + clc + jsr setscrn ; get data on screen + and #$7f + cmp #' ' ; convert inverse + bcs read3 + + adc #'@' ; make normal + +read3 stx ch ; restore ch + ldx x_save + rts + + +; check the local keyboard +keyin lda $c000 ; gads, we do a whole lot! + rts + + +; do x-y positioning +xypos stx ch ; set position + sty cv + tya + tax + jmp setbase ; setup base + + +; show that chat has been selected +shchat tax + lda wndtop ; are we full screen? + beq shchat5 ; yep, dont display + + lda ch ; save location + pha + lda cv + pha + txa + beq shchat3 ; cover it up + + pha + ldy #0 + ldx #33 ; position cursor + jsr xypos + lda #-1 + sta invflg ; set inverse mode + pla + + tay + ldx msgoff-1,y +shchat2 lda chatmsg,x ; print chat message + inx + pha + jsr cout + pla + bpl shchat2 + + lda #0 ; set normal mode + sta invflg + beq shchat4 ; finish up + +shchat3 ldx #0 ; fix top line + lda #'-' + jsr clrlst2 + +shchat4 pla + tay + pla ; move back + tax + jsr xypos +shchat5 rts + +msgoff db 0,12 + +chatmsg dci '[ Page: On ]' + dci '[ Exec: On ]' + + +; handle any incoming interupts +irq pha + lda $c099 ; clear int + lda $c0a9 + pla + rti + + +; table of screen address +scrnadr dw $400 ; first 1/3 decoding + dw $480 + dw $500 + dw $580 + dw $600 + dw $680 + dw $700 + dw $780 + + dw $428 ; second 1/3 decoding + dw $4a8 + dw $528 + dw $5a8 + dw $628 + dw $6a8 + dw $728 + dw $7a8 + + dw $450 ; third 1/3 decoding + dw $4d0 + dw $550 + dw $5d0 + dw $650 + dw $6d0 + dw $750 + dw $7d0 + + end diff --git a/Source/Config/Video/Videx.S b/Source/Config/Video/Videx.S index 31793f4..bf77db1 100644 --- a/Source/Config/Video/Videx.S +++ b/Source/Config/Video/Videx.S @@ -1 +1,516 @@ - 捍썠⍍㰵㰸㰸㰰䰰砤썠䍠䍠􍍻  ߱ ߱ 荍߲ᠣ 砻 卍ᠣ 荠荍峫 ፠峫 ߍ 占 忍󱠻 ߍ 荠 卍፠፠፠፠㍠ 占򫱬 嫱፠፠󍍍 堻 獠占ፍ䠣栻 荠捠𠣧 ፠占獠ᠣ 卍荠􍍠蠻 占荠 俍 卍 荍 占 忍𠣲 卍 덠፠ፍ፠ 占占ᠤ㍠㠣 占 ፍ堻 捠占蠻 썍ᠣ 占荍 卍 ㍠ 㠣􍍠 㠣 堻 卍 ߍ ᠣ 占፠堻 占ፍ 占󍍍 ፠占占堻 卍㍠堻 占荠嫱 占㠣ᠣ 占占󍍍 ፠ᠣ ᠣ፠󍍍 堻 䍍ᠣ⹠ ፠䠣捍ᠣ 󍍍 󱍍፠㍠ᠣᠣ㠣፠  占󲍍፠㍠占占嫱嫱󍍍 ፠卍㍠፠占ᠠ ᠣ嫱ᠠ ፠䠣 獠፠፠ᠣ𰍠㠣 󱫲፠ 卍፠ᠤ捠ᠤ㰰 占占󍍍 荠፠卍 ᠣ 占ᠤ㰱ᠤ㰰 䍠 ፍ㫱 忍 卍𠣢Ϣ ύ𠣢堪 ЍᠣТ𠣢ݢ堪 ͍ᠣ͢𠣢ޢ堪 ΍ᠣ΢𠣢 㰶 䍠 䍍 𠣰 󍍍 ᠣ ߍ 𿍠嶠 卍屠堻 ᠣ岠 占岍峠ᠤ巠 􍍠堻 俍巠 卍ᠣ 䍍巠ᠣ 峍占ᠣ崠 占崍占 ᠣ􍍠 栻 嶠 歱嵠 占 嵍嶠󍍍 捠堻 ⠰⠰㠢 ݢ㠢 ݢ ⠤⬤嬤⬤⠤⠰ \ No newline at end of file +* -------------------------- +* videx 80 col bios +* -------------------------- + lst off + + rel + dsk rel/videx + +cr equ $0d +lf equ $0a +bs equ $08 +syn equ $16 +esc equ $1b + +slot equ 3 + +shift equ $20 +wndwdth equ $21 +wndtop equ $22 +wndbtm equ $23 +ch equ $24 +cv equ $25 +testbyt equ $26 +base equ $28 +start equ $2a +x_save equ $2c +y_save equ $2d +z_save equ $2e +yoffset equ $2f +invflg equ $32 +hdrhide equ $33 + +softon equ $c059 +dev0 equ $c080+slot*16 +dev1 equ $c081+slot*16 +disp0 equ $cc00 +disp1 equ $cd00 + +videx ent + org $0900 + +begin jmp init + jmp cls + jmp cout + jmp scroll + jmp banner + jmp clrlast + jmp rdinit + jmp rdkey + jmp rdend + jmp window + jmp read + jmp keyin + jmp xypos + jmp shchat + +; init 80 col video + +init ldx #0 ; do 16 byte init + stx start + stx start+1 +init_1 stx dev0 ; select reg to init + lda crtinit,x + sta dev1 ; init it + inx + cpx #16 + bne init_1 + + sta softon ; turn on soft switch + +init_2 lda #0 ; reset screen + sta shift + sta wndtop + sta invflg ; set to 'normal' mode + + lda #80 ; set window width + sta wndwdth + + lda begin-$100+12 + sta update3+1 ; point to top of screen data + lda begin-$100+13 + sta update3+2 + +; ___fall through to cls___ + +cls ldx wndtop +cls1 jsr clrlst1 ; clear each line + inx + cpx #24 ; is there more? + bne cls1 ; yep + +; ___fall through to home routine___ + +home ldx #0 ; home cursor + stx ch + ldx wndtop + stx cv + +; ___fall through to setbase routine + +setbase pha + txa + pha + asl a + tax + + clc + lda start ; get base address + adc scrnadr,x + sta base + lda start+1 + adc scrnadr+1,x ; update address + sta base+1 + + pla + tax + pla + rts + + +; output a character +cout stx x_save ; save everything + sty y_save + pha + + and #$7f ; clear high + cmp #cr + beq cout2 + cmp #lf + beq cout3 + cmp #bs + beq cout5 + cmp #' ' + bcc cout4 + + ldx cv ; point to data + jsr setbase + bit invflg + bpl cout1 + ora #$80 ; make inverse + +cout1 ldy ch + jsr dataout + + inc ch ; move over 1 space + ldy ch + cpy #80 ; wrap-around? + bne cout4 ; nope + +cout2 ldy #0 ; reset horiz + sty ch + +cout3 inc cv ; go down 1 line + lda cv ; is it in range? + cmp #24 + bne cout4 ; nope + + dec cv ; put it back + jsr scroll +cout4 pla + cmp #syn+128 + bne cout4a + + pha + ldx #0 ; go to top line + jsr setbase + lda $427 + clc + adc #"@" ; make into legal range + ldy #79 + jsr dataout ; display on screen + pla + +cout4a ldx x_save ; restore stuff + ldy y_save + rts + +cout5 dec ch ; backup + bpl cout4 ; all is well + + lda #79 ; move to end of line + sta ch + + lda cv ; are we at the top + cmp wndtop + beq cout4 ; yep + + dec cv + jmp cout4 ; ok, we are done + + +; scroll the screen down 1 line +scroll clc + lda start ; advance screen pointer + adc #80 + sta start + + ldx #13 + stx dev0 ; save low byte of address + sta dev1 + + lda start+1 + adc #0 + sta start+1 + + dex + stx dev0 ; save high byte of address + sta dev1 + jsr update ; posible top of screen update + +; ___fall through into clear last line routine___ + +clrlast ldx #23 ; get line to clear +clrlst1 lda #' ' ; clear to spaces + +clrlst2 stx x_save + pha + jsr setbase ; position to last line + pla + + ldx #0 + stx yoffset +clrlst3 jsr quicksv ; clear last line + inx + cpx #80 + bne clrlst3 + ldx x_save +banner rts + + +; init rdkey routine +rdinit pha + stx x_save + sty y_save + ldx cv + jsr setbase ; setup base + + clc + lda base ; point to low byte + adc ch + ldx #15 + stx dev0 + sta dev1 + + lda base+1 ; point to high byte + adc #0 + ldx #14 + stx dev0 + sta dev1 + + ldx #10 + stx dev0 + lda #$48 ; blink cursor + sta dev1 + ldx x_save + ldy y_save + pla +rdkey rts + + +; finish up rdkey routine +rdend pha + lda #10 + sta dev0 ; remove cursor + lda #$28 + sta dev1 + pla + rts + + +; read the data off a line of the screen +read jsr setbase ; x = line to read + + lda #$b9 ; change STA to LDA + sta dataot1 + + jsr dataout ; get data + and #$7f + + lda #$99 ; change LDA back to STA + sta dataot1 + rts + + +; quick data output routine +quicksv ldy yoffset + bne quicks1 + + pha + jsr dataout + sec + lda #1 + sbc yoffset + sta testbyt + lda #1 + sbc #0 + sta testbyt+1 + pla + rts + +quicks1 sta disp0,y ; save data on screen + inc yoffset ; save offset for next write + bne quicks2 + + pha + clc + lda base + adc testbyt + sta base + lda base+1 + adc testbyt+1 + sta base+1 + pla +quicks2 rts + + +; special data output routine +dataout pha + sty z_save + + clc + tya + adc base + pha ; save character offset + lda #0 + adc base+1 + + pha ; save 1/2 number (0 or 1) + asl a + and #%00001100 + tay ; select 512 byte paging + lda dev0,y + + pla + lsr a + lda #>disp0 + adc #0 ; get page number in A + sta dataot1+2 + sta quicks1+2 + + pla + tay ; get index into page + + pla + sta $cfff + sta $c000+slot*256 +dataot1 sta disp0,y + iny + sty yoffset ; save offset to next write + ldy z_save + rts + + +; do x-y positioning +xypos sty cv + stx ch + tya + tax + jmp setbase + + +; check for local keyin +keyin1 lda #$60 + eor shift ; toggle shift byte + sta shift + +keyin0 sta $c010 +keyin lda $c000 ; check keyboard + bpl keyin2 ; no data + + cmp #esc+128 ; change case? + beq keyin1 ; nope + + cmp #"O"-$40 ; dont allow ctrl-O + beq keyin0 + + cmp #"@" + bne *+4 ; translate @ --> P + lda #"P" + + cmp #"]" + bne *+4 ; translate ] --> M + lda #"M" + + cmp #"^" + bne *+4 ; translate ^ --> N + lda #"N" + + cmp #"A" ; dont shift below this + bcc keyin2 + + bit $c063 ; check shift-key mod + bpl keyin2 ; dont change data, they shifted + + ora shift ; possible shift + +keyin2 cmp #0 ; reset all flags + rts + + +; print top of screen window +window lda #4 + sta wndtop + +; ___ fall through into update routine ___ + +; update top of screen display +update lda wndtop ; re-display top? + beq update6 ; nope + +update1 ldx #0 + stx yoffset + jsr setbase ; point to top of screen + ldy #0 + + lda #"-" + ldx #0 +update2 jsr quicksv ; put top line + inx + cpx #80 + bne update2 + + ldx #0 +update3 lda $1234,x + bpl update7 ; normal text + + bit hdrhide ; hide password? + bpl update7 ; nope + + lda #"*" ; cover password + +update7 ora #$80 ; display top of screen + jsr quicksv + inx + cpx #160 + bne update3 + + ldx #3 + jsr setbase + ldx #0 + stx yoffset + ldy #0 + + lda #"-" +update4 jsr quicksv ; show bottom line + inx + cpx #80 + bne update4 + + ldx #0 + jsr setbase + ldy #32 ; htab 33 + lda #"-" + jsr dataout + + ldx #12 ; save counter + stx lnlen + + ldx chatoff ; get chat offset + beq update6 ; no display + lda msgoff-1,x + tax + +update5 lda chatmsg,x + jsr quicksv ; put onto top line + inx + dec lnlen ; count down + bne update5 + +update6 rts + + +; show that chat has been selected +shchat sta chatoff + jmp update ; display new screen + +chatoff db 0 + +msgoff db 0,12 + +chatmsg asc "[ Page: On ]" + asc "[ Exec: On ]" + + +; table of screen address +scrnadr dw 0 + dw 80 + dw 160 + dw 240 + dw 320 + dw 400 + dw 480 + dw 560 + dw 640 + dw 720 + dw 800 + dw 880 + dw 960 + dw 1040 + dw 1120 + dw 1200 + dw 1280 + dw 1360 + dw 1440 + dw 1520 + dw 1600 + dw 1680 + dw 1760 + dw 1840 + +crtinit db $7b,$50,$5e,$29,$1b,$08,$18,$19 + db $00,$08,$28,$08,$00,$00,$00,$00 + +lnlen db 0 + + end