Muzyka z Revenge of Magnus byla zawsze moja ulubiona.
Nie mialem pojecia ze jest w ASMA Dzieki Dely!
Od razu pomyslalem zeby ja przerzucic na A7800
Ale najpierw zdisasemblowalem i jestem w szoku jak krotka jest playerka i jak malo czasu rastra zajmuje.
Udalo mi sie ja relokowac tam gdzie chcialem i zaraz zabieram sie za wersje dla A7800
Ponizej xex dla Atari xl/xe pokazujacy ile czasu zajmuje.
; Code equates
;
L00F0 = $F0
L00F1 = $F1
L4D78 = $F2
L4D79 = $F3
L4D8B = $F4
L4D8C = $F5
;
; Start of code
;
pokey equ $d200
org $8000
;
.byte $00,$00,$00
L4803: .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $39,$39,$39,$39,$39,$00,$39,$00,$39,$00,$39,$00,$39,$00,$39,$00
.byte $48,$48,$48,$48,$48,$00,$48,$00,$48,$00,$48,$00,$48,$00,$48,$00
.byte $55,$55,$55,$55,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00,$55,$00
.byte $3F,$3F,$3F,$3F,$3F,$00,$3F,$00,$3F,$00,$3F,$00,$3F,$00,$3F,$00
.byte $39,$00,$00,$00,$00,$00,$48,$00,$00,$00,$55,$00,$00,$00,$55,$00
.byte $3F,$00,$00,$00,$3F,$00,$00,$00,$3F,$00,$00,$00,$3F,$00,$00,$00
L4873: .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $64,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $C8,$00,$00,$00,$14,$00,$C8,$00,$C8,$00,$00,$00,$14,$00,$00,$00
.byte $C8,$00,$00,$C8,$14,$00,$C8,$00,$C8,$00,$00,$00,$14,$00,$00,$00
.byte $C8,$00,$00,$C8,$14,$00,$C8,$00,$C8,$00,$14,$14,$14,$00,$14,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$01,$00,$00,$0A,$00,$00,$13,$00
L48D3: .byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $BF,$7E,$5D,$BF,$7E,$00,$BF,$00,$7E,$00,$BF,$00,$4E,$00,$5D,$00
L48F3: .byte $08,$04,$03,$02,$02,$01,$01,$00,$00,$00,$08,$07,$06,$05,$04,$03
.byte $02,$01,$00,$00,$0F,$06,$00,$00,$00,$00,$00,$00,$00,$00,$0F,$0A
.byte $08,$06,$04,$02,$00,$00,$00,$00,$0C,$0B,$0A,$09,$08,$07,$06,$05
.byte $04,$03,$0C,$08,$06,$04,$02,$00,$00,$00,$00,$00,$0C,$0A,$09,$08
.byte $07,$06,$05,$04,$03,$02,$08,$0A,$0A,$09,$08,$07,$06,$05,$04,$04
L4943:
data_music
.byte $01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $6B,$80,$00,$00,$5A,$80,$6B,$80,$00,$00,$6B,$80,$00,$00,$6B,$80
.byte $5A,$80,$00,$00,$47,$80,$5A,$80,$00,$00,$5A,$80,$00,$00,$5A,$80
.byte $87,$80,$00,$00,$6B,$80,$87,$80,$00,$00,$87,$80,$00,$00,$87,$80
.byte $78,$80,$00,$00,$5F,$80,$78,$80,$00,$00,$78,$80,$00,$00,$78,$80
.byte $00,$00,$00,$00,$00,$00,$8F,$00,$5A,$00,$5A,$00,$5A,$00,$5F,$00
.byte $00,$00,$6B,$00,$00,$00,$00,$00,$00,$00,$00,$00,$47,$00,$50,$00
.byte $00,$00,$47,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$50,$00,$50,$00,$50,$00,$50,$00,$47,$00,$50,$00
.byte $00,$00,$78,$00,$00,$00,$78,$00,$5A,$00,$00,$00,$5A,$00,$5F,$00
.byte $00,$00,$6B,$00,$00,$00,$00,$00,$47,$00,$00,$00,$47,$00,$50,$00
.byte $00,$00,$47,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$5A,$00,$50,$00
.byte $00,$00,$50,$00,$50,$00,$50,$00,$50,$00,$50,$00,$47,$00,$50,$00
.byte $00,$00,$5A,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$8F,$00,$5A,$00,$00,$00,$5A,$00,$5F,$00
.byte $00,$00,$6B,$00,$00,$00,$00,$00,$47,$00,$00,$00,$47,$00,$50,$00
.byte $00,$00,$47,$00,$00,$00,$5A,$00,$5A,$00,$00,$00,$5A,$00,$50,$00
.byte $00,$00,$50,$00,$50,$00,$50,$00,$50,$00,$50,$00,$47,$00,$50,$00
.byte $00,$00,$78,$00,$00,$00,$78,$00,$5A,$00,$00,$00,$5A,$00,$5F,$00
.byte $00,$00,$6B,$00,$00,$00,$00,$00,$47,$00,$00,$00,$47,$00,$50,$00
.byte $00,$00,$47,$00,$00,$00,$00,$00,$00,$00,$5A,$00,$5A,$00,$50,$00
.byte $00,$00,$50,$00,$50,$00,$00,$00,$50,$00,$47,$00,$00,$00,$50,$00
.byte $00,$00,$5A,$00,$00,$00,$5A,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $6B,$80,$5A,$80,$6B,$80,$87,$80,$00,$00,$00,$00,$00,$00,$00,$00
.byte $6B,$80,$5A,$80,$50,$80,$43,$80,$00,$00,$00,$00,$47,$80,$00,$00
;bylo $4ad3 start muzyki
song .byte $00,$00,$10,$00,$00,$00,$10,$00,$10,$00,$10,$00,$20,$00,$10,$00
.byte $30,$00,$10,$00,$40,$00,$10,$00,$10,$00,$10,$00,$20,$00,$10,$00
.byte $30,$00,$10,$00,$40,$00,$10,$00
;bylo $4afb
restartsong .byte $10,$20,$10,$00,$20,$30,$10,$00
.byte $30,$20,$10,$00,$40,$30,$10,$00,$10,$20,$10,$00,$20,$30,$10,$00
.byte $30,$20,$10,$00,$40,$30,$10,$00,$10,$20,$10,$08,$20,$30,$10,$10
.byte $30,$20,$10,$18,$40,$30,$10,$20,$10,$20,$10,$08,$20,$30,$10,$10
.byte $30,$20,$10,$18,$40,$30,$10,$20,$60,$20,$00,$00,$00,$10,$00,$28
.byte $10,$20,$00,$30,$20,$30,$00,$38,$30,$20,$00,$40,$40,$30,$00,$48
.byte $10,$20,$00,$50,$20,$30,$00,$58,$30,$20,$00,$60,$20,$30,$00,$68
.byte $20,$40,$00,$70,$10,$20,$10,$78,$20,$30,$10,$80,$30,$20,$10,$88
.byte $40,$30,$10,$90,$10,$20,$10,$98,$20,$30,$10,$A0,$30,$20,$10,$A8
.byte $20,$30,$10,$B0,$10,$20,$10,$08,$20,$30,$10,$10,$30,$20,$10,$18
.byte $40,$30,$10,$20,$10,$20,$10,$08,$20,$30,$10,$10,$30,$20,$10,$18
.byte $40,$30,$10,$20,$60,$20,$00,$00,$00,$10,$00,$28,$10,$20,$00,$30
.byte $20,$30,$00,$38,$30,$20,$00,$40,$40,$30,$00,$48,$10,$20,$00,$50
.byte $20,$30,$00,$58,$30,$20,$00,$60,$20,$30,$00,$68,$20,$40,$00,$70
.byte $10,$20,$10,$78,$20,$30,$10,$80,$30,$20,$10,$88,$40,$30,$10,$90
.byte $10,$20,$10,$98,$20,$30,$10,$A0,$30,$20,$10,$A8,$20,$30,$10,$B0
.byte $50,$20,$00,$B8,$50,$30,$00,$B8,$50,$20,$00,$C0,$50,$40,$00,$C0
.byte $50,$20,$00,$B8,$50,$30,$00,$B8,$50,$20,$00,$C0,$50,$40,$00,$B8
.byte $60,$50,$00,$00,$00,$10,$00,$70,$10,$20,$10,$78,$20,$30,$10,$80
.byte $30,$20,$10,$88,$40,$30,$10,$90,$10,$20,$10,$98,$20,$30,$10,$A0
.byte $30,$20,$10,$A8,$20,$30,$10,$B0,$FF,$FF,$FF,$FF,$20,$4B,$4C
nop
nop
nop
nop
nop
nop
nop
nop
nop
music_init
lda #<song ;$D3
sta L00F0
lda #>song ;$4A
sta L00F1
lda #$0F
sta L4E16
lda #$00
ldx #$07
L4C5C: sta POKEY,X
sta L4E02,X
dex
bpl L4C5C
sta L4E15
sta L4E0E
sta L4E18
lda #$09
sta L4E12
sta L4E10
sta L4E11
lda #$02
sta L4E17
rts
Play:
lda #$40
sta POKEY+8 ;AUDCTL
lda #$03
sta POKEY+$0F ;SKCTL
ldx #$07
L4C8B: lda L4E02,X
sta POKEY,X
dex
bpl L4C8B
inc L4E18
lda L4E18
cmp #$02
bne L4CA6
lda #$00
sta L4E18
rts
nop
nop
L4CA6: inc L4E17
lda L4E17
cmp #$03
bne L4CBA
lda #$00
sta L4E17
sta L4E17
beq L4CBD
L4CBA: jmp L4D94
L4CBD: inc L4E16
lda L4E16
and #$0F
sta L4E16
bne L4CEE
L4CCA: ldy #$03
L4CCC: lda (L00F0),Y
sta L4E0A,Y
dey
bpl L4CCC
cmp #$FF
bne L4CE3
lda #<restartsong ;$FB
sta L00F0
lda #>restartsong ;$4A
sta L00F1
jmp L4CCA
L4CE3: clc
lda L00F0
adc #$04
sta L00F0
bcc L4CEE
inc L00F1
L4CEE: lda L4E0D
asl @
php
clc
adc #<data_music ;$43
sta L4D78
sta L4D8B
lda #>data_music ;$49
adc #$00
plp
adc #$00
sta L4D79
sta L4D8C
lda L4E0A
ora L4E16
tax
lda L4803,X
beq L4D1D
sta L4E04
lda #$00
sta L4E12
L4D1D: lda L4E0C
ora L4E16
tax
lda L48D3,X
beq L4D31
sta L4E02
lda #$00
sta L4E10
L4D31: lda L4E0B
ora L4E16
tax
lda L4873,X
beq L4D6D
sta L4E14
ldx #$1E
cmp #$14
beq L4D54
ldx #$28
cmp #$64
beq L4D54
ldx #$32
cmp #$14
bcc L4D54
ldx #$14
L4D54: stx L4E15
ldx #$00
cmp #$C8
bcs L4D65
ldx #$02
cmp #$64
bne L4D65
ldx #$FB
L4D65: stx L4E0F
lda #$00
sta L4E11
L4D6D: lda L4E16
and #$01
bne L4D94
ldy L4E16 ;;;ldx L4E16
modify1:
lda ($f2),y ;;;lda L4943,X ;zamiana na strone zerowa dla A7800
beq L4D94
sta L4E08
lda #$00
sta L4E13
lda #$46
sta L4E0E
iny ;;;inx
modify2:
lda ($f4),y ;;;lda L4943,X ;zamiana na strone zerowa dla A7800
bpl L4D94
lda #$3C
sta L4E0E
L4D94: ldx L4E10
lda L48F3,X
ora #$20
sta L4E03
inx
cpx #$0A
beq L4DA7
stx L4E10
L4DA7: ldx L4E12
lda L48F3,X
ora #$C0
sta L4E05
inx
cpx #$0A
beq L4DBA
stx L4E12
L4DBA: lda L4E0E
clc
adc L4E13
tax
lda L48F3,X
ora #$A0
sta L4E09
ldx L4E13
inx
cpx #$0A
beq L4DD5
stx L4E13
L4DD5: lda L4E15
clc
adc L4E11
tax
lda L48F3,X
ora #$80
sta L4E07
ldx L4E11
inx
cpx #$0A
beq L4DF0
stx L4E11
L4DF0: lda L4E14
sta L4E06
clc
adc L4E0F
bcs L4DFF
sta L4E14
L4DFF: rts
; adres Ramu dla A7800
org $1800
nop
nop
L4E02: .byte $00
L4E03: .byte $00
L4E04: .byte $00
L4E05: .byte $00
L4E06: .byte $00
L4E07: .byte $00
L4E08: .byte $00
L4E09: .byte $00
L4E0A: .byte $00
L4E0B: .byte $00
L4E0C: .byte $10
L4E0D: .byte $00
L4E0E: .byte $00
L4E0F: .byte $00
L4E10: .byte $09
L4E11: .byte $09
L4E12: .byte $09
L4E13: .byte $09
L4E14: .byte $C8
L4E15: .byte $00
L4E16: .byte $0F
L4E17: .byte $02
L4E18: .byte $00,$00,$00,$00,$00,$00,$00,$00,$70,$70,$70,$70,$70,$70,$70,$70
.byte $54,$23,$50,$54,$A3,$50,$54,$23,$51,$54,$A3,$51,$54,$23,$52,$54
.byte $A3,$52,$54,$23,$53,$54,$A3,$53,$30,$41,$20,$4E,$A9