command at 0xA value 0x04 flashes different colors bit depth?? value 0x10 very corrupted graphics text characters off by 1 broken sync signal maybe broken horizontal flip mode?? value 0x20 (flipscreen) rest nothing? sprite jump is not 12 bits probably 11 nope just 10 scroll offsets: - both scrolls can be set at once (e.g. 0b1111) to the same value - scroll is always set from the un-adjusted coordinates (i.e. ignore bits dont matter) - set bits: - 0b0000 - set neither - 0b0001 - set one ("local") - 0b0010 - set the other ("global") - 0b0011 - set both - ignore bits: - 0b1000 is the same as 0b0000 (!) - use both offsets - 0b0100 - ignore scroll set by 0b0001 (use "global" only) - 0b1100 - ignore both - scroll is applied BEFORE rendering the current sprite(!) (i.e. using the set scroll bits on a visible sprite will render it at 2x the listed position) - basically, the sequence of events is - POS0 = read from sprite entry - set the scroll(s) from POS0, if specified - add the scroll(s) to POS0, if specified - POS1.y = POS0.y (if [the old value of] Y_LOCK is 0) - read Y_LOCK and PALETTE_LOCK and PALETTE1 (and block control bits and everything else in word 4) from sprite entry - PALETTE2 = PALETTE1 (if PALETTE_LOCK is 0) - POS2.y = POS1.y (if Y_MODE is 0) - POS2.x = POS1.x = POS0.x (if X_MODE is 0) - POS2.x = POS1.x (if X_MODE is 1) - POS1.x = POS2.x; POS2.x = POS0.x (if X_MODE is 2) - POS1.x = POS2.x (if X_MODE is 3) - render the sprite at POS2 (resetting POS2.x from POS1.x after each row), with PALETTE2 and the flip settings etc. - the x and y positions are 12 bits (e.g. 0x7000 = 0x0000 ≠ 0x0800) - word 5 (tile id high) has at least 2 bits for the tile id. but i suspect carts can support 3 or 4 - a sprite IS rendered if the command bit is set, as well as if the lower 16 bits of the id is 0 (and upper bits are set) - but not sure if sprites are rendered if all id bits are 0, our rom has a blank sprite there i think - approximately 880 sprites can be rendered total ? sprite word 5: [??kj ?hgf edca ??tb] b - (command mode only) set bank (todo test this more) t - (command mode only) disable clearing? seems to have a strange effect in reality though. may require using both banks or something. the first 2 bits are the upper bits of the tile id regardless of whether we're in command mode or not a - (both) flip each group of 4 columns (texture relative)? c - (both) mix up rows? not similar to the previous d - (both) display right half different? e - (both) squish vertically and display bottom different? in command mode, if the $00F0 nibble is set to 3, 5, 11, or 13, sprites disappear. when changed out of these modes, they reappear and there are garbage pixels for a frame (but the amount of garbage pixels can vary a lot) so, this happens, if a=1 and c≠d, i suppose. 3 and 11 and different from 5 and 13 in some way (namely, if we set those, and also set a bank switch, we can still see sprites as we swap between banks. while 5 and 13 don't do that) also other values cause our sprites to not be visible when flipping banks: 1, and 9. so, basically. i think the upper bit doesnt matter, and the lower 3 are like, in a scenario where we have this settings set on one bank but not the other, and are flipping between them: .000 - normal .001 - sprites in bank 0 (ie the other bank from the one we're in after setting this value) arent visible .010 - normal? .011 - sprites in both banks not visible .100 - normal? .101 - sprites in both banks not visible .110 - normal? .111 - normal? f - (command mode) sets palettes to 0(?), and then adds some garbage pixels around the sprites which do a palette offset? not sure where these come from, they seem consistent? g - (command mode) similar to f but different h - (command mode) bank select 2 (uses sprite list at $604000 (and presumably $60C000 if the other bank switch is set) j - (command mode) changes video signal (causes us to lose sync, but definitely still outputting a picture) k - (command mode) flipscreen also note that the command mode bits' (b, t, f, etc.) effects are permanent until set back by another command sprite. and i think thats everything. so basically these bits affect the current sprite: $00F3 and when command mode is enabled, these bits will set persistent settings: $3773 ok so when reading sprite textures, we get 24 bits of data per address. corresponding to 4 pixels at 6bpp. each texture is 256 pixels so that's 256/4 = 64 addresses per texture. thus, 6 bits of the graphics bus address are used for addressing within a texture, and the remaining 18 are the texture id. vs tiles: 48 bits per address = 8 pixels, 32 addresses per texture. 5 bits within the texture, 19 bits for the texture id (EXCEPT, bit 0 of the graphics bus address is not used for tile textures, for some reason) so actually 18 bits (which we know for sure to be true, since there's no bits left in the tile struct) HOWEVER technically we don't actually know if the graphics bus address is only 24 bits. our cartridge only latches that many,