mirror of
https://github.com/NovaSquirrel/Mesen-X.git
synced 2024-05-16 11:10:56 -04:00
Color borders exclusive to NTSC machines
This commit is contained in:
parent
17e77e2df6
commit
a9a6d0b959
|
@ -56,11 +56,12 @@ void NtscFilter::OnBeforeApplyFilter()
|
|||
}
|
||||
|
||||
if (_console->GetModel() == NesModel::NTSC) {
|
||||
_ntsc_bg = _console->GetPpu()->GetCurrentBgColor();
|
||||
// BG color borders on NTSC machines
|
||||
_ntsc_border = _console->GetPpu()->GetCurrentBgColor();
|
||||
}
|
||||
else {
|
||||
// black borders on PAL machines
|
||||
_ntsc_bg = 15;
|
||||
// black borders on other machines
|
||||
_ntsc_border = 15;
|
||||
}
|
||||
|
||||
PictureSettings pictureSettings = _console->GetSettings()->GetPictureSettings();
|
||||
|
@ -131,7 +132,7 @@ void NtscFilter::OnBeforeApplyFilter()
|
|||
|
||||
void NtscFilter::ApplyFilter(uint16_t *ppuOutputBuffer)
|
||||
{
|
||||
nes_ntsc_blit(&_ntscData, ppuOutputBuffer, _ntsc_bg, PPU::ScreenWidth, IsOddFrame() ? 0 : 1, PPU::ScreenWidth, 240, _ntscBuffer, NES_NTSC_OUT_WIDTH(PPU::ScreenWidth)*4);
|
||||
nes_ntsc_blit(&_ntscData, ppuOutputBuffer, _ntsc_border, PPU::ScreenWidth, IsOddFrame() ? 0 : 1, PPU::ScreenWidth, 240, _ntscBuffer, NES_NTSC_OUT_WIDTH(PPU::ScreenWidth)*4);
|
||||
GenerateArgbFrame(_ntscBuffer);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ private:
|
|||
bool _useExternalPalette = true;
|
||||
uint8_t _palette[512 * 3];
|
||||
uint32_t* _ntscBuffer;
|
||||
uint16_t _ntsc_bg;
|
||||
uint16_t _ntsc_border;
|
||||
|
||||
void GenerateArgbFrame(uint32_t *outputBuffer);
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ void nes_ntsc_init( nes_ntsc_t* ntsc, nes_ntsc_setup_t const* setup )
|
|||
|
||||
#ifndef NES_NTSC_NO_BLITTERS
|
||||
|
||||
void nes_ntsc_blit( nes_ntsc_t const* ntsc, NES_NTSC_IN_T const* input, NES_NTSC_IN_T ntsc_bg, long in_row_width,
|
||||
void nes_ntsc_blit( nes_ntsc_t const* ntsc, NES_NTSC_IN_T const* input, NES_NTSC_IN_T ntsc_border, long in_row_width,
|
||||
int burst_phase, int in_width, int in_height, void* rgb_out, long out_pitch )
|
||||
{
|
||||
int chunk_count = (in_width - 1) / nes_ntsc_in_chunk;
|
||||
|
@ -243,7 +243,7 @@ void nes_ntsc_blit( nes_ntsc_t const* ntsc, NES_NTSC_IN_T const* input, NES_NTSC
|
|||
{
|
||||
NES_NTSC_IN_T const* line_in = input;
|
||||
NES_NTSC_BEGIN_ROW( ntsc, burst_phase,
|
||||
ntsc_bg, ntsc_bg, NES_NTSC_ADJ_IN( *line_in ) );
|
||||
ntsc_border, ntsc_border, NES_NTSC_ADJ_IN( *line_in ) );
|
||||
nes_ntsc_out_t* restrict line_out = (nes_ntsc_out_t*) rgb_out;
|
||||
int n;
|
||||
++line_in;
|
||||
|
@ -269,15 +269,15 @@ void nes_ntsc_blit( nes_ntsc_t const* ntsc, NES_NTSC_IN_T const* input, NES_NTSC
|
|||
}
|
||||
|
||||
/* finish final pixels */
|
||||
NES_NTSC_COLOR_IN( 0, ntsc_bg);
|
||||
NES_NTSC_COLOR_IN( 0, ntsc_border);
|
||||
NES_NTSC_RGB_OUT( 0, line_out [0], NES_NTSC_OUT_DEPTH );
|
||||
NES_NTSC_RGB_OUT( 1, line_out [1], NES_NTSC_OUT_DEPTH );
|
||||
|
||||
NES_NTSC_COLOR_IN( 1, ntsc_bg);
|
||||
NES_NTSC_COLOR_IN( 1, ntsc_border);
|
||||
NES_NTSC_RGB_OUT( 2, line_out [2], NES_NTSC_OUT_DEPTH );
|
||||
NES_NTSC_RGB_OUT( 3, line_out [3], NES_NTSC_OUT_DEPTH );
|
||||
|
||||
NES_NTSC_COLOR_IN( 2, ntsc_bg);
|
||||
NES_NTSC_COLOR_IN( 2, ntsc_border);
|
||||
NES_NTSC_RGB_OUT( 4, line_out [4], NES_NTSC_OUT_DEPTH );
|
||||
NES_NTSC_RGB_OUT( 5, line_out [5], NES_NTSC_OUT_DEPTH );
|
||||
NES_NTSC_RGB_OUT( 6, line_out [6], NES_NTSC_OUT_DEPTH );
|
||||
|
|
|
@ -68,7 +68,7 @@ In_row_width is the number of pixels to get to the next input row. Out_pitch
|
|||
is the number of *bytes* to get to the next output row. Output pixel format
|
||||
is set by NES_NTSC_OUT_DEPTH (defaults to 16-bit RGB). */
|
||||
EXPORT void nes_ntsc_blit( nes_ntsc_t const* ntsc, NES_NTSC_IN_T const* nes_in,
|
||||
NES_NTSC_IN_T ntsc_bg, long in_row_width, int burst_phase, int in_width,
|
||||
NES_NTSC_IN_T ntsc_border, long in_row_width, int burst_phase, int in_width,
|
||||
int in_height, void* rgb_out, long out_pitch );
|
||||
|
||||
/* Number of output pixels written by blitter for given input width. Width might
|
||||
|
|
Loading…
Reference in a new issue