User:Myask/MyaGrafx

From NESdev Wiki
< User:Myask
Revision as of 07:21, 21 April 2015 by Myask (talk | contribs) (Created page with ""Perhaps someone should mock up a specification for a CPLD that only provides 8x8 attributes and nothing else."--[http://forums.nesdev.com/viewtopic.php?f=21&t=11497&start=165...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

"Perhaps someone should mock up a specification for a CPLD that only provides 8x8 attributes and nothing else."--Tepples

Sources

PPU rendering, Cartridge connector

Basic

As the cart only has CIRAM A10 piped through, one can't just remap part of CIRAM to supply the 256 bytes of attribute one needs for page 0.

So, for the basicmost case... PPU: --10 NT11 11yy yxxx is where attributes normally reside. To our advantage, the nametable byte precedes the attribute table byte. This allows at least the 8x8 tile to be detected: NT-fetch is PPU: --10 NTYY YyyX XXxx. (A1, A6 are what we want to know, as they're not in the AT fetch). For this simple one, instead of storing the attribute data per-tile, it's arranged as usual: four tiles in a 32x32 are specified each byte, just that the game pak will return different byte depending on the X and Y tile evenness.


//pseudo-verilog
fall(PPU_/RD){
  if (PPU_A13 & NAND(PPUA8, PPUA9) {AT_8X <= PPUA1; AT_8Y <= PPUA6} //NT-fetch
}

rise(M2){
  if (~CPU_W & CPU_A15 == 1) //only have one visible register bit, so little decoding necessary: CPU$8xxx.
    Mya_ATRAM_Enable <= CPU_D0;
}
Mya_ATRAM_A0-5 = PPU_A0-5; //don't really need to go through CPLD?
Mya_ATRAM_A6 = PPU_A12 ? PPU_A6: AT_8X; //write to PPU  0011 NT*0 YXyy yxxx, A8=0 is to dodge palettes.
Mya_ATRAM_A7 = PPU_A12 ? PPU_A7: AT_8Y;
Mya_ATRAM_A8-9 = PPU_A10-11; //NT-select. Also don't need to be routed through.
Mya_ATRAM_WR = PPU_WR & PPU_A13 & PPU_A12 & ~PPU_A8;
Mya_ATRAM_CE = PPU_A13 & (PPU_A12 ? (~PPU_A8) : PPU_A8) & PPU_A9 & (AT_8X | AT_8Y) & Mya_ATRAM_Enable;
CIRAM_CE = PPUA13       //NT/AT only
  & (~PPUA12 | AND(PPUA8-11))  //disable for 30xx-3Exx to allow the writes to cart
  & (AND(PPUA6-9) ? NOR(AT_8X | AT_8Y): 1); //and enable for the UL AT fetches and all NT fetches.
//also connect Mya_ATRAM_D0-7 to PPU_D0-7

Less basic

This mode of writing does not work if we want to extend to 8x1 attributes; there are three bits of attribute space to add and we only have three choices (00, 01, 10) of PPUADDR 8-9 for NT3. Even in two-screen mirroring, there is a small problem: but as we are relying on CIRAM for the first sliver of each section, one does not need to have duplicate write-access to those. One could remap $38** to what would have been in $3F**. Four-screen proves more problematic.