1 // This is part of Pico Library
\r
3 // (c) Copyright 2007, Grazvydas "notaz" Ignotas
\r
4 // Free for non-commercial use.
\r
6 // For commercial use, separate licencing terms must be obtained.
\r
9 // this is a frame-based renderer, alternative to Dave's line based which is in Draw.c
\r
12 #include "PicoInt.h"
\r
14 // port_config.h include must define these 2 defines:
\r
15 // #define START_ROW 1 // which row of tiles to start rendering at?
\r
16 // #define END_ROW 27 // ..end
\r
17 // one row means 8 pixels. If above example was used, (27-1)*8=208 lines would be rendered.
\r
19 #define TILE_ROWS END_ROW-START_ROW
\r
23 // note: this is not implemented in ARM asm
\r
24 #if defined(DRAW2_OVERRIDE_LINE_WIDTH)
\r
25 #define LINE_WIDTH DRAW2_OVERRIDE_LINE_WIDTH
\r
27 #define LINE_WIDTH 328
\r
30 static int HighCache2A[41*(TILE_ROWS+1)+1+1]; // caches for high layers
\r
31 static int HighCache2B[41*(TILE_ROWS+1)+1+1];
\r
33 unsigned short *PicoCramHigh=Pico.cram; // pointer to CRAM buff (0x40 shorts), converted to native device color (works only with 16bit for now)
\r
34 void (*PicoPrepareCram)()=0; // prepares PicoCramHigh for renderer to use
\r
37 // stuff available in asm:
\r
39 void BackFillFull(int reg7);
\r
40 void DrawLayerFull(int plane, int *hcache, int planestart, int planeend);
\r
41 void DrawTilesFromCacheF(int *hc);
\r
42 void DrawWindowFull(int start, int end, int prio);
\r
43 void DrawSpriteFull(unsigned int *sprite);
\r
47 static int TileXnormYnorm(unsigned char *pd,int addr,unsigned char pal)
\r
49 unsigned int pack=0; unsigned int t=0, blank = 1;
\r
52 for(i=8; i; i--, addr+=2, pd += LINE_WIDTH) {
\r
53 pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
\r
56 t=pack&0x0000f000; if (t) pd[0]=(unsigned char)((t>>12)|pal);
\r
57 t=pack&0x00000f00; if (t) pd[1]=(unsigned char)((t>> 8)|pal);
\r
58 t=pack&0x000000f0; if (t) pd[2]=(unsigned char)((t>> 4)|pal);
\r
59 t=pack&0x0000000f; if (t) pd[3]=(unsigned char)((t )|pal);
\r
60 t=pack&0xf0000000; if (t) pd[4]=(unsigned char)((t>>28)|pal);
\r
61 t=pack&0x0f000000; if (t) pd[5]=(unsigned char)((t>>24)|pal);
\r
62 t=pack&0x00f00000; if (t) pd[6]=(unsigned char)((t>>20)|pal);
\r
63 t=pack&0x000f0000; if (t) pd[7]=(unsigned char)((t>>16)|pal);
\r
67 return blank; // Tile blank?
\r
70 static int TileXflipYnorm(unsigned char *pd,int addr,unsigned char pal)
\r
72 unsigned int pack=0; unsigned int t=0, blank = 1;
\r
75 for(i=8; i; i--, addr+=2, pd += LINE_WIDTH) {
\r
76 pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
\r
79 t=pack&0x000f0000; if (t) pd[0]=(unsigned char)((t>>16)|pal);
\r
80 t=pack&0x00f00000; if (t) pd[1]=(unsigned char)((t>>20)|pal);
\r
81 t=pack&0x0f000000; if (t) pd[2]=(unsigned char)((t>>24)|pal);
\r
82 t=pack&0xf0000000; if (t) pd[3]=(unsigned char)((t>>28)|pal);
\r
83 t=pack&0x0000000f; if (t) pd[4]=(unsigned char)((t )|pal);
\r
84 t=pack&0x000000f0; if (t) pd[5]=(unsigned char)((t>> 4)|pal);
\r
85 t=pack&0x00000f00; if (t) pd[6]=(unsigned char)((t>> 8)|pal);
\r
86 t=pack&0x0000f000; if (t) pd[7]=(unsigned char)((t>>12)|pal);
\r
89 return blank; // Tile blank?
\r
92 static int TileXnormYflip(unsigned char *pd,int addr,unsigned char pal)
\r
94 unsigned int pack=0; unsigned int t=0, blank = 1;
\r
98 for(i=8; i; i--, addr-=2, pd += LINE_WIDTH) {
\r
99 pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
\r
100 if(!pack) continue;
\r
102 t=pack&0x0000f000; if (t) pd[0]=(unsigned char)((t>>12)|pal);
\r
103 t=pack&0x00000f00; if (t) pd[1]=(unsigned char)((t>> 8)|pal);
\r
104 t=pack&0x000000f0; if (t) pd[2]=(unsigned char)((t>> 4)|pal);
\r
105 t=pack&0x0000000f; if (t) pd[3]=(unsigned char)((t )|pal);
\r
106 t=pack&0xf0000000; if (t) pd[4]=(unsigned char)((t>>28)|pal);
\r
107 t=pack&0x0f000000; if (t) pd[5]=(unsigned char)((t>>24)|pal);
\r
108 t=pack&0x00f00000; if (t) pd[6]=(unsigned char)((t>>20)|pal);
\r
109 t=pack&0x000f0000; if (t) pd[7]=(unsigned char)((t>>16)|pal);
\r
113 return blank; // Tile blank?
\r
116 static int TileXflipYflip(unsigned char *pd,int addr,unsigned char pal)
\r
118 unsigned int pack=0; unsigned int t=0, blank = 1;
\r
122 for(i=8; i; i--, addr-=2, pd += LINE_WIDTH) {
\r
123 pack=*(unsigned int *)(Pico.vram+addr); // Get 8 pixels
\r
124 if(!pack) continue;
\r
126 t=pack&0x000f0000; if (t) pd[0]=(unsigned char)((t>>16)|pal);
\r
127 t=pack&0x00f00000; if (t) pd[1]=(unsigned char)((t>>20)|pal);
\r
128 t=pack&0x0f000000; if (t) pd[2]=(unsigned char)((t>>24)|pal);
\r
129 t=pack&0xf0000000; if (t) pd[3]=(unsigned char)((t>>28)|pal);
\r
130 t=pack&0x0000000f; if (t) pd[4]=(unsigned char)((t )|pal);
\r
131 t=pack&0x000000f0; if (t) pd[5]=(unsigned char)((t>> 4)|pal);
\r
132 t=pack&0x00000f00; if (t) pd[6]=(unsigned char)((t>> 8)|pal);
\r
133 t=pack&0x0000f000; if (t) pd[7]=(unsigned char)((t>>12)|pal);
\r
136 return blank; // Tile blank?
\r
140 // start: (tile_start<<16)|row_start, end: [same]
\r
141 static void DrawWindowFull(int start, int end, int prio)
\r
143 struct PicoVideo *pvid=&Pico.video;
\r
144 int nametab, nametab_step, trow, tilex, blank=-1, code;
\r
145 unsigned char *scrpos = PicoDraw2FB;
\r
146 int tile_start, tile_end; // in cells
\r
149 tile_start = start>>16;
\r
150 tile_end = end>>16;
\r
151 start = start<<16>>16;
\r
154 // Find name table line:
\r
155 if (pvid->reg[12]&1)
\r
157 nametab=(pvid->reg[3]&0x3c)<<9; // 40-cell mode
\r
158 nametab_step = 1<<6;
\r
162 nametab=(pvid->reg[3]&0x3e)<<9; // 32-cell mode
\r
163 nametab_step = 1<<5;
\r
165 nametab += nametab_step*start;
\r
168 code=Pico.vram[nametab+tile_start];
\r
169 if ((code>>15) != prio) return; // hack: just assume that whole window uses same priority
\r
171 scrpos+=8*LINE_WIDTH+8;
\r
172 scrpos+=8*LINE_WIDTH*(start-START_ROW);
\r
174 // do a window until we reach planestart row
\r
175 for(trow = start; trow < end; trow++, nametab+=nametab_step) { // current tile row
\r
176 for (tilex=tile_start; tilex<tile_end; tilex++)
\r
178 int code,addr,zero=0;
\r
179 // unsigned short *pal=NULL;
\r
182 code=Pico.vram[nametab+tilex];
\r
183 if (code==blank) continue;
\r
185 // Get tile address/2:
\r
186 addr=(code&0x7ff)<<4;
\r
188 // pal=PicoCramHigh+((code>>9)&0x30);
\r
189 pal=(unsigned char)((code>>9)&0x30);
\r
191 switch((code>>11)&3) {
\r
192 case 0: zero=TileXnormYnorm(scrpos+(tilex<<3),addr,pal); break;
\r
193 case 1: zero=TileXflipYnorm(scrpos+(tilex<<3),addr,pal); break;
\r
194 case 2: zero=TileXnormYflip(scrpos+(tilex<<3),addr,pal); break;
\r
195 case 3: zero=TileXflipYflip(scrpos+(tilex<<3),addr,pal); break;
\r
197 if(zero) blank=code; // We know this tile is blank now
\r
200 scrpos += LINE_WIDTH*8;
\r
205 static void DrawLayerFull(int plane, int *hcache, int planestart, int planeend)
\r
207 struct PicoVideo *pvid=&Pico.video;
\r
208 static char shift[4]={5,6,6,7}; // 32,64 or 128 sized tilemaps
\r
209 int width, height, ymask, htab;
\r
210 int nametab, hscroll=0, vscroll, cells;
\r
211 unsigned char *scrpos;
\r
212 int blank=-1, xmask, nametab_row, trow;
\r
215 cells = (planeend>>16)-(planestart>>16);
\r
216 planestart = planestart<<16>>16;
\r
217 planeend = planeend<<16>>16;
\r
219 // Work out the Tiles to draw
\r
221 htab=pvid->reg[13]<<9; // Horizontal scroll table address
\r
222 // if ( pvid->reg[11]&2) htab+=Scanline<<1; // Offset by line
\r
223 // if ((pvid->reg[11]&1)==0) htab&=~0xf; // Offset by tile
\r
224 htab+=plane; // A or B
\r
226 if(!(pvid->reg[11]&3)) { // full screen scroll
\r
227 // Get horizontal scroll value
\r
228 hscroll=Pico.vram[htab&0x7fff];
\r
229 htab = 0; // this marks that we don't have to update scroll value
\r
232 // Work out the name table size: 32 64 or 128 tiles (0-3)
\r
233 width=pvid->reg[16];
\r
234 height=(width>>4)&3; width&=3;
\r
236 xmask=(1<<shift[width ])-1; // X Mask in tiles
\r
237 ymask=(height<<5)|0x1f; // Y Mask in tiles
\r
238 if(width == 1) ymask&=0x3f;
\r
239 else if(width>1) ymask =0x1f;
\r
241 // Find name table:
\r
242 if (plane==0) nametab=(pvid->reg[2]&0x38)<< 9; // A
\r
243 else nametab=(pvid->reg[4]&0x07)<<12; // B
\r
245 scrpos = PicoDraw2FB;
\r
246 scrpos+=8*LINE_WIDTH*(planestart-START_ROW);
\r
248 // Get vertical scroll value:
\r
249 vscroll=Pico.vsram[plane]&0x1ff;
\r
250 scrpos+=(8-(vscroll&7))*LINE_WIDTH;
\r
251 if(vscroll&7) planeend++; // we have vertically clipped tiles due to vscroll, so we need 1 more row
\r
253 *hcache++ = 8-(vscroll&7); // push y-offset to tilecache
\r
256 for(trow = planestart; trow < planeend; trow++) { // current tile row
\r
257 int cellc=cells,tilex,dx;
\r
259 // Find the tile row in the name table
\r
260 //ts.line=(vscroll+Scanline)&ymask;
\r
261 //ts.nametab+=(ts.line>>3)<<shift[width];
\r
262 nametab_row = nametab + (((trow+(vscroll>>3))&ymask)<<shift[width]); // pointer to nametable entries for this row
\r
264 // update hscroll if needed
\r
266 int htaddr=htab+(trow<<4);
\r
267 if(trow) htaddr-=(vscroll&7)<<1;
\r
268 hscroll=Pico.vram[htaddr&0x7fff];
\r
271 // Draw tiles across screen:
\r
272 tilex=(-hscroll)>>3;
\r
273 dx=((hscroll-1)&7)+1;
\r
274 if(dx != 8) cellc++; // have hscroll, do more cells
\r
276 for (; cellc; dx+=8,tilex++,cellc--)
\r
278 int code=0,addr=0,zero=0;
\r
279 // unsigned short *pal=NULL;
\r
282 code=Pico.vram[nametab_row+(tilex&xmask)];
\r
283 if (code==blank) continue;
\r
285 if (code>>15) { // high priority tile
\r
286 *hcache++ = code|(dx<<16)|(trow<<27); // cache it
\r
290 // Get tile address/2:
\r
291 addr=(code&0x7ff)<<4;
\r
293 // pal=PicoCramHigh+((code>>9)&0x30);
\r
294 pal=(unsigned char)((code>>9)&0x30);
\r
296 switch((code>>11)&3) {
\r
297 case 0: zero=TileXnormYnorm(scrpos+dx,addr,pal); break;
\r
298 case 1: zero=TileXflipYnorm(scrpos+dx,addr,pal); break;
\r
299 case 2: zero=TileXnormYflip(scrpos+dx,addr,pal); break;
\r
300 case 3: zero=TileXflipYflip(scrpos+dx,addr,pal); break;
\r
302 if(zero) blank=code; // We know this tile is blank now
\r
305 scrpos += LINE_WIDTH*8;
\r
308 *hcache = 0; // terminate cache
\r
312 static void DrawTilesFromCacheF(int *hc)
\r
314 int code, addr, zero = 0;
\r
315 unsigned int prevy=0xFFFFFFFF;
\r
316 // unsigned short *pal;
\r
318 short blank=-1; // The tile we know is blank
\r
319 unsigned char *scrpos = PicoDraw2FB, *pd = 0;
\r
321 // *hcache++ = code|(dx<<16)|(trow<<27); // cache it
\r
322 scrpos+=(*hc++)*LINE_WIDTH - START_ROW*LINE_WIDTH*8;
\r
324 while((code=*hc++)) {
\r
325 if((short)code == blank) continue;
\r
328 if(((unsigned)code>>27) != prevy) {
\r
329 prevy = (unsigned)code>>27;
\r
330 pd = scrpos + prevy*LINE_WIDTH*8;
\r
333 // Get tile address/2:
\r
334 addr=(code&0x7ff)<<4;
\r
335 // pal=PicoCramHigh+((code>>9)&0x30);
\r
336 pal=(unsigned char)((code>>9)&0x30);
\r
338 switch((code>>11)&3) {
\r
339 case 0: zero=TileXnormYnorm(pd+((code>>16)&0x1ff),addr,pal); break;
\r
340 case 1: zero=TileXflipYnorm(pd+((code>>16)&0x1ff),addr,pal); break;
\r
341 case 2: zero=TileXnormYflip(pd+((code>>16)&0x1ff),addr,pal); break;
\r
342 case 3: zero=TileXflipYflip(pd+((code>>16)&0x1ff),addr,pal); break;
\r
345 if(zero) blank=(short)code;
\r
350 // sx and sy are coords of virtual screen with 8pix borders on top and on left
\r
351 static void DrawSpriteFull(unsigned int *sprite)
\r
353 int width=0,height=0;
\r
354 // unsigned short *pal=NULL;
\r
356 int tile,code,tdeltax,tdeltay;
\r
357 unsigned char *scrpos;
\r
362 sy=(sy&0x1ff)-0x78; // Y
\r
363 width=(height>>2)&3; height&=3;
\r
364 width++; height++; // Width and height in tiles
\r
367 sx=((code>>16)&0x1ff)-0x78; // X
\r
369 tile=code&0x7ff; // Tile number
\r
370 tdeltax=height; // Delta to increase tile by going right
\r
371 tdeltay=1; // Delta to increase tile by going down
\r
372 if (code&0x0800) { tdeltax=-tdeltax; tile+=height*(width-1); } // Flip X
\r
373 if (code&0x1000) { tdeltay=-tdeltay; tile+=height-1; } // Flip Y
\r
375 //delta<<=4; // Delta of address
\r
376 // pal=PicoCramHigh+((code>>9)&0x30); // Get palette pointer
\r
377 pal=(unsigned char)((code>>9)&0x30);
\r
379 // goto first vertically visible tile
\r
380 while(sy <= START_ROW*8) { sy+=8; tile+=tdeltay; height--; }
\r
382 scrpos = PicoDraw2FB;
\r
383 scrpos+=(sy-START_ROW*8)*LINE_WIDTH;
\r
385 for (; height > 0; height--, sy+=8, tile+=tdeltay)
\r
387 int w = width, x=sx, t=tile;
\r
389 if(sy >= END_ROW*8+8) return; // offscreen
\r
391 for (; w; w--,x+=8,t+=tdeltax)
\r
394 if(x>=328) break; // Offscreen
\r
396 t&=0x7fff; // Clip tile address
\r
397 switch((code>>11)&3) {
\r
398 case 0: TileXnormYnorm(scrpos+x,t<<4,pal); break;
\r
399 case 1: TileXflipYnorm(scrpos+x,t<<4,pal); break;
\r
400 case 2: TileXnormYflip(scrpos+x,t<<4,pal); break;
\r
401 case 3: TileXflipYflip(scrpos+x,t<<4,pal); break;
\r
405 scrpos+=8*LINE_WIDTH;
\r
411 static void DrawAllSpritesFull(int prio, int maxwidth)
\r
413 struct PicoVideo *pvid=&Pico.video;
\r
414 int table=0,maskrange=0;
\r
416 unsigned int *sprites[80]; // Sprites
\r
417 int y_min=START_ROW*8, y_max=END_ROW*8; // for a simple sprite masking
\r
419 table=pvid->reg[5]&0x7f;
\r
420 if (pvid->reg[12]&1) table&=0x7e; // Lowest bit 0 in 40-cell mode
\r
421 table<<=8; // Get sprite table address/2
\r
423 for (i=u=0; u < 80; u++)
\r
425 unsigned int *sprite=NULL;
\r
426 int code, code2, sx, sy, height;
\r
428 sprite=(unsigned int *)(Pico.vram+((table+(link<<2))&0x7ffc)); // Find sprite
\r
433 // check if it is not hidden vertically
\r
434 sy = (code&0x1ff)-0x80;
\r
435 height = (((code>>24)&3)+1)<<3;
\r
436 if(sy+height <= y_min || sy > y_max) goto nextsprite;
\r
440 sx = (code2>>16)&0x1ff;
\r
442 int to = sy+height; // sy ~ from
\r
444 // try to merge with previous range
\r
445 if((maskrange>>16)+1 >= sy && (maskrange>>16) <= to && (maskrange&0xffff) < sy) sy = (maskrange&0xffff);
\r
446 else if((maskrange&0xffff)-1 <= to && (maskrange&0xffff) >= sy && (maskrange>>16) > to) to = (maskrange>>16);
\r
448 // support only very simple masking (top and bottom of screen)
\r
449 if(sy <= y_min && to+1 > y_min) y_min = to+1;
\r
450 else if(to >= y_max && sy-1 < y_max) y_max = sy-1;
\r
451 else maskrange=sy|(to<<16);
\r
457 if(((code2>>15)&1) != prio) goto nextsprite; // wrong priority
\r
459 // check if sprite is not hidden horizontally
\r
460 sx -= 0x78; // Get X coordinate + 8
\r
461 if(sx <= -8*3 || sx >= maxwidth) goto nextsprite;
\r
463 // sprite is good, save it's index
\r
464 sprites[i++]=sprite;
\r
467 // Find next sprite
\r
468 link=(code>>16)&0x7f;
\r
469 if(!link) break; // End of sprites
\r
472 // Go through sprites backwards:
\r
473 for (i-- ;i>=0; i--)
\r
475 DrawSpriteFull(sprites[i]);
\r
479 #ifndef _ASM_DRAW_C
\r
480 static void BackFillFull(int reg7)
\r
484 // Start with a background color:
\r
485 // back=PicoCramHigh[reg7&0x3f];
\r
490 memset32((int *)PicoDraw2FB, back, LINE_WIDTH*(8+(END_ROW-START_ROW)*8)/4);
\r
494 static void DrawDisplayFull(void)
\r
496 struct PicoVideo *pvid=&Pico.video;
\r
497 int win, edge=0, hvwin=0; // LSb->MSb: hwin&plane, vwin&plane, full
\r
498 int planestart=START_ROW, planeend=END_ROW; // plane A start/end when window shares display with plane A (in tile rows or columns)
\r
499 int winstart=START_ROW, winend=END_ROW; // same for window
\r
500 int maxw, maxcolc; // max width and col cells
\r
502 if(pvid->reg[12]&1) {
\r
503 maxw = 328; maxcolc = 40;
\r
505 maxw = 264; maxcolc = 32;
\r
508 // horizontal window?
\r
509 if ((win=pvid->reg[0x12]))
\r
511 hvwin=1; // hwindow shares display with plane A
\r
514 // fullscreen window
\r
516 } else if(win < 0x80) {
\r
517 // window on the top
\r
518 if(edge <= START_ROW) hvwin=0; // window not visible in our drawing region
\r
519 else if(edge >= END_ROW) hvwin=4;
\r
520 else planestart = winend = edge;
\r
521 } else if(win > 0x80) {
\r
522 // window at the bottom
\r
523 if(edge >= END_ROW) hvwin=0;
\r
524 else planeend = winstart = edge;
\r
528 // check for vertical window, but only if win is not fullscreen
\r
531 win=pvid->reg[0x11];
\r
535 else if(edge < (maxcolc>>1)) {
\r
536 // window is on the right
\r
538 planeend|=edge<<17;
\r
539 winstart|=edge<<17;
\r
540 winend|=maxcolc<<16;
\r
543 if(edge >= (maxcolc>>1)) hvwin=4;
\r
545 // window is on the left
\r
548 planestart|=edge<<17;
\r
549 planeend|=maxcolc<<16;
\r
554 if (hvwin==1) { winend|=maxcolc<<16; planeend|=maxcolc<<16; }
\r
556 HighCache2A[1] = HighCache2B[1] = 0;
\r
557 if (PicoDrawMask & PDRAW_LAYERB_ON)
\r
558 DrawLayerFull(1, HighCache2B, START_ROW, (maxcolc<<16)|END_ROW);
\r
559 if (PicoDrawMask & PDRAW_LAYERA_ON) switch (hvwin)
\r
562 // fullscreen window
\r
563 DrawWindowFull(START_ROW, (maxcolc<<16)|END_ROW, 0);
\r
567 // we have plane A and both v and h windows
\r
568 DrawLayerFull(0, HighCache2A, planestart, planeend);
\r
569 DrawWindowFull( winstart&~0xff0000, (winend&~0xff0000)|(maxcolc<<16), 0); // h
\r
570 DrawWindowFull((winstart&~0xff)|START_ROW, (winend&~0xff)|END_ROW, 0); // v
\r
575 // both window and plane A visible, window is vertical XOR horizontal
\r
576 DrawLayerFull(0, HighCache2A, planestart, planeend);
\r
577 DrawWindowFull(winstart, winend, 0);
\r
581 // fullscreen plane A
\r
582 DrawLayerFull(0, HighCache2A, START_ROW, (maxcolc<<16)|END_ROW);
\r
585 if (PicoDrawMask & PDRAW_SPRITES_LOW_ON)
\r
586 DrawAllSpritesFull(0, maxw);
\r
588 if (HighCache2B[1]) DrawTilesFromCacheF(HighCache2B);
\r
589 if (HighCache2A[1]) DrawTilesFromCacheF(HighCache2A);
\r
590 if (PicoDrawMask & PDRAW_LAYERA_ON) switch (hvwin)
\r
593 // fullscreen window
\r
594 DrawWindowFull(START_ROW, (maxcolc<<16)|END_ROW, 1);
\r
598 // we have plane A and both v and h windows
\r
599 DrawWindowFull( winstart&~0xff0000, (winend&~0xff0000)|(maxcolc<<16), 1); // h
\r
600 DrawWindowFull((winstart&~0xff)|START_ROW, (winend&~0xff)|END_ROW, 1); // v
\r
605 // both window and plane A visible, window is vertical XOR horizontal
\r
606 DrawWindowFull(winstart, winend, 1);
\r
609 if (PicoDrawMask & PDRAW_SPRITES_HI_ON)
\r
610 DrawAllSpritesFull(1, maxw);
\r
614 PICO_INTERNAL void PicoFrameFull()
\r
617 if (PicoPrepareCram) PicoPrepareCram();
\r
620 BackFillFull(Pico.video.reg[7]);
\r
621 if (Pico.video.reg[1]&0x40) DrawDisplayFull();
\r