Simplifying/modernizing

This commit is contained in:
Sergio Martin 2024-01-19 18:44:28 +01:00
parent 823bc9ad1c
commit f7cd3834a7
40 changed files with 95 additions and 168 deletions

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <cstring>
#include <cstdint>
#include <cstdlib>
#include "blargg_common.h"
@ -36,7 +37,7 @@ public:
uint8_t flags2; // MMMM --XX Mapper high 4 bits
uint8_t zero [8]; // if zero [7] is non-zero, treat flags2 as zero
};
BOOST_STATIC_ASSERT( sizeof (ines_header_t) == 16 );
static_assert( sizeof (ines_header_t) == 16 );
// Load iNES file
void load_ines( const uint8_t* buffer )

View File

@ -113,7 +113,7 @@ struct joypad_state_t
uint8_t w4016; // strobe
uint8_t unused [3];
};
BOOST_STATIC_ASSERT( sizeof (joypad_state_t) == 12 );
static_assert( sizeof (joypad_state_t) == 12 );
struct cpu_state_t
{
@ -125,7 +125,7 @@ struct cpu_state_t
uint8_t y;
uint8_t unused [1];
};
BOOST_STATIC_ASSERT( sizeof (cpu_state_t) == 8 );
static_assert( sizeof (cpu_state_t) == 8 );
class Nes_Core : private Nes_Cpu {
typedef Nes_Cpu cpu;
@ -1085,18 +1085,18 @@ inline void Nes_Core::cpu_write( nes_addr_t addr, int data, nes_time_t time )
}
#define NES_CPU_READ_PPU( cpu, addr, time ) \
STATIC_CAST(Nes_Core&,*cpu).cpu_read_ppu( addr, time )
static_cast<Nes_Core&>(*cpu).cpu_read_ppu( addr, time )
#define NES_CPU_READ( cpu, addr, time ) \
STATIC_CAST(Nes_Core&,*cpu).cpu_read( addr, time )
static_cast<Nes_Core&>(*cpu).cpu_read( addr, time )
#define NES_CPU_WRITEX( cpu, addr, data, time ){\
STATIC_CAST(Nes_Core&,*cpu).cpu_write( addr, data, time );\
static_cast<Nes_Core&>(*cpu).cpu_write( addr, data, time );\
}
#define NES_CPU_WRITE( cpu, addr, data, time ){\
if ( addr < 0x800 ) cpu->low_mem [addr] = data;\
else if ( addr == 0x2007 ) STATIC_CAST(Nes_Core&,*cpu).cpu_write_2007( data );\
else STATIC_CAST(Nes_Core&,*cpu).cpu_write( addr, data, time );\
else if ( addr == 0x2007 ) static_cast<Nes_Core&>(*cpu).cpu_write_2007( data );\
else static_cast<Nes_Core&>(*cpu).cpu_write( addr, data, time );\
}

View File

@ -1,4 +1,3 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include <cstring>
@ -18,11 +17,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
int const sound_fade_size = 384;
// Constants are manually duplicated in Nes_Emu so their value can be seen
// directly, rather than having to look in Nes_Ppu.h. "0 +" converts to int.
BOOST_STATIC_ASSERT( Nes_Emu::image_width == 0 + Nes_Ppu::image_width );
BOOST_STATIC_ASSERT( Nes_Emu::image_height == 0 + Nes_Ppu::image_height );
Nes_Emu::equalizer_t const Nes_Emu::nes_eq = { -1.0, 80 };
Nes_Emu::equalizer_t const Nes_Emu::famicom_eq = { -15.0, 80 };
Nes_Emu::equalizer_t const Nes_Emu::tv_eq = { -12.0, 180 };

View File

@ -8,6 +8,8 @@
#include "Nes_Cart.h"
#include "Nes_Cpu.h"
#include <climits>
class Blip_Buffer;
class blip_eq_t;
class Nes_Core;

View File

@ -7,6 +7,8 @@
#define NES_PPU_H
#include "Nes_Ppu_Rendering.h"
#include <climits>
class Nes_Mapper;
class Nes_Core;

View File

