| 1 |
|
| 2 |
|
| 3 |
#ifndef ZTERP_PROCESS_H |
| 4 |
#define ZTERP_PROCESS_H |
| 5 |
|
| 6 |
#include <array> |
| 7 |
#include <exception> |
| 8 |
|
| 9 |
#include "stack.h" |
| 10 |
#include "types.h" |
| 11 |
|
| 12 |
static constexpr uint8_t JOURNEY_DIAL_EXT = 0xf0; |
| 13 |
static constexpr uint8_t SHOGUN_MENU_EXT = 0xf1; |
| 14 |
|
| 15 |
namespace Operation { |
| 16 |
|
| 17 |
|
| 18 |
class Return : public std::exception { |
| 19 |
}; |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
class Restart : public std::exception { |
| 25 |
}; |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
class Quit : public std::exception { |
| 30 |
}; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
struct Restore : public std::exception { |
| 35 |
explicit Restore(SaveOpcode saveopcode_) : saveopcode(saveopcode_) { |
| 36 |
} |
| 37 |
|
| 38 |
const SaveOpcode saveopcode; |
| 39 |
}; |
| 40 |
} |
| 41 |
|
| 42 |
extern unsigned long pc; |
| 43 |
extern unsigned long current_instruction; |
| 44 |
|
| 45 |
extern std::array<uint16_t, 8> zargs; |
| 46 |
extern int znargs; |
| 47 |
|
| 48 |
extern bool interrupt_override; |
| 49 |
|
| 50 |
bool in_interrupt(); |
| 51 |
void setup_opcodes(); |
| 52 |
void process_instructions(); |
| 53 |
void process_loop(); |
| 54 |
|
| 55 |
#endif |