twinaphex/genesis-next — comment on commit 62ee45296bd1e23ca9dede6461caa59d0d0f7357
File:  line 0
By Themaister:

2) I still don't get why include to stdlib.h need to be moved out m68kops.h, this does not make any sense to me so can you at least give me the error or warning you are getting ?

It wasn't there to begin with (I think?), tried adding it, to fix this warning:
src/m68k/m68kops.h: In function 'UseDivsCycles':
src/m68k/m68kops.h:51:3: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]

Adding stdlib.h however, I got:
In file included from /usr/include/stdlib.h:320:0,
from src/m68k/m68kops.h:5,
from src/m68k/m68kcpu.c:46:
/usr/include/sys/types.h:153:22: error: duplicate 'unsigned'
/usr/include/sys/types.h:153:22: error: two or more data types in declaration specifiers

so, I just reverted, and just pulled a "meh, I'll fix it later :P"

As for NTSC stuff, some guy specifically submitted a patch to being able to use NTSC directly from the core, so I merged it. However, when we pulled latest, the old NTSC fixes he did were overwritten, so had a look at it. Normally, I'd assume we could just set output format to 15-bit, but this didn't work, as the NTSC filter for some reason hardcoded stuff.

#define MD_NTSC_RGB_OUT_( rgb_out, bits, x ) {\
rgb_out = (raw_>>(13-x)& 0xF800)|(raw_>>(8-x)&0x07E0)|(raw_>>(4-x)&0x001F);\
}

Studying the code, this is for RGB565, so ifdeffed that for RGB555 with:
#define MD_NTSC_RGB_OUT_( rgb_out, bits, x ) {\
rgb_out = (raw_>>(14-x)& 0x7C00)|(raw_>>(9-x)&0x03E0)|(raw_>>(4-x)&0x001F);\
}

I know blargg SNES NTSC has proper defines for this, so maybe it's something that was pulled out?

At any rate, SSNES supports external plugin filters, and it'd be tons more clean to do it outside the code as a filter plugin, but haven't bothered making one yet.

One extra thing, which you might have an idea about. I had a strange bug report about libsnes port of genplus:
https://github.com/Themaister/SSNES/issues/6

Reading this, SRAM is apparently always active and dumps an SRAM full of ones even if there's not supposed to be SRAM.