From 9f5c8403d9efce7d814cb172b02e514e3659c221 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Sun, 29 Apr 2018 17:28:38 -0700 Subject: [PATCH] Add timer compre event and register accessors --- currentProblems.txt | 2 + qtBuildSystem/Mu/Mu.pro.user | 534 ++++++++++++++++---------------- src/hardwareRegisters.c | 4 + src/hardwareRegistersTiming.c.h | 6 + unimplementedFeatures.txt | 1 + 5 files changed, 280 insertions(+), 267 deletions(-) diff --git a/currentProblems.txt b/currentProblems.txt index e38d4f7..e082c8f 100644 --- a/currentProblems.txt +++ b/currentProblems.txt @@ -1,3 +1,5 @@ +//stuck on timer wait, inside interrupt level 6 handler +CPU wrote 16 bits of 0x00000000 to register 0x60A, PC 0x10083BF0. #define kChannelSet1 \ kChannelTemp0, \ diff --git a/qtBuildSystem/Mu/Mu.pro.user b/qtBuildSystem/Mu/Mu.pro.user index bc14e15..e658ffb 100644 --- a/qtBuildSystem/Mu/Mu.pro.user +++ b/qtBuildSystem/Mu/Mu.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -8,7 +8,7 @@ ProjectExplorer.Project.ActiveTarget - 1 + 0 ProjectExplorer.Project.EditorSettings @@ -58,6 +58,271 @@ ProjectExplorer.Project.Target.0 + + Desktop Qt 5.10.1 clang 64bit + Desktop Qt 5.10.1 clang 64bit + qt.qt5.5101.clang_64_kit + 0 + 0 + 0 + + /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Mu + + Qt4ProjectManager.Qt4RunConfiguration:/Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/Mu/Mu.pro + true + + Mu.pro + false + + /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Debug/Mu.app/Contents/MacOS + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.Target.1 Android for armeabi-v7a (GCC 4.9, Qt 5.10.1 for Android armv7) Android for armeabi-v7a (GCC 4.9, Qt 5.10.1 for Android armv7) @@ -374,271 +639,6 @@ 1 - - ProjectExplorer.Project.Target.1 - - Desktop Qt 5.10.1 clang 64bit - Desktop Qt 5.10.1 clang 64bit - qt.qt5.5101.clang_64_kit - 0 - 0 - 0 - - /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Debug - - - true - qmake - - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - true - - - /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Release - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - - /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Profile - - - true - qmake - - QtProjectManager.QMakeBuildStep - true - - false - true - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - 3 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy Configuration - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Mu - - Qt4ProjectManager.Qt4RunConfiguration:/Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/Mu/Mu.pro - true - - Mu.pro - false - - /Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/qtBuildSystem/build-Mu-Desktop_Qt_5_10_1_clang_64bit-Debug/Mu.app/Contents/MacOS - 3768 - false - true - false - false - true - - 1 - - ProjectExplorer.Project.TargetCount 2 diff --git a/src/hardwareRegisters.c b/src/hardwareRegisters.c index ff4b2af..475004a 100644 --- a/src/hardwareRegisters.c +++ b/src/hardwareRegisters.c @@ -466,6 +466,8 @@ unsigned int getHwRegister16(unsigned int address){ case TCMP2: case TPRER1: case TPRER2: + case TSTAT1: + case TSTAT2: case SPICONT2: case SPIDATA2: //simple read, no actions needed @@ -821,6 +823,8 @@ void setHwRegister16(unsigned int address, unsigned int value){ case TCMP2: case TPRER1: case TPRER2: + case TSTAT1: + case TSTAT2: case SPIDATA2: //simple write, no actions needed registerArrayWrite16(address, value); diff --git a/src/hardwareRegistersTiming.c.h b/src/hardwareRegistersTiming.c.h index 58839f8..cfe63ae 100644 --- a/src/hardwareRegistersTiming.c.h +++ b/src/hardwareRegistersTiming.c.h @@ -139,6 +139,9 @@ static inline void timer12Clk32(){ setIprIsrBit(INT_TMR1); } + //set timer triggered bit + registerArrayWrite16(TSTAT1, registerArrayRead16(TSTAT1) | 0x0001); + if(!(timer1Control & 0x0100)){ //not free running, reset to 0, to prevent loss of ticks after compare event just subtract timerXCompare timer1Count -= timer1Compare; @@ -185,6 +188,9 @@ static inline void timer12Clk32(){ setIprIsrBit(INT_TMR2); } + //set timer triggered bit + registerArrayWrite16(TSTAT2, registerArrayRead16(TSTAT2) | 0x0001); + if(!(timer2Control & 0x0100)){ //not free running, reset to 0, to prevent loss of ticks after compare event just subtract timerXCompare timer2Count -= timer2Compare; diff --git a/unimplementedFeatures.txt b/unimplementedFeatures.txt index 1c68bdd..4517066 100644 --- a/unimplementedFeatures.txt +++ b/unimplementedFeatures.txt @@ -21,6 +21,7 @@ interrupt control register (ICR), POL5 and edge trigger selects ADC7846 temperature sensors ADC7846 dock sensor some undocumented I/O might be on port e and port j +timers shouldn't allow comp bits to be cleared until read with a 1 in them and should remain in interrupt state until they are cleared(this is unverified) Debug tools: missing icons