diff options
Diffstat (limited to 'whichbas.c')
-rw-r--r-- | whichbas.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1030,15 +1030,12 @@ void detect_foreign(void) { if(c == EOF || d == EOF) die("File is too short to be a BASIC program of any kind."); - if(c == 0 && d == 0) { + if((c == 0 || c == 0x77) && d == 0) { /* This is why we can't read from stdin. */ rewind(input_file); return; } - if(c == 0x77 && d == 0x00) - foreign("OSS Integer BASIC", SRET_OSSINT); - if(c == 0xfb && d == 0xc2) foreign("Compiled Turbo BASIC XL", SRET_COMPILED_TURBO); @@ -1224,6 +1221,19 @@ CALLBACK(check_aplus_cmd) { last_cmd = tok; } +void check_oss_int(void) { + if(lomem != 0x77) return; + switch(save_command_tok) { + case 0x19: /* SAVE */ + case 0x33: /* CSAVE */ + foreign("OSS Integer BASIC (disk)", SRET_OSSINT_DISK); + break; + default: + foreign("OSS Integer BASIC (cartridge)", SRET_OSSINT_DISK); + break; + } +} + void check_aplus(void) { allow_hex_const = 1; @@ -1250,6 +1260,7 @@ int main(int argc, char **argv) { readfile(); parse_header(); + check_oss_int(); check_variables(); check_aplus(); |