wwww
修訂 | d6aa8de1065d2657d9aebc1d7fc9953588675e25 (tree) |
---|---|
時間 | 2016-05-09 15:39:14 |
作者 | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
wwww
@@ -187,6 +187,7 @@ modexDefaultPage(page_t *p) | ||
187 | 187 | page.tilesh=page.height/TILEWH; |
188 | 188 | page.tilemidposscreenx = page.tw/2; |
189 | 189 | page.tilemidposscreeny = (page.th/2)+1; |
190 | + page.stridew=page.width/4; | |
190 | 191 | page.pagesize = (sdiword)(page.width/4)*page.height; |
191 | 192 | page.id = 0; |
192 | 193 |
@@ -212,6 +213,7 @@ modexNextPage(page_t *p) { | ||
212 | 213 | result.tilesw = p->tilesw; |
213 | 214 | result.tilesh = p->tilesh; |
214 | 215 | result.id = p->id+1; |
216 | + result.stridew=p->stridew; | |
215 | 217 | result.pagesize = p->pagesize; |
216 | 218 | |
217 | 219 | return result; |
@@ -235,6 +237,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) | ||
235 | 237 | result.tilesw=result.width/TILEWH; |
236 | 238 | result.tilesh=result.height/TILEWH; |
237 | 239 | result.id = p->id+1; |
240 | + result.stridew=result.width/4; | |
238 | 241 | result.pagesize = (sdiword)(result.width/4)*result.height; |
239 | 242 | |
240 | 243 | return result; |
@@ -315,8 +318,8 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { | ||
315 | 318 | word pageOff = (word) page->data; |
316 | 319 | word xoff=x/4; /* xoffset that begins each row */ |
317 | 320 | word scanCount=w/4; /* number of iterations per row (excluding right clip)*/ |
318 | - word poffset = pageOff + y*(page->width/4) + xoff; /* starting offset */ | |
319 | - word nextRow = page->width/4-scanCount-1; /* loc of next row */ | |
321 | + word poffset = pageOff + y*(page->stridew) + xoff; /* starting offset */ | |
322 | + word nextRow = page->stridew-scanCount-1; /* loc of next row */ | |
320 | 323 | byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ |
321 | 324 | byte rclip[] = {0x00, 0x01, 0x03, 0x07}; |
322 | 325 | byte left = lclip[x&0x03]; |
@@ -392,11 +395,11 @@ modexCopyPageRegion(page_t *dest, page_t *src, | ||
392 | 395 | word dx, word dy, |
393 | 396 | word width, word height) |
394 | 397 | { |
395 | - word doffset = (word)dest->data + dy*(dest->width/4) + dx/4; | |
396 | - word soffset = (word)src->data + sy*(src->width/4) + sx/4; | |
398 | + word doffset = (word)dest->data + dy*(dest->stridew) + dx/4; | |
399 | + word soffset = (word)src->data + sy*(src->stridew) + sx/4; | |
397 | 400 | word scans = vga_state.vga_stride; |
398 | - word nextSrcRow = src->width/4 - scans - 1; | |
399 | - word nextDestRow = dest->width/4 - scans - 1; | |
401 | + word nextSrcRow = src->stridew - scans - 1; | |
402 | + word nextDestRow = dest->stridew - scans - 1; | |
400 | 403 | byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */ |
401 | 404 | byte rclip[] = {0x0f, 0x01, 0x03, 0x07}; |
402 | 405 | byte left = lclip[sx&0x03]; |
@@ -82,6 +82,7 @@ typedef struct { | ||
82 | 82 | sword tilemidposscreeny; /* middle tile position */ |
83 | 83 | sword tileplayerposscreenx; /* player position on screen */ |
84 | 84 | sword tileplayerposscreeny; /* player position on screen */ |
85 | + word stridew; /*width/4*/ | |
85 | 86 | sdiword pagesize; /* page size */ |
86 | 87 | } page_t; |
87 | 88 |