More refactoring
This commit is contained in:
parent
b970262005
commit
094ab435db
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "apu/apu.h"
|
#include "apu/apu.h"
|
||||||
#include "Nes_Cpu.h"
|
#include "Nes_Cpu.h"
|
||||||
#include "Nes_Ppu.h"
|
#include "ppu/Nes_Ppu.h"
|
||||||
#include "mappers/mapper.h"
|
#include "mappers/mapper.h"
|
||||||
|
|
||||||
class Nes_Cart;
|
class Nes_Cart;
|
||||||
|
@ -79,7 +79,6 @@ public:
|
||||||
memset( &joypad, 0, sizeof joypad );
|
memset( &joypad, 0, sizeof joypad );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
~Nes_Core()
|
~Nes_Core()
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -114,14 +114,16 @@ case op + 0x08: /* abs */ \
|
||||||
case op + 0x00: /* zp */ \
|
case op + 0x00: /* zp */ \
|
||||||
imm##op: \
|
imm##op: \
|
||||||
|
|
||||||
|
// Adding likely to fail because typically for loops exit conditions fail until the last one
|
||||||
#define BRANCH( cond ) \
|
#define BRANCH( cond ) \
|
||||||
{ \
|
{ \
|
||||||
pc++; \
|
pc++; \
|
||||||
int offset = (int8_t) data; \
|
int offset = (int8_t) data; \
|
||||||
if ( !(cond) ) {clock_count--; goto loop; } \
|
int extra_clock = (pc & 0xFF) + offset; \
|
||||||
|
if ( !(cond) ) [[likely]] {clock_count--; goto loop; } \
|
||||||
pc += offset; \
|
pc += offset; \
|
||||||
pc = uint16_t( pc ); \
|
pc = uint16_t( pc ); \
|
||||||
clock_count += (((pc & 0xFF) + offset) >> 8) & 1; \
|
clock_count += (extra_clock >> 8) & 1; \
|
||||||
goto loop; \
|
goto loop; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# quickerNES Core sources
|
# quickerNES Core sources
|
||||||
|
|
||||||
quickerNESAudioSrc = [
|
quickerNESAPUSrc = [
|
||||||
'apu/apu.cpp',
|
'apu/apu.cpp',
|
||||||
'apu/Nes_Oscs.cpp',
|
'apu/Nes_Oscs.cpp',
|
||||||
'apu/Nes_Buffer.cpp',
|
'apu/Nes_Buffer.cpp',
|
||||||
|
@ -16,11 +16,14 @@ quickerNESAudioSrc = [
|
||||||
'apu/fme7/apu.cpp',
|
'apu/fme7/apu.cpp',
|
||||||
]
|
]
|
||||||
|
|
||||||
quickerNESSrc = quickerNESAudioSrc + [
|
quickerNESPPUSrc = [
|
||||||
|
'ppu/Nes_Ppu.cpp',
|
||||||
|
'ppu/Nes_Ppu_Impl.cpp',
|
||||||
|
'ppu/Nes_Ppu_Rendering.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
quickerNESSrc = quickerNESAPUSrc + quickerNESPPUSrc + [
|
||||||
'mappers/mapper.cpp',
|
'mappers/mapper.cpp',
|
||||||
'Nes_Ppu.cpp',
|
|
||||||
'Nes_Ppu_Impl.cpp',
|
|
||||||
'Nes_Ppu_Rendering.cpp',
|
|
||||||
'Nes_Emu.cpp',
|
'Nes_Emu.cpp',
|
||||||
'Nes_Cpu.cpp'
|
'Nes_Cpu.cpp'
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue