Fixes for a few minor warnings from cppcheck.

This commit is contained in:
Stephen Anthony 2022-05-08 17:50:16 -02:30
parent 928de47898
commit c0ab3580c3
3 changed files with 20 additions and 28 deletions

View File

@ -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::pixel_info_t, AtariNTSC::alignment_count>
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<float, 6> AtariNTSC::default_decoder = {
0.9563F, 0.6210F, -0.2721F, -0.6474F, -1.1070F, 1.7046F
};

View File

@ -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<pixel_info_t, alignment_count> atari_ntsc_pixels;
static const std::array<float, 6> default_decoder;
static constexpr std::array<float, 6> 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);
}

View File

@ -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;