@ -325,19 +325,19 @@ struct calc_sprite_max_scanlines
uint8_t* p = scanlines + top;
if ( (unsigned) (239 - top) < limit )
{
unsigned long p0 = ((unaligned_uint32_t*)p) [0].val + offset;
unsigned long p4 = ((unaligned_uint32_t*)p) [1].val + offset;
((unaligned_uint32_t*)p) [0].val = p0;
unsigned long p0 = ((uint32_t*)p) [0] + offset;
unsigned long p4 = ((uint32_t*)p) [1] + offset;
((uint32_t*)p) [0] = p0;
any_hits |= p0;
((unaligned_uint32_t*)p) [1].val = p4;
((uint32_t*)p) [1] = p4;
any_hits |= p4;
if ( height > 8 )
{
unsigned long p0 = ((unaligned_uint32_t*)p) [2].val + offset;
unsigned long p4 = ((unaligned_uint32_t*)p) [3].val + offset;
((unaligned_uint32_t*)p) [2].val = p0;
unsigned long p0 = ((uint32_t*)p) [2] + offset;
unsigned long p4 = ((uint32_t*)p) [3] + offset;
((uint32_t*)p) [2] = p0;
any_hits |= p0;
((unaligned_uint32_t*)p) [3].val = p4;
((uint32_t*)p) [3] = p4;
any_hits |= p4;
}
}
@ -376,12 +376,12 @@ long Nes_Ppu_Impl::recalc_sprite_max( int scanline )
// check four at a time
uint8_t* pos = &sprite_max_scanlines [scanline];
unsigned long n = ((unaligned_uint32_t*)pos)->val;
unsigned long n = *((uint32_t*)pos);
while ( 1 )
{
unsigned long x = n & mask;
pos += 4;
n = ((unaligned_uint32_t*)pos)->val;
n = *((uint32_t*)pos);
if ( x )
break;
}

View File

