Processing genesis.h and io_ctrl.h

This commit is contained in:
SergioMartin86 2024-03-30 08:15:58 +01:00
parent a887907658
commit 0e0aa6637f
16 changed files with 56 additions and 28 deletions

View File

@ -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)

View File

@ -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 */

View File

@ -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);

View File

@ -44,6 +44,7 @@
#include "../vdp_ctrl.h"
#include "../io_ctrl.h"
#include "input.h"
#include "state.h"
/************************************************************************************/
/* */

View File

@ -38,6 +38,7 @@
#include "../macros.h"
#include "input.h"
#include "state.h"
struct
{

View File

@ -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)
{

View File

@ -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);

View File

@ -47,6 +47,7 @@
#include "system.h"
#include "genesis.h"
#include "vdp_ctrl.h"
#include "state.h"
/*** ROM Information ***/
#define ROMCONSOLE 256

View File

@ -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) */

View File

@ -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];

View File

@ -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
View 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
View 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];

View File

@ -53,6 +53,7 @@
#include "vdp_ctrl.h"
#include "vdp_render.h"
#include "io_ctrl.h"
#include "state.h"
/* Global variables */
t_bitmap bitmap;

View File

@ -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) \

View File

@ -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