Fix for affine parameter address resolution

This commit is contained in:
Guy Perfect 2026-03-28 16:46:32 -05:00
parent 534ce852f4
commit 29ade46a0a
1 changed files with 7 additions and 7 deletions

View File

@ -1005,7 +1005,7 @@ static void vipDrawAffine(VB *sim, World *world) {
Cell *cell; /* Source cell */ Cell *cell; /* Source cell */
uint8_t *col, *row; /* Output pixel */ uint8_t *col, *row; /* Output pixel */
uint8_t pixel; /* Character pixel value */ uint8_t pixel; /* Character pixel value */
uint8_t *param; /* World parameter memory */ uint32_t param; /* World parameter memory */
int32_t px, py; /* Pixel source coordinates */ int32_t px, py; /* Pixel source coordinates */
int32_t dx, dy, mp, mx, my; /* Affine parameters */ int32_t dx, dy, mp, mx, my; /* Affine parameters */
int32_t wx; /* Base world X coordinate */ int32_t wx; /* Base world X coordinate */
@ -1052,16 +1052,16 @@ static void vipDrawAffine(VB *sim, World *world) {
wx = x1 - wx; wx = x1 - wx;
/* Process all visible rows */ /* Process all visible rows */
param = &sim->vip.ram[world->paramBase | (y1 - world->gy) << 4]; param = world->paramBase + ((y1 - world->gy) << 4);
row = &sim->vip.shadow[i][x1 * 224 + y1]; row = &sim->vip.shadow[i][x1 * 224 + y1];
for (y = y1; y < y2; y++, param += 16, row++) { for (y = y1; y < y2; y++, param += 16, row++) {
/* Parse line parameters */ /* Parse line parameters */
mx = (int32_t) busReadBuffer(param + 0, VB_S16) << 6; mx = (int32_t) busReadBuffer(&sim->vip.ram[param | 0], VB_S16) << 6;
mp = (int32_t) busReadBuffer(param + 2, VB_S16); mp = (int32_t) busReadBuffer(&sim->vip.ram[param | 2], VB_S16);
my = (int32_t) busReadBuffer(param + 4, VB_S16) << 6; my = (int32_t) busReadBuffer(&sim->vip.ram[param | 4], VB_S16) << 6;
dx = (int32_t) busReadBuffer(param + 6, VB_S16); dx = (int32_t) busReadBuffer(&sim->vip.ram[param | 6], VB_S16);
dy = (int32_t) busReadBuffer(param + 8, VB_S16); dy = (int32_t) busReadBuffer(&sim->vip.ram[param | 8], VB_S16);
/* Adjust left-edge parameters */ /* Adjust left-edge parameters */
if ((mp < 0) ^ i) { if ((mp < 0) ^ i) {