eznes upd
This commit is contained in:
+13
-6
@@ -13,12 +13,16 @@
|
|||||||
|
|
||||||
#define u8 unsigned char
|
#define u8 unsigned char
|
||||||
#define u16 unsigned short
|
#define u16 unsigned short
|
||||||
#define s8 char
|
#define s8 signed char
|
||||||
#define s16 short
|
#define s16 signed short
|
||||||
|
|
||||||
/* Generic constants */
|
/* Generic constants */
|
||||||
|
|
||||||
|
#ifdef PAL
|
||||||
|
#define CPU 1662607 /* PAL */
|
||||||
|
#else
|
||||||
#define CPU 1789773 /* NTSC */
|
#define CPU 1789773 /* NTSC */
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SCREEN_WIDTH 32
|
#define SCREEN_WIDTH 32
|
||||||
#define SCREEN_HEIGHT 28
|
#define SCREEN_HEIGHT 28
|
||||||
@@ -83,9 +87,12 @@ u8 joy_input_wait() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* palette loader */
|
/* palette loader */
|
||||||
void init_palette(u8 bg, u8 c1, u8 c2, u8 c3, u8 c4) {
|
void init_palette(u8 bg1, u8 bg2, u8 bg3, u8 bg4, u8 c1, u8 c2, u8 c3, u8 c4) {
|
||||||
u8 i, pal[16] = {0};
|
u8 i, pal[16] = {0};
|
||||||
pal[0] = pal[4] = pal[8] = pal[12] = bg;
|
pal[0] = bg1;
|
||||||
|
pal[4] = bg2;
|
||||||
|
pal[8] = bg3;
|
||||||
|
pal[12] = bg4;
|
||||||
pal[3] = c1;
|
pal[3] = c1;
|
||||||
pal[7] = c2;
|
pal[7] = c2;
|
||||||
pal[11] = c3;
|
pal[11] = c3;
|
||||||
@@ -149,11 +156,11 @@ void init_sound() {
|
|||||||
|
|
||||||
/* Game initialization section */
|
/* Game initialization section */
|
||||||
|
|
||||||
void init_game(u8 bg, u8 c1, u8 c2, u8 c3, u8 c4) {
|
void init_game(u8 bg1, u8 bg2, u8 bg3, u8 bg4, u8 c1, u8 c2, u8 c3, u8 c4) {
|
||||||
init_sound();
|
init_sound();
|
||||||
bgcolor(COLOR_BLACK);
|
bgcolor(COLOR_BLACK);
|
||||||
textcolor(0);
|
textcolor(0);
|
||||||
init_palette(bg, c1, c2, c3, c4);
|
init_palette(bg1, bg2, bg3, bg4, c1, c2, c3, c4);
|
||||||
joy_install(joy_static_stddrv);
|
joy_install(joy_static_stddrv);
|
||||||
clrscr();
|
clrscr();
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -56,7 +56,7 @@ void beep_err() {
|
|||||||
|
|
||||||
void game_startup() {
|
void game_startup() {
|
||||||
u8 i, j, x = 0;
|
u8 i, j, x = 0;
|
||||||
init_game(NES_BLACK, NES_WHITE, NES_RED, NES_GREEN, NES_YELLOW);
|
init_game(NES_BLACK, NES_BLACK, NES_BLACK, NES_BLACK, NES_WHITE, NES_RED, NES_GREEN, NES_YELLOW);
|
||||||
ppu_off();
|
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)
|
||||||
@@ -147,7 +147,7 @@ Potion level: x - 21
|
|||||||
/* Game stats */
|
/* Game stats */
|
||||||
|
|
||||||
/* main deck and room */
|
/* main deck and room */
|
||||||
static char deck[44], room[] = {0, 0, 0, 0};
|
static s8 deck[44], room[] = {0, 0, 0, 0};
|
||||||
|
|
||||||
/* status message */
|
/* status message */
|
||||||
static char status_msg[(SCREEN_WIDTH-1)];
|
static char status_msg[(SCREEN_WIDTH-1)];
|
||||||
|
|||||||
Reference in New Issue
Block a user