|
|
|
@@ -213,12 +213,12 @@ static void utoa_(u32 v, char *s){ char t[12]; int n=0; do{ t[n++]=(char)('0'+v%
|
|
|
|
|
|
|
|
|
|
static u16 fcol(u32 i){ return (u16)(i<4u ? g_cfg.field_col[i] : g_cfg.field_col2[i-4u]); }
|
|
|
|
|
static const char *ko_field(const char *s){
|
|
|
|
|
{const char *a="LAND";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\252\200\247";}
|
|
|
|
|
{const char *a="WATER";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\355\201\227";}
|
|
|
|
|
{const char *a="SKY";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\326\201\220\200\364";}
|
|
|
|
|
{const char *a="FOREST";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\201\235\200\256\200\326\201\232";}
|
|
|
|
|
{const char *a="TROPICAL";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\201\232\200\260\201\242\201\222";}
|
|
|
|
|
{const char *a="GLACIER";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\220\200\256\200\364\200\321";}
|
|
|
|
|
{const char *a="LAND";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\253\200\250";}
|
|
|
|
|
{const char *a="WATER";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\356\201\232";}
|
|
|
|
|
{const char *a="SKY";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\327\201\223\200\365";}
|
|
|
|
|
{const char *a="FOREST";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\201\240\200\257\200\327\201\235";}
|
|
|
|
|
{const char *a="TROPICAL";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\201\235\200\261\201\245\201\225";}
|
|
|
|
|
{const char *a="GLACIER";int i=0;while(a[i]&&s[i]&&a[i]==s[i])i++;if(!a[i]&&!s[i])return "\200\220\200\257\200\365\200\322";}
|
|
|
|
|
return s;}
|
|
|
|
|
static const char *fname(u32 i){ return ko_field(i<4u ? (const char*)g_cfg.field_name[i] : (const char*)g_cfg.field_name2[i-4u]); }
|
|
|
|
|
static u32 fid(u32 i){ return i<4u ? g_cfg.field_id[i] : g_cfg.field_id2[i-4u]; }
|
|
|
|
@@ -456,7 +456,7 @@ static int stash(u32 fi){
|
|
|
|
|
if(on==PAGE){ u32 x=pool_take(fi); if(x==0xFFFFu || nd>=DPG_MAX) return 11;
|
|
|
|
|
flash_prog4k(pool_addr(x),g_out); g_hdr.dpg[nd++]=(u16)x; on=0; } }
|
|
|
|
|
by+=n;
|
|
|
|
|
progress("\200\377\200\375 \201\206", ++done, tot*2u);
|
|
|
|
|
progress("\201\200\200\376 \201\210", ++done, tot*2u);
|
|
|
|
|
}
|
|
|
|
|
if(on){ u32 x=pool_take(fi); if(x==0xFFFFu || nd>=DPG_MAX) return 11;
|
|
|
|
|
for(u32 k=on;k<PAGE;k++) g_out[k]=0xFF; flash_prog4k(pool_addr(x),g_out); g_hdr.dpg[nd++]=(u16)x; }
|
|
|
|
@@ -468,7 +468,7 @@ static int stash(u32 fi){
|
|
|
|
|
if(lz_unpack(g_cmp, n, g_page)) return 12;
|
|
|
|
|
if(!flash_same(a, g_page, PAGE)) return 13;
|
|
|
|
|
off+=n;
|
|
|
|
|
progress("\201\254\200\365 \201\206", tot+i+1u, tot*2u);
|
|
|
|
|
progress("\201\257\200\366 \201\210", tot+i+1u, tot*2u);
|
|
|
|
|
}
|
|
|
|
|
g_hdr.magic=SLOT_MAGIC; g_hdr.field=fi+1u; g_hdr.npages=np; g_hdr.bytes=by; g_hdr.sum=sum;
|
|
|
|
|
g_hdr.res[0]=POOL_MAGIC; g_hdr.res[1]=nd; g_hdr.res[2]=PEND_MAGIC;
|
|
|
|
@@ -504,7 +504,7 @@ static int restore(u32 fi, int fresh){
|
|
|
|
|
} else if(set!=(int)pass) continue;
|
|
|
|
|
if(want){ if(!flash_same(a,g_page,PAGE)) flash_prog4k(a,g_page); if(!flash_same(a,g_page,PAGE)) return 22; }
|
|
|
|
|
else if(!page_ff(a)){ erase_page(a); if(!page_ff(a)) return 23; }
|
|
|
|
|
if(!pass && !(++done & 7u)) progress("\200\306\200\255\200\347\200\232 \201\206", done, tot);
|
|
|
|
|
if(!pass && !(++done & 7u)) progress("\200\307\200\256\200\350\200\232 \201\210", done, tot);
|
|
|
|
|
}
|
|
|
|
|
if(!fresh && ix2!=np) return 24;
|
|
|
|
|
}
|
|
|
|
@@ -522,24 +522,24 @@ static void leave(void){
|
|
|
|
|
}
|
|
|
|
|
static void error_screen(int code){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(30,"\200\347\200\263",RED,2);
|
|
|
|
|
char s[12]="\201\223\200\247 00"; s[5]=(char)('0'+code/10); s[6]=(char)('0'+code%10);
|
|
|
|
|
ctext(30,"\200\350\200\264",RED,2);
|
|
|
|
|
char s[12]="\201\226\200\250 00"; s[5]=(char)('0'+code/10); s[6]=(char)('0'+code%10);
|
|
|
|
|
ctext(56,s,WHITE,1);
|
|
|
|
|
if(code==10||code==11) ctext(68,"\200\377\200\375 \200\353\200\254 \201\214\200\215",WHITE,1); /* the field stays as it is */
|
|
|
|
|
ctext(84,"B/C \200\241\200\333\200\201\200\222",GREY,1);
|
|
|
|
|
if(code==10||code==11) ctext(68,"\201\200\200\376 \200\354\200\255 \201\216\200\215",WHITE,1); /* the field stays as it is */
|
|
|
|
|
ctext(84,"B/C \200\242\200\334\200\201\200\222",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){ int k=input(); if(k==K_OK||k==K_BACK) leave(); }
|
|
|
|
|
}
|
|
|
|
|
static void message(const char *l1, const char *l2, const char *l3){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(34,l1,WHITE,1); ctext(48,l2,WHITE,1); ctext(62,l3,WHITE,1);
|
|
|
|
|
ctext(100,"C \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(100,"C \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){ int k=input(); if(k==K_OK||k==K_BACK) return; }
|
|
|
|
|
}
|
|
|
|
|
static void done_screen(const char *what, u16 col){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(40,"\200\351\200\262",WHITE,2);
|
|
|
|
|
ctext(40,"\200\352\200\263",WHITE,2);
|
|
|
|
|
ctext(66,what,col,1);
|
|
|
|
|
show();
|
|
|
|
|
delay_loop(6000000u);
|
|
|
|
@@ -556,7 +556,7 @@ static void app_detect(void){
|
|
|
|
|
g_app = m==0x43584D50u ? 2u : m==0x37584D50u ? 4u : m==0x38584D50u ? 5u : 3u;
|
|
|
|
|
for(u32 i=0x140u;i<0x400u;i+=4u) if(rd32(off+i)==0x434D4450u){ g_app=1u; break; }
|
|
|
|
|
}
|
|
|
|
|
static const char *const g_appname[6]={"","DOOM","TAMAEMU","\201\237\200\260\200\217\200\253","T7EMU","T18EMU"};
|
|
|
|
|
static const char *const g_appname[6]={"","DOOM","TAMAEMU","\201\242\200\261\200\217\200\254","T7EMU","T18EMU"};
|
|
|
|
|
static void start_app(void){
|
|
|
|
|
rect(0,0,128,128,0); show();
|
|
|
|
|
#ifdef HOST
|
|
|
|
@@ -600,12 +600,12 @@ static void apps_detect(void){
|
|
|
|
|
#ifndef NO_LSET
|
|
|
|
|
/* start device (1.6.8): sound and display time, the Paradise's own settings screens are gone */
|
|
|
|
|
if(g_cfg.flags & 16u){
|
|
|
|
|
const char *d="\200\316\201\202"; int k=0; while(d[k]){ g_appnm[g_napp][k]=d[k]; k++; } g_appnm[g_napp][k]=0;
|
|
|
|
|
const char *d="\200\317\201\204"; int k=0; while(d[k]){ g_appnm[g_napp][k]=d[k]; k++; } g_appnm[g_napp][k]=0;
|
|
|
|
|
g_appsrc[g_napp++]=0; g_sx=g_napp;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if((g_cfg.flags & 16u) && g_cfg.version>=7u && g_cfg.dl_src>=0x10000000u && g_cfg.dl_src<0x11000000u){
|
|
|
|
|
const char *d="\200\234\200\354\200\260\200\247"; int k=0; while(d[k]){ g_appnm[g_napp][k]=d[k]; k++; } g_appnm[g_napp][k]=0;
|
|
|
|
|
const char *d="\200\234\200\355\200\261\200\250"; int k=0; while(d[k]){ g_appnm[g_napp][k]=d[k]; k++; } g_appnm[g_napp][k]=0;
|
|
|
|
|
g_appsrc[g_napp++]=g_cfg.dl_src; g_dl=g_napp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -734,7 +734,7 @@ static void act_mark(u32 j){
|
|
|
|
|
}
|
|
|
|
|
/* Live save to slot g_act, then slot tgt (has) or a fresh start on field fld into the live area. */
|
|
|
|
|
static void field_switch2(u32 tgt, int has, u32 fld){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(8,"\200\374\200\330 \200\222\200\234\200\265\200\320\200\352",WHITE,1); ctext(20,"\201\201\200\356\200\361 \200\357\201\207\201\243\200\320\200\352",GREY,1); show();
|
|
|
|
|
rect(0,0,128,128,BG); ctext(8,"\200\375\200\331 \200\222\200\234\200\266\200\321\200\353",WHITE,1); ctext(20,"\201\202\200\357\200\362 \200\360\201\211\201\246\200\321\200\353",GREY,1); show();
|
|
|
|
|
int e=stash((u32)g_act);
|
|
|
|
|
if(e){ erase_page(slot_base((u32)g_act)); error_screen(e); }
|
|
|
|
|
e=restore(has ? tgt : fld,!has);
|
|
|
|
@@ -749,12 +749,12 @@ static void field_switch2(u32 tgt, int has, u32 fld){
|
|
|
|
|
static void field_switch(u32 tgt, int has){ field_switch2(tgt, has, tgt); }
|
|
|
|
|
static int field_confirm(u32 tgt, int has){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(14,"\201\201\201\255 \200\236\200\312",WHITE,1);
|
|
|
|
|
ctext(14,"\201\202\201\260 \200\236\200\313",WHITE,1);
|
|
|
|
|
ctext(30,fname(tgt),fcol(tgt),2);
|
|
|
|
|
ctext(54, has ? "\200\300\200\216\201\244 \200\377\200\375\200\361" : "\200\364 \201\207\200\344\200\343\200\314", WHITE,1);
|
|
|
|
|
ctext(66, has ? "\200\306\200\255\200\350\200\233\200\234" : "\200\313\200\260 \200\330\200\373\201\247\200\233\200\234", WHITE,1);
|
|
|
|
|
ctext(92,"B \200\346",WHITE,1);
|
|
|
|
|
ctext(106,"C \200\333\200\233\200\352",GREY,1);
|
|
|
|
|
ctext(54, has ? "\200\301\200\216\201\247 \201\200\200\376\200\362" : "\200\365 \201\211\200\345\200\344\200\315", WHITE,1);
|
|
|
|
|
ctext(66, has ? "\200\307\200\256\200\351\200\233\200\234" : "\200\314\200\261 \200\331\200\374\201\252\200\233\200\234", WHITE,1);
|
|
|
|
|
ctext(92,"B \200\347",WHITE,1);
|
|
|
|
|
ctext(106,"C \200\334\200\233\200\353",GREY,1);
|
|
|
|
|
show();
|
|
|
|
|
return yes_no();
|
|
|
|
|
}
|
|
|
|
@@ -764,7 +764,7 @@ static int launch_mode(void){ return (g_cfg.flags & F_LAUNCH) != 0u; }
|
|
|
|
|
* The time is kept in the Paradise's settings block at IDLE_OFF (0 = 2 minutes, else index + 1). */
|
|
|
|
|
#define IDLE_OFF 0xF07u
|
|
|
|
|
static const u32 g_idle_tab[5]={30000u,60000u,120000u,300000u,0u};
|
|
|
|
|
static const char *const g_idle_nm[5]={"30 S","1\200\305","2\200\305","5\200\305","\200\225\201\207 \200\334\200\362"};
|
|
|
|
|
static const char *const g_idle_nm[5]={"30 S","1\200\306","2\200\306","5\200\306","\200\225\201\211 \200\335\200\363"};
|
|
|
|
|
static u32 g_idle_t, g_idle_ms;
|
|
|
|
|
#ifdef BAT_SHOW
|
|
|
|
|
#ifdef HOST
|
|
|
|
@@ -776,9 +776,9 @@ static void bat_text(char *s){ const char *t="2.84V 80%"; int i=0; while((s[i]=t
|
|
|
|
|
static void lset_menu(void);
|
|
|
|
|
#ifdef FELD_CLEAN
|
|
|
|
|
static int clean_mode(void);
|
|
|
|
|
#define SX_TEXT (clean_mode() ? "\200\330\200\213\200\200\201\253\200\271" : "\200\322\200\265\200\200\201\253\200\271")
|
|
|
|
|
#define SX_TEXT (clean_mode() ? "\200\331\200\213\200\200\201\256\200\272" : "\200\323\200\266\200\200\201\256\200\272")
|
|
|
|
|
#else
|
|
|
|
|
#define SX_TEXT "\200\322\200\265\200\200\201\253\200\271"
|
|
|
|
|
#define SX_TEXT "\200\323\200\266\200\200\201\256\200\272"
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(FELD_PW) && !defined(HOST)
|
|
|
|
|
/* test23 (switch FELD_PW): the display dark, the menu waited for a key in a tight loop at the full clock and used
|
|
|
|
@@ -841,7 +841,7 @@ static void apps_menu(int top){
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
int y0 = n>=4u ? 1 : 12;
|
|
|
|
|
if(n<4u) ctext(2, launch_mode() ? "PARAMIX" : "\201\237\200\260\200\217\200\253",WHITE,1);
|
|
|
|
|
if(n<4u) ctext(2, launch_mode() ? "PARAMIX" : "\201\242\200\261\200\217\200\254",WHITE,1);
|
|
|
|
|
if(n>8u){ if(sel<first) first=sel; if(sel>=first+8u) first=sel-7u; } else first=0;
|
|
|
|
|
for(u32 i=first;i<n && i<first+(n>8u?8u:n);i++){
|
|
|
|
|
int sx = g_sx && i+1u==g_sx;
|
|
|
|
@@ -850,13 +850,13 @@ static void apps_menu(int top){
|
|
|
|
|
int dy = n>7u ? 14 : 16, y=2+(int)(i-first)*dy;
|
|
|
|
|
if(i==sel){ rect(1,y,127,y+dy-1,c); rect(2,y+1,126,y+dy-2,BG); }
|
|
|
|
|
text(5,y+(dy-8)/2+1,g_appnm[i],c,1);
|
|
|
|
|
const char *st = sx ? "\200\345\200\222" : "\200\330\200\373";
|
|
|
|
|
const char *st = sx ? "\200\346\200\222" : "\200\331\200\374";
|
|
|
|
|
text(123-text_w(st,1),y+(dy-8)/2+1,st,GREY,1);
|
|
|
|
|
} else big_entry(y0+(int)i*29, i==sel, g_appnm[i], g_dl && i+1u==g_dl ? "PC \200\222\200\261" : sx ? SX_TEXT : "\200\330\200\373", c, GREY);
|
|
|
|
|
} else big_entry(y0+(int)i*29, i==sel, g_appnm[i], g_dl && i+1u==g_dl ? "PC \200\222\200\262" : sx ? SX_TEXT : "\200\331\200\374", c, GREY);
|
|
|
|
|
}
|
|
|
|
|
#ifdef BAT_SHOW
|
|
|
|
|
/* test17: the start device's home screen shows the battery bottom right */
|
|
|
|
|
if(top && launch_mode()){ char bt[12]; bat_text(bt); text(5,117,"B \200\330\200\373",GREY,1); if(n<=8u) text(123-text_w(bt,1),119,bt,GREY,1);
|
|
|
|
|
if(top && launch_mode()){ char bt[12]; bat_text(bt); text(5,117,"B \200\331\200\374",GREY,1); if(n<=8u) text(123-text_w(bt,1),119,bt,GREY,1);
|
|
|
|
|
#ifdef FELD_AUTODBG
|
|
|
|
|
if(g_adbg[2]){ static const char hx[]="0123456789ABCDEF"; char d[8]; u32 mm=g_adbg[0];
|
|
|
|
|
d[0]= mm==MB_L ? 'L' : mm==MB_M ? 'M' : mm==MB_R ? 'R' : mm ? '?' : '0'; d[1]=hx[(g_adbg[1]>>8)&15u]; d[2]=g_adbg[2]==2u ? 'B' : '-'; d[3]= g_adbg[3]==MB_S ? 'S' : g_adbg[3] ? '?' : '0'; d[4]=0;
|
|
|
|
@@ -865,7 +865,7 @@ static void apps_menu(int top){
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
ctext(117, top && launch_mode() ? "B \200\330\200\373" : "B \201\254\200\365 C \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(117, top && launch_mode() ? "B \200\331\200\374" : "B \201\257\200\366 C \200\247\200\261",GREY,1);
|
|
|
|
|
if(n>8u){ char sc[8]; u32 a=sel+1u; int k=0; if(a>=10u) sc[k++]=(char)('0'+a/10u); sc[k++]=(char)('0'+a%10u); sc[k++]='/'; if(n>=10u) sc[k++]=(char)('0'+n/10u); sc[k++]=(char)('0'+n%10u); sc[k]=0; text(123-text_w(sc,1),119,sc,GREY,1); }
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
@@ -888,10 +888,10 @@ static void field_menu(int with_app, int top){
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
int y0 = n>=4u ? 1 : 12;
|
|
|
|
|
if(n<4u) ctext(2, top ? "PARAMIX" : "\201\207\200\344", WHITE,1);
|
|
|
|
|
if(n<4u) ctext(2, top ? "PARAMIX" : "\201\211\200\345", WHITE,1);
|
|
|
|
|
for(u32 i=0;i<n;i++){
|
|
|
|
|
const char *nm = i<nf ? fname(i) : g_napp>1u ? "\201\237\200\260\200\217\200\253" : g_appnm[0];
|
|
|
|
|
const char *st = i>=nf ? (g_napp>1u ? "\200\315\201\226" : "\200\330\200\373") : ((int)i==g_cur) ? "\200\310\200\353 \201\206" : has[i] ? "\200\377\200\375\200\244" : "\200\313\200\260";
|
|
|
|
|
const char *nm = i<nf ? fname(i) : g_napp>1u ? "\201\242\200\261\200\217\200\254" : g_appnm[0];
|
|
|
|
|
const char *st = i>=nf ? (g_napp>1u ? "\200\316\201\231" : "\200\331\200\374") : ((int)i==g_cur) ? "\200\311\200\354 \201\210" : has[i] ? "\201\200\200\376\200\245" : "\200\314\200\261";
|
|
|
|
|
u16 c = i<nf ? fcol(i) : ORANGE, stc = (i<nf && (int)i==g_cur) ? WHITE : GREY;
|
|
|
|
|
if(n>4u){ /* six fields: compact rows */
|
|
|
|
|
int y=2+(int)i*16;
|
|
|
|
@@ -900,7 +900,7 @@ static void field_menu(int with_app, int top){
|
|
|
|
|
text(123-text_w(st,1),y+4,st,stc,1);
|
|
|
|
|
} else big_entry(y0+(int)i*29, i==sel, nm, st, c, stc);
|
|
|
|
|
}
|
|
|
|
|
ctext(117,"B \201\254\200\365 C \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(117,"B \201\257\200\366 C \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -929,13 +929,13 @@ static int set_load(void){
|
|
|
|
|
}
|
|
|
|
|
static int set_check_msg(void){
|
|
|
|
|
int e=set_load();
|
|
|
|
|
if(e==1){ message("\200\377\200\375 \200\237\200\364\201\227\200\201","\200\323\200\312\200\243\200\342\200\327\200\233\200\234","\200\277\200\212\201\243\201\207 \200\334\200\336\200\327\200\233\200\234"); return 1; }
|
|
|
|
|
if(e==2){ message("\200\377\200\375 \200\237\200\364\201\227 \200\341\200\362","\201\204\200\221 \201\240\200\256\200\364\201\244 \200\246","\200\234\200\330 \200\330\200\240\201\243\200\320\200\352"); return 1; }
|
|
|
|
|
if(e){ message("\200\377\200\375 \201\252\200\331\200\361","\200\335 \200\324 \200\341\200\327\200\233\200\234",""); return 1; }
|
|
|
|
|
if(e==1){ message("\201\200\200\376 \200\240\200\365\201\232\200\201","\200\324\200\313\200\244\200\343\200\330\200\233\200\234","\200\300\200\212\201\246\201\211 \200\335\200\337\200\330\200\233\200\234"); return 1; }
|
|
|
|
|
if(e==2){ message("\201\200\200\376 \200\240\200\365\201\232 \200\342\200\363","\201\206\200\221 \201\243\200\257\200\365\201\247 \200\247","\200\234\200\331 \200\331\200\241\201\246\200\321\200\353"); return 1; }
|
|
|
|
|
if(e){ message("\201\200\200\376 \201\255\200\332\200\362","\200\336 \200\325 \200\342\200\330\200\233\200\234",""); return 1; }
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
static void set_write(const char *what){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(40,"\200\377\200\375 \201\206",WHITE,1); ctext(54,"\201\201\200\356\200\361 \200\357\201\207\201\243\200\320\200\352",GREY,1); show();
|
|
|
|
|
rect(0,0,128,128,BG); ctext(40,"\201\200\200\376 \201\210",WHITE,1); ctext(54,"\201\202\200\357\200\362 \200\360\201\211\201\246\200\321\200\353",GREY,1); show();
|
|
|
|
|
stamp(g_set);
|
|
|
|
|
flash_prog4k(SET_A, g_set);
|
|
|
|
|
flash_prog4k(SET_B, g_set);
|
|
|
|
@@ -1000,7 +1000,7 @@ static void clock_menu(int must){
|
|
|
|
|
for(;;){
|
|
|
|
|
if(d>mdays(y,mo)) d=mdays(y,mo);
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(4,"\200\330\200\213 \200\316\201\202",WHITE,1);
|
|
|
|
|
ctext(4,"\200\331\200\213 \200\317\201\204",WHITE,1);
|
|
|
|
|
char s[6];
|
|
|
|
|
utoa_(y,s); text(5,26,s,sel==0u?ORANGE:WHITE,2);
|
|
|
|
|
s[0]='-'; s[1]=0; text(52,26,s,GREY,2);
|
|
|
|
@@ -1010,9 +1010,9 @@ static void clock_menu(int must){
|
|
|
|
|
two(s,h); s[2]=0; text(34,52,s,sel==3u?ORANGE:WHITE,2);
|
|
|
|
|
s[0]=':'; s[1]=0; text(58,52,s,GREY,2);
|
|
|
|
|
two(s,mi); s[2]=0; text(70,52,s,sel==4u?ORANGE:WHITE,2);
|
|
|
|
|
ctext(84,"\201\260 \200\277\200\212",GREY,1);
|
|
|
|
|
ctext(96,"A \200\234\200\362 B \200\377\200\375",GREY,1);
|
|
|
|
|
if(!must) ctext(108,"C \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(84,"\201\263 \200\300\200\212",GREY,1);
|
|
|
|
|
ctext(96,"A \200\234\200\363 B \201\200\200\376",GREY,1);
|
|
|
|
|
if(!must) ctext(108,"C \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -1029,7 +1029,7 @@ static void clock_menu(int must){
|
|
|
|
|
if(k==K_BACK && !must) return;
|
|
|
|
|
if(k==K_OK){
|
|
|
|
|
Clk c; u32 idle=clk_load(&c) ? c.idle : 0u;
|
|
|
|
|
rect(0,0,128,128,BG); ctext(54,"\200\377\200\375 \201\206",WHITE,1); show();
|
|
|
|
|
rect(0,0,128,128,BG); ctext(54,"\201\200\200\376 \201\210",WHITE,1); show();
|
|
|
|
|
clk_store((u32)para_days((int32_t)y,(int32_t)mo,(int32_t)d)*86400u+h*3600u+mi*60u, idle);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@@ -1050,15 +1050,15 @@ static void lset_load(void){
|
|
|
|
|
static void lset_clean(void){
|
|
|
|
|
Clk k; u32 idl = clk_load(&k) && k.idle>=1u && k.idle<=5u ? k.idle-1u : 2u, idl0=idl, sel=0;
|
|
|
|
|
for(;;){
|
|
|
|
|
char tm[8]; u32 t=clk_now(); if(t) hhmm(t,tm); else { const char *n="\200\273\200\316\201\202"; int i=0; while((tm[i]=n[i])) i++; }
|
|
|
|
|
char tm[8]; u32 t=clk_now(); if(t) hhmm(t,tm); else { const char *n="\200\274\200\317\201\204"; int i=0; while((tm[i]=n[i])) i++; }
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(2,"\200\316\201\202",WHITE,1);
|
|
|
|
|
big_entry(16, sel==0u, "\200\330\200\213", tm, ORANGE, WHITE);
|
|
|
|
|
big_entry(45, sel==1u, "\201\253\200\271", g_idle_nm[idl], ORANGE, WHITE);
|
|
|
|
|
text(9,84,"\201\253\200\271 \200\224\201\210",GREY,1);
|
|
|
|
|
text(9,94,"\200\370\200\257\200\364 \200\341\200\361 \200\251",GREY,1);
|
|
|
|
|
ctext(108,"B \200\277\200\212",GREY,1);
|
|
|
|
|
ctext(117,"C \200\377\200\375 \201\257 \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(2,"\200\317\201\204",WHITE,1);
|
|
|
|
|
big_entry(16, sel==0u, "\200\331\200\213", tm, ORANGE, WHITE);
|
|
|
|
|
big_entry(45, sel==1u, "\201\256\200\272", g_idle_nm[idl], ORANGE, WHITE);
|
|
|
|
|
text(9,84,"\201\256\200\272 \200\224\201\212",GREY,1);
|
|
|
|
|
text(9,94,"\200\371\200\260\200\365 \200\342\200\362 \200\252",GREY,1);
|
|
|
|
|
ctext(108,"B \200\300\200\212",GREY,1);
|
|
|
|
|
ctext(117,"C \201\200\200\376 \201\262 \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int c=input();
|
|
|
|
@@ -1066,7 +1066,7 @@ static void lset_clean(void){
|
|
|
|
|
if(c==K_OK){ if(sel==0u) clock_menu(0); else idl=(idl+1u)%5u; break; }
|
|
|
|
|
if(c==K_BACK){
|
|
|
|
|
if(idl!=idl0){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(54,"\200\377\200\375 \201\206",WHITE,1); show();
|
|
|
|
|
rect(0,0,128,128,BG); ctext(54,"\201\200\200\376 \201\210",WHITE,1); show();
|
|
|
|
|
u32 t2=clk_now(); clk_store(t2, idl+1u);
|
|
|
|
|
g_idle_ms=g_idle_tab[idl];
|
|
|
|
|
}
|
|
|
|
@@ -1082,20 +1082,20 @@ static void lset_menu(void){
|
|
|
|
|
#endif
|
|
|
|
|
int e=set_load();
|
|
|
|
|
if(e==1 || e==2){ set_check_msg(); return; }
|
|
|
|
|
static const char *const snd_nm[4]={"\200\226","\200\373\200\211","\200\300\201\231","\201\224\200\211"};
|
|
|
|
|
static const char *const snd_nm[4]={"\200\226","\200\374\200\211","\200\301\201\234","\201\227\200\211"};
|
|
|
|
|
u32 snd=(g_set[SND_OFF]>>3)&3u, snd0=snd;
|
|
|
|
|
u32 idl=g_set[IDLE_OFF]; idl = idl>=1u && idl<=5u ? idl-1u : 2u; u32 idl0=idl;
|
|
|
|
|
u32 sel=0;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(2,"\200\316\201\202",WHITE,1);
|
|
|
|
|
big_entry(16, sel==0u, "\200\322\200\265", snd_nm[snd], ORANGE, WHITE);
|
|
|
|
|
big_entry(45, sel==1u, "\201\253\200\271", g_idle_nm[idl], ORANGE, WHITE);
|
|
|
|
|
text(9,74,"\200\322\200\265: \200\302\201\234 \201\200\200\353",GREY,1);
|
|
|
|
|
text(9,84,"\201\253\200\271: \200\364 \200\270\200\231\200\343\200\314",GREY,1);
|
|
|
|
|
text(9,94,"\200\370\200\257 \200\341\200\360\200\271 \200\224\201\210",GREY,1);
|
|
|
|
|
ctext(108,"B \200\277\200\212",GREY,1);
|
|
|
|
|
ctext(117,"C \200\377\200\375 \201\257 \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(2,"\200\317\201\204",WHITE,1);
|
|
|
|
|
big_entry(16, sel==0u, "\200\323\200\266", snd_nm[snd], ORANGE, WHITE);
|
|
|
|
|
big_entry(45, sel==1u, "\201\256\200\272", g_idle_nm[idl], ORANGE, WHITE);
|
|
|
|
|
text(9,74,"\200\323\200\266: \200\303\201\237 \201\201\200\354",GREY,1);
|
|
|
|
|
text(9,84,"\201\256\200\272: \200\365 \200\271\200\231\200\344\200\315",GREY,1);
|
|
|
|
|
text(9,94,"\200\371\200\260 \200\342\200\361\200\272 \200\224\201\212",GREY,1);
|
|
|
|
|
ctext(108,"B \200\300\200\212",GREY,1);
|
|
|
|
|
ctext(117,"C \201\200\200\376 \201\262 \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -1105,7 +1105,7 @@ static void lset_menu(void){
|
|
|
|
|
if(snd!=snd0 || idl!=idl0){
|
|
|
|
|
g_set[SND_OFF]=(u8)((g_set[SND_OFF]&~0x18u)|(snd<<3));
|
|
|
|
|
g_set[IDLE_OFF]=(u8)(idl+1u);
|
|
|
|
|
rect(0,0,128,128,BG); ctext(40,"\200\377\200\375 \201\206",WHITE,1); ctext(54,"\201\201\200\356\200\361 \200\357\201\207\201\243\200\320\200\352",GREY,1); show();
|
|
|
|
|
rect(0,0,128,128,BG); ctext(40,"\201\200\200\376 \201\210",WHITE,1); ctext(54,"\201\202\200\357\200\362 \200\360\201\211\201\246\200\321\200\353",GREY,1); show();
|
|
|
|
|
stamp(g_set);
|
|
|
|
|
flash_prog4k(SET_A, g_set);
|
|
|
|
|
flash_prog4k(SET_B, g_set);
|
|
|
|
@@ -1196,7 +1196,7 @@ static u32 pic_sum(u32 n){ u32 s=0; for(u32 i=0;i<n;i++) s+=g_pic[i]; s&=0xFFFFu
|
|
|
|
|
#define EXT_MAGIC 0x54584550u /* "PEXT": per item address, length, sum, first word of the picture */
|
|
|
|
|
static void draw_item_pic(u32 id, int cx, int cy, int box){
|
|
|
|
|
int k=cat_find(id);
|
|
|
|
|
if(!g_cfg.pack_off){ pic_code(cy,"\200\364\200\273\201\207 \200\341\200\362"); return; }
|
|
|
|
|
if(!g_cfg.pack_off){ pic_code(cy,"\200\365\200\274\201\211 \200\342\200\363"); return; }
|
|
|
|
|
if(k<0){ pic_code(cy,"P1"); return; }
|
|
|
|
|
u32 co=g_cfg.cat_off+8u+28u*(u32)k, pic=rd16(co+4u), want=rd16(co+6u);
|
|
|
|
|
u32 xo=g_cfg.cat_off+8u+28u*g_cfg.cat_n, e, end=0;
|
|
|
|
@@ -1272,23 +1272,23 @@ static void draw_item_pic(u32 id, int cx, int cy, int box){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
static const char *group_name(u32 id){ switch(id/1000u){ case 5: return "\200\331\200\310"; case 6: return "\200\202\200\331"; case 7: return "\200\375\200\227\200\203"; case 8: return "\200\353\201\236"; default: return "\200\222\201\225"; } }
|
|
|
|
|
static const char *group_name(u32 id){ switch(id/1000u){ case 5: return "\200\332\200\311"; case 6: return "\200\202\200\332"; case 7: return "\200\376\200\227\200\203"; case 8: return "\200\354\201\241"; default: return "\200\222\201\230"; } }
|
|
|
|
|
|
|
|
|
|
/* Draw a list: title, 10 rows from y=12, footer. */
|
|
|
|
|
static void list_draw(const char *title, u32 n, u32 sel, u32 top, int (*row)(u32 i, char *name, char *right, u16 *col), const char *foot){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(2,title,WHITE,1);
|
|
|
|
|
for(u32 r=0;r<10u && top+r<n;r++){
|
|
|
|
|
u32 i=top+r; int y=12+(int)r*10;
|
|
|
|
|
for(u32 r=0;r<8u && top+r<n;r++){
|
|
|
|
|
u32 i=top+r; int y=16+(int)r*12;
|
|
|
|
|
char nm[64], rt[8]; u16 c=WHITE; nm[0]=0; rt[0]=0;
|
|
|
|
|
row(i,nm,rt,&c);
|
|
|
|
|
if(i==sel) rect(0,y-1,128,y+8,RGB(205,225,169));
|
|
|
|
|
if(i==sel) rect(0,y-1,128,y+10,RGB(205,225,169));
|
|
|
|
|
int rw=text_w(rt,1);
|
|
|
|
|
int maxc = (122-rw)/6;
|
|
|
|
|
textn(3,y,nm,maxc,c,1);
|
|
|
|
|
text(125-rw,y,rt,GREY,1);
|
|
|
|
|
}
|
|
|
|
|
if(n>10u){ int h=100*10/(int)n; if(h<6) h=6; int y=12+(int)(100-h)*(int)top/(int)(n-10u); rect(126,y,128,y+h,GREY); }
|
|
|
|
|
if(n>8u){ int h=96*8/(int)n; if(h<6) h=6; int y=16+(int)(96-h)*(int)top/(int)(n-8u); rect(126,y,128,y+h,GREY); }
|
|
|
|
|
ctext(118,foot,GREY,1);
|
|
|
|
|
show();
|
|
|
|
|
}
|
|
|
|
@@ -1305,7 +1305,7 @@ static void bag_build(void){ g_bagn=0; u32 n=list_len(); for(u32 i=0;i<n;i++) if
|
|
|
|
|
#define BAG_SHOWN(i) 1
|
|
|
|
|
#endif
|
|
|
|
|
static int bag_row(u32 i, char *name, char *right, u16 *col){
|
|
|
|
|
if(i==0){ const char *s="+ \200\333\200\364\201\230 \201\215\200\201"; int k=0; while(s[k]){ name[k]=s[k]; k++; } name[k]=0; *col=GOLD; return 0; }
|
|
|
|
|
if(i==0){ const char *s="+ \200\334\200\365\201\233 \201\220\200\201"; int k=0; while(s[k]){ name[k]=s[k]; k++; } name[k]=0; *col=GOLD; return 0; }
|
|
|
|
|
u32 slot=g_bag[i-1]; const char *s=item_name(list_id(slot)); int k=0; while(s[k] && k<22){ name[k]=s[k]; k++; } name[k]=0;
|
|
|
|
|
right[0]='x'; utoa_(count_get(slot), right+1);
|
|
|
|
|
return 0;
|
|
|
|
@@ -1323,50 +1323,38 @@ static int cat_row(u32 i, char *name, char *right, u16 *col){
|
|
|
|
|
}
|
|
|
|
|
/* Set the count (1..15). Returns the new count, or 0 if cancelled. BAG_DEL: lo 0 allows 0 (= remove), then
|
|
|
|
|
* cancelled is 16. */
|
|
|
|
|
#ifdef BAG_DEL
|
|
|
|
|
static u32 count_edit(u32 id, u32 v, u32 lo){
|
|
|
|
|
if(v<lo) v=lo; if(v>15u) v=15u;
|
|
|
|
|
#else
|
|
|
|
|
static u32 count_edit(u32 id, u32 v){
|
|
|
|
|
const u32 lo=1u;
|
|
|
|
|
if(v<1u) v=1u; if(v>15u) v=15u;
|
|
|
|
|
#endif
|
|
|
|
|
static u32 count_choose(u32 id,u32 v,u32 lo,u32 hi,int adding){
|
|
|
|
|
if(v<lo)v=lo;if(v>hi)v=hi;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
const char *nm=item_name(id); int L=slen(nm);
|
|
|
|
|
ko_title(nm,2);
|
|
|
|
|
rect(30,20,98,84,BG);
|
|
|
|
|
draw_item_pic(id,64,52,64);
|
|
|
|
|
char s[8]; s[0]='x'; utoa_(v,s+1);
|
|
|
|
|
#ifdef BAG_DEL
|
|
|
|
|
if(!v) ctext(90,"\201\203\200\207",GOLD,2); else
|
|
|
|
|
#endif
|
|
|
|
|
ctext(90,s,GOLD,2);
|
|
|
|
|
ctext(108,"\201\260 \200\324\200\254",GREY,1);
|
|
|
|
|
ctext(117,"B \201\254\200\365 C \200\246\200\260",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
|
if(k==1){ int nv=(int)v+(g_step>0?1:-1); if(nv<(int)lo) nv=(int)lo; if(nv>15) nv=15; v=(u32)nv; break; }
|
|
|
|
|
if(k==K_A){ v = v>=15u ? lo : v+1u; break; }
|
|
|
|
|
if(k==K_OK) return v;
|
|
|
|
|
#ifdef BAG_DEL
|
|
|
|
|
if(k==K_BACK) return 16u;
|
|
|
|
|
#else
|
|
|
|
|
if(k==K_BACK) return 0;
|
|
|
|
|
#endif
|
|
|
|
|
rect(0,0,128,128,BG);ko_title(item_name(id),2);draw_item_pic(id,64,54,60);
|
|
|
|
|
char num[8];utoa_(v,num);
|
|
|
|
|
text(20,87,adding?"\201\220\200\201":"\200\325\200\255",WHITE,1);text(65,85,num,GOLD,2);text(103,87,"\200\206",WHITE,1);
|
|
|
|
|
ctext(105,"\201\263 \200\325\200\255 \201\206\201\203",GREY,1);ctext(117,"B \201\257\200\366 C \200\273\200\262",GREY,1);show();wait_release();
|
|
|
|
|
for(;;){int k=input();
|
|
|
|
|
if(k==1){int nv=(int)v+g_step;if(nv<(int)lo)nv=(int)lo;if(nv>(int)hi)nv=(int)hi;v=(u32)nv;break;}
|
|
|
|
|
if(k==K_A){if(v<hi)v++;break;}
|
|
|
|
|
if(k==K_OK)return v;if(k==K_BACK)return 16u;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#ifdef BAG_DEL
|
|
|
|
|
static u32 count_edit(u32 id,u32 v,u32 lo){return count_choose(id,v,lo,15u,0);}
|
|
|
|
|
#else
|
|
|
|
|
static u32 count_edit(u32 id,u32 v){u32 n=count_choose(id,v,1u,15u,0);return n==16u?0u:n;}
|
|
|
|
|
#endif
|
|
|
|
|
static u32 count_add(u32 id,u32 owned){
|
|
|
|
|
if(owned>=15u){message("\201\217\200\236 15\200\206 \200\301\200\360","\200\237 \201\220\200\201\201\250 \200\325 \200\342\200\330\200\233\200\234","");return 16u;}
|
|
|
|
|
u32 n=count_choose(id,1u,1u,15u-owned,1);return n==16u?16u:owned+n;
|
|
|
|
|
}
|
|
|
|
|
static int g_dirty;
|
|
|
|
|
static void cat_pick(void){
|
|
|
|
|
cat_build();
|
|
|
|
|
if(!g_catn){ message("\200\333\200\364\201\230 \200\272\200\261 \200\341\200\362","\201\251\200\376 ROM\200\343",""); return; }
|
|
|
|
|
if(!g_catn){ message("\200\334\200\365\201\233 \200\273\200\262 \200\342\200\363","\201\254\200\377 ROM\200\344",""); return; }
|
|
|
|
|
u32 sel=0, top=0;
|
|
|
|
|
for(;;){
|
|
|
|
|
if(sel<top) top=sel; if(sel>=top+10u) top=sel-9u;
|
|
|
|
|
char t[64]; const char *g=group_name(g_cat[sel]); int k=0; const char *a="\201\215\200\201: "; while(a[k]){ t[k]=a[k]; k++; } int j=0; while(g[j]){ t[k++]=g[j++]; } t[k]=0;
|
|
|
|
|
rect(0,0,128,128,BG);ctext(3,t,WHITE,1);draw_item_pic(g_cat[sel],64,54,64);ko_title(item_name(g_cat[sel]),94);ctext(117,"A \200\305\200\263 B \200\315\201\226 C \200\246\200\260",GREY,1);show();
|
|
|
|
|
if(sel<top) top=sel; if(sel>=top+8u) top=sel-7u;
|
|
|
|
|
char t[64]; const char *g=group_name(g_cat[sel]); int k=0; const char *a="\201\220\200\201: "; while(a[k]){ t[k]=a[k]; k++; } int j=0; while(g[j]){ t[k++]=g[j++]; } t[k]=0;
|
|
|
|
|
list_draw(t, g_catn, sel, top, cat_row, "A \200\306\200\264 B \200\316\201\231 C \200\247\200\261");
|
|
|
|
|
wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int c=input();
|
|
|
|
@@ -1376,13 +1364,13 @@ static void cat_pick(void){
|
|
|
|
|
if(c==K_OK){
|
|
|
|
|
u32 id=g_cat[sel], n=list_len(), slot=n;
|
|
|
|
|
for(u32 i=0;i<n;i++) if(list_id(i)==id){ slot=i; break; }
|
|
|
|
|
if(slot>=640u){ message("\200\201\200\274\200\364 \200\201\200\250 \201\212","",""); return; }
|
|
|
|
|
if(slot>=640u){ message("\200\201\200\275\200\365 \200\201\200\251 \201\214","",""); return; }
|
|
|
|
|
#ifdef BAG_DEL
|
|
|
|
|
u32 v=count_edit(id, slot<n ? count_get(slot) : 1u, 1u);
|
|
|
|
|
u32 v=count_add(id, slot<n ? count_get(slot) : 0u);
|
|
|
|
|
if(v<16u){ list_set(slot,id); count_set(slot,v); g_dirty=1; return; }
|
|
|
|
|
#else
|
|
|
|
|
u32 v=count_edit(id, slot<n ? count_get(slot) : 1u);
|
|
|
|
|
if(v){ list_set(slot,id); count_set(slot,v); g_dirty=1; return; }
|
|
|
|
|
u32 v=count_add(id, slot<n ? count_get(slot) : 0u);
|
|
|
|
|
if(v<16u){ list_set(slot,id); count_set(slot,v); g_dirty=1; return; }
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@@ -1396,8 +1384,8 @@ static void items_menu(void){
|
|
|
|
|
for(;;){
|
|
|
|
|
bag_build();
|
|
|
|
|
u32 n=g_bagn+1u; if(sel>=n) sel=n-1u;
|
|
|
|
|
if(sel<top) top=sel; if(sel>=top+10u) top=sel-9u;
|
|
|
|
|
list_draw("\200\333\200\364\201\230", n, sel, top, bag_row, "B \201\234\201\211 C \200\246\200\260");
|
|
|
|
|
if(sel<top) top=sel; if(sel>=top+8u) top=sel-7u;
|
|
|
|
|
list_draw("\200\334\200\365\201\233", n, sel, top, bag_row, "B \201\237\201\213 C \200\247\200\261");
|
|
|
|
|
wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int c=input();
|
|
|
|
@@ -1414,9 +1402,9 @@ static void items_menu(void){
|
|
|
|
|
}
|
|
|
|
|
if(c==K_BACK){
|
|
|
|
|
if(!g_dirty) return;
|
|
|
|
|
rect(0,0,128,128,BG); ctext(34,"\200\277\200\212\200\361 \200\377\200\375\201\245\200\223\200\352?",WHITE,1); ctext(60,"\200\302\201\213\200\201 \200\376\200\330\200\373\200\245\200\233\200\234",GREY,1);
|
|
|
|
|
ctext(92,"B \200\346",WHITE,1); ctext(106,"C \200\333\200\233\200\352",GREY,1); show();
|
|
|
|
|
if(yes_no()) set_write("\200\333\200\364\201\230 \200\377\200\375 \200\351\200\262");
|
|
|
|
|
rect(0,0,128,128,BG); ctext(34,"\200\300\200\212\200\362 \201\200\200\376\201\250\200\223\200\353?",WHITE,1); ctext(60,"\200\303\201\215\200\201 \200\377\200\331\200\374\200\246\200\233\200\234",GREY,1);
|
|
|
|
|
ctext(92,"B \200\347",WHITE,1); ctext(106,"C \200\334\200\233\200\353",GREY,1); show();
|
|
|
|
|
if(yes_no()) set_write("\200\334\200\365\201\233 \201\200\200\376 \200\352\200\263");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1429,15 +1417,15 @@ static void points_menu(void){
|
|
|
|
|
int pos=0;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(10,"\200\234\200\267\201\235\200\365\201\232",GOLD,1);
|
|
|
|
|
ctext(10,"\200\234\200\270\201\240\200\366\201\235",GOLD,1);
|
|
|
|
|
for(int i=0;i<5;i++){
|
|
|
|
|
int x=14+i*21; char s[2]={(char)('0'+dg[i]),0};
|
|
|
|
|
if(i==pos) rect(x-2,40,x+17,68,RGB(60,60,110));
|
|
|
|
|
text(x,43,s,i==pos?GOLD:WHITE,3);
|
|
|
|
|
}
|
|
|
|
|
ctext(80,"\201\260 \200\325\200\372 \200\277\200\212",GREY,1);
|
|
|
|
|
ctext(92,"B \200\234\200\362 A \200\364\201\201",GREY,1);
|
|
|
|
|
ctext(106,"C \201\216\200\322",GREY,1);
|
|
|
|
|
ctext(80,"\201\263 \200\326\200\373 \200\300\200\212",GREY,1);
|
|
|
|
|
ctext(92,"B \200\234\200\363 A \200\365\201\202",GREY,1);
|
|
|
|
|
ctext(106,"C \201\221\200\323",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -1448,10 +1436,10 @@ static void points_menu(void){
|
|
|
|
|
if(pos<4){ pos++; break; }
|
|
|
|
|
u32 nv=0; for(int i=0;i<5;i++) nv=nv*10u+dg[i];
|
|
|
|
|
if(nv==money_get()) return;
|
|
|
|
|
rect(0,0,128,128,BG); ctext(24,"\201\235\200\365\201\232 \200\316\201\202\200\204",WHITE,1);
|
|
|
|
|
char s[8]; utoa_(nv,s); ctext(44,s,GOLD,2); ctext(70,"\200\302\201\213\200\201 \200\376\200\330\200\373\200\245\200\233\200\234",GREY,1);
|
|
|
|
|
ctext(92,"B \200\346",WHITE,1); ctext(106,"C \200\333\200\233\200\352",GREY,1); show();
|
|
|
|
|
if(yes_no()){ money_put(nv); set_write("\201\235\200\365\201\232 \200\377\200\375 \200\351\200\262"); }
|
|
|
|
|
rect(0,0,128,128,BG); ctext(24,"\201\240\200\366\201\235 \200\317\201\204\200\204",WHITE,1);
|
|
|
|
|
char s[8]; utoa_(nv,s); ctext(44,s,GOLD,2); ctext(70,"\200\303\201\215\200\201 \200\377\200\331\200\374\200\246\200\233\200\234",GREY,1);
|
|
|
|
|
ctext(92,"B \200\347",WHITE,1); ctext(106,"C \200\334\200\233\200\353",GREY,1); show();
|
|
|
|
|
if(yes_no()){ money_put(nv); set_write("\201\240\200\366\201\235 \201\200\200\376 \200\352\200\263"); }
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1464,14 +1452,14 @@ static int tama_ok(void){ return (g_cfg.flags & F_TAMA) && g_cfg.version>=6u &&
|
|
|
|
|
static u32 lv_get(void){ return g_set[g_cfg.level_off] & 15u; }
|
|
|
|
|
static u32 t_id(void){ u32 o=g_cfg.tama_off+4u; return g_set[o]|(g_set[o+1]<<8); }
|
|
|
|
|
static u32 t_stage(void){ return (g_set[g_cfg.tama_off+0x18u]>>2)&7u; }
|
|
|
|
|
static const char *stage_name(u32 st){ switch(st){ case 1: return "\200\335"; case 2: return "\200\333\200\222"; case 3: return "\200\357\200\333\200\222"; case 4: return "\200\317\200\375\200\222"; case 5: return "\200\317\201\213"; default: return "?"; } }
|
|
|
|
|
static const char *stage_name(u32 st){ switch(st){ case 1: return "\200\336"; case 2: return "\200\334\200\222"; case 3: return "\200\360\200\334\200\222"; case 4: return "\200\320\200\376\200\222"; case 5: return "\200\320\201\215"; default: return "?"; } }
|
|
|
|
|
static u16 g_chr[256]; static u32 g_chrn;
|
|
|
|
|
static void chr_build(u32 st){ g_chrn=0; for(u32 k=0;k<g_cfg.cat_n && g_chrn<256u;k++){ u32 o=g_cfg.cat_off+8u+28u*k; if(fl(o+2)[0]==2u && fl(o+6)[0]==st) g_chr[g_chrn++]=(u16)k; } }
|
|
|
|
|
static void chr_name(u32 k, char *out){const char *n=item_name(rd16(g_cfg.cat_off+8u+28u*k));int i=0;while(n[i]&&i<60){out[i]=n[i];i++;}out[i]=0;}
|
|
|
|
|
static int chr_row(u32 i, char *name, char *right, u16 *col){
|
|
|
|
|
u32 k=g_chr[i], o=g_cfg.cat_off+8u+28u*k; chr_name(k,name);
|
|
|
|
|
u32 f=fl(o+7)[0]; const char *fn=""; if(f && f-1u<nfields()){ fn=fname(f-1u); *col=fcol(f-1u); }
|
|
|
|
|
int q=0; while(fn[q] && q<3){ right[q]=fn[q]; q++; } right[q]=0;
|
|
|
|
|
u32 f=fl(o+7)[0]; const char *fn=""; if(f && f-1u<nfields()){ fn=fname(f-1u); *col=WHITE; }
|
|
|
|
|
int q=0; while(fn[q] && q<4){ right[q]=fn[q]; q++; } right[q]=0;
|
|
|
|
|
if(rd16(o)==t_id()) *col=GOLD;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
@@ -1504,17 +1492,18 @@ static u32 tama_files(u32 old, u32 nw){
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|
static u32 ko_names(void){u32 a=g_cfg.cat_off+12u+40u*g_cfg.cat_n;return rd32(a)==0x31464f4bu?a+8u+13u*rd32(a+4u):0;}
|
|
|
|
|
static void ko_portrait(u32 k){u32 a=ko_names();if(!a)return;u32 o=rd32(a+26u*g_cfg.cat_n+4u*k);if(!o)return;for(u32 y=0;y<32;y++)for(u32 x=0;x<32;x++){u32 c=rd16(g_cfg.cat_off+o+2u*(y*32u+x));if(c!=0xf81fu)rect(32+x*2,27+y*2,34+x*2,29+y*2,(u16)c);}}
|
|
|
|
|
static u32 ko_le32(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 void ko_portrait(u32 k){u32 a=ko_names();if(!a)return;u32 o=ko_le32(a+26u*g_cfg.cat_n+4u*k);if(!o)return;for(u32 y=0;y<32;y++)for(u32 x=0;x<32;x++){const volatile u8 *p=fl(g_cfg.cat_off+o+2u*(y*32u+x));u32 c=p[0]|((u32)p[1]<<8);if(c!=0xf81fu)rect(32+x*2,27+y*2,34+x*2,29+y*2,(u16)c);}}
|
|
|
|
|
static void chr_pick(void){
|
|
|
|
|
static const u8 st_list[3]={3,4,5}; u32 si=t_stage()>=3u && t_stage()<=5u ? t_stage()-3u : 2u;
|
|
|
|
|
u32 sel=0, top=0;
|
|
|
|
|
chr_build(st_list[si]);
|
|
|
|
|
for(;;){
|
|
|
|
|
if(!g_chrn){ message("\201\221\200\266\201\227 \200\341\200\362","\201\251\200\376 ROM\200\343",""); return; }
|
|
|
|
|
if(!g_chrn){ message("\201\224\200\267\201\232 \200\342\200\363","\201\254\200\377 ROM\200\344",""); return; }
|
|
|
|
|
if(sel>=g_chrn) sel=g_chrn-1u;
|
|
|
|
|
if(sel<top) top=sel; if(sel>=top+10u) top=sel-9u;
|
|
|
|
|
char t[64]; const char *a="\200\234\200\267: "; int k=0; while(a[k]){ t[k]=a[k]; k++; } const char *b=stage_name(st_list[si]); int j=0; while(b[j]) t[k++]=b[j++]; t[k]=0;
|
|
|
|
|
rect(0,0,128,128,BG);ctext(3,t,WHITE,1);ko_portrait(g_chr[sel]);char name[64];chr_name(g_chr[sel],name);ko_title(name,94);ctext(117,"A \200\235\200\213 B \200\315\201\226 C \200\246\200\260",GREY,1);show();
|
|
|
|
|
if(sel<top) top=sel; if(sel>=top+8u) top=sel-7u;
|
|
|
|
|
char t[64]; const char *a="\200\234\200\270: "; int k=0; while(a[k]){ t[k]=a[k]; k++; } const char *b=stage_name(st_list[si]); int j=0; while(b[j]) t[k++]=b[j++]; t[k]=0;
|
|
|
|
|
list_draw(t, g_chrn, sel, top, chr_row, "A \200\235\200\213 B \200\316\201\231 C \200\247\200\261");
|
|
|
|
|
wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int c=input();
|
|
|
|
@@ -1524,14 +1513,14 @@ static void chr_pick(void){
|
|
|
|
|
if(c==K_OK){
|
|
|
|
|
u32 kk=g_chr[sel], o=g_cfg.cat_off+8u+28u*kk, nw=rd16(o), st=fl(o+6)[0], old=t_id();
|
|
|
|
|
char nm[64]; chr_name(kk,nm);
|
|
|
|
|
rect(0,0,128,128,BG); ctext(24,"\200\277\200\212\201\245 \200\234\200\267\200\214\201\217",WHITE,1); ctext(42,nm,GOLD,1); ctext(54,stage_name(st),GREY,1);
|
|
|
|
|
ctext(76,"\200\302\201\213\200\201 \200\376\200\330\200\373\200\245\200\233\200\234",GREY,1); ctext(96,"B \200\346",WHITE,1); ctext(108,"C \200\333\200\233\200\352",GREY,1); show();
|
|
|
|
|
rect(0,0,128,128,BG);ko_title(nm,2);ko_portrait(kk);
|
|
|
|
|
ctext(95,stage_name(st),GREY,1);ctext(117,"B \200\300\200\212 C \200\273\200\262",GREY,1);show();
|
|
|
|
|
if(!yes_no()) break;
|
|
|
|
|
u32 to=g_cfg.tama_off;
|
|
|
|
|
#ifdef FELD_TAMA_ANY
|
|
|
|
|
/* without the Tama's file the game keeps showing the old Tama: say so instead of "changed" (files first, the
|
|
|
|
|
* settings block in RAM stays untouched then) */
|
|
|
|
|
if(old && old!=nw && !tama_files(old, nw)){ message("\200\234\200\267\200\214\201\217 \200\341\200\362","\200\277\200\212\201\243\201\207 \200\334\200\336\200\327\200\233\200\234",""); return; }
|
|
|
|
|
if(old && old!=nw && !tama_files(old, nw)){ message("\200\234\200\270\200\214\201\222 \200\342\200\363","\200\300\200\212\201\246\201\211 \200\335\200\337\200\330\200\233\200\234",""); return; }
|
|
|
|
|
#endif
|
|
|
|
|
g_set[to+4]=(u8)nw; g_set[to+5]=(u8)(nw>>8); g_set[to+6]=(u8)nw; g_set[to+7]=(u8)(nw>>8);
|
|
|
|
|
g_set[to+0x18u]=(u8)((g_set[to+0x18u]&~0x1Cu)|((st&7u)<<2));
|
|
|
|
@@ -1539,7 +1528,7 @@ static void chr_pick(void){
|
|
|
|
|
#else
|
|
|
|
|
if(old && old!=nw) tama_files(old, nw);
|
|
|
|
|
#endif
|
|
|
|
|
set_write("\200\234\200\267\200\214\201\217 \200\277\200\212\200\244");
|
|
|
|
|
set_write("\200\234\200\270\200\214\201\222 \200\300\200\212\200\245");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -1548,9 +1537,9 @@ static void chr_pick(void){
|
|
|
|
|
static void level_edit(void){
|
|
|
|
|
u32 v=lv_get(), old=v;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(10,"\201\250\200\317 \200\256\200\276",GOLD,1);
|
|
|
|
|
rect(0,0,128,128,BG); ctext(10,"\201\253\200\320 \200\257\200\277",GOLD,1);
|
|
|
|
|
char s[4]; utoa_(v,s); ctext(40,s,WHITE,4);
|
|
|
|
|
ctext(80,"\201\260 \200\256\200\276 \200\277\200\212",GREY,1); ctext(94,"B \201\254\200\365 C \200\246\200\260",GREY,1); show(); wait_release();
|
|
|
|
|
ctext(80,"\201\263 \200\257\200\277 \200\300\200\212",GREY,1); ctext(94,"B \201\257\200\366 C \200\247\200\261",GREY,1); show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
|
if(k==1){ int nv=(int)v+(g_step>0?1:-1); if(nv<0) nv=0; if(nv>10) nv=10; v=(u32)nv; break; }
|
|
|
|
@@ -1561,33 +1550,33 @@ static void level_edit(void){
|
|
|
|
|
u32 o=g_cfg.level_off, b=g_set[o];
|
|
|
|
|
/* up: the game celebrates the new level itself; down: nothing to celebrate */
|
|
|
|
|
g_set[o]=(u8)(v>old ? ((b&0xF0u)|v) : ((v<<4)|v));
|
|
|
|
|
set_write("\200\256\200\276 \200\377\200\375 \200\351\200\262");
|
|
|
|
|
set_write("\200\257\200\277 \201\200\200\376 \200\352\200\263");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
static void care_full(void){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(24,"\200\241\200\303 \201\256\200\301",WHITE,1); ctext(40,"\200\275\200\304\200\264\200\200\201\250\200\301\200\200\200\210\200\205",GOLD,1);
|
|
|
|
|
ctext(70,"\200\302\201\213\200\201 \200\376\200\330\200\373\200\245\200\233\200\234",GREY,1); ctext(92,"B \200\346",WHITE,1); ctext(106,"C \200\333\200\233\200\352",GREY,1); show();
|
|
|
|
|
rect(0,0,128,128,BG); ctext(24,"\200\242\200\304 \201\261\200\302",WHITE,1); ctext(40,"\200\276\200\305\200\265\200\200\201\253\200\302\200\200\200\210\200\205",GOLD,1);
|
|
|
|
|
ctext(70,"\200\303\201\215\200\201 \200\377\200\331\200\374\200\246\200\233\200\234",GREY,1); ctext(92,"B \200\347",WHITE,1); ctext(106,"C \200\334\200\233\200\353",GREY,1); show();
|
|
|
|
|
if(!yes_no()) return;
|
|
|
|
|
u32 to=g_cfg.tama_off;
|
|
|
|
|
g_set[to+0x1Cu]=6u; g_set[to+0x1Du]=20u; g_set[to+0x10u]=0u;
|
|
|
|
|
set_write("\200\241\200\303 \201\256\200\301 \200\351\200\262");
|
|
|
|
|
set_write("\200\242\200\304 \201\261\200\302 \200\352\200\263");
|
|
|
|
|
}
|
|
|
|
|
static void big_entry(int y, int sel, const char *name, const char *st, u16 c, u16 stc);
|
|
|
|
|
static void tama_menu(void){
|
|
|
|
|
if(set_check_msg()) return;
|
|
|
|
|
u32 sel=0;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(2,"\200\234\200\267\200\214\201\217",WHITE,1);
|
|
|
|
|
rect(0,0,128,128,BG); ctext(2,"\200\234\200\270\200\214\201\222",WHITE,1);
|
|
|
|
|
char st[64], nm[64]; nm[0]=0;
|
|
|
|
|
utoa_(lv_get(),st); big_entry(12,sel==0,"\200\256\200\276",st,GOLD,GREY);
|
|
|
|
|
utoa_(lv_get(),st); big_entry(12,sel==0,"\200\257\200\277",st,GOLD,GREY);
|
|
|
|
|
{ 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\277\200\212",nm,PINK,GREY);
|
|
|
|
|
{ u32 to=g_cfg.tama_off; char *p=st; const char *a="\200\275\200\304\200\264 "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Cu],p); while(*p) p++; a=" \201\250\200\301 "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Du],p); while(*p) p++; if(g_set[to+0x10u]){ a=" \200\333\201\241"; while(*a) *p++=*a++; } *p=0; }
|
|
|
|
|
big_entry(70,sel==2,"\200\241\200\303",st,ORANGE,GREY);
|
|
|
|
|
ctext(117,"B \201\254\200\365 C \200\246\200\260",GREY,1);
|
|
|
|
|
big_entry(41,sel==1,"\200\300\200\212",nm,PINK,GREY);
|
|
|
|
|
{ u32 to=g_cfg.tama_off; char *p=st; const char *a="\200\276\200\305\200\265 "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Cu],p); while(*p) p++; a=" \201\253\200\302 "; while(*a) *p++=*a++; utoa_(g_set[to+0x1Du],p); while(*p) p++; if(g_set[to+0x10u]){ a=" \200\334\201\244"; while(*a) *p++=*a++; } *p=0; }
|
|
|
|
|
big_entry(70,sel==2,"\200\242\200\304",st,ORANGE,GREY);
|
|
|
|
|
ctext(117,"B \201\257\200\366 C \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -1629,9 +1618,9 @@ static void saves_scan(void){
|
|
|
|
|
static u32 field_pick(void){ /* field for a new game, 0xFF = back */
|
|
|
|
|
u32 nf=nfields(), sel=0;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG); ctext(2,"\200\330\200\373\201\245 \201\207\200\344",WHITE,1);
|
|
|
|
|
rect(0,0,128,128,BG); ctext(2,"\200\331\200\374\201\250 \201\211\200\345",WHITE,1);
|
|
|
|
|
for(u32 i=0;i<nf;i++){ int y=14+(int)i*16; if(i==sel){ rect(1,y,127,y+15,fcol(i)); rect(2,y+1,126,y+14,BG); } text(5,y+4,fname(i),fcol(i),1); }
|
|
|
|
|
ctext(117,"B \201\254\200\365 C \200\246\200\260",GREY,1); show(); wait_release();
|
|
|
|
|
ctext(117,"B \201\257\200\366 C \200\247\200\261",GREY,1); show(); wait_release();
|
|
|
|
|
for(;;){ int k=input();
|
|
|
|
|
if(k==1){ sel=(u32)((int)sel+(g_step>0?1:-1)+(int)nf)%nf; break; }
|
|
|
|
|
if(k==K_A){ sel=(sel+1u)%nf; break; }
|
|
|
|
@@ -1645,24 +1634,24 @@ static void saves_menu(int with_app, int top){
|
|
|
|
|
u32 na = with_app ? (g_napp>1u ? 1u : g_napp) : 0u, n=ns+na, sel = na ? ns : (u32)g_act;
|
|
|
|
|
for(;;){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
if(n<=4u) ctext(2, top ? "PARAMIX" : "\200\377\200\375 \200\272\200\261", WHITE,1);
|
|
|
|
|
if(n<=4u) ctext(2, top ? "PARAMIX" : "\201\200\200\376 \200\273\200\262", WHITE,1);
|
|
|
|
|
for(u32 i=0;i<n;i++){
|
|
|
|
|
char nm[12], st[48]; u16 c=ORANGE, stc=GREY;
|
|
|
|
|
if(i<ns){
|
|
|
|
|
const char *a="\200\377\200\375 "; int k=0; while(a[k]){ nm[k]=a[k]; k++; } nm[k++]=(char)('1'+i); nm[k]=0;
|
|
|
|
|
const char *a="\201\200\200\376 "; int k=0; while(a[k]){ nm[k]=a[k]; k++; } nm[k++]=(char)('1'+i); nm[k]=0;
|
|
|
|
|
int f=g_sfld[i]; char *p=st;
|
|
|
|
|
if((int)i!=g_act && !slot_valid(i)){ const char *e="\200\307\200\337 \200\371\200\362"; while(*e) *p++=*e++; c=GREY; }
|
|
|
|
|
if((int)i!=g_act && !slot_valid(i)){ const char *e="\200\310\200\340 \200\372\200\363"; while(*e) *p++=*e++; c=GREY; }
|
|
|
|
|
else if(n>4u && g_snm[i][0]){ for(int q=0;g_snm[i][q];q++) *p++=g_snm[i][q]; if(f>=0) c=fcol((u32)f); } /* compact: the Tama, field by colour */
|
|
|
|
|
else { const char *e=f>=0 ? fname((u32)f) : "?"; while(*e) *p++=*e++; if(g_snm[i][0]){ *p++=' '; for(int q=0;g_snm[i][q];q++) *p++=g_snm[i][q]; } if(f>=0) c=fcol((u32)f); }
|
|
|
|
|
*p=0; if((int)i==g_act) stc=WHITE;
|
|
|
|
|
} else { const char *e=g_napp>1u ? "\201\237\200\260\200\217\200\253" : g_appnm[0]; int k=0; while(e[k] && k<11){ nm[k]=e[k]; k++; } nm[k]=0; e=g_napp>1u?"\200\315\201\226":"\200\330\200\373"; int q=0; while(e[q]){ st[q]=e[q]; q++; } st[q]=0; }
|
|
|
|
|
} else { const char *e=g_napp>1u ? "\201\242\200\261\200\217\200\254" : g_appnm[0]; int k=0; while(e[k] && k<11){ nm[k]=e[k]; k++; } nm[k]=0; e=g_napp>1u?"\200\316\201\231":"\200\331\200\374"; int q=0; while(e[q]){ st[q]=e[q]; q++; } st[q]=0; }
|
|
|
|
|
if(n>4u){
|
|
|
|
|
int y=2+(int)i*16;
|
|
|
|
|
if(i==sel){ rect(1,y,127,y+15,c); rect(2,y+1,126,y+14,BG); }
|
|
|
|
|
text(5,y+4,nm,c,1); int w=text_w(st,1); int x=123-w; if(x<48) x=48; textn(x,y+4,st,(124-x)/6,stc,1);
|
|
|
|
|
} else big_entry((n<4u?12:1)+(int)i*29, i==sel, nm, st, c, stc);
|
|
|
|
|
}
|
|
|
|
|
ctext(117,"B \201\254\200\365 C \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(117,"B \201\257\200\366 C \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -1673,14 +1662,14 @@ static void saves_menu(int with_app, int top){
|
|
|
|
|
if(sel>=ns){ if(g_napp>1u) apps_menu(0); else start_app_i(0); break; }
|
|
|
|
|
if((int)sel==g_act){ if(top) leave(); return; }
|
|
|
|
|
int has=slot_valid(sel); u32 fld;
|
|
|
|
|
if(has){ fld=(u32)g_sfld[sel]; if(g_sfld[sel]<0){ message("\200\377\200\375","\200\366\200\222 \200\332\201\233",""); break; } }
|
|
|
|
|
if(has){ fld=(u32)g_sfld[sel]; if(g_sfld[sel]<0){ message("\201\200\200\376","\200\367\200\222 \200\333\201\236",""); break; } }
|
|
|
|
|
else { fld=field_pick(); if(fld==0xFFu) break; }
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
char t[8]="\200\377\200\375 "; t[5]=(char)('1'+sel); t[6]=0;
|
|
|
|
|
ctext(14, has ? "\200\306\200\255\200\347\200\222" : "\200\313 \200\211\200\367 \201\207\200\344", WHITE,1); ctext(28,t,WHITE,2);
|
|
|
|
|
char t[8]="\201\200\200\376 "; t[5]=(char)('1'+sel); t[6]=0;
|
|
|
|
|
ctext(14, has ? "\200\307\200\256\200\350\200\222" : "\200\314 \200\211\200\370 \201\211\200\345", WHITE,1); ctext(28,t,WHITE,2);
|
|
|
|
|
ctext(52,fname(fld),fcol(fld),1); if(has && g_snm[sel][0]) ctext(64,g_snm[sel],GREY,1);
|
|
|
|
|
ctext(80,"\200\222\201\205 \200\377\200\375 \200\357\201\207",GREY,1);
|
|
|
|
|
ctext(96,"B \200\346",WHITE,1); ctext(108,"C \200\333\200\233\200\352",GREY,1); show();
|
|
|
|
|
ctext(80,"\200\222\201\207 \201\200\200\376 \200\360\201\211",GREY,1);
|
|
|
|
|
ctext(96,"B \200\347",WHITE,1); ctext(108,"C \200\334\200\233\200\353",GREY,1); show();
|
|
|
|
|
if(yes_no()) field_switch2(sel, has, fld);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@@ -1698,23 +1687,17 @@ static void main_menu(void){
|
|
|
|
|
if(g_napp) kinds[n++]=3;
|
|
|
|
|
u32 sel = g_napp ? n-1u : 0u;
|
|
|
|
|
for(;;){
|
|
|
|
|
int ok=set_load()==0;
|
|
|
|
|
set_load();
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(3,"\200\234\200\267\200\214\201\217 \201\234\201\211",WHITE,1);
|
|
|
|
|
ctext(3,"\200\234\200\270\200\214\201\222 \201\237\201\213",WHITE,1);
|
|
|
|
|
for(u32 i=0;i<n;i++){
|
|
|
|
|
int x=9+(int)(i%3u)*39,y=21+(int)(i/3u)*39;
|
|
|
|
|
u16 col=i==sel?GOLD:GREY;
|
|
|
|
|
rect(x-3,y-3,x+34,y+34,col);rect(x-1,y-1,x+32,y+32,BG);
|
|
|
|
|
/* Compact pixel icons: planet, bag, points, Tama and programs. */
|
|
|
|
|
if(kinds[i]==0){rect(x+7,y+3,x+24,y+27,RGB(60,180,235));rect(x+2,y+9,x+29,y+21,RGB(60,180,235));rect(x+7,y+10,x+18,y+15,RGB(110,220,100));rect(x+16,y+17,x+24,y+22,RGB(110,220,100));}
|
|
|
|
|
else if(kinds[i]==1){rect(x+6,y+10,x+26,y+27,PINK);rect(x+10,y+4,x+22,y+14,PINK);rect(x+13,y+7,x+19,y+11,BG);}
|
|
|
|
|
else if(kinds[i]==2){rect(x+7,y+4,x+25,y+27,GOLD);rect(x+3,y+9,x+29,y+22,GOLD);text(x+12,y+11,"P",BG,1);}
|
|
|
|
|
else if(kinds[i]==4){rect(x+5,y+9,x+27,y+25,RGB(120,220,120));rect(x+7,y+3,x+11,y+12,RGB(120,220,120));rect(x+21,y+3,x+25,y+12,RGB(120,220,120));rect(x+10,y+14,x+13,y+17,BG);rect(x+20,y+14,x+23,y+17,BG);rect(x+14,y+21,x+20,y+23,BG);}
|
|
|
|
|
else {rect(x+3,y+6,x+29,y+25,ORANGE);text(x+9,y+11,"AB",BG,1);}
|
|
|
|
|
const char *label;
|
|
|
|
|
switch(kinds[i]){case 0:label="\201\211\200\345\200\215 \201\200\200\376";break;case 1:label="\200\334\200\365\201\233";break;case 2:label="\200\234\200\270\201\240\200\366\201\235";break;case 4:label="\200\234\200\270\200\214\201\222";break;default:label="\201\242\200\261\200\217\200\254";}
|
|
|
|
|
int y=22+(int)i*18;
|
|
|
|
|
if(i==sel){rect(5,y-3,123,y+13,GOLD);rect(7,y-1,121,y+11,RGB(205,225,169));}
|
|
|
|
|
text(14,y,label,WHITE,1);
|
|
|
|
|
}
|
|
|
|
|
const char *label;
|
|
|
|
|
switch(kinds[sel]){case 0:label="\201\207\200\344\200\215 \200\377\200\375";break;case 1:label="\200\333\200\364\201\230";break;case 2:label="\200\234\200\267\201\235\200\365\201\232";break;case 4:label="\200\234\200\267\200\214\201\217";break;default:label="\201\237\200\260\200\217\200\253";}
|
|
|
|
|
ctext(102,label,WHITE,1);ctext(117,"A \200\364\200\242 B \200\315\201\226 C \200\246\200\260",GREY,1);
|
|
|
|
|
ctext(117,"A \200\365\200\243 B \200\316\201\231 C \200\247\200\261",GREY,1);
|
|
|
|
|
show(); wait_release();
|
|
|
|
|
for(;;){
|
|
|
|
|
int k=input();
|
|
|
|
@@ -1772,18 +1755,18 @@ static void run(void){
|
|
|
|
|
/* the game itself moved the Tama to this field (1.6.8): an older save of the field is still stored */
|
|
|
|
|
if(fields && !saves_mode() && slot_valid((u32)g_cur) && rd32(slot_base((u32)g_cur)+28u)!=PEND_MAGIC){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(10,"\200\234\200\267\200\214\201\217 \200\364\200\242 \201\207\200\344",WHITE,1); ctext(22,fname((u32)g_cur),fcol((u32)g_cur),1); ctext(34,"\200\211\200\367\200\343\200\314 \200\364\200\242\201\246",WHITE,1);
|
|
|
|
|
ctext(52,"\200\364\201\201 \201\207\200\344\200\363",GREY,1); ctext(64,fname((u32)g_cur),fcol((u32)g_cur),1); ctext(76,"\200\377\200\375\200\364 \200\230\200\333 \200\371\200\362",GREY,1);
|
|
|
|
|
ctext(96,"B \200\311\201\203",WHITE,1); ctext(108,"C \200\357\201\207",GREY,1);
|
|
|
|
|
ctext(10,"\200\234\200\270\200\214\201\222 \200\365\200\243 \201\211\200\345",WHITE,1); ctext(22,fname((u32)g_cur),fcol((u32)g_cur),1); ctext(34,"\200\211\200\370\200\344\200\315 \200\365\200\243\201\251",WHITE,1);
|
|
|
|
|
ctext(52,"\200\365\201\202 \201\211\200\345\200\364",GREY,1); ctext(64,fname((u32)g_cur),fcol((u32)g_cur),1); ctext(76,"\201\200\200\376\200\365 \200\230\200\334 \200\372\200\363",GREY,1);
|
|
|
|
|
ctext(96,"B \200\312\201\205",WHITE,1); ctext(108,"C \200\360\201\211",GREY,1);
|
|
|
|
|
show();
|
|
|
|
|
if(yes_no()) erase_page(slot_base((u32)g_cur));
|
|
|
|
|
}
|
|
|
|
|
/* interrupted switch? */
|
|
|
|
|
else if(fields && slot_valid((u32)g_act) && (!saves_mode() || rd32(slot_base((u32)g_act)+28u)==PEND_MAGIC)){
|
|
|
|
|
rect(0,0,128,128,BG);
|
|
|
|
|
ctext(14,"\201\201\201\255 \200\373\200\340\200\364",RED,1); ctext(26,"\201\206\200\235\200\243\200\342\200\327\200\233\200\234",RED,1);
|
|
|
|
|
ctext(48,"\200\377\200\375\200\361 \200\301\200\356\201\245\200\223\200\352",WHITE,1); ctext(60,fname((u32)g_cur),fcol((u32)g_cur),1); ctext(72,"?",WHITE,1);
|
|
|
|
|
ctext(96,"B \200\346",WHITE,1); ctext(108,"C \200\333\200\233\200\352",GREY,1);
|
|
|
|
|
ctext(14,"\201\202\201\260 \200\374\200\341\200\365",RED,1); ctext(26,"\201\210\200\235\200\244\200\343\200\330\200\233\200\234",RED,1);
|
|
|
|
|
ctext(48,"\201\200\200\376\200\362 \200\302\200\357\201\250\200\223\200\353",WHITE,1); ctext(60,fname((u32)g_cur),fcol((u32)g_cur),1); ctext(72,"?",WHITE,1);
|
|
|
|
|
ctext(96,"B \200\347",WHITE,1); ctext(108,"C \200\334\200\233\200\353",GREY,1);
|
|
|
|
|
show();
|
|
|
|
|
if(!yes_no()) leave();
|
|
|
|
|
rect(0,0,128,128,BG); show();
|
|
|
|
@@ -1795,7 +1778,7 @@ static void run(void){
|
|
|
|
|
#ifdef FELD_CLEAN
|
|
|
|
|
if(clean_mode() && !clk_now() && CLK_ASK()) clock_menu(1); /* new batteries: the time first */
|
|
|
|
|
#endif
|
|
|
|
|
while(!g_napp) message("\201\237\200\260\200\217\200\253 \200\341\200\362","\201\251\200\376 ROM\200\343","");
|
|
|
|
|
while(!g_napp) message("\201\242\200\261\200\217\200\254 \200\342\200\363","\201\254\200\377 ROM\200\344","");
|
|
|
|
|
apps_menu(1);
|
|
|
|
|
}
|
|
|
|
|
if(g_cfg.flags & (F_BAG|F_TAMA)) main_menu();
|
|
|
|
|