comparison blastem.h @ 1103:22e87b739ad6

WIP split of ROM loading/argument parsing from Genesis emulation code. Compiles and doesn't crash, but nothing works. Still a few too many globals as well.
author Michael Pavone <pavone@retrodev.com>
date Fri, 09 Dec 2016 09:48:48 -0800
parents 5fb64487b6e1
children 2eb54e24914e
comparison
equal deleted inserted replaced
1102:c15896605bf2 1103:22e87b739ad6
1 /*
2 Copyright 2013 Michael Pavone
3 This file is part of BlastEm.
4 BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
5 */
6 #ifndef BLASTEM_H_ 1 #ifndef BLASTEM_H_
7 #define BLASTEM_H_ 2 #define BLASTEM_H_
8 3
9 #include <stdint.h> 4 #include "tern.h"
10 #include "m68k_core.h"
11 #include "z80_to_x86.h"
12 #include "ym2612.h"
13 #include "vdp.h"
14 #include "psg.h"
15 #include "io.h"
16 #include "config.h"
17 #include "romdb.h"
18 #include "arena.h"
19 5
20 typedef struct genesis_context genesis_context; 6 extern int headless;
7 extern int exit_after;
8 extern int z80_enabled;
9 extern int frame_limit;
21 10
22 struct genesis_context {
23 m68k_context *m68k;
24 z80_context *z80;
25 vdp_context *vdp;
26 ym2612_context *ym;
27 psg_context *psg;
28 genesis_context *next_context;
29 uint16_t *cart;
30 uint16_t *lock_on;
31 uint16_t *work_ram;
32 uint8_t *zram;
33 void *extra;
34 arena *arena;
35 char *next_rom;
36 char *save_dir;
37 uint8_t *save_storage;
38 eeprom_map *eeprom_map;
39 uint32_t num_eeprom;
40 uint32_t save_size;
41 uint32_t save_ram_mask;
42 uint32_t master_clock; //Current master clock value
43 uint32_t normal_clock; //Normal master clock (used to restore master clock after turbo mode)
44 uint32_t frame_end;
45 uint32_t max_cycles;
46 uint8_t bank_regs[8];
47 uint16_t mapper_start_index;
48 uint8_t save_type;
49 io_port ports[3];
50 uint8_t bus_busy;
51 uint8_t should_exit;
52 uint8_t save_state;
53 uint8_t mouse_mode;
54 uint8_t mouse_captured;
55 eeprom_state eeprom;
56 };
57
58 extern genesis_context * genesis;
59 extern int headless;
60 extern int break_on_sync;
61 extern tern_node * config; 11 extern tern_node * config;
62 12
63 #define RAM_WORDS 32 * 1024 13 extern char *save_state_path;
64 #define Z80_RAM_BYTES 8 * 1024
65 #define QUICK_SAVE_SLOT 10 14 #define QUICK_SAVE_SLOT 10
66 15
67 extern uint16_t *cart;
68 extern uint16_t *ram;
69 extern uint8_t z80_ram[Z80_RAM_BYTES];
70
71 uint16_t read_dma_value(uint32_t address);
72 uint16_t get_open_bus_value();
73 m68k_context * sync_components(m68k_context *context, uint32_t address);
74 m68k_context * debugger(m68k_context * context, uint32_t address);
75 void set_speed_percent(genesis_context * context, uint32_t percent);
76
77 #endif //BLASTEM_H_ 16 #endif //BLASTEM_H_
78