mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-06-02 11:41:30 +00:00
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
|
* On entry, (OSCTRL)=>control block
|
||||||
* Y=0
|
* Y=0
|
||||||
|
|
||||||
WORD01 TYA ; Dummy, just return zero
|
WORD01 PHP ; Disable interrupts
|
||||||
:WORD01LP STA (OSCTRL),Y
|
SEI
|
||||||
|
STA RDMAINRAM ; Read from main memory
|
||||||
|
:WORD01LP LDA SYSCLOCK,Y ; Read sys clock in main mem
|
||||||
|
STA (OSCTRL),Y ; Store in buffer
|
||||||
INY
|
INY
|
||||||
CPY #$05
|
CPY #$05
|
||||||
BCC :WORD01LP
|
BCC :WORD01LP
|
||||||
|
STA RDCARDRAM ; Read from aux memory
|
||||||
|
PLP ; Restore interrupt state
|
||||||
|
RTS
|
||||||
|
|
||||||
WORD04
|
WORD04
|
||||||
WORD03
|
WORD03
|
||||||
WORD02 RTS ; Dummy, do nothing
|
WORD02 RTS ; Dummy, do nothing
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
* Applecorn audio code
|
* 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
|
* Sound buffers
|
||||||
* Four bytes are enqueued for each note, as follows:
|
* Four bytes are enqueued for each note, as follows:
|
||||||
|
@ -370,9 +374,16 @@ CHORD PHA
|
||||||
|
|
||||||
* Called from Ensoniq interrupt handler - process audio queue
|
* Called from Ensoniq interrupt handler - process audio queue
|
||||||
* Should be called at 100Hz
|
* Should be called at 100Hz
|
||||||
ENSQISR INC COUNTER+0 ; Increment centisecond timer
|
ENSQISR INC SYSCLOCK+0 ; Increment system clock
|
||||||
BNE :S1
|
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
|
:S1 DEC :CNT ; Find every 5th cycle
|
||||||
BNE :AT100HZ
|
BNE :AT100HZ
|
||||||
LDA #5
|
LDA #5
|
||||||
|
|
Loading…
Reference in New Issue
Block a user