@ -29,7 +29,7 @@ struct ppu_state_t
uint8_t open_bus;
uint8_t unused2[3];
};
BOOST_STATIC_ASSERT( sizeof (ppu_state_t) == 20 + 0x20 );
static_assert( sizeof (ppu_state_t) == 20 + 0x20 );
class Nes_Ppu_Impl : public ppu_state_t {
public:

View File

@ -1,4 +1,3 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include "Nes_Ppu_Rendering.h"
@ -30,7 +29,7 @@ inline Nes_Ppu_Impl::cached_tile_t const&
int index = sprite_tile_index( sprite );
// use index directly, since cached tile is same size as native tile
BOOST_STATIC_ASSERT( sizeof (cached_tile_t) == bytes_per_tile );
static_assert( sizeof (cached_tile_t) == bytes_per_tile );
return *(Nes_Ppu_Impl::cached_tile_t*)
((uint8_t*) tiles + map_chr_addr( index * bytes_per_tile ));
}
@ -38,7 +37,7 @@ inline Nes_Ppu_Impl::cached_tile_t const&
inline Nes_Ppu_Impl::cached_tile_t const& Nes_Ppu_Impl::get_bg_tile( int index )
{
// use index directly, since cached tile is same size as native tile
BOOST_STATIC_ASSERT( sizeof (cached_tile_t) == bytes_per_tile );
static_assert( sizeof (cached_tile_t) == bytes_per_tile );
return *(Nes_Ppu_Impl::cached_tile_t*)
((uint8_t*) tile_cache + map_chr_addr( index * bytes_per_tile ));
}
@ -205,11 +204,11 @@ void Nes_Ppu_Rendering::draw_background_( int remain )
for ( int n = 4; n--; )
{
unsigned long line = *lines++;
((unaligned_uint32_t*) p) [0].val = (line >> 4 & mask) + offset;
((unaligned_uint32_t*) p) [1].val = (line & mask) + offset;
((uint32_t*) p) [0] = (line >> 4 & mask) + offset;
((uint32_t*) p) [1] = (line & mask) + offset;
p += row_bytes;
((unaligned_uint32_t*) p) [0].val = (line >> 6 & mask) + offset;
((unaligned_uint32_t*) p) [1].val = (line >> 2 & mask) + offset;
((uint32_t*) p) [0] = (line >> 6 & mask) + offset;
((uint32_t*) p) [1] = (line >> 2 & mask) + offset;
p += row_bytes;
}
}
@ -220,27 +219,27 @@ void Nes_Ppu_Rendering::draw_background_( int remain )
if ( fine_y & 1 )
{
unsigned long line = *lines++;
((unaligned_uint32_t*) p) [0].val = (line >> 6 & mask) + offset;
((unaligned_uint32_t*) p) [1].val = (line >> 2 & mask) + offset;
((uint32_t*) p) [0] = (line >> 6 & mask) + offset;
((uint32_t*) p) [1] = (line >> 2 & mask) + offset;
p += row_bytes;
}
for ( int n = height >> 1; n--; )
{
unsigned long line = *lines++;
((unaligned_uint32_t*) p) [0].val = (line >> 4 & mask) + offset;
((unaligned_uint32_t*) p) [1].val = (line & mask) + offset;
((uint32_t*) p) [0] = (line >> 4 & mask) + offset;
((uint32_t*) p) [1] = (line & mask) + offset;
p += row_bytes;
((unaligned_uint32_t*) p) [0].val = (line >> 6 & mask) + offset;
((unaligned_uint32_t*) p) [1].val = (line >> 2 & mask) + offset;
((uint32_t*) p) [0] = (line >> 6 & mask) + offset;
((uint32_t*) p) [1] = (line >> 2 & mask) + offset;
p += row_bytes;
}
if ( height & 1 )
{
unsigned long line = *lines;
((unaligned_uint32_t*) p) [0].val = (line >> 4 & mask) + offset;
((unaligned_uint32_t*) p) [1].val = (line & mask) + offset;
((uint32_t*) p) [0] = (line >> 4 & mask) + offset;
((uint32_t*) p) [1] = (line & mask) + offset;
}
}
}
@ -367,8 +366,8 @@ void Nes_Ppu_Rendering::check_sprite_hit( int begin, int end )
{
// get pixels for line
unsigned long line = lines [skip >> 1];
unsigned long hit0 = ((unaligned_uint32_t*) bg) [0].val;
unsigned long hit1 = ((unaligned_uint32_t*) bg) [1].val;
unsigned long hit0 = ((uint32_t*) bg) [0];
unsigned long hit1 = ((uint32_t*) bg) [1];
bg += next_row;
line >>= skip << 1 & 2;
line |= line >> 1;

View File

@ -50,7 +50,7 @@ private:
inline Nes_Ppu_Rendering::Nes_Ppu_Rendering()
{
sprite_limit = 8;
host_pixels = NULL;
host_pixels = nullptr;
}
inline void Nes_Ppu_Rendering::draw_sprites( int start, int count )

View File

@ -32,11 +32,11 @@ unsigned long const maskgen = 0x80808080 + zero;
#define DRAW_PAIR( shift ) { \
int sprite_count = *scanlines; \
CALC_FOUR( ((unaligned_uint32_t*) out) [0].val, (line >> (shift + 4)), out0 ) \
CALC_FOUR( ((unaligned_uint32_t*) out) [1].val, (line >> shift), out1 ) \
CALC_FOUR( ((uint32_t*) out) [0], (line >> (shift + 4)), out0 ) \
CALC_FOUR( ((uint32_t*) out) [1], (line >> shift), out1 ) \
if ( sprite_count < this->max_sprites ) { \
((unaligned_uint32_t*) out) [0].val = out0; \
((unaligned_uint32_t*) out) [1].val = out1; \
((uint32_t*) out) [0] = out0; \
((uint32_t*) out) [1] = out1; \
} \
if ( CLIPPED ) visible--; \
out += next_row; \

View File

@ -22,11 +22,11 @@ typedef long fixed_t;
const unsigned echo_size = 4096;
const unsigned echo_mask = echo_size - 1;
BOOST_STATIC_ASSERT( (echo_size & echo_mask) == 0 ); // must be power of 2
static_assert( (echo_size & echo_mask) == 0 ); // must be power of 2
const unsigned reverb_size = 8192 * 2;
const unsigned reverb_mask = reverb_size - 1;
BOOST_STATIC_ASSERT( (reverb_size & reverb_mask) == 0 ); // must be power of 2
static_assert( (reverb_size & reverb_mask) == 0 ); // must be power of 2
Effects_Buffer::config_t::config_t()
{

View File

@ -2,6 +2,7 @@
// Blip_Buffer 0.4.0. http://www.slack.net/~ant/
#include "Multi_Buffer.h"
#include <cstdint>
/* Copyright (C) 2003-2006 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser
@ -67,9 +68,9 @@ void Mono_Buffer::RestoreAudioBufferState()
Silent_Buffer::Silent_Buffer() : Multi_Buffer( 1 ) // 0 channels would probably confuse
{
chan.left = NULL;
chan.center = NULL;
chan.right = NULL;
chan.left = 0;
chan.center = 0;
chan.right = 0;
}
void Silent_Buffer::SaveAudioBufferState()
@ -192,7 +193,7 @@ void Stereo_Buffer::mix_stereo( blip_sample_t* out, long count )
right.begin( bufs [2] );
int bass = center.begin( bufs [0] );
if (out != NULL)
if (out != 0)
{
while ( count-- )
{
@ -235,7 +236,7 @@ void Stereo_Buffer::mix_mono( blip_sample_t* out, long count )
Blip_Reader in;
int bass = in.begin( bufs [0] );
if (out != NULL)
if (out != 0)
{
while ( count-- )
{

View File

@ -97,7 +97,7 @@ long Nes_Buffer::read_samples( blip_sample_t* out, long count )
int lin_bass = lin.begin( buf );
int nonlin_bass = nonlin.begin( tnd );
if (out != NULL)
if (out != 0)
{
for ( int n = count; n--; )
{
@ -150,7 +150,7 @@ void Nes_Buffer::RestoreAudioBufferState()
Nes_Nonlinearizer::Nes_Nonlinearizer()
{
apu = NULL;
apu = nullptr;
enabled = true;
float const gain = 0x7fff * 1.3f;

View File

@ -7,6 +7,8 @@
#define NES_BUFFER_H
#include "Multi_Buffer.h"
#include <cstdint>
class Nes_Apu;
class Nes_Nonlinearizer {

View File

@ -11,6 +11,9 @@
class Nes_Apu;
typedef long nes_time_t; // CPU clock cycle count
typedef unsigned nes_addr_t; // 16-bit memory address
struct Nes_Osc
{
unsigned char regs [4];

View File

@ -21,8 +21,8 @@ Nes_Apu::Nes_Apu() :
square2( &square_synth )
{
dmc.apu = this;
dmc.prg_reader = NULL;
irq_notifier_ = NULL;
dmc.prg_reader = 0;
irq_notifier_ = 0;
oscs [0] = &square1;
oscs [1] = &square2;
@ -30,7 +30,7 @@ Nes_Apu::Nes_Apu() :
oscs [3] = &noise;
oscs [4] = &dmc;
output( NULL );
output( 0 );
volume( 1.0 );
reset( false );
}

View File

@ -5,11 +5,9 @@
// Nes_Snd_Emu 0.1.7
#include <cstdint>
#include <cstdint>
#include <climits>
#include "blargg_endian.h"
typedef long nes_time_t; // CPU clock cycle count
typedef unsigned nes_addr_t; // 16-bit memory address
#include "Nes_Oscs.h"
class Nes_Apu {
@ -91,7 +89,7 @@ public:
SWAP_LE( dmc.addr );
}
};
BOOST_STATIC_ASSERT( sizeof (apu_state_t) == 72 );
static_assert( sizeof (apu_state_t) == 72 );
Nes_Apu();
~Nes_Apu();
@ -102,7 +100,7 @@ public:
// Set memory reader callback used by DMC oscillator to fetch samples.
// When callback is invoked, 'user_data' is passed unchanged as the
// first parameter.
void dmc_reader( int (*callback)( void* user_data, nes_addr_t ), void* user_data = NULL );
void dmc_reader( int (*callback)( void* user_data, nes_addr_t ), void* user_data = nullptr );
// All time values are the number of CPU clock cycles relative to the
// beginning of the current time frame. Before resetting the CPU clock
@ -150,7 +148,7 @@ public:
// Set IRQ time callback that is invoked when the time of earliest IRQ
// may have changed, or NULL to disable. When callback is invoked,
// 'user_data' is passed unchanged as the first parameter.
void irq_notifier( void (*callback)( void* user_data ), void* user_data = NULL );
void irq_notifier( void (*callback)( void* user_data ), void* user_data = nullptr );
// Get time that APU-generated IRQ will occur if no further register reads
// or writes occur. If IRQ is already pending, returns irq_waiting. If no
@ -162,7 +160,7 @@ public:
// Count number of DMC reads that would occur if 'run_until( t )' were executed.
// If last_read is not NULL, set *last_read to the earliest time that
// 'count_dmc_reads( time )' would result in the same result.
int count_dmc_reads( nes_time_t t, nes_time_t* last_read = NULL ) const;
int count_dmc_reads( nes_time_t t, nes_time_t* last_read = nullptr ) const;
// Time when next DMC memory read will occur
nes_time_t next_dmc_read_time() const;

View File

@ -15,7 +15,7 @@ struct fme7_apu_state_t
uint8_t latch;
uint16_t delays [3]; // a, b, c
};
BOOST_STATIC_ASSERT( sizeof (fme7_apu_state_t) == 24 );
static_assert( sizeof (fme7_apu_state_t) == 24 );
class Nes_Fme7_Apu : private fme7_apu_state_t {
public:
@ -86,7 +86,7 @@ inline void Nes_Fme7_Apu::output( Blip_Buffer* buf )
inline Nes_Fme7_Apu::Nes_Fme7_Apu()
{
output( NULL );
output( 0 );
volume( 1.0 );
reset();
}

View File

@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Nes_Namco_Apu::Nes_Namco_Apu()
{
output( NULL );
output( 0 );
volume( 1.0 );
reset();
}

View File

@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Nes_Vrc6_Apu::Nes_Vrc6_Apu()
{
output( NULL );
output( 0 );
volume( 1.0 );
reset();
}

View File

@ -73,7 +73,7 @@ struct vrc6_apu_state_t
uint8_t phases [3];
uint8_t unused;
};
BOOST_STATIC_ASSERT( sizeof (vrc6_apu_state_t) == 20 );
static_assert( sizeof (vrc6_apu_state_t) == 20 );
inline void Nes_Vrc6_Apu::osc_output( int i, Blip_Buffer* buf )
{

View File

@ -60,7 +60,7 @@ struct vrc7_snapshot_t
int internal_opl_state_size;
OPLL_STATE internal_opl_state;
};
BOOST_STATIC_ASSERT( sizeof (vrc7_snapshot_t) == 28 + 440 + 4 );
static_assert( sizeof (vrc7_snapshot_t) == 28 + 440 + 4 );
inline void Nes_Vrc7::osc_output( int i, Blip_Buffer* buf )
{

View File

@ -1,60 +0,0 @@
// Sets up common environment for Shay Green's libraries.
// To change configuration options, modify blargg_config.h, not this file.
// File_Extractor 1.0.0
#ifndef BLARGG_COMMON_H
#define BLARGG_COMMON_H
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
/* Pure virtual functions cause a vtable entry to a "called pure virtual"
error handler, requiring linkage to the C++ runtime library. This macro is
used in place of the "= 0", and simply expands to its argument. During
development, it expands to "= 0", allowing detection of missing overrides. */
#define BLARGG_PURE( def ) def
/* My code depends on ASCII anywhere a character or string constant is
compared with data read from a file, and anywhere file data is read and
treated as a string. */
#if '\n'!=0x0A || ' '!=0x20 || '0'!=0x30 || 'A'!=0x41 || 'a'!=0x61
#error "ASCII character set required"
#endif
/* My code depends on int being at least 32 bits. Almost everything these days
uses at least 32-bit ints, so it's hard to even find a system with 16-bit ints
to test with. The issue can't be gotten around by using a suitable blargg_int
everywhere either, because int is often converted to implicitly when doing
arithmetic on smaller types. */
#if UINT_MAX < 0xFFFFFFFF
#error "int must be at least 32 bits"
#endif
// In case compiler doesn't support these properly. Used rarely.
#define STATIC_CAST(T,expr) static_cast<T> (expr)
// BOOST_STATIC_ASSERT( expr ): Generates compile error if expr is 0.
#ifndef BOOST_STATIC_ASSERT
#ifdef _MSC_VER
// MSVC6 (_MSC_VER < 1300) fails for use of __LINE__ when /Zl is specified
#define BOOST_STATIC_ASSERT( expr ) \
void blargg_failed_( int (*arg) [2 / (int)!!(expr) - 1] )
#else
// Some other compilers fail when declaring same function multiple times in class,
// so differentiate them by line
#define BOOST_STATIC_ASSERT( expr ) \
void blargg_failed_( int (*arg) [2 / !!(expr) - 1] [__LINE__] )
#endif
#endif
typedef struct
#ifdef NO_UNALIGNED_ACCESS
__attribute ((packed))
#endif
{
uint32_t val;
}unaligned_uint32_t;
#endif

View File

@ -3,8 +3,7 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include "Nes_Mapper.h"
#include <string.h>
#include <cstring>
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser
@ -25,7 +24,7 @@ struct mmc1_state_t
uint8_t bit; // number of bits in buffer (0 to 4)
uint8_t buf; // currently buffered bits (new bits added to bottom)
};
BOOST_STATIC_ASSERT( sizeof (mmc1_state_t) == 6 );
static_assert( sizeof (mmc1_state_t) == 6 );
class Mapper001 : public Nes_Mapper, mmc1_state_t {
public:

View File

@ -4,7 +4,7 @@
#include "Nes_Mapper.h"
#include <string.h>
#include <cstring>
#include "Nes_Core.h"
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you
@ -37,7 +37,7 @@ struct mmc3_state_t
uint8_t irq_enabled;// last write was to 0) $e000, 1) $e001
uint8_t irq_flag;
};
BOOST_STATIC_ASSERT( sizeof (mmc3_state_t) == 15 );
static_assert( sizeof (mmc3_state_t) == 15 );
class Mapper004 : public Nes_Mapper, mmc3_state_t {
public:

View File

@ -7,7 +7,7 @@
#include "Nes_Mapper.h"
#include "Nes_Core.h"
#include <string.h>
#include <cstring>
/* Copyright (C) 2004-2006 Shay Green. This module is free software; you
can redistribute it and/or modify it under the terms of the GNU Lesser
@ -26,8 +26,7 @@ struct mmc5_state_t
uint8_t regs [0x30];
uint8_t irq_enabled;
};
// to do: finalize state format
BOOST_STATIC_ASSERT( sizeof (mmc5_state_t) == 0x31 );
static_assert( sizeof (mmc5_state_t) == 0x31 );
// MMC5

View File

@ -25,7 +25,7 @@ struct Mapper015_state_t
uint8_t mirroring;
};
BOOST_STATIC_ASSERT( sizeof (Mapper015_state_t) == 5 );
static_assert( sizeof (Mapper015_state_t) == 5 );
// K-1029, K-1030P

View File

@ -5,7 +5,6 @@
// Nes_Emu 0.7.0. http://www.slack.net/~ant/
#include "Nes_Mapper.h"
#include "blargg_endian.h"
#include "audio/namco/apu.h"
@ -37,8 +36,7 @@ struct namco106_state_t
set_le16( &sound_state.delays [i], sound_state.delays [i] );
}
};
BOOST_STATIC_ASSERT( sizeof (namco106_state_t) == 20 + sizeof (namco_state_t) );
static_assert( sizeof (namco106_state_t) == 20 + sizeof (namco_state_t) );
// Namco106

View File

@ -40,8 +40,7 @@ struct vrc2_state_t
uint16_t next_time;
uint8_t irq_pending;
};
BOOST_STATIC_ASSERT( sizeof ( vrc2_state_t ) == 18 );
static_assert( sizeof ( vrc2_state_t ) == 18 );
template <bool type_a, bool type_b>
class Mapper_VRC2_4 : public Nes_Mapper, vrc2_state_t {

View File

@ -47,9 +47,7 @@ struct vrc6_state_t
set_le16( &sound_state.delays [i], sound_state.delays [i] );
}
};
BOOST_STATIC_ASSERT( sizeof (vrc6_state_t) == 26 + sizeof (vrc6_apu_state_t) );
static_assert( sizeof (vrc6_state_t) == 26 + sizeof (vrc6_apu_state_t) );
template <int swapMask>
class Mapper_Vrc6 : public Nes_Mapper, vrc6_state_t {

View File

@ -32,8 +32,7 @@ struct mapper32_state_t
uint8_t prg_mode;
uint8_t mirr;
};
BOOST_STATIC_ASSERT( sizeof ( mapper32_state_t ) == 12 );
static_assert( sizeof ( mapper32_state_t ) == 12 );
// Irem_G101

View File

@ -31,8 +31,7 @@ struct tc0190_state_t
uint8_t creg [ 6 ];
uint8_t mirr;
};
BOOST_STATIC_ASSERT( sizeof ( tc0190_state_t ) == 9 );
static_assert( sizeof ( tc0190_state_t ) == 9 );
// TaitoTC0190

View File

@ -38,7 +38,7 @@ struct fme7_state_t
set_le16( &sound_state.delays [i], sound_state.delays [i] );
}
};
BOOST_STATIC_ASSERT( sizeof (fme7_state_t) == 18 + sizeof (fme7_apu_state_t) );
static_assert( sizeof (fme7_state_t) == 18 + sizeof (fme7_apu_state_t) );
// Fme7

View File

@ -26,8 +26,7 @@ struct vrc1_state_t
uint8_t chr_banks_hi [ 2 ];
uint8_t mirroring;
};
BOOST_STATIC_ASSERT( sizeof ( vrc1_state_t ) == 8 );
static_assert( sizeof ( vrc1_state_t ) == 8 );
// VRC1

View File

@ -34,7 +34,7 @@ struct vrc7_state_t
vrc7_snapshot_t sound_state;
};
BOOST_STATIC_ASSERT( sizeof (vrc7_state_t) == 20 + sizeof (vrc7_snapshot_t) );
static_assert( sizeof (vrc7_state_t) == 20 + sizeof (vrc7_snapshot_t) );
// Vrc7

View File

@ -33,8 +33,7 @@ struct namco_34x3_state_t
uint8_t mirr;
uint8_t mode;
};
BOOST_STATIC_ASSERT( sizeof (namco_34x3_state_t) == 10 );
static_assert( sizeof (namco_34x3_state_t) == 10 );
template < bool _is154 >
class Mapper_Namco_34x3 : public Nes_Mapper, namco_34x3_state_t {

View File

@ -1,5 +1,4 @@
#include "Nes_Mapper.h"
#pragma once
// DIS23C01 DAOU ROM CONTROLLER
@ -9,7 +8,7 @@ struct m156_state_t
uint8_t prg_bank;
uint8_t chr_banks [8];
};
BOOST_STATIC_ASSERT( sizeof (m156_state_t) == 9 );
static_assert( sizeof (m156_state_t) == 9 );
class Mapper156 : public Nes_Mapper, m156_state_t {
public:

View File

@ -33,8 +33,7 @@ struct namco_34xx_state_t
uint8_t mirr;
uint8_t mode;
};
BOOST_STATIC_ASSERT( sizeof (namco_34xx_state_t) == 10 );
static_assert( sizeof (namco_34xx_state_t) == 10 );
// Namco_34xx

View File

@ -31,8 +31,7 @@ struct taito_x1005_state_t
uint8_t creg [ 6 ];
uint8_t nametable [ 2 ];
};
BOOST_STATIC_ASSERT( sizeof (taito_x1005_state_t) == 11 );
static_assert( sizeof (taito_x1005_state_t) == 11 );
// TaitoX1005

View File

@ -32,8 +32,7 @@ struct mapper244_state_t
uint8_t preg;
uint8_t creg;
};
BOOST_STATIC_ASSERT( sizeof (mapper244_state_t) == 2 );
static_assert( sizeof (mapper244_state_t) == 2 );
class Mapper244 : public Nes_Mapper, mapper244_state_t {
public: