| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef _GLUE_H_ |
| 6 |
#define _GLUE_H_ |
| 7 |
|
| 8 |
#include <stdint.h> |
| 9 |
#include <stdbool.h> |
| 10 |
#include <SDL.h> |
| 11 |
|
| 12 |
#include "cpu/registers.h" |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#define NUM_MAX_BANKS 256 |
| 18 |
#define NUM_MAX_RAM_BANKS 256 |
| 19 |
#define NUM_ROM_BANKS 32 |
| 20 |
#define NUM_CART_BANKS (256 - 32) |
| 21 |
|
| 22 |
#define RAM_SIZE (num_banks * BANK_SIZE) |
| 23 |
#define BRAM_SIZE (num_ram_banks * 8192) |
| 24 |
#define ROM_SIZE (NUM_ROM_BANKS * 16384) |
| 25 |
#define CART_SIZE (NUM_CART_BANKS * 16384) |
| 26 |
|
| 27 |
#define WINDOW_TITLE "Commander X16" |
| 28 |
|
| 29 |
#ifdef __APPLE__ |
| 30 |
#define MOUSE_GRAB_MSG " (\xE2\x87\xA7\xE2\x8C\x98M to end mouse/keyboard capture)" |
| 31 |
#else |
| 32 |
#define MOUSE_GRAB_MSG " (Ctrl+M to end mouse/keyboard capture)" |
| 33 |
#endif |
| 34 |
|
| 35 |
typedef enum { |
| 36 |
ECHO_MODE_NONE, |
| 37 |
ECHO_MODE_RAW, |
| 38 |
ECHO_MODE_COOKED, |
| 39 |
ECHO_MODE_ISO, |
| 40 |
} echo_mode_t; |
| 41 |
|
| 42 |
|
| 43 |
typedef enum { |
| 44 |
RECORD_GIF_PAUSE, |
| 45 |
RECORD_GIF_SNAP, |
| 46 |
RECORD_GIF_RESUME |
| 47 |
} gif_recorder_command_t; |
| 48 |
|
| 49 |
|
| 50 |
typedef enum { |
| 51 |
RECORD_GIF_DISABLED, |
| 52 |
RECORD_GIF_PAUSED, |
| 53 |
RECORD_GIF_SINGLE, |
| 54 |
RECORD_GIF_ACTIVE |
| 55 |
} gif_recorder_state_t; |
| 56 |
|
| 57 |
extern struct regs regs; |
| 58 |
extern uint16_t opcode_addr; |
| 59 |
extern uint8_t *RAM; |
| 60 |
extern uint8_t *BRAM; |
| 61 |
extern uint8_t ROM[]; |
| 62 |
extern uint8_t *CART; |
| 63 |
|
| 64 |
extern uint16_t num_banks; |
| 65 |
extern uint16_t num_ram_banks; |
| 66 |
|
| 67 |
extern bool debugger_enabled; |
| 68 |
extern bool log_video; |
| 69 |
extern bool log_keyboard; |
| 70 |
extern bool log_speed; |
| 71 |
extern echo_mode_t echo_mode; |
| 72 |
extern bool save_on_exit; |
| 73 |
extern bool disable_emu_cmd_keys; |
| 74 |
extern gif_recorder_state_t record_gif; |
| 75 |
extern char *gif_path; |
| 76 |
extern uint8_t *fsroot_path; |
| 77 |
extern uint8_t *startin_path; |
| 78 |
extern uint8_t keymap; |
| 79 |
extern bool warp_mode; |
| 80 |
extern bool grab_mouse; |
| 81 |
extern bool testbench; |
| 82 |
extern bool has_via2; |
| 83 |
extern uint32_t host_sample_rate; |
| 84 |
extern bool enable_midline; |
| 85 |
|
| 86 |
extern bool has_midi_card; |
| 87 |
extern uint16_t midi_card_addr; |
| 88 |
|
| 89 |
extern void machine_dump(const char* reason); |
| 90 |
extern void machine_reset(); |
| 91 |
extern void machine_nmi(); |
| 92 |
extern void machine_paste(char *text, bool handle_free); |
| 93 |
extern void machine_toggle_warp(); |
| 94 |
extern void init_audio(); |
| 95 |
extern void main_shutdown(); |
| 96 |
|
| 97 |
extern bool video_is_tilemap_address(int addr); |
| 98 |
extern bool video_is_tiledata_address(int addr); |
| 99 |
extern bool video_is_special_address(int addr); |
| 100 |
|
| 101 |
extern int ieee_unit; |
| 102 |
extern bool using_hostfs; |
| 103 |
extern uint8_t activity_led; |
| 104 |
extern bool nvram_dirty; |
| 105 |
extern uint8_t nvram[0x40]; |
| 106 |
|
| 107 |
extern uint8_t MHZ; |
| 108 |
|
| 109 |
extern bool mouse_grabbed; |
| 110 |
extern bool no_keyboard_capture; |
| 111 |
extern bool kernal_mouse_enabled; |
| 112 |
extern char window_title[]; |
| 113 |
extern bool pwr_long_press; |
| 114 |
extern bool is_gen2; |
| 115 |
#endif |