P* * Initialization and interrupt routines * DSK 'interrupt' REL PUT 'playvars.i.s' PUT 'diskio.ext.s' BLNON = $CF SCNKEY EQU $EA87 PLAYFLAG EXT RASTFLAG EXT * * Two vectors at $8000 (warm restart) and * $8003 (cold restart) * JMP ERROR * * Okay... this is the routine which gets the whole * thing moving. It is placed into this file purely * for convenience. It sets up the appropriate * variables and interrupt vectors and such and * then jumps into the music editor. * * How exciting! * * SLJ 3/31/97 * MACINIT EXT MUSINIT EXT MUSICED EXT BEGIN LDA $01 AND #$F8 ORA #6 STA $01 JSR MACINIT JMP ERROR NMI SEI PHA LDA #$FF ;Check for R/S key STA $DC02 LDA #0 STA $DC03 LDA #$7F STA $DC00 LDA $DC01 BPL ERROR PLA CLI RTI PERROR JSR INTINIT LDA $01 AND #$F8 ORA #6 STA $01 LDA #00 STA $D021 LDA #2 STA $D020 JSR STROUT DFB 147,5 TXT '** What the heck did you just do? **' DFB 13,13 TXT 'Something drastic has occured.' DFB 13,13,00 JSR WAITKEY ERROR LDA $01 AND #$F8 ORA #6 STA $01 LDA #NMI STA $0319 LDA #PERROR STA $0317 LDX #$FD ;Reset stack TXS LDA #00 ;Zero volume STA $D418 LDA #1 STA $CC ;Stop cursor flash JSR INTINIT JSR MUSINIT JMP MUSICED * * Exit to BASIC * GOBASIC ENT LDA $01 ORA #3 STA $01 JMP $A483 * * Initialize music interrupt routine * INTINIT LDA #00 STA PLAYFLAG SEI LDA #IRQ STA $0315 LDA #$C6 ;Give stable raster position STA $DC04 LDA #$42 STA $DC05 LDA #1 ;Continuous STA $DC0E CLI RTS * * Main interrupt routine * IRQ LDA PLAYFLAG BEQ :NORMAL LDA RASTFLAG BNE :C1 INC $D020 :C1 JSR MAINPLAY LDA RASTFLAG BNE :C2 DEC $D020 :C2 JSR SCNKEY LDA #00 ;So cursor flash routines STA BLNON ;won't lock up. LDA $DC0D PLA TAY PLA TAX PLA RTI :NORMAL JMP $EA31