본체 메뉴 안내줄 위치와 긴 이름 줄 간격 정리

11월 17일 사이트에 반영한 내용을 저장소에도 올립니다.

- 다마고치 설정 화면 아래 B/C 안내줄을 조금 올리고 흰색으로 바꿨습니다.
- 자동 언어 메뉴에서 아이템 이름이 두 줄로 넘어가면 글자 높이에 맞춰 줄 간격을 주고 그림을 그만큼 줄여서 겹치지 않게 했습니다.
- 9개 언어의 모든 이름이 그림 위 칸에 들어가는지 확인하는 검사(qa-auto-preview.h)를 넣었습니다. 중국어 긴 아이템 이름도 따로 확인합니다.
- 다시 빌드한 feld-ko, feldc-ko, feld-auto, feldc-auto 펌웨어를 함께 올립니다.
This commit is contained in:
syskiller committed 2026-11-24 07:14:28 +09:00
1 parent 2d48091205
commit 0655d3b599
10 files changed
+66 -5

No files matched your search

Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+14 -2
View File
@@ -1099,7 +1099,19 @@ static int cat_find(u32 id){
}
static int cat_fixed(u32 id){ int k=cat_find(id); return k>=0 && fl(g_cfg.cat_off+8u+28u*(u32)k+2u)[0]; }
static char g_nm[64];
static void ko_title(const char *s,int y){int n=0,w=0;while(s[n]){int z=ko_pair(s+n)?2:1,px=z==2?al_width(128+(((u8)s[n]&127)<<7)+((u8)s[n+1]&127)):6;if(w+px>116)break;w+=px;n+=z;}textn((128-w)/2,y,s,n,WHITE,1);if(s[n])ctext(y+11,s+n,WHITE,1);}
static int ko_title(const char *s,int y){
int n=0,w=0,h=7;
while(s[n]){int z=ko_pair(s+n)?2:1,c=z==2?128+(((u8)s[n]&127)<<7)+((u8)s[n+1]&127):(u8)s[n];
int px=al_width(c);if(w+px>116)break;w+=px;n+=z;
const volatile u8 *g=c>=128?al_glyph(c):0;if(g&&g[1]>h)h=g[1];
}
textn((128-w)/2,y,s,n,WHITE,1);
if(s[n]){y+=h>=11?h+1:11;AlText it={s+n,0,0};int c;h=7;
while((c=al_next(&it,999))>=0){const volatile u8*g=c>=128?al_glyph(c):0;if(g&&g[1]>h)h=g[1];}
ctext(y,s+n,WHITE,1);
}
return y+h+1;
}
static const char *item_name(u32 id){
int k=cat_find(id);
if(k>=0)return al_string((u32)k,1);
@@ -1295,7 +1307,7 @@ static int cat_row(u32 i, char *name, char *right, u16 *col){
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);ko_title(item_name(id),2);draw_item_pic(id,64,54,60);
rect(0,0,128,128,BG);int title_end=ko_title(item_name(id),2);int box=60,cy=54;if(title_end>24){box=85-title_end;cy=(85+title_end)/2;}draw_item_pic(id,64,cy,box);
char num[8];utoa_(v,num);
text(20,87,adding?"\037\041\173":"\037\041\174",WHITE,1);text(65,85,num,GOLD,2);text(103,87,"",WHITE,1);
ctext(101,"\037\041\175",GREY,1);ctext(115,"\037\041\176",GREY,1);show();wait_release();
+1 -1
View File
@@ -1602,7 +1602,7 @@ static void tama_menu(void){
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; }
if(sel==2)ko_detail(st);
ctext(117,"B \201\273\201\200 C \200\252\200\265",GREY,1);
ctext(115,"B \201\273\201\200 C \200\252\200\265",RGB(255,255,255),1);
show(); wait_release();
for(;;){
int k=input();
+25
View File
@@ -0,0 +1,25 @@
/* Exercise every native name against the actual preview framebuffer. */
static void verify_preview_names(void){
for(u32 k=0;k<g_cfg.cat_n;k++){
const char *s=al_string(k,1);rect(0,0,128,128,BG);
int bottom=ko_title(s,2),last=-1;
for(int y=0;y<128;y++)for(int x=0;x<128;x++)if(g_fb[y*128+x]!=BG)last=y;
assert(last>=2 && last<bottom && bottom<85);
u32 id=rd16(g_cfg.cat_off+8u+28u*k);
if(fl(g_cfg.cat_off+8u+28u*k+2u)[0]==2u){
/* A title may not reach the full-height character portrait at y=22. */
assert(bottom<=22);
}else{
u16 title[128*32];assert(bottom<=32);
memcpy(title,g_fb,(size_t)bottom*128*sizeof(u16));
int box=60,cy=54;if(bottom>24){box=85-bottom;cy=(85+bottom)/2;}
draw_item_pic(id,64,cy,box);
assert(!memcmp(title,g_fb,(size_t)bottom*128*sizeof(u16)));
}
/* This two-line Chinese name previously joined its rows at y=13. */
if(al_lang()==7 && id==6021){
rect(0,0,128,128,BG);ko_title(s,2);
for(int x=0;x<128;x++)assert(g_fb[14*128+x]==BG);
}
}
}
+5
View File
@@ -8,6 +8,7 @@
#undef g_out
#include <assert.h>
#include <sys/stat.h>
#include "qa-auto-preview.h"
static const char *proof_root;
static void proof(const char *name,void (*fn)(void),const char *keys){
static char folder[512];snprintf(folder,sizeof folder,"%s/%s",proof_root,name);mkdir(folder,0700);g_dir=folder;g_frame=0;
@@ -17,6 +18,7 @@ static void fields(void){field_menu(0,0);}
static void persist(void){set_write("OK");}
static u32 quantity_result,quantity_owned;
static void quantity(void){quantity_result=count_add(5001,quantity_owned);}
static void long_item(void){count_add(6021,0);}
#include "qa-character-genes.h"
int main(int argc,char **argv){
if(argc!=4)return 2;
@@ -68,9 +70,12 @@ int main(int argc,char **argv){
snprintf(name,sizeof name,"language-%u-points",l);proof(name,points_menu,"c");
for(u32 i=0;i<g_cfg.cat_n;i++){const char*t=al_string(i,1);assert(*t);}
for(u32 i=0;i<al_u32(al_base()+4);i++){int w=text_w(al_string(i,0),1);assert(w<=127);}
verify_preview_names();
if(l==8)proof("chinese-long-item",long_item,"c");
}
host_flash[SET_A+0x7b]&=0xe1u;assert(al_lang()==1);
host_flash[SET_A+0x7b]|=30u;assert(al_lang()==1);
printf("PASS: native language values 1..9, names and labels, invalid language fallback\n");
printf("PASS: all catalog titles in 9 languages fit above pictures; Chinese multiline title has a clear row gap\n");
printf("PASS: text lists, list selection followed by color dial and wraparound, unchanged flash on cancellation, B commits pictured character, quantity 1..15, additive batch inventory\n");free(host_flash);return 0;
}
+18 -1
View File
@@ -41,7 +41,24 @@ const split=s.indexOf('/* ------------------------------------------------------
s=s.replace('if(k>=0){ u32 o=g_cfg.cat_off+8u+28u*(u32)k;', 'if(k>=0)return al_string((u32)k,1);\n if(k>=0){ u32 o=g_cfg.cat_off+8u+28u*(u32)k;');
s=s.replace("s[5]=(char)('0'+code/10); s[6]=(char)('0'+code%10);", "s[3]=(char)('0'+code/10); s[4]=(char)('0'+code%10); s[5]=0;");
s=s.replace("t[5]=(char)('1'+sel); t[6]=0;", "t[3]=(char)('1'+sel); t[4]=0;");
s=s.replace('px=z==2?10:6','px=z==2?al_width(128+(((u8)s[n]&127)<<7)+((u8)s[n+1]&127)):6');
const titleStart=s.indexOf('static void ko_title('),titleEnd=s.indexOf('static const char *item_name',titleStart);
if(titleStart<0||titleEnd<titleStart)throw Error('Preview title changed');
s=s.slice(0,titleStart)+`static int ko_title(const char *s,int y){
int n=0,w=0,h=7;
while(s[n]){int z=ko_pair(s+n)?2:1,c=z==2?128+(((u8)s[n]&127)<<7)+((u8)s[n+1]&127):(u8)s[n];
int px=al_width(c);if(w+px>116)break;w+=px;n+=z;
const volatile u8 *g=c>=128?al_glyph(c):0;if(g&&g[1]>h)h=g[1];
}
textn((128-w)/2,y,s,n,WHITE,1);
if(s[n]){y+=h>=11?h+1:11;AlText it={s+n,0,0};int c;h=7;
while((c=al_next(&it,999))>=0){const volatile u8*g=c>=128?al_glyph(c):0;if(g&&g[1]>h)h=g[1];}
ctext(y,s+n,WHITE,1);
}
return y+h+1;
}
`+s.slice(titleEnd);
s=s.replace('ko_title(item_name(id),2);draw_item_pic(id,64,54,60);',
'int title_end=ko_title(item_name(id),2);int box=60,cy=54;if(title_end>24){box=85-title_end;cy=(85+title_end)/2;}draw_item_pic(id,64,cy,box);');
s=s.replace('static const char *fname(u32 i){ return i<4u ? (const char*)g_cfg.field_name[i] : (const char*)g_cfg.field_name2[i-4u]; }','static const char *fname(u32 i){const char*s=i<4u?(const char*)g_cfg.field_name[i]:(const char*)g_cfg.field_name2[i-4u];'+['LAND','WATER','SKY','FOREST','TROPICAL','GLACIER'].map(k=>'{const char*t="'+k+'";int j=0;while(s[j]&&s[j]==t[j])j++;if(!s[j]&&!t[j])return '+token(k)+';}').join('')+'return s;}');
s=s.replaceAll('ctext(117,','ctext(115,').replaceAll('ctext(105,','ctext(101,').replace('ctext(93,ko_color_name()','ctext(88,ko_color_name()').replace('top=27+','top=22+');
s=s.replaceAll('text(5,119,','text(5,114,');
+3 -1
View File
@@ -81,7 +81,9 @@ static void ko_row(int y,int selected){rect(5,y+2,123,y+14,RGB(18,96,136));rect(
screen=screen.replace(/utoa_\(lv_get\(\),st\); big_entry\(12,sel==0,.*?,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?${labels[0]}:i==1?${labels[1]}:${labels[2]},WHITE,1);}\n utoa_(lv_get(),st);if(sel==0)ko_detail(st);`);
screen=screen.replace(/big_entry\(41,sel==1,.*?,nm,PINK,GREY\);/,'if(sel==1)ko_detail(nm);');
screen=screen.replace(/big_entry\(70,sel==2,.*?,st,ORANGE,GREY\);/,'if(sel==2)ko_detail(st);');
screen=screen.replace(/ctext\(119,("(?:\\.|[^"\\])*"),GREY,1\);/,'ctext(115,$1,RGB(255,255,255),1);');
const footer=/ctext\(11[79],("(?:\\.|[^"\\])*"),GREY,1\);/;
if(!footer.test(screen))throw Error('Character settings footer changed');
screen=screen.replace(footer,'ctext(115,$1,RGB(255,255,255),1);');
s=s.slice(0,ta)+screen+s.slice(tb);
// The full name and growth stage appear in the picture screen; keep list rows uncluttered.
s=s.replace('q<3){ right[q]=fn[q];','q<0){ right[q]=fn[q];');