Drawing a 2x2 (16x16) sprite from individual 8x8 tiles requires 4 separate oam_spr calls with manual offset math. This appears in staticsprite, movingsprite, pong, and other samples:
// Today: 4 calls with manual x+8, y+8 offsets and OAM slot math
oam_spr(x, y, 0xD8, 0, 0);
oam_spr((byte)(x + 8), y, 0xDA, 0, 4);
oam_spr(x, (byte)(y + 8), 0xD9, 0, 8);
oam_spr((byte)(x + 8), (byte)(y + 8), 0xDB, 0, 12);
Proposed API:
// Draw a 2x2 sprite grid from 4 tile indices, returns next sprid
byte sprid = oam_spr_2x2(x, y, 0xD8, 0xD9, 0xDA, 0xDB, attr, sprid);
This is the drawing counterpart to meta_spr_2x2 (#419 which creates metasprite data arrays). oam_spr_2x2 directly writes 4 entries into the OAM buffer with the standard 8-pixel offsets.
Parameters are (topLeft, bottomLeft, topRight, bottomRight) to match existing NES tile layout convention.
Once implemented, the staticsprite, movingsprite, and pong samples should be updated to use it.
Related to #30
Drawing a 2x2 (16x16) sprite from individual 8x8 tiles requires 4 separate
oam_sprcalls with manual offset math. This appears in staticsprite, movingsprite, pong, and other samples:Proposed API:
This is the drawing counterpart to
meta_spr_2x2(#419 which creates metasprite data arrays).oam_spr_2x2directly writes 4 entries into the OAM buffer with the standard 8-pixel offsets.Parameters are (topLeft, bottomLeft, topRight, bottomRight) to match existing NES tile layout convention.
Once implemented, the staticsprite, movingsprite, and pong samples should be updated to use it.
Related to #30