Hello.
I am making a hardware NSF player, which consists of a NES CPU, RAM and programmable rom (Flash) memory, MMC card reader, LCD display and a CPLD, which generates enable signals for RAM/ROM/LCD, helps to communicate CPU with MMC and so on.
the memory area I designed is as follows:
$0000-$1fff - 8KB RAM
$2000-$2007 - registers for MMC card & LCD
$3000-$3fff - 4KB RAM
$5FF8-$5fff - bankswitching registers
$6000-$7fff - 8KB RAM
$8000-$8fff - 4KB ROM bank0
$9000-$9fff - 4KB ROM bank1
$a000-$afff - 4KB ROM bank2
$b000-$bfff - 4KB ROM bank3
$c000-$cfff - 4KB ROM bank4
$d000-$dfff - 4KB ROM bank5
$e000-$efff - 4KB ROM bank6
$f000-$ffff - 4KB ROM bank7
Also the whole ROM space can be switched in 64kb chunks.
The 50 HZ hardware generated signal (for executing play routine in proper intervals) is connected to the /NMI line of CPU.
When the device is turned on, it is executing the bootloader code (that is available in the ROM - chunk 0).
It it copying the useful procedures to the unused by NSF RAM areas ($3000-3FFF) and begins executing code from there.
Then it switches the ROM to the chunk1 and fills it with the NSF code.
The NMI interrupt vector is pointing to some location in the $3000-$3FFF RAM, where resides the procedure for updating LCD display and executing the play code from NSF.
There aren't any problems with the not bankswitched NSF files - ROM is programmed with its contents, except the $FFFE-$FFFF address, which is programmed to point to the procedure in the $3000-$3FFF RAM.
However, some problems occurs with bankswitched music, because the last rom bank (7), which contains NMI interrupt vector might be switched during playback, so I don't know in which banks' last 2 bytes should I write the NMI addres vector?
I am making a hardware NSF player, which consists of a NES CPU, RAM and programmable rom (Flash) memory, MMC card reader, LCD display and a CPLD, which generates enable signals for RAM/ROM/LCD, helps to communicate CPU with MMC and so on.
the memory area I designed is as follows:
$0000-$1fff - 8KB RAM
$2000-$2007 - registers for MMC card & LCD
$3000-$3fff - 4KB RAM
$5FF8-$5fff - bankswitching registers
$6000-$7fff - 8KB RAM
$8000-$8fff - 4KB ROM bank0
$9000-$9fff - 4KB ROM bank1
$a000-$afff - 4KB ROM bank2
$b000-$bfff - 4KB ROM bank3
$c000-$cfff - 4KB ROM bank4
$d000-$dfff - 4KB ROM bank5
$e000-$efff - 4KB ROM bank6
$f000-$ffff - 4KB ROM bank7
Also the whole ROM space can be switched in 64kb chunks.
The 50 HZ hardware generated signal (for executing play routine in proper intervals) is connected to the /NMI line of CPU.
When the device is turned on, it is executing the bootloader code (that is available in the ROM - chunk 0).
It it copying the useful procedures to the unused by NSF RAM areas ($3000-3FFF) and begins executing code from there.
Then it switches the ROM to the chunk1 and fills it with the NSF code.
The NMI interrupt vector is pointing to some location in the $3000-$3FFF RAM, where resides the procedure for updating LCD display and executing the play code from NSF.
There aren't any problems with the not bankswitched NSF files - ROM is programmed with its contents, except the $FFFE-$FFFF address, which is programmed to point to the procedure in the $3000-$3FFF RAM.
However, some problems occurs with bankswitched music, because the last rom bank (7), which contains NMI interrupt vector might be switched during playback, so I don't know in which banks' last 2 bytes should I write the NMI addres vector?