Version 4.5d with a few more tweaks and improvements as we get ready for the next big release.

This commit is contained in:
Dave Bernazzani 2024-01-15 07:54:17 -05:00
parent 5eefe3f4e4
commit 0b94d6994b
9 changed files with 65 additions and 14 deletions

View File

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

Binary file not shown.

View File

@ -48,6 +48,8 @@ extern Rip *currentRip;
// 1,2 = Game Options
UINT8 options_shown = 0; // Start with Global config... can toggle to game options as needed
UINT8 bConfigWasFound = FALSE;
short int display_options_list(bool);
// --------------------------------------------
@ -326,6 +328,7 @@ void FindAndLoadConfig(UINT32 crc)
{
FILE *fp;
bConfigWasFound = FALSE;
SetDefaultGameConfig(crc);
fp = fopen("/data/NINTV-DS.DAT", "rb");
if (fp != NULL)
@ -333,6 +336,24 @@ void FindAndLoadConfig(UINT32 crc)
fread(&allConfigs, sizeof(allConfigs), 1, fp);
fclose(fp);
// ---------------------------------------------------------------------------------------
// Check for previous config... one time upgrade for DSi to remove frame skip by default.
// ---------------------------------------------------------------------------------------
if (allConfigs.config_ver == 0x0006)
{
allConfigs.config_ver = CONFIG_VER;
// 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;
for (int slot=0; slot<MAX_CONFIGS; slot++)
{
allConfigs.game_config[slot].frame_skip = 0;
}
}
}
if (allConfigs.config_ver != CONFIG_VER)
{
dsPrintValue(0,1,0, (char*)"PLEASE WAIT...");
@ -355,6 +376,7 @@ void FindAndLoadConfig(UINT32 crc)
{
if (allConfigs.game_config[slot].game_crc == crc) // Got a match?!
{
bConfigWasFound = TRUE;
memcpy(&myConfig, &allConfigs.game_config[slot], sizeof(struct Config_t));
break;
}

View File

@ -18,7 +18,7 @@
// ---------------------------
// Config handling...
// ---------------------------
#define CONFIG_VER 0x0006
#define CONFIG_VER 0x0007
#define MAX_CONFIGS 625
@ -124,4 +124,6 @@ extern void FindAndLoadConfig(UINT32 crc);
extern void dsChooseOptions(void);
extern void SaveConfig(bool bShow);
extern UINT8 bConfigWasFound;
#endif

View File

@ -1,10 +1,10 @@
// =====================================================================================
// Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
//
// Copying and distribution of this emulator, its source code and associated
// readme files, with or without modification, are permitted in any medium without
// Copying and distribution of this emulator, its source code and associated
// readme files, with or without modification, are permitted in any medium without
// royalty provided the this copyright notice is used and wavemotion-dave (NINTV-DS)
// and Kyle Davis (BLISS) are thanked profusely.
// and Kyle Davis (BLISS) are thanked profusely.
//
// The NINTV-DS emulator is offered as-is, without any warranty.
// =====================================================================================
@ -70,7 +70,7 @@ class AY38914 : public Processor, public AudioProducer
INT32 getClocksPerSample();
INT32 getSampleRate() { return getClockSpeed(); }
INT32 tick(INT32);
void getState(AY38914State *state);
void setState(AY38914State *state);
@ -78,11 +78,11 @@ class AY38914 : public Processor, public AudioProducer
INT32 getClockDivisor();
AY38914_Registers registers;
struct Channel_t channel0;
struct Channel_t channel1;
struct Channel_t channel2;
struct Channel_t channel2;
//cached total output sample
UINT8 cachedTotalOutputIsDirty;
@ -95,18 +95,18 @@ class AY38914 : public Processor, public AudioProducer
UINT8 envelopeAltr;
UINT8 envelopeAtak;
UINT8 envelopeCont;
INT32 envelopeCounter;
INT32 envelopeCounter;
//noise data
UINT8 noiseIdle;
INT32 noisePeriod;
INT32 noisePeriodValue;
INT32 noiseCounter;
INT32 noiseCounter;
//data for random number generator, used for white noise accuracy
INT32 my_random;
UINT8 noise;
private:
AY38914_InputOutput* psgIO0;
AY38914_InputOutput* psgIO1;

View File

@ -4279,6 +4279,11 @@ void CP1610::getState(CP1610State *state)
state->ext = ext;
state->interruptAddress = interruptAddress;
state->resetAddress = resetAddress;
state->bCP1610_PIN_IN_BUSRQ = bCP1610_PIN_IN_BUSRQ;
state->bCP1610_PIN_IN_INTRM = bCP1610_PIN_IN_INTRM;
state->bCP1610_PIN_OUT_BUSAK = bCP1610_PIN_OUT_BUSAK;
for (int i=0; i<8; i++) state->r[i] = r[i];
}
@ -4294,6 +4299,11 @@ void CP1610::setState(CP1610State *state)
ext = state->ext;
interruptAddress = state->interruptAddress;
resetAddress = state->resetAddress;
bCP1610_PIN_IN_BUSRQ = state->bCP1610_PIN_IN_BUSRQ;
bCP1610_PIN_IN_INTRM = state->bCP1610_PIN_IN_INTRM;
bCP1610_PIN_OUT_BUSAK = state->bCP1610_PIN_OUT_BUSAK;
for (int i=0; i<8; i++) r[i] = state->r[i];
bHandleInterrupts = (!bCP1610_PIN_IN_BUSRQ || (I && !bCP1610_PIN_IN_INTRM));

View File

@ -37,6 +37,9 @@ TYPEDEF_STRUCT_PACK( _CP1610State
UINT8 I;
UINT8 D;
UINT8 interruptible;
UINT8 bCP1610_PIN_IN_BUSRQ;
UINT8 bCP1610_PIN_IN_INTRM;
UINT8 bCP1610_PIN_OUT_BUSAK;
INT8 ext;
UINT16 interruptAddress;
UINT16 resetAddress;

View File

@ -430,7 +430,8 @@ Rip* Rip::LoadBinCfg(const CHAR* configFile, UINT32 crc, size_t size)
}
if (strstr(ptr, "ecs"))
{
bUseECS = (isDSiMode() ? 1 : 0); // For the DS-Lite/Phat, we ignore this directive that is so often set even when there is no advantage to using it (and it chews up CPU). User can still override.
if (strstr(ptr, "0")) bUseECS = 0;
else bUseECS = (isDSiMode() ? 1 : 0); // For the DS-Lite/Phat, we ignore this directive that is so often set even when there is no advantage to using it (and it chews up CPU). User can still override.
}
}
@ -443,7 +444,19 @@ Rip* Rip::LoadBinCfg(const CHAR* configFile, UINT32 crc, size_t size)
}
}
fclose(cfgFile);
// ---------------------------------------------------------------------------------------------------
// If we didn't find a specific config for this game and ECS is enabled, default to frameskip=1
// This is because the secondary audio processor is expensive to emulate and the DSi will just barely
// keep up. So we default back to some small level of frameskip to ensure the game runs properly.
// The user is free to disable frameskip - or turn off the ECS handling if the game really isn't
// utilizing it (many .cfg files specify "ecs=1" when it has no real effect on the game).
// ---------------------------------------------------------------------------------------------------
if ((bConfigWasFound == FALSE) && bUseECS)
{
myConfig.frame_skip = 1;
}
// If we were asked to have 16-bit RAM in the 8000-9FFF region and we didn't get JLP enabled (which has its own RAM mapped there), we map new RAM
if (maybeRAMidx && !bUseJLP)
{

View File

@ -337,6 +337,7 @@ void dsShowEmuInfo(void)
{
sprintf(tmpStr, "Build Date: %s", __DATE__); dsPrintValue(0, idx++, 0, tmpStr);
sprintf(tmpStr, "CPU Mode: %s", isDSiMode() ? "DSI 134MHz 16MB":"DS 67MHz 4 MB"); dsPrintValue(0, idx++, 0, tmpStr);
sprintf(tmpStr, "Frame Skip: %s", myConfig.frame_skip ? "YES":"NO "); dsPrintValue(0, idx++, 0, tmpStr);
sprintf(tmpStr, "Binary Size: %-9u ", currentRip->GetSize()); dsPrintValue(0, idx++, 0, tmpStr);
sprintf(tmpStr, "Binary CRC: %08X ", currentRip->GetCRC()); dsPrintValue(0, idx++, 0, tmpStr);
sprintf(tmpStr, "Intellivoice: %s ", (bUseIVoice ? "YES":"NO")); dsPrintValue(0, idx++, 0, tmpStr);