More refactoring

This commit is contained in:
Sergio Martin 2024-01-19 21:24:50 +01:00
parent b970262005
commit 094ab435db
10 changed files with 13 additions and 9 deletions

View File

@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <string>
#include "apu/apu.h"
#include "Nes_Cpu.h"
#include "Nes_Ppu.h"
#include "ppu/Nes_Ppu.h"
#include "mappers/mapper.h"
class Nes_Cart;
@ -78,7 +78,6 @@ public:
memset( &nes, 0, sizeof nes );
memset( &joypad, 0, sizeof joypad );
}
~Nes_Core()
{

View File

@ -114,14 +114,16 @@ case op + 0x08: /* abs */ \
case op + 0x00: /* zp */ \
imm##op: \
// Adding likely to fail because typically for loops exit conditions fail until the last one
#define BRANCH( cond ) \
{ \
pc++; \
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 = uint16_t( pc ); \
clock_count += (((pc & 0xFF) + offset) >> 8) & 1; \
clock_count += (extra_clock >> 8) & 1; \
goto loop; \
}

View File

@ -1,6 +1,6 @@
# quickerNES Core sources
quickerNESAudioSrc = [
quickerNESAPUSrc = [
'apu/apu.cpp',
'apu/Nes_Oscs.cpp',
'apu/Nes_Buffer.cpp',
@ -16,11 +16,14 @@ quickerNESAudioSrc = [
'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',
'Nes_Ppu.cpp',
'Nes_Ppu_Impl.cpp',
'Nes_Ppu_Rendering.cpp',
'Nes_Emu.cpp',
'Nes_Cpu.cpp'
]