50 fps!
This commit is contained in:
parent
686125592a
commit
048a1270bb
@ -9,7 +9,7 @@ require 'rmagick'
|
||||
# [ ] turn the big color counts into three bitplames worth of data
|
||||
# [ ] turn the little color counts into up to 8 sprites worth of data strips & color changes
|
||||
|
||||
image = Magick::Image.read('topaz.png').first
|
||||
image = Magick::Image.read('topaz-narrow.png').first
|
||||
|
||||
rows = []
|
||||
|
||||
@ -263,7 +263,7 @@ module Amiga
|
||||
class Util
|
||||
TOTAL_HEIGHT = 256
|
||||
TOP_OFFSET = 44
|
||||
LEFT_OFFSET = 128
|
||||
LEFT_OFFSET = 128 + 64
|
||||
|
||||
SPRITE_HEIGHT = TOTAL_HEIGHT + TOP_OFFSET
|
||||
|
||||
|
91
main.c
91
main.c
@ -40,16 +40,6 @@ uint16_t custom_color = (uint16_t)offsetof(Custom, color);
|
||||
uint16_t custom_sprite = (uint16_t)offsetof(Custom, sprpt);
|
||||
uint16_t custom_sprite_control = (uint16_t)offsetof(Custom, spr);
|
||||
|
||||
uint16_t spritePositionsEachLine[256][2];
|
||||
|
||||
void calculageSpritePositionsEachLine() {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 255; ++i) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#define SPRPOS(x, y) (((y & 0xff) << 8) + ((x & 0x1fe) >> 1))
|
||||
#define SPRCTL(x, y, height) ( \
|
||||
((height & 0xff) << 8) + \
|
||||
@ -64,6 +54,10 @@ extern uint16_t chip SpriteCopperlist[];
|
||||
extern uint16_t chip SpriteData[];
|
||||
extern uint16_t chip MaskBitplane[];
|
||||
|
||||
#define TOPAZ_WIDTH_PIXELS (160)
|
||||
#define TOPAZ_WIDTH_BYTES (TOPAZ_WIDTH_PIXELS / 8)
|
||||
#define TOPAZ_WIDTH_WORDS (TOPAZ_WIDTH_PIXELS / 16)
|
||||
|
||||
void renderTopaz(void) {
|
||||
int plane;
|
||||
|
||||
@ -71,7 +65,7 @@ void renderTopaz(void) {
|
||||
uint8_t *bltbpt;
|
||||
|
||||
bltcon0 = 0xca + (1 << 8) + (1 << 9) + (1 << 10) + (1 << 11);
|
||||
bltcmod = screenSetup.byteWidth - 32;
|
||||
bltcmod = screenSetup.byteWidth - TOPAZ_WIDTH_BYTES;
|
||||
bltbpt = TopazBitplanes;
|
||||
|
||||
for (plane = 0; plane < 3; ++plane) {
|
||||
@ -81,15 +75,15 @@ void renderTopaz(void) {
|
||||
custom.bltalwm = 0xffff;
|
||||
custom.bltapt = MaskBitplane;
|
||||
custom.bltbpt = bltbpt;
|
||||
custom.bltcpt = currentScreen.planes[plane];
|
||||
custom.bltdpt = currentScreen.planes[plane];
|
||||
custom.bltcpt = currentScreen.planes[plane] + 8;
|
||||
custom.bltdpt = currentScreen.planes[plane] + 8;
|
||||
custom.bltamod = 0;
|
||||
custom.bltbmod = 0;
|
||||
custom.bltcmod = bltcmod;
|
||||
custom.bltdmod = bltcmod;
|
||||
custom.bltsize = 16 + (256 << 6);
|
||||
custom.bltsize = TOPAZ_WIDTH_WORDS + (256 << 6);
|
||||
|
||||
bltbpt += 32 * 256;
|
||||
bltbpt += TOPAZ_WIDTH_BYTES * 256;
|
||||
|
||||
WaitBlit();
|
||||
}
|
||||
@ -102,13 +96,6 @@ int main(void) {
|
||||
|
||||
struct BunRenderer bunRenderer;
|
||||
|
||||
color_t colors[8];
|
||||
|
||||
colors[0] = 0x09b8;
|
||||
colors[1] = 0x0000;
|
||||
colors[2] = 0x0fff;
|
||||
colors[3] = 0x000f;
|
||||
|
||||
printf("setting up, i haven't crashed...yet.\n");
|
||||
|
||||
setupScreen(&screenSetup, SCREEN_WIDTH, SCREEN_HEIGHT, 3);
|
||||
@ -131,7 +118,6 @@ int main(void) {
|
||||
¤tScreen,
|
||||
&copperlistBitplanePointers
|
||||
);
|
||||
//currentCopperlist = setUpEmptySpritesInCopperlist(currentCopperlist);
|
||||
|
||||
currentCopperColors = CopperColors;
|
||||
currentSpriteCopperlist = SpriteCopperlist;
|
||||
@ -158,6 +144,7 @@ int main(void) {
|
||||
|
||||
for (y = 0; y < 256; ++y) {
|
||||
for (i = 0; i < 8; ++i) {
|
||||
// set sprite color
|
||||
*(currentCopperlist++) = custom_color + 32 + (
|
||||
// sprite color group
|
||||
(i / 2) * 4 +
|
||||
@ -165,12 +152,9 @@ int main(void) {
|
||||
1 +
|
||||
i % 2
|
||||
) * 2;
|
||||
|
||||
*(currentCopperlist++) = *(currentSpriteCopperlist++);
|
||||
//*(currentCopperlist++) = 0xf0f;
|
||||
|
||||
//currentSpriteCopperlist++;
|
||||
|
||||
// set sprite position
|
||||
*(currentCopperlist++) = custom_sprite_control + i * 8;
|
||||
*(currentCopperlist++) = *(currentSpriteCopperlist++);
|
||||
|
||||
@ -185,22 +169,6 @@ int main(void) {
|
||||
|
||||
*(currentCopperlist++) = 1 + ((31 + (256 / 4)) << 1) + ((44 + y) << 8);
|
||||
*(currentCopperlist++) = 0xFFFE;
|
||||
/*
|
||||
*(currentCopperlist++) = custom_color;
|
||||
*(currentCopperlist++) = 0x9b8;
|
||||
*/
|
||||
|
||||
/*
|
||||
*(currentCopperlist++) = 1 + (1 << 1) + ((44 + y) << 8);
|
||||
*(currentCopperlist++) = 0xFFFE;
|
||||
*/
|
||||
|
||||
/*
|
||||
*(currentCopperlist++) = 1 + ((31 + (320 / 4)) << 1) + ((44 + y) << 8);
|
||||
*(currentCopperlist++) = 0xFFFE;
|
||||
*(currentCopperlist++) = custom_color;
|
||||
*(currentCopperlist++) = 0x000;
|
||||
*/
|
||||
}
|
||||
|
||||
endCopperlist(currentCopperlist);
|
||||
@ -212,33 +180,10 @@ int main(void) {
|
||||
|
||||
clearCurrentBuns(&bunRenderer);
|
||||
|
||||
/*
|
||||
for (plane = 0; plane < 2; ++plane) {
|
||||
custom.bltcon0 = 0xc0 + (1 << 8);
|
||||
custom.bltcon1 = 0;
|
||||
custom.bltadat = 0x0000;
|
||||
custom.bltafwm = 0xffff;
|
||||
custom.bltalwm = 0xffff;
|
||||
custom.bltdpt = currentScreen.planes[plane];
|
||||
custom.bltdmod = 0;
|
||||
custom.bltsize = screenSetup.byteWidth / 2 + (screenSetup.height << 6);
|
||||
WaitBlit();
|
||||
}
|
||||
*/
|
||||
|
||||
renderBunFrame(i, &bunRenderer);
|
||||
|
||||
renderTopaz();
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*(SpriteData) = SPRPOS(250, 44);
|
||||
*(SpriteData + 1) = SPRCTL(250, 44, 44 + 257);
|
||||
*/
|
||||
|
||||
updateDisplayInCopperList(
|
||||
&screenSetup,
|
||||
¤tScreen,
|
||||
@ -246,29 +191,17 @@ int main(void) {
|
||||
);
|
||||
|
||||
WaitTOF();
|
||||
|
||||
|
||||
if ((ciaa.ciapra >> 6) != 3) break;
|
||||
|
||||
i++;
|
||||
i %= FRAMES_FOR_SCREEN;
|
||||
}
|
||||
|
||||
/*
|
||||
for (i = 0; i < 200; ++i) {
|
||||
WaitTOF();
|
||||
}
|
||||
*/
|
||||
|
||||
giveBackSystem();
|
||||
|
||||
teardownScreen(&screenSetup);
|
||||
|
||||
/*
|
||||
for (i = 0; i < 50; ++i) {
|
||||
printf("%x %x\n", copperlist[i * 2], copperlist[i * 2 + 1]);
|
||||
}
|
||||
*/
|
||||
|
||||
freeCopperlist(copperlist);
|
||||
|
||||
teardownBunRenderer();
|
||||
|
BIN
mask-bitplane
BIN
mask-bitplane
Binary file not shown.
Binary file not shown.
BIN
sprite-data
BIN
sprite-data
Binary file not shown.
BIN
topaz-bitplane
BIN
topaz-bitplane
Binary file not shown.
BIN
topaz-narrow.png
Normal file
BIN
topaz-narrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
Loading…
Reference in New Issue
Block a user