Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!
Paste
Pasted as CSS by Denine ( 14 years ago )
.bank 30
.org $C000
; The music data
songData1:
.incbin "./music/vrc6.bin"
songData2:
.incbin "./music/cisza.bin"
songData3:
.incbin "./music/prime.bin"
.bank 31
.org $E000
Music_Init:
; Then store the address of the intented music data, if any.
lda musicDataTableLow, x
sta ft_music_addr
lda musicDataTableHigh, x
sta ft_music_addr + 1
; Finally select the song inside the music data
lda #$0 ; track 0
ldx #$0 ; NTSC
jsr ft_music_init
; init default value for ppu_crtl flags + activate NMI
lda #PPU_CTRL_NMI
sta zpPpuCtrlFlags
sta PPU_CTRL
rts
;->BANK 01: Test code and utils -------------------------------------------
; Separated in another file to make it easier to read
.include "./common/utils.asm"
; The code for the player
.include "./soundDrv/driver.asm"
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
; Vectors for NMI and IRQ
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;->BEGIN----------------------------------------------------------------------
; NMI interrupt handler. Called 60 times per second (NTSC)
;
vector_nmi:
jsr ft_music_play
rti
;-<END------------------------------------------------------------------------
READ_GFX:
sta $8000 ;load Bank number before running this...
sta current_bank
TXA
Read_Grafics_PPU:
asl A ;multiply by 2 because each address is 2 bytes
tax
lda grafTable+0, x ;copy the low byte
sta addrLO
lda grafTable+1, x ;copy the high byte
sta addrHI
ldx #32
ldy #0
Read_Grafics:
LDA [addrLO], y ; load data from address (background + the value in x)
STA $2007 ; write to PPU
INy ; X = X + 1
BNE Read_Grafics ; Branch to LoadBackgroundLoop if compare was Not Equal to zero
inc addrHI
dex
bne Read_Grafics
lda #$00
sta $8000
sta current_bank
rts
grafTable:
.dw Tlo1, Sprity1
Reset:
LDA #$00
STA $0000, x
STA $0100, x
STA $0200, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
STA $0300, x
INX
BNE Reset
ldx #$00
; bank 0 in $8000...
lda #0
sta $8000
sta current_bank
;Bank 15 in $C000...
lda #-2
sta $C000
sta current_bankC
; set CHR registers
ldx #0
stx $D000
inx
stx $D001
inx
stx $D002
inx
stx $D003
inx
stx $E000
inx
stx $E001
inx
stx $E002
inx
stx $E003
; virtical mirroring
lda #00
sta $B003
; disable IRQs
lda #0
sta $F001
; disable VRC6 audio(Don't affect Music driver...)
lda #0
sta $9002
sta $A002
sta $B002
jmp Start
musicDataTableLow: .byte LOW(songData1), LOW(songData2), LOW(songData3)
musicDataTableHigh: .byte HIGH(songData1), HIGH(songData2), HIGH(songData3)
.include "SYS/Rysowania.txt"
.org $FFFA
.dw vector_nmi ; no VBlank
.dw Reset ; address to execute on reset
.dw 0 ; no whatever
;;--- END OF CODE FILE ---;;
Revise this Paste