- while((code=*hc++)) {\r
- if(!sh && (short)code == blank) continue;\r
-\r
- // Get tile address/2:\r
- addr=(code&0x7ff)<<4;\r
- addr+=(unsigned int)code>>25; // y offset into tile\r
- dx=(code>>16)&0x1ff;\r
- if(sh) {\r
- unsigned char *zb = HighCol+dx;\r
+ if (sh && (rendstatus & (PDRAW_SHHI_DONE|PDRAW_PLANE_HI_PRIO)))\r
+ {\r
+ if (!(rendstatus & PDRAW_SHHI_DONE))\r
+ DrawTilesFromCacheShPrep();\r
+ sh = 0;\r
+ }\r
+\r
+ if (!sh)\r
+ {\r
+ short blank=-1; // The tile we know is blank\r
+ while ((code=*hc++)) {\r
+ int zero;\r
+ if((short)code == blank) continue;\r
+ // Get tile address/2:\r
+ addr=(code&0x7ff)<<4;\r
+ addr+=(unsigned int)code>>25; // y offset into tile\r
+ dx=(code>>16)&0x1ff;\r
+\r
+ pal=((code>>9)&0x30);\r
+ if (rlim-dx < 0) goto last_cut_tile;\r
+\r
+ if (code&0x0800) zero=TileFlip(dx,addr,pal);\r
+ else zero=TileNorm(dx,addr,pal);\r
+\r
+ if (zero) blank=(short)code;\r
+ }\r
+ }\r
+ else\r
+ {\r
+ while ((code=*hc++)) {\r
+ unsigned char *zb;\r
+ // Get tile address/2:\r
+ addr=(code&0x7ff)<<4;\r
+ addr+=(unsigned int)code>>25; // y offset into tile\r
+ dx=(code>>16)&0x1ff;\r
+ zb = HighCol+dx;\r