mirror of
https://github.com/LemonBoy/grape.git
synced 2024-11-29 06:50:06 +00:00
Fix the keyboard handling. Reset the mixed mode flag when changing video mode. Better path building for savestates.
This commit is contained in:
parent
57802a979c
commit
8e45768c29
@ -39,7 +39,7 @@ void update_input ()
|
||||
kbd_key = keyboardUpdate();
|
||||
|
||||
if (kbd_key > 0) {
|
||||
switch (keybd_latch) {
|
||||
switch (kbd_key) {
|
||||
case DVK_ENTER:
|
||||
keybd_latch = 0x8d;
|
||||
return;
|
||||
|
@ -11,12 +11,22 @@ typedef struct state_hdr_t {
|
||||
|
||||
#define STATE_MAGIC (0x47525033)
|
||||
|
||||
char *build_path (int slot)
|
||||
{
|
||||
static char tmp[1024];
|
||||
if (basename)
|
||||
snprintf(tmp, sizeof(tmp), "%s.%03i", basename, slot);
|
||||
else
|
||||
snprintf(tmp, sizeof(tmp), "grape.%03i", slot);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
int state_save (int slot)
|
||||
{
|
||||
FILE *f;
|
||||
state_hdr_t h;
|
||||
|
||||
f = fopen("game.sav", "w+");
|
||||
f = fopen(build_path(slot), "w+");
|
||||
if (f)
|
||||
return 0;
|
||||
|
||||
@ -51,7 +61,7 @@ int state_load (int slot)
|
||||
FILE *f;
|
||||
state_hdr_t h;
|
||||
|
||||
f = fopen("game.sav", "w+");
|
||||
f = fopen(build_path(slot), "w+");
|
||||
if (f)
|
||||
return 0;
|
||||
|
||||
|
@ -112,9 +112,11 @@ u8 video_io_read (u16 addr)
|
||||
switch (addr&0xf) {
|
||||
case 0x0:
|
||||
text_mode = 0;
|
||||
mixed_mode = 0;
|
||||
break;
|
||||
case 0x1:
|
||||
text_mode = 1;
|
||||
mixed_mode = 0;
|
||||
break;
|
||||
case 0x2:
|
||||
mixed_mode = 0;
|
||||
@ -130,9 +132,11 @@ u8 video_io_read (u16 addr)
|
||||
break;
|
||||
case 0x6:
|
||||
hires = 0;
|
||||
mixed_mode = 0;
|
||||
break;
|
||||
case 0x7:
|
||||
hires = 1;
|
||||
mixed_mode = 0;
|
||||
break;
|
||||
// Annunciators
|
||||
case 0x8:
|
||||
|
Loading…
Reference in New Issue
Block a user