some minor refactoring of dc video, shouldn't make any noticable difference.

This commit is contained in:
davidhay 2009-03-31 20:36:04 +00:00
parent 17829d00e1
commit 7d2fd2d4ef
2 changed files with 37 additions and 12 deletions

View File

@ -333,7 +333,7 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
char name[128]; char name[128];
UINT64 key; UINT64 key;
memset(name, '\0',128); memset(name,'\0',128);
memcpy(name, v->picdata+33, 7); memcpy(name, v->picdata+33, 7);
memcpy(name+7, v->picdata+25, 7); memcpy(name+7, v->picdata+25, 7);
gdromfile = cdrom_open(v->gdromchd); gdromfile = cdrom_open(v->gdromchd);
@ -393,6 +393,8 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
(buffer[pos+11] << 8) | (buffer[pos+11] << 8) |
(buffer[pos+12] << 16) | (buffer[pos+12] << 16) |
(buffer[pos+13] << 24)); (buffer[pos+13] << 24));
printf("start %08x size %08x\n", start,size);
break; break;
} }
if (buffer[pos] == 0) if (buffer[pos] == 0)
@ -450,6 +452,8 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
(buffer[pos+11] << 8) | (buffer[pos+11] << 8) |
(buffer[pos+12] << 16) | (buffer[pos+12] << 16) |
(buffer[pos+13] << 24)); (buffer[pos+13] << 24));
printf("start %08x size %08x\n", start,size);
break; break;
} }
if (buffer[pos] == 0) if (buffer[pos] == 0)

View File

@ -823,7 +823,9 @@ static void computedilated(void)
} }
#if DEBUG_VERTICES #if DEBUG_VERTICES
static void testdrawline(bitmap_t *bitmap, int index, int from, int to)
INLINE void testdrawline(bitmap_t *bitmap, testvertices* from, testvertices* to)
{ {
UINT32 *bmpaddr; UINT32 *bmpaddr;
int ix, iy, i, inc, x, y, dx, dy, plotx, ploty; int ix, iy, i, inc, x, y, dx, dy, plotx, ploty;
@ -834,10 +836,10 @@ render_bounds line, clip;
clip.y0=0; clip.y0=0;
clip.x1=639; clip.x1=639;
clip.y1=479; clip.y1=479;
line.x0=state_ta.grab[index].showvertices[from].x; line.x0=from->x;
line.y0=state_ta.grab[index].showvertices[from].y; line.y0=from->y;
line.x1=state_ta.grab[index].showvertices[to].x; line.x1=to->x;
line.y1=state_ta.grab[index].showvertices[to].y; line.y1=to->y;
if (render_clip_line(&line, &clip)) if (render_clip_line(&line, &clip))
return; return;
dx=line.x1-line.x0; dx=line.x1-line.x0;
@ -871,6 +873,15 @@ render_bounds line, clip;
} }
} }
} }
INLINE void testdrawpoly(bitmap_t *bitmap, testvertices **v)
{
testdrawline(bitmap,v[0],v[1]);
testdrawline(bitmap,v[1],v[2]);
testdrawline(bitmap,v[2],v[0]);
}
#endif #endif
#if 0 #if 0
@ -1103,13 +1114,23 @@ static void testdrawscreen(const running_machine *machine,bitmap_t *bitmap,const
a = state_ta.grab[rs].testvertices_size; a = state_ta.grab[rs].testvertices_size;
if (a > 65530) if (a > 65530)
a = 65530; a = 65530;
for (cs=1;cs < a;cs++)
cs = 0;
while (cs<a)
{ {
testdrawline(bitmap,rs,cs-1,cs); // draw a segment from vertex xi to vertex yi testvertices *v[3];
if ((cs > 1) && (state_ta.grab[rs].showvertices[cs-2].endofstrip == 0))
testdrawline(bitmap,rs,cs-2,cs); v[0] = &state_ta.grab[rs].showvertices[cs]; cs++;
if (state_ta.grab[rs].showvertices[cs].endofstrip == 1) v[1] = &state_ta.grab[rs].showvertices[cs]; cs++;
cs++; v[2] = &state_ta.grab[rs].showvertices[cs]; cs++;
testdrawpoly(bitmap,v);
if (v[2]->endofstrip==0)
{
cs-=2;
}
} }
#endif #endif
} }