Skip to content

Commit

Permalink
Merge pull request #70 from jsmolina/feature/menu_intro
Browse files Browse the repository at this point in the history
intro menu added
  • Loading branch information
jsmolina committed Mar 4, 2019
2 parents f53e448 + d2a094c commit b6f1c13
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ compile:

develop:
# -DWFRAMES=3
sudo nice -n -20 su jordism -c "zcc +zx -v -m -startup=31 -clib=sdcc_iy -SO3 --opt-code-size -zopt --max-allocs-per-node200000 @zproject.lst -pragma-include:zpragma.inc -o misifu -lay/vt_sound_6.lib"
sudo nice -n -20 su jordism -c "zcc +zx -v -m -startup=31 -clib=sdcc_iy -SO3 --opt-code-size -zopt @zproject.lst -pragma-include:zpragma.inc -o misifu -lay/vt_sound_6.lib"
ls *.bin
appmake +zx -b screen.scr --org 16384 --noloader --blockname screen -o screen.tap
appmake +zx -b misifu_CODE.bin --org 24500 --noloader --blockname code -o code.tap
Expand Down
26 changes: 23 additions & 3 deletions defines.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,32 +130,47 @@ JOYFUNC joy;
udk_t joy_keys = { IN_KEY_SCANCODE_SPACE, IN_KEY_SCANCODE_p, IN_KEY_SCANCODE_o, IN_KEY_SCANCODE_a, IN_KEY_SCANCODE_q };
uint16_t in;

unsigned char show_menu[] = "-1.keyboard-2.kempston-3.sinclair";

void all_lives_lost() {
uint16_t has_kempston = in_stick_kempston();

print_background_lvl1();

ay_vt_init(pcspeaker_module);
intrinsic_ei();

sp1_MoveSprAbs(misifu.sp, &full_screen, (void*) BORED, 13, 22, 0, 0);
idx_j = 3;
x = 10;
for(idx = 0; idx != 33; ++idx ) {
if(show_menu[idx] == '-') {
++idx_j;
x = 10;
++idx;
}
sp1_PrintAtInv(idx_j, ++x, INK_WHITE | PAPER_BLACK, show_menu[idx]);
}

sp1_UpdateNow();


// todo think on animating the cat a bit in 'demo mode'
while(1) {
// todo check joystick fire also so joystick is chosen
if(in_key_pressed( IN_KEY_SCANCODE_SPACE )) {
if(in_key_pressed(IN_KEY_SCANCODE_1)) {
joy = (JOYFUNC)in_stick_keyboard;
break;
} else if(has_kempston == 0 && (in_stick_kempston() & IN_STICK_FIRE)) {
} else if(in_key_pressed(IN_KEY_SCANCODE_2)) {
joy = (JOYFUNC)in_stick_kempston;
break;
} else if(in_key_pressed(IN_KEY_SCANCODE_3)) {
joy = (JOYFUNC)in_stick_sinclair1;
break;
}
}
first_keypress = tick;
srand(first_keypress);
print_background_lvl1();

intrinsic_di();
ay_vt_init(music_module);
Expand Down Expand Up @@ -412,6 +427,11 @@ void check_keys()
in_wait_nokey();
paws = 1;
}

if(in_key_pressed(IN_KEY_SCANCODE_r)) {
lives = 0;
all_lives_lost();
}
}

void check_swim() {
Expand Down

0 comments on commit b6f1c13

Please sign in to comment.