mirror of
https://github.com/wavemotion-dave/NINTV-DS.git
synced 2025-06-18 22:05:37 -04:00
Version 4.7a with new option to enable key click and slight memory improvements so even larger games will load (future-proofing as no games are that large currently).
This commit is contained in:
parent
c1e975578d
commit
c3226a865c
2
Makefile
2
Makefile
@ -14,7 +14,7 @@ include $(DEVKITARM)/ds_rules
|
||||
|
||||
export TARGET := NINTV-DS
|
||||
export TOPDIR := $(CURDIR)
|
||||
export VERSION := 4.7
|
||||
export VERSION := 4.7a
|
||||
|
||||
ICON := -b $(CURDIR)/logo.bmp "NINTV-DS $(VERSION);wavemotion-dave;https://github.com/wavemotion-dave/NINTV-DS"
|
||||
|
||||
|
BIN
NINTV-DS.nds
BIN
NINTV-DS.nds
Binary file not shown.
@ -147,10 +147,10 @@ void CheatMenu(void)
|
||||
// -------------------------------------------------------------------------
|
||||
// Read the global nintv-ds.cht file and match it up with our current game
|
||||
// -------------------------------------------------------------------------
|
||||
extern char filebuf[];
|
||||
void LoadCheats(void)
|
||||
{
|
||||
u8 bFound = false;
|
||||
char filebuf[128];
|
||||
FILE *fp = NULL;
|
||||
|
||||
// --------------------------------------------
|
||||
|
@ -169,8 +169,8 @@ static void SetDefaultGameConfig(UINT32 crc)
|
||||
myConfig.offset_x = 0;
|
||||
myConfig.bLatched = 0;
|
||||
myConfig.fudgeTiming = 0;
|
||||
myConfig.spare3 = 0;
|
||||
myConfig.spare4 = 0;
|
||||
myConfig.key_click = 0;
|
||||
myConfig.bSkipBlanks = 0;
|
||||
myConfig.spare5 = 0;
|
||||
myConfig.spare6 = 0;
|
||||
myConfig.spare7 = 0;
|
||||
@ -193,7 +193,6 @@ static void SetDefaultGameConfig(UINT32 crc)
|
||||
// -----------------------------------------------------------------------------------------
|
||||
if (crc == 0x2DEACD15) myConfig.bLatched = true; // Stampede must have latched backtab access
|
||||
if (crc == 0x573B9B6D) myConfig.bLatched = true; // Masters of the Universe must have latched backtab access
|
||||
if (crc == 0x8AD19AB3) myConfig.frame_skip = 0; // B-17 Bomber no frame skip
|
||||
if (crc == 0x5F6E1AF6) myConfig.fudgeTiming = 2; // Motocross needs some fudge timing to run... known race condition...
|
||||
if (crc == 0xfab2992c) myConfig.controller_type = CONTROLLER_DUAL_ACTION_B; // Astrosmash is best with Dual Action B
|
||||
if (crc == 0xd0f83698) myConfig.controller_type = CONTROLLER_DUAL_ACTION_B; // Astrosmash (competition) is best with Dual Action B
|
||||
@ -202,6 +201,7 @@ static void SetDefaultGameConfig(UINT32 crc)
|
||||
if (crc == 0xc047d487) myConfig.controller_type = CONTROLLER_DUAL_ACTION_B; // Beauty and the Beast is best with Dual Action B
|
||||
if (crc == 0xc047d487) myConfig.dpad_config = DPAD_STRICT_4WAY; // Beauty and the Beast is best with Strict 4-way
|
||||
if (crc == 0xD8C9856A) myConfig.dpad_config = DPAD_DIAGONALS; // Q-Bert is best with diagonal
|
||||
if (crc == 0x8AD19AB3) myConfig.bSkipBlanks = true; // B-17 Bomber needs to skip rendering blanks or the screen 'flashes'
|
||||
}
|
||||
|
||||
|
||||
@ -360,6 +360,7 @@ void FindAndLoadConfig(UINT32 crc)
|
||||
{
|
||||
bConfigWasFound = TRUE;
|
||||
memcpy(&myConfig, &allConfigs.game_config[slot], sizeof(struct Config_t));
|
||||
if (crc == 0x8AD19AB3) myConfig.bSkipBlanks = true; // B-17 Bomber needs to skip rendering blanks or the screen 'flashes'
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -427,6 +428,8 @@ const struct options_t Option_Table[3][20] =
|
||||
{
|
||||
{"BACKTAB", {"NOT LATCHED", "LATCHED"}, &myConfig.bLatched, 2},
|
||||
{"CPU FUDGE", {"NONE", "LOW", "MEDIUM", "HIGH", "MAX"}, &myConfig.fudgeTiming, 5},
|
||||
{"KEYBD CLICK", {"NO" , "YES"}, &myConfig.key_click, 2},
|
||||
{"SKIP BLANKS", {"NO" , "YES"}, &myConfig.bSkipBlanks, 2},
|
||||
{NULL, {"", ""}, NULL, 1},
|
||||
},
|
||||
|
||||
|
@ -51,8 +51,8 @@ struct Config_t
|
||||
INT8 offset_x;
|
||||
UINT8 bLatched;
|
||||
UINT8 fudgeTiming;
|
||||
UINT8 spare3;
|
||||
UINT8 spare4;
|
||||
UINT8 key_click;
|
||||
UINT8 bSkipBlanks;
|
||||
UINT8 spare5;
|
||||
UINT8 spare6;
|
||||
UINT8 spare7;
|
||||
|
@ -69,8 +69,6 @@ UINT16 mobBuffers[8][128] __attribute__((section(".dtcm")));
|
||||
UINT8 fgcolor __attribute__((section(".dtcm"))) = 0;
|
||||
UINT8 bgcolor __attribute__((section(".dtcm"))) = 0;
|
||||
|
||||
UINT8 bRenderBlanks = TRUE; // Only B-17 Bomber sets this to false... still debugging it.
|
||||
|
||||
// Movable objects
|
||||
MOB mobs[8] __attribute__((section(".dtcm")));
|
||||
|
||||
@ -218,7 +216,7 @@ ITCM_CODE INT32 AY38900::tick(INT32 minimum) {
|
||||
if (!displayEnabled) {
|
||||
if (previousDisplayEnabled)
|
||||
{
|
||||
if (bRenderBlanks)
|
||||
if (myConfig.bSkipBlanks == 0)
|
||||
{
|
||||
UINT32 borderColor32 = color_repeat_table[borderColor];
|
||||
UINT32 *ptr = (UINT32 *)pixelBuffer;
|
||||
|
@ -121,7 +121,7 @@ ITCM_CODE INT32 AudioMixer::tick(INT32 minimum)
|
||||
extern UINT8 sp_idle;
|
||||
|
||||
UINT16 soundChannelsToProcess = audioProducerCount;
|
||||
if (bUseIVoice && sp_idle) soundChannelsToProcess--; // If ECS is idle we can skip processing it...
|
||||
if (bUseIVoice && sp_idle) soundChannelsToProcess--; // If the Intellivoice is idle we can skip processing it... Saves CPU time.
|
||||
|
||||
for (INT32 totalTicks = 0; totalTicks < minimum; totalTicks++)
|
||||
{
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define MAX_MAPPED_MEMORIES 144
|
||||
#define MAX_MAPPED_MEMORIES 250
|
||||
#define MAX_PERIPHERALS 4
|
||||
#define MAX_COMPONENTS 4
|
||||
#define MAX_ROMS 128
|
||||
#define MAX_RAM_ROM_SEGMENTS 128
|
||||
|
||||
extern UINT32 MAX_ROM_FILE_SIZE;
|
||||
|
||||
|
@ -41,7 +41,7 @@ Processor* Peripheral::GetProcessor(UINT16 i)
|
||||
|
||||
void Peripheral::AddRAM(RAM* m)
|
||||
{
|
||||
if (ramCount < MAX_ROMS)
|
||||
if (ramCount < MAX_RAM_ROM_SEGMENTS)
|
||||
{
|
||||
rams[ramCount] = m;
|
||||
ramCount++;
|
||||
@ -108,7 +108,7 @@ InputConsumer* Peripheral::GetInputConsumer(UINT16 i)
|
||||
|
||||
void Peripheral::AddROM(ROM* r)
|
||||
{
|
||||
if (romCount < MAX_ROMS)
|
||||
if (romCount < MAX_RAM_ROM_SEGMENTS)
|
||||
{
|
||||
roms[romCount] = r;
|
||||
romCount++;
|
||||
|
@ -227,9 +227,9 @@ class Peripheral
|
||||
UINT8 audioProducerCount;
|
||||
InputConsumer* inputConsumers[MAX_COMPONENTS];
|
||||
UINT8 inputConsumerCount;
|
||||
RAM* rams[MAX_ROMS];
|
||||
RAM* rams[MAX_RAM_ROM_SEGMENTS];
|
||||
UINT8 ramCount;
|
||||
ROM* roms[MAX_ROMS];
|
||||
ROM* roms[MAX_RAM_ROM_SEGMENTS];
|
||||
UINT8 romCount;
|
||||
};
|
||||
|
||||
|
@ -344,15 +344,6 @@ Rip* Rip::LoadBinCfg(const CHAR* configFile, UINT32 crc, size_t size)
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern UINT8 bRenderBlanks;
|
||||
bRenderBlanks = TRUE;
|
||||
// Special handling for B-17 Bomber
|
||||
if (db_entry->game_crc == 0x8AD19AB3)
|
||||
{
|
||||
bRenderBlanks = FALSE;
|
||||
}
|
||||
|
||||
// Now add the required peripherals...
|
||||
if (db_entry->bIntellivoice)
|
||||
{
|
||||
@ -464,8 +455,8 @@ Rip* Rip::LoadBinCfg(const CHAR* configFile, UINT32 crc, size_t size)
|
||||
// ------------------------------------------------------------------------
|
||||
// Make sure we haven't exceeded the maximum number of mapped ROM segments
|
||||
// ------------------------------------------------------------------------
|
||||
if (rip->GetRAMCount() >= MAX_ROMS) break;
|
||||
if (rip->GetROMCount() >= MAX_ROMS) break;
|
||||
if (rip->GetRAMCount() >= MAX_RAM_ROM_SEGMENTS) break;
|
||||
if (rip->GetROMCount() >= MAX_RAM_ROM_SEGMENTS) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -720,9 +711,6 @@ Rip* Rip::LoadRom(const CHAR* filename)
|
||||
// Load the ECS if asked for...
|
||||
if (bUseECS) rip->AddPeripheralUsage("ECS", (bUseECS == 3) ? PERIPH_OPTIONAL:PERIPH_REQUIRED);
|
||||
|
||||
extern UINT8 bRenderBlanks;
|
||||
bRenderBlanks = TRUE;
|
||||
|
||||
return rip;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ BOOL LoadCart(const CHAR* filename)
|
||||
// -----------------------------------------------------------------------
|
||||
void CheckFirstTimeLoad(void)
|
||||
{
|
||||
static bool bFirstTime = true;
|
||||
static UINT8 bFirstTime = true;
|
||||
|
||||
// First time in we use the config setting to determine where we open files...
|
||||
if (bFirstTime)
|
||||
@ -366,7 +366,7 @@ int intvFilescmp (const void *c1, const void *c2)
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
bool isFavorite(char *filename)
|
||||
{
|
||||
for (int i=0; i<64; i++)
|
||||
for (UINT8 i=0; i<64; i++)
|
||||
{
|
||||
if (myGlobalConfig.favorites[i] != 0x00000000)
|
||||
{
|
||||
@ -384,7 +384,7 @@ bool isFavorite(char *filename)
|
||||
// ----------------------------------------------------------------------------------------
|
||||
void setFavorite(char *filename)
|
||||
{
|
||||
for (int i=0; i<64; i++)
|
||||
for (UINT8 i=0; i<64; i++)
|
||||
{
|
||||
if (myGlobalConfig.favorites[i] == 0x00000000)
|
||||
{
|
||||
@ -400,7 +400,7 @@ void setFavorite(char *filename)
|
||||
// ----------------------------------------------------------------------------------------
|
||||
void clrFavorite(char *filename)
|
||||
{
|
||||
for (int i=0; i<64; i++)
|
||||
for (UINT8 i=0; i<64; i++)
|
||||
{
|
||||
if (myGlobalConfig.favorites[i] != 0x00000000)
|
||||
{
|
||||
@ -420,7 +420,7 @@ void clrFavorite(char *filename)
|
||||
// ----------------------------------------------------------------------------------------
|
||||
void intvFindFiles(void)
|
||||
{
|
||||
static bool bFirstTime = true;
|
||||
static UINT8 bFirstTime = true;
|
||||
DIR *pdir;
|
||||
struct dirent *pent;
|
||||
|
||||
|
@ -40,11 +40,12 @@ char man_buf[MAX_MAN_ROWS][MAX_MAN_COLS +1];
|
||||
extern Rip *currentRip;
|
||||
extern int bg0, bg0b,bg1b;
|
||||
|
||||
char filepath[32];
|
||||
char filebuf[128];
|
||||
|
||||
static void ReadManual(void)
|
||||
{
|
||||
u8 bFound = false;
|
||||
char filepath[32];
|
||||
char filebuf[128];
|
||||
FILE *fp = NULL;
|
||||
// Read the associated .man file and parse it...
|
||||
if (currentRip != NULL)
|
||||
@ -187,9 +188,9 @@ static void ReadManual(void)
|
||||
// -------------------------------------------------------------------------
|
||||
// Show one page (16 lines) of the manual starting at start_line
|
||||
// -------------------------------------------------------------------------
|
||||
char strBuf[MAX_MAN_COLS +1];
|
||||
void DisplayManualPage(UINT16 start_line)
|
||||
{
|
||||
char strBuf[MAX_MAN_COLS +1];
|
||||
UINT16 idx=0;
|
||||
for (UINT16 i=start_line; i<(start_line+ROWS_PER_PAGE); i++)
|
||||
{
|
||||
@ -208,7 +209,7 @@ void dsShowManual(void)
|
||||
{
|
||||
static UINT16 top_line = 0;
|
||||
static UINT32 last_crc=0;
|
||||
bool bDone=false;
|
||||
UINT8 bDone=false;
|
||||
int keys_pressed;
|
||||
static int last_keys = -1;
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include "printf.h"
|
||||
#include "CRC32.h"
|
||||
#include "mus_intro_wav.h"
|
||||
#include "keyclick_wav.h"
|
||||
#include "screenshot.h"
|
||||
|
||||
// --------------------------------------------------------
|
||||
@ -57,6 +58,8 @@ UINT8 bMetaSpeedup __attribute__((section(".dtcm"))) = false;
|
||||
UINT8 hud_x = 3;
|
||||
UINT8 hud_y = 0;
|
||||
|
||||
UINT16 keypad_pressed = 0;
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// This one is accessed rather often so we'll put it in .dtcm
|
||||
// -------------------------------------------------------------
|
||||
@ -660,8 +663,9 @@ void ds_handle_meta(int meta_key)
|
||||
}
|
||||
}
|
||||
|
||||
void poll_touch_screen(UINT16 ctrl_disc, UINT16 ctrl_keys, UINT16 ctrl_side)
|
||||
UINT8 poll_touch_screen(UINT16 ctrl_disc, UINT16 ctrl_keys, UINT16 ctrl_side)
|
||||
{
|
||||
UINT8 pad_pressed = 0;
|
||||
touchPosition touch;
|
||||
touchRead(&touch);
|
||||
#ifdef DEBUG_ENABLE
|
||||
@ -690,7 +694,7 @@ void poll_touch_screen(UINT16 ctrl_disc, UINT16 ctrl_keys, UINT16 ctrl_side)
|
||||
// ----------------------------------------------------------------------
|
||||
for (int i=0; i <= OVL_KEY_ENTER; i++)
|
||||
{
|
||||
if (touch.px > myOverlay[i].x1 && touch.px < myOverlay[i].x2 && touch.py > myOverlay[i].y1 && touch.py < myOverlay[i].y2) ds_key_input[ctrl_keys][i] = 1;
|
||||
if (touch.px > myOverlay[i].x1 && touch.px < myOverlay[i].x2 && touch.py > myOverlay[i].y1 && touch.py < myOverlay[i].y2) {ds_key_input[ctrl_keys][i] = 1; pad_pressed=1;}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@ -830,6 +834,8 @@ void poll_touch_screen(UINT16 ctrl_disc, UINT16 ctrl_keys, UINT16 ctrl_side)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pad_pressed;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
@ -879,7 +885,6 @@ ITCM_CODE void pollInputs(void)
|
||||
// Unless told otherwise, we are NOT in un-throttle mode...
|
||||
bMetaSpeedup = false;
|
||||
|
||||
|
||||
// If one of the NDS keys is pressed...
|
||||
if (keys_pressed & (KEY_UP | KEY_DOWN | KEY_LEFT | KEY_RIGHT | KEY_L | KEY_R | KEY_A | KEY_B | KEY_X | KEY_Y | KEY_SELECT | KEY_START))
|
||||
{
|
||||
@ -1198,8 +1203,17 @@ ITCM_CODE void pollInputs(void)
|
||||
// -----------------------------------------------------------------
|
||||
if (keys_pressed & KEY_TOUCH)
|
||||
{
|
||||
poll_touch_screen(ctrl_disc, ctrl_keys, ctrl_side);
|
||||
if (poll_touch_screen(ctrl_disc, ctrl_keys, ctrl_side)) // Returns non-zero if we pressed one of the 12 keypad keys
|
||||
{
|
||||
if (++keypad_pressed == 3) // Need to see it pressed for several frames
|
||||
{
|
||||
if (myConfig.key_click)
|
||||
{
|
||||
soundPlaySample(keyclick_wav, SoundFormat_16Bit, keyclick_wav_size, 44100, 127, 64, false, 0);
|
||||
}
|
||||
}
|
||||
} else keypad_pressed = 0;
|
||||
} else keypad_pressed = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1230,7 +1244,6 @@ void dsShowScreenMain(bool bFull, bool bPlayJingle)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hud_x = 3;
|
||||
hud_y = 0;
|
||||
|
||||
@ -1252,13 +1265,13 @@ void dsShowScreenMain(bool bFull, bool bPlayJingle)
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
void dsInitScreenMain(void)
|
||||
{
|
||||
vramSetBankB(VRAM_B_LCD ); // Not using this for video but 128K of faster RAM always useful! Mapped at 0x06820000 - Used for Memory Bus Read Counter
|
||||
vramSetBankD(VRAM_D_LCD ); // Not using this for video but 128K of faster RAM always useful! Mapped at 0x06860000 - Used for Cart "Fast Buffer" 64k x 16 = 128k
|
||||
vramSetBankE(VRAM_E_LCD ); // Not using this for video but 64K of faster RAM always useful! Mapped at 0x06880000 - Used for Custom Tile Overlay Buffer (60K for tile[] buffer, 4K for map[] buffer)
|
||||
vramSetBankF(VRAM_F_LCD ); // Not using this for video but 16K of faster RAM always useful! Mapped at 0x06890000 - Slow 8-bit RAM buffer for ECS and games like USFC Chess and Land Battle (8K)
|
||||
vramSetBankG(VRAM_G_LCD ); // Not using this for video but 16K of faster RAM always useful! Mapped at 0x06894000 - JLP RAM Buffer (8K Words or 16K Bytes)
|
||||
vramSetBankH(VRAM_H_LCD ); // Not using this for video but 32K of faster RAM always useful! Mapped at 0x06898000 - Slow 16-bit RAM buffer (16K Words or 32K Bytes)
|
||||
vramSetBankI(VRAM_I_LCD ); // Not using this for video but 16K of faster RAM always useful! Mapped at 0x068A0000 - Unused
|
||||
vramSetBankB(VRAM_B_LCD); // Not using this for video but 128K of faster RAM always useful! Mapped at 0x06820000 - Used for Memory Bus Read Counter
|
||||
vramSetBankD(VRAM_D_LCD); // Not using this for video but 128K of faster RAM always useful! Mapped at 0x06860000 - Used for Cart "Fast Buffer" 64k x 16 = 128k
|
||||
vramSetBankE(VRAM_E_LCD); // Not using this for video but 64K of faster RAM always useful! Mapped at 0x06880000 - Used for Custom Tile Overlay Buffer (60K for tile[] buffer, 4K for map[] buffer)
|
||||
vramSetBankF(VRAM_F_LCD); // Not using this for video but 16K of faster RAM always useful! Mapped at 0x06890000 - Slow 8-bit RAM buffer for ECS and games like USFC Chess and Land Battle (8K)
|
||||
vramSetBankG(VRAM_G_LCD); // Not using this for video but 16K of faster RAM always useful! Mapped at 0x06894000 - JLP RAM Buffer (8K Words or 16K Bytes)
|
||||
vramSetBankH(VRAM_H_LCD); // Not using this for video but 32K of faster RAM always useful! Mapped at 0x06898000 - Slow 16-bit RAM buffer (16K Words or 32K Bytes)
|
||||
vramSetBankI(VRAM_I_LCD); // Not using this for video but 16K of faster RAM always useful! Mapped at 0x068A0000 - Unused
|
||||
|
||||
WAITVBL;
|
||||
}
|
||||
|
BIN
extras.zip
BIN
extras.zip
Binary file not shown.
Loading…
Reference in New Issue
Block a user