Update to bsnes v016r44 release.

[No changelog available]
This commit is contained in:
byuu 2006-08-08 02:02:38 +00:00
parent a55d640459
commit 764fe1974a
25 changed files with 180 additions and 341 deletions

189
bsnes.cfg
View File

@ -1,189 +0,0 @@
# Default path to look for ROM files in ("" = use default directory)
# (default = "")
fs.rom_path = ""
# Default path for all save RAM and cheat files ("" = use current directory)
# (default = "")
fs.save_path = ""
# Extension to be used for all save RAM files
# (default = "srm")
fs.save_ext = "srm"
# Use precalculated TV-style gamma ramp
# (default = true)
snes.colorfilter.gamma_ramp = true
# Convert color to sepia tone
# (default = false)
snes.colorfilter.sepia = false
# Convert color to grayscale tone
# (default = false)
snes.colorfilter.grayscale = false
# Invert output image colors
# (default = false)
snes.colorfilter.invert = false
#
# (default = 0)
snes.colorfilter.contrast = 0
#
# (default = 0)
snes.colorfilter.brightness = 0
#
# (default = 80)
snes.colorfilter.gamma = 80
# Merge fields in NTSC video filter
# Set to true if using filter at any refresh rate other than 60hz
#
# (default = true)
snes.ntsc_merge_fields = true
# Mutes SNES audio output when enabled
# (default = false)
snes.mute = true
# Regulate speed to 60hz (NTSC) / 50hz (PAL)
# (default = true)
system.regulate_speed = false
# Slowest speed setting (in hz)
# (default = 16000)
system.speed_slowest = 16000
# Slow speed setting
# (default = 24000)
system.speed_slow = 24000
# Normal speed setting
# (default = 32000)
system.speed_normal = 32000
# Fast speed setting
# (default = 48000)
system.speed_fast = 48000
# Fastest speed setting
# (default = 64000)
system.speed_fastest = 64000
# Video renderer
# "dd" (DirectDraw7 -- faster, less features)
# "d3d" (Direct3D9 -- slower, more features)
# (default = "d3d")
video.renderer = "d3d"
#
# (default = 2)
video.profile = 0
# Video profile 0-7 configuration
# Please use bsnes GUI configuration editor to modify video profile settings
# Format: software_filter;hardware_filter;video_standard;multiplier-1;correct_aspect_ratio;
# enable_scanlines;manual_render_size;render_width;render_height;
# resolution_width;resolution_height;refresh_rate;triple_buffering
# (default = "0;0;0;0;false;false;false;256;224;0;0;0;false")
video.profile_0 = "0;0;0;0;false;false;false;256;239;0;0;0;false"
#
# (default = "0;0;0;1;false;false;false;512;448;0;0;0;false")
video.profile_1 = "0;0;0;1;false;false;false;512;448;0;0;0;false"
#
# (default = "0;1;0;1;true;false;false;597;448;0;0;0;false")
video.profile_2 = "0;1;0;1;true;false;false;597;448;0;0;0;false"
#
# (default = "0;1;0;2;true;false;false;896;672;0;0;0;false")
video.profile_3 = "0;1;0;2;true;false;false;896;672;0;0;0;false"
#
# (default = "0;1;0;3;true;false;false;1195;896;0;0;0;false")
video.profile_4 = "0;1;0;3;true;false;false;1195;896;0;0;0;false"
#
# (default = "0;0;0;0;false;false;false;256;224;0;0;0;false")
video.profile_5 = "0;0;0;0;false;false;false;256;224;0;0;0;false"
#
# (default = "0;0;0;0;false;false;false;256;224;0;0;0;false")
video.profile_6 = "0;0;0;0;false;false;false;256;224;0;0;0;false"
#
# (default = "0;0;0;0;false;false;false;256;224;0;0;0;false")
video.profile_7 = "0;0;0;0;false;false;false;256;224;0;0;0;false"
# Use Video RAM instead of System RAM
# (default = true)
video.use_vram = true
# Use triple buffering
# (default = false)
video.triple_buffering = false
# Progressive scanline intensity
# Value is percentage of intensity from 0 to 100
# (default = 30)
video.pscanline_intensity = 30
# Interlace scanline intensity
# (default = 50)
video.iscanline_intensity = 50
# Axis resistance for all analog joypads
# Affects responsiveness of analog stick movement by specifying what percentage
# in any given direction the axis must be pressed to trigger a button press.
# In other words, this determines how hard you have to press the analog stick to
# simulate pressing e.g. left or right on a digital joypad.
# Value is a percentage, from 0 (axis will trigger with virtually any axis movement)
# up to 100 (axis must be pressed fully to given corner).
# Value affects all four directions of the axis equally.
# Note: Values below 10 or above 90 are not recommended and may not work at all.
# (default = 75)
input.axis_resistance = 75
# Allow up+down and left+right key combinations for joypad 1 (not recommended)
# (default = false)
input.joypad1.allow_invalid_input = false
# Joypad 1 button map
# Format: Up; Down; Left; Right; A; B; X; Y; L; R; Select; Start
# (default = "up | joypad0.up; down | joypad0.down; left | joypad0.left; right | joypad0.right; x | joypad0.button3; z | joypad0.button2; s | joypad0.button1; a | joypad0.button0; d | joypad0.button6; c | joypad0.button7; rshift | joypad0.button4; enter | joypad0.button5")
input.joypad1.map = "up | joypad0.up; down | joypad0.down; left | joypad0.left; right | joypad0.right; x | joypad0.button3; z | joypad0.button2; s | joypad0.button1; a | joypad0.button0; d | joypad0.button6; c | joypad0.button7; rshift | joypad0.button4; enter | joypad0.button5"
# Allow up+down and left+right key combinations for joypad 2 (not recommended)
# (default = false)
input.joypad2.allow_invalid_input = false
# Joypad 2 button map
# Format: Up; Down; Left; Right; A; B; X; Y; L; R; Select; Start
# (default = "t | joypad1.up; g | joypad1.down; f | joypad1.left; h | joypad1.right; k | joypad1.button3; j | joypad1.button2; i | joypad1.button1; u | joypad1.button0; o | joypad1.button6; l | joypad1.button7; lbracket | joypad1.button4; rbracket | joypad1.button5")
input.joypad2.map = "t | joypad1.up; g | joypad1.down; f | joypad1.left; h | joypad1.right; k | joypad1.button3; j | joypad1.button2; i | joypad1.button1; u | joypad1.button0; o | joypad1.button6; l | joypad1.button7; lbracket | joypad1.button4; rbracket | joypad1.button5"
# Number of lines buffered for debugger console
# (default = 100)
debugger.console_lines = 100
# Image format for screenshots
# Valid formats: "bmp", "png", "jpg"
# (default = "png")
misc.image_format = "png"
# Window style for main emulation window
# (default = "titlebar|frame|minimize|dragmove")
misc.window_style = "titlebar|frame|minimize|dragmove"
# Show framerate
# (default = true)
misc.show_fps = true
# Alpha level (opacity) of configuration window
# Value must be between 64 (25% opaque, 75% transparent) and 255 (100% opaque)
# (default = 255)
misc.config_window_alpha_level = 255

