Skip to content

Commit

Permalink
Update the version number to v7 and v7n
Browse files Browse the repository at this point in the history
And add a check to make sure that you can't load a 48k .x
file on a Next and vice-versa.

Signed-off-by: Mark Ryan <[email protected]>
  • Loading branch information
markdryan committed Jan 28, 2024
1 parent 8dda965 commit be40eca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/state_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ void specasm_load_e(const char *fname)
return;
}

if (SPECASM_VERSION >= state.version) {
/*
* We use the top bit to distinguish between 48K and Next versions
* of the file format.
*/

if (((SPECASM_VERSION & 0x8000) == (state.version & 0x8000)) &&
(SPECASM_VERSION >= state.version)) {
state.version = SPECASM_VERSION;
return;
}
Expand Down
9 changes: 7 additions & 2 deletions src/state_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
#ifndef SPECASM_STATE_READ_H
#define SPECASM_STATE_READ_H

#define SPECASM_VERSION 6
#define SPECASM_VERSION_STR "v6"
#ifdef SPECASM_TARGET_NEXT_OPCODES
#define SPECASM_VERSION 0x8007
#define SPECASM_VERSION_STR "v7n"
#else
#define SPECASM_VERSION 7
#define SPECASM_VERSION_STR "v7"
#endif

#include <stdint.h>

Expand Down

0 comments on commit be40eca

Please sign in to comment.