Skip to content

Commit

Permalink
k1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
fengflash committed Sep 6, 2024
1 parent f8b2550 commit 7235d42
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ include $(DEVKITARM)/gba_rules
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source source/ff13c
INCLUDES := include source/ff13c
SOURCES := source source/ff15
INCLUDES := include source/ff15
DATA := font
MUSIC :=

Expand Down
34 changes: 31 additions & 3 deletions source/GBApatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -947,6 +954,7 @@ u32 use_internal_engine(u8 gamecode[])
{
u32 i;
u32 count0x3007FFC=0;
u32 result=0;

g_Offset = 0;

Expand All @@ -956,12 +964,14 @@ 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();
Expand All @@ -972,7 +982,7 @@ u32 use_internal_engine(u8 gamecode[])
{
Add2(((vu32*)pReadCache)[i+ii], 0x3007FF4);//0x3007FFC offset
}
return 1;
return result;
}
//------------------------------------------------------------------
void Patch_SpecialROM_sleepmode(void)
Expand Down Expand Up @@ -1396,4 +1406,22 @@ 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 );
}
}
}
}
}
22 changes: 15 additions & 7 deletions source/ezkernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "images/Chinese_manual.h"
#include "images/English_manual.h"

#include "goomba.h"
#include "jagoombacolor.h"
#include "pocketnes.h"


Expand Down Expand Up @@ -1314,9 +1314,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);
Expand Down Expand Up @@ -2483,16 +2483,24 @@ int main(void) {
SetTrimSize(pReadCache,gamefilesize,0x20000,0x0,saveMODE);

if((gl_engine_sel==0) || (gl_select_lang == 0xE2E2))
{
{
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;
}
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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/setwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ u8 edit_rtshotkey[3]={0};
void Show_ver(void)
{
char msg[20];
char *ver="K:1.09";
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);
Expand Down

0 comments on commit 7235d42

Please sign in to comment.