; Altirra Acid800 test suite ; Copyright (C) 2010 Avery Lee, All Rights Reserved. ; ; Permission is hereby granted, free of charge, to any person obtaining a copy ; of this software and associated documentation files (the "Software"), to deal ; in the Software without restriction, including without limitation the rights ; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ; copies of the Software, and to permit persons to whom the Software is ; furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ; SOFTWARE. _SAP_HEADER "PIA: Interrupt control test" opt h+o+ icl 'library.s' irqflag equ $80 org $2000 main: ldy #>testname lda # $3C transition sets pending flag which is turned into ;IRQB2 flag on input mode. The actual choice of input mode ;doesn't matter. dta $34,$3c,$3c,$04, $44,$00 dta $34,$3c,$3c,$0c, $4c,$01 dta $34,$3c,$04,$04, $44,$00 ;Any output mode clears IRQB2. dta $34,$3c,$04,$24, $24,$00 ;Handshake mode (100) can be between the 34:3C sequence. Pulse ;output mode (101) cannot be, nor can an input mode. dta $34,$24,$3c,$04, $44,$00 dta $34,$28,$3c,$04, $04,$00 dta $34,$04,$3c,$04, $04,$00 ;High-low-high sequence does not work. dta $34,$3c,$34,$04, $04,$00 dta $3c,$34,$3c,$04, $44,$00 dta $00 ;========================================================================== ;Port A test vectors ; testvec_a: ;IRQA2 is set if the line is forced low (34) and the next input ;mode is for a negative-to-positive transition (14/1C). The line ;can temporarily be raised (3C) in any pattern as long as it is ;lowered at some point. dta $3c,$3c,$3c,$14, $14,$00 dta $3c,$3c,$34,$14, $54,$00 dta $3c,$34,$3c,$14, $54,$00 dta $3c,$34,$3c,$1c, $5c,$01 dta $34,$34,$34,$04, $04,$00 ;Pulse output mode (2c) clears the pending transition, but ;handshake mode does not. dta $34,$34,$2c,$14, $14,$00 dta $34,$34,$24,$14, $54,$00 ;Any output mode clears IRQA2/IRQB2. dta $34,$34,$14,$34, $34,$00 dta $00 ;========================================================================== .proc checkIRQ mwa #irqHandler vimirq lda #0 cli :8 nop sei rts irqHandler: pla pla pla lda #1 rts .endp ;========================================================================== run $2000 end