diff --git a/src/common/tv_filters/AtariNTSC.cxx b/src/common/tv_filters/AtariNTSC.cxx index aab7c3adc..e2d203485 100644 --- a/src/common/tv_filters/AtariNTSC.cxx +++ b/src/common/tv_filters/AtariNTSC.cxx @@ -100,8 +100,9 @@ void AtariNTSC::enableThreading(bool enable) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void AtariNTSC::render(const uInt8* atari_in, const uInt32 in_width, const uInt32 in_height, - void* rgb_out, const uInt32 out_pitch, uInt32* rgb_in) +void AtariNTSC::render(const uInt8* atari_in, const uInt32 in_width, + const uInt32 in_height, void* rgb_out, + const uInt32 out_pitch, uInt32* rgb_in) { // Spawn the threads... for(uInt32 i = 0; i < myWorkerThreads; ++i) @@ -520,28 +521,9 @@ void AtariNTSC::genKernel(init_t& impl, float y, float i, float q, uInt32* out) while ( --burst_remain ); } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const AtariNTSC::Setup AtariNTSC::TV_Composite = { - 0.0F, 0.15F, 0.0F, 0.0F, 0.0F -}; -const AtariNTSC::Setup AtariNTSC::TV_SVideo = { - 0.0F, 0.45F, -1.0F, -1.0F, 0.0F -}; -const AtariNTSC::Setup AtariNTSC::TV_RGB = { - 0.2F, 0.70F, -1.0F, -1.0F, -1.0F -}; -const AtariNTSC::Setup AtariNTSC::TV_Bad = { - 0.2F, 0.1F, 0.5F, 0.5F, 0.5F -}; - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const std::array AtariNTSC::atari_ntsc_pixels = { { { PIXEL_OFFSET1(-4, -9), PIXEL_OFFSET2(-4), { 1, 1, 1, 1 } }, { PIXEL_OFFSET1( 0, -5), PIXEL_OFFSET2( 0), { 1, 1, 1, 1 } } } }; - -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const std::array AtariNTSC::default_decoder = { - 0.9563F, 0.6210F, -0.2721F, -0.6474F, -1.1070F, 1.7046F -}; diff --git a/src/common/tv_filters/AtariNTSC.hxx b/src/common/tv_filters/AtariNTSC.hxx index b617c64b4..14828d139 100644 --- a/src/common/tv_filters/AtariNTSC.hxx +++ b/src/common/tv_filters/AtariNTSC.hxx @@ -67,10 +67,18 @@ class AtariNTSC }; // Video format presets - static const Setup TV_Composite; // color bleeding + artifacts - static const Setup TV_SVideo; // color bleeding only - static const Setup TV_RGB; // crisp image - static const Setup TV_Bad; // badly adjusted TV + static constexpr Setup TV_Composite = { // color bleeding + artifacts + 0.0F, 0.15F, 0.0F, 0.0F, 0.0F + }; + static constexpr Setup TV_SVideo = { // color bleeding only + 0.0F, 0.45F, -1.0F, -1.0F, 0.0F + }; + static constexpr Setup TV_RGB = { // crisp image + 0.2F, 0.70F, -1.0F, -1.0F, -1.0F + }; + static constexpr Setup TV_Bad = { // badly adjusted TV + 0.2F, 0.1F, 0.5F, 0.5F, 0.5F + }; // Initializes and adjusts parameters // Note that this must be called before setting a palette @@ -175,7 +183,9 @@ class AtariNTSC }; static const std::array atari_ntsc_pixels; - static const std::array default_decoder; + static constexpr std::array default_decoder = { + 0.9563F, 0.6210F, -0.2721F, -0.6474F, -1.1070F, 1.7046F + }; void init(init_t& impl, const Setup& setup); void initFilters(init_t& impl, const Setup& setup); @@ -242,7 +252,7 @@ class AtariNTSC (rescale_out - (((scaled) + rescale_out * 10) % rescale_out)) % rescale_out + (kernel_size * 2 * (((scaled) + rescale_out * 10) % rescale_out))); } - static constexpr int PIXEL_OFFSET2( int ntsc ) { + static constexpr float PIXEL_OFFSET2( int ntsc ) { return 1.0F - (((ntsc) + 100) & 2); } diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index bef8ce200..abdcbf4e7 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -339,7 +339,7 @@ bool CartDebug::disassemble(int bank, uInt16 PC, Disassembly& disassembly, // If the offset has changed, all old addresses must be 'converted' // For example, if the list contains any $fxxx and the address space is now // $bxxx, it must be changed - const uInt16 offset = PC & 0x1000 ? myConsole.cartridge().bankOrigin(bank, PC) : 0; + const uInt16 offset = (PC & 0x1000) ? myConsole.cartridge().bankOrigin(bank, PC) : 0; AddressList& addresses = info.addressList; for(auto& i: addresses) i = (i & 0xFFF) + offset;