Skip to content

Commit

Permalink
V2.3 : 10-Oct-2021 by wavemotion-dave
Browse files Browse the repository at this point in the history
  * New Custom Overlay Guide (see extras folder)
  * New Manual/Instructions Support (see extras folder)
  * Improved speed, reduced memory usage
  * Full JLP flash support
  * DS-LITE/PHAT sound improvment
  • Loading branch information
wavemotion-dave committed Oct 10, 2021
1 parent 75b6361 commit b08b329
Show file tree
Hide file tree
Showing 9 changed files with 977 additions and 272 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include $(DEVKITARM)/ds_rules

export TARGET := NINTV-DS
export TOPDIR := $(CURDIR)
export VERSION := 2.2a
export VERSION := 2.3

ICON := -b $(CURDIR)/logo.bmp "NINTV-DS $(VERSION);wavemotion-dave;https://github.com/wavemotion-dave/NINTV-DS"

Expand Down
Binary file modified NINTV-DS.nds
Binary file not shown.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Features :
* Many games run very close to full speed on the older DS-LITE and
DS-PHAT hardware but you can play with config settings to get the
most out of these games (even if you have to disable sound to gain the speed).
* Custom Overlay Support. See the 'extras' folder for details.
* Manual instruction Support. See the 'extras' folder for an example.

* JLP support for accelerated functions and RAM is supported. When loading a game,
use the X button to load and force JLP support ON.
Expand Down Expand Up @@ -49,6 +51,13 @@ The NINTV-DS emulator is offered as-is, without any warranty.
--------------------------------------------------------------------------------
History :
--------------------------------------------------------------------------------
V2.3 : 10-Oct-2021 by wavemotion-dave
* New Custom Overlay Guide (see extras folder)
* New Manual/Instructions Support (see extras folder)
* Improved speed, reduced memory usage
* Full JLP flash support
* DS-LITE/PHAT sound improvment

V2.2 : 07-Oct-2021 by wavemotion-dave
* Stampede graphics fixed.
* Minor artifacts in Masters of the Universe fixed.
Expand Down
Binary file modified arm9/gfx/bgTop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 29 additions & 10 deletions arm9/source/ds_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ typedef enum _RunState
bool bStartSoundFifo = false;
bool bUseJLP = false;
bool bForceIvoice=false;
bool bInitEmulator=false;

RunState runState = Stopped;
Emulator *currentEmu = NULL;
Expand All @@ -62,7 +63,7 @@ VideoBus *videoBus = NULL;
AudioMixer *audioMixer = NULL;

int debug1, debug2;
UINT16 emu_frames=1;
UINT16 emu_frames=0;
UINT16 frames=0;


Expand Down Expand Up @@ -283,7 +284,7 @@ BOOL LoadCart(const CHAR* filename)
dsShowScreenEmu();
dsShowScreenMain(false);
bFirstGameLoaded = TRUE;

bInitEmulator = true;
return TRUE;
}

Expand Down Expand Up @@ -326,10 +327,15 @@ BOOL LoadPeripheralRoms(Peripheral* peripheral)

void reset_emu_frames(void)
{
TIMER1_CR = 0;
TIMER1_DATA = 0;
TIMER1_CR=TIMER_ENABLE | TIMER_DIV_1024;

TIMER0_CR=0;
TIMER0_DATA=0;
TIMER0_CR=TIMER_ENABLE|TIMER_DIV_1024;
emu_frames=1;
TIMER0_CR=TIMER_ENABLE | TIMER_DIV_1024;
emu_frames=0;
frames=0;
}

BOOL InitializeEmulator(void)
Expand Down Expand Up @@ -377,9 +383,15 @@ BOOL InitializeEmulator(void)
}
}

// No audio to start... it will turn on 1 frame in...
TIMER2_CR=0; irqDisable(IRQ_TIMER2);

//hook the audio and video up to the currentEmulator
currentEmu->InitVideo(videoBus,currentEmu->GetVideoWidth(),currentEmu->GetVideoHeight());
currentEmu->InitAudio(audioMixer, SOUND_FREQ);

// Clear the audio mixer...
audioMixer->resetProcessor();

//put the RIP in the currentEmulator
currentEmu->SetRip(currentRip);
Expand All @@ -393,6 +405,7 @@ BOOL InitializeEmulator(void)
// And put the Sound Fifo back at the start...
bStartSoundFifo = true;

// Make sure we're starting fresh...
reset_emu_frames();

return TRUE;
Expand Down Expand Up @@ -519,7 +532,6 @@ void ds_handle_meta(int meta_key)
if (LoadCart(newFile))
{
dsInitPalette();
InitializeEmulator();
}
else
{
Expand All @@ -536,8 +548,6 @@ void ds_handle_meta(int meta_key)
reset_emu_frames();
dsInitPalette();
WAITVBL;WAITVBL;WAITVBL;WAITVBL;WAITVBL;WAITVBL;
touchPosition touch;
touchRead(&touch);
break;

case OVL_META_SCORES:
Expand Down Expand Up @@ -933,14 +943,13 @@ ITCM_CODE void Run(char *initial_file)
if (LoadCart(initial_file))
{
dsInitPalette();
InitializeEmulator();
}
}

while(runState == Running)
{
// Time 1 frame...
while(TIMER0_DATA < (target_frame_timing[myConfig.target_fps]*emu_frames))
while(TIMER0_DATA < (target_frame_timing[myConfig.target_fps]*(emu_frames+1)))
;

// Have we processed target (default 60) frames... start over...
Expand All @@ -951,11 +960,21 @@ ITCM_CODE void Run(char *initial_file)

//poll the input
pollInputs();

if (bInitEmulator) // If the inputs told us we loaded a new file... cleanup and start over...
{
InitializeEmulator();
bInitEmulator = false;
continue;
}

if (bFirstGameLoaded)
{
//flush the audio - normaly this would be done AFTER run/render but this gives us maximum accuracy on audio timing
currentEmu->FlushAudio();
if (!bStartSoundFifo)
{
currentEmu->FlushAudio();
}

//run the emulation
currentEmu->Run();
Expand Down
Binary file added extras/Custom Overlay Guide.pdf
Binary file not shown.
Loading

0 comments on commit b08b329

Please sign in to comment.