I've seen people developing "PPU"s like Uzebox that are at the same time game consoles. They have their pros and cons regarding resources, but they all use megaAVR microcontrollers which are barely overclocked to cca 24MHz.
Now, the XMEGA microcontrollers which are held in the shadow of incompatibility due to 16-bit pointers of the avr-gcc compiler/linker, are actually much stronger. There's an XMEGA microcontroller called ATXMEGA128A1U which I have and it has the external bus interface, 128kB of program memory and 8kB of RAM. There's also another one called ATXMEGA384C3 and a similar one called ATXMEGA384D3 which is the strongest AVR microcontroller because it has 384kB of Flash memory and 32kB of RAM, but no external bus interface.
I was thinking if one of those, overclocked at 48MHz, using PWM or USART/SPI to act as PWM which then connects to a PWM to analog converter and such, could actually act like an NES PPU. I imagine placing them on a development board which attaches to the DIP chip socket on the NES.
The reasons to do this would be:
The XMEGA wouldn't be strong enough to handle the bus transfers so I was thinking if fast shift registers such as parallel-to-serial and serial-to-parallel could be connected to the SPI pins of the XMEGA so that the XMEGA sends bytes like 0x12 0x34 0x56 which means that at address 0x1234 should 0x56 be written. Likewise, the parallel-to-serial registers would be connected together so that the register address and data byte are connected to 3 bytes which go to the XMEGA's SPI and are transferred into the XMEGA's RAM by DMA while the XMEGA is rendering the picture.
What do you think about the doability of this?
Now, the XMEGA microcontrollers which are held in the shadow of incompatibility due to 16-bit pointers of the avr-gcc compiler/linker, are actually much stronger. There's an XMEGA microcontroller called ATXMEGA128A1U which I have and it has the external bus interface, 128kB of program memory and 8kB of RAM. There's also another one called ATXMEGA384C3 and a similar one called ATXMEGA384D3 which is the strongest AVR microcontroller because it has 384kB of Flash memory and 32kB of RAM, but no external bus interface.
I was thinking if one of those, overclocked at 48MHz, using PWM or USART/SPI to act as PWM which then connects to a PWM to analog converter and such, could actually act like an NES PPU. I imagine placing them on a development board which attaches to the DIP chip socket on the NES.
The reasons to do this would be:
- Masking out the first and last 8 pixels to prevent scrolling glitches, with black color, unless the PPU mask bit is configured to not mask
- Rendering more than 8 sprites per scanline
- Increasing the color palette
- Using the internal RAM to extend the pattern table to spare cartridge RAM and to make 4bpp tiles
- Enabling extra features for sprites that could be used by the currently unused bits 2, 3 and 4 in the byte 2 of the OAM structure, such as:
- Using 16x8 (if sprite height is set to 8x16) sprites rather than 8x16 sprites because horizontally longer sprites reduce the number of sprites per scaline
- Using 16x16 sprites if sprite height is set to 8x8
- Using more palettes
- Using 4bpp sprites from the extended pattern table
- Using internal RAM to make more nametables
- Using internal Flash to store full ASCII fonts which can be mappable to the extended pattern table by the internal mapper
The XMEGA wouldn't be strong enough to handle the bus transfers so I was thinking if fast shift registers such as parallel-to-serial and serial-to-parallel could be connected to the SPI pins of the XMEGA so that the XMEGA sends bytes like 0x12 0x34 0x56 which means that at address 0x1234 should 0x56 be written. Likewise, the parallel-to-serial registers would be connected together so that the register address and data byte are connected to 3 bytes which go to the XMEGA's SPI and are transferred into the XMEGA's RAM by DMA while the XMEGA is rendering the picture.
What do you think about the doability of this?