; ; File - DEC4 AAAAAAAAAAAA Main interr servic code ; ; ; interr BIT stat00 ;Check if it is ours BPL intign ; Definitely not LDAIM 8 ; Mask for int disable bit BIT oldctr BNE intok ; Our ints still enaled, so must be it. intign JMP ignore intok JSR disab ; Disable interrs from the decoder CLI ; Allow nested interr LDYIM 0 ; Row number rowget STY rowcnt STY rowreg ; Set it in decoder as well as RAM ;BIT stat00 ;BVS ovrrun LDA datare ; Framing code or 0 if no row BNE gotrow ; Got one! nextro LDY rowcnt INY ; Next row CPYIM 16 ; Number of rows BNE rowget LDA stat00 STA intzp0 BIT intzp0 BVC exitin ovrrun ; ***** WAS TAKEN OUT/.. JSR zapmag exitin ; Exit page grabber, allow more interrs ;LDAIM 15 ; JUST TO MAKE SURE.. ;STA rowreg ; STA status ; Clear the interr status in the TTXT decoder ; JSR enab ; Set interr enable bit ; *** Both removed to BUFMAN JMP bufman ; Go and sort out buffers ;****ACS******EXIT PAGE GRABBING ROUTINE************** badMRA ; badrow JSR zapmag ; Clear out all pointers to buffers being filled badhea LDY rowcnt STY rowreg LDAIM 0 STA datare JMP nextro ; gotrow ; Found somthing in the decoder RAM ;So mark the row by zeroing the Framing code STY rowreg ; Y already contains - reset to start of row LDAIM 0 STA datare ;Now decode row & magazine LDX datare ; Get 1st byte of MRAG JSR hamm00 ; Decode the Hamming code - result in A BMI badMRA ; Ignore row if hammin fails (OK = 4 bits, fail =&FF) PHA ; Save whole nibble ANDIM 07 ; Mask out row bit STA thisma ; Save for future use TAY ; And for use just ahead PLA ; Get back whole nibble (Already checked hammin) ;Get row bit from magazine byte CMPIM 8 ; Carry = bit3 - if it was set, always >=8 else <8 & C=0 PHP ; **** PRESERVE CARRY **** (GT) LDX datare ; row 'byte' (condenses to nibble) JSR hamm00 ; Decode hammin code X to nibble in A BPL Notbad ;Kill all reception if bad hammin (max 4 bits if OK) plp jmp badMRA Notbad PLP ; **** RESTORE CARRY **** (GT) ROLA ; Shift in bit from mag nibble (was in carry) STA thisro ; Complete 5-bit row number BNE nothea JMP header ; If header, go & sort it out nothea CPYIM 0 BNE notTSD Lda thisro CMPIM 30 Bne notTSD LdaIM :LSB: TSbuff Sta intzp0 ldaIM :MSB: TSbuff Sta intzp1 LdxIM 40 LdyIM 0 Jmp xferda notTSD ; Y has magazine no from earlier LDXAY magptr ; X is now offset to control block (or &FF) INX ; Now points to address of buffer+1 or =0 if no buffer BEQ nextro LDAAX ctrlbl-1 ; Lo of buffer addr (X has been INC'd) STA intzp0 LDAAX ctrlbl ; Hi STA intzp1 LDA thisro CMPIM 26 ; Number of text rows LDYIM 1 ; Offset start of buffer to next row ptr.(needed just ahead) BCC norrow ; If a text row LDAIY intzp0 TAX ADCIM 0 STAIY intzp0 ; Update pointer ;Back to old value TXA norrow ; Gets here with (intzp0)= page buffer, A=effective row number ;also Y=1. NB entered here from header also DEY ; offset to max rows CMPIY intzp0 BCS next00 ; Ignore rows above max number ;Now multiply by 48! STA intscr LDAIM 0 STA ints00 LDYIM 4 ; Number of shifts wanted shiftr CLC ROL intscr ; Lo byte ROL ints00 ; Roll in carry DEY BNE shiftr ;Now *16 CLC LDA intzp0 ; Lo of base ADC intscr ; Lo of offset STA intzp0 LDA intzp1 ; Hi ADC ints00 STA intzp1 CLC ROL intscr ; Now *2 again = *32 ROL ints00 CLC LDA intzp0 ; Lo of base ADC intscr ; Lo of offset STA intzp0 LDA intzp1 ; Hi ADC ints00 STA intzp1 ;Now ready to roll in row data LDYIM 2 ; offset pointer (skipping over the two bytes at the start) LDA thisro STAIY intzp0 LDYIM 10 ; Bytes 1 to 7 are spare for use by other routines LDXIM 40 ; Number of bytes per row xferda LDA datare ; Get a byte STAIY intzp0 INY DEX BNE xferda next00 JMP nextro ; Also entered from elsewhere ; ;******************* Header ******************* ; Do rolling headers, & generate the below info. ; also copy into headbuf as in ARGs version. ;*** Zapmag(thisma) and JMP badhea IF error ; (Headerflags) ; [Thismag|<-thispa[1..6]->|update+magserial+...] ; (ONE BYTE) ONE BYTE, BIT6=UPDATE duffhe LDY thisma LDXAY magptr INX BEQ gojump ; no reception to be zapped... DEX JSR Zap ;(X,Y) gojump JMP badhea header LDYIM 0 head1 ; The header bytes are put into headbu in the order they arrive. LDX datare JSR hamm00 BMI duffhe STAAY headbu INY CPYIM 8 BNE head1 LDAIM 0 STA thishe ; prepare to collect header flags ; Now construct internal form of header line ;Thismag, Thispage[0..6],thishe ; (Thismag already done from MRAG) LDA headbu+5 ANDIM 3 STA thispa+2 ; Hrs 10s LDA headbu+4 ANDIM &F STA thispa+3 ; Hrs 1s LDA headbu+3 ANDIM 7 STA thispa+4 ; Mins 10s LDA headbu+2 ANDIM &F STA thispa+5 ; Mins 1s LDA headbu+1 ANDIM &F STA thispa+0 ; Page 10s LDA headbu+0 ANDIM &F STA thispa+1 ; Page 1s ; ; header flags are condensed into one byte ; so bits in mask are select appropriately LDAIM 4 BIT headbu+groupA BEQ htest1 LDA thishe ORAIM intseq ; Interrupted sequence C9 STA thishe htest1 LDAIM 8 BIT headbu+groupA BEQ htest2 LDA thishe ORAIM inhibd ; No displa of page at all C10 STA thishe htest2 LDAIM 1 BIT headbu+groupB BEQ htest3 LDA thishe ORAIM magser ; Magazine serial page C11 STA thishe htest3 LDAIM 8 BIT headbu+3 ; C4 is in Mins 10s slot. C4 BEQ htest4 LDA thishe ORAIM eraseF STA thishe ; erase page htest4 LDAIM 2 BIT headbu+groupA BEQ htest5 LDA thishe ORAIM update ; Update C8 STA thishe htest5 LDAIM 1 BIT headbu+groupA ;Suppress header C7 BEQ htest6 LDA thishe ORAIM suphea STA thishe htest6 ; Newsflash& subtitle tests omitted. ; ; ; Now do header tests -can we displa this header? ; ; LDA head00+1 BEQ nodisp ; no rolling headers wanted. (0 page address given) ; LDAIM intseq BIT thishe BNE nodisp ; out of sequence ; LDAIM suphea BIT thishe BNE nodisp ; header only suppresed. ; LDAIM inhibd BIT thishe BNE nodisp ; Whole page suppressed ; LDAIM magser BIT thishe BNE displa ; Display unless magazine serial set, ; with select mag matching one offered. ; LDX select LDAAX ctrlbl+inuse CMPIM &40 BNE displa ; CB valid, so check mag wanted. LDAAX ctrlbl+2 ; Mag no. of current page BMI displa ; WILD!!! ANDIM 7 CMP thisma BNE nodisp ; magser, and not same... so don't displa ; displa LDA head00 STA intzp0 LDA head00+1 STA intzp1 LDYIM 0 LDXIM 32 headlo LDA datare ORAIM &80 STAIY intzp0 ; WRITE ROLLING HEADER INY DEX BNE headlo nodisp ; LNK DEC4B