From a62f570458620fc21dc2dbc1cdd087a172a4ffac Mon Sep 17 00:00:00 2001 From: Slyvtt Date: Fri, 15 Apr 2022 21:06:51 +0200 Subject: [PATCH] current status - before debug session --- CMakeLists.txt | 1 + Demo.layout | 22 +++++------ assets-cg/fontFantasy.png | Bin 0 -> 1894 bytes assets-cg/fxconv-metadata.txt | 8 ++++ capture | 1 + send | 1 + src/clock.c | 69 +++++++++------------------------- src/main.c | 8 ++-- 8 files changed, 44 insertions(+), 66 deletions(-) create mode 100644 assets-cg/fontFantasy.png create mode 100755 capture create mode 100755 send diff --git a/CMakeLists.txt b/CMakeLists.txt index 98447b3..93f6ec5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ set(ASSETS_cg assets-cg/fontmatrix.png assets-cg/SlyVTT.png assets-cg/Selection.png + assets-cg/fontFantasy.png ) fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA) diff --git a/Demo.layout b/Demo.layout index 354c1bd..4dbcea6 100644 --- a/Demo.layout +++ b/Demo.layout @@ -2,29 +2,29 @@ + + + + + + + + + + - - - - - - - - - - - + diff --git a/assets-cg/fontFantasy.png b/assets-cg/fontFantasy.png new file mode 100644 index 0000000000000000000000000000000000000000..0b9333903139a2b0d30f27ee572247976ba76583 GIT binary patch literal 1894 zcmV-s2buVZP)002A)0ssI2ZV4tr0004nX+uL$Nkc;* zaB^>EX>4Tx04R}tkv&MmKpe$iQ>CIU4t7v+$WWauh>AK&6^me@v=v%)FuC+YXws0R zxHt-~1qVMCs}3&Cx;nTDg5U>;o12rOi`@MGpoLMhMdqGxbDzAp_6xbq^n3@1i`*``n)+q~uKo_(bAarW+RVI`Pz| zrE}gV4zrS^5T6r|8gxP8N3P2*zi}=)Ebz>*kx9)Fhl#~v8_R9XN`^{2NgPpBjq-)8 z%L?Z$&T6^Jn)l={4Cb}vG}mbkA&x~Pkc0>sRcxRP3sG7%QcR?1Kjz^dbo@zj$>iDq zBgZ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d{_jitQV!326pGiPIy`l~?4>QwFW)(gMd z(QYJbBU!tAajBaGt8E0{>{_k)>l+C1duAeY^UGX1TqExF4;#IjKd9Ch#K`gOgIO!@&jK)5=^L0%99{kSly@xhNMHGd(lZC^N1%E(#_H z&dd!1hnY?m_*n%YzS>bR*AHcQVXQC~aZ?!poXpR9n8{*V<}Z*XNyfYXY8v?@612#) zFt8DLiW~ALyZ?#<0d^Ytd~f$*R`1a~5^Z31v0Uy9xG>(uA&k_LsMcTfq9efR&*x;V gL%}wZwaeu42cL1my_;3iQUCw|07*qoM6N<$f}C85y#N3J literal 0 HcmV?d00001 diff --git a/assets-cg/fxconv-metadata.txt b/assets-cg/fxconv-metadata.txt index e4136f5..d69fd3f 100644 --- a/assets-cg/fxconv-metadata.txt +++ b/assets-cg/fxconv-metadata.txt @@ -34,3 +34,11 @@ Selection.png: profile: p8 name: Selection +fontFantasy.png: + type: font + charset: print + name: font_fantasy + grid.size: 8x8 + grid.padding: 1 + proportional: true + diff --git a/capture b/capture new file mode 100755 index 0000000..0332a60 --- /dev/null +++ b/capture @@ -0,0 +1 @@ +fxlink -iw diff --git a/send b/send new file mode 100755 index 0000000..273aa57 --- /dev/null +++ b/send @@ -0,0 +1 @@ +fxlink -sw *.g3a diff --git a/src/clock.c b/src/clock.c index 79224a1..9dfb22c 100644 --- a/src/clock.c +++ b/src/clock.c @@ -58,32 +58,22 @@ uint32_t initTimersTCNT[3]; uint32_t initTimersTCOR[3]; uint32_t newTimersTCNT[3]; uint32_t newTimersTCOR[3]; -int initPphi; -int newPphi; +uint32_t initPphi; +uint32_t newPphi; -static int getPphi_sh7305(void) + +// Return the value of Pphi_Freq as per the current overclocking configuration +uint32_t getPphi_sh7305(void) { - /* The meaning of the PLL setting on SH7305 differs from the - documentation of SH7224; the value must not be doubled. */ - int pll = CPG.FRQCR.STC + 1; + uint32_t fll_freq; + uint32_t pll_freq; + uint32_t per_freq; + fll_freq = (SH7305_CPG.FLLFRQ.FLF * 32768) / (1 << SH7305_CPG.FLLFRQ.SELXM); + pll_freq = fll_freq * (SH7305_CPG.FRQCR.STC + 1); + per_freq = pll_freq / (1 << (SH7305_CPG.FRQCR.P1FC + 1)); - /* The FLL ratio is the value of the setting, halved if SELXM=1 */ - int fll = CPG.FLLFRQ.FLF; - if(CPG.FLLFRQ.SELXM == 1) fll >>= 1; - - /* On SH7724, the divider ratio is given by 1 / (setting + 1), but on - the SH7305 it is 1 / (2^setting + 1). */ - - int divb = CPG.FRQCR.BFC; - int divi = CPG.FRQCR.IFC; - int divp = CPG.FRQCR.P1FC; - - /* Deduce the input frequency of divider 1 */ - int base = 32768; - if(CPG.PLLCR.FLLE) base *= fll; - if(CPG.PLLCR.PLLE) base *= pll; - return (base >> (divp + 1)); + return per_freq; } //We list all running timers and store this in a table (true/false) @@ -91,16 +81,9 @@ void listTimerStatus( void ) { for(int k=0;k<3; k++) { - if(k < 3) - { tmu_t *T = &TMU[k]; - runningTimers[k]= (!T->TCR.UNIE && !(*TSTR & (1 << k))); - } -// else -// { -// etmu_t *T = &ETMU[k-3]; -// runningTimers[k]= (!T->TCR.UNIE && !T->TSTR); -// } + //runningTimers[k]= (!T->TCR.UNIE && !(*TSTR & (1 << k))); + runningTimers[k] = (T->TCNT!=0xffffffff || T->TCOR!=0xffffffff); // as per Lephe's proposal for Libprof compatibility } } @@ -112,18 +95,9 @@ void getInitialTimersParameters( void ) { if (runningTimers[k]==true) { - if(k < 3) - { tmu_t *T = &TMU[k]; initTimersTCNT[k]= T->TCNT; initTimersTCOR[k]= T->TCOR; - } -// else -// { -// etmu_t *T = &ETMU[k-3]; -// initTimersTCNT[k]= T->TCNT; -// initTimersTCOR[k]= T->TCOR; -// } } } } @@ -142,25 +116,18 @@ void updateNewTimersParameters( void ) if (runningTimers[k]==true) { timer_stop( k ); - if(k < 3) - { + tmu_t *T = &TMU[k]; T->TCNT = newTimersTCNT[k]; T->TCOR = newTimersTCOR[k]; - } -// else -// { -// etmu_t *T = &ETMU[k-3]; -// T->TCNT = newTimersTCNT[k]; -// T->TCOR = newTimersTCOR[k]; -// } + timer_start(k); } } } //We compute the new TCNT and new TCOR -void computeNewTimersParameters( int initPphi_f, int newPphi_f ) +void computeNewTimersParameters( uint32_t initPphi_f, uint32_t newPphi_f ) { for(int k=0;k<3; k++) { @@ -177,8 +144,6 @@ static overclock_level current_clock_state = OC_Default; bool overclock_config_changed = false; - - void SetOCDefault( void ) { BSC.CS0WCR.WR = WAIT18; diff --git a/src/main.c b/src/main.c index 33461a9..5e9f13d 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,7 @@ uint8_t pagevisible=0; bool screenshot = false; bool record = false; +extern font_t font_fantasy; size_t image_size_profile(int profile, int width, int height) { @@ -1231,9 +1232,6 @@ int main(void) init_module1(); - - dfont(&matrix); - while(!stop) { dt = ((float) time_render / 1000.0); @@ -1243,6 +1241,8 @@ int main(void) dclear(C_BLACK); + dfont( &matrix ); + if (skip_intro==false) { run_intro(); @@ -1280,6 +1280,8 @@ int main(void) } } + dfont(&font_fantasy); + dprint(1,1, C_WHITE, "FPS %.0f", (float) (1000.0f/dt) ); dprint(1,15, C_WHITE, "OC STAT %d", valueOC );