Mercurial > repos > blastem
annotate genesis.h @ 1106:cacbd3f18f03
Fix field flag handling bug introduced with VDP/render interface cleanup
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 12 Dec 2016 09:50:33 -0800 |
parents | 22e87b739ad6 |
children | 2eb54e24914e |
rev | line source |
---|---|
467
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
451
diff
changeset
|
1 /* |
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
451
diff
changeset
|
2 Copyright 2013 Michael Pavone |
483
3e1573fa22cf
Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents:
467
diff
changeset
|
3 This file is part of BlastEm. |
467
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
451
diff
changeset
|
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. |
140af5509ce7
Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents:
451
diff
changeset
|
5 */ |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
6 #ifndef GENESIS_H_ |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
7 #define GENESIS_H_ |
66 | 8 |
75 | 9 #include <stdint.h> |
569
9b7fcf748be0
Rename x86_68k_options and m68k_to_x86.h to m68k_options and m68k_core.h respectively
Michael Pavone <pavone@retrodev.com>
parents:
524
diff
changeset
|
10 #include "m68k_core.h" |
288
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
198
diff
changeset
|
11 #include "z80_to_x86.h" |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
198
diff
changeset
|
12 #include "ym2612.h" |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
198
diff
changeset
|
13 #include "vdp.h" |
354
15dd6418fe67
Initial PSG support. Mostly works, noise channel is borked though.
Mike Pavone <pavone@retrodev.com>
parents:
351
diff
changeset
|
14 #include "psg.h" |
421
d0cacb4ade0b
Move IO code to a separate file and do a tiny bit of refactoring
Mike Pavone <pavone@retrodev.com>
parents:
418
diff
changeset
|
15 #include "io.h" |
769
4638b88bc72d
Initial work on I2C EEPROM implementation
Michael Pavone <pavone@retrodev.com>
parents:
767
diff
changeset
|
16 #include "romdb.h" |
883
9f149f0e98b7
It is now possible to switch back and forth between the menu ROM and the game
Michael Pavone <pavone@retrodev.com>
parents:
874
diff
changeset
|
17 #include "arena.h" |
66 | 18 |
957 | 19 typedef struct genesis_context genesis_context; |
20 | |
21 struct genesis_context { | |
22 m68k_context *m68k; | |
23 z80_context *z80; | |
24 vdp_context *vdp; | |
25 ym2612_context *ym; | |
26 psg_context *psg; | |
27 genesis_context *next_context; | |
28 uint16_t *cart; | |
1016
5fb64487b6e1
Very basic support for S&K lock-on. Needs more work for full functionality.
Michael Pavone <pavone@retrodev.com>
parents:
981
diff
changeset
|
29 uint16_t *lock_on; |
957 | 30 uint16_t *work_ram; |
31 uint8_t *zram; | |
32 void *extra; | |
33 arena *arena; | |
34 char *next_rom; | |
35 char *save_dir; | |
36 uint8_t *save_storage; | |
37 eeprom_map *eeprom_map; | |
38 uint32_t num_eeprom; | |
39 uint32_t save_size; | |
40 uint32_t save_ram_mask; | |
41 uint32_t master_clock; //Current master clock value | |
42 uint32_t normal_clock; //Normal master clock (used to restore master clock after turbo mode) | |
43 uint32_t frame_end; | |
44 uint32_t max_cycles; | |
45 uint8_t bank_regs[8]; | |
46 uint16_t mapper_start_index; | |
47 uint8_t save_type; | |
48 io_port ports[3]; | |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
49 uint8_t version_reg; |
957 | 50 uint8_t bus_busy; |
51 uint8_t should_exit; | |
961
750995b587a0
Save State menu option is now fully functional. Load state sort of works, but is mostly broken.
Michael Pavone <pavone@retrodev.com>
parents:
957
diff
changeset
|
52 uint8_t save_state; |
971
e28f365605da
Move mouse mode and capture state to emulation context so it persists properly when switching between the menu and the game
Michael Pavone <pavone@retrodev.com>
parents:
961
diff
changeset
|
53 uint8_t mouse_mode; |
e28f365605da
Move mouse mode and capture state to emulation context so it persists properly when switching between the menu and the game
Michael Pavone <pavone@retrodev.com>
parents:
961
diff
changeset
|
54 uint8_t mouse_captured; |
957 | 55 eeprom_state eeprom; |
56 }; | |
288
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
198
diff
changeset
|
57 |
421
d0cacb4ade0b
Move IO code to a separate file and do a tiny bit of refactoring
Mike Pavone <pavone@retrodev.com>
parents:
418
diff
changeset
|
58 extern genesis_context * genesis; |
d0cacb4ade0b
Move IO code to a separate file and do a tiny bit of refactoring
Mike Pavone <pavone@retrodev.com>
parents:
418
diff
changeset
|
59 extern int break_on_sync; |
66 | 60 |
524
fb39534b6604
Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
508
diff
changeset
|
61 #define RAM_WORDS 32 * 1024 |
fb39534b6604
Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
508
diff
changeset
|
62 #define Z80_RAM_BYTES 8 * 1024 |
fb39534b6604
Move debugging code outside of main source file
Mike Pavone <pavone@retrodev.com>
parents:
508
diff
changeset
|
63 |
75 | 64 uint16_t read_dma_value(uint32_t address); |
981
902c53d9c16f
Half assed, prefetch based open bus value emulation. Gets BlastEm up to 119/122 in VDP FIFO Testing
Michael Pavone <pavone@retrodev.com>
parents:
971
diff
changeset
|
65 uint16_t get_open_bus_value(); |
707
8aa9aacefe12
Sync machine state before entering debugger
Michael Pavone <pavone@retrodev.com>
parents:
696
diff
changeset
|
66 m68k_context * sync_components(m68k_context *context, uint32_t address); |
198
209a37eed3e7
Add support for breaking into the debugger while game is running
Mike Pavone <pavone@retrodev.com>
parents:
75
diff
changeset
|
67 m68k_context * debugger(m68k_context * context, uint32_t address); |
483
3e1573fa22cf
Implement turbo/slow motion feature that overclocks or underclocks the entire system at the push of a button
Mike Pavone <pavone@retrodev.com>
parents:
467
diff
changeset
|
68 void set_speed_percent(genesis_context * context, uint32_t percent); |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
69 genesis_context *alloc_config_genesis(void *rom, uint32_t rom_size, void *lock_on, uint32_t lock_on_size, uint32_t ym_opts, uint8_t force_region, rom_info *info_out); |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
70 void start_genesis(genesis_context *gen, char *statefile, uint8_t *debugger); |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
71 void free_genesis(genesis_context *gen); |
66 | 72 |
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.
Michael Pavone <pavone@retrodev.com>
parents:
1016
diff
changeset
|
73 #endif //GENESIS_H_ |
66 | 74 |