mirror of https://github.com/bsnes-emu/bsnes.git
Update to bsnes v064r05 release.
- swaps the video_refresh output from BGR555 to RGB555, for the sake of direct copying for certain APIs. Not going to do RGB565 because the G5 bit doesn't exist, and faking it is lame. [Meanwhile, in bsnesui 2010-04-24...] bsnes.python: - adds more icons and stuff. bsnes.net: - new port, targets C#, binds every function in libsnes - targets .NET 3.5 ... I honestly would have went with 4.0 for the nicer IntPtr addition alone, but the SP3 requirement may put off a lot of people - video output that doesn't scale (or clean up when dropping to a smaller size) - Port1 joypad input support via keyboard only bsnes.cocoa: - stuck in a time/space wormhole until Apple gets their heads out of their asses and updates GCC Probably the coolest thing about Python and .NET is that anyone can now compile these GUIs and modify them just by having the run-times installed. I really like the way MS is distributing the complete development chain along with the run-time.
This commit is contained in:
parent
44bab83d68
commit
0d19902435
|
@ -4,7 +4,7 @@ ui := ui_qt
|
|||
# compiler
|
||||
c := $(compiler) -std=gnu99
|
||||
cpp := $(subst cc,++,$(compiler)) -std=gnu++0x
|
||||
flags := -O3 -fomit-frame-pointer -fPIC -I.
|
||||
flags := -O3 -fomit-frame-pointer -I.
|
||||
link :=
|
||||
objects :=
|
||||
|
||||
|
|
|
@ -347,21 +347,23 @@ void bPPU::reset() {
|
|||
bPPU::bPPU() {
|
||||
alloc_tiledata_cache();
|
||||
|
||||
for(int l = 0; l < 16; l++) {
|
||||
for(int i = 0; i < 4096; i++) {
|
||||
for(unsigned l = 0; l < 16; l++) {
|
||||
for(unsigned i = 0; i < 4096; i++) {
|
||||
mosaic_table[l][i] = (i / (l + 1)) * (l + 1);
|
||||
}
|
||||
}
|
||||
|
||||
for(int l = 0; l < 16; l++) {
|
||||
double m = (double)l / 15.0;
|
||||
for(int i = 0; i < 32 * 32; i++) {
|
||||
int r = (int)((double)((i) & 31) * m + 0.5);
|
||||
int g = (int)((double)((i >> 5) & 31) * m + 0.5);
|
||||
r = max(0, min(31, r));
|
||||
g = max(0, min(31, g));
|
||||
if(i < 32) light_table_b[l][i] = (r << 10);
|
||||
light_table_gr[l][i] = (g << 5) | (r);
|
||||
for(unsigned l = 0; l < 16; l++) {
|
||||
for(unsigned r = 0; r < 32; r++) {
|
||||
for(unsigned g = 0; g < 32; g++) {
|
||||
for(unsigned b = 0; b < 32; b++) {
|
||||
double luma = (double)l / 15.0;
|
||||
unsigned ar = (luma * r + 0.5);
|
||||
unsigned ag = (luma * g + 0.5);
|
||||
unsigned ab = (luma * b + 0.5);
|
||||
light_table[l][(r << 10) + (g << 5) + b] = (ab << 10) + (ag << 5) + ar;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,8 +36,7 @@ public:
|
|||
alwaysinline bool overscan() const { return display.overscan; }
|
||||
alwaysinline bool hires() const { return (regs.pseudo_hires || regs.bg_mode == 5 || regs.bg_mode == 6); }
|
||||
|
||||
uint16 light_table_b[16][32];
|
||||
uint16 light_table_gr[16][32 * 32];
|
||||
uint16 light_table[16][32768];
|
||||
uint16 mosaic_table[16][4096];
|
||||
void render_line();
|
||||
|
||||
|
|
|
@ -85,47 +85,24 @@ inline uint16 bPPU::get_pixel_swap(uint32 x) {
|
|||
}
|
||||
|
||||
inline void bPPU::render_line_output() {
|
||||
uint16 *ptr = (uint16*)output + (line * 1024) +
|
||||
((interlace() && field()) ? 512 : 0);
|
||||
uint16 *luma_b = light_table_b [regs.display_brightness];
|
||||
uint16 *luma_gr = light_table_gr[regs.display_brightness];
|
||||
uint16 *ptr = (uint16*)output + (line * 1024) + ((interlace() && field()) ? 512 : 0);
|
||||
uint16 *luma = light_table[regs.display_brightness];
|
||||
uint16 curr, prev;
|
||||
|
||||
if(!regs.pseudo_hires && regs.bg_mode != 5 && regs.bg_mode != 6) {
|
||||
if(regs.display_brightness == 15) {
|
||||
for(unsigned x = 0; x < 256; x++) {
|
||||
*ptr++ = get_pixel_normal(x);
|
||||
}
|
||||
} else {
|
||||
for(unsigned x = 0; x < 256; x++) {
|
||||
curr = get_pixel_normal(x);
|
||||
*ptr++ = luma_b[curr >> 10] + luma_gr[curr & 0x3ff];
|
||||
}
|
||||
for(unsigned x = 0; x < 256; x++) {
|
||||
curr = luma[get_pixel_normal(x)];
|
||||
*ptr++ = curr;
|
||||
}
|
||||
} else {
|
||||
if(regs.display_brightness == 15) {
|
||||
for(unsigned x = 0, prev = 0; x < 256; x++) {
|
||||
curr = get_pixel_swap(x);
|
||||
*ptr++ = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
|
||||
prev = curr;
|
||||
for(unsigned x = 0, prev = 0; x < 256; x++) {
|
||||
curr = luma[get_pixel_swap(x)];
|
||||
*ptr++ = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
|
||||
prev = curr;
|
||||
|
||||
curr = get_pixel_normal(x);
|
||||
*ptr++ = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
|
||||
prev = curr;
|
||||
|
||||
}
|
||||
} else {
|
||||
for(unsigned x = 0, prev = 0; x < 256; x++) {
|
||||
curr = get_pixel_swap(x);
|
||||
curr = luma_b[curr >> 10] + luma_gr[curr & 0x3ff];
|
||||
*ptr++ = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
|
||||
prev = curr;
|
||||
|
||||
curr = get_pixel_normal(x);
|
||||
curr = luma_b[curr >> 10] + luma_gr[curr & 0x3ff];
|
||||
*ptr++ = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
|
||||
prev = curr;
|
||||
}
|
||||
curr = luma[get_pixel_normal(x)];
|
||||
*ptr++ = (prev + curr - ((prev ^ curr) & 0x0421)) >> 1;
|
||||
prev = curr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ sPPU::Screen::Screen(sPPU &self) : self(self) {
|
|||
unsigned ar = (luma * r + 0.5);
|
||||
unsigned ag = (luma * g + 0.5);
|
||||
unsigned ab = (luma * b + 0.5);
|
||||
light_table[l][(b << 10) + (g << 5) + r] = (ab << 10) + (ag << 5) + ar;
|
||||
light_table[l][(r << 10) + (g << 5) + b] = (ab << 10) + (ag << 5) + ar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
static const char bsnesVersion[] = "064.04";
|
||||
static const char bsnesVersion[] = "064.05";
|
||||
static const char bsnesTitle[] = "bsnes";
|
||||
static const unsigned bsnesSerializerVersion = 10;
|
||||
|
||||
|
|
|
@ -99,10 +99,10 @@ void Filter::colortable_update() {
|
|||
double kr = 0.2126, kb = 0.0722, kg = (1.0 - kr - kb); //luminance weights
|
||||
|
||||
for(unsigned i = 0; i < 32768; i++) {
|
||||
unsigned color //bgr555->rgb888 conversion
|
||||
= ((i & 0x001f) << 19) | ((i & 0x001c) << 14)
|
||||
| ((i & 0x03e0) << 6) | ((i & 0x0380) << 1)
|
||||
| ((i & 0x7c00) >> 7) | ((i & 0x7000) >> 12);
|
||||
unsigned color //rgb555->rgb888 conversion
|
||||
= ((i & 0x7c00) << 9) + ((i & 0x7000) << 4)
|
||||
+ ((i & 0x03e0) << 6) + ((i & 0x0380) << 1)
|
||||
+ ((i & 0x001f) << 3) + ((i & 0x001c) >> 2);
|
||||
|
||||
signed l;
|
||||
signed r = (color >> 16) & 0xff;
|
||||
|
|
Loading…
Reference in New Issue