mcd, accelerate scale/rot rendering code

This commit is contained in:
kub 2022-02-17 19:57:37 +00:00
parent b633247f35
commit 7ce6a6d18e

View file

@ -212,16 +212,13 @@ static inline int gfx_pixel(uint32 xpos, uint32 ypos, uint16 *lut_cell)
/* with: yyy = pixel row (0-7) = (ypos >> 11) & 7 */
/* xxx = pixel column (0-7) = (xpos >> 11) & 7 */
/* hrr = HFLIP & ROTATION bits */
stamp_index |= gfx.lut_pixel[stamp_data | ((xpos >> 8) & 0x38) | ((ypos >> 5) & 0x1c0)];
stamp_index |= gfx.lut_pixel[stamp_data | ((ypos >> 5) & 0x1c0) | ((xpos >> 8) & 0x38)];
/* read pixel pair (2 pixels/byte) */
pixel_out = READ_BYTE(Pico_mcd->word_ram2M, stamp_index >> 1);
/* extract left or rigth pixel */
if (!(stamp_index & 1))
{
pixel_out >>= 4;
}
/* extract left or right pixel */
pixel_out >>= 4 * !(stamp_index & 1);
pixel_out &= 0x0f;
}
}
@ -231,7 +228,7 @@ static inline int gfx_pixel(uint32 xpos, uint32 ypos, uint16 *lut_cell)
#define RENDER_LOOP(N, UPDP, COND1, COND2) do { \
if (bufferIndex & 1) { \
bufferIndex &= ~1; \
bufferIndex ^= 1; \
goto right##N; /* no initial left pixel */ \
} \
/* process all dots */ \
@ -424,10 +421,9 @@ static void gfx_schedule(void)
h = (Pico_mcd->s68k_regs[0x64] << 8) | Pico_mcd->s68k_regs[0x65];
cycles = 5 * w * h;
y_step = h;
if (cycles > UPDATE_CYCLES)
y_step = (UPDATE_CYCLES + 5 * w - 1) / (5 * w);
else
y_step = h;
gfx.y_step = y_step;
pcd_event_schedule_s68k(PCD_EVENT_GFX, 5 * w * y_step);