summaryrefslogtreecommitdiff
path: root/genesis.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2018-08-14 00:07:21 -0700
committerMichael Pavone <pavone@retrodev.com>2018-08-14 00:07:21 -0700
commit7f914285b17c1b010c5a3f007f13e587126f6f4d (patch)
treec7caf557adee57425f19c5f70356fe79eed45924 /genesis.c
parent04063013139898718b3775dc10123a400b2c9173 (diff)
Added J-Cart support
Diffstat (limited to 'genesis.c')
-rw-r--r--genesis.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/genesis.c b/genesis.c
index b9b1668..7f2b103 100644
--- a/genesis.c
+++ b/genesis.c
@@ -17,6 +17,7 @@
#include "gdb_remote.h"
#include "saves.h"
#include "bindings.h"
+#include "jcart.h"
#define MCLKS_NTSC 53693175
#define MCLKS_PAL 53203395
@@ -330,6 +331,9 @@ m68k_context * sync_components(m68k_context * context, uint32_t address)
io_adjust_cycles(gen->io.ports, context->current_cycle, deduction);
io_adjust_cycles(gen->io.ports+1, context->current_cycle, deduction);
io_adjust_cycles(gen->io.ports+2, context->current_cycle, deduction);
+ if (gen->mapper_type == MAPPER_JCART) {
+ jcart_adjust_cycles(gen, deduction);
+ }
context->current_cycle -= deduction;
z80_adjust_cycles(z_context, deduction);
gen->ym->current_cycle -= deduction;
@@ -1208,12 +1212,18 @@ static void gamepad_down(system_header *system, uint8_t gamepad_num, uint8_t but
{
genesis_context *gen = (genesis_context *)system;
io_gamepad_down(&gen->io, gamepad_num, button);
+ if (gen->mapper_type == MAPPER_JCART) {
+ jcart_gamepad_down(gen, gamepad_num, button);
+ }
}
static void gamepad_up(system_header *system, uint8_t gamepad_num, uint8_t button)
{
genesis_context *gen = (genesis_context *)system;
io_gamepad_up(&gen->io, gamepad_num, button);
+ if (gen->mapper_type == MAPPER_JCART) {
+ jcart_gamepad_up(gen, gamepad_num, button);
+ }
}
static void mouse_down(system_header *system, uint8_t mouse_num, uint8_t button)