Mercurial > hg > Members > kono > nitros9-code
changeset 1322:273cf463b5fe
Backported to OS-9 Level One
author | boisy |
---|---|
date | Thu, 04 Sep 2003 20:46:44 +0000 |
parents | acc63d0452bd |
children | 35a9b809b980 |
files | level2/modules/ssp.asm level2/modules/sspak.asm |
diffstat | 2 files changed, 0 insertions(+), 213 deletions(-) [+] |
line wrap: on
line diff
--- a/level2/modules/ssp.asm Thu Sep 04 20:46:30 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -******************************************************************** -* SSP - Speech-Sound Pak device descriptor -* -* by Bruce Isted (CIS 76625,2273) -* released to the Public Domain 87/05/02 - -* $Id$ -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ - - nam SSP - ttl Speech-Sound Pak device descriptor - - ifp1 - use defsfile - endc - -PageAddr equ $07 extended page address (set to $FF for level 1) -PortAddr equ $FF7D Speech-Sound Pak base address -SVrsn equ $00 - - mod SEnd,SNam,Devic+Objct,ReEnt+SVrsn,MgrNam,DrivrNam - fcb SHARE.+PWRIT.+WRITE. device capabilities - fcb PageAddr - fdb PortAddr - fcb SOptEnd-*-1 option table size - fcb DT.SCF device type - fcb $00 case (0=both, 1=upper only) - fcb $00 backspace (0=bse, 1=bse,sp,bse) - fcb $01 delete (0=bse over line, 1=CR) - fcb $00 echo (1=echo) - fcb $00 auto LF (0=no auto LF) - fcb $00 EOL null count - fcb $00 pause (1=page pause) - fcb $00 lines per page - fcb C$BSP backspace character - fcb $18 delete line character - fcb C$CR end of record character - fcb $00 end of file character - fcb $04 reprint line character - fcb $01 dup last line character - fcb $00 pause character - fcb $00 interrupt character - fcb $00 quit character - fcb $00 backspace echo character (bse) - fcb $00 line overflow character - fcb $00 initialization value (parity) - fcb $00 baud rate - fdb $0000 attached device name offset - fcb $00 xon character - fcb $00 xoff character -SOptEnd equ * -SNam fcs "SSP" -MgrNam fcs "SCF" -DrivrNam fcs "SSPak" - - emod -SEnd equ * - end -
--- a/level2/modules/sspak.asm Thu Sep 04 20:46:30 2003 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -******************************************************************** -* SSPak - Speech-Sound Pak Text-To-Speech Driver -* -* $Id$ -* -* by Bruce Isted (CIS 76625,2273) -* released to the Public Domain 87/05/03 -* -* This driver supports only the Speech-Sound Pak's text-to-speech mode. -* Bit 7 is cleared and control codes are filtered to ensure that only carriage -* returns and characters in the range of $20-$7F (inclusive) are passed. A -* character count and automatic buffer flush is used, which should prevent -* buffer overflow in the Speech-Sound Pak. -* -* Due to way the COCO's sound select circuitry is tied in with other sound -* sources and the joysticks, only one will function at a time. This means -* that while the Speech-Sound Pak is active other sound sources and/or the -* joysticks cannot be used. Speech output is enabled only when a carriage -* return is received, or when the buffer is flushed. Speech output is -* disabled as soon as the Speech-Sound Pak is finished speaking the string -* received before the carriage return or buffer flush. -* -* Ed. Comments Who YY/MM/DD -* ------------------------------------------------------------------ -* 1 Created BRI 87/05/03 - - nam SSPak - ttl Speech-Sound Pak Text-To-Speech Driver - - ifp1 - use defsfile - endc - -BuffCnt equ 200 character count before flushing buffer (0-255) -BusyBit equ %10000000 SSPak busy status bit (active low) -CharMask equ %01111111 printable ASCII character mask -CRA equ $01 PIA CRA offset -CRB equ $03 PIA CRB offset -MUXBit equ %00001000 COCO sound MUX control/select bit position -SpeakBit equ %01000000 SSPak speech status bit (active low) -SSPData equ $01 SSPak data register offset -SSPReset equ $00 SSPak reset register offset -SSPStat equ $01 SSPak status register offset - -rev equ $00 -edition set 1 - - mod SEnd,SNam,Drivr+Objct,ReEnt+rev,SEntry,SMem - - org V.SCF SCF manager data area -Count rmb 1 character counter -SMem equ . - - fcb SHARE.+PWRIT.+WRITE. device capabilities - -SNam fcs "SSPak" - fcb edition - -SEntry lbra SInit - lbra SRead - lbra SWrite - lbra SGetStat - lbra SSetStat - lbra STerm - -SInit equ * -STerm equ * - ldx V.PORT,u - ldb #$01 - stb SSPReset,x reset SSPak - clrb - stb SSPReset,x end SSPak reset - rts - -SRead comb - ldb #E$BMode - rts - -SWrite anda #CharMask strip MSBit of character - cmpa #C$CR carriage return? - beq SpkOut yes, go enable SSPak speech output - inc Count,u increment character counter - cmpa #C$SPAC higher than space? - bhi WritChar yes, go write character to SSPak - lda #C$SPAC only space allowed through here - ldb Count,u get current character count - cmpb #BuffCnt time to flush buffer? - blo WritChar no, go write space to SSPak -SpkOut clr Count,u reset character count - ldy #PIA0Base - lda CRA,y get PIA0 CRA - ldb CRB,y get PIA0 CRB - pshs d save them - anda #^MUXBit clear PIA0 CA2 control LSBit - orb #MUXBit set PIA0 CB2 control LSBit - sta CRA,y * set COCO sound MUX to cartridge input - stb CRB,y * - ldy #PIA1Base - ldb CRB,y get PIA1 CRB - pshs b save it - orb #MUXBit set PIA1 CB2 control LSBit - stb CRB,y enable COCO sound MUX - lda #C$CR load execute speech character - bsr WritChar go write command character to SSPak - bsr SSWait go wait until SSPak has finished - puls b recover original PIA1 CRB - stb CRB,y disable COCO sound MUX - puls d recover original PIA0 CRA & CRB - ldy #PIA0Base - sta CRA,y *restore COCO sound MUX to previous setting - stb CRB,y * - clrb - rts -WritChar bsr BusyWait go check if SSPak is busy - sta SSPData,x write character to SSPak - clrb - rts - -SGetStat equ * -SSetStat equ * - comb - ldb #E$UnkSvc - rts - -BusyWait ldx V.PORT,u - ldb SSPStat,x get SSPak status - andb #BusyBit SSPak busy? - beq BusyWait yes, go check again - ldb SSPStat,x *allow for slow busy bit - andb #BusyBit * - beq BusyWait * - ldb SSPStat,x *allow for very slow busy bit - andb #BusyBit * - beq BusyWait * - rts - -SSWait ldx V.PORT,u - ldb SSPStat,x get SSPak status - andb #SpeakBit SSPak speech active yet? - bne SSWait no, go check again -SSWait0 ldx #$0001 sleep remainder of tick - os9 F$Sleep - ldx V.PORT,u - ldb SSPStat,x get SSPak status - andb #SpeakBit SSPak speech still active? - beq SSWait0 yes, go sleep some more - rts - - emod -SEnd equ * - end -