From 2972902c7256277b888b848ac1a9a4c6c41156f7 Mon Sep 17 00:00:00 2001 From: wavemotion-dave <75039837+wavemotion-dave@users.noreply.github.com> Date: Sun, 13 Dec 2020 10:29:09 -0500 Subject: [PATCH] Highscore Cart (highscore.rom) supported for any game that uses it. Minor TIA speedups and improvements. --- A7800DS.nds | Bin 376320 -> 377856 bytes Makefile | 2 +- arm9/source/a7800utils.c | 9 +- arm9/source/emu/Cartridge.c | 131 +++++++++++++++++- arm9/source/emu/Cartridge.h | 3 + arm9/source/emu/Database.c | 265 ++++++++++++++++++------------------ arm9/source/emu/Memory.c | 18 ++- arm9/source/emu/ProSystem.c | 1 + arm9/source/emu/Tia.h | 5 + arm9/source/emu/Tia.itcm.c | 35 ++++- readme.txt | 6 + 11 files changed, 332 insertions(+), 143 deletions(-) diff --git a/A7800DS.nds b/A7800DS.nds index 148b5c89949fc24258d09edeea75bdb3aa9a3f42..1e3eb31d5a9b23663a54e5dc2ff85933c49b441e 100644 GIT binary patch delta 16913 zcmbt+4P2B}+V?qU?tu{zM?^wI9FY_iaX$#aeVhB(f=A zgp%zq{+Y_R-!a#1g$cP7Lxf>Bs}pDrA3gDz3!jrgWMA>z~>Eus0U`bR<)g=Ns@tTgHm4x-TdDFYDHse>1yv;d73oN4UN%{z%)T zRltX`<<_- zbhM|F4I%qMn}}@j6%hb@iJhIeFeGr1a-4M*tP2;dlRVCxiv81dRpFYPM%FiZ5(Sv58hz2td7S4 zvY!om1nTlBF{|u7yPN2fCI`L!o}qqXj+vBJTOxlZUB63)swv!l$zz1R)P77~pt#?O&udYw08!GWlhFLazCK*I(n zgUrYVd}!NHN7J|=*PF9Toz=#_IVjICYRz<1%4Bu0RBN3EmADk!?BJ;zYbkv&(hq)WPFvfcVC^#-YqU>qu1PTLaF*LkokCyZ2(Q`Uv@#S{Q{^myE~4fO=U#cn zoIYdLKpSh{;pBQ=%j|aNGRTScFA$c+nQ16>n%E8}v!8X&MXp%L%vj}2GlH@lC)3OO z=k$*XpDP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2GAhTH$l6At_2MQ{S#@&4zA>wme(*- zrXy9DmG_;}BYcJOt5X{0^Qs0{#Zb=HO~bVoK5f$x?MS|K(`{{+X(NzAckmA5u8NUc z?fA*9rdpUAjzOjtr%T_|`g9$ZE{CV#Dr47mf#KBhXA!|CIP=q0#+s9ex# z4Q(|hRhU9_qmT9pP}@}>ZEt)gKCT3|b1N3M)4u9b)cb0qC?VKS+t2IL2e@K+Tp91D z-KeLl#4Y}K3H(60;-}r!Mz-boYxCNNR-@rP_l*zXuMDWst;j%s&Uonq+xSrJ#t^9l zf0B4$nWmZlIYui|#Nh(m01B}gt=edz8N}u&k8Rg}ub6je1O6|P?Xlh3y&|tztGC47 zJo1~?7<;qs4vV-|MO@Doe6KaK``PD)BfN*!6nnGyH>o;@$+wd2<0&xDIc4rtS;8JA2_l3xv_o| zf_i9;oigxEdK1t6y^DukE;inE@!4<6r^VV(ORs;C@A)=GcW~u 0x24 case WSYNC: diff --git a/arm9/source/emu/ProSystem.c b/arm9/source/emu/ProSystem.c index 4f9e818..a64ccfd 100644 --- a/arm9/source/emu/ProSystem.c +++ b/arm9/source/emu/ProSystem.c @@ -66,6 +66,7 @@ void prosystem_Reset( ) { cartridge_Store( ); } + cartridge_LoadHighScoreCart(); prosystem_cycles = sally_ExecuteRES( ); prosystem_active = true; } diff --git a/arm9/source/emu/Tia.h b/arm9/source/emu/Tia.h index 3070fb6..279db55 100644 --- a/arm9/source/emu/Tia.h +++ b/arm9/source/emu/Tia.h @@ -46,9 +46,14 @@ #include "shared.h" +extern byte tia_audc[2]; +extern byte tia_audf[2]; +extern byte tia_audv[2]; + extern void tia_Reset( ); extern void tia_SetRegister(word address, byte data); +extern void tia_MemoryChannel(byte channel); extern void tia_Clear( ); extern void tia_Process(uint length); extern byte tia_buffer[TIA_BUFFER_SIZE]; diff --git a/arm9/source/emu/Tia.itcm.c b/arm9/source/emu/Tia.itcm.c index 3c6905a..a14347e 100644 --- a/arm9/source/emu/Tia.itcm.c +++ b/arm9/source/emu/Tia.itcm.c @@ -45,6 +45,7 @@ byte tia_buffer[TIA_BUFFER_SIZE] = {0}; uint tia_size = 524; +extern int debug[]; static const byte TIA_POLY4[ ] = {1,1,0,1,1,1,0,0,0,0,1,0,1,0,0}; static const byte TIA_POLY5[ ] = {0,0,1,0,1,1,0,0,1,1,1,1,1,0,0,0,1,1,0,1,1,1,0,1,0,1,0,0,0,0,1}; @@ -53,9 +54,9 @@ static const byte TIA_DIV31[ ] = {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, static byte tia_volume[2] = {0}; static byte tia_counterMax[2] = {0}; static byte tia_counter[2] = {0}; -static byte tia_audc[2] = {0}; -static byte tia_audf[2] = {0}; -static byte tia_audv[2] = {0}; +byte tia_audc[2] = {0}; +byte tia_audf[2] = {0}; +byte tia_audv[2] = {0}; static uint tia_poly4Cntr[2] = {0}; static uint tia_poly5Cntr[2] = {0}; static uint tia_poly9Cntr[2] = {0}; @@ -132,7 +133,7 @@ void tia_SetRegister(word address, byte data) { byte channel=0; byte frequency; - + switch(address) { case AUDC0: tia_audc[0] = data & 15; @@ -183,6 +184,32 @@ void tia_SetRegister(word address, byte data) } } +void tia_MemoryChannel(byte channel) +{ + byte frequency = 0; + if(tia_audc[channel] == 0) + { + tia_volume[channel] = tia_audv[channel]; + } + else + { + frequency = tia_audf[channel] + 1; + if(tia_audc[channel] > 11) + { + frequency *= 3; + } + } + + if(frequency != tia_counterMax[channel]) + { + tia_counterMax[channel] = frequency; + if(tia_counter[channel] == 0 || frequency == 0) + { + tia_counter[channel] = frequency; + } + } +} + // -------------------------------------------------------------------------------------- // Process // -------------------------------------------------------------------------------------- diff --git a/readme.txt b/readme.txt index cf6e511..5abae81 100644 --- a/readme.txt +++ b/readme.txt @@ -20,6 +20,12 @@ http://www.portabledev.com -------------------------------------------------------------------------------- History : -------------------------------------------------------------------------------- +V1.4 : 13-Dec-2020 by wavemotion-dave + * Implemented Hiscore Saving per the HSC cart. Put the 4k highscore.rom (don't ask) + where your ROMs live. If found, it will enable saving of high scores + on all 9 original games (Asteroids, Joust, Centipede, Xevious, Dig Dug, Galaga, + Food Fight, Ms Pac-Man and Robotron) as well as most of the newer homebrews. + V1.3 : 12-Dec-2020 by wavemotion-dave * Backported some fixes and emulation timing improvments from Prosystem 1.3g plus the Wii version. Renders a few more games playable.