Share A+C menu design and picture controls in English and Korean
This commit is contained in:
1 parent
e220d59741
commit
c0e835a94d
20 files changed
+1984
-19
No files matched your search
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# Build the Paramix field switch (feld.bin, runs from PRAM 0)
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
CF="--target=thumbv7m-none-eabi -mcpu=cortex-m3 -mthumb -flto -ffreestanding -nostdlib -Oz -fno-common -Wall -Wno-initializer-overrides -Wno-unused-const-variable -fno-builtin-memset -DTONE_FIX -DBL_BLACK -DBL_OFFFIX -DBL_SLEEP -DFAST_LCD -DLCD_FASTCLK -DCLEAN -DPARA_BACK -DPARA_MB_KEEP -DPARA_FLASH -DPARA_FLASH_LATE -DFELD_AUTO -DFELD_BFALL -DFELD_BFALL_NOA -DCLEAN_AUTO -DBAT_SHOW -DBAG_DEL -DFELD_PW -DFELD_TAMA_ANY -DFELD_NOCLK -DFELD_BSETTLE -DFELD_SEEN $XCF"
|
||||
O=""
|
||||
for f in main-en.c hw.c libc.c flash.c; do n=$(basename $f .c); OPT=; [ "$n" = main-en ] && OPT=-Oz; clang $CF $OPT -c $f -o $n.o; O="$O $n.o"; done # 1.6.8: main with -Oz (menu code, size before speed)
|
||||
N=${OUT:-feld-en}
|
||||
ld.lld -T link.ld --no-rosegment $O -o $N.elf
|
||||
llvm-objcopy -O binary -j .text $N.elf $N.bin
|
||||
python3 -c 'import pathlib,sys; p=pathlib.Path(sys.argv[1]); p.write_bytes(p.read_bytes()+b"ITOSM_EN_MENU_V1\x00")' "$N.bin"
|
||||
llvm-size $N.elf; ls -l $N.bin
|
||||
# 1.7.2 CLEAN_ROM: a second build for ROMs without the Paradise (own clock); the start device keeps the build above
|
||||
if [ -z "$XCF" ]; then XCF=-DFELD_CLEAN OUT=feldc-en sh ./build-en.sh --inner; fi
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,55 @@
|
||||
/* Offline renderer. Supply your own private ROM; never distribute that image. */
|
||||
#define HOST
|
||||
#include "main-en.c"
|
||||
#define main upstream_host_main
|
||||
#define g_out host_output_path
|
||||
#include "host.c"
|
||||
#undef main
|
||||
#undef g_out
|
||||
#include <assert.h>
|
||||
#include <sys/stat.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;
|
||||
g_seq=keys;g_pos=0;if(!setjmp(g_jb))fn();
|
||||
}
|
||||
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);}
|
||||
int main(int argc,char **argv){
|
||||
if(argc!=4)return 2;
|
||||
host_flash=malloc(0x1000000);FILE *f=fopen(argv[1],"rb");if(!f)return 3;
|
||||
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;
|
||||
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");
|
||||
// The picture/quantity screen must not mutate inventory on cancellation.
|
||||
u8 snapshot[PAGE];memcpy(snapshot,g_set,PAGE);g_dirty=0;
|
||||
proof("cancel",cat_pick,"bnnncc");assert(!memcmp(snapshot,g_set,PAGE));assert(!g_dirty);
|
||||
quantity_owned=2;proof("add-three",quantity,"nnb");assert(quantity_result==5);
|
||||
quantity_owned=14;proof("capacity",quantity,"nnnnb");assert(quantity_result==15);
|
||||
quantity_owned=15;proof("full",quantity,"b");assert(quantity_result==16);
|
||||
quantity_owned=0;proof("minimum",quantity,"ppb");assert(quantity_result==1);
|
||||
quantity_owned=0;proof("maximum",quantity,"nnnnnnnnnnnnnnnnnb");assert(quantity_result==15);
|
||||
quantity_owned=2;proof("quantity-cancel",quantity,"nnc");assert(quantity_result==16);
|
||||
// Batch insertion and additive updates exercise the real packed save fields.
|
||||
memset(g_set+g_cfg.list_off,0,1280);memset(g_set+g_cfg.count_off,0,320);g_dirty=0;
|
||||
proof("insert",cat_pick,"bnnnb");assert(g_dirty);assert(list_len()==1);assert(count_get(0)==4);
|
||||
u32 item=list_id(0);g_dirty=0;proof("append",cat_pick,"bnnb");assert(g_dirty);assert(list_id(0)==item);assert(list_len()==1);assert(count_get(0)==7);
|
||||
// Cancelling character preview returns to the list without writing any save.
|
||||
memcpy(snapshot,g_set,PAGE);u8 *flash_snapshot=malloc(0x1000000);memcpy(flash_snapshot,host_flash,0x1000000);
|
||||
proof("character-dial",chr_pick,"bnnpppnncc");assert(!memcmp(snapshot,g_set,PAGE));assert(!memcmp(flash_snapshot,host_flash,0x1000000));
|
||||
// Moving from the last row cannot read beyond the catalog. Returning to the
|
||||
// list and reopening must keep the item selected in the picture screen.
|
||||
char edge[300];edge[0]='b';memset(edge+1,'n',256);strcpy(edge+257,"cbc");
|
||||
proof("character-edge",chr_pick,edge);assert(!memcmp(flash_snapshot,host_flash,0x1000000));
|
||||
// B applies the character currently pictured, not the originally opened row.
|
||||
chr_build(t_stage()>=3u&&t_stage()<=5u?t_stage():5u);u32 expected=rd16(g_cfg.cat_off+8u+28u*g_chr[1]);
|
||||
proof("character-confirm",chr_pick,"bnnb");expected=rd16(g_cfg.cat_off+8u+28u*g_chr[2]);assert(t_id()==expected);
|
||||
memcpy(host_flash,flash_snapshot,0x1000000);memcpy(g_set,snapshot,PAGE);free(flash_snapshot);
|
||||
proof("persist",persist,"b");memset(g_set,0,PAGE);assert(set_load()==0);assert(list_id(0)==item);assert(count_get(0)==7);
|
||||
printf("PASS: text lists, picture dial selection and bounds, unchanged flash on cancellation, B commits pictured character, quantity 1..15, additive batch inventory\n");free(host_flash);return 0;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Reference in new issue
Block a user