diff --git a/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c b/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c index a834da989..9c1546cf1 100644 --- a/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c +++ b/src/video/nv/nv3/classes/nv3_class_00c_win95_gdi_text.c @@ -63,7 +63,8 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_ nv3->pgraph.win95_gdi_text.point_d.x = (param & 0xFFFF); nv3->pgraph.win95_gdi_text.point_d.y = ((param >> 16) & 0xFFFF); - nv3->pgraph.win95_gdi_text_current_position = nv3->pgraph.win95_gdi_text.point_d; + nv3->pgraph.win95_gdi_text_current_position.x = (nv3->pgraph.win95_gdi_text.point_d.x + nv3->pgraph.win95_gdi_text.size_in_d.w); + nv3->pgraph.win95_gdi_text_current_position.y = (nv3->pgraph.win95_gdi_text.point_d.y); break; default: /* Type A submission: these are the same things as rectangles */ diff --git a/src/video/nv/nv3/render/nv3_render_primitives.c b/src/video/nv/nv3/render/nv3_render_primitives.c index d8dfe7ba9..8a9ca8598 100644 --- a/src/video/nv/nv3/render/nv3_render_primitives.c +++ b/src/video/nv/nv3/render/nv3_render_primitives.c @@ -65,28 +65,9 @@ void nv3_render_gdi_type_d(nv3_grobj_t grobj, uint32_t param) bool bit = (param >> bit_num) & 0x01; //bool bit = true; // debug test - nv3->pgraph.win95_gdi_text_current_position.x++; - /* let's hope NV never overflow the y */ - if (nv3->pgraph.win95_gdi_text_current_position.x >= end_x) - { - nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_d.x; - nv3->pgraph.win95_gdi_text_current_position.y++; - } - - /* check if we are in the clipping rectangle */ - if (nv3->pgraph.win95_gdi_text_current_position.x < nv3->pgraph.win95_gdi_text.clip_d.left - || nv3->pgraph.win95_gdi_text_current_position.x > nv3->pgraph.win95_gdi_text.clip_d.right - || nv3->pgraph.win95_gdi_text_current_position.y < nv3->pgraph.win95_gdi_text.clip_d.top - || nv3->pgraph.win95_gdi_text_current_position.y > nv3->pgraph.win95_gdi_text.clip_d.bottom) - { - return; - } - - // if it's 0 we don't need to do anything - if (!bit) - continue; - else + // if it's a 0 bit we don't need to do anything + if (bit) { switch (nv3->nvbase.svga.bpp) { @@ -105,5 +86,24 @@ void nv3_render_gdi_type_d(nv3_grobj_t grobj, uint32_t param) } } + /* increment the position - the bitmap is stored horizontally backward */ + nv3->pgraph.win95_gdi_text_current_position.x--; + + /* let's hope NV never overflow the y */ + if (nv3->pgraph.win95_gdi_text_current_position.x <= nv3->pgraph.win95_gdi_text.point_d.x) + { + nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_d.x + nv3->pgraph.win95_gdi_text.size_in_d.w; + nv3->pgraph.win95_gdi_text_current_position.y++; + } + + /* check if we are in the clipping rectangle */ + if (nv3->pgraph.win95_gdi_text_current_position.x < nv3->pgraph.win95_gdi_text.clip_d.left + || nv3->pgraph.win95_gdi_text_current_position.x > nv3->pgraph.win95_gdi_text.clip_d.right + || nv3->pgraph.win95_gdi_text_current_position.y < nv3->pgraph.win95_gdi_text.clip_d.top + || nv3->pgraph.win95_gdi_text_current_position.y > nv3->pgraph.win95_gdi_text.clip_d.bottom) + { + return; + } + } } \ No newline at end of file