Add NameTable and AttributeTable resolve funcs
that use the registers as input to obtain the
address.
Made v and t registers into a variable type
Fixed error regarding the highest bit of the registers,
which should've been null, not 1, my bad.
#include"cartridge.h" //needs acces to the cartridge to load CHR maps, since r/w functions are in-house instead of bus-wide like it is for busRead/Write it needs to be imported here too, quite like there are physical wires connecting the cartridge CHR bank pins to the PPU
byteppuBus[0x3FFF];
#define PPU_BUS_SIZE (0x3FFF)
byteppuBus[PPU_BUS_SIZE];
PPUppu;
inlinewordresolveNameTableAddress(wordregData){
return(regData&0b0000111111111111)|(1<<(14-1));
}
/*
10NNYYYYYXXXXX
10100010100011==>$28A3
--~~-----~~~~~
^^^^
||||
||y=5x=3
||
|3rdnametable
|
fixed
*/
wordresolveAttributeTableAddress(wordregData){
locationRegistern;
n.data=regData;
bytetrimmedCoarseX=n.bits.coarseX>>2;//trim the lowest 2 bits of coarse X
bytetrimmedCoarseY=n.bits.coarseY>>2;//trim the lowest 2 bits of coarse Y