Bring over changes from kernel 1.10 update.

Changelog from official 1.10 update.

* Updated the embedded gbc emulator to Jagoombacolor 0.5, credited to
EvilJagaGenius, FluBBa, Dwedit, Minucce, Sterophonick, Nuvie, Radimerry,
Therealteamplayer and other contributors.
* Added the addon support for Goodboy Galaxy for GBA v1.2.
* Upgrade FatFs library to v0.15

Note that the FatFS library update I had already ported over from DE
kernel but official build of kernel now has this. :P
This commit is contained in:
ApacheThunder 2024-09-05 23:28:37 -05:00
parent d489524a8d
commit 4f16d4d4ae
4 changed files with 2727 additions and 2670 deletions

View File

@ -255,6 +255,11 @@ void IWRAM_CODE PatchInternal(u32* Data,int iSize,u32 offset)
Add2(ii, 0x3007FF4);//0x3007FFCµÄλÖÃ
}
break;
case 0x3FFFFFC:
{
Add2(ii, 0x3007FF4);
}
break;
}
}
}
@ -596,6 +601,7 @@ void GBApatch_PSRAM(u32* address,int filesize)//Only once
PatchNes(address);
PatchDragonBallZ(address);
Check_Fire_Emblem();
Patch_somegame(address);
if( (gl_rts_on==1) && (gl_cheat_on == 0) && (gl_reset_on == 0) && (gl_sleep_on == 0) ) {
spend_address = Get_spend_address(address);
@ -639,6 +645,7 @@ void GBApatch_NOR(u32* address,int filesize,u32 offset)
B_install_handler = 0xEA000000|((iTrimSize-8)/4);
Write(0,(u8*)&B_install_handler , 4); //B
spend_address = Get_spend_address(address);
Patch_somegame(address);
}
PatchNes(address);
PatchDragonBallZ(address);
@ -947,6 +954,7 @@ u32 use_internal_engine(u8 gamecode[])
{
u32 i;
u32 count0x3007FFC=0;
u32 result=0;
g_Offset = 0;
@ -956,12 +964,15 @@ u32 use_internal_engine(u8 gamecode[])
count0x3007FFC = ((vu32*)pReadCache)[i+1];
if( ((vu32*)pReadCache)[i] == *(vu32*)gamecode )
{
{
result =1;
break;
}
i += (count0x3007FFC+1);
}
if(result==0)return 0;
#ifdef DEBUG
//DEBUG_printf("%d: %X VS %X %x",i,((vu32*)pReadCache)[i],*(vu32*)gamecode,count0x3007FFC);
//wait_btn();
@ -972,7 +983,7 @@ u32 use_internal_engine(u8 gamecode[])
{
Add2(((vu32*)pReadCache)[i+ii], 0x3007FF4);//0x3007FFC offset
}
return 1;
return result;
}
//------------------------------------------------------------------
void Patch_SpecialROM_sleepmode(void)
@ -1396,4 +1407,24 @@ void Check_Fire_Emblem(void)
else{
Set_AUTO_save(0x01);
}
}
}
//------------------------------------------------------------------
void Patch_somegame(u32 *Data)
{
u32 size = 0x7FF0;
if( *(u32*)GAMECODE == 0x50424732 )
{
for(u32 ii=0;ii<0x100;ii++)
{
if(0x3000000==Data[ii])
{
if(0x8000 ==Data[ii+1] )
{
Write((ii+1)*4,(u8*)&size,4 );
}
}
}
}
}

View File

@ -38,7 +38,7 @@
#include "images/Chinese_manual.h"
#include "images/English_manual.h"
#include "goomba.h"
#include "jagoombacolor.h"
#include "pocketnes.h"
@ -1341,9 +1341,9 @@ u32 IWRAM_CODE LoadEMU2PSRAM(TCHAR *filename,u32 is_EMU)
{
case 1://gbc
case 2://gb
dmaCopy((void*)goomba_gba,pReadCache, goomba_gba_size);
dmaCopy((void*)pReadCache,PSRAMBase_S98, goomba_gba_size);
rom_start_address = goomba_gba_size;
dmaCopy((void*)jagoombacolor_gba,pReadCache, jagoombacolor_gba_size);
dmaCopy((void*)pReadCache,PSRAMBase_S98, jagoombacolor_gba_size);
rom_start_address = jagoombacolor_gba_size;
break;
case 3://nes
dmaCopy((void*)pocketnes_gba,pReadCache, pocketnes_gba_size);
@ -2585,16 +2585,24 @@ re_showfile:
SetTrimSize(pReadCache,gamefilesize,0x20000,0x0,saveMODE);
if((gl_engine_sel==0) || (gl_select_lang == 0xE2E2))
{
FAT_table_buffer[0x1F4/4] = 0x2; // copy mode
{
get_find:
FAT_table_buffer[0x1F4/4] = 0x2; // copy mode
Send_FATbuffer(FAT_table_buffer,1); //only save FAT
res=Loadfile2PSRAM(pfilename);
make_pat = 1;
res=Loadfile2PSRAM(pfilename);
make_pat = 1;
}
else
{
use_internal_engine(GAMECODE);
Send_FATbuffer(FAT_table_buffer,0);//Loading rom
res=use_internal_engine(GAMECODE);
if(res == 1)
{
Send_FATbuffer(FAT_table_buffer,0);//Loading rom
}
else
{
goto get_find;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -57,7 +57,7 @@ u8 edit_rtshotkey[3]={0};
void Show_ver(void)
{
char msg[20];
char *ver="K:1.08";
char *ver="K:1.10";
u16 FPGAver = Read_FPGA_ver();
sprintf(msg,"FW:%d %s",FPGAver&0xFF,ver);
DrawHZText12(msg,0,160,3, gl_color_text,1);