uint32 dummy;
uint32 color = (addr & 0x0c000) >> 14;
#if defined(_FM77AV_VARIANTS)
- if(active_page != 0) {
- offset = offset_point_bank1 & 0x7fff;
+ if (display_mode != DISPLAY_MODE_8_400L) {
+ if (mode320) {
+ if (active_page != 0) {
+ offset = offset_point_bank1 & 0x1fff;
+ } else {
+ offset = offset_point & 0x1fff;
+ }
+ } else {
+ if (active_page != 0) {
+ offset = offset_point_bank1 & 0x3fff;
+ } else {
+ offset = offset_point & 0x3fff;
+ }
+ }
} else {
- offset = offset_point & 0x7fff;
+ if (active_page != 0) {
+ offset = offset_point_bank1 & 0x7fff;
+ } else {
+ offset = offset_point & 0x7fff;
+ }
+ }
+ if (!offset_77av) {
+ offset &= 0x7fe0;
}
#else
offset = offset_point & 0x7fe0;
tmp_offset_point[active_page].b.h &= 0x7f;
} else {
tmp_offset_point[active_page].b.l = rval;
- if(!offset_77av) {
- tmp_offset_point[active_page].b.l &= 0xe0;
- }
}
offset_changed[active_page] = !offset_changed[active_page];
if(offset_changed[active_page]) {
uint8 dummy;
#if defined(_FM77AV_VARIANTS)
- if(active_page != 0) { // Not 400line
- offset = offset_point_bank1 & 0x7fff;
+ if (display_mode != DISPLAY_MODE_8_400L) {
+ if (mode320) {
+ if (active_page != 0) {
+ offset = offset_point_bank1 & 0x1fff;
+ } else {
+ offset = offset_point & 0x1fff;
+ }
+ } else {
+ if (active_page != 0) {
+ offset = offset_point_bank1 & 0x3fff;
+ } else {
+ offset = offset_point & 0x3fff;
+ }
+ }
} else {
- offset = offset_point & 0x7fff;
+ if (active_page != 0) {
+ offset = offset_point_bank1 & 0x7fff;
+ } else {
+ offset = offset_point & 0x7fff;
+ }
+ }
+ if (!offset_77av) {
+ offset &= 0x7fe0;
}
#else
- offset = offset_point & 0x7fe0;
+ offset = offset_point & 0x3fe0;
#endif
if(addr < 0xc000) {
#if defined(_FM77AV_VARIANTS)
void MB61VH010::do_line(void)
{
- int x_begin = (int)line_xbegin.w.l;
- int x_end = (int)line_xend.w.l;
- int y_begin = (int)line_ybegin.w.l;
- int y_end = (int)line_yend.w.l;
- int cpx_t = x_begin;
- int cpy_t = y_begin;
- int ax = x_end - x_begin;
- int ay = y_end - y_begin;
+ uint32 x_begin = line_xbegin.w.l;
+ uint32 x_end = line_xend.w.l;
+ uint32 y_begin = line_ybegin.w.l;
+ uint32 y_end = line_yend.w.l;
+ int cpx_t = (int)x_begin;
+ int cpy_t = (int)y_begin;
+ int ax = (int)x_end - (int)x_begin;
+ int ay = (int)y_end - (int)y_begin;
int diff = 0;
int count = 0;
int xcount;
oldaddr = 0xffffffff;
-
+ if ((x_begin >= screen_width) && (x_end >= screen_width)) return;
+ if ((y_begin >= screen_height) && (y_end >= screen_height)) return;
+
line_style = line_pattern;
busy_flag = true;
total_bytes = 0;
mask_reg = 0xff;
- if((line_style.b.h & 0x80) != 0) {
- mask_reg &= ~vmask[cpx_t & 7];
- }
+ if ((line_style.b.h & 0x80) != 0) {
+ mask_reg &= ~vmask[cpx_t & 7];
+ }
tmp8a = ((line_style.b.h & 0x80) >> 7) & 0x01;
line_style.w.l = (line_style.w.l << 1) | tmp8a;
if(ycount == 0) {
if(ax > 0) {
if(x_end >= screen_width) x_end = screen_width - 1;
- for(; cpx_t <= x_end; cpx_t++) {
+ for(; cpx_t <= (int)x_end; cpx_t++) {
lastflag = put_dot(cpx_t, cpy_t);
}
} else {
if(x_end < 0) x_end = 0;
- for(; cpx_t >= x_end; cpx_t--) {
+ for(; cpx_t >= (int)x_end; cpx_t--) {
lastflag = put_dot(cpx_t, cpy_t);
}
}
} else if(xcount == 0) {
if(ay > 0) {
if(y_end >= screen_height) y_end = screen_height - 1;
- for(; cpy_t <= y_end; cpy_t++) {
+ for(; cpy_t <= (int)y_end; cpy_t++) {
lastflag = put_dot(cpx_t, cpy_t);
}
} else {
- if(y_end < 0) y_end = 0;
- for(; cpy_t >= y_end; cpy_t--) {
+ //if(y_end < 0) y_end = 0;
+ for(; cpy_t >= (int)y_end; cpy_t--) {
lastflag = put_dot(cpx_t, cpy_t);
}
}
if(ax < 0) {
if(x_end < 0) xcount = x_begin;
} else {
- if(x_end >= screen_width) xcount = screen_width - x_begin - 1;
+ //if(x_end >= screen_width) xcount = screen_width - x_begin - 1;
+ if(x_end >= screen_width) xcount = (int)screen_width - (int)x_begin;
}
for(; xcount >= 0; xcount-- ) {
lastflag = put_dot(cpx_t, cpy_t);
count += diff;
if(count > 16384) {
if(ay < 0) {
- if(cpy_t > y_end) cpy_t--;
+ if(cpy_t > (int)y_end) cpy_t--;
} else {
- if(cpy_t < y_end) cpy_t++;
+ if(cpy_t < (int)y_end) cpy_t++;
}
count -= 32768;
}
} else if(xcount == ycount) {
//xcount++;
if(ax < 0) {
- if(x_end < 0) xcount = x_begin;
+ xcount = x_begin;
} else {
- if(x_end >= screen_width) xcount = screen_width - x_begin - 1;
+ //if(x_end >= screen_width) xcount = (int)(screen_width - x_begin) - 1;
+ if (x_end >= screen_width) xcount = (int)screen_width - (int)x_begin;
}
for(; xcount >= 0; xcount-- ) {
lastflag = put_dot(cpx_t, cpy_t);
count += diff;
if(count > 16384) {
if(ax < 0) {
- if(cpx_t > x_end) cpx_t--;
+ if(cpx_t > (int)x_end) cpx_t--;
} else if(ax > 0) {
- if(cpx_t < x_end) cpx_t++;
+ if(cpx_t < (int)x_end) cpx_t++;
}
count -= 32768;
}