Moved buffer and song addresses to higher memory

* AY register buffer moved from $300 to $8400. Replaced fixed
references with an EQU.
* Song moved from $4000 to $8900. This allows to keep the whole player
routine including buffers and songs between $8400 and $9200.
* Changed zero page pointers to safer locations.
This commit is contained in:
cybernesto 2017-04-22 09:51:24 +02:00
parent 7b1bc9712b
commit 96c2745384

View File

@ -16,8 +16,9 @@ ACR EQU $C40B
IFR EQU $C40D IFR EQU $C40D
IER EQU $C40E IER EQU $C40E
SONGADD EQU $6 SONGADD EQU $EB
CHANNADD EQU $D6 CHANNADD EQU $D6
BUFFER EQU $8400
JMP INTRUPT JMP INTRUPT
JMP INIT JMP INIT
@ -27,7 +28,7 @@ CHANNADD EQU $D6
JMP CONTINUE JMP CONTINUE
TEMPO HEX 04 TEMPO HEX 04
DECAY HEX 03 DECAY HEX 03
STARTADD HEX FE3F7E44 STARTADD HEX FE887E8D
STRONG HEX 0A STRONG HEX 0A
START HEX 00 START HEX 00
END HEX 06 END HEX 06
@ -208,7 +209,7 @@ IM2 STY ORA
STA ORB STA ORB
LDA #$4 LDA #$4
STA ORB STA ORB
LDA $300,Y LDA BUFFER,Y
STA ORA STA ORA
LDA #$6 LDA #$6
STA ORB STA ORB
@ -219,7 +220,7 @@ IM2 STY ORA
STA ORB2 STA ORB2
LDA #$4 LDA #$4
STA ORB2 STA ORB2
LDA $310,Y LDA BUFFER+$10,Y
STA ORA2 STA ORA2
LDA #$6 LDA #$6
STA ORB2 STA ORB2
@ -256,9 +257,9 @@ SONGADDS LDA STARTADD
STA $3FE STA $3FE
LDA #>INTRUPT LDA #>INTRUPT
STA $3FF STA $3FF
LDA #$0 LDA #<BUFFER
STA CHANNADD STA CHANNADD
LDA #$3 LDA #>BUFFER
STA CHANNADD+1 STA CHANNADD+1
LDA #$1 LDA #$1
STA CNTR STA CNTR
@ -273,8 +274,8 @@ SONGADDS LDA STARTADD
INIT JSR INITPAR INIT JSR INITPAR
JSR SONGADDS JSR SONGADDS
LDA #$F8 LDA #$F8
STA $307 STA BUFFER+$7
STA $317 STA BUFFER+$17
LDA #%01000000 LDA #%01000000
STA ACR STA ACR
LDA #%01111111 LDA #%01111111
@ -295,20 +296,20 @@ D1 LDA VOICE,X
TAY TAY
LDA TIED,Y LDA TIED,Y
BNE D2 BNE D2
LDA $308,X LDA BUFFER+$8,X
CMP REST CMP REST
BEQ D2 BEQ D2
DEC $308,X DEC BUFFER+$8,X
D2 LDA VOICE+3,X D2 LDA VOICE+3,X
CMP #$2 CMP #$2
BCS D3 BCS D3
TAY TAY
LDA TIED,Y LDA TIED,Y
BNE D3 BNE D3
LDA $318,X LDA BUFFER+$18,X
CMP REST CMP REST
BEQ D3 BEQ D3
DEC $318,X DEC BUFFER+$18,X
D3 INX D3 INX
CPX #$3 CPX #$3
BNE D1 BNE D1
@ -328,7 +329,7 @@ CONTINUE CLI
INITPAR LDX #0 INITPAR LDX #0
]LOOP LDA PARAMS,X ]LOOP LDA PARAMS,X
STA $0300,X STA BUFFER,X
INX INX
CPX #$20 CPX #$20
BNE ]LOOP BNE ]LOOP