OK, good to know, and thanks all of information so far !
I compose experimental music using old consoles as sound sources, using simple vblank routine as timer is adequate, don't need more as the sound file or live settings is (heavily) modified. I use other languages to generate NESASM code, each NES-file is used once for one composition, then new program, another composition etc. I use NES, but others as well: SMS, Genesis, Atari 2600, 5200, GB, MSX and so on, different any languages I find those machines.
NES-files consist three components (the header is originally from some tutorial, tried to find without luck). It seems I posted the older version of the header, here's what I've used with NESASM currently:
Code: Select all
.inesprg 1
.ineschr 0
.inesmir 1
.inesmap 0
.bank 1
.org $fffa
.dw 0
.dw start
.dw 0
.bank 0
.org $8000
Second component is timing:
Code: Select all
loop1:
vwait:
lda $2002
bpl vwait
dex
bne loop1
rts
Then the last component, it consist just of direct writing to sound registers, depending what I'm working, but this is a short sample which contain what is needed (I hope):
Code: Select all
start:
lda #15
sta $4015 ; all four channels
start1:
lda #70
sta $4000
lda #84
sta $4001
lda #167
sta $4002
lda #205
sta $4003
.... ; more writing to sound registers
ldx #16
jsr loop1 ;calling vblank
.... ; same continues until a loop is formed
jmp start1 ; endless loop
That's all, header, enabling necessary sound channels, writing directly to sound registers, looped vblank for timing and back to start. Simple, clumsy, direct, but exactly what I need.
Thanks !
-jp