Version 4.6 with major overhaul to CPU and memory so that the DS-Lite/Phat can now run more modern homebrews. See readme.md for details.

This commit is contained in:
Dave Bernazzani 2024-01-15 09:03:55 -05:00
parent 0b94d6994b
commit a69a317b33
9 changed files with 34 additions and 21 deletions

View File

@ -14,7 +14,7 @@ include $(DEVKITARM)/ds_rules
export TARGET := NINTV-DS
export TOPDIR := $(CURDIR)
export VERSION := 4.5d
export VERSION := 4.6
ICON := -b $(CURDIR)/logo.bmp "NINTV-DS $(VERSION);wavemotion-dave;https://github.com/wavemotion-dave/NINTV-DS"

Binary file not shown.

View File

@ -23,7 +23,7 @@ Features :
* Save Sate support (3 save slots per game).
* High Scores for up to 10 scores per game with various sorting options.
* Cheat / Hack support using NINTV-DS.cht (see 'extras' folder and place in /data directory)
* Tons of button / controller mapping options. Dual-Controller support (run and shoot at the same time).
* Numerous button / controller mapping options. Dual-Controller support (run and shoot at the same time).
* JLP support for accelerated functions (multiply/divide), extra RAM and flash memory. If not auto-detected, when loading a game use the X button to load with options.
* ECS support for ECS games including sound-enhanced games like Space Patrol. If not auto-detected, when loading a game use the X button to load with options.
@ -88,6 +88,13 @@ Credits :
--------------------------------------------------------------------------------
History :
--------------------------------------------------------------------------------
V4.6 : 15-Jan-2024 by wavemotion-dave
* Massive overhaul to the core emulation to reduce memory footprint. The older DS-Lite/Phat (with 4MB of memory) can now load all of the newest homebrew games!
* Optmizations in Video, Audio and CPU cores providese 10% speed up across the board.
* Improved sound quality for the DSi including a new "BEST" option (not enabled by default) that will render the sound as good as I can make it on the handheld.
* A few small fixes for the CPU core to improve the cycle accuracy.
* With the improved speed, the DSi largely disables frameskip for the best visual experience.
V4.5 : 01-Jan-2024 by wavemotion-dave
* Added new Screenshot handling (press and hold the L+R shoulder buttons for ~1 second to take a .bmp snapshot written to the SD card)
* Added new meta key mapping to un-throttle (Speedup) the emulator. Useful for games where your character is resting and you want the emulator to run the frames as fast as it can.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -125,7 +125,7 @@ static void SetDefaultGlobalConfig(void)
myGlobalConfig.erase_saves = 0;
myGlobalConfig.key_START_map_default = OVL_KEY_ENTER;
myGlobalConfig.key_SELECT_map_default = OVL_META_MENU;
myGlobalConfig.def_sound_quality = (isDSiMode() ? 1:3);
myGlobalConfig.def_sound_quality = (isDSiMode() ? 1:2);
myGlobalConfig.def_palette = 0;
myGlobalConfig.brightness = 0;
myGlobalConfig.menu_color = 1;
@ -160,7 +160,7 @@ static void SetDefaultGameConfig(UINT32 crc)
myConfig.key_YB_map = OVL_BTN_FIRE;
myConfig.key_BA_map = OVL_BTN_FIRE;
myConfig.controller_type = CONTROLLER_P1;
myConfig.sound_clock_div = myGlobalConfig.def_sound_quality;
myConfig.sound_quality = myGlobalConfig.def_sound_quality;
myConfig.dpad_config = DPAD_NORMAL;
myConfig.target_fps = 0;
myConfig.load_options = 0x00;
@ -346,10 +346,20 @@ void FindAndLoadConfig(UINT32 crc)
// With all the recent speed improvements, we are upgrading the DSi to no frame skip by default!
if (isDSiMode())
{
allConfigs.global_config.frame_skip = 0;
allConfigs.global_config.frame_skip = 0; // No Frame Skip
allConfigs.global_config.def_sound_quality = 1; // "Great" Sound Quality by default
for (int slot=0; slot<MAX_CONFIGS; slot++)
{
allConfigs.game_config[slot].frame_skip = 0;
allConfigs.game_config[slot].frame_skip = 0; // No Frame Skip
allConfigs.game_config[slot].sound_quality = 1; // "Great" Sound Quality
}
}
else
{
allConfigs.global_config.def_sound_quality = 2; // "Good" Sound Quality for DS-Lite/Phat by default
for (int slot=0; slot<MAX_CONFIGS; slot++)
{
allConfigs.game_config[slot].sound_quality = 2; // "Good" Sound Quality
}
}
}
@ -435,7 +445,7 @@ const struct options_t Option_Table[3][20] =
{"CONTROLLER", {"LEFT/PLAYER1", "RIGHT/PLAYER2", "DUAL-ACTION A", "DUAL-ACTION B"}, &myConfig.controller_type, 4},
{"D-PAD", {"NORMAL", "SWAP LEFT/RGT", "SWAP UP/DOWN", "DIAGONALS", "STRICT 4-WAY"}, &myConfig.dpad_config, 5},
{"FRAMESKIP", {"OFF", "ON (ODD)", "ON (EVEN)", "AGRESSIVE"}, &myConfig.frame_skip, 4},
{"SOUND DIV", {"12 (BEST)", "14 (EXELLENT)", "16 (GOOD)", "20 (AVERAGE)", "24 (FAIR)", "DISABLED"}, &myConfig.sound_clock_div, 6},
{"SOUND QUAL", {"BEST", "GREAT", "GOOD"}, &myConfig.sound_quality, 3},
{"TGT SPEED", {"60 FPS (100%)", "66 FPS (110%)", "72 FPS (120%)", "78 FPS (130%)", "84 FPS (140%)", "90 FPS (150%)", "54 FPS (90%)", "MAX SPEED"}, &myConfig.target_fps, 8},
{"PALETTE", {"ORIGINAL", "MUTED", "BRIGHT", "PAL", "CUSTOM"}, &myConfig.palette, 5},
{NULL, {"", ""}, NULL, 1},
@ -459,7 +469,7 @@ const struct options_t Option_Table[3][20] =
{"MAN DIR", {"SAME AS ROMS", "/ROMS/MAN", "/ROMS/INTV/MAN", "/DATA/MAN"}, &myGlobalConfig.man_dir, 4},
{"START DEF", {KEY_MAP_OPTIONS}, &myGlobalConfig.key_START_map_default, 27},
{"SELECT DEF", {KEY_MAP_OPTIONS}, &myGlobalConfig.key_SELECT_map_default, 27},
{"DEF SOUND", {"12 (BEST)", "14 (EXELLENT)", "16 (GOOD)", "20 (FAIR)", "24 (POOR)", "DISABLED"}, &myGlobalConfig.def_sound_quality, 6},
{"DEF SOUND", {"BEST", "GREAT", "GOOD"}, &myGlobalConfig.def_sound_quality, 3},
{"DEF PALETTE", {"ORIGINAL", "MUTED", "BRIGHT", "PAL", "CUSTOM"}, &myGlobalConfig.def_palette, 5},
{"DEF FRAMSKP", {"OFF", "ON (ODD)", "ON (EVEN)", "AGRESSIVE"}, &myGlobalConfig.frame_skip, 4},
{"BRIGTNESS", {"MAX", "DIM", "DIMMER", "DIMEST"}, &myGlobalConfig.brightness, 4},
@ -479,8 +489,8 @@ void ApplyOptions(void)
{
// Change the sound div if needed... affects sound quality and speed
extern INT32 clockDivisor, clocksPerSample;
static UINT32 sound_divs[] = {12,14,16,20,24,SOUND_DIV_DISABLE};
clockDivisor = sound_divs[myConfig.sound_clock_div];
static UINT32 sound_divs[] = {8,12,16};
clockDivisor = sound_divs[myConfig.sound_quality];
clocksPerSample = clockDivisor<<4;
// Check if the sound changed...

View File

@ -18,7 +18,7 @@
// ---------------------------
// Config handling...
// ---------------------------
#define CONFIG_VER 0x0007
#define CONFIG_VER 0x0008
#define MAX_CONFIGS 625
@ -42,7 +42,7 @@ struct Config_t
UINT8 key_YB_map;
UINT8 key_BA_map;
UINT8 controller_type;
UINT8 sound_clock_div;
UINT8 sound_quality;
UINT8 dpad_config;
UINT8 target_fps;
UINT8 load_options;

View File

@ -111,16 +111,16 @@ INT32 AudioMixer::getClockSpeed()
}
// ----------------------------------------------------------------------------------------------------------------
// This is CPU heavy... we've optimized this as much as possible. We only support two audio producers - the normal
// PSG sound chip for the Intellivision and the SP0256 chip for the speech on Intellivoice. For non-intellivoice
// games (or when the intellivoice is idle), we can just deal with a single sound producer which helps...
// This is CPU heavy... we've optimized this as much as possible. We support up to three audio producers - the
// normal PSG sound chip for the Intellivision and the SP0256 chip for the speech on Intellivoice and an optional
// PSG sound chip for the ECS. For non-intellivoice games (or when the intellivoice is idle), we can just deal
// with a single sound producer which helps...
// ----------------------------------------------------------------------------------------------------------------
ITCM_CODE INT32 AudioMixer::tick(INT32 minimum)
{
extern INT32 clockDivisor;
INT32 totalSample = 0;
extern UINT8 sp_idle;
if (clockDivisor == SOUND_DIV_DISABLE) return minimum;
UINT16 soundChannelsToProcess = audioProducerCount;
if (bUseIVoice && sp_idle) soundChannelsToProcess--; // If ECS is idle we can skip processing it...

View File

@ -110,11 +110,7 @@ void dsInstallSoundEmuFIFO(void)
TIMER2_DATA = TIMER_FREQ(tFreq);
TIMER2_CR = TIMER_DIV_1 | TIMER_IRQ_REQ | TIMER_ENABLE;
irqSet(IRQ_TIMER2, b_dsi_mode ? VsoundHandlerDSi:VsoundHandler);
if (myConfig.sound_clock_div != SOUND_DIV_DISABLE)
irqEnable(IRQ_TIMER2);
else
irqDisable(IRQ_TIMER2);
irqEnable(IRQ_TIMER2);
}

Binary file not shown.