1 Ostatnio edytowany przez xxl (2012-07-26 17:48:41)

dlaczego to tak wyglada? wersja ZX-Spectrum zostala przetlumaczona na 6502, z wersji 6502 przepisalem go na 8088 (AtariPortfolio) a z tego na powrot przetlumaczylem na 6502.

jeden z najprostszych silnikow na GTIA, publikuje zrodlo, moze ktos zechce poeksperymentowac :-)

dane muzyki mozna sobie pociagnac z edytorow na zx spectrum... jest ich kilka do tego silniczka. w zalaczniku plik wykonywalny dla atari - no ewentualnie Altirra, inne emulatory moga nie grac tak jak trzeba.

smacznego

                opt h+l+o+

gractl          equ $d01d
consol          equ $d01f
skctl            equ $d20f
dmactl          equ $d400
nmien           equ $d40e

S_REG           equ $f0
speed           equ $f1
_channel        equ $f2 ; 4 byte


                org $2000
run_adr         sei
                lda #$00 
                sta nmien
                sta gractl
                sta dmactl

music_studio_stack
                tsx
                stx S_REG
                ldx #$03
_lch            lda _ch1,x
                sta _channel,x
                dex
                bpl _lch

_loop           lda skctl
                and #$04
                bne _cont
                ldx S_REG
                txs
                rts

_cont           ldx #$00
_load           lda (_channel,x)
                bpl _80_1
                lda _ch1,x
                sta _channel,x
                lda _ch1+1,x
                sta _channel+1,x
                lda (_channel,x)
_80_1            inc _channel,x
                bne _80_2
                inc _channel+1,x
_80_2            tay
                lda _nuty,y
                pha
                pha
                pha
                sec
                sbc #$01
                pha
                beq _80_en1
                lda #$08
_80_en1         pha
                lda #$00
                pha
                txa
                eor #%10
                tax                 
                bne _load
                tay ; =0
                lda music_speed
                sta speed

_iloop          tsx
_2kolej         lda $0101,x
                sta consol
                dec $0105,x
                bne _2kl
                eor $0102,x
                sta $0101,x
                lda $0106,x
                sta $0105,x
                lda $0104,x
                cmp #$20
                bcs _2kl
                inc $0106,x
_2kl            dec $0103,x
                bne _2kn
                lda $0101,x
                eor $0102,x
                sta $0101,x
                lda $0106,x
                sta $0103,x
                dec $0103,x
_2kn
                txa
                ;clc          ; too slow, replace with sbx
                ;adc #$06
                ;tax
                sbx #$100-$06 ; +6
                cpx S_REG
                bne _2kolej
            
                dey
                bne _iloop
                dec speed
                bne _iloop
                txs
                jmp _loop

_nuty   .byte $FF,$F0,$E3,$D7,$CB,$C0,$B4,$AB
        .byte $A1,$97,$90,$88,$80,$79,$72,$6C
        .byte $66,$60,$5B,$56,$51,$4C,$48,$44
        .byte $40,$3D,$39,$36,$33,$30,$2D,$2B
        .byte $28,$26,$24,$22,$20,$1E,$1C,$1B
        .byte $19,$18,$17,$15,$14,$13,$12,$11
        .byte $10,$01


music_speed     .byte $0f
_ch1            .word kanal1
_ch2            .word kanal2
    
