//4 this dose the sprite? wwww
/* fill pattern offset with a distinctive pattern */
for (i=0;i < gvar.video.page[0].width;i++) {
- o = (i >> 2) + gvar.video.page[1].pattern_ofs;
+ o = (i >> 2) + (0x10000UL - (uint16_t)gvar.video.page[1].data);
vga_write_sequencer(0x02/*map mask*/,1 << (i&3));
for (j=0;j < VMEMHEIGHT;j++,o += gvar.video.page[0].stridew)
vga_state.vga_graphics_ram[o] = (i^j)&15; // VRL samples put all colors in first 15!
/* block copy pattern to where we will draw the sprite */
vga_setup_wm1_block_copy();
o2 = gvar.video.page[0].pagesize;
- o = gvar.video.page[1].pattern_ofs + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen
+ o = (0x10000UL - (uint16_t)gvar.video.page[1].data) + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen
for (i=0;i < h;i++,o += gvar.video.page[0].stridew,o2 += (w >> 2)) vga_wm1_mem_block_copy(o2,o,w >> 2);
/* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */
vga_restore_rm0wm0();
}
}
//uint16_t
- printf("%u %u\n", (gvar.video.page[1].data), 0x10000UL - gvar.video.page[0].pagesize);
+ printf("%u\n", (0x10000UL - (uint16_t)(gvar.video.page[1].data)));
VGAmodeX(0, 1, &gvar);
free(vrl_lineoffs);
buffer = NULL;
page.tilesh=page.height/TILEWH;\r
page.tilemidposscreenx = page.tw/2;\r
page.tilemidposscreeny = (page.th/2)+1;\r
- page.pattern_ofs=0;\r
page.stridew=page.width/4;\r
page.pagesize = (word)(page.stridew)*page.height;\r
page.pi=page.width*4;\r
result.tilesw = p->tilesw;\r
result.tilesh = p->tilesh;\r
result.stridew=p->stridew;\r
- result.pattern_ofs = 0x10000UL - p->pagesize;\r
result.pagesize = p->pagesize;\r
result.pi=result.width*4;\r
result.id = p->id+1;\r
result.th = result.sh/TILEWH;\r
result.tilesw=result.width/TILEWH;\r
result.tilesh=result.height/TILEWH;\r
- result.pattern_ofs=0x10000UL - (p->pattern_ofs+p->pagesize);\r
result.id = p->id+1;\r
result.stridew=p->sw/4;//result.width/4;\r
result.pagesize = (word)(result.stridew)*result.height;\r
mv[id].tx++;
/* Snap the origin forward */
mv[id].page->data += 4;
- mv[id].page->pattern_ofs += 4;
+
mv[id].page->dx = mv[id].map->tiles->tileWidth;
}
mv[id].tx--;
/* Snap the origin backward */
mv[id].page->data -= 4;
- mv[id].page->pattern_ofs -= 4;
+
mv[id].page->dx = mv[id].map->tiles->tileWidth;
}
mv[id].ty--;
/* Snap the origin downward */
mv[id].page->data -= mv[id].page->pi;
- mv[id].page->pattern_ofs -= mv[id].page->pi;
+
mv[id].page->dy = mv[id].map->tiles->tileHeight;
}
mv[id].ty++;
/* Snap the origin downward */
mv[id].page->data += mv[id].page->pi;
- mv[id].page->pattern_ofs += mv[id].page->pi;
+
mv[id].page->dy = mv[id].map->tiles->tileHeight;
}
// vga_restore_rm0wm0();
/* Snap the origin forward */
mv[id].page->data += 4;
- mv[id].page->pattern_ofs += 4;
mv[id].page->dx = mv[0].map->tiles->tileWidth;
}
}
// vga_restore_rm0wm0();
/* Snap the origin backward */
mv[id].page->data -= 4;
- mv[id].page->pattern_ofs -=4;
mv[id].page->dx = mv[0].map->tiles->tileWidth;
}
}
// vga_restore_rm0wm0();
/* Snap the origin backward */
mv[id].page->data -= mv[id].page->pi;
- mv[id].page->pattern_ofs -= mv[id].page->pi;
mv[id].page->dy = mv[0].map->tiles->tileWidth;
}
}
// vga_restore_rm0wm0();
/* Snap the origin forward */
mv[id].page->data += mv[id].page->pi;
- mv[id].page->pattern_ofs += mv[id].page->pi;
mv[id].page->dy = mv[0].map->tiles->tileWidth;
}
}
sword tilemidposscreeny; /* middle tile position */\r
sword tileplayerposscreenx; /* player position on screen */\r
sword tileplayerposscreeny; /* player position on screen */\r
- uint16_t pattern_ofs; /* doslib vga patter offset www */\r
word stridew; /*width/4*/\r
word pagesize; /* page size */\r
word pi; /* incremention page by this much to preserve location */\r