some colorization fixes

This commit is contained in:
Luxferre
2026-01-09 13:14:34 +02:00
parent b82ae856fe
commit d33009f8d4
+15
View File
@@ -30,6 +30,14 @@
#define GAME_YELLOW 2 #define GAME_YELLOW 2
#define GAME_GREEN 3 #define GAME_GREEN 3
void ppu_off() {
PPU.mask &= 0xE7;
}
void ppu_on() {
PPU.mask |= 0x1A;
}
int joy_input_wait() { int joy_input_wait() {
unsigned char last_joy = 0, joy, pressed; unsigned char last_joy = 0, joy, pressed;
/* wait until the previous key is released */ /* wait until the previous key is released */
@@ -88,6 +96,7 @@ void game_startup() {
textcolor(0); textcolor(0);
init_palette(); init_palette();
clrscr(); clrscr();
ppu_off();
for(j=0;j<24;j+=4) for(j=0;j<24;j+=4)
for(i=3;i<32;i+=4) for(i=3;i<32;i+=4)
colorxy(i, j, 1 + ((++entropy) % 3)); colorxy(i, j, 1 + ((++entropy) % 3));
@@ -120,6 +129,7 @@ void game_startup() {
cputsxy(1, SCREEN_HEIGHT - 2, "Luxferre"); cputsxy(1, SCREEN_HEIGHT - 2, "Luxferre");
cputsxy(SCREEN_WIDTH-5, SCREEN_HEIGHT - 2, "2026"); cputsxy(SCREEN_WIDTH-5, SCREEN_HEIGHT - 2, "2026");
joy_install(joy_static_stddrv); joy_install(joy_static_stddrv);
ppu_on();
while(1) { while(1) {
++entropy; ++entropy;
joy = joy_read(JOY_1); joy = joy_read(JOY_1);
@@ -134,6 +144,7 @@ void game_startup() {
void win_screen(int score) { void win_screen(int score) {
unsigned char i, j; unsigned char i, j;
clrscr(); clrscr();
ppu_off();
for(j=0;j<12;j+=4) for(j=0;j<12;j+=4)
for(i=3;i<32;i+=4) for(i=3;i<32;i+=4)
colorxy(i, j, 1 + (rand() % 3)); colorxy(i, j, 1 + (rand() % 3));
@@ -153,6 +164,7 @@ void win_screen(int score) {
cputs("\r\nOriginal concept by Zach Gage\r\nand Kurt Bieg, 2011"); cputs("\r\nOriginal concept by Zach Gage\r\nand Kurt Bieg, 2011");
chlinexy(0, 23, SCREEN_WIDTH); chlinexy(0, 23, SCREEN_WIDTH);
cputsxy(10, 25, "Press Start"); cputsxy(10, 25, "Press Start");
ppu_on();
while(joy_input_wait() != KEY_ST); while(joy_input_wait() != KEY_ST);
} }
@@ -273,6 +285,7 @@ void render_main_scene() {
for(i=0;i<sizeof(deck);i++) for(i=0;i<sizeof(deck);i++)
if(deck[i]) deck_count++; if(deck[i]) deck_count++;
clrscr(); clrscr();
ppu_off();
/* render the frames */ /* render the frames */
chlinexy(0,SCREEN_HEIGHT-1,SCREEN_WIDTH); chlinexy(0,SCREEN_HEIGHT-1,SCREEN_WIDTH);
chlinexy(0,SCREEN_HEIGHT-3,SCREEN_WIDTH); chlinexy(0,SCREEN_HEIGHT-3,SCREEN_WIDTH);
@@ -299,6 +312,8 @@ void render_main_scene() {
/* render status message */ /* render status message */
gotoxy(1, SCREEN_HEIGHT-2); gotoxy(1, SCREEN_HEIGHT-2);
cprintf("%s", status_msg); cprintf("%s", status_msg);
ppu_on();
waitvsync();
} }
/* Confirmation method */ /* Confirmation method */