; 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. opt h+o+ icl 'library.s' org $e0 verdet dta 0 VERONICA_CTL = $D5C0 ;============ NON-RESIDENT SECTION ============ org $2000 .proc main ;save and turn off display (it may or may not be on) lda sdmctl pha lda #0 sta sdmctl sta dmactl sei ;turn on both windows, make sure they are read/write lda $8000 pha eor #$55 tax lda $A000 pha eor #$33 tay mva #$38 VERONICA_CTL lda #0 stx $8000 sty $A000 cpx $8000 seq:adc #1 cpy $A000 seq:adc #1 tax pla sta $A000 pla sta $8000 mva #0 VERONICA_CTL txa bne veronica_fail ;upload resident code mva #$28 VERONICA_CTL ldy #0 mva:rne $3F00,y $BF00,y+ ;launch mva #$AB VERONICA_CTL vwait: bit VERONICA_CTL bpl veronica_pass dey bne vwait veronica_fail: pla sta sdmctl mva #0 VERONICA_CTL cli jsr _imprint dta c"Error: Veronica not found.",$9b,$9b,0 jmp _waitKeyPrompt veronica_pass: pla sta sdmctl mva #0 VERONICA_CTL cli mva #$ff _veronica rts .endp ;========================================================================== ; RESIDENT CODE (6502) ;========================================================================== org $0900 .nowarn .proc _veronicaLaunch2 ;temporarily turn off display and suspend stage 2 VBLANK pha lda sdmctl sta sdmctl_save lda #0 sta sdmctl sta dmactl sei ;bank in Veronica mva #$a8 $d5c0 ;copy module to Veronica pla stx vrun_addr-$4000 sta vcopy_dst+1-$4000 sta copy_src+1 lda d0 sta vrun_addr+1-$4000 sty pages lda #0 sta vcopy_src-$4000 sta vcopy_dst-$4000 sta vcopy_cnt-$4000 mva #$e0 vcopy_src+1-$4000 mva #1 vcopy_cnt+1-$4000 ldy #0 pages = *-1 ldx #0 copy_loop: lda.w $0000,x copy_src = *-2 sta $A000,x inx bne copy_loop lda #