Added five-byte system clock, OSWORD &01.
This commit is contained in:
parent
43e429d4df
commit
76ca965adb
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
|
@ -315,11 +315,18 @@ WORD00 IF MAXLEN-OSTEXT-2
|
|||
* On entry, (OSCTRL)=>control block
|
||||
* Y=0
|
||||
|
||||
WORD01 TYA ; Dummy, just return zero
|
||||
:WORD01LP STA (OSCTRL),Y
|
||||
WORD01 PHP ; Disable interrupts
|
||||
SEI
|
||||
STA RDMAINRAM ; Read from main memory
|
||||
:WORD01LP LDA SYSCLOCK,Y ; Read sys clock in main mem
|
||||
STA (OSCTRL),Y ; Store in buffer
|
||||
INY
|
||||
CPY #$05
|
||||
BCC :WORD01LP
|
||||
STA RDCARDRAM ; Read from aux memory
|
||||
PLP ; Restore interrupt state
|
||||
RTS
|
||||
|
||||
WORD04
|
||||
WORD03
|
||||
WORD02 RTS ; Dummy, do nothing
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
* Applecorn audio code
|
||||
*
|
||||
|
||||
COUNTER DW $0000 ; Centisecond counter
|
||||
SYSCLOCK DB $00 ; Centisecond counter (5 bytes)
|
||||
DB $00
|
||||
DB $00
|
||||
DB $00
|
||||
DB $00
|
||||
|
||||
* Sound buffers
|
||||
* Four bytes are enqueued for each note, as follows:
|
||||
|
@ -370,9 +374,16 @@ CHORD PHA
|
|||
|
||||
* Called from Ensoniq interrupt handler - process audio queue
|
||||
* Should be called at 100Hz
|
||||
ENSQISR INC COUNTER+0 ; Increment centisecond timer
|
||||
ENSQISR INC SYSCLOCK+0 ; Increment system clock
|
||||
BNE :S1
|
||||
INC COUNTER+1
|
||||
INC SYSCLOCK+1
|
||||
BNE :S1
|
||||
INC SYSCLOCK+2
|
||||
BNE :S1
|
||||
INC SYSCLOCK+3
|
||||
BNE :S1
|
||||
INC SYSCLOCK+4
|
||||
|
||||
:S1 DEC :CNT ; Find every 5th cycle
|
||||
BNE :AT100HZ
|
||||
LDA #5
|
||||
|
|
Loading…
Reference in New Issue