* OUT N START EQU $A800 MEMORY EQU $A800 BUFR EQU $32 ROWCRS EPZ $54 COLCRS EPZ $55 ICCOM EQU $342 ICBAL EQU $344 ICBAH EQU $345 ICBLL EQU $348 ICBLH EQU $349 ICAUX1 EQU $34A RUNAD EQU $02E0 DDEVIC EQU $0300 DUNIT EQU $0301 DCOMND EQU $0302 DSTATS EQU $0303 DBUFLO EQU $0304 DBUFHI EQU $0305 DTIM EQU $0306 DBYTLO EQU $0308 DBYTHI EQU $0309 DAUX1 EQU $030A DAUX2 EQU $030B CIOV EQU $E456 DBUFR EQU $5000 LNTITL EQU 4 LNCMD EQU 10 LNSENS EQU 12 ORG RUNAD DFW PRGSTART ORG START+$0800,MEMORY+$0800 PRGSTART KOPEN LDA #0 STA BUFPOS COPYOUT SEARCD LDA CDID BMI PRGENDE READTOC TOCOUT KEYBEF KCLOSE PRGENDE RTS NEXTTRK LDX CURTRK CPX LTRK INX STX CURTRK TXA PLAYTRK RTS PREVTRK LDX CURTRK CPX FTRK DEX STX CURTRK TXA PLAYTRK RTS GOASPI JMPASPI BPL GASPI20 CPY #$C2 BNE GASPI20 LDA CDID REQSEN LDA DBUFR+2 CMP #2 ; NO MEDIA BNE GASPI10 LDA DBUFR+12 CMP #4 ; NOT READY BEQ GASPI08 LDX #TNOCD:L LDY #TNOCD:H LDA #13 CHROUT RTS GASPI08 CSETDCB LDA #CMDTUR:L STA DAUX1 LDA #CMDTUR:H STA DAUX2 LDA CDID STA CMDTUR LDA #0 STA DBYTLO STA DBYTHI BEQ GOASPI GASPI10 CMP #8 ; WRONG TYPE BNE GASPI12 LDX #TNOCD:L LDY #TNOCD:H LDA #7 CHROUT RTS GASPI12 CMP #6 ; MEDIA CHANGED BNE GASPI20 GASPI18 READTOC BMI GASPI20 TOCOUT GASPI20 RTS JMPASPI JMP ($0002) PAUSE LDA RESUME BPL PAUS00 LDA CURTRK PLAYTRK RTS PAUS00 TAX BEQ PAUS04 LDX #$FF PAUS04 INX STX RESUME STA CMDRES+8+2 CSETDCB LDA #0 STA DBYTLO LDA #0 STA DBYTHI LDA #CMDRES:L STA DAUX1 LDA #CMDRES:H STA DAUX2 LDA CDID STA CMDRES GOASPI RTS SEARCD LDA #$FF STA CDID LDA #$0 STA CMDINQ SEAR00 CSETDCB LDA #36 STA DBYTLO LDA #0 STA DBYTHI LDA #CMDINQ:L STA DAUX1 LDA #CMDINQ:H STA DAUX2 GOASPI BMI SEAR08 SEAR04 LDA DBUFR AND #%00011111 CMP #$5 BEQ SEAR12 SEAR08 INC CMDINQ LDA CMDINQ CMP #7 BNE SEAR00 NOTFOUND LDX #TNOTF:L LDY #TNOTF:H LDA #23 CHROUT RTS SEAR12 LDA CMDINQ STA CDID LDX #TCDROM:L LDY #TCDROM:H LDA #6 CHROUT LDA CDID BCDOUT SPACEOUT LDX #DBUFR+8:L LDY #DBUFR+8:H LDA #24 CHROUT NEWLINE RTS READTOC CSETDCB LDA #0 STA DBYTLO LDA #1 STA DBYTHI LDA #CMDRDTOC:L STA DAUX1 LDA #CMDRDTOC:H STA DAUX2 LDA CDID STA CMDRDTOC JMP GOASPI *READTOC RDTOC00 CMDOUT LDA #LNCMD-1 STA ROWCRS NEWLINE LDX #TCMD:L LDY #TCMD:H LDA #32 JMP CHROUT TOCOUT LDA #LNTITL-1 STA ROWCRS NEWLINE DELLINE DELLINE DELLINE DELLINE DELLINE DELLINE LDA DBUFR+3 STA LTRK LDA DBUFR+2 STA FTRK LDA FTRK RDTOC06 PHA DECOUT SPACEOUT PLA PHA ASL ASL ASL TAX LDA DBUFR+10,X SEC SBC DBUFR+2,X BCS TOC02 ADC #60 TOC02 PHA LDA DBUFR+9,X SBC DBUFR+1,X DECOUT LDA #': AKOUT PLA DECOUT SPACEOUT PLA PHA AND #%00000011 BNE RDTOC07 TOCO04 NEWLINE RDTOC07 PLA CLC ADC #1 CMP LTRK BCC RDTOC06 BEQ RDTOC06 LDA #$FF STA RESUME LDA FTRK STA CURTRK RDTOC08 NEWLINE CMDOUT RTS PLAYTRK STA CMDPLTRK+4+2 STA CURTRK LDA #0 STA RESUME LDA LTRK STA CMDPLTRK+7+2 CSETDCB LDA #0 STA DBYTLO LDA #0 STA DBYTHI LDA #CMDPLTRK:L STA DAUX1 LDA #CMDPLTRK:H STA DAUX2 LDA CDID STA CMDPLTRK JMP GOASPI REQSEN PHA CSETDCB LDA #$FF STA DBYTLO LDA #$00 STA DBYTHI LDA #CMDREQS:L STA DAUX1 LDA #CMDREQS:H STA DAUX2 PLA STA CMDREQS GOASPI BPL REQS00 BRK REQS00 LDA #LNSENS-1 STA ROWCRS NEWLINE LDA CMDREQS BCDOUT LDA #$20 AKOUT LDA DBUFR+2 BCDOUT LDA #$20 AKOUT LDA DBUFR+12 HEXOUT LDA DBUFR+13 HEXOUT SPACEOUT INC SENCOUN LDA SENCOUN HEXOUT LDA #$9B AKOUT RTS CSETDCB LDY #$7 CSDCB01 LDA CMDDCB,Y STA DDEVIC,Y DEY BPL CSDCB01 RTS COPYOUT LDX #TCOPY:L LDY #TCOPY:H LDA #38 CHROUT RTS ESCAPE PLA PLA RTS OPTRAY CSETDCB LDA #0 STA DBYTLO STA DBYTHI LDA #CMDLOAD:L STA DAUX1 LDA #CMDLOAD:H STA DAUX2 LDA CDID STA CMDLOAD GOASPI LDA CMDLOAD+6 EOR #%00000001 STA CMDLOAD+6 RTS CHID RTS CHID1 LDA #1 BNE CHID CHID2 LDA #2 BNE CHID CHID3 LDA #3 BNE CHID CHID4 LDA #4 BNE CHID CHID5 LDA #5 BNE CHID CHID6 LDA #6 BNE CHID CHID0 LDA #0 BEQ CHID CHCMD RTS CHCMD1 LDA #1 BNE CHCMD CHCMD2 LDA #2 BNE CHCMD CHCMD3 LDA #3 BNE CHCMD CHCMD4 LDA #4 BNE CHCMD CHCMD5 LDA #5 BNE CHCMD CHCMD6 LDA #6 BNE CHCMD CHCMD7 LDA #7 BNE CHCMD CHCMD8 LDA #8 BNE CHCMD CHCMD9 LDA #9 BNE CHCMD CHCMD0 LDA #0 BEQ CHCMD EXECUTE RTS CHMODE RTS KBEF00 JSR KBEF08 KEYBEF AKIN LDY #$FD KBEF04 INY INY INY CPY #(BEFTBEND-BEFTBL) BEQ KEYBEF CMP BEFTBL,Y BNE KBEF04 BEQ KBEF00 KBEF08 LDA BEFTBL+2,Y PHA LDA BEFTBL+1,Y PHA RTS BEFTBL DFB $1B DFW ESCAPE-1 ASC "P" DFW PAUSE-1 ASC ">" DFW NEXTTRK-1 ASC "<" DFW PREVTRK-1 ASC "O" DFW OPTRAY-1 BEFTBEND EQU * ASC "M" DFW CHMODE-1 * ASC "C" * DFW CLBUFO-1 ASC "1" DFW CHCMD1-1 ASC "2" DFW CHCMD2-1 ASC "3" DFW CHCMD3-1 ASC "4" DFW CHCMD4-1 ASC "5" DFW CHCMD5-1 ASC "6" DFW CHCMD6-1 ASC "7" DFW CHCMD7-1 ASC "8" DFW CHCMD8-1 ASC "9" DFW CHCMD9-1 ASC "0" DFW CHCMD0-1 ASC "!" DFW CHID1-1 ASC !"! DFW CHID2-1 ASC "#" DFW CHID3-1 ASC "$" DFW CHID4-1 ASC "%" DFW CHID5-1 ASC "&" DFW CHID6-1 ASC ")" DFW CHID0-1 *BEFTBEND EQU * AKIN LDX #$10 LDA #0 STA ICBLL,X STA ICBLH,X LDA #7 STA ICCOM,X JMP CIOV KOPEN LDX #$10 LDA #KDEV:L STA ICBAL,X LDA #KDEV:H STA ICBAH,X LDA #4 STA ICAUX1,X LDA #3 STA ICCOM,X JMP CIOV KCLOSE LDX #$10 LDA #12 STA ICCOM,X JMP CIOV KDEV ASC "K:" DFB $9B DELLINE LDA #$9C JMP OAKOUT NEWLINE LDA #$9B BNE AKOUT SPACEOUT LDA #$20 BNE AKOUT DECTEMP DFB 0 DECOUT LDX #0 SEC DECO02 SBC #10 BCC DECO04 INX BNE DECO02 DECO04 ADC #10 STA DECTEMP TXA ASL ASL ASL ASL ORA DECTEMP HEXOUT PHA LSR LSR LSR LSR BCDOUT PLA BCDOUT AND #%00001111 CMP #10 BCC BCDO00 ADC #6 BCDO00 ADC #$30 AKOUT LDX BUFPOS STA LINBUF,X INC BUFPOS CMP #$9B BEQ AKO00 RTS AKO00 LDX #0 LDA #LINBUF:L STA ICBAL,X LDA #LINBUF:H STA ICBAH,X LDA #80 STA ICBLH,X LDA #0 STA ICBLL,X LDA #9 STA ICCOM,X JSR CIOV LDA #0 STA BUFPOS RTS CHROUT STY BUFR+1 STX BUFR STA ATEMP CHRO04 LDY #0 LDX BUFPOS LDA (BUFR),Y STA LINBUF,X INC BUFPOS CMP #$9B BNE CHRO08 LDX BUFR STX XTEMP LDY BUFR+1 STY YTEMP LDX #LINBUF:L LDY #LINBUF:H AKO00 LDA XTEMP STA BUFR LDA YTEMP STA BUFR+1 CHRO08 INC BUFR BNE CHRO10 INC BUFR+1 CHRO10 DEC ATEMP BNE CHRO04 RTS LINBUF ASC " " ASC " " BUFPOS DFB 0 YTEMP DFB 0 XTEMP DFB 0 ATEMP DFB 0 OAKOUT PHA LDX #0 LDA #0 STA ICBLL,X STA ICBLH,X LDA #11 STA ICCOM,X PLA JMP CIOV CMDDCB DFB $70 DFB 1 DFB $02 DFB $40 DFW DBUFR DFB $01 DFB 0 TCOPY DFB $7D DFB $9B ASC "ATASPI CDPLAY V0.20 (c) 2000 by msc" DFB $9B TNOTF DFB $9B ASC "no CD-ROM drive found" DFB $9B TNOCD DFB $9B ASC "no audio CD" DFB $9B TCDROM ASC "CD: Id" TCMD ASC /P/ ASC "lay/Pause " ASC /O/ ASC "pen " ASC // ASC "next " ASC /ESC/ DFB $9B CMDREQS DFB 0 DFB 6 DFB 3,0,0,0 DFB $FF DFB 0 CMDRDTOC DFB 0 DFB 10 DFB $43 DFB %00000010 DFB 0,0,0,0,0 DFB 1,0 DFB 0 CMDINQ DFB 0 ;ID DFB 6 DFB $12 ;CMD DFB 0 DFB 0 ;LUN DFB 0 ;RES DFB 36 ;DATALEN DFB 0 CMDTUR DFB 0 ;ID DFB 6 DFB 0 ;CMD DFB 0 DFB 0 ;LUN DFB 0 ;RES DFB 0 ;DATALEN DFB 0 CMDRES DFB 4 DFB 10 DFB $4B DFB 0 DFB 0,0 DFB 0 DFB 0,0 DFB 0 DFB 0,0 CMDPLTRK DFB 4 DFB 10 DFB $48 DFB 0 DFB 0,0 DFB 2 DFB 0,0 DFB 4 DFB 0,0 CMDLOAD DFB 0 ; TID DFB 6 ; LEN DFB $1B ; DFB %00000000 DFB 0,0 DFB %00000010 DFB 0 VARIAB EQU * CDID EQU VARIAB RETRY EQU CDID+1 FTRK EQU RETRY+1 LTRK EQU FTRK+1 CURTRK EQU LTRK+1 RESUME EQU CURTRK+1 SENCOUN EQU RESUME+1 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