diff --git a/source/quickNES/meson.build b/source/quickNES/meson.build index 825d176..4fc3e6e 100644 --- a/source/quickNES/meson.build +++ b/source/quickNES/meson.build @@ -65,8 +65,7 @@ quickNESSrc = [ 'QuickNES_Core/nes_emu/Mapper_TaitoTC0190.cpp', 'QuickNES_Core/nes_emu/Mapper_Un1rom.cpp', 'QuickNES_Core/nes_emu/nes_ntsc.cpp', - 'Mapper_70.cpp', - 'quickNESInstance.hpp' + 'Mapper_70.cpp' ] # quickNES Core Configuration diff --git a/source/quickerNES/Nes_Core.h b/source/quickerNES/Nes_Core.h index 122344d..ea8354b 100644 --- a/source/quickerNES/Nes_Core.h +++ b/source/quickerNES/Nes_Core.h @@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "blargg_common.h" -#include "Nes_Apu.h" +#include "audio/apu.h" #include "Nes_Cpu.h" #include "Nes_Ppu.h" #include "Nes_Mapper.h" diff --git a/source/quickerNES/Nes_Emu.h b/source/quickerNES/Nes_Emu.h index 03cdaba..eb52dc6 100644 --- a/source/quickerNES/Nes_Emu.h +++ b/source/quickerNES/Nes_Emu.h @@ -7,9 +7,10 @@ #define NES_EMU_H #include "blargg_common.h" -#include "Multi_Buffer.h" +#include "audio/Multi_Buffer.h" #include "Nes_Cart.h" #include "Nes_Core.h" + class Nes_State; class Nes_Emu { diff --git a/source/quickerNES/Blip_Buffer.cpp b/source/quickerNES/audio/Blip_Buffer.cpp similarity index 100% rename from source/quickerNES/Blip_Buffer.cpp rename to source/quickerNES/audio/Blip_Buffer.cpp diff --git a/source/quickerNES/Blip_Buffer.h b/source/quickerNES/audio/Blip_Buffer.h similarity index 100% rename from source/quickerNES/Blip_Buffer.h rename to source/quickerNES/audio/Blip_Buffer.h diff --git a/source/quickerNES/Effects_Buffer.cpp b/source/quickerNES/audio/Effects_Buffer.cpp similarity index 100% rename from source/quickerNES/Effects_Buffer.cpp rename to source/quickerNES/audio/Effects_Buffer.cpp diff --git a/source/quickerNES/Effects_Buffer.h b/source/quickerNES/audio/Effects_Buffer.h similarity index 100% rename from source/quickerNES/Effects_Buffer.h rename to source/quickerNES/audio/Effects_Buffer.h diff --git a/source/quickerNES/Multi_Buffer.cpp b/source/quickerNES/audio/Multi_Buffer.cpp similarity index 100% rename from source/quickerNES/Multi_Buffer.cpp rename to source/quickerNES/audio/Multi_Buffer.cpp diff --git a/source/quickerNES/Multi_Buffer.h b/source/quickerNES/audio/Multi_Buffer.h similarity index 100% rename from source/quickerNES/Multi_Buffer.h rename to source/quickerNES/audio/Multi_Buffer.h diff --git a/source/quickerNES/Nes_Buffer.cpp b/source/quickerNES/audio/Nes_Buffer.cpp similarity index 98% rename from source/quickerNES/Nes_Buffer.cpp rename to source/quickerNES/audio/Nes_Buffer.cpp index 66285c3..e17ddee 100644 --- a/source/quickerNES/Nes_Buffer.cpp +++ b/source/quickerNES/audio/Nes_Buffer.cpp @@ -1,7 +1,7 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/libs/ -#include "Nes_Buffer.h" -#include "Nes_Apu.h" +#include "audio/Nes_Buffer.h" +#include "audio/apu.h" /* Library Copyright (C) 2003-2006 Shay Green. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser diff --git a/source/quickerNES/Nes_Buffer.h b/source/quickerNES/audio/Nes_Buffer.h similarity index 100% rename from source/quickerNES/Nes_Buffer.h rename to source/quickerNES/audio/Nes_Buffer.h diff --git a/source/quickerNES/Nes_Effects_Buffer.cpp b/source/quickerNES/audio/Nes_Effects_Buffer.cpp similarity index 97% rename from source/quickerNES/Nes_Effects_Buffer.cpp rename to source/quickerNES/audio/Nes_Effects_Buffer.cpp index 9f823c8..d339daf 100644 --- a/source/quickerNES/Nes_Effects_Buffer.cpp +++ b/source/quickerNES/audio/Nes_Effects_Buffer.cpp @@ -1,8 +1,8 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/libs/ -#include "Nes_Effects_Buffer.h" -#include "Nes_Apu.h" +#include "audio/Nes_Effects_Buffer.h" +#include "audio/apu.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 diff --git a/source/quickerNES/Nes_Effects_Buffer.h b/source/quickerNES/audio/Nes_Effects_Buffer.h similarity index 100% rename from source/quickerNES/Nes_Effects_Buffer.h rename to source/quickerNES/audio/Nes_Effects_Buffer.h diff --git a/source/quickerNES/Nes_Oscs.cpp b/source/quickerNES/audio/Nes_Oscs.cpp similarity index 99% rename from source/quickerNES/Nes_Oscs.cpp rename to source/quickerNES/audio/Nes_Oscs.cpp index 8f1171d..485fad6 100644 --- a/source/quickerNES/Nes_Oscs.cpp +++ b/source/quickerNES/audio/Nes_Oscs.cpp @@ -1,7 +1,7 @@ // Nes_Snd_Emu 0.1.7. http://www.slack.net/~ant/ -#include "Nes_Apu.h" +#include "apu.h" /* 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 diff --git a/source/quickerNES/Nes_Oscs.h b/source/quickerNES/audio/Nes_Oscs.h similarity index 100% rename from source/quickerNES/Nes_Oscs.h rename to source/quickerNES/audio/Nes_Oscs.h diff --git a/source/quickerNES/Nes_Apu.cpp b/source/quickerNES/audio/apu.cpp similarity index 99% rename from source/quickerNES/Nes_Apu.cpp rename to source/quickerNES/audio/apu.cpp index dd0f8c7..f1ac56f 100644 --- a/source/quickerNES/Nes_Apu.cpp +++ b/source/quickerNES/audio/apu.cpp @@ -1,7 +1,7 @@ // Nes_Snd_Emu 0.1.7. http://www.slack.net/~ant/ -#include "Nes_Apu.h" +#include "apu.h" /* 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 diff --git a/source/quickerNES/Nes_Apu.h b/source/quickerNES/audio/apu.h similarity index 100% rename from source/quickerNES/Nes_Apu.h rename to source/quickerNES/audio/apu.h diff --git a/source/quickerNES/Nes_Fme7_Apu.cpp b/source/quickerNES/audio/fme7/apu.cpp similarity index 98% rename from source/quickerNES/Nes_Fme7_Apu.cpp rename to source/quickerNES/audio/fme7/apu.cpp index 43d5798..7480677 100644 --- a/source/quickerNES/Nes_Fme7_Apu.cpp +++ b/source/quickerNES/audio/fme7/apu.cpp @@ -1,9 +1,8 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/ -#include "Nes_Fme7_Apu.h" - -#include +#include "audio/fme7/apu.h" +#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 diff --git a/source/quickerNES/Nes_Fme7_Apu.h b/source/quickerNES/audio/fme7/apu.h similarity index 96% rename from source/quickerNES/Nes_Fme7_Apu.h rename to source/quickerNES/audio/fme7/apu.h index 49e5a37..28a26bc 100644 --- a/source/quickerNES/Nes_Fme7_Apu.h +++ b/source/quickerNES/audio/fme7/apu.h @@ -1,14 +1,11 @@ +#pragma once // Sunsoft FME-7 sound emulator - // Nes_Emu 0.7.0 -#ifndef NES_FME7_APU_H -#define NES_FME7_APU_H - -#include +#include #include "blargg_common.h" -#include "Blip_Buffer.h" +#include "audio/Blip_Buffer.h" struct fme7_apu_state_t { @@ -133,4 +130,3 @@ inline void Nes_Fme7_Apu::load_state( fme7_apu_state_t const& in ) run_until(last_time); } -#endif diff --git a/source/quickerNES/audio/meson.build b/source/quickerNES/audio/meson.build new file mode 100644 index 0000000..11ec518 --- /dev/null +++ b/source/quickerNES/audio/meson.build @@ -0,0 +1,17 @@ +# quickerNES Audio sources + +quickerNESAudioSrc = [ + 'audio/apu.cpp', + 'audio/Nes_Oscs.cpp', + 'audio/Nes_Buffer.cpp', + 'audio/Blip_Buffer.cpp', + 'audio/Effects_Buffer.cpp', + 'audio/Nes_Effects_Buffer.cpp', + 'audio/Multi_Buffer.cpp', + 'audio/namco/apu.cpp', + 'audio/vrc6/apu.cpp', + 'audio/vrc7/emu2413.cpp', + 'audio/vrc7/emu2413_state.cpp', + 'audio/vrc7/apu.cpp', + 'audio/fme7/apu.cpp', +] diff --git a/source/quickerNES/Nes_Namco_Apu.cpp b/source/quickerNES/audio/namco/apu.cpp similarity index 98% rename from source/quickerNES/Nes_Namco_Apu.cpp rename to source/quickerNES/audio/namco/apu.cpp index c58d549..f2a0b04 100644 --- a/source/quickerNES/Nes_Namco_Apu.cpp +++ b/source/quickerNES/audio/namco/apu.cpp @@ -1,7 +1,8 @@ // Nes_Snd_Emu 0.1.7. http://www.slack.net/~ant/ -#include "Nes_Namco_Apu.h" +#include "audio/Blip_Buffer.h" +#include "audio/namco/apu.h" /* 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 diff --git a/source/quickerNES/Nes_Namco_Apu.h b/source/quickerNES/audio/namco/apu.h similarity index 91% rename from source/quickerNES/Nes_Namco_Apu.h rename to source/quickerNES/audio/namco/apu.h index b84e54a..17636ca 100644 --- a/source/quickerNES/Nes_Namco_Apu.h +++ b/source/quickerNES/audio/namco/apu.h @@ -1,15 +1,20 @@ +#pragma once // Namco 106 sound chip emulator - // Nes_Snd_Emu 0.1.7 -#ifndef NES_NAMCO_APU_H -#define NES_NAMCO_APU_H +#include +#include "audio/apu.h" -#include -#include "Nes_Apu.h" - -struct namco_state_t; +struct namco_state_t +{ + uint8_t regs [0x80]; + uint8_t addr; + uint8_t unused; + uint8_t positions [8]; + uint32_t delays [8]; +}; +static_assert( sizeof (namco_state_t) == 172 ); class Nes_Namco_Apu { public: @@ -63,17 +68,6 @@ private: void run_until( nes_time_t ); }; -struct namco_state_t -{ - uint8_t regs [0x80]; - uint8_t addr; - uint8_t unused; - uint8_t positions [8]; - uint32_t delays [8]; -}; - -BOOST_STATIC_ASSERT( sizeof (namco_state_t) == 172 ); - inline uint8_t& Nes_Namco_Apu::access() { int addr = addr_reg & 0x7f; @@ -101,4 +95,3 @@ inline void Nes_Namco_Apu::write_data( nes_time_t time, int data ) access() = data; } -#endif diff --git a/source/quickerNES/Nes_Vrc6_Apu.cpp b/source/quickerNES/audio/vrc6/apu.cpp similarity index 99% rename from source/quickerNES/Nes_Vrc6_Apu.cpp rename to source/quickerNES/audio/vrc6/apu.cpp index 6e49795..3d9464a 100644 --- a/source/quickerNES/Nes_Vrc6_Apu.cpp +++ b/source/quickerNES/audio/vrc6/apu.cpp @@ -1,7 +1,7 @@ // Nes_Snd_Emu 0.1.7. http://www.slack.net/~ant/ -#include "Nes_Vrc6_Apu.h" +#include "audio/vrc6/apu.h" /* 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 diff --git a/source/quickerNES/Nes_Vrc6_Apu.h b/source/quickerNES/audio/vrc6/apu.h similarity index 94% rename from source/quickerNES/Nes_Vrc6_Apu.h rename to source/quickerNES/audio/vrc6/apu.h index f70f2d5..e110ad1 100644 --- a/source/quickerNES/Nes_Vrc6_Apu.h +++ b/source/quickerNES/audio/vrc6/apu.h @@ -1,15 +1,12 @@ +#pragma once + // Konami VRC6 sound chip emulator - // Nes_Snd_Emu 0.1.7 -#ifndef NES_VRC6_APU_H -#define NES_VRC6_APU_H - -#include - -#include "Nes_Apu.h" -#include "Blip_Buffer.h" +#include +#include "audio/apu.h" +#include "audio/Blip_Buffer.h" struct vrc6_apu_state_t; @@ -95,5 +92,3 @@ inline void Nes_Vrc6_Apu::treble_eq( blip_eq_t const& eq ) saw_synth.treble_eq( eq ); square_synth.treble_eq( eq ); } - -#endif diff --git a/source/quickerNES/Nes_Vrc7.cpp b/source/quickerNES/audio/vrc7/apu.cpp similarity index 97% rename from source/quickerNES/Nes_Vrc7.cpp rename to source/quickerNES/audio/vrc7/apu.cpp index 759310f..d9894ca 100644 --- a/source/quickerNES/Nes_Vrc7.cpp +++ b/source/quickerNES/audio/vrc7/apu.cpp @@ -1,7 +1,7 @@ #include "Nes_Mapper.h" -#include "Nes_Vrc7.h" -#include "emu2413.h" -#include +#include "audio/vrc7/apu.h" +#include "audio/vrc7/emu2413.h" +#include #define BYTESWAP(xxxx) {uint32_t _temp = (uint32_t)(xxxx);\ ((uint8_t*)&(xxxx))[0] = (uint8_t)((_temp) >> 24);\ diff --git a/source/quickerNES/Nes_Vrc7.h b/source/quickerNES/audio/vrc7/apu.h similarity index 93% rename from source/quickerNES/Nes_Vrc7.h rename to source/quickerNES/audio/vrc7/apu.h index a6b0813..27b5ed0 100644 --- a/source/quickerNES/Nes_Vrc7.h +++ b/source/quickerNES/audio/vrc7/apu.h @@ -1,13 +1,11 @@ +#pragma once + // Konami VRC7 sound chip emulator - // Nes_Snd_Emu 0.1.7. Copyright (C) 2003-2005 Shay Green. GNU LGPL license. -#ifndef NES_VRC7_H -#define NES_VRC7_H - -#include "emu2413_state.h" -#include "Blip_Buffer.h" +#include "audio/vrc7/emu2413_state.h" +#include "audio/Blip_Buffer.h" struct vrc7_snapshot_t; @@ -69,4 +67,3 @@ inline void Nes_Vrc7::osc_output( int i, Blip_Buffer* buf ) oscs [i].output = buf; } -#endif diff --git a/source/quickerNES/emu2413.cpp b/source/quickerNES/audio/vrc7/emu2413.cpp similarity index 100% rename from source/quickerNES/emu2413.cpp rename to source/quickerNES/audio/vrc7/emu2413.cpp diff --git a/source/quickerNES/emu2413.h b/source/quickerNES/audio/vrc7/emu2413.h similarity index 99% rename from source/quickerNES/emu2413.h rename to source/quickerNES/audio/vrc7/emu2413.h index 9ce9f88..657266a 100644 --- a/source/quickerNES/emu2413.h +++ b/source/quickerNES/audio/vrc7/emu2413.h @@ -1,5 +1,4 @@ -#ifndef EMU2413_H -#define EMU2413_H +#pragma once typedef signed int e_int; typedef unsigned int e_uint; @@ -215,4 +214,3 @@ EMU2413_API e_uint32 OPLL_toggleMask(OPLL *, e_uint32 mask) ; } #endif -#endif diff --git a/source/quickerNES/emu2413_state.cpp b/source/quickerNES/audio/vrc7/emu2413_state.cpp similarity index 100% rename from source/quickerNES/emu2413_state.cpp rename to source/quickerNES/audio/vrc7/emu2413_state.cpp diff --git a/source/quickerNES/emu2413_state.h b/source/quickerNES/audio/vrc7/emu2413_state.h similarity index 90% rename from source/quickerNES/emu2413_state.h rename to source/quickerNES/audio/vrc7/emu2413_state.h index bcafa79..6fd4338 100644 --- a/source/quickerNES/emu2413_state.h +++ b/source/quickerNES/audio/vrc7/emu2413_state.h @@ -1,5 +1,4 @@ -#ifndef EMU2413_STATE_H -#define EMU2413_STATE_H +#pragma once #include "emu2413.h" @@ -32,6 +31,4 @@ void OPLL_state_byteswap(OPLL_STATE *state); #ifdef __cplusplus } -#endif - #endif \ No newline at end of file diff --git a/source/quickerNES/mappers/mapper019.hpp b/source/quickerNES/mappers/mapper019.hpp index 967590a..1db8dd4 100644 --- a/source/quickerNES/mappers/mapper019.hpp +++ b/source/quickerNES/mappers/mapper019.hpp @@ -7,7 +7,7 @@ #include "Nes_Mapper.h" #include "blargg_endian.h" -#include "Nes_Namco_Apu.h" +#include "audio/namco/apu.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 diff --git a/source/quickerNES/mappers/mapper024.hpp b/source/quickerNES/mappers/mapper024.hpp index 872dee9..00f3f1f 100644 --- a/source/quickerNES/mappers/mapper024.hpp +++ b/source/quickerNES/mappers/mapper024.hpp @@ -6,7 +6,7 @@ #include "Nes_Mapper.h" #include -#include "Nes_Vrc6_Apu.h" +#include "audio/vrc6/apu.h" #include "blargg_endian.h" /* Copyright (C) 2004-2006 Shay Green. This module is free software; you diff --git a/source/quickerNES/mappers/mapper069.hpp b/source/quickerNES/mappers/mapper069.hpp index 59dc6cc..669c7b0 100644 --- a/source/quickerNES/mappers/mapper069.hpp +++ b/source/quickerNES/mappers/mapper069.hpp @@ -5,9 +5,8 @@ // Nes_Emu 0.7.0. http://www.slack.net/~ant/libs/ #include "Nes_Mapper.h" - #include "blargg_endian.h" -#include "Nes_Fme7_Apu.h" +#include "audio/fme7/apu.h" /* Copyright (C) 2005 Chris Moeller */ /* Copyright (C) 2005-2006 Shay Green. This module is free software; you diff --git a/source/quickerNES/mappers/mapper085.hpp b/source/quickerNES/mappers/mapper085.hpp index 392fb55..9fd70ab 100644 --- a/source/quickerNES/mappers/mapper085.hpp +++ b/source/quickerNES/mappers/mapper085.hpp @@ -1,11 +1,11 @@ +#pragma once + // Nes_Emu 0.5.4. http://www.slack.net/~ant/ #include "Nes_Mapper.h" -#include "Nes_Vrc7.h" +#include "audio/vrc7/apu.h" #include "blargg_endian.h" -#include - -#pragma once +#include /* Copyright (C) 2004-2005 Shay Green. This module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser diff --git a/source/quickerNES/meson.build b/source/quickerNES/meson.build index 23f6ca5..360dc3f 100644 --- a/source/quickerNES/meson.build +++ b/source/quickerNES/meson.build @@ -1,27 +1,15 @@ # quickerNES Core sources -quickerNESSrc = [ - 'Nes_Apu.cpp', - 'Nes_Oscs.cpp', - 'Nes_Buffer.cpp', - 'Nes_Fme7_Apu.cpp', +subdir('audio') + +quickerNESSrc = quickerNESAudioSrc + [ 'Nes_Ppu.cpp', - 'Blip_Buffer.cpp', 'Nes_Ppu_Impl.cpp', 'Nes_Ppu_Rendering.cpp', - 'Effects_Buffer.cpp', - 'emu2413.cpp', - 'emu2413_state.cpp', - 'Nes_Effects_Buffer.cpp', - 'Nes_Namco_Apu.cpp', - 'Nes_Vrc6_Apu.cpp', - 'Multi_Buffer.cpp', 'Nes_Emu.cpp', 'nes_ntsc.cpp', - 'Nes_Vrc7.cpp', 'Nes_Mapper.cpp', - 'Nes_Cpu.cpp', - 'quickerNESInstance.hpp' + 'Nes_Cpu.cpp' ] # quickerNES Core Configuration