[Core/General] added optional dynamic allocation of cartridge/CD hardware buffer

This commit is contained in:
EkeEke 2014-11-23 20:22:04 +01:00
parent b9b4c16272
commit 9f5dd11e93
4 changed files with 17 additions and 1 deletions

View File

@ -44,7 +44,11 @@
#ifndef _MD_CART_H_
#define _MD_CART_H_
#ifdef USE_DYNAMIC_ALLOC
#define cart ext->md_cart
#else
#define cart ext.md_cart
#endif
/* Lock-On cartridge type */
#define TYPE_GG 0x01 /* Game Genie */

View File

@ -44,7 +44,11 @@
#include "pcm.h"
#include "cd_cart.h"
#ifdef USE_DYNAMIC_ALLOC
#define scd ext->cd_hw
#else
#define scd ext.cd_hw
#endif
/* 5000000 SCD clocks/s = ~3184 clocks/line with a Master Clock of 53.693175 MHz */
/* This would be slightly (~30 clocks) more on PAL systems because of the slower */

View File

@ -41,7 +41,11 @@
#include "shared.h"
external_t ext; /* External Hardware (Cartridge, CD unit, ...) */
#ifdef USE_DYNAMIC_ALLOC
external_t *ext;
#else /* External Hardware (Cartridge, CD unit, ...) */
external_t ext;
#endif
uint8 boot_rom[0x800]; /* Genesis BOOT ROM */
uint8 work_ram[0x10000]; /* 68K RAM */
uint8 zram[0x2000]; /* Z80 RAM */

View File

@ -54,7 +54,11 @@ typedef union
} external_t;
/* Global variables */
#ifdef USE_DYNAMIC_ALLOC
extern external_t *ext;
#else
extern external_t ext;
#endif
extern uint8 boot_rom[0x800];
extern uint8 work_ram[0x10000];
extern uint8 zram[0x2000];