kanal1  .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $08,$14,$08,$14,$05,$11,$05,$11
        .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $08,$14,$08,$14,$05,$11,$05,$07
        .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $08,$14,$08,$14,$05,$11,$05,$07
        .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $08,$14,$08,$14,$05,$11,$05,$07
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $03,$0F,$25,$0F,$03,$0F,$25,$25
        .byte $08,$14,$25,$14,$08,$14,$25,$14
        .byte $05,$11,$25,$11,$05,$11,$25,$25
        .byte $00,$0C,$25,$0C,$00,$0C,$00,$0C
        .byte $03,$0F,$25,$0F,$03,$0F,$25,$0F
        .byte $08,$14,$25,$14,$08,$14,$25,$14
        .byte $05,$11,$25,$11,$07,$25,$25,$25
        .byte $03,$0F,$25,$0F,$03,$0F,$25,$0F
        .byte $05,$11,$25,$11,$05,$11,$25,$25
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $0A,$16,$25,$16,$0A,$25,$0A,$25
        .byte $03,$0F,$25,$0F,$03,$0F,$25,$25
        .byte $05,$11,$25,$11,$05,$11,$25,$25
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $0A,$16,$25,$16,$0A,$25,$0A,$25
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $00,$0C,$25,$0C,$07,$05,$25,$25
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $00,$0C,$25,$0C,$07,$25,$03,$25
        .byte $30,$30,$31,$30,$30,$31,$2D,$2D
        .byte $31,$2B,$2B,$31,$27,$31,$27,$31
        .byte $30,$30,$30,$30,$30,$30,$2D,$2D
        .byte $2D,$2A,$2A,$2A,$27,$27,$27,$27
        .byte $18,$1F,$18,$1D,$1F,$18,$22,$1F
        .byte $18,$1D,$1F,$18,$24,$1F,$22,$24
        .byte $18,$1F,$22,$1D,$1F,$18,$22,$1F
        .byte $18,$1D,$1B,$1F,$1A,$1D,$16,$1A
        .byte $18,$1F,$18,$1D,$1F,$18,$22,$1F
        .byte $18,$1D,$1F,$18,$24,$1F,$22,$24
        .byte $18,$1F,$22,$1D,$1F,$18,$22,$1F
        .byte $18,$1D,$1B,$18,$1A,$1B,$16,$1A
        .byte $ff
        
kanal2  .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $08,$14,$08,$14,$05,$11,$05,$11
        .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $08,$14,$08,$14,$05,$11,$05,$07
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $08,$14,$25,$14,$05,$11,$25,$25
        .byte $00,$0C,$25,$0C,$00,$0C,$25,$0C
        .byte $08,$14,$25,$14,$05,$25,$05,$25
        .byte $1F,$0C,$1F,$0C,$1D,$1F,$00,$18
        .byte $03,$18,$1B,$18,$03,$18,$1B,$18
        .byte $1F,$14,$1F,$14,$1D,$1F,$08,$18
        .byte $05,$18,$1B,$18,$1F,$1D,$1B,$1D
        .byte $1F,$0C,$1F,$0C,$1D,$1B,$25,$18
        .byte $03,$18,$1B,$18,$03,$18,$1F,$18
        .byte $1F,$14,$1F,$14,$1D,$1B,$08,$18
        .byte $05,$18,$1B,$1D,$1F,$1D,$1B,$1A
        .byte $18,$0F,$18,$0F,$16,$18,$03,$13
        .byte $05,$18,$1B,$1D,$1F,$1D,$1B,$1D
        .byte $18,$0C,$1A,$0C,$1B,$18,$00,$1F
        .byte $0A,$1D,$1B,$1D,$1F,$1D,$1B,$1D
        .byte $18,$0F,$18,$0F,$16,$18,$03,$13
        .byte $05,$1D,$1B,$1D,$1F,$1D,$1B,$1A
        .byte $18,$0C,$18,$1A,$1B,$18,$00,$1F
        .byte $0A,$1F,$1D,$1B,$1D,$1B,$1A,$16
        .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $00,$0C,$00,$0C,$07,$05,$03,$05
        .byte $00,$0C,$00,$0C,$00,$0C,$00,$0C
        .byte $00,$0C,$00,$0C,$07,$05,$03,$02
        .byte $30,$30,$30,$30,$30,$30,$2D,$2D
        .byte $2D,$2B,$2B,$2A,$27,$27,$27,$27
        .byte $30,$30,$31,$30,$30,$31,$2D,$2D
        .byte $31,$2A,$2A,$31,$27,$31,$27,$31
        .byte $18,$1F,$31,$1D,$1F,$31,$22,$1F
        .byte $31,$1D,$1F,$31,$24,$31,$22,$31
        .byte $18,$1F,$31,$1D,$1F,$31,$22,$1F
        .byte $31,$1D,$1B,$31,$1A,$31,$16,$31
        .byte $18,$1F,$31,$1D,$1F,$31,$22,$1F
        .byte $31,$1D,$1F,$31,$24,$31,$22,$31
        .byte $18,$1F,$31,$1D,$1F,$31,$22,$1F
        .byte $31,$1D,$1B,$31,$1A,$31,$16,$31
        .byte $ff

        org $2e0
        .word a(run_adr)

---
muzyka Mr.Beep

Post's attachments

music_studio_stack.obx 875 b, liczba pobrań: 10 (od 2012-07-26) 

Tylko zalogowani mogą pobierać załączniki.
http://atari.pl/hsc/ad.php?i=1.