summaryrefslogtreecommitdiff
path: root/trans.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-04-18 19:47:50 -0700
committerMichael Pavone <pavone@retrodev.com>2019-04-18 19:47:50 -0700
commitaa41d9724e763de7a64776a7a2c262a5757383f9 (patch)
tree37ff43745e254182d89a99a7f80333700341c84c /trans.c
parent3ecfc320d19f84248ef5f8b403ac8bd1cb737dd1 (diff)
WIP new 68K core using CPU DSL
Diffstat (limited to 'trans.c')
-rw-r--r--trans.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/trans.c b/trans.c
index 32193ca..1992e88 100644
--- a/trans.c
+++ b/trans.c
@@ -4,7 +4,11 @@
BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
*/
#include "68kinst.h"
+#ifdef NEW_CORE
+#include "m68k.h"
+#else
#include "m68k_core.h"
+#endif
#include "mem.h"
#include <stdio.h>
#include <stdlib.h>
@@ -19,6 +23,7 @@ void render_infobox(char * title, char * buf)
{
}
+#ifndef NEW_CORE
m68k_context * sync_components(m68k_context * context, uint32_t address)
{
if (context->current_cycle > 0x80000000) {
@@ -29,6 +34,7 @@ m68k_context * sync_components(m68k_context * context, uint32_t address)
}
return context;
}
+#endif
m68k_context *reset_handler(m68k_context *context)
{
@@ -74,11 +80,17 @@ int main(int argc, char ** argv)
m68k_context * context = init_68k_context(&opts, reset_handler);
context->mem_pointers[0] = memmap[0].buffer;
context->mem_pointers[1] = memmap[1].buffer;
+#ifndef NEW_CORE
context->target_cycle = context->sync_cycle = 0x80000000;
- uint32_t address;
- address = filebuf[2] << 16 | filebuf[3];
- translate_m68k_stream(address, context);
+#endif
m68k_reset(context);
+#ifdef NEW_CORE
+ for (;;)
+ {
+ m68k_execute(context, 0x80000000);
+ context->cycles = 0;
+ }
+#endif
return 0;
}