Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/fceux.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeromus <zeromus@users.noreply.github.com>2022-08-24 05:58:00 +0300
committerzeromus <zeromus@users.noreply.github.com>2022-08-24 05:58:18 +0300
commit1798fca76a3ffc8d22318e445d10fbb7b63a762b (patch)
tree76f0e08443ee757733c930a839745070c288200a
parentd5a073741a9e9dba9e89695a2b513cc4bb5e9994 (diff)
proper deemph handling for win32 aviout. used 57ec344b1fffd263c64b94cb4a87831a69b84a8c from 7 years ago as a reference (when the png writing was fixed). fixes #429
-rw-r--r--src/drivers/win/aviout.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/drivers/win/aviout.cpp b/src/drivers/win/aviout.cpp
index b5ce0333..e0d347be 100644
--- a/src/drivers/win/aviout.cpp
+++ b/src/drivers/win/aviout.cpp
@@ -291,6 +291,8 @@ static void do_video_conversion(const unsigned char* buffer)
{
// memset(avi_file->convert_buffer, 0, VIDEO_WIDTH*(avi_file->end_scanline-avi_file->start_scanline)*3);
+ const unsigned char* mybuffer = buffer;
+
buffer += avi_file->start_scanline * VIDEO_WIDTH;
for(int y=avi_file->start_scanline; y<avi_file->end_scanline; ++y)
@@ -300,10 +302,11 @@ static void do_video_conversion(const unsigned char* buffer)
for(int x=0; x<VIDEO_WIDTH; ++x)
{
- uint8 *cp = (uint8*)(color_palette + *buffer++)+2;
- *pix++ = *cp--;
- *pix++ = *cp--;
- *pix++ = *cp;
+ u32 color = ModernDeemphColorMap(buffer,mybuffer,1);
+ *pix++=(color>>0x00)&0xFF;
+ *pix++=(color>>0x08)&0xFF;
+ *pix++=(color>>0x10)&0xFF;
+ buffer++;
}
buffer = prevbuf + VIDEO_WIDTH;