BIN
bsnes.exe Normal file

Binary file not shown.

Binary file not shown.

BIN
cart.db

Binary file not shown.

View File

@ -1,4 +1,4 @@
#define BSNES_VERSION "0.016.42"
#define BSNES_VERSION "0.016.44"
#define BSNES_TITLE "bsnes v" BSNES_VERSION
#define MEMCORE bMemBus
@ -20,7 +20,7 @@
//#define JMA_SUPPORT
//debugging extensions (~10% speed hit)
//#define DEBUGGER
#define DEBUGGER
//snes core polymorphism
//(allow mem/cpu/apu/ppu overriding, ~10% speed hit)

View File

@ -181,7 +181,7 @@ void Cartridge::load_sram() {
FileReader ff(sram_fn);
if(!ff.ready()) {
sram = (uint8*)malloc(info.ram_size);
memset(sram, 0, info.ram_size);
memset(sram, 0xff, info.ram_size);
return;
}
@ -197,45 +197,57 @@ FileWriter ff(sram_fn);
ff.write(sram, info.ram_size);
}
uint Cartridge::mirror_rom(uint size) {
uint i;
//find largest power of two <= size
for(i = 31; i >= 0; i--) {
if(size & (1 << i))break;
uint Cartridge::mirror_realloc(uint8 *&data, uint size) {
for(int i = 31; i >= 0; i--) {
if(size & (1 << i)) {
if(!(size & ~(1 << i))) { return 1 << i; }
data = (uint8*)realloc(data, 2 << i);
return 2 << i;
}
}
return 0;
}
uint Cartridge::mirror(uint8 *&data, uint size) {
uint r = mirror_realloc(data, size);
while(size < r) {
uint i = 0;
for(; i < 32; i++) { if(size & (1 << i))break; }
uint masklo = 1 << i++;
for(; i < 32; i++) { if(size & (1 << i))break; }
uint maskhi = 1 << i;
if(i > 31)break; //no mirroring necessary
while(masklo < maskhi) {
uint start = size - masklo;
memcpy(data + size, data + start, masklo);
size += masklo;
masklo <<= 1;
}
}
uint P0_size = 1 << i;
size -= P0_size;
if(size == 0)return P0_size;
//find smallest power of two >= size
for(i = 0; i <= 31; i++) {
if((1 << i) >= size)break;
}
uint P1_size = 1 << i;
return P0_size + P1_size;
return r;
}
void Cartridge::load_rom(Reader &rf) {
info.rom_size = rf.size();
bool header = false;
if((info.rom_size & 0x7fff) == 0x0200) {
info.rom_size -= 512;
header = true;
}
uint8 *data = rf.read();
uint size = rf.size();
bool header = ((size & 0x7fff) == 0x0200);
info.rom_size = size - (header ? 512 : 0);
info.rom_size = mirror_rom(info.rom_size);
base_rom = rf.read(info.rom_size + ((header) ? 512 : 0));
rom = base_rom;
if(header)rom += 512;
base_rom = (uint8*)malloc(info.rom_size);
memcpy(base_rom, data + (header ? 512 : 0), info.rom_size);
SafeFree(data);
info.crc32 = 0xffffffff;
for(int32 i = 0; i < info.rom_size; i++) {
info.crc32 = crc32_adjust(info.crc32, rom[i]);
info.crc32 = crc32_adjust(info.crc32, base_rom[i]);
}
info.crc32 = ~info.crc32;
info.rom_size = mirror(base_rom, info.rom_size);
rom = base_rom;
}
bool Cartridge::load(const char *fn) {

View File

@ -78,7 +78,9 @@ struct {
uint header_index;
} info;
uint mirror_rom(uint size);
uint mirror_realloc(uint8 *&data, uint size);
uint mirror(uint8 *&data, uint size);
void load_rom(Reader &rf);
void load_sram();
void save_sram();

Binary file not shown.

View File

@ -28,6 +28,12 @@ pcb = "BSC-1A7M-01" ;unverified
rom = 16mbit
ram = 512kbit
[0xa5c0045e]
name = "Secret of Evermore (USA) [!]"
pcb = "SHVC-1J3M-20"
rom = 32mbit
ram = 64kbit
[0x5ebf7246]
name = "Sound Novel Tsukuru (Japan) [!]"
pcb = "BSC-1A7M-10"

Binary file not shown.

View File

@ -2,22 +2,15 @@ Config config_file;
namespace config {
FS::Path FS::base_path(0, "fs.base_path", "Directory that bsnes resides in", "");
FS::Path FS::rom_path(&config_file, "fs.rom_path",
"Default path to look for ROM files in (\"\" = use default directory)", "");
FS::Path FS::save_path(&config_file, "fs.save_path",
"Default path for all save RAM and cheat files (\"\" = use current directory)", "");
void FS::Path::sset(const char *_data) {
void fs_set_path(Setting &s, const char *data) {
string path;
strcpy(path, _data);
strcpy(path, data);
strunquote(path);
replace(path, "\\", "/");
//blank path?
if(strlen(path) == 0) {
Setting::sset(strptr(path));
s.sset(strptr(path));
return;
}
@ -26,31 +19,33 @@ string path;
strcat(path, "/");
}
Setting::sset(strptr(path));
s.sset(strptr(path));
}
Setting FS::base_path(0, "fs.base_path",
"Directory that bsnes resides in", "");
Setting FS::rom_path(&config_file, "fs.rom_path",
"Default path to look for ROM files in (\"\" = use default directory)", "");
Setting FS::save_path(&config_file, "fs.save_path",
"Default path for all save RAM and cheat files (\"\" = use current directory)", "");
Setting FS::save_ext(&config_file, "fs.save_ext",
"Extension to be used for all save RAM files", "srm");
SNES::VideoColorAdjust SNES::gamma_ramp(&config_file, "snes.colorfilter.gamma_ramp",
Setting SNES::gamma_ramp(&config_file, "snes.colorfilter.gamma_ramp",
"Use precalculated TV-style gamma ramp", true, Setting::TRUE_FALSE);
SNES::VideoColorAdjust SNES::sepia(&config_file, "snes.colorfilter.sepia",
Setting SNES::sepia(&config_file, "snes.colorfilter.sepia",
"Convert color to sepia tone", false, Setting::TRUE_FALSE);
SNES::VideoColorAdjust SNES::grayscale(&config_file, "snes.colorfilter.grayscale",
Setting SNES::grayscale(&config_file, "snes.colorfilter.grayscale",
"Convert color to grayscale tone", false, Setting::TRUE_FALSE);
SNES::VideoColorAdjust SNES::invert(&config_file, "snes.colorfilter.invert",
Setting SNES::invert(&config_file, "snes.colorfilter.invert",
"Invert output image colors", false, Setting::TRUE_FALSE);
SNES::VideoColorAdjust SNES::contrast(&config_file, "snes.colorfilter.contrast",
"", 0, Setting::DEC);
SNES::VideoColorAdjust SNES::brightness(&config_file, "snes.colorfilter.brightness",
"", 0, Setting::DEC);
SNES::VideoColorAdjust SNES::gamma(&config_file, "snes.colorfilter.gamma",
"", 80, Setting::DEC);
void SNES::VideoColorAdjust::set(uint32 _data) {
Setting::set(_data);
::snes->update_color_lookup_table();
}
Setting SNES::contrast(&config_file, "snes.colorfilter.contrast",
"Contrast", 0, Setting::DEC);
Setting SNES::brightness(&config_file, "snes.colorfilter.brightness",
"Brightness", 0, Setting::DEC);
Setting SNES::gamma(&config_file, "snes.colorfilter.gamma",
"Gamma", 80, Setting::DEC);
Setting SNES::ntsc_merge_fields(&config_file, "snes.ntsc_merge_fields",
"Merge fields in NTSC video filter\n"

View File

@ -2,22 +2,15 @@ extern Config config_file;
namespace config {
void fs_set_path(Setting &s, const char *data);
extern struct FS {
static class Path : public Setting {
public:
void sset(const char *_data);
SettingOperators(Path);
} base_path, rom_path, save_path;
static Setting base_path, rom_path, save_path;
static Setting save_ext;
} fs;
extern struct SNES {
static class VideoColorAdjust : public Setting {
public:
void set(uint32 _data);
SettingOperators(VideoColorAdjust);
} gamma_ramp, sepia, grayscale, invert, contrast, brightness, gamma;
static Setting gamma_ramp, sepia, grayscale, invert, contrast, brightness, gamma;
static Setting ntsc_merge_fields;
static Setting mute;
} snes;

View File

@ -24,7 +24,7 @@ uint8 r;
//read from address bus b, write to address bus a
//block invalid writes, see comments above
r = (bbus == 0x80) ? r_cpu->regs.mdr : r_mem->read(0x2100 | bbus);
r = r_mem->read(0x2100 | bbus);
if((abus & 0x40ff00) == 0x2100 || (abus & 0x40ff80) == 0x4300 ||
(abus & 0x40ffff) == 0x420b || (abus & 0x40ffff) == 0x420c)return;
r_mem->write(abus, r);

View File

@ -4,3 +4,5 @@
CPU::CPU() {
cpu_version = 1;
}
CPU::~CPU() {}

View File

@ -88,5 +88,5 @@ enum {
uint8 opcode_length();
CPU();
virtual ~CPU() {}
virtual ~CPU();
};

View File

@ -84,9 +84,9 @@ public:
CPUReg24 pc;
CPUReg16 a, x, y, s, d;
CPURegFlags p;
uint8 db;
uint8 mdr;
bool e;
bool acc_8b, idx_8b;
uint8 db;
uint8 mdr;
bool e;
bool acc_8b, idx_8b;
CPURegs() : db(0), mdr(0x00), e(false), acc_8b(true), idx_8b(true) {}
};

View File

@ -1,27 +1,29 @@
/*****
* used by both DMA and HDMA
* prevents transfer across same bus (a->a or b->b)
*
* DMA address bus a cannot read from or write to the following addresses :
* $[00-3f|80-bf]:21[00-ff] <address bus b>
* DMA address bus A cannot read from or write to the following addresses :
* $[00-3f|80-bf]:43[00-7f] <DMA control registers>
* $[00-3f|80-bf]:420b <DMA enable register>
* $[00-3f|80-bf]:420c <HDMA enable register>
*
* DMA address bus b cannot read from $2180
* WRAM<>WRAM transfers via $2180
*****/
void sCPU::dma_transfer(bool direction, uint8 bbus, uint32 abus) {
uint8 r;
if(direction == 0) { //a->b
if((abus & 0x40ff00) == 0x2100 || (abus & 0x40ff80) == 0x4300 ||
(abus & 0x40ffff) == 0x420b || (abus & 0x40ffff) == 0x420c) {
r = r_cpu->regs.mdr; //invalid reads return open bus
r = regs.mdr;
} else {
r = r_mem->read(abus);
}
r_mem->write(0x2100 | bbus, r);
} else { //b->a
uint8 r = (bbus == 0x80) ? r_cpu->regs.mdr : r_mem->read(0x2100 | bbus);
if(bbus == 0x80 && ((abus & 0x7e0000) == 0x7e0000 || (abus & 0x40e000) == 0x0000)) {
//prevent WRAM->WRAM transfers
r = regs.mdr;
} else {
r = r_mem->read(0x2100 | bbus);
}
if((abus & 0x40ff00) == 0x2100 || (abus & 0x40ff80) == 0x4300 ||
(abus & 0x40ffff) == 0x420b || (abus & 0x40ffff) == 0x420c)return;
r_mem->write(abus, r);

View File

@ -14,14 +14,25 @@ void bMemBus::load_cart() {
if(!strcmp(cartridge.info.pcb, "SHVC-1A3B-11")) { cart_map_shvc_1a3b_13(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3B-12")) { cart_map_shvc_1a3b_13(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3B-13")) { cart_map_shvc_1a3b_13(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3B-20")) { cart_map_shvc_1a3b_20(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3M-10")) { cart_map_shvc_1a3m_30(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3M-20")) { cart_map_shvc_1a3m_30(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3M-21")) { cart_map_shvc_1a3m_30(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1A3M-30")) { cart_map_shvc_1a3m_30(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1J3M-01")) { cart_map_shvc_1j3m_20(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1J3M-10")) { cart_map_shvc_1j3m_20(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1J3M-11")) { cart_map_shvc_1j3m_20(); break; }
if(!strcmp(cartridge.info.pcb, "SHVC-1J3M-20")) { cart_map_shvc_1j3m_20(); break; }
if(!strcmp(cartridge.info.pcb, "BSC-1A5M-01")) { cart_map_bsc_1a5m_01(); break; }
if(!strcmp(cartridge.info.pcb, "BSC-1A7M-01")) { cart_map_bsc_1a7m_01(); break; }
if(!strcmp(cartridge.info.pcb, "BSC-1A7M-10")) { cart_map_bsc_1a7m_10(); break; }
dprintf("* PCB mapper not found");
return;

View File

@ -1,12 +1,16 @@
void bMemBus::cart_map_range(
uint8 bank_lo, uint8 bank_hi,
uint8 page_lo, uint8 page_hi,
uint mode,
uint8 bank_lo, uint8 bank_hi,
uint16 addr_lo, uint16 addr_hi,
uint type, uint offset
) {
uint8 *data = 0;
uint size = 0;
uint index = 0;
uint8 page_lo = (addr_lo >> 8) & 255;
uint8 page_hi = (addr_hi >> 8) & 255;
switch(type) {
case MAP_ROM: {
@ -24,6 +28,8 @@ uint index = 0;
if(size) { index = (index + offset) % size; }
for(uint bank = bank_lo; bank <= bank_hi; bank++) {
if(mode == SHADOW && size) { index = (index + page_lo * 256) % size; }
for(uint page = page_lo; page <= page_hi; page++) {
uint16 n = (bank << 8) + page;
@ -44,6 +50,8 @@ uint index = 0;
}
}
if(mode == SHADOW && size) { index = (index + (255 - page_hi) * 256) % size; }
}
}
@ -52,5 +60,5 @@ uint index = 0;
#include "mapper_pcb.cpp"
#undef cart_map_range
#undef map
#undef mapper

View File

@ -1,3 +1,8 @@
enum {
LINEAR,
SHADOW,
};
enum {
MAP_ROM,
MAP_RAM,
@ -9,12 +14,13 @@ enum {
MAP_OBC1,
};
void cart_map_range(uint8 bank_lo, uint8 bank_hi, uint8 page_lo, uint8 page_hi, uint type, uint offset = 0);
void cart_map_range(uint mode, uint8 bank_lo, uint8 bank_hi, uint16 addr_lo, uint16 addr_hi, uint type, uint offset = 0);
#define mapper(name) void cart_map_##name()
mapper(shvc_1a3b_13);
mapper(shvc_1a3b_20);
mapper(shvc_1a3m_30);
mapper(shvc_1j3m_20);
mapper(bsc_1a5m_01);
mapper(bsc_1a7m_01);
mapper(bsc_1a7m_10);

View File

@ -2,94 +2,77 @@
//SHVC-1A3B-11
//SHVC-1A3B-12
//SHVC-1A3B-13
//
//$[00-1f]:[8000-ffff] ROM P0
//$[70-7f]:[0000-ffff] RAM
//$[80-9f]:[8000-ffff] ROM P0
//$[f0-ff]:[0000-ffff] RAM
mapper(shvc_1a3b_13) {
map(0x00, 0x1f, 0x80, 0xff, MAP_ROM);
map(0x70, 0x7f, 0x00, 0xff, MAP_RAM);
map(0x80, 0x9f, 0x80, 0xff, MAP_ROM);
map(0xf0, 0xff, 0x00, 0xff, MAP_RAM);
map(LINEAR, 0x00, 0x1f, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0x70, 0x7f, 0x0000, 0xffff, MAP_RAM);
map(LINEAR, 0x80, 0x9f, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0xf0, 0xff, 0x0000, 0xffff, MAP_RAM);
}
//SHVC-1A3B-20
//
//$[00-7f]:[8000-ffff] ROM P0
//$[70-7f]:[0000-7fff] RAM
//$[80-ff]:[8000-ffff] ROM P0
//$[f0-ff]:[0000-7fff] RAM
mapper(shvc_1a3b_20) {
map(0x00, 0x7f, 0x80, 0xff, MAP_ROM);
map(0x70, 0x7f, 0x00, 0x7f, MAP_RAM);
map(0x80, 0xff, 0x80, 0xff, MAP_ROM);
map(0xf0, 0xff, 0x00, 0x7f, MAP_RAM);
map(LINEAR, 0x00, 0x7f, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0x70, 0x7f, 0x0000, 0x7fff, MAP_RAM);
map(LINEAR, 0x80, 0xff, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0xf0, 0xff, 0x0000, 0x7fff, MAP_RAM);
}
//SHVC-1A3M-10
//SHVC-1A3M-20
//SHVC-1A3M-21
//SHVC-1A3M-30
//
//$[00-7f]:[8000-ffff]
//$[70-7f]:[0000-7fff]
//$[80-ff]:[8000-ffff]
//$[f0-ff]:[0000-7fff]
mapper(shvc_1a3m_30) {
map(0x00, 0x7f, 0x80, 0xff, MAP_ROM);
map(0x70, 0x7f, 0x00, 0x7f, MAP_RAM);
map(0x80, 0xff, 0x80, 0xff, MAP_ROM);
map(0xf0, 0xff, 0x00, 0x7f, MAP_RAM);
map(LINEAR, 0x00, 0x7f, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0x70, 0x7f, 0x0000, 0x7fff, MAP_RAM);
map(LINEAR, 0x80, 0xff, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0xf0, 0xff, 0x0000, 0x7fff, MAP_RAM);
}
//SHVC-1J3M-01
//SHVC-1J3M-10
//SHVC-1J3M-11
//SHVC-1J3M-20
mapper(shvc_1j3m_20) {
map(SHADOW, 0x00, 0x3f, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0x20, 0x3f, 0x6000, 0x7fff, MAP_RAM);
map(LINEAR, 0x40, 0x7f, 0x0000, 0xffff, MAP_ROM);
map(SHADOW, 0x80, 0xbf, 0x8000, 0xffff, MAP_ROM);
map(LINEAR, 0xa0, 0xbf, 0x6000, 0x7fff, MAP_RAM);
map(LINEAR, 0xc0, 0xff, 0x0000, 0xffff, MAP_ROM);
}
//unverified
//BSC-1A5M-01
//
//$[00-1f]:[8000-ffff] ROM P0
//$[20-3f]:[8000-ffff] ROM P1
//$[70-7f]:[0000-7fff] RAM
//$[80-9f]:[8000-ffff] ROM P2
//$[a0-bf]:[8000-ffff] ROM P1
//$[c0-ef]:[0000-ffff] BSX
mapper(bsc_1a5m_01) {
map(0x00, 0x1f, 0x80, 0xff, MAP_ROM, 0x000000);
map(0x20, 0x3f, 0x80, 0xff, MAP_ROM, 0x100000);
map(0x70, 0x7f, 0x00, 0x7f, MAP_RAM);
map(0x80, 0x9f, 0x80, 0xff, MAP_ROM, 0x200000);
map(0xa0, 0xbf, 0x80, 0xff, MAP_ROM, 0x100000);
map(LINEAR, 0x00, 0x1f, 0x8000, 0xffff, MAP_ROM, 0x000000);
map(LINEAR, 0x20, 0x3f, 0x8000, 0xffff, MAP_ROM, 0x100000);
map(LINEAR, 0x70, 0x7f, 0x0000, 0x7fff, MAP_RAM);
map(LINEAR, 0x80, 0x9f, 0x8000, 0xffff, MAP_ROM, 0x200000);
map(LINEAR, 0xa0, 0xbf, 0x8000, 0xffff, MAP_ROM, 0x100000);
}
//unverified
//BSC-1A7M-01
//
//$[00-1f]:[8000-ffff] ROM P0
//$[20-3f]:[8000-ffff] ROM P1
//$[70-7f]:[0000-7fff] RAM
//$[80-9f]:[8000-ffff] ROM P0
//$[a0-bf]:[8000-ffff] ROM P1
//$[c0-ef]:[0000-ffff] BSX
mapper(bsc_1a7m_01) {
map(0x00, 0x1f, 0x80, 0xff, MAP_ROM, 0x000000);
map(0x20, 0x3f, 0x80, 0xff, MAP_ROM, 0x100000);
map(0x70, 0x7f, 0x00, 0x7f, MAP_RAM);
map(0x80, 0x9f, 0x80, 0xff, MAP_ROM, 0x000000);
map(0xa0, 0xbf, 0x80, 0xff, MAP_ROM, 0x100000);
map(LINEAR, 0x00, 0x1f, 0x8000, 0xffff, MAP_ROM, 0x000000);
map(LINEAR, 0x20, 0x3f, 0x8000, 0xffff, MAP_ROM, 0x100000);
map(LINEAR, 0x70, 0x7f, 0x0000, 0x7fff, MAP_RAM);
map(LINEAR, 0x80, 0x9f, 0x8000, 0xffff, MAP_ROM, 0x000000);
map(LINEAR, 0xa0, 0xbf, 0x8000, 0xffff, MAP_ROM, 0x100000);
}
//unverified
//BSC-1A7M-10
//
//$[00-1f]:[8000-ffff] ROM P0
//$[20-3f]:[8000-ffff] ROM P1
//$[70-7f]:[0000-7fff] RAM
//$[80-9f]:[8000-ffff] ROM P2
//$[a0-bf]:[8000-ffff] ROM P1
//$[c0-ef]:[0000-ffff] BSX
mapper(bsc_1a7m_10) {
map(0x00, 0x1f, 0x80, 0xff, MAP_ROM, 0x000000);
map(0x20, 0x3f, 0x80, 0xff, MAP_ROM, 0x100000);
map(0x70, 0x7f, 0x00, 0x7f, MAP_RAM);
map(0x80, 0x9f, 0x80, 0xff, MAP_ROM, 0x200000);
map(0xa0, 0xbf, 0x80, 0xff, MAP_ROM, 0x100000);
map(LINEAR, 0x00, 0x1f, 0x8000, 0xffff, MAP_ROM, 0x000000);
map(LINEAR, 0x20, 0x3f, 0x8000, 0xffff, MAP_ROM, 0x100000);
map(LINEAR, 0x70, 0x7f, 0x0000, 0x7fff, MAP_RAM);
map(LINEAR, 0x80, 0x9f, 0x8000, 0xffff, MAP_ROM, 0x200000);
map(LINEAR, 0xa0, 0xbf, 0x8000, 0xffff, MAP_ROM, 0x100000);
}

View File

@ -4,7 +4,7 @@ CXX = cl
AS = nasm
RM = del
OBJ = obj
CFLAGS = /nologo /O2 /MD /arch:SSE2 /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
CFLAGS = /nologo /O2 /arch:SSE2 /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
COMPILE = $(CC) $(CFLAGS) /c
ASSEMBLE = $(AS) -f win32
LINK =
@ -18,7 +18,7 @@ CXX = cl
AS = nasm
RM = del
OBJ = obj
CFLAGS = /nologo /O2 /MD /GL /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
CFLAGS = /nologo /O2 /GL /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
COMPILE = $(CC) $(CFLAGS) /c
ASSEMBLE = $(AS) -f win32
LINK = /link /LTCG
@ -32,7 +32,7 @@ CXX = cl
AS = nasm
RM = del
OBJ = obj
CFLAGS = /nologo /O2 /MD /GL /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
CFLAGS = /nologo /O2 /GL /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
COMPILE = $(CC) $(CFLAGS) /c
ASSEMBLE = $(AS) -f win32
LINK = /link /PGD:bsnes.pgd /LTCG:PGINSTRUMENT
@ -46,7 +46,7 @@ CXX = cl
AS = nasm
RM = del
OBJ = obj
CFLAGS = /nologo /O2 /MD /arch:SSE2 /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
CFLAGS = /nologo /O2 /arch:SSE2 /DPLATFORM_WIN /DCOMPILER_VISUALC /DPROCESSOR_X86
COMPILE = $(CC) $(CFLAGS) /c
ASSEMBLE = $(AS) -f win32
LINK = /link /PGD:bsnes.pgd /LTCG:PGOPTIMIZE
@ -60,7 +60,7 @@ CXX = cl
AS = nasm
RM = del
OBJ = obj
CFLAGS = /nologo /O2 /MD /DPLATFORM_SDL /DCOMPILER_VISUALC /DPROCESSOR_X86
CFLAGS = /nologo /O2 /DPLATFORM_SDL /DCOMPILER_VISUALC /DPROCESSOR_X86
COMPILE = $(CC) $(CFLAGS) /c
ASSEMBLE = $(AS) -f win32
LINK =
@ -85,7 +85,7 @@ OBJS = main.$(OBJ) \
all: $(OBJS)
rc /r /fobsnes.res bsnes.rc
$(CC) /Febsnes.exe $(CFLAGS) $(OBJS) bsnes.res $(LIBS) $(LINK)
mt -nologo -manifest bsnes.exe.manifest -outputresource:bsnes.exe;1
# mt -nologo -manifest bsnes.exe.manifest -outputresource:bsnes.exe;1
clean:
$(RM) *.$(OBJ)

View File

@ -117,7 +117,7 @@ string dir;
if(cartridge.loaded() == true)cartridge.unload();
wDebug.Clear();
cartridge.load(t);
if(cartridge.load(t) == false)return;
wCheatEditor.Refresh();
bsnes->power();

View File

@ -67,7 +67,7 @@ string t;
}
}
config::fs.base_path.sset(strptr(t));
config::fs_set_path(config::fs.base_path, strptr(t));
}
int __stdcall WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) {

View File

@ -5,12 +5,15 @@ bool ColorAdjustWindow::Event(EventInfo &info) {
if(info.control == &ContrastSlider) {
config::snes.contrast = ContrastSlider.GetPos();
ContrastLabel.SetText("Contrast: %d", int32(config::snes.contrast));
snes->update_color_lookup_table();
} else if(info.control == &BrightnessSlider) {
config::snes.brightness = BrightnessSlider.GetPos();
BrightnessLabel.SetText("Brightness: %d", int32(config::snes.brightness));
snes->update_color_lookup_table();
} else if(info.control == &GammaSlider) {
config::snes.gamma = GammaSlider.GetPos();
GammaLabel.SetText("Gamma: %0.2f", double(config::snes.gamma) / 100.0);
snes->update_color_lookup_table();
}
} break;
@ -18,19 +21,23 @@ bool ColorAdjustWindow::Event(EventInfo &info) {
if(info.control == &GammaRamp) {
config::snes.gamma_ramp.toggle();
GammaRamp.Check(config::snes.gamma_ramp);
snes->update_color_lookup_table();
} else if(info.control == &Sepia) {
config::snes.sepia.toggle();
Sepia.Check(config::snes.sepia);
snes->update_color_lookup_table();
} else if(info.control == &Grayscale) {
config::snes.grayscale.toggle();
Grayscale.Check(config::snes.grayscale);
snes->update_color_lookup_table();
} else if(info.control == &Invert) {
config::snes.invert.toggle();
Invert.Check(config::snes.invert);
snes->update_color_lookup_table();
} else if(info.control == &Restore) {
config::snes.contrast = 0;
config::snes.brightness = 0;
config::snes.gamma = 100;
config::snes.gamma = 80;
config::snes.gamma_ramp = true;
config::snes.sepia = false;
config::snes.grayscale = false;
@ -45,6 +52,7 @@ bool ColorAdjustWindow::Event(EventInfo &info) {
Sepia.Check(config::snes.sepia);
Grayscale.Check(config::snes.grayscale);
Invert.Check(config::snes.invert);
snes->update_color_lookup_table();
}
} break;