Simplify cool bun rendering code

This commit is contained in:
John Bintz 2024-07-17 07:08:59 -04:00
parent 6aed100cd2
commit 777257b83d
3 changed files with 8 additions and 12 deletions

18
bun.c
View File

@ -94,7 +94,7 @@ void bun_offRightSide(
bltalwm += (1 << (15 - i)); bltalwm += (1 << (15 - i));
} }
bltcon0 = BLTCON0(0xc0, 0, 1, 0, 1, shift); bltcon0 = BLTCON0(0xf0, 1, 0, 0, 1, shift);
bltcon1 = BLTCON1(bunClear->direction, shift); bltcon1 = BLTCON1(bunClear->direction, shift);
bltdmod = screenSetup->byteWidth - COOL_BUN_WIDTH_BYTES + bltdmod = screenSetup->byteWidth - COOL_BUN_WIDTH_BYTES +
@ -106,15 +106,14 @@ void bun_offRightSide(
custom.bltcon0 = bltcon0; custom.bltcon0 = bltcon0;
custom.bltcon1 = bltcon1; custom.bltcon1 = bltcon1;
custom.bltadat = 0xffff; custom.bltapt = coolbunPlaneStarts[BUN_OFF_LEFT_SIDE][plane];
custom.bltbpt = coolbunPlaneStarts[BUN_OFF_LEFT_SIDE][plane];
custom.bltdpt = currentScreen->planes[plane] + custom.bltdpt = currentScreen->planes[plane] +
bunClear->memoryStartOffsetBytes; bunClear->memoryStartOffsetBytes;
custom.bltafwm = 0xffff; custom.bltafwm = 0xffff;
custom.bltalwm = bltalwm; custom.bltalwm = bltalwm;
custom.bltbmod = wordShift * 2; custom.bltamod = wordShift * 2;
custom.bltdmod = bltdmod; custom.bltdmod = bltdmod;
custom.bltsize = bltsize; custom.bltsize = bltsize;
@ -150,7 +149,7 @@ void bun_offLeftSide(
bltalwm += (1 << i); bltalwm += (1 << i);
} }
bltcon0 = BLTCON0(0xc0, 0, 1, 0, 1, shift); bltcon0 = BLTCON0(0xf0, 1, 0, 0, 1, shift);
bltcon1 = BLTCON1(bunClear->direction, shift); bltcon1 = BLTCON1(bunClear->direction, shift);
bltdmod = screenSetup->byteWidth - 4 + wordShift * 2; bltdmod = screenSetup->byteWidth - 4 + wordShift * 2;
@ -161,10 +160,8 @@ void bun_offLeftSide(
custom.bltcon0 = bltcon0; custom.bltcon0 = bltcon0;
custom.bltcon1 = bltcon1; custom.bltcon1 = bltcon1;
// a has a mask we're shifting // a has bun data
custom.bltadat = 0xffff; custom.bltapt = coolbunPlaneStarts[BUN_OFF_RIGHT_SIDE][plane];
// b has bun data
custom.bltbpt = coolbunPlaneStarts[BUN_OFF_RIGHT_SIDE][plane];
// d is the part on screen // d is the part on screen
custom.bltdpt = currentScreen->planes[plane] + bunClear->memoryStartOffsetBytes; custom.bltdpt = currentScreen->planes[plane] + bunClear->memoryStartOffsetBytes;
@ -172,7 +169,7 @@ void bun_offLeftSide(
custom.bltafwm = 0xffff; custom.bltafwm = 0xffff;
custom.bltalwm = bltalwm; custom.bltalwm = bltalwm;
custom.bltbmod = wordShift * 2; custom.bltamod = wordShift * 2;
custom.bltdmod = bltdmod; custom.bltdmod = bltdmod;
custom.bltsize = bltsize; custom.bltsize = bltsize;
@ -221,7 +218,6 @@ void bun_anywhere(
custom.bltdpt = currentScreen->planes[plane] + custom.bltdpt = currentScreen->planes[plane] +
bunClear->memoryStartOffsetBytes; bunClear->memoryStartOffsetBytes;
// custom.bltdpt = screenSetup.memoryStart;
custom.bltafwm = 0xffff; custom.bltafwm = 0xffff;
custom.bltalwm = bltalwm; custom.bltalwm = bltalwm;

BIN
main

Binary file not shown.

2
main.c
View File

@ -52,7 +52,7 @@ extern uint8_t chip TopazBitplanes[];
extern uint16_t chip CopperColors[]; extern uint16_t chip CopperColors[];
extern uint16_t chip SpriteCopperlist[]; extern uint16_t chip SpriteCopperlist[];
extern uint16_t chip SpriteData[]; extern uint16_t chip SpriteData[];
extern uint16_t chip MaskBitplane[]; extern uint8_t chip MaskBitplane[];
#define TOPAZ_WIDTH_PIXELS (160) #define TOPAZ_WIDTH_PIXELS (160)
#define TOPAZ_WIDTH_BYTES (TOPAZ_WIDTH_PIXELS / 8) #define TOPAZ_WIDTH_BYTES (TOPAZ_WIDTH_PIXELS / 8)