diff --git a/source/quickerNES/Effects_Buffer.cpp b/source/quickerNES/Effects_Buffer.cpp index 00c1555..7548610 100644 --- a/source/quickerNES/Effects_Buffer.cpp +++ b/source/quickerNES/Effects_Buffer.cpp @@ -2,8 +2,7 @@ // Game_Music_Emu 0.3.0. http://www.slack.net/~ant/ #include "Effects_Buffer.h" - -#include +#include /* 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 @@ -16,12 +15,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - -#ifdef BLARGG_ENABLE_OPTIMIZER - #include BLARGG_ENABLE_OPTIMIZER -#endif - typedef long fixed_t; #define TO_FIXED( f ) fixed_t ((f) * (1L << 15) + 0.5) @@ -98,8 +91,7 @@ const char *Effects_Buffer::set_sample_rate( long rate, int msec ) reverb_buf = new blip_sample_t [reverb_size]; } - for ( int i = 0; i < buf_count; i++ ) - RETURN_ERR( bufs [i].set_sample_rate( rate, msec ) ); + for ( int i = 0; i < buf_count; i++ ) bufs [i].set_sample_rate( rate, msec ); config( config_ ); clear(); diff --git a/source/quickerNES/Multi_Buffer.cpp b/source/quickerNES/Multi_Buffer.cpp index 66cc8b7..5e7e743 100644 --- a/source/quickerNES/Multi_Buffer.cpp +++ b/source/quickerNES/Multi_Buffer.cpp @@ -14,8 +14,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - Multi_Buffer::Multi_Buffer( int spf ) : samples_per_frame_( spf ) { length_ = 0; @@ -49,7 +47,7 @@ Mono_Buffer::~Mono_Buffer() const char * Mono_Buffer::set_sample_rate( long rate, int msec ) { - RETURN_ERR( buf.set_sample_rate( rate, msec ) ); + buf.set_sample_rate( rate, msec ); return Multi_Buffer::set_sample_rate( buf.sample_rate(), buf.length() ); } @@ -115,8 +113,7 @@ Stereo_Buffer::~Stereo_Buffer() const char * Stereo_Buffer::set_sample_rate( long rate, int msec ) { - for ( int i = 0; i < buf_count; i++ ) - RETURN_ERR( bufs [i].set_sample_rate( rate, msec ) ); + for ( int i = 0; i < buf_count; i++ ) bufs [i].set_sample_rate( rate, msec ) ; return Multi_Buffer::set_sample_rate( bufs [0].sample_rate(), bufs [0].length() ); } diff --git a/source/quickerNES/Nes_Apu.cpp b/source/quickerNES/Nes_Apu.cpp index ef42a93..dd0f8c7 100644 --- a/source/quickerNES/Nes_Apu.cpp +++ b/source/quickerNES/Nes_Apu.cpp @@ -14,8 +14,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - int const amp_range = 15; Nes_Apu::Nes_Apu() : diff --git a/source/quickerNES/Nes_Apu.h b/source/quickerNES/Nes_Apu.h index ef6e998..ad1a424 100644 --- a/source/quickerNES/Nes_Apu.h +++ b/source/quickerNES/Nes_Apu.h @@ -5,7 +5,6 @@ // Nes_Snd_Emu 0.1.7 #include -#include "blargg_source.h" #include "blargg_endian.h" typedef long nes_time_t; // CPU clock cycle count diff --git a/source/quickerNES/Nes_Buffer.cpp b/source/quickerNES/Nes_Buffer.cpp index 9926dff..66285c3 100644 --- a/source/quickerNES/Nes_Buffer.cpp +++ b/source/quickerNES/Nes_Buffer.cpp @@ -1,8 +1,6 @@ - // Nes_Emu 0.7.0. http://www.slack.net/~ant/libs/ #include "Nes_Buffer.h" - #include "Nes_Apu.h" /* Library Copyright (C) 2003-2006 Shay Green. This library is free software; @@ -16,11 +14,6 @@ details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - -#ifdef BLARGG_ENABLE_OPTIMIZER - #include BLARGG_ENABLE_OPTIMIZER -#endif // Nes_Buffer @@ -47,8 +40,8 @@ void Nes_Buffer::enable_nonlinearity( bool b ) const char * Nes_Buffer::set_sample_rate( long rate, int msec ) { enable_nonlinearity( nonlin.enabled ); // reapply - RETURN_ERR( buf.set_sample_rate( rate, msec ) ); - RETURN_ERR( tnd.set_sample_rate( rate, msec ) ); + buf.set_sample_rate( rate, msec ); + tnd.set_sample_rate( rate, msec ); return Multi_Buffer::set_sample_rate( buf.sample_rate(), buf.length() ); } diff --git a/source/quickerNES/Nes_Cart.h b/source/quickerNES/Nes_Cart.h index 1ca0249..d3fd82b 100644 --- a/source/quickerNES/Nes_Cart.h +++ b/source/quickerNES/Nes_Cart.h @@ -39,7 +39,7 @@ public: BOOST_STATIC_ASSERT( sizeof (ines_header_t) == 16 ); // Load iNES file - const char * load_ines( const uint8_t* buffer ) +void load_ines( const uint8_t* buffer ) { ines_header_t h; @@ -61,8 +61,6 @@ public: { size_t copySize = prg_size(); memcpy(prg(), &buffer[bufferPos], copySize); bufferPos += copySize; } { size_t copySize = chr_size(); memcpy(chr(), &buffer[bufferPos], copySize); bufferPos += copySize; } - - return 0; } inline bool has_battery_ram() const { return mapper & 0x02; } diff --git a/source/quickerNES/Nes_Core.h b/source/quickerNES/Nes_Core.h index e12fb39..122344d 100644 --- a/source/quickerNES/Nes_Core.h +++ b/source/quickerNES/Nes_Core.h @@ -159,10 +159,10 @@ public: return 0; } - const char * open( Nes_Cart const* new_cart ) + void open( Nes_Cart const* new_cart ) { close(); - RETURN_ERR( init() ); + init(); // Getting cartdrige mapper code auto mapperCode = new_cart->mapper_code(); @@ -228,20 +228,18 @@ public: if (mapper == NULL) { fprintf(stderr, "Could not find mapper for code: %u\n", mapperCode); - return NULL; + exit(-1); } // Assigning backwards pointers to cartdrige and emulator now mapper->cart_ = new_cart; mapper->emu_ = this; - RETURN_ERR( ppu.open_chr( new_cart->chr(), new_cart->chr_size() ) ); + ppu.open_chr( new_cart->chr(), new_cart->chr_size() ); cart = new_cart; memset( impl->unmapped_page, unmapped_fill, sizeof impl->unmapped_page ); reset( true, true ); - - return 0; } size_t getLiteStateSize() const @@ -689,7 +687,7 @@ private: inline nes_time_t earliest_irq( nes_time_t present ) { - return min( impl->apu.earliest_irq( present ), mapper->next_irq( present ) ); + return std::min( impl->apu.earliest_irq( present ), mapper->next_irq( present ) ); } inline nes_time_t ppu_frame_length( nes_time_t present ) @@ -710,13 +708,13 @@ private: // DMC if ( wait_states_enabled ) - t = min( t, impl->apu.next_dmc_read_time() + 1 ); + t = std::min( t, impl->apu.next_dmc_read_time() + 1 ); // NMI - t = min( t, ppu.nmi_time() ); + t = std::min( t, ppu.nmi_time() ); if ( single_instruction_mode ) - t = min( t, present + 1 ); + t = std::min( t, present + 1 ); return t; } diff --git a/source/quickerNES/Nes_Effects_Buffer.cpp b/source/quickerNES/Nes_Effects_Buffer.cpp index 169eb3e..9f823c8 100644 --- a/source/quickerNES/Nes_Effects_Buffer.cpp +++ b/source/quickerNES/Nes_Effects_Buffer.cpp @@ -2,7 +2,6 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/libs/ #include "Nes_Effects_Buffer.h" - #include "Nes_Apu.h" /* Copyright (C) 2004-2006 Shay Green. This module is free software; you @@ -16,8 +15,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - Nes_Effects_Buffer::Nes_Effects_Buffer() : Effects_Buffer( true ) // nes never uses stereo channels { diff --git a/source/quickerNES/Nes_Emu.cpp b/source/quickerNES/Nes_Emu.cpp index 170f6eb..891e797 100644 --- a/source/quickerNES/Nes_Emu.cpp +++ b/source/quickerNES/Nes_Emu.cpp @@ -1,11 +1,9 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/ -#include "Nes_Emu.h" - -#include #include #include "Nes_Mapper.h" +#include "Nes_Emu.h" /* 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 @@ -18,8 +16,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - int const sound_fade_size = 384; // Constants are manually duplicated in Nes_Emu so their value can be seen @@ -70,12 +66,13 @@ inline const char * Nes_Emu::auto_init() { if ( !init_called ) { - RETURN_ERR( init_() ); + init_(); init_called = true; } return 0; } + inline void Nes_Emu::clear_sound_buf() { fade_sound_out = false; @@ -83,19 +80,16 @@ inline void Nes_Emu::clear_sound_buf() sound_buf->clear(); } -const char * Nes_Emu::set_cart( Nes_Cart const* new_cart ) +void Nes_Emu::set_cart( Nes_Cart const* new_cart ) { - RETURN_ERR( auto_init() ); - RETURN_ERR( emu.open( new_cart ) ); + auto_init(); + emu.open( new_cart ); channel_count_ = Nes_Apu::osc_count + emu.mapper->channel_count(); - RETURN_ERR( sound_buf->set_channel_count( channel_count() ) ); + sound_buf->set_channel_count( channel_count() ); set_equalizer( equalizer_ ); enable_sound( true ); - reset(); - - return 0; } void Nes_Emu::reset( bool full_reset, bool erase_battery_ram ) @@ -175,10 +169,10 @@ const char * Nes_Emu::emulate_frame( int joypad1, int joypad2 ) // Extras -const char * Nes_Emu::load_ines( const uint8_t* buffer ) +void Nes_Emu::load_ines( const uint8_t* buffer ) { private_cart.load_ines( buffer ); - return set_cart( &private_cart ); + set_cart( &private_cart ); } void Nes_Emu::write_chr( void const* p, long count, long offset ) @@ -191,14 +185,14 @@ void Nes_Emu::write_chr( void const* p, long count, long offset ) const char * Nes_Emu::set_sample_rate( long rate, class Nes_Buffer* buf ) { extern Multi_Buffer* set_apu( class Nes_Buffer*, Nes_Apu* ); - RETURN_ERR( auto_init() ); + auto_init(); return set_sample_rate( rate, set_apu( buf, &emu.impl->apu ) ); } const char * Nes_Emu::set_sample_rate( long rate, class Nes_Effects_Buffer* buf ) { extern Multi_Buffer* set_apu( class Nes_Effects_Buffer*, Nes_Apu* ); - RETURN_ERR( auto_init() ); + auto_init(); return set_sample_rate( rate, set_apu( buf, &emu.impl->apu ) ); } @@ -211,9 +205,9 @@ void Nes_Emu::set_frame_rate( double rate ) const char * Nes_Emu::set_sample_rate( long rate, Multi_Buffer* new_buf ) { - RETURN_ERR( auto_init() ); + auto_init(); emu.impl->apu.volume( 1.0 ); // cancel any previous non-linearity - RETURN_ERR( new_buf->set_sample_rate( rate, 1200 / frame_rate ) ); + new_buf->set_sample_rate( rate, 1200 / frame_rate ); sound_buf = new_buf; sound_buf_changed_count = 0; if ( new_buf != default_sound_buf ) diff --git a/source/quickerNES/Nes_Emu.h b/source/quickerNES/Nes_Emu.h index 0b6ea1b..03cdaba 100644 --- a/source/quickerNES/Nes_Emu.h +++ b/source/quickerNES/Nes_Emu.h @@ -20,7 +20,7 @@ public: // Basic setup // Load iNES file into emulator and clear recording - const char * load_ines( const uint8_t* buffer ); + void load_ines( const uint8_t* buffer ); // Set sample rate for sound generation const char * set_sample_rate( long ); @@ -88,7 +88,7 @@ public: // Use already-loaded cartridge. Retains pointer, so it must be kept around until // closed. A cartridge can be shared among multiple emulators. After opening, // cartridge's CHR data shouldn't be modified since a copy is cached internally. - const char * set_cart( Nes_Cart const* ); + void set_cart( Nes_Cart const* ); // Pointer to current cartridge, or NULL if none is loaded Nes_Cart const* cart() const { return emu.cart; } diff --git a/source/quickerNES/Nes_Fme7_Apu.cpp b/source/quickerNES/Nes_Fme7_Apu.cpp index 1451d9a..43d5798 100644 --- a/source/quickerNES/Nes_Fme7_Apu.cpp +++ b/source/quickerNES/Nes_Fme7_Apu.cpp @@ -16,8 +16,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - void Nes_Fme7_Apu::reset() { last_time = 0; diff --git a/source/quickerNES/Nes_Mapper.cpp b/source/quickerNES/Nes_Mapper.cpp index 1f28bf7..675a73e 100644 --- a/source/quickerNES/Nes_Mapper.cpp +++ b/source/quickerNES/Nes_Mapper.cpp @@ -1,8 +1,8 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/ +#include #include "Nes_Mapper.h" -#include #include "Nes_Core.h" /* Copyright (C) 2004-2006 Shay Green. This module is free software; you @@ -16,8 +16,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - Nes_Mapper::Nes_Mapper() { emu_ = NULL; diff --git a/source/quickerNES/Nes_Namco_Apu.cpp b/source/quickerNES/Nes_Namco_Apu.cpp index 9839f1e..c58d549 100644 --- a/source/quickerNES/Nes_Namco_Apu.cpp +++ b/source/quickerNES/Nes_Namco_Apu.cpp @@ -14,8 +14,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - Nes_Namco_Apu::Nes_Namco_Apu() { output( NULL ); diff --git a/source/quickerNES/Nes_Oscs.cpp b/source/quickerNES/Nes_Oscs.cpp index 1d2629f..8f1171d 100644 --- a/source/quickerNES/Nes_Oscs.cpp +++ b/source/quickerNES/Nes_Oscs.cpp @@ -14,12 +14,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - -#ifdef BLARGG_ENABLE_OPTIMIZER - #include BLARGG_ENABLE_OPTIMIZER -#endif - // Nes_Osc void Nes_Osc::clock_length( int halt_mask ) diff --git a/source/quickerNES/Nes_Ppu.cpp b/source/quickerNES/Nes_Ppu.cpp index 8bf25ad..c354424 100644 --- a/source/quickerNES/Nes_Ppu.cpp +++ b/source/quickerNES/Nes_Ppu.cpp @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // to do: remove unnecessary run_until() calls -#include "blargg_source.h" - // Timing ppu_time_t const scanline_len = Nes_Ppu::scanline_len; @@ -271,7 +269,7 @@ void Nes_Ppu::update_sprite_hit( nes_time_t cpu_time ) if ( count_needed > 240 ) count_needed = 240; while ( scanline_count < count_needed ) - render_bg_until( max( cpu_time, next_bg_time + 1 ) ); + render_bg_until( std::max( cpu_time, next_bg_time + 1 ) ); if ( sprite_hit_found < 0 ) return; // sprite won't hit diff --git a/source/quickerNES/Nes_Ppu_Impl.cpp b/source/quickerNES/Nes_Ppu_Impl.cpp index a4a233a..b98eb0b 100644 --- a/source/quickerNES/Nes_Ppu_Impl.cpp +++ b/source/quickerNES/Nes_Ppu_Impl.cpp @@ -19,8 +19,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - int const cache_line_size = 128; // tile cache is kept aligned to this boundary Nes_Ppu_Impl::Nes_Ppu_Impl() diff --git a/source/quickerNES/Nes_Ppu_Rendering.cpp b/source/quickerNES/Nes_Ppu_Rendering.cpp index ef69d32..32d1fff 100644 --- a/source/quickerNES/Nes_Ppu_Rendering.cpp +++ b/source/quickerNES/Nes_Ppu_Rendering.cpp @@ -2,9 +2,9 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/ #include "Nes_Ppu_Rendering.h" - -#include -#include +#include +#include +#include /* 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 @@ -17,20 +17,10 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - -#ifdef BLARGG_ENABLE_OPTIMIZER - #include BLARGG_ENABLE_OPTIMIZER -#endif - -#ifdef __MWERKS__ - static unsigned zero = 0; // helps CodeWarrior optimizer when added to constants -#else - const unsigned zero = 0; // compile-time constant on other compilers -#endif - // Nes_Ppu_Impl +static unsigned zero = 0; // helps CodeWarrior optimizer when added to constants + inline Nes_Ppu_Impl::cached_tile_t const& Nes_Ppu_Impl::get_sprite_tile( uint8_t const* sprite ) { @@ -509,8 +499,8 @@ void Nes_Ppu_Rendering::draw_background( int start, int count ) { // not rendering, but still handle sprite hit using mini graphics buffer int y = spr_ram [0] + 1; - int skip = min( count, max( y - start, 0 ) ); - int visible = min( count - skip, sprite_height() ); + int skip = std::min( count, std::max( y - start, 0 ) ); + int visible = std::min( count - skip, sprite_height() ); if ( visible > 0 ) { diff --git a/source/quickerNES/Nes_Vrc6_Apu.cpp b/source/quickerNES/Nes_Vrc6_Apu.cpp index a25038e..6e49795 100644 --- a/source/quickerNES/Nes_Vrc6_Apu.cpp +++ b/source/quickerNES/Nes_Vrc6_Apu.cpp @@ -14,8 +14,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - Nes_Vrc6_Apu::Nes_Vrc6_Apu() { output( NULL ); diff --git a/source/quickerNES/blargg_source.h b/source/quickerNES/blargg_source.h deleted file mode 100644 index 5176042..0000000 --- a/source/quickerNES/blargg_source.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Included at the beginning of library source files, AFTER all other #include -lines. Sets up helpful macros and services used in my source code. Since this -is only "active" in my source code, I don't have to worry about polluting the -global namespace with unprefixed names. */ - -// File_Extractor 1.0.0 -#ifndef BLARGG_SOURCE_H -#define BLARGG_SOURCE_H - -#ifndef BLARGG_COMMON_H // optimization only - #include "blargg_common.h" -#endif - -#include /* memcpy(), memset(), memmove() */ -#include /* offsetof() */ - -/* If expr yields non-NULL error string, returns it from current function, -otherwise continues normally. */ -#undef RETURN_ERR -#define RETURN_ERR( expr ) \ - do {\ - const char *blargg_return_err_ = (expr);\ - if ( blargg_return_err_ )\ - return blargg_return_err_;\ - } while ( 0 ) - -template T min( T x, T y ) { return x < y ? x : y; } -template T max( T x, T y ) { return x > y ? x : y; } - -#endif diff --git a/source/quickerNES/mappers/mapper000.hpp b/source/quickerNES/mappers/mapper000.hpp index a7aa280..b288063 100644 --- a/source/quickerNES/mappers/mapper000.hpp +++ b/source/quickerNES/mappers/mapper000.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // NROM class Mapper000 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper001.hpp b/source/quickerNES/mappers/mapper001.hpp index d5aa0d2..61fe1ac 100644 --- a/source/quickerNES/mappers/mapper001.hpp +++ b/source/quickerNES/mappers/mapper001.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // MMC1 struct mmc1_state_t diff --git a/source/quickerNES/mappers/mapper002.hpp b/source/quickerNES/mappers/mapper002.hpp index 97888b4..517fb73 100644 --- a/source/quickerNES/mappers/mapper002.hpp +++ b/source/quickerNES/mappers/mapper002.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // UNROM class Mapper002 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper003.hpp b/source/quickerNES/mappers/mapper003.hpp index 7a77c8f..8a31e5d 100644 --- a/source/quickerNES/mappers/mapper003.hpp +++ b/source/quickerNES/mappers/mapper003.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // CNROM class Mapper003 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper004.hpp b/source/quickerNES/mappers/mapper004.hpp index d0309f2..f822df9 100644 --- a/source/quickerNES/mappers/mapper004.hpp +++ b/source/quickerNES/mappers/mapper004.hpp @@ -18,8 +18,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // 264 or less breaks Gargoyle's Quest II // 267 or less breaks Magician int const irq_fine_tune = 268; diff --git a/source/quickerNES/mappers/mapper005.hpp b/source/quickerNES/mappers/mapper005.hpp index 0724361..c657e1f 100644 --- a/source/quickerNES/mappers/mapper005.hpp +++ b/source/quickerNES/mappers/mapper005.hpp @@ -20,9 +20,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - - struct mmc5_state_t { enum { reg_count = 0x30 }; diff --git a/source/quickerNES/mappers/mapper007.hpp b/source/quickerNES/mappers/mapper007.hpp index f598235..96db2ac 100644 --- a/source/quickerNES/mappers/mapper007.hpp +++ b/source/quickerNES/mappers/mapper007.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // AOROM class Mapper007 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper009.hpp b/source/quickerNES/mappers/mapper009.hpp index 84ccf51..92517bc 100644 --- a/source/quickerNES/mappers/mapper009.hpp +++ b/source/quickerNES/mappers/mapper009.hpp @@ -1,9 +1,7 @@ #pragma once #include - #include "Nes_Mapper.h" -#include "blargg_source.h" // MMC2 diff --git a/source/quickerNES/mappers/mapper010.hpp b/source/quickerNES/mappers/mapper010.hpp index 186cc5c..f77baed 100644 --- a/source/quickerNES/mappers/mapper010.hpp +++ b/source/quickerNES/mappers/mapper010.hpp @@ -1,8 +1,6 @@ #pragma once #include - #include "Nes_Mapper.h" -#include "blargg_source.h" // MMC4 diff --git a/source/quickerNES/mappers/mapper011.hpp b/source/quickerNES/mappers/mapper011.hpp index fd03ccf..9232c2e 100644 --- a/source/quickerNES/mappers/mapper011.hpp +++ b/source/quickerNES/mappers/mapper011.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // Color Dreams class Mapper011 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper019.hpp b/source/quickerNES/mappers/mapper019.hpp index 44d4106..967590a 100644 --- a/source/quickerNES/mappers/mapper019.hpp +++ b/source/quickerNES/mappers/mapper019.hpp @@ -20,8 +20,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // to do: CHR mapping and nametable handling needs work struct namco106_state_t diff --git a/source/quickerNES/mappers/mapper024.hpp b/source/quickerNES/mappers/mapper024.hpp index f91bcde..872dee9 100644 --- a/source/quickerNES/mappers/mapper024.hpp +++ b/source/quickerNES/mappers/mapper024.hpp @@ -20,8 +20,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - struct vrc6_state_t { // written registers diff --git a/source/quickerNES/mappers/mapper034.hpp b/source/quickerNES/mappers/mapper034.hpp index 7cc6d81..1f5da44 100644 --- a/source/quickerNES/mappers/mapper034.hpp +++ b/source/quickerNES/mappers/mapper034.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // Nina-1 (Deadly Towers only) class Mapper034 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper066.hpp b/source/quickerNES/mappers/mapper066.hpp index 75ca737..3b4a7d0 100644 --- a/source/quickerNES/mappers/mapper066.hpp +++ b/source/quickerNES/mappers/mapper066.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // GNROM class Mapper066 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper069.hpp b/source/quickerNES/mappers/mapper069.hpp index df8304f..59dc6cc 100644 --- a/source/quickerNES/mappers/mapper069.hpp +++ b/source/quickerNES/mappers/mapper069.hpp @@ -21,8 +21,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - struct fme7_state_t { // first 16 bytes in register order @@ -43,8 +41,6 @@ struct fme7_state_t }; BOOST_STATIC_ASSERT( sizeof (fme7_state_t) == 18 + sizeof (fme7_apu_state_t) ); - - // Fme7 class Mapper069 : public Nes_Mapper, fme7_state_t { diff --git a/source/quickerNES/mappers/mapper071.hpp b/source/quickerNES/mappers/mapper071.hpp index 17b09de..5bd7f5c 100644 --- a/source/quickerNES/mappers/mapper071.hpp +++ b/source/quickerNES/mappers/mapper071.hpp @@ -17,8 +17,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // Camerica class Mapper071 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper087.hpp b/source/quickerNES/mappers/mapper087.hpp index 314580e..00a9d93 100644 --- a/source/quickerNES/mappers/mapper087.hpp +++ b/source/quickerNES/mappers/mapper087.hpp @@ -18,8 +18,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // Jaleco/Konami/Taito class Mapper087 : public Nes_Mapper { diff --git a/source/quickerNES/mappers/mapper232.hpp b/source/quickerNES/mappers/mapper232.hpp index d8e52e2..cdf554b 100644 --- a/source/quickerNES/mappers/mapper232.hpp +++ b/source/quickerNES/mappers/mapper232.hpp @@ -18,8 +18,6 @@ more details. You should have received a copy of the GNU Lesser General Public License along with this module; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "blargg_source.h" - // Quattro class Mapper232 : public Nes_Mapper { diff --git a/source/quickerNES/quickerNESInstance.hpp b/source/quickerNES/quickerNESInstance.hpp index 4adeebc..fa789fb 100644 --- a/source/quickerNES/quickerNESInstance.hpp +++ b/source/quickerNES/quickerNESInstance.hpp @@ -24,8 +24,8 @@ class QuickerNESInstance : public EmuInstance virtual bool loadROMFileImpl(const std::string& romData) override { // Loading rom data - auto result = _nes->load_ines((uint8_t*)romData.data()); - return result == 0; + _nes->load_ines((uint8_t*)romData.data()); + return true; } uint8_t* getLowMem() const override { return _nes->low_mem(); };