I managed to get a NES rom with 5b sound after searching a lot more, got it by using eznsf.
the rom seem to call the right addresses but it wont output sound on the 5b chip (atleast not in mesen). This led me to think, it will never work with other mappers then 69 in emulators if not custom support is added.
The rom will most likely work on the real hardware once i built it. but it sort of defeats the purpose that i wanted to build something that would have good support from the get go.
Now if i create this maybe i should take an other approach of some kind. sure i still think YM2149 is a good choice because of famitracker support. maybe still the best choice.
should i still try to make it using the same addresses for example, and other things to consider?
lidnariq wrote:
There's a simple definition that is compatible with every existing mapper, and requires only signals that are already on the expansion port.
Note that top-loading NESes don't have an expansion port.
In the NES, writes to $4016 keep track of the bottom three bits, but only the bottom one bit is normally accessible. The other two bits are only on the expansion port, and could be used as a signal to latch the upper five bits.
So a simple design, using the other major PSG of the era (the SN76494) might latch D7-D4 on a rising edge of OUT2, latch D7-D4 (save as the lower half byte) on a falling edge of OUT2, and connect OUT1 to /WE and /CE. A game would do something like
Code:
lda #$76 ; 1789773Hz÷110Hz = 508 = 0b0111_1111_00 ; four msbits here, out2 rising edge, out1 high
sta $4016
lda #$10 ; select register 0, "tone 1 frequency", and out2 and out1 falling edges
sta $4016
ldx #6
delay1: dex
bpl delay1
lda #$F6 ; four middle bits of period here, out2 rising edge, out1 high
sta $4016
lda #0 ; two lsbits here, and out2 and out1 falling edges
sta $4016
ldx #6
delay2: dex
bpl delay2
lda #2 ; prevent re-write of register
sta $4016
The AY-3-8910 requires nine bits, not eight, but a similar division is possible. The expansion port even provides the user with access to the 4MHz CIC clock, but it's a low-quality clock source and probably wouldn't be in tune with the crystal used by the NES itself.
Some existing games that were also released in Japan might already use OUT1 and OUT2 for other purposes.
So that solution wouldnt need hardware modifications to cartridges at all? just work OOB if the software support it?
I were planning to use the 4mhz clock the port uses. trying to minimize the hardware needed. but if a crystal is needed then I'll add it.