로그인 상태 유지와 다마고치 수정 화면 정리
This commit is contained in:
1 parent
80d332a79c
commit
40615838ac
33 files changed
+248
-73
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1548,18 +1548,31 @@ static void care_full(void){
|
||||
set_write("\037\042\103");
|
||||
}
|
||||
static void big_entry(int y, int sel, const char *name, const char *st, u16 c, u16 stc);
|
||||
static void ko_detail(const char *s){
|
||||
char expanded[192];AlText it={s,0,0};int code,nbytes=0;
|
||||
while((code=al_next(&it,999))>=0 && nbytes<188){if(code<128)expanded[nbytes++]=(char)code;else{u32 glyph=(u32)code-128;expanded[nbytes++]=(char)(128+(glyph>>7));expanded[nbytes++]=(char)(128+(glyph&127));}}
|
||||
expanded[nbytes]=0;s=expanded;
|
||||
rect(5,77,123,111,BG);
|
||||
char line[128];int n=0,y=80;line[0]=0;
|
||||
while(*s){int z=ko_pair(s)?2:1;if(n+z>=124)break;for(int j=0;j<z;j++)line[n+j]=s[j];line[n+z]=0;
|
||||
if(text_w(line,1)>108){line[n]=0;text(10,y,line,GREY,1);if(y>=95)return;y=95;n=0;continue;}
|
||||
n+=z;s+=z;
|
||||
}
|
||||
text(10,y,line,GREY,1);
|
||||
}
|
||||
static void tama_menu(void){
|
||||
if(set_check_msg()) return;
|
||||
u32 sel=0;
|
||||
for(;;){
|
||||
rect(0,0,128,128,BG); ctext(2,"\037\042\104",WHITE,1);
|
||||
ko_surface(); ctext(4,"\037\042\104",RGB(255,255,255),1);
|
||||
char st[64], nm[64]; nm[0]=0;
|
||||
utoa_(lv_get(),st); big_entry(12,sel==0,"\037\042\105",st,GOLD,GREY);
|
||||
for(u32 i=0;i<3;i++){int y=25+(int)i*18;ko_row(y-2,i==sel);text(14,y,i==0?"\037\042\105":i==1?"\037\042\106":"\037\042\112",WHITE,1);}
|
||||
utoa_(lv_get(),st);if(sel==0)ko_detail(st);
|
||||
{ u32 id=t_id(); int k=cat_find(id); if(k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]==2u) chr_name((u32)k,nm); else utoa_(id,nm); }
|
||||
big_entry(41,sel==1,"\037\042\106",nm,PINK,GREY);
|
||||
if(sel==1)ko_detail(nm);
|
||||
{ u32 to=g_cfg.tama_off; char *p=st; const char *a="\037\042\107"; while(*a) *p++=*a++; utoa_(g_set[to+0x1Cu],p); while(*p) p++; a="\037\042\110"; while(*a) *p++=*a++; utoa_(g_set[to+0x1Du],p); while(*p) p++; if(g_set[to+0x10u]){ a="\037\042\111"; while(*a) *p++=*a++; } *p=0; }
|
||||
big_entry(70,sel==2,"\037\042\112",st,ORANGE,GREY);
|
||||
ctext(119,"\037\041\123",GREY,1);
|
||||
if(sel==2)ko_detail(st);
|
||||
ctext(115,"\037\041\123",RGB(255,255,255),1);
|
||||
show(); wait_release();
|
||||
for(;;){
|
||||
int k=input();
|
||||
|
||||
+15
-5
@@ -1556,18 +1556,28 @@ static void care_full(void){
|
||||
set_write("TAMA VERSORGT");
|
||||
}
|
||||
static void big_entry(int y, int sel, const char *name, const char *st, u16 c, u16 stc);
|
||||
static void ko_detail(const char *s){
|
||||
rect(5,77,123,111,BG);
|
||||
char line[128];int n=0,y=80;line[0]=0;
|
||||
while(*s){int z=ko_pair(s)?2:1;if(n+z>=124)break;for(int j=0;j<z;j++)line[n+j]=s[j];line[n+z]=0;
|
||||
if(text_w(line,1)>108){line[n]=0;text(10,y,line,GREY,1);if(y>=95)return;y=95;n=0;continue;}
|
||||
n+=z;s+=z;
|
||||
}
|
||||
text(10,y,line,GREY,1);
|
||||
}
|
||||
static void tama_menu(void){
|
||||
if(set_check_msg()) return;
|
||||
u32 sel=0;
|
||||
for(;;){
|
||||
rect(0,0,128,128,BG); ctext(2,"TAMA",WHITE,1);
|
||||
ko_surface(); ctext(4,"TAMA",RGB(255,255,255),1);
|
||||
char st[64], nm[64]; nm[0]=0;
|
||||
utoa_(lv_get(),st); big_entry(12,sel==0,"LEVEL",st,GOLD,GREY);
|
||||
for(u32 i=0;i<3;i++){int y=25+(int)i*18;ko_row(y-2,i==sel);text(14,y,i==0?"LEVEL":i==1?"\304NDERN":"PFLEGE",WHITE,1);}
|
||||
utoa_(lv_get(),st);if(sel==0)ko_detail(st);
|
||||
{ u32 id=t_id(); int k=cat_find(id); if(k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]==2u) chr_name((u32)k,nm); else utoa_(id,nm); }
|
||||
big_entry(41,sel==1,"\304NDERN",nm,PINK,GREY);
|
||||
if(sel==1)ko_detail(nm);
|
||||
{ u32 to=g_cfg.tama_off; char *p=st; const char *a="SATT "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Cu],p); while(*p) p++; a=" FROH "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Du],p); while(*p) p++; if(g_set[to+0x10u]){ a=" KRANK"; while(*a) *p++=*a++; } *p=0; }
|
||||
big_entry(70,sel==2,"PFLEGE",st,ORANGE,GREY);
|
||||
ctext(119,"B OK C ZUR\334CK",GREY,1);
|
||||
if(sel==2)ko_detail(st);
|
||||
ctext(115,"B OK C ZUR\334CK",RGB(255,255,255),1);
|
||||
show(); wait_release();
|
||||
for(;;){
|
||||
int k=input();
|
||||
|
||||
+15
-5
@@ -1555,18 +1555,28 @@ static void care_full(void){
|
||||
set_write("TAMA CARED FOR");
|
||||
}
|
||||
static void big_entry(int y, int sel, const char *name, const char *st, u16 c, u16 stc);
|
||||
static void ko_detail(const char *s){
|
||||
rect(5,77,123,111,BG);
|
||||
char line[128];int n=0,y=80;line[0]=0;
|
||||
while(*s){int z=ko_pair(s)?2:1;if(n+z>=124)break;for(int j=0;j<z;j++)line[n+j]=s[j];line[n+z]=0;
|
||||
if(text_w(line,1)>108){line[n]=0;text(10,y,line,GREY,1);if(y>=95)return;y=95;n=0;continue;}
|
||||
n+=z;s+=z;
|
||||
}
|
||||
text(10,y,line,GREY,1);
|
||||
}
|
||||
static void tama_menu(void){
|
||||
if(set_check_msg()) return;
|
||||
u32 sel=0;
|
||||
for(;;){
|
||||
rect(0,0,128,128,BG); ctext(2,"TAMA",WHITE,1);
|
||||
ko_surface(); ctext(4,"TAMA",RGB(255,255,255),1);
|
||||
char st[64], nm[64]; nm[0]=0;
|
||||
utoa_(lv_get(),st); big_entry(12,sel==0,"LEVEL",st,GOLD,GREY);
|
||||
for(u32 i=0;i<3;i++){int y=25+(int)i*18;ko_row(y-2,i==sel);text(14,y,i==0?"LEVEL":i==1?"CHANGE":"CARE",WHITE,1);}
|
||||
utoa_(lv_get(),st);if(sel==0)ko_detail(st);
|
||||
{ u32 id=t_id(); int k=cat_find(id); if(k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]==2u) chr_name((u32)k,nm); else utoa_(id,nm); }
|
||||
big_entry(41,sel==1,"CHANGE",nm,PINK,GREY);
|
||||
if(sel==1)ko_detail(nm);
|
||||
{ u32 to=g_cfg.tama_off; char *p=st; const char *a="FOOD "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Cu],p); while(*p) p++; a=" JOY "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Du],p); while(*p) p++; if(g_set[to+0x10u]){ a=" SICK"; while(*a) *p++=*a++; } *p=0; }
|
||||
big_entry(70,sel==2,"CARE",st,ORANGE,GREY);
|
||||
ctext(119,"B OK C BACK",GREY,1);
|
||||
if(sel==2)ko_detail(st);
|
||||
ctext(115,"B OK C BACK",RGB(255,255,255),1);
|
||||
show(); wait_release();
|
||||
for(;;){
|
||||
int k=input();
|
||||
|
||||
+14
-4
@@ -1581,17 +1581,27 @@ static void care_full(void){
|
||||
set_write("\200\244\200\312 \201\276\200\310 \200\364\200\267");
|
||||
}
|
||||
static void big_entry(int y, int sel, const char *name, const char *st, u16 c, u16 stc);
|
||||
static void ko_detail(const char *s){
|
||||
rect(5,77,123,111,BG);
|
||||
char line[128];int n=0,y=80;line[0]=0;
|
||||
while(*s){int z=ko_pair(s)?2:1;if(n+z>=124)break;for(int j=0;j<z;j++)line[n+j]=s[j];line[n+z]=0;
|
||||
if(text_w(line,1)>108){line[n]=0;text(10,y,line,GREY,1);if(y>=95)return;y=95;n=0;continue;}
|
||||
n+=z;s+=z;
|
||||
}
|
||||
text(10,y,line,GREY,1);
|
||||
}
|
||||
static void tama_menu(void){
|
||||
if(set_check_msg()) return;
|
||||
u32 sel=0;
|
||||
for(;;){
|
||||
rect(0,0,128,128,BG); ctext(2,"\200\236\200\275\200\214\201\235",WHITE,1);
|
||||
ko_surface(); ctext(4,"\200\236\200\275\200\214\201\235",RGB(255,255,255),1);
|
||||
char st[64], nm[64]; nm[0]=0;
|
||||
utoa_(lv_get(),st); big_entry(12,sel==0,"\200\263\200\305",st,GOLD,GREY);
|
||||
for(u32 i=0;i<3;i++){int y=25+(int)i*18;ko_row(y-2,i==sel);text(14,y,i==0?"\200\263\200\305":i==1?"\200\306\200\212":"\200\244\200\312",WHITE,1);}
|
||||
utoa_(lv_get(),st);if(sel==0)ko_detail(st);
|
||||
{ u32 id=t_id(); int k=cat_find(id); if(k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]==2u) chr_name((u32)k,nm); else utoa_(id,nm); }
|
||||
big_entry(41,sel==1,"\200\306\200\212",nm,PINK,GREY);
|
||||
if(sel==1)ko_detail(nm);
|
||||
{ u32 to=g_cfg.tama_off; char *p=st; const char *a="\200\304\200\313\200\271 "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Cu],p); while(*p) p++; a=" \201\266\200\310 "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Du],p); while(*p) p++; if(g_set[to+0x10u]){ a=" \200\344\201\257"; while(*a) *p++=*a++; } *p=0; }
|
||||
big_entry(70,sel==2,"\200\244\200\312",st,ORANGE,GREY);
|
||||
if(sel==2)ko_detail(st);
|
||||
ctext(117,"B \201\273\201\200 C \200\252\200\265",GREY,1);
|
||||
show(); wait_release();
|
||||
for(;;){
|
||||
|
||||
@@ -24,6 +24,9 @@ int main(int argc,char **argv){
|
||||
if(fread(host_flash,1,0x1000000,f)!=0x1000000)return 4;fclose(f);
|
||||
u32 offset=(u32)strtoul(argv[2],0,0);memcpy((void*)&g_cfg,host_flash+offset+0x140,sizeof g_cfg);
|
||||
proof_root=argv[3];for(u32 i=0;i<PAGE;i++)g_ff[i]=255;assert(set_load()==0);g_cur=0;g_act=0;g_napp=0;verify_character_genes();
|
||||
{u8 saved[PAGE];memcpy(saved,g_set,PAGE);u8 *original=malloc(0x1000000);memcpy(original,host_flash,0x1000000);
|
||||
proof("tama-menu",tama_menu,"nnc");proof("tama-cancel",tama_menu,"bcnnbcc");
|
||||
assert(!memcmp(saved,g_set,PAGE));assert(!memcmp(original,host_flash,0x1000000));free(original);}
|
||||
proof("main",main_menu,"nnnc");proof("character",chr_pick,"nbcc");
|
||||
proof("character-scroll",chr_pick,"nnnnnnnnnnnnnbcc");
|
||||
proof("item",cat_pick,"nnbnncc");proof("points",points_menu,"c");proof("fields",fields,"nc");
|
||||
@@ -59,7 +62,7 @@ int main(int argc,char **argv){
|
||||
proof("persist",persist,"b");memset(g_set,0,PAGE);assert(set_load()==0);assert(list_id(0)==item);assert(count_get(0)==7);
|
||||
for(u32 l=1;l<=9;l++){
|
||||
g_set[0x7b]=(g_set[0x7b]&0xe1u)|(l<<1);stamp(g_set);memcpy(host_flash+SET_A,g_set,PAGE);memcpy(host_flash+SET_B,g_set,PAGE);assert(al_lang()==l-1);assert(set_load()==0);
|
||||
char name[80];snprintf(name,sizeof name,"language-%u-main",l);proof(name,main_menu,"c");
|
||||
char name[80];snprintf(name,sizeof name,"language-%u-tama-menu",l);proof(name,tama_menu,"nnc");snprintf(name,sizeof name,"language-%u-main",l);proof(name,main_menu,"c");
|
||||
snprintf(name,sizeof name,"language-%u-character",l);proof(name,chr_pick,"nbnncc");
|
||||
snprintf(name,sizeof name,"language-%u-item",l);proof(name,cat_pick,"bnncc");
|
||||
snprintf(name,sizeof name,"language-%u-points",l);proof(name,points_menu,"c");
|
||||
|
||||
@@ -24,6 +24,9 @@ int main(int argc,char **argv){
|
||||
if(fread(host_flash,1,0x1000000,f)!=0x1000000)return 4;fclose(f);
|
||||
u32 offset=(u32)strtoul(argv[2],0,0);memcpy((void*)&g_cfg,host_flash+offset+0x140,sizeof g_cfg);
|
||||
proof_root=argv[3];for(u32 i=0;i<PAGE;i++)g_ff[i]=255;assert(set_load()==0);g_cur=0;g_act=0;g_napp=0;verify_character_genes();
|
||||
{u8 saved[PAGE];memcpy(saved,g_set,PAGE);u8 *original=malloc(0x1000000);memcpy(original,host_flash,0x1000000);
|
||||
proof("tama-menu",tama_menu,"nnc");proof("tama-cancel",tama_menu,"bcnnbcc");
|
||||
assert(!memcmp(saved,g_set,PAGE));assert(!memcmp(original,host_flash,0x1000000));free(original);}
|
||||
proof("main",main_menu,"nnnc");proof("character",chr_pick,"nbcc");
|
||||
proof("character-scroll",chr_pick,"nnnnnnnnnnnnnbcc");
|
||||
proof("item",cat_pick,"nnbnncc");proof("points",points_menu,"c");proof("fields",fields,"nc");
|
||||
|
||||
@@ -24,6 +24,9 @@ int main(int argc,char **argv){
|
||||
if(fread(host_flash,1,0x1000000,f)!=0x1000000)return 4;fclose(f);
|
||||
u32 offset=(u32)strtoul(argv[2],0,0);memcpy((void*)&g_cfg,host_flash+offset+0x140,sizeof g_cfg);
|
||||
proof_root=argv[3];for(u32 i=0;i<PAGE;i++)g_ff[i]=255;assert(set_load()==0);g_cur=0;g_act=0;g_napp=0;verify_character_genes();
|
||||
{u8 saved[PAGE];memcpy(saved,g_set,PAGE);u8 *original=malloc(0x1000000);memcpy(original,host_flash,0x1000000);
|
||||
proof("tama-menu",tama_menu,"nnc");proof("tama-cancel",tama_menu,"bcnnbcc");
|
||||
assert(!memcmp(saved,g_set,PAGE));assert(!memcmp(original,host_flash,0x1000000));free(original);}
|
||||
proof("main",main_menu,"nnnc");proof("character",chr_pick,"nbcc");
|
||||
proof("character-scroll",chr_pick,"nnnnnnnnnnnnnbcc");
|
||||
proof("item",cat_pick,"nnbnncc");proof("points",points_menu,"c");proof("fields",fields,"nc");
|
||||
|
||||
@@ -24,6 +24,9 @@ int main(int argc,char **argv){
|
||||
if(fread(host_flash,1,0x1000000,f)!=0x1000000)return 4;fclose(f);
|
||||
u32 offset=(u32)strtoul(argv[2],0,0);memcpy((void*)&g_cfg,host_flash+offset+0x140,sizeof g_cfg);
|
||||
proof_root=argv[3];for(u32 i=0;i<PAGE;i++)g_ff[i]=255;assert(set_load()==0);g_cur=0;g_act=0;g_napp=0;verify_character_genes();
|
||||
{u8 saved[PAGE];memcpy(saved,g_set,PAGE);u8 *original=malloc(0x1000000);memcpy(original,host_flash,0x1000000);
|
||||
proof("tama-menu",tama_menu,"nnc");proof("tama-cancel",tama_menu,"bcnnbcc");
|
||||
assert(!memcmp(saved,g_set,PAGE));assert(!memcmp(original,host_flash,0x1000000));free(original);}
|
||||
proof("main",main_menu,"nnnc");proof("character",chr_pick,"nbcc");
|
||||
proof("character-scroll",chr_pick,"nnnnnnnnnnnnnbcc");
|
||||
proof("item",cat_pick,"nnbnncc");proof("points",points_menu,"c");proof("fields",fields,"nc");
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Reference in new issue
Block a user