annotate backend.h @ 1931:374a5ae694e8 mame_interp

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sat, 18 Apr 2020 11:42:53 -0700
parents 8fe162bdb038 0c1491818f4b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 351
diff changeset
1 /*
140af5509ce7 Added copyright notice to source files and added GPL license text in COPYING
Mike Pavone <pavone@retrodev.com>
parents: 351
diff changeset
2 Copyright 2013 Michael Pavone
555
5af986d2b9da Start work on refactoring some of the backend code to allow more sharing between M68K and Z80 cores and possibly also between x86 and the ARM backend when it exists
Michael 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: 351
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: 351
diff changeset
5 */
557
acec5464fa1e Rename x86_backend.h and x86_backend.c to backend.h and backend.c respectively
Mike Pavone <pavone@retrodev.com>
parents: 556
diff changeset
6 #ifndef BACKEND_H_
acec5464fa1e Rename x86_backend.h and x86_backend.c to backend.h and backend.c respectively
Mike Pavone <pavone@retrodev.com>
parents: 556
diff changeset
7 #define BACKEND_H_
211
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
8
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
9 #include <stdint.h>
556
34dfa9b24c7b Fix build breakage
Michael Pavone <pavone@retrodev.com>
parents: 555
diff changeset
10 #include <stdio.h>
1931
374a5ae694e8 Merge from default
Michael Pavone <pavone@retrodev.com>
parents: 1769 1838
diff changeset
11 #ifndef NEW_CORE
563
c8fefa140c80 Moved some generic stuff from backend.h gen_arm.h and gen_arm.c into gen.h and gen.c. Added a couple fields to cpu_options so that gen_mem_fun can be made guest CPU generic
Michael Pavone <pavone@retrodev.com>
parents: 558
diff changeset
12 #include "gen.h"
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
13 #else
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
14 typedef uint8_t * code_ptr;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
15 typedef struct {
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
16 code_ptr cur;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
17 code_ptr last;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
18 uint32_t stack_off;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
19 } code_info;
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
20 #endif
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
21
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
22 #define INVALID_OFFSET 0xFFFFFFFF
252
63b9a500a00b Implement retranslating code when written to. Possibly broken, need to fix some other bugs before a proper test.
Mike Pavone <pavone@retrodev.com>
parents: 235
diff changeset
23 #define EXTENSION_WORD 0xFFFFFFFE
668
5439ae7946ca Made the Z80 core more contained by refactoring some code in blastem.c into z80_to_x86.c
Michael Pavone <pavone@retrodev.com>
parents: 667
diff changeset
24 #define CYCLE_NEVER 0xFFFFFFFF
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
25
582
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
26 #if defined(X86_32) || defined(X86_64)
211
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
27 typedef struct {
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
28 int32_t disp;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
29 uint8_t mode;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
30 uint8_t base;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
31 uint8_t index;
582
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
32 } host_ea;
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
33 #else
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
34 typedef struct {
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
35 int32_t disp;
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
36 uint8_t mode;
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
37 uint8_t base;
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
38 } host_ea;
c05fcbfe1b1a Refactored translate_m68k so that it contains no host-cpu specific code and moved it to m68k_core.c
Michael Pavone <pavone@retrodev.com>
parents: 567
diff changeset
39 #endif
211
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
40
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
41 typedef struct {
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
42 uint8_t *base;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
43 int32_t *offsets;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
44 } native_map_slot;
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
45
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
46 typedef struct deferred_addr {
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
47 struct deferred_addr *next;
558
dc9f178085a0 Use a typedef code_ptr in place of uint8_t * in 68K core to better support host instruction sets with different instruction word sizes. Make x86_68k_options contain a cpu_options so that gen_mem_fun can eventually be shared with the Z80 core.
Mike Pavone <pavone@retrodev.com>
parents: 557
diff changeset
48 code_ptr dest;
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
49 uint32_t address;
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
50 } deferred_addr;
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
51
1595
360d5bab199f Update controller config when changed in UI without restart
Michael Pavone <pavone@retrodev.com>
parents: 1519
diff changeset
52 #include "memmap.h"
1149
6b0da6021544 Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents: 1130
diff changeset
53 #include "system.h"
6b0da6021544 Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents: 1130
diff changeset
54
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
55 typedef struct {
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
56 uint32_t flags;
1931
374a5ae694e8 Merge from default
Michael Pavone <pavone@retrodev.com>
parents: 1769 1838
diff changeset
57 #ifndef NEW_CORE
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
58 native_map_slot *native_code_map;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
59 deferred_addr *deferred;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
60 code_info code;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
61 uint8_t **ram_inst_sizes;
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
62 #endif
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
63 memmap_chunk const *memmap;
1931
374a5ae694e8 Merge from default
Michael Pavone <pavone@retrodev.com>
parents: 1769 1838
diff changeset
64 #ifndef NEW_CORE
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
65 code_ptr save_context;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
66 code_ptr load_context;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
67 code_ptr handle_cycle_limit;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
68 code_ptr handle_cycle_limit_int;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
69 code_ptr handle_code_write;
987
1f09994e92c5 Initial stab at implementing address error exceptions. Need to fill in the value of IR, undefined bits of last stack frame word and properly deal with address errors that occur during exception processing.
Michael Pavone <pavone@retrodev.com>
parents: 697
diff changeset
70 code_ptr handle_align_error_write;
1f09994e92c5 Initial stab at implementing address error exceptions. Need to fill in the value of IR, undefined bits of last stack frame word and properly deal with address errors that occur during exception processing.
Michael Pavone <pavone@retrodev.com>
parents: 697
diff changeset
71 code_ptr handle_align_error_read;
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
72 #endif
1149
6b0da6021544 Don't lock up CPU if performing a read with writes configured when in PBC mode. Allow access to VDP debug commands from Z80 debugger in PBC mode. Handle Mode 4 in VDP debug print functions
Michael Pavone <pavone@retrodev.com>
parents: 1130
diff changeset
73 system_str_fun_r8 debug_cmd_handler;
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
74 uint32_t memmap_chunks;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
75 uint32_t address_mask;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
76 uint32_t max_address;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
77 uint32_t bus_cycles;
667
30ccf56842d6 All cycle counters are now based off the master clock. This seems to have messed up Z80 interrupt timing (music in Sonic 2 is too slow for instance), but things are generally working
Michael Pavone <pavone@retrodev.com>
parents: 653
diff changeset
78 uint32_t clock_divider;
1931
374a5ae694e8 Merge from default
Michael Pavone <pavone@retrodev.com>
parents: 1769 1838
diff changeset
79 #ifndef NEW_CORE
1465
5d41d0574863 Preserve original address when retranslating instructions instead of switching to the lowest alias
Michael Pavone <pavone@retrodev.com>
parents: 1313
diff changeset
80 uint32_t move_pc_off;
5d41d0574863 Preserve original address when retranslating instructions instead of switching to the lowest alias
Michael Pavone <pavone@retrodev.com>
parents: 1313
diff changeset
81 uint32_t move_pc_size;
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
82 int32_t mem_ptr_off;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
83 int32_t ram_flags_off;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
84 uint8_t ram_flags_shift;
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
85 #endif
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
86 uint8_t address_size;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
87 uint8_t byte_swap;
1931
374a5ae694e8 Merge from default
Michael Pavone <pavone@retrodev.com>
parents: 1769 1838
diff changeset
88 #ifndef NEW_CORE
1047
6b07af1515b5 Change cycle tracking code for Z80 core to only use a single register. Store low 7 bits of R in a reg and increment it appropriately.
Michael Pavone <pavone@retrodev.com>
parents: 987
diff changeset
89 int8_t context_reg;
6b07af1515b5 Change cycle tracking code for Z80 core to only use a single register. Store low 7 bits of R in a reg and increment it appropriately.
Michael Pavone <pavone@retrodev.com>
parents: 987
diff changeset
90 int8_t cycles;
6b07af1515b5 Change cycle tracking code for Z80 core to only use a single register. Store low 7 bits of R in a reg and increment it appropriately.
Michael Pavone <pavone@retrodev.com>
parents: 987
diff changeset
91 int8_t limit;
6b07af1515b5 Change cycle tracking code for Z80 core to only use a single register. Store low 7 bits of R in a reg and increment it appropriately.
Michael Pavone <pavone@retrodev.com>
parents: 987
diff changeset
92 int8_t scratch1;
6b07af1515b5 Change cycle tracking code for Z80 core to only use a single register. Store low 7 bits of R in a reg and increment it appropriately.
Michael Pavone <pavone@retrodev.com>
parents: 987
diff changeset
93 int8_t scratch2;
987
1f09994e92c5 Initial stab at implementing address error exceptions. Need to fill in the value of IR, undefined bits of last stack frame word and properly deal with address errors that occur during exception processing.
Michael Pavone <pavone@retrodev.com>
parents: 697
diff changeset
94 uint8_t align_error_mask;
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
95 #endif
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
96 } cpu_options;
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
97
1931
374a5ae694e8 Merge from default
Michael Pavone <pavone@retrodev.com>
parents: 1769 1838
diff changeset
98 #ifndef NEW_CORE
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
99 typedef uint8_t * (*native_addr_func)(void * context, uint32_t address);
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
100
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
101 deferred_addr * defer_address(deferred_addr * old_head, uint32_t address, uint8_t *dest);
282
7b8a49220e3b Remove deferred address entries from abandoned translations inside z80_retrans_inst
Mike Pavone <pavone@retrodev.com>
parents: 252
diff changeset
102 void remove_deferred_until(deferred_addr **head_ptr, deferred_addr * remove_to);
235
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
103 void process_deferred(deferred_addr ** head_ptr, void * context, native_addr_func get_native);
d9bf8e61c33c Get Z80 core working for simple programs
Mike Pavone <pavone@retrodev.com>
parents: 211
diff changeset
104
567
8e395210f50f Refactor gen_x86 to use an interface more like gen_arm and to remove the need for the caller to decide whether an 8-bit or 32-bit displacement is needed in the rdisp functions. Update m68k_to_x86 to use the new version of the gen_x86 functions and do some minor refactoring there in the process
Michael Pavone <pavone@retrodev.com>
parents: 563
diff changeset
105 void cycles(cpu_options *opts, uint32_t num);
8e395210f50f Refactor gen_x86 to use an interface more like gen_arm and to remove the need for the caller to decide whether an 8-bit or 32-bit displacement is needed in the rdisp functions. Update m68k_to_x86 to use the new version of the gen_x86 functions and do some minor refactoring there in the process
Michael Pavone <pavone@retrodev.com>
parents: 563
diff changeset
106 void check_cycles_int(cpu_options *opts, uint32_t address);
8e395210f50f Refactor gen_x86 to use an interface more like gen_arm and to remove the need for the caller to decide whether an 8-bit or 32-bit displacement is needed in the rdisp functions. Update m68k_to_x86 to use the new version of the gen_x86 functions and do some minor refactoring there in the process
Michael Pavone <pavone@retrodev.com>
parents: 563
diff changeset
107 void check_cycles(cpu_options * opts);
601
f0061e3d2ad9 Fix a few bugs introduced in the Z80 core from the adjustments to fit with the code gen refactor
Michael Pavone <pavone@retrodev.com>
parents: 593
diff changeset
108 void check_code_prologue(code_info *code);
697
7f96bd1cb1be Sync fixes and logging to fix more sync issues
Michael Pavone <pavone@retrodev.com>
parents: 690
diff changeset
109 void log_address(cpu_options *opts, uint32_t address, char * format);
567
8e395210f50f Refactor gen_x86 to use an interface more like gen_arm and to remove the need for the caller to decide whether an 8-bit or 32-bit displacement is needed in the rdisp functions. Update m68k_to_x86 to use the new version of the gen_x86 functions and do some minor refactoring there in the process
Michael Pavone <pavone@retrodev.com>
parents: 563
diff changeset
110
1465
5d41d0574863 Preserve original address when retranslating instructions instead of switching to the lowest alias
Michael Pavone <pavone@retrodev.com>
parents: 1313
diff changeset
111 void retranslate_calc(cpu_options *opts);
5d41d0574863 Preserve original address when retranslating instructions instead of switching to the lowest alias
Michael Pavone <pavone@retrodev.com>
parents: 1313
diff changeset
112 void patch_for_retranslate(cpu_options *opts, code_ptr native_address, code_ptr handler);
5d41d0574863 Preserve original address when retranslating instructions instead of switching to the lowest alias
Michael Pavone <pavone@retrodev.com>
parents: 1313
diff changeset
113
593
5ef3fe516da9 Z80 core is sort of working again
Michael Pavone <pavone@retrodev.com>
parents: 592
diff changeset
114 code_ptr gen_mem_fun(cpu_options * opts, memmap_chunk const * memmap, uint32_t num_chunks, ftype fun_type, code_ptr *after_inc);
1507
2455662378ed Added MAME Z80 core, re-enabled 68K tracing in Musashi core, disabled a bunch of code gen stuff when using interpreters from MAME
Michael Pavone <pavone@retrodev.com>
parents: 1506
diff changeset
115 #endif
653
a18e3923481e Remove some of the hard coded assumptions about the memory map from the CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 620
diff changeset
116 void * get_native_pointer(uint32_t address, void ** mem_pointers, cpu_options * opts);
1753
33ec5df77fac Integration of new Z80 core is sort of working now
Michael Pavone <pavone@retrodev.com>
parents: 1703
diff changeset
117 void * get_native_write_pointer(uint32_t address, void ** mem_pointers, cpu_options * opts);
1313
b27d7bf1107e Improved printing of word at absolute address to support reading from all address types. Implemented support for printing the value pointed to by a register. Removed abuse of read_dma_value in internal debugger.
Michael Pavone <pavone@retrodev.com>
parents: 1149
diff changeset
118 uint16_t read_word(uint32_t address, void **mem_pointers, cpu_options *opts, void *context);
1838
0c1491818f4b WIP new 68K core using CPU DSL
Michael Pavone <pavone@retrodev.com>
parents: 1753
diff changeset
119 void write_word(uint32_t address, uint16_t value, void **mem_pointers, cpu_options *opts, void *context);
1703
49a52c737bf0 Fix zero flag calculation in CPU DSL
Michael Pavone <pavone@retrodev.com>
parents: 1595
diff changeset
120 uint8_t read_byte(uint32_t address, void **mem_pointers, cpu_options *opts, void *context);
49a52c737bf0 Fix zero flag calculation in CPU DSL
Michael Pavone <pavone@retrodev.com>
parents: 1595
diff changeset
121 void write_byte(uint32_t address, uint8_t value, void **mem_pointers, cpu_options *opts, void *context);
1130
8f14767661fa Remove memory map assumptions from Z80 core and move a little bit of logic to the generic backend.c so it can be shared between CPU cores
Michael Pavone <pavone@retrodev.com>
parents: 1079
diff changeset
122 memmap_chunk const *find_map_chunk(uint32_t address, cpu_options *opts, uint16_t flags, uint32_t *size_sum);
690
fc04781f4d28 Removed hardcoded assumptions in M68K core about which parts of the memory map are RAM
Michael Pavone <pavone@retrodev.com>
parents: 668
diff changeset
123 uint32_t chunk_size(cpu_options *opts, memmap_chunk const *chunk);
fc04781f4d28 Removed hardcoded assumptions in M68K core about which parts of the memory map are RAM
Michael Pavone <pavone@retrodev.com>
parents: 668
diff changeset
124 uint32_t ram_size(cpu_options *opts);
589
2dde38c1744f Split gen_mem_fun out of m68k_core_x86 and make it more generic so it can be used by the Z80 core
Michael Pavone <pavone@retrodev.com>
parents: 582
diff changeset
125
557
acec5464fa1e Rename x86_backend.h and x86_backend.c to backend.h and backend.c respectively
Mike Pavone <pavone@retrodev.com>
parents: 556
diff changeset
126 #endif //BACKEND_H_
211
464513050c85 Small bit of cleanup
Mike Pavone <pavone@retrodev.com>
parents:
diff changeset
127