Skip to content

Commit

Permalink
Removing more defines (dynamic allocation, libvorbis, etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMartin86 committed Apr 7, 2024
1 parent 02cb0b7 commit 09e9aa6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 61 deletions.
4 changes: 0 additions & 4 deletions core/cart_hw/md_cart.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
#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 */
Expand Down
29 changes: 0 additions & 29 deletions core/cd_hw/cdd.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@

#include "blip_buf.h"

#if defined(USE_LIBVORBIS)
#include <vorbis/vorbisfile.h>
#elif defined(USE_LIBTREMOR)
#include "tremor/ivorbisfile.h"
#endif

#if defined(USE_LIBCHDR)
#include "libchdr/src/chd.h"
#include "libchdr/src/cdrom.h"
#endif

#define cdd scd.cdd_hw

/* CDD status */
Expand All @@ -74,9 +63,6 @@
typedef struct
{
cdStream *fd;
#if defined(USE_LIBTREMOR) || defined(USE_LIBVORBIS)
OggVorbis_File vf;
#endif
int offset;
int start;
int end;
Expand All @@ -94,18 +80,6 @@ typedef struct
cdStream *sub;
} toc_t;

#if defined(USE_LIBCHDR)
/* CHD file */
typedef struct
{
chd_file *file;
uint8 *hunk;
int hunkbytes;
int hunknum;
int hunkofs;
} chd_t;
#endif

/* CDD hardware */
typedef struct
{
Expand All @@ -119,9 +93,6 @@ typedef struct
uint8 status;
uint16 sectorSize;
toc_t toc;
#if defined(USE_LIBCHDR)
chd_t chd;
#endif
int16 audio[2];
} cdd_t;

Expand Down
4 changes: 0 additions & 4 deletions core/cd_hw/scd.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
#include "pcm.h"
#include "cd_cart.h"

#ifdef USE_DYNAMIC_ALLOC
#define scd ext->cd_hw
#else
#define scd ext.cd_hw
#endif

/* CD hardware models */
#define CD_TYPE_DEFAULT 0x00
Expand Down
4 changes: 0 additions & 4 deletions core/genesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@

#include "shared.h"

#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 */
Expand Down
4 changes: 0 additions & 4 deletions core/genesis.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ 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];
Expand Down
9 changes: 0 additions & 9 deletions core/loadrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,6 @@ int load_rom(char *filename)
{
int i, size;

#ifdef USE_DYNAMIC_ALLOC
if (!ext)
{
/* allocate & initialize memory for Cartridge / CD hardware if required */
ext = (external_t *)calloc(1, sizeof(external_t));
if (!ext) return (0);
}
#endif

/* clear any existing patches */
ggenie_shutdown();
areplay_shutdown();
Expand Down
14 changes: 7 additions & 7 deletions testbed/tests/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ newHashFile="/tmp/newGPGX.${folder}.${script}.${pid}.hash"

# Removing them if already present
rm -f ${baseHashFile}
rm -f ${newHashFile}.simple
rm -f ${newHashFile}

set -x
# Running script on base GPGX
${baseExecutable} ${script} --hashOutputFile ${baseHashFile}.simple ${testerArgs}
${baseExecutable} ${script} --hashOutputFile ${baseHashFile} ${testerArgs}

# Running script on new GPGX (Simple)
${newExecutable} ${script} --hashOutputFile ${newHashFile}.simple ${testerArgs}
${newExecutable} ${script} --hashOutputFile ${newHashFile} ${testerArgs}
set +x

# Comparing hashes
baseHash=`cat ${baseHashFile}.simple`
newHashSimple=`cat ${newHashFile}.simple`
baseHash=`cat ${baseHashFile}`
newHash=`cat ${newHashFile}`

# Removing temporary files
rm -f ${baseHashFile}.simple ${newHashFile}.simple
rm -f ${baseHashFile} ${newHashFile}

# Compare hashes
if [ "${baseHash}" = "${newHashSimple}" ]; then
if [ "${baseHash}" = "${newHash}" ]; then
echo "[] Test Passed"
exit 0
else
Expand Down

0 comments on commit 09e9aa6

Please sign in to comment.