8 static void particle(int x, int y, int sz);
10 #define SPRITE_BASE 0x8000
11 extern uint16_t cellspr_data[], cellspr_data_end[];
12 extern unsigned char cellspr_cmap[], cellspr_cmap_end[];
23 vdp_setcolor(0, i, i, i, i);
24 vdp_setcolor(1, i, cptr[0] >> 4, cptr[1] >> 4, cptr[2] >> 4);
28 /* upload sprite tiles */
30 vdp_setup_addr(VDP_VRAM, SPRITE_BASE);
31 while(src < cellspr_data_end) {
42 if(bnstate & PAD_UP) {
44 } else if(bnstate & PAD_DOWN) {
47 if(bnstate & PAD_LEFT) {
49 } else if(bnstate & PAD_RIGHT) {
52 if(bndiff & bnstate & PAD_A) {
54 } else if(bndiff & bnstate & PAD_B) {
61 static void particle(int x, int y, int pixsz)
63 int tile, offs = 4, szlevel;
68 tile = VDP_ADDR2TILE(SPRITE_BASE);
69 } else if(pixsz < 16) {
71 tile = VDP_ADDR2TILE(SPRITE_BASE) + szlevel;
72 } else if(pixsz < 24) {
74 tile = VDP_ADDR2TILE(SPRITE_BASE) + szlevel;
75 } else if(pixsz < 32) {
85 tile = VDP_ADDR2TILE(SPRITE_BASE) + (pixsz < 32 ? szlevel : 12);
92 spr_add(x - 4, y - 4, VDP_TILENAME(tile, 1, VDP_TILE_FG), SPR_SIZE(1, 1));
100 spr_add(x - offs, y - offs, VDP_TILENAME(tile, 1, VDP_TILE_FG), SPR_SIZE(1, 1));
101 spr_add(x, y - offs, VDP_TILENAME(tile, 1, VDP_TILE_FG | VDP_TILE_HFLIP), SPR_SIZE(1, 1));
102 spr_add(x - offs, y, VDP_TILENAME(tile, 1, VDP_TILE_FG | VDP_TILE_VFLIP), SPR_SIZE(1, 1));
103 spr_add(x, y, VDP_TILENAME(tile, 1, VDP_TILE_FG | VDP_TILE_HVFLIP), SPR_SIZE(1, 1));
107 offs = 8 + (pixsz & 7);
108 spr_add(x - offs, y - offs, VDP_TILENAME(tile, 1, VDP_TILE_FG), SPR_SIZE(2, 2));
109 spr_add(x, y - offs, VDP_TILENAME(tile, 1, VDP_TILE_FG | VDP_TILE_HFLIP), SPR_SIZE(2, 2));
110 spr_add(x - offs, y, VDP_TILENAME(tile, 1, VDP_TILE_FG | VDP_TILE_VFLIP), SPR_SIZE(2, 2));
111 spr_add(x, y, VDP_TILENAME(tile, 1, VDP_TILE_FG | VDP_TILE_HVFLIP), SPR_SIZE(2, 2));