mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-06-02 16:48:43 +02:00
Processing genesis.h and io_ctrl.h
This commit is contained in:
parent
a887907658
commit
0e0aa6637f
|
@ -50,6 +50,7 @@
|
|||
#include "../genesis.h"
|
||||
#include "eeprom_93c.h"
|
||||
#include "sram.h"
|
||||
#include "state.h"
|
||||
|
||||
#define MAPPER_NONE (0x00)
|
||||
#define MAPPER_TEREBI (0x01)
|
||||
|
|
|
@ -52,20 +52,13 @@
|
|||
#include "memz80.h"
|
||||
#include "membnk.h"
|
||||
#include "io_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
#ifdef USE_DYNAMIC_ALLOC
|
||||
external_t *ext;
|
||||
#else /* External Hardware (Cartridge, CD unit, ...) */
|
||||
external_t ext;
|
||||
#endif
|
||||
uint8_t boot_rom[0x800]; /* Genesis BOOT ROM */
|
||||
uint8_t work_ram[0x10000]; /* 68K RAM */
|
||||
uint8_t zram[0x2000]; /* Z80 RAM */
|
||||
uint32_t zbank; /* Z80 bank window address */
|
||||
uint8_t zstate; /* Z80 bus state (d0 = /RESET, d1 = BUSREQ, d2 = WAIT) */
|
||||
uint8_t pico_current; /* PICO current page */
|
||||
|
||||
static uint8_t tmss[4]; /* TMSS security register */
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* Init, reset, shutdown functions */
|
||||
|
|
|
@ -58,12 +58,6 @@ extern external_t *ext;
|
|||
#else
|
||||
extern external_t ext;
|
||||
#endif
|
||||
extern uint8_t boot_rom[0x800];
|
||||
extern uint8_t work_ram[0x10000];
|
||||
extern uint8_t zram[0x2000];
|
||||
extern uint32_t zbank;
|
||||
extern uint8_t zstate;
|
||||
extern uint8_t pico_current;
|
||||
|
||||
/* Function prototypes */
|
||||
extern void gen_init(void);
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "../vdp_ctrl.h"
|
||||
#include "../io_ctrl.h"
|
||||
#include "input.h"
|
||||
#include "state.h"
|
||||
|
||||
/************************************************************************************/
|
||||
/* */
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "../macros.h"
|
||||
#include "input.h"
|
||||
#include "state.h"
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -56,16 +56,7 @@
|
|||
#include "genesis.h"
|
||||
#include "vdp_ctrl.h"
|
||||
#include "io_ctrl.h"
|
||||
|
||||
uint8_t io_reg[0x10];
|
||||
|
||||
uint8_t region_code = REGION_USA;
|
||||
|
||||
static struct port_t
|
||||
{
|
||||
void (*data_w)(unsigned char data, unsigned char mask);
|
||||
unsigned char (*data_r)(void);
|
||||
} port[3];
|
||||
#include "state.h"
|
||||
|
||||
static void dummy_write(unsigned char data, unsigned char mask)
|
||||
{
|
||||
|
|
|
@ -51,9 +51,11 @@
|
|||
#define REGION_USA 0x80
|
||||
#define REGION_EUROPE 0xC0
|
||||
|
||||
/* Global variables */
|
||||
extern uint8_t io_reg[0x10];
|
||||
extern uint8_t region_code;
|
||||
struct port_t
|
||||
{
|
||||
void (*data_w)(unsigned char data, unsigned char mask);
|
||||
unsigned char (*data_r)(void);
|
||||
};
|
||||
|
||||
/* Function prototypes */
|
||||
extern void io_init(void);
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "system.h"
|
||||
#include "genesis.h"
|
||||
#include "vdp_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
/*** ROM Information ***/
|
||||
#define ROMCONSOLE 256
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "vdp_ctrl.h"
|
||||
#include "membnk.h"
|
||||
#include "io_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* Unused areas (return open bus data, i.e prefetched instruction word) */
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "vdp_ctrl.h"
|
||||
#include "membnk.h"
|
||||
#include "io_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
t_zbank_memory_map zbank_memory_map[256];
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "vdp_ctrl.h"
|
||||
#include "membnk.h"
|
||||
#include "io_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* Handlers for access to unused addresses and those which make the */
|
||||
|
|
18
core/state.c
Normal file
18
core/state.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "state.h"
|
||||
|
||||
// genesis.c
|
||||
|
||||
uint8_t boot_rom[0x800];
|
||||
uint8_t work_ram[0x10000];
|
||||
uint8_t zram[0x2000];
|
||||
uint32_t zbank;
|
||||
uint8_t zstate;
|
||||
uint8_t pico_current;
|
||||
uint8_t tmss[4]; // TMSS security register
|
||||
|
||||
// io_ctrl.c
|
||||
|
||||
uint8_t io_reg[0x10];
|
||||
uint8_t region_code = REGION_USA;
|
||||
struct port_t port[3];
|
||||
|
21
core/state.h
Normal file
21
core/state.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <stdint.h>
|
||||
#include "genesis.h"
|
||||
#include "io_ctrl.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
// genesis.h
|
||||
|
||||
extern uint8_t boot_rom[0x800];
|
||||
extern uint8_t work_ram[0x10000];
|
||||
extern uint8_t zram[0x2000];
|
||||
extern uint32_t zbank;
|
||||
extern uint8_t zstate;
|
||||
extern uint8_t pico_current;
|
||||
extern uint8_t tmss[4]; // TMSS security register
|
||||
|
||||
// io_ctrl.h
|
||||
|
||||
extern uint8_t io_reg[0x10];
|
||||
extern uint8_t region_code;
|
||||
extern struct port_t port[3];
|
|
@ -53,6 +53,7 @@
|
|||
#include "vdp_ctrl.h"
|
||||
#include "vdp_render.h"
|
||||
#include "io_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
/* Global variables */
|
||||
t_bitmap bitmap;
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "vdp_ctrl.h"
|
||||
#include "vdp_render.h"
|
||||
#include "io_ctrl.h"
|
||||
#include "state.h"
|
||||
|
||||
/* Mark a pattern as modified */
|
||||
#define MARK_BG_DIRTY(addr) \
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#include <vdp_ctrl.h>
|
||||
#include <input_hw/input.h>
|
||||
#include <cart_hw/sram.h>
|
||||
|
||||
#include <ntsc/sms_ntsc.h>
|
||||
#include <ntsc/md_ntsc.h>
|
||||
#include <state.h>
|
||||
|
||||
#define SOUND_FREQUENCY 48000
|
||||
#define SOUND_SAMPLES_SIZE 2048
|
||||
|
|
Loading…
Reference in New Issue
Block a user