다마고치 선택 그림과 실제 외형 및 이름을 일치시킴
Paramix Studio / build (push) Canceled after 0s
Paramix Studio / pages (push) Canceled after 0s

This commit is contained in:
syskiller committed 2026-11-11 20:37:50 +09:00
1 parent 6ff604302e
commit fda254aa35
20 files changed
+193 -114

No files matched your search

+22
View File
@@ -98,6 +98,28 @@ static u32 count_add(u32 id,u32 owned){
u32 sum=rd32(a)-before;for(u32 z=8;z<0x180;z+=4)sum+=*(u32*)(g_page+z);*(u32*)g_page=sum;*(u32*)(g_page+4u)=0u-sum;
}
flash_prog4k(a, g_page); n++;`);
// Replace the cached current-pet package, not every friend sharing its ID.
{const a=s.indexOf('static u32 tama_files(u32 old, u32 nw){'),z=s.indexOf('static u32 ko_names(void){',a);
s=s.slice(0,a)+`static u32 ghost_rd32(u32 a){const volatile u8 *p=fl(a);return (u32)p[0]|((u32)p[1]<<8)|((u32)p[2]<<16)|((u32)p[3]<<24);}
static u32 tama_files(u32 old,u32 nw){
int k=cat_find(nw);u32 names=ko_names();if(k<0||!names)return 0;
u32 tab=names+30u*g_cfg.cat_n;if(ghost_rd32(tab)!=0x314b5047u||ghost_rd32(tab+4u)!=g_cfg.cat_n)return 0;
u32 rel=ghost_rd32(tab+8u+4u*(u32)k);if(!rel)return 0;u32 src=g_cfg.cat_off+rel,len=ghost_rd32(src+0x10cu);
if(len<0x1d34u||len>0x4000u||src>=g_cfg.user_start||len>g_cfg.user_start-src||ghost_rd32(src+8u)!=1u||(ghost_rd32(src+0x108u)>>16)!=nw||ghost_rd32(src)+ghost_rd32(src+4u)!=0u)return 0;
for(u32 a=g_cfg.user_start;a+0x4000u<=g_cfg.user_end&&a+0x4000u<=SET_A;a+=PAGE){
if(rd32(a+8u)!=1u||rd16(a+12u)!=4017u||rd32(a)+rd32(a+4u)!=0u)continue;
u32 n=rd32(a+0x10cu);if(n<0x1d34u||n>0x4000u||rd32(a+0x118u)!=0x1d34u)continue;
// The first native genes slot is the current pet. Never alter later friend slots.
if(rd16(a+0x10au)!=old&&rd16(a+14u)!=old)return 0;
for(u32 off=0;off<0x4000u;off+=PAGE){for(u32 j=0;j<PAGE;j++)g_page[j]=off+j<len?fl(src+off+j)[0]:255u;flash_prog4k(a+off,g_page);}
return 1;
}
return 0;
}
`+s.slice(z);}
s=s.replace('if(old && old!=nw && !tama_files(old, nw))','if(!tama_files(old, nw))');
s=s.replace('g_set[to+0x18u]=(u8)((g_set[to+0x18u]&~0x1Cu)|((st&7u)<<2));','g_set[to+0x18u]=(u8)((g_set[to+0x18u]&~0x1Cu)|((st&7u)<<2));\n g_set[to+0x19u]=(u8)((g_set[to+0x19u]&0xe0u)|31u);');
s=s.replace('RGB(60,60,110)','RGB(205,225,169)').replace('RGB(40,40,70)','BG');
s=s.replace('if(k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]==2u){ char t[64]; chr_name((u32)k,t); t[15]=0;', 'if(k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]==2u){ char t[64]; chr_name((u32)k,t); int z=0;while(t[z]&&z+(ko_pair(t+z)?2:1)<=14)z+=ko_pair(t+z)?2:1;t[z]=0;');
return s;