aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-11-28 18:47:52 -0500
committerhistoria <historiavg@proton.me>2026-11-28 18:47:52 -0500
commita800849f149f9fa1cb1673c38da6cd52441188ed (patch)
treee2bd8f700bb8f29594f34a8af4a8acc9953309eb
downloadfamicom-igo-nyuumon-translation-a800849f149f9fa1cb1673c38da6cd52441188ed.tar.gz
inital commit
-rw-r--r--.gitignore3
-rw-r--r--README.md31
-rw-r--r--assets/famicom-igo-nyuumon.pngbin0 -> 161248 bytes
-rw-r--r--roms/english/Famicom Igo Nyuumon (English).nesbin0 -> 327696 bytes
-rw-r--r--roms/original/Famicom Igo Nyuumon (Japan).nesbin0 -> 163856 bytes
-rw-r--r--tools/advanced_en.py434
-rw-r--r--tools/bank3_en.py266
-rw-r--r--tools/basics_en.py176
-rw-r--r--tools/build.py1557
-rw-r--r--tools/feedback_en.py386
-rw-r--r--tools/font8.py62
-rw-r--r--tools/make_book.py192
-rw-r--r--tools/quiz_en.json1277
-rw-r--r--tools/title_screen.py594
14 files changed, 4978 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b908d4c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+__pycache__/
+*.pyc
+.DS_Store
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..c9f356e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,31 @@
+# Famicom Igo Nyuumon — English Translation Hack
+
+![](assets/famicom-igo-nyuumon.png)
+
+This is a complete English translation of **Famicom Igo Nyuumon** (Famicom Go Basics), a Go training and quiz game for the Famicom.
+
+This is complete LLM slop, an experiment to see how well 2026 LLMs can do translation ROM hacks.
+
+## Playing
+
+The English ROM is here:
+
+```text
+roms/english/Famicom Igo Nyuumon (English).nes
+```
+
+## Building from Source
+
+### Requirements
+
+- Python 3
+- [Pillow](https://python-pillow.org/) (`pip install pillow`)
+- Noto Serif Black Italic font (`/usr/share/fonts/noto/NotoSerif-BlackItalic.ttf`)
+
+### Build
+
+```sh
+python3 tools/build.py
+```
+
+This reads `roms/original/Famicom Igo Nyuumon (Japan).nes`, applies the translation, and writes `roms/english/Famicom Igo Nyuumon (English).nes`
diff --git a/assets/famicom-igo-nyuumon.png b/assets/famicom-igo-nyuumon.png
new file mode 100644
index 0000000..f67caee
--- /dev/null
+++ b/assets/famicom-igo-nyuumon.png
Binary files differ
diff --git a/roms/english/Famicom Igo Nyuumon (English).nes b/roms/english/Famicom Igo Nyuumon (English).nes
new file mode 100644
index 0000000..c4f8fa8
--- /dev/null
+++ b/roms/english/Famicom Igo Nyuumon (English).nes
Binary files differ
diff --git a/roms/original/Famicom Igo Nyuumon (Japan).nes b/roms/original/Famicom Igo Nyuumon (Japan).nes
new file mode 100644
index 0000000..2425bb2
--- /dev/null
+++ b/roms/original/Famicom Igo Nyuumon (Japan).nes
Binary files differ
diff --git a/tools/advanced_en.py b/tools/advanced_en.py
new file mode 100644
index 0000000..2d1cbbe
--- /dev/null
+++ b/tools/advanced_en.py
@@ -0,0 +1,434 @@
+"""English translations for the ADVANCED course (10 lessons, 167 messages)
+and the 10-topic Study-Course Drills (100 prompts + 98 feedback lines).
+
+Every entry is a tuple of 1 or 2 lines, each at most 26 characters wide
+(the exact width of the lesson/drill message box: $1A = 26 cells).
+"""
+
+# ---------------------------------------------------------------------------
+# 167 ADVANCED lesson messages (original table $F3A7..$F4F4, PRG bank 6 -> 8)
+# ---------------------------------------------------------------------------
+ADV_MESSAGES = [
+ # --- Lesson 1: ATARI (0..20) ---
+ ("I AM KUZUMI. I WILL TEACH", "YOU HOW TO WIN AT GO."), # 0 $8000
+ ("YOU KNOW THE RULES OF GO.", "SURROUND FOES TO CAPTURE."), # 1 $8022
+ ("ONE MOVE BEFORE CAPTURE,", "A STONE HAS ONE LIBERTY."), # 2 $804C
+ ("THIS IS CALLED ATARI.", "PLAY HERE TO TAKE 1 WHITE."), # 3 $807C
+ ("TWO WHITE STONES ARE THE", "SAME. THEY ARE IN ATARI."), # 4 $80A8
+ ("ON THE EDGE, TWO STONES", "PUT A STONE IN ATARI."), # 5 $80C9
+ ("TWO STONES ARE IN ATARI.", "GO AHEAD AND CAPTURE THEM."), # 6 $80E9
+ ("CORNER ATARI. CORNERS", "ARE EASY TO LOSE. CAREFUL!"), # 7 $810B
+ ("AN UNUSUAL SHAPE, YET", "ALL 7 WHITE ARE IN ATARI."), # 8 $8138
+ ("THE SAME THING HERE.", "BLACK'S NEXT MOVE TAKES 8."), # 9 $8160
+ ("NOW IT IS 10 STONES, YET", "BLACK STILL TAKES THEM!"), # 10 $8186
+ ("IF IT IS WHITE'S TURN,", "WHITE ESCAPES LIKE THIS."), # 11 $81AA
+ ("BUT IN THIS ATARI SHAPE,", "WHITE CANNOT ESCAPE."), # 12 $81CC
+ ("DOUBLE ATARI ATTACKS TWO", "GROUPS AT THE SAME TIME."), # 13 $81F1
+ ("WHITE CAN ONLY SAVE ONE", "OF THE TWO STONES."), # 14 $8225
+ ("DOUBLE ATARI GUARANTEES", "CAPTURING ONE OF THE TWO."), # 15 $823D
+ ("AN OLD PROVERB WARNS:", "DON'T PLAY BLIND ATARI!"), # 16 $8263
+ ("BEGINNERS OFTEN PLAY", "ATARI WITHOUT THINKING."), # 17 $8291
+ ("IF IT FAILS TO CAPTURE,", "WHITE ESCAPES. YOU LOSE!"), # 18 $82B3
+ ("SO BE CAREFUL WITH ATARI.", "THAT ENDS THIS LESSON."), # 19 $82E0
+ ("FIRST, TRY SOLVING SOME", "PROBLEMS ABOUT ATARI."), # 20 $8306
+
+ # --- Lesson 2: CAPTURE / TAKING STONES (21..35) ---
+ ("LET'S STUDY CAPTURING.", "STONES OFTEN FACE DANGER."), # 21 $8326
+ ("TWO BLACK ARE IN ATARI.", "EVEN RUNNING, WHITE TAKES."), # 22 $8358
+ ("WHITE PLAYS LIKE THIS", "AND CAPTURES BOTH STONES."), # 23 $838B
+ ("ON THE EDGE, IF BLACK", "PLAYS HERE, WHITE IS DEAD."), # 24 $83B0
+ ("WHEN BLACK CUTS WHITE,", "WHITE IS ALREADY CAUGHT."), # 25 $83D5
+ ("SAME HERE. ONE BLACK", "MOVE TRAPS WHITE. TRY IT!"), # 26 $83F3
+ ("IN THE CORNER, THIS CUT", "STOPS WHITE FROM RUNNING."), # 27 $8423
+ ("TRYING TO RUN ONLY LOSES", "MORE STONES IN THE END."), # 28 $843B
+ ("WHEN STONES CANNOT RUN,", "GIVE THEM UP RIGHT AWAY."), # 29 $8461
+ ("WHAT IF BLACK PLAYED", "FROM THE WRONG SIDE HERE?"), # 30 $8486
+ ("WHITE CONNECTS, AND NOW", "BLACK IS IN TROUBLE!"), # 31 $84B9
+ ("ALWAYS READ AHEAD TO SEE", "HOW TO CAPTURE CLEANLY."), # 32 $84DB
+ ("BATTLES TO CAPTURE OR BE", "CAPTURED HAPPEN OFTEN."), # 33 $8510
+ ("IT IS THE FUN OF GO,", "SO ENJOY THE TACTICS!"), # 34 $8534
+ ("NOW TRY SOME PROBLEMS", "ON CAPTURING STONES."), # 35 $8562
+
+ # --- Lesson 3: LADDER / SHICHOU (36..50) ---
+ ("YOU KNOW ATARI: ONE MORE", "MOVE CAPTURES THE STONE."), # 36 $8577
+ ("THERE IS A CLEVER WAY TO", "CHASE STONES WITH ATARI."), # 37 $85B3
+ ("SUPPOSE BLACK PLAYS", "ATARI, AND WHITE RUNS."), # 38 $85E5
+ ("THEN BLACK IMMEDIATELY", "PLAYS ATARI ONCE MORE."), # 39 $860A
+ ("WHITE RUNS AGAIN, BLACK", "CHASES UNTIL WHITE FALLS."), # 40 $8629
+ ("THIS REPEATED ATARI", "CHASE IS CALLED A LADDER."), # 41 $8660
+ ("HERE IS A BIGGER LADDER.", "WHITE IS STILL CAPTURED."), # 42 $868F
+ ("A REAL-GAME SHAPE. HOW", "CAN BLACK START A LADDER?"), # 43 $86B8
+ ("NO LADDER YET. WHAT IF", "BLACK SACRIFICES A STONE?"), # 44 $86F1
+ ("IF WHITE TAKES, BLACK", "PLAYS ATARI RIGHT HERE."), # 45 $8725
+ ("IF WHITE CONNECTS, BLACK", "CATCHES IT IN A LADDER."), # 46 $873C
+ ("A VERY TRICKY PROBLEM,", "BUT BLACK HAS A LADDER."), # 47 $8757
+ ("NO MATTER HOW WHITE", "TRIES, THERE IS NO ESCAPE."), # 48 $878D
+ ("DON'T PLAY GO WITHOUT", "KNOWING LADDERS, THEY SAY."), # 49 $87A6
+ ("NOW TRY SOME PROBLEMS", "ABOUT LADDERS."), # 50 $87D9
+
+ # --- Lesson 4: NET / GETA (51..62) ---
+ ("IF AN ENEMY STONE WAITS", "AHEAD, A LADDER FAILS."), # 51 $87EA
+ ("WHEN A LADDER FAILS,", "THERE IS ANOTHER WAY."), # 52 $881C
+ ("INSTEAD OF ATARI, PLAY", "HERE. CAN WHITE ESCAPE?"), # 53 $883F
+ ("WHITE STILL GETS CAUGHT.", "THIS MOVE IS A NET (GETA)."), # 54 $8872
+ ("IT WORKS ON TWO STONES", "TOO. WHITE CANNOT ESCAPE."), # 55 $88A7
+ ("HERE IT CATCHES THREE", "STONES IN A NET."), # 56 $88DA
+ ("EVEN IF WHITE RUNS, IT", "IS CAUGHT ON MOVE 7."), # 57 $88FB
+ ("A DIRECT CHASE FAILS.", "USE A CLEVER MOVE. TRY IT!"), # 58 $891B
+ ("BLACK CAUGHT WHITE IN A", "NET AND CAPTURED IT."), # 59 $8951
+ ("UNLIKE A LADDER, A NET", "TRAPS STONES INDIRECTLY."), # 60 $8966
+ ("GETA MEANS WOODEN CLOGS,", "TRAPPING STONES UNDERFOOT."), # 61 $899A
+ ("NOW TRY SOME PROBLEMS", "ABOUT NETS (GETA)."), # 62 $89C7
+
+ # --- Lesson 5: SNAPBACK & SHORTAGE / UTTEGAESHI & OIOTOSHI (63..83) ---
+ ("SOMETIMES YOU LET STONES", "BE TAKEN AS A SACRIFICE."), # 63 $89D7
+ ("YOU CAN SACRIFICE TO CATCH", "AN EVEN BIGGER GROUP!"), # 64 $8A0B
+ ("BLACK ATTACKS TWO WHITE.", "WHITE IS IN DANGER."), # 65 $8A30
+ ("IF WHITE TAKES, BLACK", "IMMEDIATELY TAKES THREE!"), # 66 $8A58
+ ("THIS TACTIC IS CALLED A", "SNAPBACK (UTTEGAESHI)."), # 67 $8A89
+ ("ANOTHER SNAPBACK. IF", "WHITE TAKES ONE TO SAVE 3,"), # 68 $8AB1
+ ("BLACK TAKES FOUR! 4 - 1", "MEANS WHITE STILL LOST 3."), # 69 $8ADF
+ ("ANOTHER SNAPBACK. BLACK", "SACRIFICES TO WIN BIG."), # 70 $8B16
+ ("YOU CAN ALSO SACRIFICE", "AND CHASE WITH ATARI."), # 71 $8B4C
+ ("BLACK SACRIFICES A STONE", "TO ATTACK WHITE."), # 72 $8B73
+ ("IF WHITE IGNORES IT, ONE", "GROUP WILL BE CAPTURED."), # 73 $8B8B
+ ("IF WHITE TAKES THAT", "STONE, BLACK PLAYS ATARI!"), # 74 $8BA5
+ ("WHITE CONNECTS TO RUN,", "AND BLACK TAKES ALL FOUR!"), # 75 $8BCB
+ ("THIS TACTIC IS CALLED", "OIOTOSHI (SHORTAGE TRAP)."), # 76 $8BF1
+ ("HERE IS ANOTHER OIOTOSHI", "FOR BLACK TO PLAY."), # 77 $8C15
+ ("EVEN IF WHITE TAKES ONE,", "BLACK TRAPS THE GROUP."), # 78 $8C31
+ ("YOU CAN SEE THAT RUNNING", "IS USELESS FOR WHITE NOW."), # 79 $8C4F
+ ("LET'S TRY AN OIOTOSHI.", "PLAY BLACK RIGHT HERE."), # 80 $8C71
+ ("BOTH TACTICS GIVE UP A", "LITTLE TO GAIN MUCH MORE."), # 81 $8C92
+ ("THEY FEEL GREAT WHEN", "THEY WORK. REMEMBER THEM!"), # 82 $8CC0
+ ("NOW SOLVE PROBLEMS ON", "SNAPBACK AND OIOTOSHI."), # 83 $8CE5
+
+ # --- Lesson 6: CONNECTING / RENRAKU (84..98) ---
+ ("GO IS WON BY TERRITORY,", "SO CONNECTING MATTERS."), # 84 $8CFD
+ ("BOTH SIDES ARE SPLIT.", "WHAT IF BLACK PLAYS HERE?"), # 85 $8D32
+ ("TOP AND BOTTOM JOIN INTO", "ONE GROUP: CONNECTED!"), # 86 $8D60
+ ("IN THE SAME SHAPE, IF", "WHITE PLAYS HERE, NO LINK."), # 87 $8D96
+ ("THIS IS CALLED A CUT.", "WHITE CUT BLACK APART."), # 88 $8DBE
+ ("ANOTHER LINK. IF WHITE", "PLAYS HERE, BLACK IS CUT."), # 89 $8DE0
+ ("BLACK CONNECTS SOLIDLY.", "THIS IS A SOLID CONNECT."), # 90 $8E10
+ ("THIS IS A TIGER'S MOUTH.", "IT LOOKS UNCONNECTED, YET"), # 91 $8E3F
+ ("IF WHITE CUTS, BLACK", "TAKES IT. SO IT IS LINKED!"), # 92 $8E79
+ ("THIS ALSO LOOKS SPLIT,", "YET BLACK CAN STOP A CUT."), # 93 $8EA3
+ ("WHICHEVER WAY WHITE CUTS", "BLACK PLAYS THE OTHER!"), # 94 $8ED5
+ ("THIS IS A BAMBOO JOINT,", "SHAPED LIKE BAMBOO."), # 95 $8EF9
+ ("HAVING TWO EQUIVALENT", "REPLIES IS CALLED MIAI."), # 96 $8F25
+ ("READING CONNECTIONS IS", "VITAL IN EVERY GO GAME."), # 97 $8F57
+ ("NOW TRY SOME PROBLEMS", "ON CONNECTING STONES."), # 98 $8F7F
+
+ # --- Lesson 7: CUTTING / KIRI (99..112) ---
+ ("IF LINKING IS VITAL, SO", "IS CUTTING ENEMY STONES."), # 99 $8F93
+ ("THERE IS A WAY TO SPLIT", "WHITE'S GROUPS APART."), # 100 $8FC3
+ ("NOW WHITE CANNOT LINK.", "BLACK HAS CUT WHITE APART."), # 101 $8FEB
+ ("LET'S HAVE BLACK TRY TO", "CUT WHITE HERE TOO."), # 102 $9017
+ ("WHITE CANNOT CONNECT", "THESE STONES ANYMORE."), # 103 $9031
+ ("NOW, HOW CAN BLACK CUT", "WHITE APART HERE?"), # 104 $9046
+ ("THAT CLEANLY CUT WHITE", "INTO TWO GROUPS!"), # 105 $9061
+ ("THE SHAPE CHANGED A BIT.", "CUTTING NOW IS DANGEROUS!"), # 106 $9071
+ ("DO YOU REMEMBER WHY?", "BLACK DIES IN A LADDER!"), # 107 $90A1
+ ("BEFORE CUTTING, ALWAYS", "CHECK IF THE CUT WORKS."), # 108 $90C3
+ ("THIS CUT WORKS. SIMPLY", "CUT AND ANSWER WHITE."), # 109 $90F9
+ ("GO IS ABOUT CUTTING, AS", "THE OLD SAYING GOES."), # 110 $9128
+ ("CUTTING ENEMY STONES", "OPENS THE WAY TO ATTACK."), # 111 $9151
+ ("NOW TRY SOME PROBLEMS", "ON CUTTING STONES."), # 112 $9176
+
+ # --- Lesson 8: LIFE / IKI (113..134) ---
+ ("YOU ALREADY KNOW STONES", "CAN BE ALIVE OR DEAD."), # 113 $918A
+ ("TWO SEPARATE INSIDE", "POINTS STOP ANY CAPTURE."), # 114 $91B2
+ ("THESE PROTECTED INSIDE", "SPOTS ARE CALLED EYES."), # 115 $91EA
+ ("A GROUP WITH TWO OR MORE", "EYES IS ALWAYS ALIVE."), # 116 $9210
+ ("THIS IS TWO EYES. ALL OF", "THESE BLACK GROUPS LIVE."), # 117 $923D
+ ("WITH TWO EYES, EVEN IF", "SURROUNDED, YOU CAN'T DIE."), # 118 $9276
+ ("BLACK IS ALIVE. EVEN IF", "WHITE INVADES, 2 EYES!"), # 119 $92AA
+ ("IF WHITE TRIES ANOTHER", "MOVE, BLACK STILL LIVES."), # 120 $92D6
+ ("SO PLAYING HERE MAKES", "THIS BLACK GROUP ALIVE."), # 121 $92F6
+ ("ANOTHER WAY TO LIVE IS", "PLAYING THE VITAL POINT."), # 122 $9328
+ ("PLAY THE VITAL POINT TO", "MAKE TWO EYES AND LIVE."), # 123 $934E
+ ("TO MAKE A GROUP LIVE,", "FIND ITS VITAL POINT."), # 124 $9373
+ ("A CARELESS MOVE HERE", "DESTROYS YOUR OWN EYES."), # 125 $9394
+ ("SUPPOSE BLACK PLAYS", "WRONG RIGHT HERE."), # 126 $93BA
+ ("WHITE TAKES THE VITAL", "POINT AND KILLS BLACK!"), # 127 $93D2
+ ("IN LIFE AND DEATH, THE", "CENTER IS OFTEN VITAL."), # 128 $93F6
+ ("HERE BOTH SPOTS ARE", "VITAL. EITHER ONE LIVES."), # 129 $9421
+ ("THERE ARE REAL EYES AND", "FALSE EYES IN GO."), # 130 $9459
+ ("BLACK LOOKS LIKE 2 EYES,", "BUT THE LOWER ONE IS FAKE."), # 131 $947D
+ ("WHITE PLAYS HERE AND", "DESTROYS THAT FAKE EYE."), # 132 $94AC
+ ("A BROKEN EYE IS A FALSE", "EYE. IT CANNOT MAKE LIFE."), # 133 $94DF
+ ("NOW TRY SOME PROBLEMS", "ON MAKING LIFE."), # 134 $9507
+
+ # --- Lesson 9: DEATH / SHI (135..154) ---
+ ("NOW LET'S LEARN HOW TO", "KILL ENEMY GROUPS."), # 135 $951B
+ ("USUALLY YOU REDUCE SPACE", "THEN HIT THE VITAL POINT."), # 136 $953C
+ ("YOU PLAY BLACK. PICK THE", "BEST MOVE FROM A, B, OR C."), # 137 $9988
+ ("FIRST, REDUCE THE ENEMY", "EYE SPACE FROM OUTSIDE."), # 138 $956D
+ ("NEXT, HIT THE VITAL SPOT", "INSIDE: CALLED NAKADE."), # 139 $9584
+ ("INSIDE 3 SPACES IS 3-PT", "NAKADE. WHITE IS DEAD!"), # 140 $95B9
+ ("A LARGER GROUP. FIRST,", "REDUCE WHITE'S EYE SPACE."), # 141 $95EC
+ ("THE SAME 3-PT NAKADE", "KILLS WHITE AGAIN."), # 142 $9603
+ ("ANOTHER TACTIC: BOTH", "WHITE GROUPS LOOK ALIVE..."), # 143 $961D
+ ("SUPPOSE WHITE CAPTURES", "THIS BLACK STONE."), # 144 $964E
+ ("THAT LEAVES A FALSE EYE,", "SO BOTH WHITE GROUPS DIE!"), # 145 $9661
+ ("FORCING A FALSE EYE LIKE", "THIS IS CALLED UCHIKAKI."), # 146 $9685
+ ("IF WHITE HAD PLAYED HERE", "FIRST, WHITE WOULD LIVE."), # 147 $96A5
+ ("NOW TRY KILLING A GROUP", "YOURSELF. PLAY BLACK!"), # 148 $96CA
+ ("WHITE TAKES TWO STONES,", "BUT THE WHOLE GROUP DIES."), # 149 $96EF
+ ("WHITE IS ALREADY DEAD.", "PLAYING OUT SHOWS WHY."), # 150 $9710
+ ("DEAD STONES COME OFF AT", "THE END. NO NEED TO RUSH."), # 151 $9739
+ ("LIFE AND DEATH PROBLEMS", "ARE CALLED TSUMEGO."), # 152 $976E
+ ("STUDYING TSUMEGO WILL MAKE", "YOU MUCH STRONGER AT GO."), # 153 $9792
+ ("NOW TRY SOME PROBLEMS", "ON KILLING GROUPS."), # 154 $97B9
+
+ # --- Lesson 10: KO (155..166) ---
+ ("KO MAKES GO EXCITING,", "YET MANY PLAYERS FEAR IT."), # 155 $97C7
+ ("VARIOUS KOS. BLACK'S", "MOVE HERE TAKES THE KO."), # 156 $97FC
+ ("KOS COME IN MANY", "DIFFERENT SIZES."), # 157 $9826
+ ("IF WHITE WINS THIS KO,", "ALL OF BLACK'S GROUP DIES."), # 158 $9839
+ ("LIFE OR DEATH RIDES ON", "IT: A HUGE KO FIGHT!"), # 159 $9869
+ ("A TINY KO: WHITE TAKES.", "BLACK PASSES, WHITE LINKS."), # 160 $988E
+ ("TWO MOVES FOR 1 POINT:", "A TINY HALF-POINT KO."), # 161 $98C5
+ ("THERE ARE MANY WAYS TO", "START A KO FIGHT."), # 162 $98FE
+ ("THIS BLACK MOVE STARTS", "A KO AGAINST WHITE."), # 163 $9928
+ ("THROWING IN A STONE TO", "CREATE A KO FIGHT."), # 164 $993D
+ ("BY THE WAY, KO MEANS AN", "ETERNITY OF TIME."), # 165 $9950
+ ("NOW TRY SOME PROBLEMS", "ALL ABOUT KO!"), # 166 $9977
+]
+
+
+# ---------------------------------------------------------------------------
+# 100 Study-Course Drill Prompts (original table $F5B9..$F680, PRG bank 2 -> 9)
+# 10 topics x 10 questions each!
+# ---------------------------------------------------------------------------
+DRILL_PROMPTS = [
+ # Topic 1: ATARI (0..9)
+ ("WHITE IS IN ATARI.", "CAPTURE THE WHITE STONE."), # 0
+ ("NEXT, CAPTURE THE WHITE", "STONE ON THE EDGE."), # 1
+ ("NEXT, CAPTURE THE WHITE", "STONE IN THE CORNER."), # 2
+ ("CAPTURE THE TWO WHITE", "STONES."), # 3
+ ("CAPTURE THE FOUR WHITE", "STONES."), # 4
+ ("SAVE THE BLACK STONE", "THAT IS IN ATARI."), # 5
+ ("YOU ARE IN ATARI.", "SAVE THE TWO BLACK STONES."), # 6
+ ("CAPTURE THE THREE WHITE", "STONES."), # 7
+ ("CAPTURE THE THREE WHITE", "STONES."), # 8
+ ("A BLACK STONE IS IN", "ATARI. SAVE IT!"), # 9
+
+ # Topic 2: CAPTURE (10..19)
+ ("CAPTURE THE TWO WHITE", "STONES."), # 10
+ ("CAPTURE THE WHITE STONE", "ON THE 2ND LINE."), # 11
+ ("CAPTURE THE FOUR WHITE", "STONES IN THE CENTER."), # 12
+ ("TAKE THE 3 CENTER STONES", "TO CONNECT EVERYTHING."), # 13
+ ("TO SAVE 4 BLACK STONES,", "CAPTURE ONE WHITE STONE."), # 14
+ ("CAPTURE THE THREE WHITE", "STONES IN THE CENTER."), # 15
+ ("CAPTURE THE FOUR WHITE", "STONES."), # 16
+ ("HOW TO PLAY ATARI:", "CAPTURE TWO WHITE STONES."), # 17
+ ("CAPTURE THE MORE", "IMPORTANT WHITE STONES."), # 18
+ ("PUNISH WHITE'S OVERPLAY!",), # 19
+
+ # Topic 3: LADDER (20..29)
+ ("CAPTURE ONE WHITE STONE", "WITH A LADDER."), # 20
+ ("CAPTURE TWO WHITE STONES.", "WATCH THE ATARI DIRECTION!"), # 21
+ ("AGAIN, THE DIRECTION OF", "ATARI IS KEY."), # 22
+ ("YOUR EDGE GROUP HAS 2", "LIBERTIES. USE A LADDER!"), # 23
+ ("CAPTURE THE TWO WHITE", "STONES."), # 24
+ ("YOU CAN CAPTURE THE", "THREE CENTER STONES."), # 25
+ ("CAPTURE 1 WHITE. ONE", "MISTAKE AND YOU GET TAKEN!"), # 26
+ ("USE A SACRIFICE STONE TO", "START A LADDER."), # 27
+ ("BE CAREFUL WHICH WAY YOU", "CHASE THE STONES."), # 28
+ ("TO SAVE 3 BLACK STONES,", "LADDER TWO WHITE STONES."), # 29
+
+ # Topic 4: NET / GETA (30..39)
+ ("ONE WHITE STONE CANNOT", "BE CAUGHT BY A LADDER."), # 30
+ ("THE SAME TACTIC AS", "PROBLEM 1."), # 31
+ ("CAPTURE THE TWO VITAL", "WHITE STONES."), # 32
+ ("A SHAPE THAT APPEARS", "OFTEN IN REAL GAMES."), # 33
+ ("A SLIGHTLY NEW SHAPE, YET", "CAPTURED THE SAME WAY."), # 34
+ ("SHOULD YOU PLAY THE NET", "ON THE VERY FIRST MOVE?"), # 35
+ ("ONLY A NET CAN CAPTURE", "THE VITAL WHITE STONES."), # 36
+ ("USE THE EDGE TO CAPTURE", "THE TWO WHITE STONES."), # 37
+ ("A SPECIAL NET, ALSO", "CALLED A CHIN-STRAP NET."), # 38
+ ("ANOTHER SPECIAL NET.", "CAPTURE WHITE CLEANLY."), # 39
+
+ # Topic 5: SNAPBACK & OIOTOSHI (40..49)
+ ("CAPTURE THE THREE WHITE", "STONES IN THE CORNER."), # 40
+ ("CAPTURE THE THREE WHITE", "STONES."), # 41
+ ("USE A SNAPBACK TO TAKE", "THE 3 CENTER WHITE STONES."), # 42
+ ("SAVE THE FOUR BLACK", "STONES IN THE CENTER."), # 43
+ ("TO LIVE, YOU MUST TAKE", "THE THREE WHITE STONES."), # 44
+ ("USE A SACRIFICE TO TAKE", "THE FOUR WHITE STONES."), # 45
+ ("SAVE THE TWO BLACK", "STONES."), # 46
+ ("CAPTURE THE 4 CENTER", "WHITE WITH OIOTOSHI."), # 47
+ ("DROP TO THE 1ST LINE TO", "CAPTURE FOUR WHITE STONES."), # 48
+ ("CAPTURE WHITE USING", "OIOTOSHI."), # 49
+
+ # Topic 6: CONNECT (50..59)
+ ("SAVE THE TWO BLACK", "STONES AT THE TOP."), # 50
+ ("CONNECT THE LEFT AND", "RIGHT 3-STONE GROUPS."), # 51
+ ("CONNECT THE LEFT AND", "RIGHT BLACK GROUPS."), # 52
+ ("WHICH MOVE CONNECTS", "MOST SOLIDLY?"), # 53
+ ("TO CONNECT THE 5 RIGHT", "STONES, TAKE THE BLOCKER."), # 54
+ ("SAVE THE TWO BLACK", "STONES."), # 55
+ ("CAPTURE ONE WHITE STONE", "TO CONNECT."), # 56
+ ("ONE MOVE CONNECTS ALL", "OF YOUR STONES."), # 57
+ ("SAVE THE SINGLE BLACK", "STONE IN THE CENTER."), # 58
+ ("WHERE SHOULD YOU", "CONNECT?"), # 59
+
+ # Topic 7: CUT (60..69)
+ ("CUT AND CAPTURE THE", "TWO WHITE STONES."), # 60
+ ("CAPTURE THE THREE WHITE", "STONES IN THE CORNER."), # 61
+ ("CUT OFF THE SINGLE STONE", "ON THE 3RD LINE."), # 62
+ ("CAPTURE THE FOUR WHITE", "STONES."), # 63
+ ("CUT OFF THE TWO WHITE", "STONES IN THE CENTER."), # 64
+ ("WHERE DO YOU CUT TO MAKE", "A DOUBLE ATARI?"), # 65
+ ("WHERE DO YOU CUT TO MAKE", "A DOUBLE ATARI?"), # 66
+ ("FIND A TACTIC THAT MAKES", "TWO CUTS MIAI (PAIRED)."), # 67
+ ("WHICH CUT CREATES A", "WINNING TACTIC?"), # 68
+ ("WHICH CUTTING POINT", "WORKS HERE?"), # 69
+
+ # Topic 8: LIFE (70..79)
+ ("MAKE TWO EYES AND LIVE!",), # 70
+ ("AN EASY VITAL POINT", "TO FIND."), # 71
+ ("WATCH OUT FOR A FALSE", "EYE!"), # 72
+ ("BE CAREFUL NOT TO END UP", "WITH A FALSE EYE."), # 73
+ ("CAN YOU LIVE BY", "CONNECTING THE TWO STONES?"), # 74
+ ("WHICH MOVE EXPANDS YOUR", "EYE SPACE?"), # 75
+ ("EXPANDING TOWARD THE", "CORNER GIVES MORE SPACE."), # 76
+ ("THE TRICK IS SPLITTING", "INTO TWO SEPARATE EYES."), # 77
+ ("HIT THE VITAL POINT TO", "MAKE TWO EYES AND LIVE!"), # 78
+ ("WHITE HIT THE VITAL SPOT.", "SPLIT INTO 2 EYES TO LIVE."), # 79
+
+ # Topic 9: DEATH (80..89)
+ ("EASY! STOP WHITE FROM", "MAKING TWO EYES."), # 80
+ ("KILL WHITE WITH A", "3-POINT NAKADE."), # 81
+ ("KILL WHITE WITH A", "4-POINT NAKADE."), # 82
+ ("DO THE 2 BLACK STONES IN", "ATARI MATTER HERE?"), # 83
+ ("PLAY ON THE EDGE, OR IN", "THE CENTER...?"), # 84
+ ("KILL WHITE USING", "SHORTAGE OF LIBERTIES."), # 85
+ ("WHICH HANE KILLS WHITE?",), # 86
+ ("USE ATARI TO KILL WHITE.",), # 87
+ ("IT TAKES A TACTIC, BUT", "THE SPACE IS SMALL. READ!"), # 88
+ ("THERE IS ONLY ONE MOVE", "TO KILL WHITE."), # 89
+
+ # Topic 10: KO (90..99)
+ ("THE CLEANEST MOVE IS THE", "CORRECT ANSWER."), # 90
+ ("HOW TO MAKE A KO IN THE", "CORNER...?"), # 91
+ ("WHITE LOOKS ALIVE, BUT", "YOU CAN MAKE A KO."), # 92
+ ("PLAYING CARELESSLY WILL", "GET YOU KILLED."), # 93
+ ("DON'T LOSE THE CAPTURING", "RACE TO AN EYE!"), # 94
+ ("MAKE THE CORNER GROUP", "INTO A KO."), # 95
+ ("THIS BECOMES A TWO-STEP", "KO."), # 96
+ ("A CAPTURING RACE: YOU", "CANNOT WIN CLEANLY."), # 97
+ ("YOU CANNOT WIN THIS RACE", "WITHOUT A KO."), # 98
+ ("DO NOT LET WHITE MAKE", "A KO HERE!"), # 99
+]
+
+
+# ---------------------------------------------------------------------------
+# 98 Study-Course Drill Feedbacks (original table $F4F5..$F5B8, B2/B6 -> 9)
+# ---------------------------------------------------------------------------
+DRILL_FEEDBACKS = [
+ ("WHITE CONNECTS AND LINKS.",), # 0
+ ("WHITE CONNECTS SAFELY.",), # 1
+ ("WHITE ESCAPES!",), # 2
+ ("WHITE REPLIES. NO CAPTURE.",), # 3
+ ("YOU ARE TAKEN. WHITE RUNS.",), # 4
+ ("WHITE PLAYS AND TAKES.",), # 5
+ ("EVEN WITH ATARI, YOU GET", "CAPTURED FIRST."), # 6
+ ("YOU ARE IN ATARI, SO", "WHITE TAKES YOU FIRST."), # 7
+ ("YOU GET CAPTURED.",), # 8
+ ("WHITE COUNTER-CAPTURES!",), # 9
+ ("YOU GET TAKEN INSTEAD!",), # 10
+ ("WHITE PLAYS AND ESCAPES.",), # 11
+ ("WHITE STOPS THE CAPTURE.",), # 12
+ ("NO GOOD.",), # 13
+ ("YOU ARE CAPTURED FIRST.",), # 14
+ ("WHITE RUNS AND TAKES YOU.",), # 15
+ ("WHITE COUNTER-CAPTURES!",), # 16
+ ("CANNOT CAPTURE.",), # 17
+ ("THE KEY STONES ESCAPED!",), # 18
+ ("WORSE THAN THE BEST MOVE.",), # 19
+ ("TOO PASSIVE. YOU LOSE.",), # 20
+ ("NOW YOU CANNOT CAPTURE", "NO MATTER WHAT."), # 21
+ ("WHITE ESCAPED INTO THE", "OPEN."), # 22
+ ("YOUR OWN STONE IS IN", "ATARI. NO CAPTURE."), # 23
+ ("WHITE ESCAPED SAFELY.",), # 24
+ ("YOU GET TAKEN INSTEAD!",), # 25
+ ("YOUR EDGE STONES FALL.",), # 26
+ ("YOUR STONE IS IN ATARI,", "SO THE LADDER FAILS."), # 27
+ ("WHITE SACRIFICES 1 AND", "ESCAPES."), # 28
+ ("CANNOT CAPTURE THE 3.",), # 29
+ ("WHITE CONNECTS AND RUNS.",), # 30
+ ("NOW IT IS TOO LATE.",), # 31
+ ("YOUR STONE IS IN ATARI.", "NO GOOD."), # 32
+ ("WHITE PLAYS. NO GOOD.",), # 33
+ ("WHITE PUTS YOU IN ATARI", "FIRST. NO GOOD."), # 34
+ ("WHITE TAKES YOU FIRST.",), # 35
+ ("WHITE CONNECTS. NO GOOD.",), # 36
+ ("CAPTURED. NO GOOD.",), # 37
+ ("CANNOT BE SAVED.",), # 38
+ ("CANNOT CONNECT.",), # 39
+ ("A BAD MOVE.",), # 40
+ ("FAILED!",), # 41
+ ("LOST THE CAPTURING RACE.",), # 42
+ ("THIS DOES NOT WORK.",), # 43
+ ("DEAD.",), # 44
+ ("ALIVE.",), # 45
+ ("THAT IS A FALSE EYE.",), # 46
+ ("WHITE PLAYS AND LIVES.",), # 47
+ ("IT BECOMES A KO.",), # 48
+ ("WHITE LIVES!",), # 49
+ ("WHITE PLAYS. YOU LOSE.",), # 50
+ ("CORRECT!",), # 51
+ ("DOUBLE ATARI, BUT WHITE", "SAVES THE KEY GROUP."), # 52
+ ("WHITE LINKS. CUT FAILS.",), # 53
+ ("WHITE CONNECTS SAFELY.",), # 54
+ ("CANNOT TAKE 3. NO GOOD.",), # 55
+ ("WHITE LINKS. NO GOOD.",), # 56
+ ("WHITE LINKS. NO CAPTURE.",), # 57
+ ("CANNOT CAPTURE THE 4.",), # 58
+ ("CUT AND CAPTURED.",), # 59
+ ("WHITE STOPS THE LINK.",), # 60
+ ("WHITE SPLITS LEFT AND", "RIGHT APART."), # 61
+ ("CONNECTED, BUT A LOSS.",), # 62
+ ("WHITE PLAYS. FAILED!",), # 63
+ ("CUT APART. NO GOOD.",), # 64
+ ("CUT APART. FAILED!",), # 65
+ ("WHITE IGNORES ATARI.", "NO GOOD."), # 66
+ ("CAUGHT IN A LADDER.", "NO GOOD."), # 67
+ ("WHITE PLAYS AND LINKS.",), # 68
+ ("THAT'S NOT AN EYE. WHITE", "PLAYS AND LIVES."), # 69
+ ("NEITHER ATARI AFFECTS", "THE EYES. WHITE LIVES."), # 70
+ ("DEAD EVEN IF WHITE", "PLAYS ELSEWHERE."), # 71
+ ("THE TWO STONES STILL DIE.",), # 72
+ ("WHITE PLAYS AWAY. LOWER", "EYE IS FALSE, SO DEAD."), # 73
+ ("FALSE EYE FORCED. DEAD.",), # 74
+ ("ONE SIDE IS A FALSE EYE,", "SO YOU ARE DEAD."), # 75
+ ("WHITE PLAYS 3-PT NAKADE.", "YOU ARE DEAD."), # 76
+ ("DEAD EVEN IF WHITE", "PLAYS ELSEWHERE."), # 77
+ ("5-PT NAKADE. DEAD.",), # 78
+ ("CAPTURED, WHITE LIVES.",), # 79
+ ("VITAL POINT! WHITE LIVES.",), # 80
+ ("WHITE MAKES AN EDGE EYE", "AND LIVES."), # 81
+ ("1 EYE EACH ON EDGE AND", "CENTER. ALIVE!"), # 82
+ ("YOU TAKE 2 WHITE, BUT", "YOUR 4 STONES DIE."), # 83
+ ("LEAVES BAD WEAKNESS (AJI).",), # 84
+ ("CUT! NO NEED TO DEFEND:", "THE LADDER ALREADY WORKS."), # 85
+ ("FALSE EYE FORCED. DEAD!",), # 86
+ ("BOTH TOP AND BOTTOM", "BECOME FALSE EYES."), # 87
+ ("WHITE MAKES IT A KO.",), # 88
+ ("WHITE CONNECTS. DEAD.",), # 89
+ ("WHITE LIVES EVEN PLAYING", "ELSEWHERE."), # 90
+ ("YOU DIE EASILY.",), # 91
+ ("DEAD.",), # 92
+ ("WHITE'S EYE WINS THE RACE.",), # 93
+ ("WHITE LIVES EVEN PLAYING", "ELSEWHERE."), # 94
+ ("LOST TO A SNAPBACK!",), # 95
+ ("ALIVE!",), # 96
+ ("3-PT NAKADE. DEAD.",), # 97
+]
+
+assert len(ADV_MESSAGES) == 167
+assert len(DRILL_PROMPTS) == 100
+assert len(DRILL_FEEDBACKS) == 98
diff --git a/tools/bank3_en.py b/tools/bank3_en.py
new file mode 100644
index 0000000..ccac24f
--- /dev/null
+++ b/tools/bank3_en.py
@@ -0,0 +1,266 @@
+"""Natural, accurate English translations for all 255 Bank 3 TEST prompts.
+
+Every entry fits within its original byte budget (`cap`) in PRG bank 3,
+uses at most 2 lines (`\n` -> 0x00), and keeps every line <= 23 characters
+so it fits cleanly inside the TEST question box.
+"""
+
+E = [
+ 'THE 3-4 POINT IS CALLED\nKOMOKU.', # 0 cap=34
+ "DON'T BACK DOWN!", # 1 cap=18
+ 'HEAD OF 2 STONES!', # 2 cap=18
+ 'HOW SHOULD YOU DEFEND\nTHE CUT?', # 3 cap=31
+ 'A BIT TRICKY, BUT LEARN\nTHE KEY!', # 4 cap=34
+ 'CONNECT A CUT.', # 5 cap=14
+ 'BASIC STAR JOSEKI', # 6 cap=17
+ 'A VERSATILE SEALING.', # 7 cap=22
+ 'STABILIZE STONES.', # 8 cap=18
+ "DON'T GET CUT!", # 9 cap=15
+ 'A CLASSIC PROVERB.', # 10 cap=21
+ 'A COMMON JOSEKI.', # 11 cap=18
+ 'WHERE DO YOU LINK?', # 12 cap=20
+ 'LIVING SMALL FAILS.', # 13 cap=22
+ 'CAPTURE CORNER STONE.', # 14 cap=23
+ 'ONLY MOVE!', # 15 cap=13
+ 'WHERE SHOULD BLACK GO?', # 16 cap=23
+ 'WHICH CONNECTION HAS\nFLEXIBILITY?', # 17 cap=34
+ 'DENY GOOD SHAPE.', # 18 cap=21
+ 'IGNORE THE CUT AND\nPLAY BOLD!', # 19 cap=29
+ 'CAPTURE ONE.', # 20 cap=12
+ 'JOSEKI. FIGHT HARD!', # 21 cap=23
+ 'WASTE NO STONES.', # 22 cap=16
+ 'BUILD THE CENTER.', # 23 cap=19
+ 'WHICH CUT TO CONNECT?', # 24 cap=25
+ 'TWO WEAK GROUPS VS 1\nLOSES.', # 25 cap=28
+ 'WHICH CUT, AND HOW?', # 26 cap=21
+ 'A BASIC 3-3 INVASION\nSTAR-POINT JOSEKI.', # 27 cap=46
+ 'FOLLOWING BEHIND IS\nWEAK.', # 28 cap=26
+ 'LIVE FOR SURE.', # 29 cap=16
+ 'CALM MOVE KILLS.', # 30 cap=17
+ 'A COMMON GAME SHAPE.\nKILL CLEANLY!', # 31 cap=34
+ 'A COMMON GAME SHAPE.', # 32 cap=22
+ 'EASY, YET GREED FAILS.', # 33 cap=26
+ 'WHICH MAKES TWO EYES?', # 34 cap=24
+ 'HOW TO LIVE?', # 35 cap=15
+ 'AVOID A KO.', # 36 cap=11
+ 'LOOKS ALIVE, YET\nIT DIES!', # 37 cap=30
+ 'THE WHITE STONE HELPS.', # 38 cap=22
+ 'CORNERS ARE TRICKY', # 39 cap=18
+ 'SURPRISE!', # 40 cap=10
+ 'KEEP IT SIMPLE:\nUSE SHORTAGE!', # 41 cap=32
+ 'CAPTURE TWO.', # 42 cap=12
+ 'AVOID A KO.', # 43 cap=12
+ 'TRICKY: USE A\nSACRIFICE!', # 44 cap=28
+ 'EXPAND YOUR SPACE', # 45 cap=17
+ "EXPANDING ISN'T\nBEST.", # 46 cap=25
+ 'EASY TO MISS IN PLAY', # 47 cap=20
+ 'TIGHT, YET EVERY\nSTONE HELPS.', # 48 cap=29
+ 'ONLY ONE MOVE\nREALLY LIVES!', # 49 cap=27
+ "DON'T FOCUS ON 2 BLACK.", # 50 cap=25
+ 'KILL OUTRIGHT.', # 51 cap=16
+ 'LOOK CLOSE!', # 52 cap=11
+ 'KILL: 3-PT NAKADE.', # 53 cap=19
+ "DON'T RUSH YOUR READ.", # 54 cap=23
+ "CAREFUL: IT'S A TRAP", # 55 cap=20
+ 'STEP IN DEEPER.', # 56 cap=15
+ '1ST LINE HELPS.', # 57 cap=16
+ 'A KO FAILS.', # 58 cap=15
+ 'SPOT THE SNAPBACK...', # 59 cap=23
+ 'SNAPBACK MOVE.', # 60 cap=16
+ 'DIRECT ATTACK FAILS', # 61 cap=20
+ 'HIT THE VITAL POINT.', # 62 cap=20
+ 'KILL VIA SHORTAGE.', # 63 cap=21
+ 'TIGHT SPACE: FIND THE\nVITAL KEY.', # 64 cap=32
+ '1ST-LINE STONE HELPS', # 65 cap=21
+ 'SPLIT INTO TWO EYES.', # 66 cap=23
+ '1ST-LINE CAPTURES\nOFTEN FAIL.', # 67 cap=31
+ 'GREED FAILS.', # 68 cap=16
+ 'A COMMON TACTIC', # 69 cap=15
+ 'NOT TOO SHALLOW OR\nDEEP.', # 70 cap=25
+ 'KILL WITH SHORTAGE.', # 71 cap=21
+ 'TAKE TWO CLEVERLY.', # 72 cap=21
+ 'CORNER VITAL POINT!', # 73 cap=21
+ 'TAKE 1 CLEVERLY TO\nLIVE.', # 74 cap=25
+ 'MAKE TWO EYES?', # 75 cap=17
+ 'WATCH LIBERTIES', # 76 cap=15
+ 'EASY TO MISS.', # 77 cap=15
+ 'LINK 1 CLEVERLY TO\nLIVE.', # 78 cap=26
+ 'MAKE EYES ONE BY ONE', # 79 cap=20
+ 'WIDE SPACE: JUST AIM\nFOR 2 EYES.', # 80 cap=33
+ 'NO DBL ATARI!', # 81 cap=14
+ 'ONE SPOT HAS CONTACT.', # 82 cap=24
+ 'SMALL, YET...', # 83 cap=13
+ 'STRONG OR WEAK?\nKEY JUNCTION!', # 84 cap=30
+ 'WHERE IS BLACK WEAK?', # 85 cap=21
+ 'A CLOSE FIGHT. READ\nTHE LAST MOVE!', # 86 cap=39
+ 'QUIET, YET...', # 87 cap=14
+ 'PLAY CALM AND THICK.', # 88 cap=21
+ 'CUT WHILE CONNECTING.', # 89 cap=22
+ 'WHITE JUST MOVED.\nWHAT NEXT?', # 90 cap=28
+ 'DEFEND OR ATTACK?\nATTACK IS BEST DEFENSE!', # 91 cap=41
+ 'CLAIM CORNER.', # 92 cap=15
+ 'SECURE BLACK...', # 93 cap=17
+ "TAKE WHITE'S BASE.", # 94 cap=20
+ 'A SOLID MOVE.', # 95 cap=13
+ 'STABILIZE BLACK.', # 96 cap=17
+ 'ATTACK AND DEFEND', # 97 cap=18
+ 'SEALING IS STRONG.', # 98 cap=20
+ 'WHITE MISSED A\nJOSEKI END.', # 99 cap=26
+ 'KEY TO BOTH BASES.', # 100 cap=22
+ 'GOOD SHAPE RIGHT HERE.', # 101 cap=24
+ "DON'T RUSH HERE.", # 102 cap=18
+ "HIT WHITE'S FLAW.", # 103 cap=18
+ 'ALL GOOD, YET WHICH IS\nBIGGEST?', # 104 cap=31
+ 'MID-JOSEKI.', # 105 cap=16
+ 'LOOKS SMALL, YET...', # 106 cap=21
+ 'WHERE IS CONTACT?', # 107 cap=18
+ 'ALL BIG: WHERE IS THE\nKEY POINT?', # 108 cap=34
+ 'CLASSIC PROVERB!', # 109 cap=19
+ 'THIS SPLITS WHITE.', # 110 cap=20
+ 'CONNECTING STONES IS\nCRUCIAL.', # 111 cap=32
+ 'STRIKE THE HEAD!', # 112 cap=24
+ 'ATTACK FIRST!', # 113 cap=17
+ 'KEEP ALLIES SAFE.', # 114 cap=19
+ 'IGNORING A FIGHT IS\nUSUALLY BAD.', # 115 cap=33
+ "TAKE WHITE'S BASE.", # 116 cap=19
+ 'ATTACK FIRST!', # 117 cap=17
+ 'MID-FIGHT!', # 118 cap=15
+ 'ATTACK AND BUILD:\n2 BIRDS, 1 STONE?', # 119 cap=37
+ 'TAKE 3 WHITE?', # 120 cap=14
+ 'SQUEEZE TAKES THREE.', # 121 cap=22
+ 'A RACE! BLACK CAN\nSTILL WIN THIS!', # 122 cap=33
+ 'A RACE! WATCH YOUR\nDESCENT.', # 123 cap=28
+ 'CORNERS ARE SPECIAL.\nSTOP ENTRY!', # 124 cap=33
+ 'OIOTOSHI TAKES 3.', # 125 cap=18
+ 'A SNEAKY ANSWER!', # 126 cap=18
+ "FILL WHITE'S LIBERTIES", # 127 cap=23
+ 'IGNORE ONE STONE!', # 128 cap=17
+ 'SAVE 1 STONE.', # 129 cap=13
+ 'ATARI FAILS.', # 130 cap=14
+ 'A TACTIC HIDES INSIDE.\nTAKE 3!', # 131 cap=32
+ 'CUT AND TAKE 4.', # 132 cap=17
+ 'SURPRISE TAKES 2.', # 133 cap=19
+ 'STOP THE LINK.', # 134 cap=14
+ 'SQUEEZE MOVE.', # 135 cap=13
+ 'TAKE ALL FOUR.', # 136 cap=16
+ 'CUT AND TAKE 5.', # 137 cap=17
+ 'TAKE 4 WHITE.', # 138 cap=15
+ 'SQUEEZE FOR LIBERTIES', # 139 cap=22
+ 'SHORTAGE TAKES 3.', # 140 cap=20
+ 'USE BOTH FLAWS TO\nTAKE 4!', # 141 cap=30
+ "TAKE 4 WHITE.\nWEDGE KNIGHT'S MOVE!", # 142 cap=35
+ 'OIOTOSHI TRAP.', # 143 cap=14
+ 'AIM FOR OIOTOSHI.', # 144 cap=20
+ 'HOW DO YOU GAIN THE\nMOST HERE?', # 145 cap=30
+ 'AVOID AN EYE-VS-NO-EYE\nFIGHT: MAKE A KO!', # 146 cap=43
+ "DON'T RUSH!", # 147 cap=14
+ "CUT 3 STONES.\nHIT KNIGHT'S MOVE!", # 148 cap=33
+ 'OIOTOSHI TACTIC.', # 149 cap=17
+ 'SACRIFICE TO TRAP 2\nIN OIOTOSHI.', # 150 cap=33
+ "DON'T GET TRAPPED", # 151 cap=18
+ 'SACRIFICE TO WIN\nTHE RACE.', # 152 cap=26
+ 'WATCH HOW YOU ATARI.', # 153 cap=21
+ 'CUT AND TAKE 3.', # 154 cap=17
+ 'A COMMON TACTIC.', # 155 cap=17
+ 'OIOTOSHI TAKES FOUR.', # 156 cap=22
+ 'STOP WHITE ENTERING.', # 157 cap=25
+ 'OIOTOSHI TAKES 4.', # 158 cap=18
+ 'SACRIFICE TO TAKE\n2 WHITE.', # 159 cap=26
+ 'SACRIFICE!', # 160 cap=11
+ 'A CUTTING TACTIC.', # 161 cap=19
+ 'THE 1ST-LINE STONE IS\nKEY. TAKE 3!', # 162 cap=39
+ 'OIOTOSHI MOVE.', # 163 cap=15
+ 'CORNERS ARE SPECIAL.\nTAKE 1 WITH BEST MOVE!', # 164 cap=44
+ 'BEST WAY TO CAPTURE\nONE STONE?', # 165 cap=33
+ 'ENTER AS DEEP AS\nYOU CAN.', # 166 cap=26
+ 'SACRIFICE PAYS OFF', # 167 cap=19
+ 'CARELESS GREED COSTS', # 168 cap=21
+ 'USE THE DEAD 2.', # 169 cap=19
+ 'BIG GAIN HIDES.', # 170 cap=18
+ 'GAIN A LITTLE.', # 171 cap=16
+ 'SACRIFICE TO 1ST LINE', # 172 cap=23
+ 'TIGHT, YET YOU CAN\nPROFIT.', # 173 cap=26
+ 'LINK BACK FOR GAIN.', # 174 cap=20
+ 'TIGHT SPACE: A SLICK\nENDGAME!', # 175 cap=31
+ '1ST-LINE STONE HELPS.', # 176 cap=23
+ 'SNAPBACK TACTIC HERE.', # 177 cap=23
+ 'SACRIFICE OUTSIDE TO\nSQUEEZE WHITE!', # 178 cap=43
+ 'TIGHT SPACE. GAIN\nCAREFULLY!', # 179 cap=29
+ 'USE A SACRIFICE...', # 180 cap=19
+ 'SQUEEZE WHITE FROM THE\nOUTSIDE TO WIN.', # 181 cap=41
+ 'SNAPBACK TACTIC.', # 182 cap=19
+ 'SACRIFICE TO WIN THIS\nCAPTURE RACE.', # 183 cap=36
+ 'STOP WHITE FROM\nSTEPPING IN.', # 184 cap=31
+ 'SACRIFICE 2 TO CUT\nWHITE LAND.', # 185 cap=31
+ 'GAIN EVEN 1 PT.', # 186 cap=17
+ 'USE BLACK 1 TO TAKE\n2 OR 4.', # 187 cap=31
+ "WHICH CUTS WHITE'S\nLAND?", # 188 cap=27
+ 'CONNECT CLEVERLY!', # 189 cap=24
+ 'CONNECT WELL TO GUARD\nAGAINST A RIGHT HANE.', # 190 cap=45
+ 'A TACTIC HIDES INSIDE.\nWHICH IS BEST?', # 191 cap=39
+ 'FAMOUS ENDGAME.', # 192 cap=18
+ "DON'T ALWAYS BLOCK\nWHITE'S PUSH.", # 193 cap=33
+ 'SACRIFICE TO GAIN.', # 194 cap=20
+ 'TRICKY: SQUEEZE WHITE\nTO BUILD YOUR LAND.', # 195 cap=46
+ 'A SPLITTING ATTACK!', # 196 cap=23
+ 'DEFEND THE TOP 3.', # 197 cap=21
+ 'AN INVASION SPLITS\nYOU APART.', # 198 cap=29
+ 'ALL ARE BIG. WHICH\nIS BIGGEST?', # 199 cap=32
+ 'DEFEND THE ATTACK.', # 200 cap=20
+ 'PUT YOUR THICK WALL\nTO WORK!', # 201 cap=31
+ 'LOOKS SMALL, YET\nSAFETY IS HUGE!', # 202 cap=33
+ 'STABILIZE BLACK.', # 203 cap=18
+ 'ONE SHAPE IS NOT\nDONE YET.', # 204 cap=26
+ 'ATTACK FIRST!', # 205 cap=16
+ 'SECURE 1 STONE.', # 206 cap=16
+ 'ATTACK AND DEFEND?', # 207 cap=24
+ 'HIT THE VITAL SPOT.', # 208 cap=20
+ 'ATTACKING IS BIGGEST.', # 209 cap=22
+ 'A MOVE TO EXPAND YOUR\nINFLUENCE.', # 210 cap=33
+ "DON'T GIVE UP CENTER.", # 211 cap=22
+ 'WATCH THE CUT.', # 212 cap=15
+ 'EXPAND YOUR\nINFLUENCE.', # 213 cap=27
+ 'MOVE 3 TAKES THE EYE.', # 214 cap=22
+ 'SACRIFICE, KILL', # 215 cap=16
+ 'USE OIOTOSHI, BUT\nTAKE CAREFULLY!', # 216 cap=34
+ 'OIOTOSHI TACTIC.', # 217 cap=18
+ 'ONLY 1 MOVE KILLS.', # 218 cap=20
+ 'STEP DEEP! USE THE\n1ST LINE.', # 219 cap=30
+ 'HIT KEY TO KILL.', # 220 cap=17
+ 'TAKE EDGE EYES.', # 221 cap=17
+ "HOW'S THE RACE?", # 222 cap=17
+ 'BE CAREFUL FILLING', # 223 cap=19
+ 'WHICH MOVE BLOCKS THE\nLINK BEST?', # 224 cap=34
+ 'WHERE IS WHITE WEAK?', # 225 cap=21
+ 'PUT THE TOP-RIGHT\nWALL TO WORK!', # 226 cap=32
+ 'ATTACKING WINS.', # 227 cap=18
+ 'KEY FIGHTING SPOT.', # 228 cap=19
+ 'COMPLETES THE JOSEKI.', # 229 cap=23
+ 'WHITE SKIPPED DEFENSE.', # 230 cap=23
+ "DON'T BE CUT ONE-SIDED", # 231 cap=24
+ 'FEWER CUTS IS BETTER.', # 232 cap=25
+ 'LEAVING WHITE CUTS\nGAINS A LOT.', # 233 cap=31
+ 'WHICH CONNECTS BEST?', # 234 cap=22
+ 'HEAD OF 2 SHAPE', # 235 cap=16
+ 'CUT WHILE PUTTING\nPRESSURE ON.', # 236 cap=34
+ 'GIVE NO BREATHER.', # 237 cap=18
+ 'PEEPED! PLAY A\nNATURAL MOVE.', # 238 cap=28
+ 'HANE VS ATTACH.', # 239 cap=16
+ 'WHITE IS LINKED, SO\nBLACK CONNECTS TOO.', # 240 cap=41
+ 'BLACK HAS MORE STONES,\nSO FIGHT ON!', # 241 cap=36
+ 'HOW TO LINK.', # 242 cap=13
+ 'LINK WHILE PRESSURING.', # 243 cap=24
+ 'SIMPLE IS BEST HERE.', # 244 cap=21
+ 'FEAR A CUT? PLAY\nBOLDLY!', # 245 cap=30
+ 'FIND THE MOST ACTIVE\nCONNECTION.', # 246 cap=32
+ 'WHICH DEFENSE IS SAFE?', # 247 cap=27
+ 'ATTACK THE 3 STONES?', # 248 cap=20
+ 'CONNECT AND PUSH\nDEEPLY.', # 249 cap=26
+ 'COUNTER THE OVERPLAY.', # 250 cap=23
+ 'NO NEED TO WORRY.', # 251 cap=19
+ "DON'T BE TIMID HERE.", # 252 cap=21
+ 'PUNISH WHITE!', # 253 cap=18
+ 'NO GOOD.', # 254 cap=9
+]
+
+assert len(E) == 255
diff --git a/tools/basics_en.py b/tools/basics_en.py
new file mode 100644
index 0000000..1eea844
--- /dev/null
+++ b/tools/basics_en.py
@@ -0,0 +1,176 @@
+"""Natural English translations for all 146 BASICS and BASICS PART 2 messages.
+
+Each index 0..145 maps 1-to-1 to the fixed-bank message pointer table at
+$F283..$F3A6 (originally PRG bank 4, packed cleanly into PRG bank 14).
+Every entry is a tuple of 1 or 2 lines, each at most 26 characters wide.
+"""
+
+BASICS_MESSAGES = [
+ # --- Lesson 1: Board & Stones (0..12) ---
+ ("I AM MASTER SEIMOKU. READY", "TO LEARN HOW TO PLAY GO?"), # 0 $A535
+ ("GO IS A TWO-PLAYER GAME.", "THAT'S HOW IT IS PLAYED."), # 1 $A563
+ ("LOOK BELOW: 19 LINES RUN", "EACH WAY. THIS IS A GOBAN."), # 2 $A599
+ ("PLACE STONES WHERE LINES", "CROSS, NOT IN THE SQUARES."), # 3 $A5C8
+ ("STONES ARE BLACK OR WHITE.", "COUNTED AS 1-SHI, 2-SHI."), # 4 $A5FA
+ ("EACH LINE CROSSING IS", "CALLED A POINT, OR MOKU."), # 5 $A626
+ ("AREAS OF THE BOARD HAVE", "NAMES. MIDDLE IS CENTER."), # 6 $A64D
+ ("THE OUTER BORDER IS", "CALLED THE SIDE (HEN)."), # 7 $A688
+ ("AND THIS AREA IS THE", "CORNER (SUMI). SIMPLE!"), # 8 $A69F
+ ("THERE IS NO STRICT LINE", "BETWEEN CORNER AND SIDE."), # 9 $A6BC
+ ("SEE THE DOTS ON THE BOARD?", "THEY ARE STAR POINTS."), # 10 $A6E9
+ ("THE CENTER STAR POINT IS", "CALLED TENGEN, THE CENTER."), # 11 $A718
+ ("NOW YOU KNOW THE BOARD.", "SHALL WE LEARN TO PLAY?"), # 12 $A740
+
+ # --- Lesson 2: Placing Stones (13..22) ---
+ ("GO IS A GAME OF TERRITORY.", "USE STONES TO CLAIM LAND."), # 13 $A796
+ ("BIGGEST TERRITORY WINS.", "FIRST, HOW TO PLACE THEM."), # 14 $A7CE
+ ("ONE PLAYER TAKES BLACK,", "THE OTHER TAKES WHITE."), # 15 $A80C
+ ("BLACK GOES FIRST. TAKE", "TURNS PLACING ONE STONE."), # 16 $A83E
+ ("WITH HANDICAP STONES,", "WHITE MOVES FIRST. (PT 2)"), # 17 $A870
+ ("STONES GO ON ANY CROSSING,", "EVEN THE EDGE OR CORNER."), # 18 $A8A6
+ ("ONCE PLACED, STONES NEVER", "MOVE UNLESS CAPTURED."), # 19 $A8D3
+ ("PLACING A STONE IS A MOVE.", "ONE STONE IS ONE MOVE."), # 20 $A906
+ ("NOW TRY MAKING A MOVE!", "MANY GAMES START HERE."), # 21 $A936
+ ("NEXT, LET'S LEARN HOW TO", "CAPTURE STONES. CONTINUE?"), # 22 $A967
+
+ # --- Lesson 3: Capturing (23..35) ---
+ ("YOU CAN CAPTURE ENEMY", "STONES. IT IS VERY EASY!"), # 23 $A988
+ ("SURROUND AN ENEMY STONE", "ON ALL 4 SIDES TO TAKE IT."), # 24 $A9B9
+ ("ON THE EDGE, IT ONLY TAKES", "3 STONES TO CAPTURE ONE."), # 25 $A9EE
+ ("IN THE CORNER, JUST TWO", "STONES WILL CAPTURE IT!"), # 26 $AA08
+ ("CAREFUL: DIAGONALS DON'T", "COUNT. COVER ALL 4 SIDES."), # 27 $AA20
+ ("GROUPS WORK THE SAME WAY.", "COVER EVERY SIDE TO TAKE."), # 28 $AA4B
+ ("TAKING STONES IS CAPTURE.", "PRISONERS ARE AGEHAMA."), # 29 $AA7F
+ ("NOW GO AHEAD AND CAPTURE", "ONE WHITE STONE!"), # 30 $AAAE
+ ("NOW TRY CAPTURING THREE!",), # 31 $AAC4
+ ("KEEP CAPTURED STONES SAFE.", "THEY COUNT TOWARD SCORE."), # 32 $AAD2
+ ("REMOVE CAPTURED STONES AT", "ONCE. NEVER LEAVE THEM ON."), # 33 $AB09
+ ("CAPTURING USUALLY HELPS,", "THOUGH NOT ALWAYS. TRICKY!"), # 34 $AB45
+ ("NOW THAT YOU CAN CAPTURE,", "LET'S LEARN THE RULES. ON?"), # 35 $AB7C
+
+ # --- Lesson 4: Forbidden Moves (36..48) ---
+ ("YOU CAN PLAY ALMOST", "ANYWHERE, WITH TWO LIMITS."), # 36 $ABAB
+ ("PLAYING ON A BANNED POINT", "IS AN ILLEGAL MOVE."), # 37 $ABE6
+ ("THERE ARE TWO SUCH RULES.", "FIRST, NO SUICIDE MOVES."), # 38 $AC15
+ ("YOU CANNOT PLAY WHERE YOUR", "STONE IS TRAPPED AT ONCE."), # 39 $AC40
+ ("HERE, BLACK CANNOT PLAY", "INSIDE THE WHITE STONES."), # 40 $AC70
+ ("IF BLACK PLAYED THERE,", "BOTH BLACK STONES DIE."), # 41 $AC92
+ ("HOWEVER, YOU MAY PLAY", "THERE IF IT TAKES WHITE."), # 42 $ACC4
+ ("IF WHITE IS SURROUNDED", "LIKE THIS, BLACK CAN PLAY."), # 43 $ACF7
+ ("NOW ALL 10 WHITE STONES", "ARE SURROUNDED AND TAKEN!"), # 44 $AD29
+ ("GO AHEAD AND TRY IT!",), # 45 $AD54
+ ("OOPS... TRY AGAIN!",), # 46 $AD63
+ ("WATCH: BLACK TAKES ONE,", "THEN WHITE TAKES IT BACK!"), # 47 $AD6C
+ ("THAT LEADS TO RULE TWO.", "SHALL WE KEEP GOING?"), # 48 $ADA2
+
+ # --- Lesson 5: Ko (49..58) ---
+ ("SOMETIMES TWO PLAYERS CAN", "CAPTURE BACK AND FORTH."), # 49 $ADD3
+ ("THIS REPEATING CAPTURE", "SHAPE IS CALLED A KO."), # 50 $AE07
+ ("IT WOULD LOOP FOREVER, SO", "GO HAS A SPECIAL KO RULE."), # 51 $AE33
+ ("WHEN YOUR KO STONE FALLS,", "YOU CANNOT RETAKE AT ONCE."), # 52 $AE73
+ ("FIRST PLAY ONE MOVE AWAY,", "THEN YOU MAY RECAPTURE."), # 53 $AEA3
+ ("RETAKING IMMEDIATELY IS", "ILLEGAL. TRY PLAYING A KO!"), # 54 $AED5
+ ("WHITE MUST PLAY ELSEWHERE,", "SO BLACK CONNECTS SAFELY!"), # 55 $AF0B
+ ("CAREFUL: THIS IS NOT A KO.", "THE SHAPE DOES NOT REPEAT."), # 56 $AF3D
+ ("YOU CAN USE KO AS A TACTIC", "SEE ADVANCED FOR MORE!"), # 57 $AF75
+ ("NOW YOU KNOW BANNED MOVES.", "NEXT, SAFE SHAPES. GO ON?"), # 58 $AFA4
+
+ # --- Lesson 6: Life & Death (59..68) ---
+ ("USING THE SUICIDE RULE,", "STONES CAN BE UNKILLABLE!"), # 59 $AFD5
+ ("BLACK SURROUNDS WHITE.", "CAN BLACK CAPTURE THEM?"), # 60 $B007
+ ("PLAYING IN EITHER SPOT", "LEAVES THE OTHER OPEN. NO!"), # 61 $B039
+ ("SO BLACK CANNOT PLAY IN.", "WHITE CAN NEVER BE TAKEN!"), # 62 $B068
+ ("A GROUP THAT CAN NEVER BE", "CAPTURED IS CALLED ALIVE."), # 63 $B099
+ ("A GROUP THAT CAN ALWAYS BE", "CAPTURED IS CALLED DEAD."), # 64 $B0C0
+ ("NOW BLACK CAN PLAY INSIDE", "AND TAKE ALL 16 WHITE!"), # 65 $B0EA
+ ("WHITE CAN DO NOTHING.", "ALL 16 STONES ARE DEAD."), # 66 $B11F
+ ("LIFE AND DEATH IS KEY TO", "GO. SEE ADVANCED FOR MORE!"), # 67 $B146
+ ("THAT'S LIFE AND DEATH!", "NEXT, TERRITORY. CONTINUE?"), # 68 $B179
+
+ # --- Lesson 7: Territory (69..80) ---
+ ("THE WINNER OF GO IS", "DECIDED BY TERRITORY SIZE."), # 69 $B1A8
+ ("EMPTY POINTS YOU SURROUND", "ARE YOUR TERRITORY (JI)."), # 70 $B1CF
+ ("USING THE EDGE AND CORNER", "TAKES FAR FEWER STONES."), # 71 $B20C
+ ("IF YOUR FOE CAN LIVE", "INSIDE, IT DOESN'T COUNT."), # 72 $B242
+ ("BLACK'S AREA LOOKS HUGE,", "RIGHT? NOW PLAY HERE!"), # 73 $B274
+ ("BLACK CANNOT CATCH WHITE", "EASILY, SO IT IS NOT SAFE."), # 74 $B29C
+ ("WHAT ABOUT WHITE'S AREA?", "LET'S TRY INVADING IT."), # 75 $B2CA
+ ("BLACK CANNOT LIVE INSIDE", "NO MATTER WHAT IT TRIES."), # 76 $B2E6
+ ("TO MAKE SOLID TERRITORY,", "KEEP INVADERS OUT."), # 77 $B300
+ ("AT GAME'S END, MOST EMPTY", "POINTS WINS. MORE NEXT!"), # 78 $B336
+ ("AT THE END, BLACK COUNTS", "5.5 FEWER POINTS (KOMI)."), # 79 $B36F
+ ("NOW LET'S LEARN HOW A", "GAME OF GO ENDS. CONTINUE?"), # 80 $B39F
+
+ # --- Lesson 8: Ending & Scoring (81..94) ---
+ ("IN GO, THERE IS NO FIXED", "FINAL MOVE TO END A GAME."), # 81 $B3D1
+ ("IT ENDS WHEN BOTH AGREE NO", "USEFUL MOVES ARE LEFT."), # 82 $B3FE
+ ("BOTH PLAYERS CONFIRM IT,", "AND THE GAME IS OVER."), # 83 $B438
+ ("(IN THIS GAME, BOTH CHOOSE", "END IN A ROW TO FINISH.)"), # 84 $B461
+ ("NEXT, TIDY THE BORDERS SO", "TERRITORY IS EASY TO SEE."), # 85 $B498
+ ("PLACE EACH PRISONER STONE", "INTO YOUR FOE'S TERRITORY."), # 86 $B4C7
+ ("LOST STONES SHRINK YOUR", "SCORE, SO LOSSES HURT!"), # 87 $B4E9
+ ("(THIS GAME SCORES FOR YOU", "AUTOMATICALLY AT THE END.)"), # 88 $B51A
+ ("ENDING A GAME TAKES SOME", "PRACTICE. TRY A FEW GAMES!"), # 89 $B550
+ ("IF YOU CANNOT WIN, YOU MAY", "ADMIT DEFEAT AND RESIGN."), # 90 $B581
+ ("THIS IS CALLED TORYO.", "THE WINNER WINS BY RESIGN."), # 91 $B5BF
+ ("IF YOU FOLLOWED ALL THIS,", "YOU ARE READY TO PLAY GO!"), # 92 $B5F8
+ ("CHECK ADVANCED TOO, BUT", "TRY PLAYING A REAL GAME!"), # 93 $B61F
+ ("THAT ENDS THE BASICS!", "GREAT WORK ON THE RULES."), # 94 $B654
+
+ # --- BASICS PART 2: Sadasaki — Opening, Sente, Handicap (95..138) ---
+ ("I AM SADASAKI. LET ME", "SHARE SOME GO WISDOM!"), # 95 $B765
+ ("PLAYERS OFTEN DISCUSS THE", "OPENING, CALLED FUSEKI."), # 96 $B799
+ ("IF WRONG, THE ONE HOLDING", "THE STONES PLAYS FIRST."), # 97 $B7CF
+ ("IN GO, PLAYING EFFICIENTLY", "IS THE KEY TO VICTORY."), # 98 $B7ED
+ ("USE AS FEW STONES AS YOU", "CAN TO CLAIM TERRITORY."), # 99 $B81C
+ ("STRONG PLAYERS START WITH", "A STRATEGY FROM MOVE ONE."), # 100 $B857
+ ("THIS EARLY WHOLE-BOARD", "STRATEGY IS CALLED FUSEKI."), # 101 $B88A
+ ("PLAY MANY GAMES AND YOU", "WILL FIND YOUR OWN STYLE!"), # 102 $B8B0
+ ("NEXT, HOW DO PLAYERS PICK", "WHO MOVES FIRST IN A GAME?"), # 103 $B8E4
+ ("SHALL WE CONTINUE?",), # 104 $B91B
+ ("SINCE YOU ALTERNATE MOVES,", "MOVING FIRST IS AN EDGE."), # 105 $B926
+ ("SO HOW DO TWO PLAYERS", "DECIDE WHO PLAYS FIRST?"), # 106 $B95F
+ ("IF ONE PLAYER IS STRONGER,", "THE WEAKER GOES FIRST."), # 107 $B996
+ ("THAT CLOSES THE GAP AND", "MAKES THE GAME MORE FUN!"), # 108 $B9CA
+ ("BETWEEN EQUAL PLAYERS,", "NIGIRI DECIDES WHO STARTS."), # 109 $B9F2
+ ("ONE HOLDS WHITE STONES.", "THE OTHER CALLS ODD/EVEN."), # 110 $BA20
+ ("IF YOU GUESS RIGHT, YOU", "GET TO PLAY FIRST (BLACK)."), # 111 $BA57
+ ("IF YOU PLAY MORE GAMES,", "TAKE TURNS GOING FIRST."), # 112 $BA7D
+ ("ALTERNATING FIRST MOVE", "IS CALLED TAGAISEN."), # 113 $BAB3
+ ("BLACK GIVES 5.5 POINTS", "OF KOMI TO BALANCE PLAY."), # 114 $BAE1
+ ("KOMI OFFSETS BLACK'S", "FIRST-MOVE ADVANTAGE."), # 115 $BB02
+ ("IF BOTH SCORES ARE EQUAL,", "IT IS A DRAW, CALLED JIGO."), # 116 $BB22
+ ("WITH 5.5 KOMI FOR BLACK,", "A DRAW CAN NEVER HAPPEN."), # 117 $BB57
+ ("THE HALF POINT ALWAYS", "DECIDES A CLEAR WINNER!"), # 118 $BB7F
+ ("(IN THIS GAME, PICK COLORS", "FREELY. NO 5.5 KOMI USED.)"), # 119 $BBA5
+ ("WHAT IF ONE PLAYER IS MUCH", "STRONGER THAN THE OTHER?"), # 120 $BBDA
+ ("NEXT, LET'S TALK ABOUT", "HANDICAPS IN GO. CONTINUE?"), # 121 $BC10
+ ("WHEN SKILL LEVELS DIFFER,", "PLAYERS USE A HANDICAP."), # 122 $BC65
+ ("THE SMALLEST HANDICAP IS", "WEAKER ALWAYS PLAYS BLACK."), # 123 $BC92
+ ("MOVING FIRST HELPS THE", "WEAKER PLAYER WIN MORE."), # 124 $BCCB
+ ("FOR A BIGGER SKILL GAP,", "TRY HANDICAP GO (OKIGO)."), # 125 $BCF9
+ ("BEFORE PLAY, THE WEAKER", "SIDE PLACES EXTRA STONES."), # 126 $BD1E
+ ("THESE STARTING STONES ARE", "ALWAYS BLACK STONES."), # 127 $BD4E
+ ("SO THE WEAKER SIDE PLAYS", "BLACK. A BIG ADVANTAGE!"), # 128 $BD74
+ ("IN HANDICAP GO, WHITE", "MAKES THE FIRST REAL MOVE."), # 129 $BDAA
+ ("HANDICAPS RUN 2 TO 9", "STONES ON SET STAR POINTS."), # 130 $BDDF
+ ("HERE IS A 2-STONE", "HANDICAP."), # 131 $BE11
+ ("HERE IS 3 STONES. WATCH", "THE REST OF THE PATTERNS!"), # 132 $BE26
+ ("FOR 9 STONES, WHERE DOES", "THE LAST STONE GO? GUESS!"), # 133 $BE43
+ ("IT GOES RIGHT HERE!",), # 134 $BE78
+ ("A 9-STONE HANDICAP IS", "SEIMOKU. SOUND FAMILIAR?"), # 135 $BE82
+ ("EVEN MORE CAN BE USED, BUT", "9 STONES IS THE USUAL MAX."), # 136 $BEB5
+ ("THAT COVERS THE MAIN GO", "TERMS. SEE YOU NEXT TIME!"), # 137 $BEEA
+ ("THAT ENDS BASICS PART 2!", "THANK YOU FOR STUDYING."), # 138 $BF1C
+
+ # --- Lesson 8 Endgame Dame Interactive Steps & Misc (139..145) ---
+ ("FIRST, FILL NEUTRAL POINTS", "(DAME) BETWEEN BORDERS."), # 139 $B673
+ ("THERE IS ONE MORE NEUTRAL", "POINT. CAN YOU FIND IT?"), # 140 $B6A5
+ ("THAT CHANGES NO TERRITORY.", "NEXT, REMOVE DEAD STONES."), # 141 $B6C4
+ ("TERRITORY IS THE EMPTY", "POINTS YOU ENCLOSE..."), # 142 $B6FA
+ ("BOTH HAVE 60 POINTS, SO", "ONE LOST STONE DECIDES IT!"), # 143 $B72A
+ ("LINES COUNT INWARD FROM", "THE EDGE: 1ST, 2ND, 3RD..."), # 144 $A76A
+ ("(ON A TIE IN THIS GAME,", "WHITE WINS BY 0.5 PTS.)"), # 145 $BC3E
+]
+
+assert len(BASICS_MESSAGES) == 146
diff --git a/tools/build.py b/tools/build.py
new file mode 100644
index 0000000..b453681
--- /dev/null
+++ b/tools/build.py
@@ -0,0 +1,1557 @@
+#!/usr/bin/env python3
+"""Build the complete English translation of Famicom Igo Nyuumon (I'MAX, 1991).
+
+Reads: ../roms/original/Famicom Igo Nyuumon (Japan).nes
+Writes: ../roms/english/Famicom Igo Nyuumon (English).nes (327,696 bytes)
+
+Expands the MMC1 ROM to 16 x 16 KiB PRG + 16 x 4 KiB CHR banks, translating
+the title screen, all book/course menus, BASICS 1 & 2 lessons (PRG bank 14),
+ADVANCED lessons (PRG bank 8), Study-Course Drills (PRG bank 9), Study-Course
+Results, PLAY/Review/Victory/Defeat screens & runtime scripts, and all 300
+TEST prompts + 900 A/B/C feedback messages while preserving all original art
+and animations.
+"""
+import json, os, sys
+from PIL import Image, ImageDraw, ImageFont
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+sys.path.insert(0, HERE)
+from font8 import glyph
+from bank3_en import E as BANK3_EN
+from feedback_en import FEEDBACK_EN
+from basics_en import BASICS_MESSAGES
+from advanced_en import ADV_MESSAGES, DRILL_PROMPTS, DRILL_FEEDBACKS
+import make_book
+import title_screen
+
+ROM = os.path.join(HERE, '..', 'roms', 'original', 'Famicom Igo Nyuumon (Japan).nes')
+OUT = os.path.join(HERE, '..', 'roms', 'english', 'Famicom Igo Nyuumon (English).nes')
+
+raw = open(ROM, 'rb').read()
+prg = bytearray(raw[16:16 + 8 * 16384])
+chr_ = bytearray(raw[16 + 8 * 16384:])
+
+# Title screen is built by title_screen.py (called below when packing b3).
+
+
+# ------------------------------------------------------------ English font
+# Place all English 8x8 letters and punctuation in the unused kana region
+# ($A0-$C3) of CHR bank 8. Keeping $00-$7F untouched preserves all three
+# instructor portraits (Seimoku $0A-$3F, Sadasaki $40-$67, Kuzumi $4A-$7F)
+# as well as the A/B/C choice-panel art and the board/box decorations.
+b2 = chr_[2 * 4096:3 * 4096]
+bank8 = bytearray(b2)
+def put8(code, ch, both=False):
+ g = glyph(ch)
+ for y in range(8):
+ lo = 0
+ for x in range(8):
+ if g[y][x]: lo |= 1 << (7 - x)
+ bank8[code * 16 + y] = lo
+ bank8[code * 16 + 8 + y] = lo if both else 0
+
+CHR8_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,?!-:/'()"
+CHR8_MAP = {ch: 0xA0 + i for i, ch in enumerate(CHR8_CHARS)}
+for ch, code in CHR8_MAP.items():
+ put8(code, ch)
+# Quiz/drill question prefix uses $48 ("Q" over 第) and $49 (blank over 問);
+# neither tile is used by any portrait (Sadasaki ends at $47, Kuzumi starts
+# at $4A). Digits live at $70-$79 with both planes set.
+put8(0x48, 'Q')
+for _k in range(16): bank8[0x49 * 16 + _k] = 0
+for _d in range(10):
+ put8(0x70 + _d, chr(ord('0') + _d), both=True)
+ CHR8_MAP[chr(ord('0') + _d)] = 0x70 + _d
+# Keep the original eight CHR banks at their original indices, add the
+# English font as bank 8, and pad to 16 banks (power of two).
+# Book-page font bank 9: copy of the 16x16 book font bank 1 with
+# English 8x8 glyphs written into free tile codes.
+intro_en, intro_c, menu_en, menu_c, bank9 = make_book.build()
+# The original title logo and kana subtitle are sprites from CHR bank 1.
+# Blank those sprite tiles so the new background logo is the only one seen.
+bank10 = bytearray(4096)
+bank11 = bytearray(chr_[4 * 4096:5 * 4096])
+bank12 = bytearray(4096)
+bank13 = bytearray(4096)
+bank14 = bytearray(4096)
+bank15 = bytearray(4096)
+
+# ------------------------------------------------------------ text bank
+b4 = bytearray(prg[4 * 16384:5 * 16384])
+txtbank = bytearray(b4)
+def encode(s):
+ s = s.upper()
+ out = []
+ for ch in s:
+ if ch == ' ':
+ out.append(0x20)
+ elif ch in CHR8_MAP:
+ out.append(CHR8_MAP[ch])
+ else:
+ raise SystemExit('unmapped text char: ' + repr(ch))
+ return bytes(out)
+# Pack all 146 BASICS and BASICS PART 2 messages directly into PRG bank 14
+# starting at $8000, matching the fixed-bank pointer table at $F283..$F3A6
+# 1-to-1. Each lesson box holds up to two 26-cell lines.
+pos = 0
+basics_ptrs = []
+for mi, lines in enumerate(BASICS_MESSAGES):
+ assert 1 <= len(lines) <= 2, (mi, lines)
+ assert all(line and len(line) <= 26 for line in lines), (mi, lines)
+ basics_ptrs.append(0x8000 + pos)
+ for li, line in enumerate(lines):
+ enc = encode(line) + (b'\x00' if li + 1 < len(lines) else b'')
+ txtbank[pos:pos + len(enc)] = enc
+ pos += len(enc)
+ txtbank[pos] = 0xFF
+ pos += 1
+assert pos <= 0x2535, (pos, 'BASICS text collides with original $A535 area')
+print('BASICS text bytes:', pos, '/', hex(0x2535), 'messages:', len(basics_ptrs))
+# Lesson 8 (END) title shown in the PTS box: "owari-kata" -> END.
+# This string lives in the lesson text bank (the engine reads bank 14),
+# not in the bank-5 feedback table.
+assert txtbank[0x33B8:0x33BD] == bytes([0xB5, 0xDC, 0xD8, 0xB6, 0xC0]), \
+ txtbank[0x33B8:0x33BD].hex()
+txtbank[0x33B8:0x33BD] = bytes([CHR8_MAP['E'], CHR8_MAP['N'], CHR8_MAP['D'], 0xFE, 0xFE])
+
+# ------------------------------------------------------------ new ROM
+# Preserve the original PRG banks 0-7 at their original indices (some
+# code restores "bank 7" to get the fixed bank). Put the translated
+# ADVANCED lessons in bank 8, the Study-Course Drills in bank 9, the
+# BASICS text bank at 14, and a copy of the fixed bank at slot 15.
+banks = [bytearray(prg[i * 16384:(i + 1) * 16384]) for i in range(8)]
+# The same lesson-title string also exists in the original bank 4 (some
+# code paths still read that bank), so patch both copies.
+assert banks[4][0x33B8:0x33BD] == bytes([0xB5, 0xDC, 0xD8, 0xB6, 0xC0])
+banks[4][0x33B8:0x33BD] = bytes([CHR8_MAP['E'], CHR8_MAP['N'], CHR8_MAP['D'], 0xFE, 0xFE])
+# English book intro (screen 11) and lesson menu (screen 12). They fit
+# in the original compressed slots, so no pointer changes are needed.
+b3 = banks[3]
+# Japanese-styled English title screen (Screen 0 + CHR0 + CHR7 stamp).
+# Original $E57E OAM coordinates stay untouched so the white NIHON KIIN
+# APPROVED stamp sits in the exact position of the 日本棋院推薦 stamp.
+title_c = title_screen.build(b3, chr_)
+assert len(title_c) <= 0x020A, (len(title_c), 'title screen does not fit')
+b3[0:len(title_c)] = title_c
+b3[len(title_c):0x020A] = b'\x00' * (0x020A - len(title_c))
+
+b3[0x1256:0x1256 + len(intro_c)] = intro_c
+b3[0x148D:0x148D + len(menu_c)] = menu_c
+
+# Lesson-list continuation/results pages (screens 13-16) were still Japanese.
+# They show extra portrait/background art, so give them their own copy of
+# the book-font bank and only replace tiles that are unused on those pages.
+_lesson_pages = [(0x16F0, 0x193A), (0x193A, 0x1B73),
+ (0x1B73, 0x1DB5), (0x1DB5, 0x1FB8)]
+_keep_page = {0x01} # live per-question status marker on screen 16
+for _off, _end in _lesson_pages:
+ _pg = make_book.decompress(b3, _off)[0]
+ for _r in range(30):
+ for _c in range(32):
+ if _off == 0x1DB5:
+ # Keep the portrait and the runtime status/score cells.
+ _is_text = ((6 <= _r <= 21 and 3 <= _c <= 4) or
+ (_r == 4 and 18 <= _c <= 28) or
+ (8 <= _r <= 17 and 20 <= _c <= 28) or
+ (18 <= _r <= 19 and 18 <= _c <= 28))
+ else:
+ _is_text = ((3 <= _r <= 24 and 3 <= _c <= 13) or
+ (3 <= _r <= 16 and 17 <= _c <= 28))
+ if not _is_text:
+ _keep_page.add(_pg[_r * 32 + _c])
+_page_free = [i for i in range(1, 256) if i not in _keep_page and i not in (0xFE, 0xFF)]
+_page_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-/:'
+lesson_codes = dict(zip(_page_chars, _page_free))
+assert len(lesson_codes) == len(_page_chars), 'out of lesson-page tile codes'
+bank15[:] = chr_[1 * 4096:2 * 4096]
+for _ch, _code in lesson_codes.items():
+ _g = glyph(_ch)
+ for _y in range(8):
+ _mask = 0
+ for _x in range(8):
+ if _g[_y][_x]: _mask |= 1 << (7 - _x)
+ _inv = 0xFF ^ _mask
+ bank15[_code * 16 + _y] = _inv
+ bank15[_code * 16 + 8 + _y] = _inv
+# Draw bold 16x16 red/pink shaded verdict tiles for screen 16 ("PASS!" / "FAIL!").
+# Palette 2 maps colour 3 = white paper, colour 2 = red stroke, colour 1 = pink shadow.
+_vfree = _page_free[len(_page_chars):]
+_vpos = 0
+verdict16_codes = {}
+for _ch in 'PASFIL!':
+ tc = _vfree[_vpos:_vpos + 4]; _vpos += 4
+ assert len(tc) == 4, 'out of verdict 16x16 tiles'
+ verdict16_codes[_ch] = tc
+ _g = glyph(_ch)
+ # Render 16x16 scaled glyph with 1px drop shadow (colour 1) and red fill (colour 2)
+ mask = [[False] * 16 for _ in range(16)]
+ for dy in range(1, 15):
+ for dx in range(1, 15):
+ mask[dy][dx] = bool(_g[(dy - 1) // 2][(dx - 1) // 2])
+ canvas = [[3] * 16 for _ in range(16)]
+ for dy in range(16):
+ for dx in range(16):
+ if mask[dy][dx]:
+ if dy + 1 < 16 and dx + 1 < 16:
+ canvas[dy + 1][dx + 1] = 2
+ for dy in range(16):
+ for dx in range(16):
+ if mask[dy][dx]:
+ canvas[dy][dx] = 1
+ for ty in range(2):
+ for tx in range(2):
+ t = tc[ty * 2 + tx]
+ for y in range(8):
+ lo = hi = 0
+ for x in range(8):
+ v = canvas[ty * 8 + y][tx * 8 + x]
+ if v & 1: lo |= 1 << (7 - x)
+ if v & 2: hi |= 1 << (7 - x)
+ bank15[t * 16 + y] = lo
+ bank15[t * 16 + 8 + y] = hi
+# The original pending-question marker is kana tile $01. The results
+# runtime overwrites this column with its status marks, so only translate
+# the pending placeholder and leave the runtime behaviour intact.
+_g = glyph('-')
+for _y in range(8):
+ _mask = 0
+ for _x in range(8):
+ if _g[_y][_x]: _mask |= 1 << (7 - _x)
+ _inv = 0xFF ^ _mask
+ bank15[0x01 * 16 + _y] = _inv
+ bank15[0x01 * 16 + 8 + _y] = _inv
+# Lesson-list pages 13-15 are the continuation of the course menu. The
+# original numbers stay untouched (they use the bold book-font digits);
+# only the Japanese lesson names and the right-hand description block are
+# rewritten. The names are vertical, one cell per column, matching the
+# original menu layout so the selection cursor keeps working.
+def make_lesson_page(off, title, part, names, clears, slot, options=()):
+ page = bytearray(make_book.decompress(b3, off)[0][:1024])
+ for x0, y0, x1, y1 in clears:
+ make_book.clear(page, x0, y0, x1, y1)
+ make_book.clear(page, 17, 3, 28, 16)
+ make_book.put(page, 17, 4, title, lesson_codes)
+ make_book.put(page, 17, 6, part, lesson_codes)
+ make_book.put(page, 17, 9, 'CHOOSE ONE', lesson_codes)
+ make_book.put(page, 17, 11, 'PRESS A', lesson_codes)
+ for col, row, name in names:
+ make_book.putv(page, col, row, name, lesson_codes)
+ for col, row, text in options:
+ make_book.putv(page, col, row, text, lesson_codes)
+ c = make_book.compress(page)
+ assert len(c) <= slot, (hex(off), len(c), slot)
+ b3[off:off + len(c)] = c
+
+# The numbers run right-to-left on each page, so the name columns are
+# listed in the same right-to-left order as the original entries.
+make_lesson_page(
+ 0x16F0, 'BASICS', 'PART 2',
+ [(11, 6, 'OPENING'), (9, 6, 'SENTE'), (7, 6, 'HANDICAP')],
+ [(13, 4, 13, 5), (3, 6, 13, 24)], 0x193A - 0x16F0,
+ [(3, 6, 'MENU'), (5, 6, 'PREV')])
+make_lesson_page(
+ 0x193A, 'ADVANCED', 'PART 1',
+ [(13, 7, 'ATARI'), (11, 7, 'CAPTURE'), (9, 7, 'LADDER'),
+ (7, 7, 'NET'), (5, 7, 'SNAPBACK')],
+ [(3, 7, 13, 24)], 0x1B73 - 0x193A,
+ [(3, 7, 'NEXT')])
+# The numbers on this page are one cell to the right of the other pages.
+make_lesson_page(
+ 0x1B73, 'ADVANCED', 'PART 2',
+ [(12, 7, 'LINK'), (10, 7, 'CUT'), (8, 7, 'LIFE'),
+ (12, 16, 'DEATH'), (10, 16, 'KO')],
+ [(3, 6, 13, 13), (3, 14, 7, 14), (3, 15, 13, 24)], 0x1DB5 - 0x1B73,
+ [(3, 7, 'MENU'), (5, 7, 'PREV')])
+
+# Screen 16: study-course results ("PRESS A FOR MENU", "TOPICS",
+# questions 1-10, and a live score out of 10). Preserve the portrait,
+# the per-question status column at x=19, and the score cell at row 19,
+# column 26; those are updated by the lesson-result state machine.
+results16 = bytearray(make_book.decompress(b3, 0x1DB5)[0][:1024])
+make_book.clear(results16, 3, 6, 4, 21)
+make_book.clear(results16, 18, 4, 28, 4)
+make_book.clear(results16, 20, 8, 28, 19)
+make_book.putv(results16, 3, 9, 'A: MENU', lesson_codes)
+make_book.put(results16, 18, 4, 'TOPICS', lesson_codes)
+for _n in range(1, 11):
+ make_book.put(results16, 20, 7 + _n, f'{_n:2} ...', lesson_codes)
+make_book.put(results16, 20, 18, 'OUT OF 10', lesson_codes)
+make_book.put(results16, 23, 19, 'OK:', lesson_codes)
+results16_c = make_book.compress(results16)
+assert len(results16_c) <= 0x1FB8 - 0x1DB5, \
+ (len(results16_c), 'study-course results screen does not fit')
+b3[0x1DB5:0x1DB5 + len(results16_c)] = results16_c
+b3[0x1DB5 + len(results16_c):0x1FB8] = \
+ b'\x00' * (0x1FB8 - 0x1DB5 - len(results16_c))
+
+# Lesson base screen (screens 17-19 share one stream at $9FB8):
+# translate the small "points" legend in the box.
+base, _ = make_book.decompress(b3, 0x1FB8)
+base = bytearray(base)
+code8 = dict(CHR8_MAP)
+for i, ch in enumerate('PTS'):
+ base[17 * 32 + 3 + i] = code8[ch]
+base_c = make_book.compress(base)
+assert len(base_c) <= 378, (len(base_c), 'lesson base does not fit')
+b3[0x1FB8:0x1FB8 + len(base_c)] = base_c
+
+# ------------------------------------------------------- PLAY setup screens
+# Screens 6 (continue/new game) and 7 (PLAY settings) both use CHR 4K
+# bank 4. Build one English copy of that bank and choose letter tiles
+# that are unused by the artwork of *both* screens.
+s6 = bytearray(make_book.decompress(b3, 0x0813)[0])
+s7 = bytearray(make_book.decompress(b3, 0x0A18)[0])
+def s6clear(x0, y0, x1, y1):
+ for yy in range(y0, y1 + 1):
+ for xx in range(x0, x1 + 1):
+ s6[yy * 32 + xx] = 0x00
+def s7clear(x0, y0, x1, y1):
+ for yy in range(y0, y1 + 1):
+ for xx in range(x0, x1 + 1):
+ s7[yy * 32 + xx] = 0x00
+# Screen 6: remove the whole Japanese text block, including the
+# dakuten/handakuten marks that sit one row above the kana.
+for _yy in range(13, 25):
+ s6clear(2, _yy, 29, _yy)
+# Replace the Japanese "PLAY GO" calligraphy with a small English label.
+s6clear(3, 4, 16, 11)
+s7clear(3, 3, 15, 10)
+s7clear(2, 12, 29, 12)
+for yy in (15, 17, 19, 21, 23):
+ s7clear(3, yy, 13, yy); s7clear(17, yy, 23, yy); s7clear(24, yy, 28, yy)
+s7clear(2, 26, 29, 26)
+# The original border rows carry stray dakuten tiles (0xDF) that paired
+# with the Japanese labels; they read as random marks under the English
+# text, so flatten them back to the plain border pattern.
+for _yy in range(13, 25):
+ for _xx in range(3, 29):
+ if s7[_yy * 32 + _xx] == 0xDF:
+ s7[_yy * 32 + _xx] = 0x32
+keep7 = set()
+for rr in range(30):
+ for cc in range(32):
+ s7_text = ((3 <= rr <= 10 and 3 <= cc <= 15) or rr == 12 or (
+ rr in (15, 17, 19, 21, 23) and (3 <= cc <= 13 or 17 <= cc <= 22 or 24 <= cc <= 28)) or rr == 26)
+ s6_text = ((13 <= rr <= 24 and 2 <= cc <= 29) or (4 <= rr <= 11 and 3 <= cc <= 16))
+ if not s7_text:
+ keep7.add(s7[rr * 32 + cc])
+ if not s6_text:
+ keep7.add(s6[rr * 32 + cc])
+# The cursor/pointer and a few other runtime icons use low CHR tiles.
+# Keep English text in the high, genuinely free part of the 4K bank so
+# letters such as the final E in "CONTINUE" cannot overwrite one.
+free7 = [i for i in range(0xC0, 0x100)
+ if i not in keep7 and i not in (0xFE, 0xFF)]
+chars7 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-/:<>'
+assert len(free7) >= len(chars7), 'ran out of high PLAY-menu tiles'
+codes7 = dict(zip(chars7, free7))
+bank11[:] = chr_[4 * 4096:5 * 4096]
+# The continue screen draws a small blinking kana mark at row 23 with
+# tile $AC. Its text is gone, so the mark is now a stray artifact above
+# PRESS START; blank that unused tile in this screen's CHR bank.
+bank11[0xAC * 16:0xAC * 16 + 16] = b'\x00' * 16
+for ch, code in codes7.items():
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ # The setup screen's Japanese glyphs use colour 2. Its runtime
+ # attribute writes switch colour 2 between white and orange to show
+ # the active option; colour 1 stays the same in both palettes.
+ bank11[code * 16 + y] = 0
+ bank11[code * 16 + 8 + y] = mask
+# Runtime stones/time digits are $A6-$AF (0-9). Replace the original
+# glyphs too, so changing a counter cannot resurrect Japanese font tiles.
+for _d in range(10):
+ _g = glyph(str(_d))
+ for _y in range(8):
+ _mask = 0
+ for _x in range(8):
+ if _g[_y][_x]: _mask |= 1 << (7 - _x)
+ bank11[(0xA6 + _d) * 16 + _y] = 0
+ bank11[(0xA6 + _d) * 16 + 8 + _y] = _mask
+def s6put(x, y, txt):
+ for i, ch in enumerate(txt):
+ if ch != ' ':
+ s6[y * 32 + x + i] = codes7[ch]
+def s7put(x, y, txt):
+ for i, ch in enumerate(txt):
+ if ch != ' ':
+ s7[y * 32 + x + i] = codes7[ch]
+# Screen 6: "continue previous game" menu.
+s6put(4, 5, 'PLAY'); s6put(5, 7, 'GO')
+s6put(8, 14, 'CONTINUE GAME')
+s6put(11, 17, 'CONTINUE')
+s6put(11, 19, 'NEW GAME')
+s6put(10, 24, 'PRESS START')
+# Keep the menu labels on the original Japanese text columns (11+). The
+# selection cursor stays at columns 9-10, immediately to their left.
+for _ac in (1, 2, 3, 4):
+ s6[960 + 4 * 8 + _ac] = 0xFF
+# PRESS START (row 24) crosses several attribute quadrants. Force every
+# top quadrant it touches to the white palette so the whole footer is one
+# colour instead of changing partway through the word.
+_s6a = 960 + 6 * 8
+for _ac in (2, 3, 4, 5):
+ s6[_s6a + _ac] = (s6[_s6a + _ac] & 0xF0) | 0x0F
+s6_c = make_book.compress(s6)
+assert len(s6_c) <= 0x0A18 - 0x0813, (len(s6_c), 'PLAY continue screen does not fit')
+b3[0x0813:0x0813 + len(s6_c)] = s6_c
+b3[0x0813 + len(s6_c):0x0A18] = b'\x00' * (0x0A18 - 0x0813 - len(s6_c))
+# Screen 7: PLAY settings table.
+s7put(5, 4, 'PLAY'); s7put(6, 6, 'GO')
+s7put(4, 12, 'UP/DN ITEM LT/RT SELECT')
+# Restore the original right-hand value box border at column 23 and put
+# the values on the Japanese text column (24). This is the correct table
+# alignment: HUMAN / WHITE / YES start exactly where the original values
+# did, one cell right of the previous English build.
+for yy in (15, 17, 19):
+ s7[yy * 32 + 22] = 0x00
+ s7[yy * 32 + 23] = 0x36
+ s7[yy * 32 + 28] = 0x00
+for yy, label, o1, o2 in ((15, 'OPPONENT', 'CPU', 'HUMAN'),
+ (17, 'COLOR', 'BLACK', 'WHITE'),
+ (19, 'HANDICAP', 'NO', 'YES')):
+ s7put(3, yy, label); s7put(17, yy, o1); s7put(24, yy, o2)
+# Stones/time retain the original live counters at columns 23 and 22-23.
+# Static digits here previously collided with those counters and hid the
+# original decrease/increase controls. Keep the dynamic cells clear.
+for yy, label in ((21, 'STONES'), (23, 'TIME')):
+ s7put(3, yy, label)
+ s7put(17, yy, 'LESS')
+ s7put(21, yy, '<')
+ s7put(24, yy, '>')
+ s7put(25, yy, 'MORE')
+# The initial 60-second value is static in the compressed Japanese page;
+# only later counter changes redraw it. Restore both of its digits.
+# Remove the original dakuten mark that sat above the Japanese footer;
+# it now shows as a lone artifact above START.
+s7[25 * 32 + 14] = 0xFE
+s7put(22, 23, '60')
+s7put(4, 26, 'PRESS START')
+# The footer row is entirely in the lower quadrants of attribute row 6.
+# Make those quadrants white across the whole PRESS START label.
+_s7a = 960 + 6 * 8
+s7[_s7a + 1] = (s7[_s7a + 1] & 0x0F) | 0xF0
+s7_c = make_book.compress(s7)
+assert len(s7_c) <= 706, (len(s7_c), 'PLAY setup screen does not fit')
+b3[0x0A18:0x0A18 + len(s7_c)] = s7_c
+
+# ------------------------------------------------------- PLAY board panels
+# Screens 1 (PLAY), 2/3/4 (in-play/scoring board), and 5 (post-game review)
+# all share CHR bank 5 -> translated copy in CHR bank 14.
+s1 = bytearray(make_book.decompress(b3, 0x020A)[0])
+s1_orig = bytes(s1)
+s2 = bytearray(make_book.decompress(b3, 0x0438)[0])
+s5 = bytearray(make_book.decompress(b3, 0x0611)[0])
+# Runtime-written tiles that must keep their original graphics:
+# E9-F2 the fat countdown/move/capture digits
+# 5B,5C,5D,5E,6B,6C,6D the bell/gong stand artwork rows
+# E6,E7,4A stone icons and divider
+# Allocate English panel letters exclusively from the unused kana range
+# $B0-$E5 of CHR bank 5 (54 tiles; chars1 needs 43). Keeping $00-$AF
+# untouched preserves all board intersections, Black/White territory markers
+# ($25/$35), stone/bowl/bell art, and runtime status tiles ($8F etc.).
+free1b = [i for i in range(0xB0, 0xE6)]
+chars1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-:/'
+assert len(free1b) >= len(chars1), 'ran out of panel letter tiles'
+codes1b = dict(zip(chars1, free1b[:len(chars1)]))
+bank14[:] = chr_[5 * 4096:6 * 4096]
+for ch, code in codes1b.items():
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ bank14[code * 16 + y] = 0xFF ^ mask
+ bank14[code * 16 + 8 + y] = mask
+# Draw crisp ".5" half-point glyph in tile $FC (used by blk 93 during scoring).
+_half5 = [
+ 0b00000000,
+ 0b00011110,
+ 0b00010000,
+ 0b00011100,
+ 0b00000010,
+ 0b01000010,
+ 0b01011100,
+ 0b00000000,
+]
+for y in range(8):
+ bank14[0xFC * 16 + y] = 0xFF ^ _half5[y]
+ bank14[0xFC * 16 + 8 + y] = _half5[y]
+# Also replace $FA ("白") -> 'W' and $FB ("黒") -> 'B' in bank14 for territory display.
+for _tile, _ch in ((0xFA, 'W'), (0xFB, 'B')):
+ _g = glyph(_ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if _g[y][x]: mask |= 1 << (7 - x)
+ bank14[_tile * 16 + y] = 0xFF ^ mask
+ bank14[_tile * 16 + 8 + y] = mask
+
+def _board_put(buf, x, y, txt, codes=None):
+ codes = codes if codes is not None else codes1b
+ for i, ch in enumerate(txt):
+ buf[y * 32 + x + i] = 0xFE if ch == ' ' else codes[ch]
+
+REGIONS1 = [(3, 3, 6, 8), (12, 3, 21, 8), (23, 3, 26, 8)]
+
+def _setup_board_common(buf, with_time=True, with_turn=False):
+ for y0, x0, y1, x1 in REGIONS1:
+ for rr in range(y0, y1 + 1):
+ for cc in range(x0, x1 + 1):
+ buf[rr * 32 + cc] = 0xFE
+ for _i, _ch in enumerate('MOVE'):
+ buf[(3 + _i) * 32 + 3] = codes1b[_ch]
+ if with_time:
+ for _i, _ch in enumerate('TIME'):
+ buf[(3 + _i) * 32 + 8] = codes1b[_ch]
+ if with_turn:
+ _board_put(buf, 4, 5, 'TURN')
+ for i, ch in enumerate('CAPS'):
+ buf[(23 + i) * 32 + 3] = codes1b[ch]
+ for _rr in (23, 24, 25, 26):
+ buf[_rr * 32 + 4] = 0x4A
+ buf[23 * 32 + 5] = codes1b['B']
+ buf[24 * 32 + 5] = 0xE6
+ buf[25 * 32 + 5] = codes1b['W']
+ buf[26 * 32 + 5] = 0xE7
+
+# Screen 1: main PLAY board + Screens 2/3/4: active PLAY / scoring board.
+# Pack s1 followed immediately by s2 inside their combined slot $020A..$0611
+# (1031 bytes) and update the $C892 pointers for screens 2/3/4.
+_setup_board_common(s1, with_time=True, with_turn=True)
+for i, txt in enumerate(('PLAY', 'LAND', 'END', 'QUIT')):
+ _board_put(s1, 4, 13 + 2 * i, txt)
+s1_c = make_book.compress(s1)
+_setup_board_common(s2, with_time=True, with_turn=False)
+s2_c = make_book.compress(s2)
+s2_off = 0x020A + len(s1_c)
+assert s2_off + len(s2_c) <= 0x0611, (len(s1_c), len(s2_c), 'PLAY screens 1-4 do not fit')
+b3[0x020A:s2_off] = s1_c
+b3[s2_off:s2_off + len(s2_c)] = s2_c
+b3[s2_off + len(s2_c):0x0611] = b'\x00' * (0x0611 - s2_off - len(s2_c))
+print(f'PLAY boards: s1={len(s1_c)}, s2-4={len(s2_c)} (at ${0x8000+s2_off:04X}) / {0x0611-0x020A}')
+
+# Screen 5: post-game Review ("感想戦") board (slot $0611..$0813 = 514 bytes).
+_setup_board_common(s5, with_time=False, with_turn=True)
+for _rr in (7, 8, 11, 12):
+ for _cc in range(3, 9):
+ s5[_rr * 32 + _cc] = 0xFE
+_board_put(s5, 3, 7, 'REVIEW')
+_board_put(s5, 4, 11, 'REVW')
+for i, txt in enumerate(('TRY', 'LAND', 'PLAY', 'END')):
+ _board_put(s5, 4, 13 + 2 * i, txt)
+for _rr in (23, 24, 25, 26):
+ for _cc in range(12, 29):
+ s5[_rr * 32 + _cc] = 0xFE
+_board_put(s5, 12, 24, 'REVIEW MODE.')
+s5_c = make_book.compress(s5)
+assert len(s5_c) <= 0x0813 - 0x0611, (len(s5_c), 'Review board screen 5 does not fit')
+b3[0x0611:0x0611 + len(s5_c)] = s5_c
+b3[0x0611 + len(s5_c):0x0813] = b'\x00' * (0x0813 - 0x0611 - len(s5_c))
+
+# ------------------------------------------------------- TEST intro screen
+# Screens 21/22 share a compressed page that uses CHR 4K bank 3.
+# The sliding-door pattern on the right half is repainted at runtime with
+# a wide set of tile codes, so the English letters must avoid all of
+# them or the door turns into garbage.
+DOOR_RUNTIME = set(
+ [0x00, 0x01]
+ + list(range(0x1A, 0x20)) + [0x2A, 0x2B, 0x2C]
+ + list(range(0x38, 0x40)) + list(range(0x48, 0x50))
+ + list(range(0x58, 0x60)) + list(range(0x60, 0x6D))
+ + list(range(0x70, 0x7D)) + [0x7F] + list(range(0x80, 0x84))
+ + [0x8E] + list(range(0x90, 0x94)) + [0x9C, 0x9E, 0x9F]
+ + list(range(0xA0, 0xA4)) + [0xAC, 0xAF]
+ + list(range(0xB9, 0xBD)) + list(range(0xCB, 0xD0))
+ + list(range(0xDB, 0xE0)) + list(range(0xE4, 0xE7))
+ + list(range(0xEC, 0xF1)) + list(range(0xF3, 0xF7))
+ + [0xFB, 0xFC, 0xFE])
+t21 = bytearray(make_book.decompress(b3, 0x2132)[0])
+def t21clear(x0, y0, x1, y1):
+ for yy in range(y0, y1 + 1):
+ for xx in range(x0, x1 + 1):
+ t21[yy * 32 + xx] = 0xFE
+# Clear the title/banner/message areas but KEEP the portrait artwork
+# (rows 14-17, cols 3-8). The body starts on row 19; clearing from row
+# 14 used to erase most of the portrait.
+t21clear(3, 2, 17, 9)
+# Row 18 holds a leftover dakuten from the original body text; it is the
+# mark that appears above HALL in the English build.
+t21clear(3, 18, 17, 26)
+keep21 = set()
+for rr in range(30):
+ for cc in range(32):
+ if (3 <= rr <= 9 and 3 <= cc <= 17) or (19 <= rr <= 26 and 3 <= cc <= 17):
+ continue
+ keep21.add(t21[rr * 32 + cc])
+free21 = [i for i in range(1, 256) if i not in keep21
+ and i not in DOOR_RUNTIME and i not in (0xFE, 0xFF)]
+bank10[:] = chr_[3 * 4096:4 * 4096]
+chars21 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-/:'
+codes21 = dict(zip(chars21, free21[:len(chars21)]))
+assert len(codes21) == len(chars21), 'ran out of TEST-intro tile codes'
+for ch, code in codes21.items():
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ # Page-1 body text is black on the pink page. The page palette maps
+ # colour 0 to black and colour 3 to pink, so fill the cell with
+ # colour 3 and cut the letter out in colour 0 (not an inverse box).
+ inv = 0xFF ^ mask
+ bank10[code * 16 + y] = inv
+ bank10[code * 16 + 8 + y] = inv
+def t21glyph16(ch, tc):
+ for t in tc:
+ for k in range(16):
+ bank10[t * 16 + k] = 0
+ g = glyph(ch)
+ # Leave a one-pixel margin on every side of the 16x16 cell. Without
+ # it the outline generator has nowhere to put the top/bottom black
+ # edge, so TEST/HALL looked open at the top.
+ mask = [[False] * 16 for _ in range(16)]
+ for dy in range(1, 15):
+ for dx in range(1, 15):
+ mask[dy][dx] = bool(g[(dy - 1) // 2][(dx - 1) // 2])
+ # Match the original red calligraphy with a black outline: colour 2
+ # is red in the title palette and colour 1 is black.
+ canvas = [[2 if mask[dy][dx] else 3 for dx in range(16)]
+ for dy in range(16)]
+ for dy in range(16):
+ for dx in range(16):
+ if mask[dy][dx]:
+ continue
+ if any(0 <= dy + oy < 16 and 0 <= dx + ox < 16 and
+ mask[dy + oy][dx + ox]
+ for oy in (-1, 0, 1) for ox in (-1, 0, 1)):
+ canvas[dy][dx] = 0
+ for dy in range(16):
+ for dx in range(16):
+ value = canvas[dy][dx]
+ if not value:
+ continue
+ t = tc[(dy // 8) * 2 + (dx // 8)]
+ bit = 1 << (7 - (dx % 8))
+ if value & 1: bank10[t * 16 + (dy % 8)] |= bit
+ if value & 2: bank10[t * 16 + 8 + (dy % 8)] |= bit
+t21pos = len(chars21)
+t21codes = {}
+for ch in 'TESTHAL':
+ tc = free21[t21pos:t21pos + 4]; t21pos += 4
+ t21codes[ch] = tc
+ t21glyph16(ch, tc)
+def t21put16(x, y, txt):
+ for i, ch in enumerate(txt):
+ tc = t21codes[ch]
+ for dy in range(2):
+ for dx in range(2):
+ t21[(y + dy) * 32 + x + i * 2 + dx] = tc[dy * 2 + dx]
+def t21put(x, y, txt, codes=None):
+ codes = codes21 if codes is None else codes
+ for i, ch in enumerate(txt):
+ t21[y * 32 + x + i] = 0xFE if ch == ' ' else codes[ch]
+def t21style8(code, ch, planes, pink_background=False):
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ lo = mask if planes & 1 else 0
+ hi = mask if planes & 2 else 0
+ if pink_background:
+ # Colour 3 background with the requested foreground colour.
+ lo |= 0xFF ^ mask
+ hi |= 0xFF ^ mask
+ bank10[code * 16 + y] = lo
+ bank10[code * 16 + 8 + y] = hi
+# The byline is red colour 2 on pink, unlike the body copy. Give it
+# private glyphs so the body and runtime help-page text keep their style.
+byline21 = {}
+for ch in dict.fromkeys('BY NIHON KIIN'.replace(' ', '')):
+ byline21[ch] = free21[t21pos]; t21pos += 1
+ t21style8(byline21[ch], ch, 2, pink_background=True)
+# The two choices use colour 1 on pink in the original runtime palettes.
+choice21 = {}
+for ch in dict.fromkeys('TRYEND'):
+ choice21[ch] = free21[t21pos]; t21pos += 1
+ t21style8(choice21[ch], ch, 1, pink_background=True)
+# Page 2 is drawn by a runtime script whose palette has colour 0 as
+# black and colour 3 as the pink background. Give it inverse glyphs
+# (filled colour-3 cell, colour-0 letter) so the result is black text
+# on pink, not pink text in black boxes.
+page2_codes = {}
+for ch in dict.fromkeys('RANKS 12 KYU TO 4 KYU.THIS TEST HAS 20 QUESTIONS'):
+ if ch == ' ':
+ continue
+ page2_codes[ch] = free21[t21pos]; t21pos += 1
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]:
+ mask |= 1 << (7 - x)
+ bank10[page2_codes[ch] * 16 + y] = 0xFF ^ mask
+ bank10[page2_codes[ch] * 16 + 8 + y] = 0xFF ^ mask
+assert t21pos <= len(free21), 'ran out of styled TEST-intro tiles'
+t21put16(4, 4, 'TEST'); t21put16(4, 6, 'HALL')
+t21put(4, 9, 'BY NIHON KIIN', byline21)
+# Page 1 uses the same rows as the Japanese original. Page 2 is a
+# runtime nametable-update script (see fb_patch below) that overwrites
+# rows 19-26, exactly like the original.
+# Keep page-1 text inside the rectangles that the page-2 runtime script
+# overwrites. Otherwise the longer English lines survive behind the
+# page-2 text (the original Japanese lines were shorter).
+t21put(4, 19, 'THIS HALL')
+t21put(4, 21, 'MEASURES YOUR')
+t21put(6, 23, 'GO SKILL.')
+# Use the original Japanese choice columns: TRY starts at column 5 and
+# END at column 13. The selection cursor sits immediately to their left
+# (columns 3-4 and 11-12), and the runtime palette makes the selected
+# word pink and the other one white.
+t21put(5, 26, 'TRY', choice21)
+t21put(13, 26, 'END', choice21)
+def t21setpal(rr0, cc0, rr1, cc1, pal):
+ for _rr in range(rr0, rr1 + 1):
+ for _cc in range(cc0, cc1 + 1):
+ _ai = 960 + (_rr // 4) * 8 + (_cc // 4)
+ _sh = ((_rr % 4) // 2) * 4 + ((_cc % 4) // 2) * 2
+ _cur = (t21[_ai] >> _sh) & 3
+ if _cur != pal:
+ t21[_ai] = (t21[_ai] & ~(3 << _sh)) | (pal << _sh)
+# Keep the original title/body/choice palettes and the portrait's private
+# palette. Only the last byline cells need palette 1; they were blank in
+# the shorter Japanese byline.
+t21setpal(8, 16, 9, 17, 1)
+
+t21_c = make_book.compress(t21)
+assert len(t21_c) <= 651, (len(t21_c), 'TEST intro does not fit')
+b3[0x2132:0x2132 + len(t21_c)] = t21_c
+b3[0x2132 + len(t21_c):0x23BD] = b'\x00' * (0x23BD - 0x2132 - len(t21_c))
+
+# Translate the second TEST help page. Its text is stored as raw
+# nametable-update bytes in the fixed bank, not in the compressed screen.
+fb = banks[7]
+# Update $C892 screen pointers for screens 2, 3, 4 to packed s2_off.
+_s2_addr = 0x8000 + s2_off
+for _si in (2, 3, 4):
+ _so = 0x0892 + 2 * _si
+ assert (fb[_so] | (fb[_so + 1] << 8)) == 0x8438
+ fb[_so] = _s2_addr & 0xFF
+ fb[_so + 1] = _s2_addr >> 8
+
+# Repoint all 146 BASICS & BASICS PART 2 messages ($F283..$F3A6) to the
+# cleanly packed messages in PRG bank 14.
+assert len(basics_ptrs) == 146
+for _i, _ptr in enumerate(basics_ptrs):
+ _o = 0x3283 + 2 * _i
+ _old = fb[_o] | (fb[_o + 1] << 8)
+ assert 0xA535 <= _old <= 0xBF50, (_i, hex(_o), hex(_old))
+ fb[_o] = _ptr & 0xFF
+ fb[_o + 1] = _ptr >> 8
+
+def fb_patch(seq, text, pad=0xFE):
+ global fb
+ enc = bytes(pad if ch == ' ' else page2_codes[ch] for ch in text)
+ start = 0
+ while True:
+ k = fb.find(seq, start)
+ if k < 0: break
+ if len(enc) > len(seq):
+ raise SystemExit('fixed-bank text too long: ' + text)
+ fb[k:k + len(seq)] = enc + bytes([pad]) * (len(seq) - len(enc))
+ start = k + len(seq)
+# Shift the last runtime line two cells right (x5 -> x7). It then
+# clears the old page-1 END tiles, which are in a different palette
+# and used to leave a lone white square beside the page-2 text.
+_line5 = bytes([0x23,0x45,0xFE,0xFE,0xEB,0xB4,0xC3,0xEE,0xBB,0xB2,0xE6])
+_k = fb.find(_line5)
+assert _k >= 0 and fb.find(_line5, _k + 1) < 0, 'page-2 line-5 patch not unique'
+fb[_k + 1] = 0x67
+# Put page-2 lines 2 and 3 on rows 21 and 23, exactly where the longer
+# English page-1 body lives. This overwrites the old body completely.
+_line2 = bytes([0x22,0x84,0xAB,0xAD,0xF6,0xF7,0xB6,0xD7,0xE5,0xAF,0xF6,0xF7,0xCF,0xC3,0xC9])
+_k = fb.find(_line2)
+assert _k >= 0 and fb.find(_line2, _k + 1) < 0, 'page-2 line-2 patch not unique'
+fb[_k + 1] = 0xA4
+# Page-2 line 3 goes on row 23, exactly where page-1 line 3 lives.
+_line3 = bytes([0x22,0xC6,0xF1,0xF2,0xDE,0xFE,0xF3,0xB2,0xCF,0xBD,0xE6])
+_k = fb.find(_line3)
+assert _k >= 0 and fb.find(_line3, _k + 1) < 0, 'page-2 line-3 patch not unique'
+fb[_k + 1] = 0xE6
+# Move the "HAS 20" line down to row 25, leaving a one-row gap after
+# the second line.
+_line4 = bytes([0x23,0x07,0xA8,0xA9,0xEA,0xC9,0xEA,0xB2,0xC6])
+_k = fb.find(_line4)
+assert _k >= 0 and fb.find(_line4, _k + 1) < 0, 'page-2 line-4 patch not unique'
+fb[_k + 1] = 0x27
+# Use both original blank runs on row 26 to erase the page-1 choices
+# (TRY / END) after QUESTIONS has moved to row 27.
+for _old, _new in (
+ # Clear only the old page-1 choices (columns 5-18). The run at
+ # $22E5 is ten tiles long, so start it at column 9 (not 12); the
+ # previous addresses ran through columns 19-22 and cut a strip out
+ # of the sliding-door artwork on the right.
+ (bytes([0x22,0xA6]) + b'\xFE' * 7, bytes([0x23,0x45]) + b'\xFE' * 7),
+ (bytes([0x22,0xE5]) + b'\xFE' * 7, bytes([0x23,0x49]) + b'\xFE' * 7)):
+ _k = fb.find(_old)
+ assert _k >= 0 and fb.find(_old, _k + 1) < 0, 'page-2 blank row not unique'
+ fb[_k:_k + len(_old)] = _new
+# Explain the rank range naturally. "Kyu" is a Go rank; the Japanese
+# original says the test covers ranks 12 kyu through 4 kyu.
+fb_patch(bytes([0xAA,0xAC,0xF4,0xF5,0xFE,0xFE,0xFE,0xAE,0xF4,0xF5,0xFE,0xDF]), 'RANKS 12 KYU')
+fb_patch(bytes([0xAB,0xAD,0xF6,0xF7,0xB6,0xD7,0xE5,0xAF,0xF6,0xF7,0xCF,0xC3,0xC9]), 'TO 4 KYU.')
+fb_patch(bytes([0xF1,0xF2,0xDE,0xFE,0xF3,0xB2,0xCF,0xBD,0xE6]), 'THIS TEST')
+fb_patch(bytes([0xA8,0xA9,0xEA,0xC9,0xEA,0xB2,0xC6]), 'HAS 20')
+fb_patch(bytes([0xFE,0xFE,0xEB,0xB4,0xC3,0xEE,0xBB,0xB2,0xE6]), 'QUESTIONS')
+
+
+# ------------------------------------------------------- quiz/result UI text
+# Screen 23 (question screen) static label: "black to play".
+s23 = bytearray(make_book.decompress(b3, 0x23BD)[0])
+# The small turn panel uses pale colour-3 lettering in the Japanese
+# original. The main quiz font is colour 1, so allocate private panel
+# glyphs instead of recolouring every question and feedback message.
+keep23 = set()
+for rr in range(30):
+ for cc in range(32):
+ if not (rr in (11, 12) and 3 <= cc <= 8):
+ keep23.add(s23[rr * 32 + cc])
+reserved23 = (set(code8.values()) | set(range(0x70, 0x7A)) |
+ {0x48, 0x49, 0xFE, 0xFF})
+free23 = [i for i in range(1, 256) if i not in keep23 and i not in reserved23]
+# Never allocate the low tiles here: $0A-$11 are live sprite tiles on
+# the TEST screen (black stones, selection cursor, etc.). Overwriting
+# them turned stones into "S" and the unselected A into "Y". Use high
+# glyph slots that are free on both the quiz and lesson screens.
+lessonbase_codes = set(make_book.decompress(b3, 0x1FB8)[0][:960])
+panel_candidates = [0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x8C, 0x8D, 0x8E]
+for code in panel_candidates:
+ assert code not in keep23, (hex(code), 'TEST panel tile used by quiz art')
+ assert code not in lessonbase_codes, (hex(code), 'TEST panel tile used by lesson art')
+ assert code not in reserved23, (hex(code), 'TEST panel tile reserved for text')
+codes23panel = {}
+for ch, code in zip(dict.fromkeys('BLACKPLAYSN'), panel_candidates):
+ codes23panel[ch] = code
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ bank8[code * 16 + y] = mask
+ bank8[code * 16 + 8 + y] = mask
+for rr in range(11, 14):
+ for cc in range(3, 9):
+ s23[rr * 32 + cc] = 0x00
+for i, ch in enumerate('BLACK'):
+ s23[11 * 32 + 3 + i] = codes23panel[ch]
+for i, ch in enumerate('PLAYS'):
+ s23[12 * 32 + 3 + i] = codes23panel[ch]
+# Replace the tiny kanji "答" at row 17 col 3 of the choice box with "ANS".
+for i, ch in enumerate('ANS'):
+ s23[17 * 32 + 3 + i] = codes23panel[ch]
+s23_c = make_book.compress(s23)
+assert len(s23_c) <= 402, (len(s23_c), 'quiz screen does not fit')
+b3[0x23BD:0x23BD + len(s23_c)] = s23_c
+
+# Screen 24 (result screen). Keep the TEST-intro font in bank 12 and
+# give the result screen its own copy in bank 10. The result's rank
+# digits and its two portraits reuse many tiles that the large TEST HALL
+# lettering would otherwise overwrite.
+bank12[:] = bank10
+bank10[:] = chr_[3 * 4096:4 * 4096]
+s24 = bytearray(make_book.decompress(b3, 0x254F)[0])
+RANK_ART = ({0x6C, 0x6D, 0x6E, 0x6F, 0x7C, 0x7D, 0x7E, 0x7F}
+ | set(range(0x80, 0xA0)))
+RESULT_PORTRAIT = set()
+for _lo, _hi in ((0x0A, 0x10), (0x1A, 0x20), (0x2A, 0x30),
+ (0x3A, 0x40), (0x40, 0x48), (0x4A, 0x50),
+ (0x50, 0x58), (0x5A, 0x60), (0x60, 0x68),
+ (0x6A, 0x70), (0x7A, 0x80)):
+ RESULT_PORTRAIT |= set(range(_lo, _hi))
+keep24 = set(RANK_ART) | RESULT_PORTRAIT
+for rr in range(30):
+ for cc in range(32):
+ # Only the old heading and the kyu/desu glyphs are disposable.
+ if rr in (3, 5, 6) and 3 <= cc <= 18:
+ continue
+ keep24.add(s24[rr * 32 + cc])
+free24 = [i for i in range(1, 256)
+ if i not in keep24 and i not in (0xFE, 0xFF)]
+codes24 = dict(zip(chars21, free24[:len(chars21)]))
+assert len(codes24) == len(chars21), 'ran out of result-screen tiles'
+for ch, code in codes24.items():
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ bank10[code * 16 + y] = mask
+ bank10[code * 16 + 8 + y] = 0
+for rr in (3, 5, 6):
+ for cc in range(3, 19):
+ s24[rr * 32 + cc] = 0xFE
+for i, ch in enumerate('YOUR RANK'):
+ if ch != ' ':
+ s24[3 * 32 + 3 + i] = codes24[ch]
+
+# The result script selects one of several rank drawings and two short
+# comments. Replace each kana run in place, retaining all command and
+# skip bytes. Blank the standalone kyu/dakuten decorations as well.
+def result_patch(addr, old, text):
+ old = bytes(old)
+ # The final run of a script is followed directly by its skip byte;
+ # intermediate runs use a 00 terminator. Match the address and run
+ # itself so both forms are handled.
+ pat = bytes([addr >> 8, addr & 0xFF]) + old
+ enc = bytes(0xFE if ch == ' ' else codes24[ch] for ch in text)
+ assert len(enc) <= len(old), (hex(addr), text, len(old))
+ enc += bytes([0xFE]) * (len(old) - len(enc))
+ start, hits = 0, 0
+ while True:
+ k = fb.find(pat, start)
+ if k < 0:
+ break
+ fb[k + 2:k + 2 + len(old)] = enc
+ hits += 1
+ start = k + len(pat)
+ assert hits, (hex(addr), old.hex(), text)
+
+for addr, old in ((0x20AD, [0xEC]), (0x20CD, [0xEE]),
+ (0x20CD, [0xED]), (0x21C6, [0xDF, 0xFE, 0xDF, 0xDF]),
+ (0x21C6, [0xDF, 0xFE, 0xFE, 0xDF]), (0x21C7, [0xDF]),
+ (0x2247, [0xDF])):
+ result_patch(addr, old, '')
+for addr, old, text in (
+ (0x21E5, [0xCF,0xC0,0xCF,0xC0,0xC3,0xBD,0xDC,0xC8,0xE6], 'START NOW'),
+ (0x21E5, [0xCF,0xC0,0xFE,0xC9,0xCB,0xCF,0xBC,0xC3,0xD6,0xE6], 'NICE TRY!'),
+ (0x21E5, [0xBB,0xB7,0xB6], 'GO!'),
+ (0x2225, [0xC0,0xC9,0xBC,0xD0,0xC5,0xB6,0xC0,0xC8,0xE6], 'HAVE FUN!'),
+ (0x21E5, [0xB1,0xC5,0xC0,0xC5,0xD7,0xE5,0xD3,0xE4,0xC4], 'YOU CAN'),
+ (0x2225, [0xC2,0xD6,0xB8,0xC5,0xDA,0xCF,0xBD,0xDC,0xE6], 'IMPROVE!'),
+ (0x21E5, [0xD3,0xB3,0xFE,0xD6,0xDC,0xB2,0xC4,0xCA,0xE5], 'WELL DONE'),
+ (0x2225, [0xB2,0xB4,0xCF,0xBE,0xDD,0xDC,0xD6,0xE6], 'NICE!'),
+ (0x2225, [0xB5,0xC3,0xB1,0xDC,0xBE,0xBC,0xC0,0xB2,0xDC,0xE6], 'TRY AGAIN!'),
+ (0x21E5, [0xB2,0xC1,0xC4], 'OH!'),
+ (0x21E5, [0xDC,0xC0,0xB8,0xBC,0xE5], 'CLOSE'),
+ (0x2225, [0xB5,0xB2,0xC2,0xB6,0xDA,0xBF,0xB3,0xD6,0xE6], 'TRY AGAIN'),
+ (0x21E5, [0xC2,0xD6,0xB2,0xB6,0xC0,0xE9,0xE9,0xE6], 'SO CLOSE'),
+ (0x2225, [0xB1,0xD8,0xCF,0xBE,0xDD,0xDC,0xE6], 'CLOSE!'),
+ (0x21E5, [0xD3,0xB3,0xFE,0xB2,0xB3,0xBA,0xC4,0xCA], 'ALMOST!'),
+ (0x21E5, [0xDC,0xC0,0xB8,0xBC,0xC6,0xCA], 'ALMOST'),
+ (0x2225, [0xD3,0xB3,0xE5,0xB5,0xB1,0xB2,0xC3,0xCA], 'GREAT!'),
+ (0x2265, [0xD1,0xD8,0xC3,0xBD,0xDC,0xC8,0xE9,0xE9,0xE6], 'BRAVO!'),
+):
+ result_patch(addr, old, text)
+
+s24_c = make_book.compress(s24)
+assert len(s24_c) <= 658, (len(s24_c), 'result screen does not fit')
+b3[0x254F:0x254F + len(s24_c)] = s24_c
+
+# ------------------------------------------------------- play/result dialogs
+# Screens 8/9 ($0CDA) = VICTORY! ("快勝!") and Screen 10 ($0F98) = DEFEAT! ("無念!").
+# Both show a framed samurai illustration in rows 4-15, the banner in rows 17-19,
+# and "Review game? YES / NO" in rows 23-25. Preserve the samurai illustrations!
+dlgs = [bytearray(make_book.decompress(b3, a)[0]) for a in (0x0CDA, 0x0F98)]
+regions = [(17, 10, 19, 21), (23, 10, 25, 22)]
+def in_dlg_region(rr, cc):
+ return any(y0 <= rr <= y1 and x0 <= cc <= x1 for y0, x0, y1, x1 in regions)
+keep13 = set()
+for ds in dlgs:
+ for rr in range(30):
+ for cc in range(32):
+ if not in_dlg_region(rr, cc):
+ keep13.add(ds[rr * 32 + cc])
+free13 = [i for i in range(1, 256) if i not in keep13 and i not in (0xFE, 0xFF)]
+chars13 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-:/'
+assert len(free13) >= len(chars13), (len(free13), 'ran out of Victory/Defeat tiles')
+codes13 = dict(zip(chars13, free13[:len(chars13)]))
+bank13[:] = chr_[6 * 4096:7 * 4096]
+for ch, code in codes13.items():
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ # Original CHR6 text uses colour 1 (red scroll bg, lo=FF hi=00) and
+ # colour 3 (black ink, lo=FF hi=mask).
+ bank13[code * 16 + y] = 0xFF
+ bank13[code * 16 + 8 + y] = mask
+def dlg_put(ds, x, y, txt):
+ for i, ch in enumerate(txt):
+ ds[y * 32 + x + i] = 0xFE if ch == ' ' else codes13[ch]
+for ds, banner in zip(dlgs, ('VICTORY!', 'DEFEAT!')):
+ for y0, x0, y1, x1 in regions:
+ for rr in range(y0, y1 + 1):
+ for cc in range(x0, x1 + 1):
+ ds[rr * 32 + cc] = 0xFE
+ dlg_put(ds, 16 - len(banner) // 2, 18, banner)
+ dlg_put(ds, 10, 23, 'REVIEW GAME?')
+ dlg_put(ds, 13, 25, 'YES')
+ dlg_put(ds, 17, 25, 'NO')
+for a, ds in zip((0x0CDA, 0x0F98), dlgs):
+ dc = make_book.compress(ds)
+ assert len(dc) <= 0x2BE, (hex(a), len(dc))
+ b3[a:a + len(dc)] = dc
+ b3[a + len(dc):a + 0x2BE] = b'\x00' * (0x2BE - len(dc))
+
+# ------------------------------------------------- fixed-bank scripts
+# The in-game message/menu system runs tile-run scripts from the fixed
+# bank via pointer table $E5E0 (112 entries). Each block starts with
+# total_tile_count, followed by [hi lo tiles... 00] runs (no 00 after
+# the last run). Contiguous block regions can be repacked cleanly in
+# place while updating their $E5E0 pointers.
+
+def script_patch(fb, old, new):
+ assert len(new) == len(old), (old.hex(), new.hex())
+ k = fb.find(old)
+ assert k >= 0, 'script pattern not found: ' + old.hex()
+ while True:
+ nxt = fb.find(old, k + 1)
+ if nxt < 0:
+ break
+ raise SystemExit('script pattern not unique: ' + old.hex())
+ fb[k:k + len(old)] = new
+
+def encode_script_block(runs):
+ """Build a $C7B9 script block from [(ppu_addr, bytes_tiles), ...]."""
+ total = sum(len(tiles) for _, tiles in runs)
+ assert 1 <= total <= 127, total
+ out = bytearray([total])
+ for i, (addr, tiles) in enumerate(runs):
+ assert 0x2000 <= addr <= 0x23FF and 0x00 not in tiles, (hex(addr), tiles)
+ out.append(addr >> 8)
+ out.append(addr & 0xFF)
+ out.extend(tiles)
+ if i + 1 < len(runs):
+ out.append(0x00)
+ return bytes(out)
+
+def pack_script_region(fb, start_addr, end_addr, blocks_by_idx):
+ """Pack {blk_idx: block_bytes} into [start_addr, end_addr) and update $E5E0."""
+ pos = start_addr - 0xC000
+ lim = end_addr - 0xC000
+ for idx, data in blocks_by_idx.items():
+ addr = 0xC000 + pos
+ assert pos + len(data) <= lim, (idx, hex(addr), len(data), hex(end_addr))
+ fb[pos:pos + len(data)] = data
+ poff = 0x25E0 + 2 * idx
+ fb[poff] = addr & 0xFF
+ fb[poff + 1] = addr >> 8
+ pos += len(data)
+ fb[pos:lim] = b'\xFF' * (lim - pos)
+ return pos - (start_addr - 0xC000)
+
+def _t(text, codes, pad=0xFE):
+ return bytes(pad if ch == ' ' else codes[ch] for ch in text.upper())
+
+# --- Lesson PTS-box titles (BASICS 1-8 & BASICS PART 2) ---
+script_patch(fb, bytes([0x22,0xA4,0xB2,0xBA,0xC4,0xCA]),
+ bytes([0x22,0xA4,code8['G'],code8['O'],0xFE,0xFE])) # L2
+script_patch(fb, bytes([0x05,0x22,0xA4,0xB2,0xBC,0xA6]),
+ bytes([0x05,0x22,0xA4,code8['S'],code8['T'],code8['N']])) # L3
+script_patch(fb, bytes([0x22,0xA4,0xB7,0xDD,0xBC,0xC3]),
+ bytes([0x22,0xA4,code8['M'],code8['O'],code8['V'],code8['E']])) # L4
+script_patch(fb, bytes([0x02,0x22,0xA5,0xFA,0xF3]),
+ bytes([0x02,0x22,0xA5,code8['K'],code8['O']])) # L5
+script_patch(fb, bytes([0x06,0x22,0xA4,0xB2,0xBC,0xA6]),
+ bytes([0x06,0x22,0xA4,code8['S'],code8['T'],code8['N']])) # L6
+script_patch(fb, bytes([0x01,0x22,0xA5,0xA0]),
+ bytes([0x01,0x22,0xA5,code8['L']])) # L7
+script_patch(fb, bytes([0x22,0xE6,0xC4,0xD9]),
+ bytes([0x22,0xE6,code8['T'],code8['K']])) # L3 "toru"
+script_patch(fb, bytes([0x22,0xE5,0xB2,0xB6,0xBD]),
+ bytes([0x22,0xE5,code8['S'],code8['T'],code8['N']])) # L6
+script_patch(fb, bytes([0x05,0x22,0xA4,0xB5,0xDC,0xD8,0xB6,0xC0]),
+ bytes([0x05,0x22,0xA4,code8['E'],code8['N'],code8['D'],
+ 0xFE,0xFE]))
+# BASICS PART 2 PTS-box labels
+script_patch(fb, bytes([0x22,0xA4,0xCC,0xBE,0xB7,0xC4,0xCA]),
+ bytes([0x22,0xA4,code8['O'],code8['P'],code8['E'],code8['N'],0xFE]))
+script_patch(fb, bytes([0x22,0xA4,0xBE,0xDD,0xC3,0xC9,0x00,
+ 0x22,0xE5,0xB7,0xD2,0xB6,0xC0]),
+ bytes([0x22,0xA4,code8['T'],code8['U'],code8['R'],code8['N'],0x00,
+ 0x22,0xE5,code8['W'],code8['H'],code8['O'],code8['?']]))
+script_patch(fb, bytes([0x22,0x86,0xDE,0x00,
+ 0x22,0xA4,0x8A,0x9D,0x83,0xE8]),
+ bytes([0x22,0x86,0xFE,0x00,
+ 0x22,0xA4,code8['H'],code8['C'],code8['P'],0xFE]))
+# Lesson continue/"shall we learn?" choice: YES / NO (block 10 at $E761).
+script_patch(fb, bytes([0x22,0x65,0xCA,0xFE,0xB2,0x00]),
+ bytes([0x22,0x65,code8['Y'],code8['E'],code8['S'],0x00]))
+script_patch(fb, bytes([0x22,0xC4,0xFE,0xB2,0xB2,0xB4,0x00]),
+ bytes([0x22,0xC4,0xFE,code8['N'],code8['O'],0xFE,0x00]))
+
+# --- ADVANCED 10 lesson PTS-box titles (blocks 41..45, 47..51 in $EA38..$EA87) ---
+adv_pts_blocks = {
+ 51: encode_script_block([(0x2263, _t('ATARI', code8))]),
+ 50: encode_script_block([(0x2264, _t('TAKE', code8))]),
+ 49: encode_script_block([(0x2263, _t('LADDER', code8))]),
+ 48: encode_script_block([(0x2264, _t('NET', code8))]),
+ 47: encode_script_block([(0x2263, _t('TRAP', code8)), (0x22A3, _t('SNAP', code8))]),
+ 45: encode_script_block([(0x2264, _t('LINK', code8))]),
+ 44: encode_script_block([(0x2264, _t('CUT', code8))]),
+ 43: encode_script_block([(0x2264, _t('LIFE', code8))]),
+ 42: encode_script_block([(0x2263, _t('DEATH', code8))]),
+ 41: encode_script_block([(0x2265, _t('KO', code8))]),
+}
+_used_adv_pts = pack_script_region(fb, 0xEA38, 0xEA87, adv_pts_blocks)
+print('ADVANCED PTS blocks packed:', _used_adv_pts, '/', 0xEA87 - 0xEA38, 'bytes')
+
+# --- Study-course results screen 16 runtime blocks (blocks 53..68 in $EADA..$EC55) ---
+def _verdict_block(word, col):
+ top = bytes(t for ch in word for t in verdict16_codes[ch][:2])
+ bot = bytes(t for ch in word for t in verdict16_codes[ch][2:])
+ return encode_script_block([(0x2000 + 22 * 32 + col, top),
+ (0x2000 + 23 * 32 + col, bot)])
+
+def _para_block(lines, start_row=14, col=5):
+ return encode_script_block([(0x2000 + (start_row + 2 * i) * 32 + col,
+ _t(line, lesson_codes))
+ for i, line in enumerate(lines)])
+
+scr16_blocks = {
+ # 4 left-page comments (horizontal, cols 5..14, rows 14..21)
+ 53: _para_block(['TAKE YOUR', 'TIME AND', 'TRY AGAIN!']),
+ 54: _para_block(['SO CLOSE!', 'YOU WILL', 'PASS NEXT', 'TIME!']),
+ 55: _para_block(['GREAT JOB!', 'KEEP THIS', 'UP NEXT', 'TIME TOO!']),
+ 56: _para_block(['PERFECT!', 'A FLAWLESS', 'SCORE!']),
+ # 10 topic titles under TOPICS (row 6, centered in cols 18..28)
+ 67: encode_script_block([(0x2000 + 6 * 32 + 21, _t('ATARI', lesson_codes))]),
+ 66: encode_script_block([(0x2000 + 6 * 32 + 20, _t('CAPTURE', lesson_codes))]),
+ 65: encode_script_block([(0x2000 + 6 * 32 + 20, _t('LADDER', lesson_codes))]),
+ 64: encode_script_block([(0x2000 + 6 * 32 + 22, _t('NET', lesson_codes))]),
+ 63: encode_script_block([(0x2000 + 6 * 32 + 19, _t('SNAPBACK', lesson_codes))]),
+ 61: encode_script_block([(0x2000 + 6 * 32 + 20, _t('CONNECT', lesson_codes))]),
+ 60: encode_script_block([(0x2000 + 6 * 32 + 22, _t('CUT', lesson_codes))]),
+ 59: encode_script_block([(0x2000 + 6 * 32 + 21, _t('LIFE', lesson_codes))]),
+ 58: encode_script_block([(0x2000 + 6 * 32 + 21, _t('DEATH', lesson_codes))]),
+ 57: encode_script_block([(0x2000 + 6 * 32 + 22, _t('KO', lesson_codes))]),
+ # Red 16x16 verdicts: PASS! (blk 62) and FAIL! (blk 68)
+ 62: _verdict_block('PASS!', 18),
+ 68: _verdict_block('FAIL!', 18),
+}
+_used_scr16 = pack_script_region(fb, 0xEADA, 0xEC55, scr16_blocks)
+print('Screen 16 runtime blocks packed:', _used_scr16, '/', 0xEC55 - 0xEADA, 'bytes')
+
+# --- PLAY / Review / Scoring / Victory-Defeat runtime blocks (69..108 in $EC55..$F1B1) ---
+# Preserve bell-stand blocks 102 ($F14F) and 103 ($F16A) verbatim so clock/bell stays intact!
+_orig_blk102 = bytes(fb[0x314F:0x316A])
+_orig_blk103 = bytes(fb[0x316A:0x3185])
+_orig_blk93 = bytes(fb[0x3019:0x301D]) # $230E: $FC (".5" half-point)
+_orig_blk95 = bytes(fb[0x3022:0x302B]) # clear row 6 cols 3-8
+_orig_blk108 = bytes(fb[0x319B:0x31B1]) # clear message line 2
+
+def _b14(text): return _t(text, codes1b)
+def _b14_4(text): return _t(text.ljust(4)[:4], codes1b)
+BLANK4 = b'\xFE\xFE\xFE\xFE'
+BLANK6 = b'\xFE' * 6
+BLANK16 = b'\xFE' * 16
+
+def _play_menu(items):
+ runs = []
+ for i, item in enumerate(items):
+ runs.append((0x2000 + (13 + 2 * i) * 32 + 4, _b14_4(item)))
+ runs.append((0x2000 + (14 + 2 * i) * 32 + 4, BLANK4))
+ return runs
+
+play_blocks = {
+ # 69: 4-item PLAY menu
+ 69: encode_script_block(_play_menu(('PLAY', 'LAND', 'END', 'QUIT'))),
+ # 70: Music menu in PLAY
+ 70: encode_script_block([
+ (0x21A4, BLANK4), (0x21C4, _b14_4('TUNE')),
+ (0x21E4, BLANK4), (0x2204, _b14_4(' YES')),
+ (0x2224, BLANK4), (0x2244, _b14_4(' NO ')),
+ (0x2264, BLANK4), (0x2284, BLANK4),
+ ]),
+ # 71: Trial-move menu (LAND / END) + status bar
+ 71: encode_script_block(_play_menu(('LAND', 'END')) + [
+ (0x230C, _b14('TRIAL MOVE MODE.')),
+ ]),
+ # 72: Territory view menu (PLAY / END) + score header (keep $E6/$E7 stone icons at col 20!)
+ 72: encode_script_block(_play_menu(('PLAY', 'END')) + [
+ (0x230C, _b14('LAND: ') + bytes([0xE6, 0xFB, 0xFE, 0xFE])),
+ (0x2354, bytes([0xE7, 0xFA, 0xFE, 0xFE])),
+ ]),
+ # 73: Time up! [BK/WH] WINS.
+ 73: encode_script_block([
+ (0x230C, _b14('TIME UP! ')),
+ (0x234E, _b14(' WINS. ')),
+ ]),
+ # 74: Resigned! [BK/WH] WINS.
+ 74: encode_script_block([
+ (0x230C, _b14('RESIGNED! ')),
+ (0x234E, _b14(' WINS. ')),
+ ]),
+ # 75: Entering scoring
+ 75: encode_script_block([
+ (0x230C, _b14('SCORING GAME... ')),
+ ]),
+ # 76: Dead stone confirm: YES / NO + IS THIS STONE / DEAD?
+ 76: encode_script_block([
+ (0x21A4, BLANK4), (0x21C4, _b14_4(' YES')),
+ (0x2205, _b14('NO ')),
+ (0x230C, _b14('IS THIS STONE ')),
+ (0x234C, _b14('DEAD? ')),
+ ]),
+ # 77: Are there dead stones?
+ 77: encode_script_block([
+ (0x230C, _b14('ARE THERE ANY ')),
+ (0x234C, _b14('DEAD STONES? ')),
+ ]),
+ # 78: Select dead stones (DONE button)
+ 78: encode_script_block([
+ (0x21C5, _b14('DONE')), (0x2205, BLANK4),
+ (0x230C, _b14('SELECT DEAD ')),
+ (0x234C, _b14('STONES. ')),
+ ]),
+ # 79: Final score banner (cols 12-14 hold numeric margin + optional .5 from blk 93)
+ 79: encode_script_block([
+ (0x21C5, BLANK4), (0x2205, BLANK4),
+ (0x230C, _b14(' PTS MARGIN ')),
+ (0x234C, _b14(' WINS. ')),
+ ]),
+ # 80: Review mode main menu + header + status
+ 80: encode_script_block([
+ (0x2163, _b14(' REVW ')), (0x2183, BLANK6),
+ ] + _play_menu(('TRY', 'LAND', 'PLAY', 'END')) + [
+ (0x230C, _b14('REVIEW MODE. ')),
+ (0x2354, BLANK6),
+ ]),
+ # 81: Music menu in Review mode
+ 81: encode_script_block([
+ (0x2163, BLANK6), (0x2183, BLANK6),
+ (0x21A4, BLANK4), (0x21C4, _b14_4('TUNE')),
+ (0x21E4, BLANK4), (0x2204, _b14_4(' YES')),
+ (0x2224, BLANK4), (0x2244, _b14_4(' NO ')),
+ (0x2264, BLANK4), (0x2284, BLANK4),
+ ]),
+ # 82: Trial move in Review mode
+ 82: encode_script_block([
+ (0x2163, _b14(' END ')), (0x2183, BLANK6),
+ ] + _play_menu(('', '', '', '')) + [
+ (0x230C, _b14('TRIAL MOVE MODE.')),
+ ]),
+ # 83: Territory view in Review mode
+ 83: encode_script_block([
+ (0x2163, _b14(' END ')), (0x2183, BLANK6),
+ ] + _play_menu(('', '', '', '')) + [
+ (0x230C, _b14('LAND: ') + bytes([0xE6, 0xFB, 0xFE, 0xFE])),
+ (0x2354, bytes([0xE7, 0xFA, 0xFE, 0xFE])),
+ ]),
+ # 84-90: Top-box status banners (keep cols 4-7 only so col 3 MOVE & col 8 TIME survive!)
+ 84: encode_script_block([(0x2084, _b14('BLK '))]),
+ 85: encode_script_block([(0x2084, _b14('WHT '))]),
+ 86: encode_script_block([(0x2084, BLANK4), (0x20A4, _b14('TURN'))]),
+ 87: encode_script_block([(0x2084, _b14('UNDO')), (0x20A4, BLANK4)]),
+ 88: encode_script_block([(0x2084, _b14('FOUL')), (0x20A4, BLANK4)]),
+ 89: encode_script_block([(0x2084, _b14('OVER')), (0x20A4, BLANK4)]),
+ 90: encode_script_block([(0x2084, BLANK4), (0x20A4, BLANK4)]),
+ # 91-94: Score/result word inserts (BK / WH / .5 / LOSE)
+ 91: encode_script_block([(0x234C, _b14('BK'))]),
+ 92: encode_script_block([(0x234C, _b14('WH'))]),
+ 93: _orig_blk93,
+ 94: encode_script_block([(0x234F, _b14('LOSE'))]),
+ 95: _orig_blk95,
+ # 96-97: 2-Player Victory banners on Screen 8/9 (uses CHR bank 13 codes13!)
+ 96: encode_script_block([(0x2000 + 18 * 32 + 12, _t('1P WINS!', codes13))]),
+ 97: encode_script_block([(0x2000 + 18 * 32 + 12, _t('2P WINS!', codes13))]),
+ # 98-100: CPU resignation requests (YES / NO in left menu + message bar)
+ 98: encode_script_block([
+ (0x21C5, _b14('YES ')), (0x2205, _b14('NO ')),
+ (0x230C, _b14('NO CHANCE LEFT. ')),
+ (0x234C, _b14('MAY I RESIGN? ')),
+ ]),
+ 99: encode_script_block([
+ (0x21C5, _b14('YES ')), (0x2205, _b14('NO ')),
+ (0x230C, _b14('I CANNOT WIN. ')),
+ (0x234C, _b14('MAY I RESIGN? ')),
+ ]),
+ 100: encode_script_block([
+ (0x21C5, _b14('YES ')), (0x2205, _b14('NO ')),
+ (0x230C, _b14('NO HOPE TO WIN. ')),
+ (0x234C, _b14('I MUST RESIGN. ')),
+ ]),
+ # 101: CPU thinking ("おまちください。")
+ 101: encode_script_block([
+ (0x230C, _b14('PLEASE WAIT... ')),
+ (0x234C, BLANK16),
+ ]),
+ 102: _orig_blk102,
+ 103: _orig_blk103,
+ # 106-108: Too many stones messages
+ 106: encode_script_block([
+ (0x230C, _b14('TOO MANY STONES.')),
+ (0x234C, _b14('SCORING GAME... ')),
+ ]),
+ 107: encode_script_block([
+ (0x234C, _b14('TOO MANY STONES.')),
+ ]),
+ 108: _orig_blk108,
+}
+_used_play = pack_script_region(fb, 0xEC55, 0xF1B1, play_blocks)
+print('PLAY runtime blocks packed:', _used_play, '/', 0xF1B1 - 0xEC55, 'bytes')
+
+
+# ---------------------------------------------------------- TEST feedback
+# The TEST presents 20 of 300 questions. The starting question index is not
+# fixed (it comes from the saved rank / course), so *any* of the 300x3 answer
+# messages can be shown - the old per-address patch covered only the single
+# 20-question path the emulator happened to take, which is why Japanese
+# feedback kept showing up on other runs (usually with an English tail glued
+# on through a 0x0A link).
+#
+# Bank 5 holds a 900-entry pointer table at $8540 (6 bytes per question:
+# answer A, B, C) into the text region that starts at $8C48. Repack the
+# whole region in English and rebuild the table. Several table entries point
+# into the middle of another message (the original data shares suffixes), so
+# each entry is resolved to the start of the message containing it; every
+# entry then gets a self-contained English line.
+def enc5(text):
+ """Encode a message-bar line for CHR bank 8.
+
+ Tile 0x20 is a solid block in this font, so blanks must use 0xFE.
+ "\\n" emits 0x00, the message box's line break.
+ """
+ out = []
+ for ch in text.upper():
+ if ch == '\n':
+ out.append(0x00)
+ elif ch == ' ':
+ out.append(0xFE)
+ elif ch in CHR8_MAP:
+ out.append(CHR8_MAP[ch])
+ else:
+ raise SystemExit('bad feedback char: ' + repr(ch))
+ return bytes(out)
+
+FEEDBACK_TABLE = 0x8540
+FEEDBACK_TEXT = 0x8C48
+FEEDBACK_ENTRIES = (FEEDBACK_TEXT - FEEDBACK_TABLE) // 2 # 900
+
+b5 = banks[5]
+orig_b5 = bytes(b5)
+
+def _fb_word(off):
+ return orig_b5[off] | (orig_b5[off + 1] << 8)
+
+fb_ptr = [_fb_word(FEEDBACK_TABLE - 0x8000 + 2 * i)
+ for i in range(FEEDBACK_ENTRIES)]
+assert all(FEEDBACK_TEXT <= a < 0xC000 for a in fb_ptr), 'bad feedback pointer'
+
+def _fb_base(addr):
+ off = addr - 0x8000
+ while off > (FEEDBACK_TEXT - 0x8000) and orig_b5[off - 1] != 0xFF:
+ off -= 1
+ return 0x8000 + off
+
+fb_base = [_fb_base(a) for a in fb_ptr]
+fb_bases = sorted(set(fb_base))
+assert set(fb_bases) == set(FEEDBACK_EN), (
+ 'tools/feedback_en.py is out of date, diff: '
+ + str(sorted(hex(a) for a in set(fb_bases) ^ set(FEEDBACK_EN))))
+
+pos = FEEDBACK_TEXT - 0x8000
+fb_enc = {}
+fb_addr = {}
+for a in fb_bases:
+ enc = enc5(FEEDBACK_EN[a])
+ lines = FEEDBACK_EN[a].split('\n')
+ assert len(lines) <= 2 and all(len(x) <= 23 for x in lines), (
+ hex(a), 'line too wide for the message box', FEEDBACK_EN[a])
+ if enc not in fb_enc:
+ fb_enc[enc] = 0x8000 + pos
+ b5[pos:pos + len(enc)] = enc
+ b5[pos + len(enc)] = 0xFF
+ pos += len(enc) + 1
+ fb_addr[a] = fb_enc[enc]
+assert pos <= 0x4000, (pos, 'English feedback does not fit in bank 5')
+b5[pos:0x4000] = b'\xFF' * (0x4000 - pos)
+for i, a in enumerate(fb_base):
+ o = FEEDBACK_TABLE - 0x8000 + 2 * i
+ b5[o] = fb_addr[a] & 0xFF
+ b5[o + 1] = fb_addr[a] >> 8
+print('feedback:', len(fb_bases), 'messages,', len(fb_enc), 'unique,',
+ pos - (FEEDBACK_TEXT - 0x8000), 'bytes')
+
+# Translate every bank-3 quiz/explanation string in place. The strings
+# are addressed directly by several pointer tables, so keeping every
+# original start address avoids touching those tables. Each English
+# version is checked against the original byte budget.
+quiz = json.load(open(os.path.join(HERE, 'quiz_en.json')))
+for qi, qe in enumerate(quiz):
+ qa = qe['addr']
+ off = qa - 0x8000
+ j = off
+ while j < 0x4000 and b3[j] != 0xFF:
+ j += 1
+ cap = j - off
+ enc = b'\x00'.join(encode(ln) for ln in BANK3_EN[qi].split('\n'))
+ assert len(enc) <= cap, (qi, hex(qa), len(enc), cap, BANK3_EN[qi])
+ # Terminate immediately. The reader ignores bytes after the first
+ # 0xFF; padding to the original length used to draw spaces past the
+ # 24-cell question box and over the border on long entries (Q10/Q20).
+ b3[off:off + len(enc)] = enc
+ b3[off + len(enc)] = 0xFF
+ b3[off + len(enc) + 1:off + cap + 1] = b'\xFF' * (cap - len(enc))
+
+# Some entries of the 300-question table in the fixed bank ($FD40) point into
+# the middle of another prompt, because the original data shares suffixes.
+# After translation those aliases render as fragments (".", "NO GOOD.",
+# "LED.", ...), so give every such entry a dedicated English prompt placed in
+# bank 3's free 0xFF padding and repoint the table entry.
+question_fix = {
+ 0xABA5: 'USE LIBERTY SHORTAGE.',
+ 0xABE0: 'USE A SACRIFICE.',
+ 0xB173: 'KEY ATTACK OR DEFENSE?',
+ 0xB304: 'STOP WHITE APPROACHING.',
+ 0xB394: 'CAPTURE THREE STONES.',
+ 0xB40A: 'CAPTURE FOUR STONES.',
+ 0xB561: 'OIOTOSHI CAPTURES IT.',
+ 0xB54B: 'CAPTURE 2 WHITE STONES.',
+ 0xBE22: 'PLAY A NATURAL MOVE.',
+ 0xA872: 'HOW TO CONNECT.',
+}
+
+# Allocate dedicated `question_fix` prompts in the unused tail bytes of
+# recompressed screen slots in Bank 3 (after each screen's 0x00 RLE end).
+_b3_pools = []
+for _slo, _shi in ((0x1256, 0x148D), (0x148D, 0x16F0), (0x16F0, 0x193A),
+ (0x193A, 0x1B73), (0x1B73, 0x1DB5)):
+ _, _send = make_book.decompress(b3, _slo)
+ if _send < _shi:
+ _b3_pools.append([_send, _shi])
+
+def _b3_alloc(enc):
+ """Place a prompt string (+ 0xFF terminator) in free Bank 3 space."""
+ need = len(enc) + 1
+ for pool in _b3_pools:
+ if pool[1] - pool[0] >= need:
+ off = pool[0]
+ b3[off:off + len(enc)] = enc
+ b3[off + len(enc)] = 0xFF
+ pool[0] += need
+ return 0x8000 + off
+ raise SystemExit('no free space in bank 3 for question prompt')
+
+QTAB = 0x3D40 # $FD40 in the fixed bank
+qtab = [banks[7][QTAB + 2 * i] | (banks[7][QTAB + 2 * i + 1] << 8)
+ for i in range(300)]
+new_qaddr = {a: _b3_alloc(encode(txt)) for a, txt in question_fix.items()}
+assert len(set(new_qaddr.values())) == len(new_qaddr)
+for i, a in enumerate(qtab):
+ if a in new_qaddr:
+ off = QTAB + 2 * i
+ banks[7][off] = new_qaddr[a] & 0xFF
+ banks[7][off + 1] = new_qaddr[a] >> 8
+
+# ------------------------------------------------ ADVANCED & Study-Course Drills
+# Pack the 167 translated ADVANCED lesson messages into PRG bank 8 (repointing
+# fixed-bank table $F3A7..$F4F4) and the 100 drill prompts + 98 drill feedbacks
+# into PRG bank 9 (repointing fixed-bank tables $F5B9..$F680 and $F4F5..$F5B8).
+# Original banks 2 and 6 keep their board/script data 100% untouched.
+def _pack_msg_bank(msg_groups):
+ buf = bytearray(b'\xFF' * 16384)
+ pos = 0
+ dedup = {}
+ ptrs = []
+ for lines in msg_groups:
+ assert 1 <= len(lines) <= 2, lines
+ assert all(1 <= len(ln) <= 26 for ln in lines), lines
+ enc = b'\x00'.join(encode(ln) for ln in lines) + b'\xFF'
+ if enc not in dedup:
+ assert pos + len(enc) <= 16384, 'PRG text bank overflow'
+ dedup[enc] = 0x8000 + pos
+ buf[pos:pos + len(enc)] = enc
+ pos += len(enc)
+ ptrs.append(dedup[enc])
+ return buf, ptrs, pos
+
+adv_bank, adv_ptrs, adv_bytes = _pack_msg_bank(ADV_MESSAGES)
+drill_bank, drill_all_ptrs, drill_bytes = _pack_msg_bank(DRILL_PROMPTS + DRILL_FEEDBACKS)
+drill_prompt_ptrs = drill_all_ptrs[:len(DRILL_PROMPTS)]
+drill_fb_ptrs = drill_all_ptrs[len(DRILL_PROMPTS):]
+print(f'ADVANCED bank 8: {len(adv_ptrs)} msgs, {adv_bytes} bytes')
+print(f'DRILL bank 9: {len(drill_prompt_ptrs)} prompts + {len(drill_fb_ptrs)} feedbacks, {drill_bytes} bytes')
+
+for i, ptr in enumerate(adv_ptrs):
+ o = 0x33A7 + 2 * i
+ fb[o] = ptr & 0xFF
+ fb[o + 1] = ptr >> 8
+for i, ptr in enumerate(drill_fb_ptrs):
+ o = 0x34F5 + 2 * i
+ fb[o] = ptr & 0xFF
+ fb[o + 1] = ptr >> 8
+for i, ptr in enumerate(drill_prompt_ptrs):
+ o = 0x35B9 + 2 * i
+ fb[o] = ptr & 0xFF
+ fb[o + 1] = ptr >> 8
+
+banks.append(adv_bank) # PRG bank 8: ADVANCED lessons
+banks.append(drill_bank) # PRG bank 9: Study-course drill prompts & feedbacks
+banks += [bytearray(16384) for _ in range(4)] # PRG banks 10-13 spare
+banks.append(txtbank) # PRG bank 14: BASICS / BASICS PART 2
+banks.append(banks[7]) # PRG bank 15: fixed bank mirror
+
+chr_new = chr_ + bank8 + bank9 + bank10 + bank11 + bank12 + bank13 + bank14 + bank15
+prg_new = b''.join(banks)
+out = bytearray(raw[:16]) + prg_new + chr_new
+out[4] = 16 # 16 x 16K PRG
+out[5] = 8 # 8 x 8K CHR (16 x 4K banks)
+# Patch Bank 4 ($03EE text-bank selectors):
+# $80F9: BASICS / BASICS2 (4 -> 14)
+# $82D8: ADVANCED lessons (6 -> 8)
+# $83E0, $8408: Drill prompts (2 -> 9)
+# $89E4, $89EA: Drill feedbacks (2 / 6 -> 9)
+_b4off = 16 + 4 * 16384
+assert out[_b4off + 0x00F9:_b4off + 0x00FB] == bytes([0xA9, 0x04])
+out[_b4off + 0x00FA] = 14
+assert out[_b4off + 0x02D8:_b4off + 0x02DA] == bytes([0xA9, 0x06])
+out[_b4off + 0x02D9] = 8
+assert out[_b4off + 0x03E0:_b4off + 0x03E2] == bytes([0xA9, 0x02])
+out[_b4off + 0x03E1] = 9
+assert out[_b4off + 0x0408:_b4off + 0x040A] == bytes([0xA9, 0x02])
+out[_b4off + 0x0409] = 9
+assert out[_b4off + 0x09E4:_b4off + 0x09E6] == bytes([0xA0, 0x02])
+out[_b4off + 0x09E5] = 9
+assert out[_b4off + 0x09EA:_b4off + 0x09EC] == bytes([0xA0, 0x06])
+out[_b4off + 0x09EB] = 9
+# lesson screens CHR0 -> 8 (fixed bank is the last PRG bank)
+fixed = 16 + 15 * 16384
+for idx in (17, 18, 19, 20, 23):
+ out[fixed + (0xC8C8 - 0xC000) + idx] = 8
+# Book intro, menu and lesson-list pages use the English book-font bank.
+for idx in (11, 12):
+ out[fixed + (0xC8C8 - 0xC000) + idx] = 9
+for idx in (13, 14, 15, 16):
+ out[fixed + (0xC8C8 - 0xC000) + idx] = 15
+# PLAY board screens (1: main, 2-4: in-play/scoring, 5: post-game review) use CHR bank 14.
+for idx in (1, 2, 3, 4, 5):
+ out[fixed + (0xC8C8 - 0xC000) + idx] = 14
+# PLAY continue/setup screens use the English CHR bank 11.
+out[fixed + (0xC8C8 - 0xC000) + 6] = 11
+out[fixed + (0xC8C8 - 0xC000) + 7] = 11
+# TEST intro/help screens use the English CHR bank 12; the result
+# screen has its own protected-art font in bank 10.
+for idx in (20, 21, 22):
+ out[fixed + (0xC8C8 - 0xC000) + idx] = 12
+out[fixed + (0xC8C8 - 0xC000) + 24] = 10
+for idx in (8, 9, 10):
+ out[fixed + (0xC8C8 - 0xC000) + idx] = 13
+# Quiz question screen uses the English 8x8 font bank 8.
+out[fixed + (0xC8C8 - 0xC000) + 23] = 8
+# Bottom legend script ($E78B): replace "ごばんと ごいし" with "GOBAN" / "STONE".
+# Start STONE at col 4 ($22E4) so its last letter stays inside the PTS box
+# (col 8) and never overwrites the right border at col 9.
+legend = bytes([0x0A, 0x22, 0xA4]) + _t('GOBAN', code8) + bytes([0x00, 0x22, 0xE4]) + _t('STONE', code8) + bytes([0x00])
+out[fixed + 0x278B:fixed + 0x278B + len(legend)] = legend
+# Mirror the same fixed-bank legend patch in bank 7 copy too.
+out[16 + 7 * 16384 + 0x278B:16 + 7 * 16384 + 0x278B + len(legend)] = legend
+# Also mirror CHR table in bank 7 copy for completeness.
+out[16 + 7 * 16384 + 0x08C8:16 + 7 * 16384 + 0x08C8 + 25] = out[fixed + 0x08C8:fixed + 0x08C8 + 25]
+open(OUT, 'wb').write(out)
+print('wrote', OUT, len(out), 'bytes')
diff --git a/tools/feedback_en.py b/tools/feedback_en.py
new file mode 100644
index 0000000..aff011b
--- /dev/null
+++ b/tools/feedback_en.py
@@ -0,0 +1,386 @@
+"""Natural, accurate English translations for all 376 Bank 5 TEST feedbacks.
+
+Every value uses 1 or 2 lines (separated by `\n`), with each line <= 23 chars
+so it fits cleanly inside the TEST question/feedback box.
+"""
+
+FEEDBACK_EN = {
+ 0x8C48: 'ATARI RUINS YOUR SHAPE.',
+ 0x8C60: 'THIS LOSES ONE POINT.',
+ 0x8C75: 'ATARI, THEN CAPTURED:\nA LOSS.',
+ 0x8C8C: 'TAKEN, THEN ATTACKED.\nNO GOOD.',
+ 0x8CA8: 'PROVERB: CAPTURE THE\nCUTTING STONE.',
+ 0x8CBB: 'CUT IN THE CENTER:\nIMPOSSIBLE.',
+ 0x8CCE: 'BLOCKING THE HANE IS\nCORRECT!',
+ 0x8CF8: 'THE CORNER IS BIGGER\nTHAN THE SIDE.',
+ 0x8D20: 'WHITE HANES OUT. YOU\nFAIL TO SEAL.',
+ 0x8D2C: 'WHITE HAS A CUT, SO\nYOU SEAL THEM IN.',
+ 0x8D47: 'NO NEED TO FIX THIS CUT',
+ 0x8D5D: 'RIGHT CUT, BUT THIS\nLINK IS PASSIVE.',
+ 0x8D8E: 'CONNECTING HERE IS\nGOOD SHAPE.',
+ 0x8DA0: 'GETTING CUT IS A LOSS.',
+ 0x8DAC: 'WHITE LINKS. YOU FAIL\nTO SEAL.',
+ 0x8DBE: 'IT SEALS WHITE, BUT TOO\nLOOSELY.',
+ 0x8DD5: 'KEY SQUEEZE: WHITE\nTAKES, BLACK BLOCKS.',
+ 0x8E05: 'THIS TAKES ONE WHITE.',
+ 0x8E17: 'NO BASE FOR THIS GROUP.',
+ 0x8E28: 'PUSHED THROUGH AND CUT.\nNO GOOD.',
+ 0x8E4D: 'GETTING TAKEN IS BAD.',
+ 0x8E59: 'HANE AT THE HEAD OF TWO\nSTONES!',
+ 0x8E70: 'A TIMID MOVE.',
+ 0x8E7B: 'PULLING BACK IS JOSEKI.\nCORRECT!',
+ 0x8EA5: 'CONNECT RIGHT HERE.',
+ 0x8ED3: 'TRADING WITH SPIRIT!\nCORRECT!',
+ 0x8F04: 'WHITE ESCAPES CAPTURE.',
+ 0x8F12: 'IF WHITE RUNS, BLOCK\nCORNER TO CAPTURE.',
+ 0x8F29: 'WHITE DESCENDS. BLACK\nIS OVEREXTENDED.',
+ 0x8F3B: 'WHITE HANES OUT. BLACK\nIS SPLIT APART.',
+ 0x8F4E: 'EVEN IF CUT, THIS IS\nTHE MOVE.',
+ 0x8F85: 'WHITE HANES. TOO SOFT\nIN THE CORNER.',
+ 0x8F97: 'POOR EYE SHAPE. YOU MAY\nBE ATTACKED.',
+ 0x8FB6: 'RICH EYE SHAPE!',
+ 0x8FC8: 'WHITE EXPANDS INTO GOOD\nSHAPE.',
+ 0x8FDF: 'VITAL POINT! WHITE HAS\nNO CUT EITHER.',
+ 0x8FFC: 'THIS STOPS ANY CUT TOO.',
+ 0x900F: 'WHITE CUTS. ONE OF YOUR\nGROUPS FALLS.',
+ 0x9020: 'NOT CUT, YET SEALED IN.',
+ 0x9032: 'FORCED TO BLOCK: A LOSS',
+ 0x9048: 'TAKE HERE TO LEAVE THE\nEDGE OPEN.',
+ 0x9065: 'TIMID: WHITE BLOCKS FOR\nA LOSS.',
+ 0x907B: 'CORNER SAVED, BUT SIDE\nSTONE IS WASTED.',
+ 0x90A0: 'WHITE CONNECTS. BAD.',
+ 0x90B0: '3-4 ATTACH AND PULL\nBACK JOSEKI.',
+ 0x90C5: 'JOSEKI! CUT AND FIGHT\nIS THE ONLY WAY.',
+ 0x90E7: 'BLACK SPLITS IN TWO:\nA BAD FIGHT.',
+ 0x9106: 'YOUR SIDE STONE IS\nWASTED.',
+ 0x911F: 'CUT INTO A BAD FIGHT.',
+ 0x9132: 'THIS IS THE THICK MOVE.',
+ 0x9146: 'WHITE HANES AT THE HEAD\nOF TWO STONES.',
+ 0x9157: 'CONNECTING STRAIGHT IS\nCORRECT!',
+ 0x917A: 'CUT FOR AN EVEN 2-ON-2\nFIGHT!',
+ 0x9193: "THIS WON'T CUT WHITE.",
+ 0x91A1: 'WRONG CUT: THE TOP CUT\nSTILL REMAINS.',
+ 0x91CC: 'CONNECTING HERE IS\nCORRECT!',
+ 0x91F5: 'FAILING TO TAKE 2 IS A\nLOSS.',
+ 0x920A: 'TOO SOFT IN THE CORNER.',
+ 0x9217: 'NO FEAR OF THE CUT: YOU\nCAN CAPTURE IT.',
+ 0x9230: 'HEAVY AND CLUMSY: BAD.',
+ 0x9259: 'CORRECT!',
+ 0x9262: 'WHITE LINKS AND LIVES.',
+ 0x926E: 'WHITE BLOCKS RIGHT AND\nLIVES.',
+ 0x9285: 'WHITE MAKES A CORNER\nEYE AND LIVES.',
+ 0x9299: 'IF WHITE LINKS, HANE TO\nKILL!',
+ 0x92A9: 'WHITE LINKS AND LIVES.',
+ 0x92CE: 'WHITE CRAWLS IN CORNER.\nBLACK DIES.',
+ 0x92DD: 'WHITE HANES. YOU DIE.',
+ 0x92EA: 'WHITE PLAYS INSIDE.\nYOU DIE.',
+ 0x92F5: 'EYE IN CORNER AND\nCENTER: ALIVE!',
+ 0x930F: 'WHITE ATTACHES AT 3-PT\nKEY. YOU DIE.',
+ 0x9326: 'EYE ON SIDE AND CENTER:\nALIVE!',
+ 0x9340: 'WHITE ATTACHES ON 1ST\nLINE. YOU DIE.',
+ 0x9379: 'WHITE TAKES AND LIVES.',
+ 0x9402: 'EVEN IF WHITE DESCENDS,\nBLACK WINS AND LIVES!',
+ 0x9460: 'WHITE BLOCKS AND LIVES.',
+ 0x94BC: 'WHITE HITS 5-PT NAKADE.\nDEAD.',
+ 0x94DE: 'WHITE IGNORES ATARI AND\nPLAYS CENTER: DEAD.',
+ 0x9525: 'IF WHITE TAKES, A NEW\nTHROW-IN KILLS!',
+ 0x9543: 'EYE IN CENTER AND SIDE:\nALIVE!',
+ 0x9588: 'IF WHITE TAKES, BLOCK\nAND TAKE TO LIVE!',
+ 0x95B7: 'WHITE HITS VITAL POINT.\nYOU DIE.',
+ 0x95CA: 'WHITE PLAYS CENTER. NO\nEYE ON 2ND LINE.',
+ 0x95E4: 'WHITE ATTACHES RIGHT.\nYOU DIE.',
+ 0x95FE: 'IF WHITE ATTACKS EYE,\nATARI TAKES IT!',
+ 0x9623: 'WHITE JUMPS IN. DEAD.',
+ 0x9674: '1ST-LINE ATARI! WHITE\nLIVES.',
+ 0x96A1: 'WHITE BENDS AND LIVES.',
+ 0x96D8: 'IF WHITE SAVES 3, ATARI\nKILLS WHITE!',
+ 0x971A: 'WHITE TAKES ABOVE: BAD.',
+ 0x974D: 'WHITE BLOCKS. TRICKY,\nYET WHITE LIVES.',
+ 0x9788: 'IF WHITE TAKES, 1ST-\nLINE HANE KILLS!',
+ 0x97A4: 'WHITE FALLS TO AN\nOIOTOSHI TRAP!',
+ 0x97BC: 'WHITE LINKS LEFT FOR A\nKO.',
+ 0x97D2: 'WHITE TAKES FROM CORNER\nAND LIVES.',
+ 0x97FE: "WHITE LINKS: IT'S A KO.",
+ 0x9844: 'WHITE PUSHES OUT: ALIVE',
+ 0x98A6: 'GOOD IDEA, BUT WHITE\nLINKS. NO GOOD.',
+ 0x98DB: 'CRAMPED: 3-PT NAKADE\nKILLS YOU.',
+ 0x98F4: 'EYE IN CORNER AND\nCENTER: ALIVE!',
+ 0x990F: 'WHITE DESCENDS. DEAD.',
+ 0x991D: 'IF WHITE DESCENDS, MAKE\nAN EYE TO LIVE!',
+ 0x993F: 'WHITE DESCENDS: FAILED.',
+ 0x9965: 'EITHER WAY, TWO EYES!\nALIVE!',
+ 0x9998: 'CUT INTO DOUBLE ATARI!',
+ 0x99A9: 'IF WHITE TAKES, PLAY\nINSIDE TO KILL!',
+ 0x99C5: 'WHITE TAKES, AND HANE\nHELPS WHITE LIVE.',
+ 0x9A07: 'WHITE LINKS WITH 2 EYES\nAND LIVES.',
+ 0x9A3A: 'WHITE LINKS. NO FOLLOW-\nUP.',
+ 0x9A4D: 'IF WHITE LINKS, WEDGE\nABOVE TO KILL!',
+ 0x9A69: 'WHITE PLAYS DIAGONAL\nAND LIVES.',
+ 0x9A81: 'YOUR 3 STONES IN ATARI:\nNO GOOD.',
+ 0x9AB0: 'ATARI FROM ABOVE KILLS\nYOU EASILY.',
+ 0x9B11: 'TAKE LIKE THIS OR DIE.',
+ 0x9B21: 'WHITE THROWS IN FOR A\nSNAPBACK: DEAD.',
+ 0x9B5D: '1ST-LINE HANE CAUSES\nSHORTAGE: DEAD.',
+ 0x9B82: 'WHITE PLAYS ATARI AND\nKILLS EASILY.',
+ 0x9BA4: 'WHITE ATTACHES FOR\nSHORTAGE: DEAD.',
+ 0x9BC6: "WHITE PLAYS ATARI: IT'S\nA KO.",
+ 0x9BDE: 'WHITE CLAMPS YOU: DEAD.',
+ 0x9C18: '1ST-LINE VITAL POINT:\nDEAD.',
+ 0x9C30: 'WHITE CUTS: NO GOOD.',
+ 0x9C64: 'SPLIT OR MAKE AN EYE:\nALIVE EITHER WAY!',
+ 0x9C99: 'BUILDS FRAMEWORK, BUT\nNO RUSH.',
+ 0x9CB7: 'BIG POINT, NOT URGENT.',
+ 0x9CD0: 'EVEN ON 2ND LINE, THIS\nIS VITAL!',
+ 0x9CE9: 'REDUCES WHITE, BUT A\nBETTER MOVE EXISTS.',
+ 0x9D22: 'IMPORTANT, YET NO RUSH.',
+ 0x9D66: 'GOOD, NOT THE BEST.',
+ 0x9D80: 'NICE EXTENSION, BUT\nANOTHER SPOT IS URGENT.',
+ 0x9DAE: 'AFTER ATTACH, HANE IS\nTHE ONLY MOVE!',
+ 0x9DC9: 'EXPANDS AREA, TOO SMALL',
+ 0x9DE5: 'STOPS 3-3 AND ATTACKS 2\nSTONES: BEST!',
+ 0x9E17: 'BIG MOVE, YET ANOTHER\nSPOT IS URGENT.',
+ 0x9E52: 'NOT URGENT.',
+ 0x9E64: 'VS 3-3 INVASION, THIS\nIS USUAL.',
+ 0x9E90: "NICE, YET IF WHITE\nLINKS, WHO'S STRONGER?",
+ 0x9EB8: 'BIG, WRONG DIRECTION.',
+ 0x9EDB: 'IF WHITE PLAYS HERE,\nBLACK IS TRAPPED.',
+ 0x9F01: 'DEFENDING IS BIG, BUT\nBETTER MOVES EXIST.',
+ 0x9F27: 'BIG, YET BETTER MOVES\nEXIST.',
+ 0x9F46: 'NO RUSH HERE.',
+ 0x9F95: 'TAKE 2 TO ATTACK THE\nOTHER 3!',
+ 0x9FB0: 'WRONG DIRECTION. BETTER\nMOVES EXIST.',
+ 0x9FE0: "IF WHITE PLAYS HERE,\nBLACK'S 3 TURN WEAK.",
+ 0xA00A: 'NICE, BUT NO RUSH.',
+ 0xA01D: "IF WHITE PLAYS HERE,\nBLACK'S 2 TURN WEAK.",
+ 0xA042: 'GREAT MOVE: ATTACKS AND\nDEFENDS!',
+ 0xA05D: 'GOOD SPOT, BUT URGENT\nMOVES COME FIRST.',
+ 0xA076: 'IMPORTANT, YET BETTER\nMOVES EXIST.',
+ 0xA090: "TO HELP BLACK'S 2,\nATTACK FIRST!",
+ 0xA0AF: 'PLAYING HERE MAKES LIFE\nHARD FOR WHITE.',
+ 0xA0C9: 'IF THIS RUNS OUT, WHITE\nFALLS APART!',
+ 0xA0E8: 'IMPORTANT, BUT WRONG\nDIRECTION.',
+ 0xA12C: '3-SPACE BASE FROM 2 IS\nIDEAL BLACK!',
+ 0xA142: 'BETTER MOVE TO\nSTABILIZE.',
+ 0xA181: 'IMPORTANT, TOO SMALL.',
+ 0xA1C9: 'TAKING THIS STONE IS\nTHE BIGGEST MOVE!',
+ 0xA1FF: 'HANE VS ATTACH! ALWAYS\nTHE RIGHT MOVE.',
+ 0xA243: 'DIRECTION IS TOO SMALL.',
+ 0xA2B8: 'THIS PRACTICALLY TAKES\nCORNER WHITE!',
+ 0xA2D6: 'HANE AGAINST ATTACH!',
+ 0xA2E5: 'SOLID LAND, YET BETTER\nMOVES EXIST.',
+ 0xA328: 'SPLITS WHITE, HELPS\nBLACK: BIGGEST!',
+ 0xA37D: 'IMPORTANT, YET ATTACKED\nFIRST.',
+ 0xA39D: 'THIS STABILIZES YOUR 2\nSTONES.',
+ 0xA3B4: 'GOOD TOO, YET BETTER\nMOVES EXIST.',
+ 0xA412: 'IMPORTANT SPOT, YET...',
+ 0xA431: 'THE ONE MOVE TO ATTACK!',
+ 0xA45C: 'WRONG DIRECTION TO PLAY',
+ 0xA470: 'PLAYING THIS CORNER...',
+ 0xA47F: 'NO RUSH FOR 1 STONE.',
+ 0xA494: 'IF WHITE HANES, BLACK\nWEAKENS AT ONCE!',
+ 0xA4B6: 'POOR DIRECTION OF PLAY.',
+ 0xA4EC: 'WHITE BLOCKS. TOO PLAIN',
+ 0xA503: 'TAKEN BY ATARI CHAIN.',
+ 0xA516: 'WHITE TAKES 1: NO GOOD.',
+ 0xA543: '1ST-LINE ATARI: BAD.',
+ 0xA580: 'DIAGONAL ATTACH TAKES\nYOU.',
+ 0xA590: 'WHITE BLOCKS LEFT AND\nTAKES ALL.',
+ 0xA5B8: 'WHITE BLOCKS. NOT DEEP\nENOUGH.',
+ 0xA5CD: 'BRILLIANT TACTIC!\nCORRECT!',
+ 0xA5F9: 'NOT DEEP ENOUGH. WHITE\nLINKS: FAILED.',
+ 0xA619: 'WHITE LIVES IN CORNER.',
+ 0xA673: 'WHITE CUTS AND TAKES\nYOU INSTEAD!',
+ 0xA685: 'GOOD IDEA, BUT WHITE\nLINKS. NO GOOD.',
+ 0xA6A7: 'WHITE BLOCKS AND LINKS.',
+ 0xA6B8: 'WHITE LINKS. YOU LOSE\nBY 1 LIBERTY.',
+ 0xA6C7: 'TRICKY, YET WHITE HANES\nINTO A KO.',
+ 0xA71D: 'WHITE BLOCKS. BLACK\nCANNOT LINK UP.',
+ 0xA736: 'WHITE LINKS. BLACK\nLOSES THE EYE RACE.',
+ 0xA75A: 'GOOD IDEA, BUT WHITE\nLINKS: NO POINT.',
+ 0xA775: 'WHITE LINKS: FAILS.\nBE MORE CLEVER!',
+ 0xA78F: 'GREAT SACRIFICE! WHITE\nTAKES, BLACK MAKES KO!',
+ 0xA7E4: 'WHITE MAKES AN EYE AND\nWINS THE RACE.',
+ 0xA7F8: 'EVEN IF WHITE PASSES,\nBLACK LOSES.',
+ 0xA81B: "BLACK'S 2 IN ATARI:\nFAILED.",
+ 0xA83F: 'WHITE TURNS: NO GOOD.',
+ 0xA88B: 'WHITE THROWS IN AND\nTAKES FOUR!',
+ 0xA8CA: 'WHITE PLAYS ATARI BELOW\nFAILED.',
+ 0xA8E5: "WHITE'S LINK IS TOO\nGOOD: FAILS.",
+ 0xA916: 'WHITE LINKS. NOTHING\nHAPPENS.',
+ 0xA92C: 'WHITE LINKS. BLACK HAS\nNO FOLLOW-UP.',
+ 0xA978: '1ST-LINE BLOCK IN SENTE\nFOR WHITE: LOSS.',
+ 0xA996: 'EVEN IF CUT, LINKING IS\nSAFE!',
+ 0xA9AE: 'STEP THIS FAR TO TAKE!',
+ 0xA9C5: 'WHITE LINKS. CANNOT\nTAKE 1 STONE.',
+ 0xA9F8: 'TIMID: WHITE LINKS FOR\nA LOSS.',
+ 0xAA0D: 'WHITE PULLS BACK: LOSES\n1 PT VS BEST.',
+ 0xAA23: 'WHITE HAS A 1ST-LINE\nJUMP DEFENSE.',
+ 0xAA41: 'STEP THIS DEEP WITHOUT\nBEING TAKEN!',
+ 0xAA56: 'WHITE DESCENDS. LOST\nFOR NOTHING.',
+ 0xAA68: 'MAKE 2 STONES, THEN\nSACRIFICE: CORRECT!',
+ 0xAA95: 'THROW-IN! YOU LOSE THE\nEYE RACE.',
+ 0xAAAD: 'WHEN WHITE TAKES, LINK\nLEFT FOR MOST GAIN!',
+ 0xAADA: 'ATARI! LOSES 2 POINTS.',
+ 0xAAEE: 'WHITE GETS AN EYE: LOSS',
+ 0xAAFD: 'BRING THIS STONE BACK\nSAFELY!',
+ 0xAB0E: 'YOUR STONE GETS TAKEN:\nA LOSS.',
+ 0xAB26: 'YOUR STONE ESCAPES\nSAFELY!',
+ 0xAB38: 'WHITE PULLS BACK. LOST\nFOR NOTHING.',
+ 0xAB54: 'WHITE BLOCKS: FAILED.',
+ 0xAB6D: 'WHITE BLOCKS. YOU END\nIN GOTE.',
+ 0xAB7F: "WHITE DESCENDS. BLACK'S\nEDGE IS OPEN.",
+ 0xABA4: 'SACRIFICE TO FORCE TO\nTHE 1ST LINE!',
+ 0xABBE: 'TAKEN FROM 1ST LINE:\nNO GOOD.',
+ 0xABF9: 'GREAT MOVE IN SENTE!',
+ 0xAC0C: 'WHITE BLOCKS: A LOSS.',
+ 0xAC1E: 'IF WHITE TAKES, DESCEND\nAND ESCAPE!',
+ 0xAC3A: "WHITE'S EMPTY TRIANGLE\nCOSTS POINTS.",
+ 0xAC5E: 'WHITE TURNS: SENTE, YET\nNO GAIN.',
+ 0xAC79: 'WHITE PULLS BACK. NOT\nDEEP ENOUGH.',
+ 0xACC8: "WHITE'S 1ST-LINE\nDIAGONAL: A LOSS.",
+ 0xACE8: 'GOOD IDEA, BLOCKED\nRIGHT: LOST FOR NOTHING',
+ 0xAD10: 'IF WHITE TAKES ABOVE,\n1ST-LINE ATARI WINS!',
+ 0xAD30: 'LEFT ATARI TAKES YOU.',
+ 0xAD4D: 'WHITE PULLS UP: FAILED.',
+ 0xAD84: 'WHITE HANES ON 1ST LINE\nYOU LOSE.',
+ 0xAD96: "WHITE ATTACHES ON 1ST\nLINE: IT'S A KO.",
+ 0xADCD: "WHITE TAKES: IT'S SEKI.",
+ 0xADDE: 'WHITE BLOCKS. YOU LOSE.',
+ 0xADF0: 'IF WHITE PUSHES OUT,\nLINK UNDER AND WIN!',
+ 0xAE02: 'WHITE TURNS ON 2ND LINE\nYOU LOSE.',
+ 0xAE14: 'ATARI FROM 4-STONE SIDE\nYOU LOSE.',
+ 0xAE2C: 'IF WHITE HANES RIGHT,\nHANE LEFT AND WIN!',
+ 0xAE55: 'DESCENDING GETS HANED.\nYOU LOSE.',
+ 0xAE6D: 'IF WHITE TAKES, 1ST-\nLINE ATARI WINS!',
+ 0xAE85: 'WHITE LINKS: 4 VS 3,\nYOU LOSE BY ONE.',
+ 0xAEAB: 'GOOD IDEA, NOT DEEP\nENOUGH.',
+ 0xAEE3: 'EITHER REPLY, ATARI\nCAPTURES THEM!',
+ 0xAEFD: 'RIGHT TACTIC, YET MAY\nEND IN GOTE.',
+ 0xAF1E: 'IF WHITE BLOCKS BELOW,\nCUT ABOVE AND TAKE!',
+ 0xAF3B: "WHITE'S 2 ESCAPE. NO\nMOVE LEFT.",
+ 0xAF54: 'GREAT MOVE! TAKE ONE\nSIDE OR THE OTHER.',
+ 0xAF6D: 'CAPTURED: LOSES 2 PTS.',
+ 0xAFA6: "GUARDS AGAINST WHITE'S\nRIGHT HANE!",
+ 0xAFCE: 'WHITE ESCAPES. NO POINT',
+ 0xAFDF: 'NOW CUT AND CAPTURE\nEITHER SIDE!',
+ 0xAFF4: 'LEFT ATARI: NO GOOD.',
+ 0xB017: "IF WHITE TAKES, IT'S KO",
+ 0xB034: 'IF WHITE LINKS RIGHT,\nBLACK PUSHES ABOVE!',
+ 0xB05A: 'WHITE LINKS. EVEN IF\nBLACK PUSHES, A LOSS.',
+ 0xB083: 'TAKE ON LINE 3, LINE 2\nATARI CONNECTS!',
+ 0xB0A5: 'WHITE PULLS BACK: ZERO.',
+ 0xB0EE: 'WHITE MUST TAKE 1, THEN\n1ST-LINE SQUEEZE WINS!',
+ 0xB12A: 'TOP AND BOTTOM STONES\nGROW WEAK.',
+ 0xB13E: 'THESE 4 ARE SMALL.',
+ 0xB148: 'ATTACKING IS BIG, YET\nBETTER MOVES EXIST.',
+ 0xB163: 'STILL TOO SMALL.',
+ 0xB17D: 'GOOD SHAPE, TOO SMALL.',
+ 0xB1AD: 'SAVES 1, TOO SMALL.',
+ 0xB1D5: 'THIS IS TOO SMALL.',
+ 0xB203: 'CUTTING TRAPS THE TOP 2\nSTONES!',
+ 0xB225: 'GOOD INVASION, YET\nBETTER MOVES EXIST.',
+ 0xB253: 'IMPORTANT, YET NOT\nATTACK OR DEFENSE.',
+ 0xB276: "ROBS WHITE'S GROUP OF\nEYE SPACE!",
+ 0xB296: 'SLIDING HERE STABILIZES\nBLACK: HUGE!',
+ 0xB2B9: 'IMPORTANT, YET ONLY\nTERRITORY.',
+ 0xB2D5: 'NO WORRY IF THESE 2 RUN',
+ 0xB2F2: 'A GOOD JUMP, YET...',
+ 0xB313: 'ONLY LAND: TOO SMALL.',
+ 0xB33F: 'VITAL SPOT! NEXT AIM\nFOR A KNIGHT PEEP.',
+ 0xB364: 'SURE AND SOLID: WHITE\nCANNOT MOVE OUT.',
+ 0xB380: 'WHITE LINKS UNDERNEATH.',
+ 0xB390: 'A GREAT SQUEEZE TACTIC!',
+ 0xB3AE: 'WHITE PUSHES OUT. YOU\nARE SPLIT APART.',
+ 0xB3C3: "ATTACKS 5 AND GROWS\nBLACK'S AREA!",
+ 0xB3E9: '3RD-LINE ATARI IS BAD.',
+ 0xB41E: 'NO NEED TO RUN HERE.',
+ 0xB432: 'ATTACKING THE 2 IS\nBIGGEST!',
+ 0xB473: 'GROWING BLACK BEATS\nREDUCING WHITE.',
+ 0xB4B5: 'THIS 1 STONE IS SMALL.',
+ 0xB4E1: 'DEFENDING IS BIG, YET\nURGENT SPOTS WAIT.',
+ 0xB50C: 'THESE 3 CAN BE GIVEN UP',
+ 0xB523: 'LINKING HERE IS THE\nTHICKEST MOVE!',
+ 0xB53C: 'EXPANDING HERE IS THE\nBIGGEST MOVE!',
+ 0xB558: 'BLACK IS STRONG AROUND\nIT. NO WORRY!',
+ 0xB588: "WHITE TAKES: IT'S A KO.",
+ 0xB5B9: 'WHITE HITS KEY. NO EYE\nBY TAKING 2.',
+ 0xB5EC: 'WHITE CRAWLS UNDER: DIE',
+ 0xB5F8: 'IF WHITE TAKES, CUT FOR\nOIOTOSHI!',
+ 0xB617: "THESE 2 DON'T AFFECT\nEYES.",
+ 0xB62B: 'NEXT, BREAK SIDE EYE TO\nKILL!',
+ 0xB644: 'WHITE MAKES CENTER EYE.',
+ 0xB657: 'EVEN BLOCKED, ATTACH AT\n2-2 TO KILL!',
+ 0xB67D: 'WHITE TIGER-LINKS: LIVE',
+ 0xB69A: 'DIAGONAL ATTACH: ALIVE.',
+ 0xB6CE: 'WHITE BLOCKS AND LIVES.',
+ 0xB6E7: 'WHITE DESCENDS RIGHT:\nNO GOOD.',
+ 0xB713: 'EVEN LINKED, DROP RIGHT\nTO WIN!',
+ 0xB730: 'WHITE LINKS. CANNOT\nFILL LIBERTIES.',
+ 0xB742: 'IF WHITE RUNS, BLOCK\nABOVE TO WIN!',
+ 0xB75F: 'STOPS LINK, TOO PASSIVE',
+ 0xB77F: 'STOPS LINK WITH RICH\nEYE SHAPE!',
+ 0xB79A: 'WHITE PLAYS A TWO-WAY\nPINCER.',
+ 0xB7B1: 'ATTACK FIRST HERE!',
+ 0xB7C6: 'WHITE EXTENDS. YOUR\nWALL LOSES POWER.',
+ 0xB7DE: 'ATTACKS AND USES WALL:\n2 BIRDS, 1 STONE!',
+ 0xB801: 'GREAT MOVE AIMING AT\nLOWER-RIGHT 3!',
+ 0xB81B: 'THIS SETTLES BLACK!',
+ 0xB831: 'IMPORTANT, YET RIGHT\nSIDE IS BIGGER.',
+ 0xB882: 'WHITE HANES YOUR HEAD.\nTOP WHITE GROWS.',
+ 0xB8A6: 'WHITE HANES HEAD OF 2:\nNOT GOOD.',
+ 0xB8CF: 'IF WHITE PLAYS HERE,\nTWO WEAK GROUPS FORM.',
+ 0xB8ED: 'SAVES CORNER, YET\nURGENT SPOTS WAIT.',
+ 0xB913: 'BIG, YET AN IMPORTANT\nSPOT REMAINS.',
+ 0xB932: 'ATTACKS AND DEFENDS AT\nONCE!',
+ 0xB944: 'WHITE ESCAPES. TOO MUCH',
+ 0xB954: 'WRONG DIRECTION. A BIT\nOVEREXTENDED.',
+ 0xB96E: 'PINCERING TO ATTACK IS\nCORRECT!',
+ 0xB997: 'FIRST, CUT RIGHT HERE!',
+ 0xB9AC: 'WHITE LINKS. YOU GET\nCUT ONE-SIDEDLY.',
+ 0xB9C2: 'LINKING THIS WAY LEAVES\nONLY ONE CUT!',
+ 0xB9DA: 'LINKING THIS WAY LEAVES\nTWO CUTS LATER.',
+ 0xB9FA: 'WHITE WEDGES AND LINKS.\nBLACK SUFFERS.',
+ 0xBA0E: "CREATES A CUT IN\nWHITE'S SHAPE!",
+ 0xBA24: 'WHITE LINKS FOR EVEN\nSHAPE.',
+ 0xBA38: 'ATARI, THEN WHITE\nEXTENDS THICKLY.',
+ 0xBA5D: 'CUT IS A LADDER! SAFE.',
+ 0xBA73: 'WHITE BLOCKS AND GROWS\nVERY THICK.',
+ 0xBA87: 'WHITE BLOCKS. CRAMPED!',
+ 0xBA97: 'SPLITTING LIKE THIS IS\nCORRECT!',
+ 0xBAB8: 'CUTTING HERE DOES NOT\nPRESSURE WHITE.',
+ 0xBADA: 'CORNER WHITE LIVES\nEASILY.',
+ 0xBAEA: 'PLAYING BOLDLY IS\nCORRECT!',
+ 0xBB0D: 'WHITE EXTENDS STRONGLY.\nBAD SHAPE.',
+ 0xBB4B: 'WHITE CUTS. ONE GROUP\nFALLS.',
+ 0xBB5D: 'CONNECTED, YET ZERO\nPRESSURE ON WHITE.',
+ 0xBB96: 'SAVES CORNER, LEAVES A\nBAD CUT.',
+ 0xBBC9: 'WHITE LINKS. CUT INTO A\nBAD FIGHT.',
+ 0xBBE4: 'WHITE FORCES ATARI AND\nLINKS: NO GOOD.',
+ 0xBC22: 'SLIGHTLY TIMID MOVE.',
+ 0xBC34: "USUAL REPLY VS WHITE'S\nDIAGONAL.",
+ 0xBC4C: 'WHITE HANES BELOW: SOFT',
+ 0xBC5E: 'WHITE LINKS. YOUR SIDE\nSTONE IS WASTED.',
+ 0xBC74: 'WHITE LINKS INTO A\nTOUGH FIGHT.',
+ 0xBC85: 'SPLITS WHITE APART!',
+ 0xBCB1: 'IF WHITE HANES OUT, CUT\nSAFELY!',
+ 0xBD04: 'CONNECTED, YET ZERO\nPRESSURE ON WHITE.',
+ 0xBD37: 'WHITE BLOCKS THE OTHER\nSIDE: TOUGH.',
+ 0xBDA3: 'LEAVES AWKWARD SHAPE.',
+ 0xBDC3: 'TOO HEAVY AND PASSIVE.',
+ 0xBDDB: 'MOST ACTIVE CONNECTION!',
+ 0xBDF5: 'FORCED ATARI: A LOSS.',
+ 0xBE07: 'SAFE, SOLID DEFENSE!',
+ 0xBE20: 'WHITE HANES OUT INTO A\nTOUGH FIGHT.',
+ 0xBE82: 'BLACK LINKS, AND WHITE\nIS LEFT THIN!',
+ 0xBEA5: 'WHITE HANES OUT AND\nCUTS YOU.',
+ 0xBEB8: 'WHITE FORCES ATARI AND\nSEALS EDGE IN SENTE.',
+ 0xBED5: "LEAVES WHITE'S RIGHT\nEDGE WIDE OPEN!",
+ 0xBEF0: 'COUNTERATTACKING HERE\nIS CORRECT!',
+ 0xBF0D: 'TIMID! WHITE CRAWLS\nUNDER: BIG LOSS.',
+ 0xBF24: 'WHITE EXTENDS FOR HUGE\nTHICKNESS.',
+ 0xBF46: 'WHITE LINKS. YOU ARE\nSPLIT APART.',
+ 0xBF62: 'WHITE LINKS. YOU CANNOT\nCONNECT.',
+ 0xBF80: 'WHITE LINKS: BAD MOVE.',
+}
+
+assert len(FEEDBACK_EN) == 376
diff --git a/tools/font8.py b/tools/font8.py
new file mode 100644
index 0000000..fb2f384
--- /dev/null
+++ b/tools/font8.py
@@ -0,0 +1,62 @@
+"""Crisp 5x7 bitmap font, centred in an 8x8 cell."""
+
+P = {
+'A':"01110 10001 10001 11111 10001 10001 10001",
+'B':"11110 10001 10001 11110 10001 10001 11110",
+'C':"01110 10001 10000 10000 10000 10001 01110",
+'D':"11110 10001 10001 10001 10001 10001 11110",
+'E':"11111 10000 10000 11110 10000 10000 11111",
+'F':"11111 10000 10000 11110 10000 10000 10000",
+'G':"01110 10001 10000 10111 10001 10001 01110",
+'H':"10001 10001 10001 11111 10001 10001 10001",
+'I':"11111 00100 00100 00100 00100 00100 11111",
+'J':"00111 00010 00010 00010 00010 10010 01100",
+'K':"10001 10010 10100 11000 10100 10010 10001",
+'L':"10000 10000 10000 10000 10000 10000 11111",
+'M':"10001 11011 10101 10101 10001 10001 10001",
+'N':"10001 11001 10101 10011 10001 10001 10001",
+'O':"01110 10001 10001 10001 10001 10001 01110",
+'P':"11110 10001 10001 11110 10000 10000 10000",
+'Q':"01110 10001 10001 10001 10101 10010 01101",
+'R':"11110 10001 10001 11110 10100 10010 10001",
+'S':"01111 10000 10000 01110 00001 00001 11110",
+'T':"11111 00100 00100 00100 00100 00100 00100",
+'U':"10001 10001 10001 10001 10001 10001 01110",
+'V':"10001 10001 10001 10001 10001 01010 00100",
+'W':"10001 10001 10001 10101 10101 11011 10001",
+'X':"10001 10001 01010 00100 01010 10001 10001",
+'Y':"10001 10001 01010 00100 00100 00100 00100",
+'Z':"11111 00001 00010 00100 01000 10000 11111",
+'0':"01110 10001 10011 10101 11001 10001 01110",
+'1':"00100 01100 00100 00100 00100 00100 01110",
+'2':"01110 10001 00001 00010 00100 01000 11111",
+'3':"11111 00010 00100 00010 00001 10001 01110",
+'4':"00010 00110 01010 10010 11111 00010 00010",
+'5':"11111 10000 11110 00001 00001 10001 01110",
+'6':"00110 01000 10000 11110 10001 10001 01110",
+'7':"11111 00001 00010 00100 01000 01000 01000",
+'8':"01110 10001 10001 01110 10001 10001 01110",
+'9':"01110 10001 10001 01111 00001 00010 01100",
+'.':"00000 00000 00000 00000 00000 00110 00110",
+',':"00000 00000 00000 00000 00110 00110 01100",
+'!':"00100 00100 00100 00100 00100 00000 00100",
+'?':"01110 10001 00001 00010 00100 00000 00100",
+'-':"00000 00000 00000 11111 00000 00000 00000",
+"'":"00100 00100 01000 00000 00000 00000 00000",
+'(':"00010 00100 01000 01000 01000 00100 00010",
+')':"01000 00100 00010 00010 00010 00100 01000",
+':':"00000 00110 00110 00000 00110 00110 00000",
+'/':"00001 00010 00010 00100 01000 01000 10000",
+'<':"00010 00100 01000 10000 01000 00100 00010",
+'>':"01000 00100 00010 00001 00010 00100 01000",
+' ':"00000 00000 00000 00000 00000 00000 00000",
+}
+
+def glyph(ch):
+ rows = P.get(ch.upper(), P[' ']).split()
+ out = [[0] * 8 for _ in range(8)]
+ for y, row in enumerate(rows):
+ for x, bit in enumerate(row):
+ if bit == '1':
+ out[y][x + 1] = 1
+ return out
diff --git a/tools/make_book.py b/tools/make_book.py
new file mode 100644
index 0000000..cb05c3a
--- /dev/null
+++ b/tools/make_book.py
@@ -0,0 +1,192 @@
+#!/usr/bin/env python3
+"""Build the English book intro (screen 11) and lesson menu (screen 12).
+
+The book pages are 1024-byte nametable+attribute screens stored
+RLE-compressed in PRG bank 3. This module decompresses the originals,
+adds an English 8x8 font to a copy of the 16x16 book CHR bank, rewrites
+the text, and recompresses the screens.
+"""
+import os, sys
+from PIL import Image
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+from font8 import glyph
+
+HERE = os.path.dirname(os.path.abspath(__file__))
+ROM = os.path.join(HERE, '..', 'roms', 'original', 'Famicom Igo Nyuumon (Japan).nes')
+CHR_OFF = 16 + 8 * 16384
+SCREEN_TABLE = 0xC892 - 0xC000
+SCREENS = {11: 0x1256, 12: 0x148D} # compressed offsets in PRG bank 3
+
+def load():
+ d = open(ROM, 'rb').read()
+ prg = d[16:16 + 8 * 16384]
+ chr_ = d[CHR_OFF:]
+ return d, prg, chr_
+
+def decompress(b3, off):
+ out = bytearray(); i = off
+ while True:
+ c = b3[i]; i += 1
+ if c == 0: break
+ n = 0x80 - (c & 0x7F)
+ if c & 0x80:
+ out.extend([b3[i]] * n); i += 1
+ else:
+ out.extend(b3[i:i + n]); i += n
+ return bytes(out), i
+
+def compress(data):
+ """Optimal RLE for the $C6C2 loader.
+
+ Control c (0x80..0xFF) repeats the next byte 0x80-(c&0x7F) times;
+ control c (0x01..0x7F) copies 0x80-c literal bytes; 0 ends.
+ """
+ n = len(data)
+ INF = 10 ** 9
+ dp = [INF] * (n + 1)
+ choice = [None] * (n + 1)
+ dp[n] = 1 # terminator
+ for i in range(n - 1, -1, -1):
+ # literal run
+ lim = min(127, n - i)
+ for l in range(1, lim + 1):
+ cost = 1 + l + dp[i + l]
+ if cost < dp[i]:
+ dp[i] = cost; choice[i] = ('lit', l)
+ # repeat run
+ j = i + 1
+ while j < n and data[j] == data[i] and j - i < 128:
+ j += 1
+ for l in range(1, j - i + 1):
+ cost = 2 + dp[i + l]
+ if cost < dp[i]:
+ dp[i] = cost; choice[i] = ('rep', l)
+ out = bytearray(); i = 0
+ while i < n:
+ kind, l = choice[i]
+ if kind == 'lit':
+ out.append(0x80 - l); out.extend(data[i:i + l])
+ else:
+ out.append(0x80 | (0x80 - l)); out.append(data[i])
+ i += l
+ out.append(0)
+ return bytes(out)
+
+CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-'():/"
+
+def make_font_bank(chr_):
+ """Copy CHR 4K bank 1 (book font) and add ASCII at free tile codes."""
+ bank = bytearray(chr_[1 * 4096:2 * 4096])
+ # Free tile codes computed from the intro/menu border tiles. These
+ # do not appear outside the replaced text areas.
+ free = [0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
+ 0x16,0x17,0x18,0x19,0x1a,0x1b,0x26,0x27,0x28,0x29,0x2a,0x2b,0x36,0x37,0x38,0x39,
+ 0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,
+ 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,
+ 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,
+ 0x70,0x71,0x72,0x73,0x74,0x75,0x7f,0x80,0x81,0x82,0x83,0x84,0x85,0x8f,0xa0,0xa1,
+ 0xa2,0xa3,0xa4,0xa5,0xa6,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,
+ 0xba,0xbb,0xbc,0xbd,0xbe,0xbf,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,
+ 0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,
+ 0xda,0xdb,0xdc,0xdd,0xde,0xdf,0xe0,0xe1,0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,
+ 0xea,0xeb,0xec,0xed,0xee,0xef,0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,
+ 0xfa,0xfb,0xfc,0xff]
+ codes = dict(zip(CHARS, free))
+ for ch, code in codes.items():
+ g = glyph(ch)
+ for y in range(8):
+ mask = 0
+ for x in range(8):
+ if g[y][x]: mask |= 1 << (7 - x)
+ # Book-font tiles are solid colour 3 with colour-0 glyph
+ # pixels carved out (the page palette makes colour 0 white
+ # and colour 3 black).
+ inv = 0xFF ^ mask
+ bank[code * 16 + y] = inv
+ bank[code * 16 + 8 + y] = inv
+ return bank, codes
+
+def clear(nt, x0, y0, x1, y1):
+ for y in range(y0, y1 + 1):
+ for x in range(x0, x1 + 1):
+ nt[y * 32 + x] = 0xFE
+
+def put(nt, x, y, s, codes):
+ for i, ch in enumerate(s):
+ if ch != ' ':
+ nt[y * 32 + x + i] = codes[ch]
+
+def putv(nt, x, y, s, codes):
+ for i, ch in enumerate(s):
+ if ch != ' ':
+ nt[(y + i) * 32 + x] = codes[ch]
+
+def build():
+ raw, prg, chr_ = load()
+ b3 = prg[3 * 16384:4 * 16384]
+ bank9, codes = make_font_bank(chr_)
+
+ # intro / course menu (screen 11)
+ # The Japanese page is a nested menu: EXIT, ADVANCED and BASICS are
+ # three selectable vertical entries on the left. Earlier builds
+ # replaced the whole menu with prose, which is why the English version
+ # jumped straight to the eight basic lessons. Keep the original entry
+ # columns so the game's cursor and selection code still work.
+ intro, _ = decompress(b3, SCREENS[11])
+ intro = bytearray(intro[:1024])
+ clear(intro, 3, 3, 13, 24)
+ clear(intro, 17, 3, 28, 24)
+ # These columns match the original label columns and the cursor sprite:
+ # EXIT -> $04-$05, ADVANCED -> $07-$08, BASICS -> $0A-$0B.
+ putv(intro, 5, 6, "EXIT", codes)
+ putv(intro, 8, 6, "ADVANCED", codes)
+ putv(intro, 11, 6, "BASICS", codes)
+ for y, s in enumerate(["RULES BOOK", "BY SEIMOKU", "", "CHOOSE A",
+ "COURSE.", "", "PRESS A."]):
+ put(intro, 17, 4 + y * 2, s, codes)
+
+ # menu
+ menu, _ = decompress(b3, SCREENS[12])
+ menu = bytearray(menu[:1024])
+ # Keep the original 4 3 2 1 row: those are the bold numeral tiles.
+ # The old build replaced them with the thinner English font digits,
+ # which is why 1-4 looked lighter than 5-8.
+ clear(menu, 3, 5, 13, 13)
+ clear(menu, 13, 4, 13, 4) # remove stray 'ル' header tile beside '1'
+ clear(menu, 3, 16, 13, 22)
+ clear(menu, 17, 4, 28, 16)
+ # Page-turn option at the original left-hand column.
+ putv(menu, 3, 6, "NEXT", codes)
+ putv(menu, 5, 6, "MOVE", codes) # 4
+ putv(menu, 7, 6, "TAKE", codes) # 3
+ putv(menu, 9, 6, "PLACE", codes) # 2
+ putv(menu, 11, 6, "RULES", codes) # 1
+ putv(menu, 5, 17, "END", codes) # 8
+ putv(menu, 7, 17, "LAND", codes) # 7
+ putv(menu, 9, 17, "LIFE", codes) # 6
+ putv(menu, 11, 17, "KO", codes) # 5
+ for y, s in enumerate(["LESSONS", "CHOOSE ONE", "BY SEIMOKU", "PRESS A"]):
+ put(menu, 17, 4 + y * 2, s, codes)
+
+ ci = compress(intro)
+ cm = compress(menu)
+ print('intro compressed', len(ci), 'original', SCREENS[11] and 567)
+ print('menu compressed', len(cm), 'original 611')
+ return bytes(intro), ci, bytes(menu), cm, bytes(bank9)
+
+def render(data, bank, fn):
+ img = Image.new('RGB', (256, 240), (0, 0, 0)); px = img.load()
+ pal = [(255, 255, 255), (170, 170, 170), (85, 85, 85), (0, 0, 0)]
+ for r in range(30):
+ for c in range(32):
+ t = data[r * 32 + c]
+ base = t * 16
+ for y in range(8):
+ lo = bank[base + y]; hi = bank[base + 8 + y]
+ for x in range(8):
+ v = ((lo >> (7 - x)) & 1) | (((hi >> (7 - x)) & 1) << 1)
+ px[c * 8 + x, r * 8 + y] = pal[v]
+ img.save(fn)
+
+if __name__ == '__main__':
+ build()
diff --git a/tools/quiz_en.json b/tools/quiz_en.json
new file mode 100644
index 0000000..1f8fadf
--- /dev/null
+++ b/tools/quiz_en.json
@@ -0,0 +1,1277 @@
+[
+ {
+ "addr": 42977,
+ "ja": "3せんと 4せんの まじわる せんを [29][59][E2]こもく[E3]と いいます。",
+ "en": "THE INTERSECTION OF THE 3RD AND 4TH LINES IS CALLED KOMOKU."
+ },
+ {
+ "addr": 43012,
+ "ja": "きあいまけを すると <80>゛<92>です。",
+ "en": "A FORCING MOVE IS USED HERE."
+ },
+ {
+ "addr": 43031,
+ "ja": "2[59]の あたまの きゅうしょです。",
+ "en": "THE VITAL POINT AT THE HEAD OF 2-9."
+ },
+ {
+ "addr": 43050,
+ "ja": "白からの でぎりを どう まも[AF]たら よいでしょうか[27]",
+ "en": "HOW SHOULD WHITE DEFEND THE DE-GIRI?"
+ },
+ {
+ "addr": 43082,
+ "ja": "すこし むずかしいですが きゅうしょを おぼえてください。",
+ "en": "IT IS A LITTLE HARD, BUT REMEMBER THE VITAL POINT."
+ },
+ {
+ "addr": 43117,
+ "ja": "きれ[59]の つぎかたです。",
+ "en": "HOW TO CONNECT A CUT."
+ },
+ {
+ "addr": 43132,
+ "ja": "ほしの きほんじょうせきです。",
+ "en": "A BASIC STAR-POINT JOSEKI."
+ },
+ {
+ "addr": 43150,
+ "ja": "おうようの きく ふうさの <90>すじです。",
+ "en": "A FUSEKI LINE WITH GOOD APPLICATION."
+ },
+ {
+ "addr": 43173,
+ "ja": "石の あんていを はかる1<90>です。",
+ "en": "A MOVE THAT SECURES STONE STABILITY."
+ },
+ {
+ "addr": 43192,
+ "ja": "でられて きられないように。",
+ "en": "SO THAT YOU CANNOT BE CUT OFF."
+ },
+ {
+ "addr": 43208,
+ "ja": "よく でてくる かくげんの <90>です。",
+ "en": "A COMMON KAKUGEN MOVE."
+ },
+ {
+ "addr": 43230,
+ "ja": "よく できる じょうせきです。",
+ "en": "A COMMON JOSEKI."
+ },
+ {
+ "addr": 43249,
+ "ja": "どこを <82><F2>だら よいでしょうか[27]",
+ "en": "WHERE SHOULD YOU PLAY?"
+ },
+ {
+ "addr": 43270,
+ "ja": "すみで いきるのでは し[AF]ぱいです。",
+ "en": "LIVING IN THE CORNER IS HARD."
+ },
+ {
+ "addr": 43293,
+ "ja": "すみの1[68]を かくじつに と[AF]てください。",
+ "en": "BE SURE TO CAPTURE THE CORNER STONE."
+ },
+ {
+ "addr": 43317,
+ "ja": "ぜ[AF]たいの 1<90>です。",
+ "en": "THE ABSOLUTE ONE-MOVE."
+ },
+ {
+ "addr": 43331,
+ "ja": "黒は どこを まも[AF]たら よいでしょうか[27]",
+ "en": "WHERE SHOULD BLACK DEFEND?"
+ },
+ {
+ "addr": 43355,
+ "ja": "つぎかたですが、 だんりょくの ある<90>は どれでしょう[27]",
+ "en": "WHICH MOVE HAS THE MOST FLEXIBILITY?"
+ },
+ {
+ "addr": 43390,
+ "ja": "あいてに よいかたちを あたえないように。",
+ "en": "DO NOT GIVE YOUR OPPONENT A GOOD SHAPE."
+ },
+ {
+ "addr": 43412,
+ "ja": "<F7><98>が きになりますが つよい<90>を う[AF]てください。",
+ "en": "THE PUSH IS TEMPTING, BUT PLAY THE STRONGER MOVE."
+ },
+ {
+ "addr": 43442,
+ "ja": "1[68]の とりかたです。",
+ "en": "HOW TO CAPTURE ONE STONE."
+ },
+ {
+ "addr": 43455,
+ "ja": "じょうせきです。つよく たたかいましょう。",
+ "en": "A JOSEKI. FIGHT STRONGLY."
+ },
+ {
+ "addr": 43479,
+ "ja": "むだな石が でないように。",
+ "en": "AVOID MAKING USELESS STONES."
+ },
+ {
+ "addr": 43496,
+ "ja": "ちゅうおうを てあつく うちましょう。",
+ "en": "PLAY THICKLY IN THE CENTER."
+ },
+ {
+ "addr": 43516,
+ "ja": "どの きれ[59]を つぐのが よいでしょうか。",
+ "en": "WHICH CUT SHOULD YOU CONNECT?"
+ },
+ {
+ "addr": 43542,
+ "ja": "よわい石が 2たい1では、 たたかいは ふりです。",
+ "en": "WITH TWO WEAK GROUPS AGAINST ONE, THE FIGHT IS BAD."
+ },
+ {
+ "addr": 43571,
+ "ja": "どの きれ[59]を どうつぐか、です。",
+ "en": "WHICH CUT SHOULD YOU CONNECT, AND HOW?"
+ },
+ {
+ "addr": 43593,
+ "ja": "ほしに さんさん[E2]3せんと 3せんが まじわる せん[E3]に はい[AF]た じょうせきです。",
+ "en": "HOSHINI SANSAN 3 SEN AND 3 SEN ARE MIXED WITH SEN YES IT'S JOSEKI."
+ },
+ {
+ "addr": 43640,
+ "ja": "あとから ついていく<90>は、 あまり よくありません。",
+ "en": ", WHICH FOLLOWS LATER, IS NOT VERY GOOD."
+ },
+ {
+ "addr": 43667,
+ "ja": "かくじつに いきてください。",
+ "en": "PLEASE GO TO THE TRUTH."
+ },
+ {
+ "addr": 43684,
+ "ja": "れいせいな 1<90>で ころせます。",
+ "en": "YOU CAN KILL IT WITH REISEINA 1."
+ },
+ {
+ "addr": 43702,
+ "ja": "じ[AF]せんで よくできます。 かくじつに ころしてください。",
+ "en": "IT WORKS WELL WITH THE SAME . PLEASE TAKE CARE OF IT."
+ },
+ {
+ "addr": 43737,
+ "ja": "じ[AF]せんで よくできる かたちです。",
+ "en": "THIS IS A SHAPE THAT CAN BE EASILY CREATED USING THE SAME ."
+ },
+ {
+ "addr": 43760,
+ "ja": "かんたんですが よくばると し[AF]ぱいします。",
+ "en": "IT'S EASY, BUT IF YOU LOOK CLOSELY, WILL BE TOO HOT."
+ },
+ {
+ "addr": 43787,
+ "ja": "かんたんです。かくじつな 2[18]を もつ<90>は[27]",
+ "en": "IT'S EASY. WITH 2 IS"
+ },
+ {
+ "addr": 43812,
+ "ja": "かくじつに いきる 1<90>は[27]",
+ "en": "ACTUALLY LIVING 1 IS"
+ },
+ {
+ "addr": 43828,
+ "ja": "<FA><F3>に しないように。",
+ "en": "DO NOT USE ."
+ },
+ {
+ "addr": 43840,
+ "ja": "いきているようですが、 <80>゛<92>づまりで ころせます。",
+ "en": "IT SEEMS TO BE WORKING FINE, BUT IT GETS STUCK IN ゛ AND FALLS DOWN."
+ },
+ {
+ "addr": 43871,
+ "ja": "なかの白1[68]が みかたにな[AF]て いきます。",
+ "en": "NAKA NO SHIRO 1 WILL TURN TO MIKATA ."
+ },
+ {
+ "addr": 43894,
+ "ja": "すみは とくべつな ところです。",
+ "en": "THE CORNER IS A SPECIAL PLACE."
+ },
+ {
+ "addr": 43913,
+ "ja": "いがいな<90>です。",
+ "en": "THIS IS IGAINA ."
+ },
+ {
+ "addr": 43924,
+ "ja": "むずかしく かんがえないで <80>゛<92>づまりを ねらいます。",
+ "en": "AIM FOR ゛ CLUTTER WITHOUT THINKING TOO HARD."
+ },
+ {
+ "addr": 43957,
+ "ja": "2[68]の とりかたです。",
+ "en": "THIS IS HOW TO DO 2."
+ },
+ {
+ "addr": 43970,
+ "ja": "<FA><F3>に されないように。",
+ "en": "AVOID BEING EXPOSED TO ."
+ },
+ {
+ "addr": 43983,
+ "ja": "すこし むずかしいですが、 すて石を つかいます。",
+ "en": "IT'S A LITTLE DIFFICULT, BUT I'LL USE A STONE."
+ },
+ {
+ "addr": 44012,
+ "ja": "りょういきの ひろげかたです。",
+ "en": "THIS IS HOW TO EXPAND YOUR LIFE."
+ },
+ {
+ "addr": 44030,
+ "ja": "ひろげるばかりが よいとは かぎりません。",
+ "en": "IT IS NOT ALWAYS GOOD TO JUST EXPAND."
+ },
+ {
+ "addr": 44056,
+ "ja": "じ[AF]せんでは う[AF]かりしそうです。",
+ "en": "IT SEEMS THAT THE SAME WILL GIVE A NEGATIVE EFFECT."
+ },
+ {
+ "addr": 44077,
+ "ja": "せまいですが、すべての石が はたらいて いきます。",
+ "en": "ALTHOUGH IT IS SMALL, ALL THE STONES WORK."
+ },
+ {
+ "addr": 44107,
+ "ja": "すべて いきそうですが せいかいは 1つです。",
+ "en": "EVERYTHING SEEMS TO WORK, BUT THERE IS ONLY ONE PROBLEM."
+ },
+ {
+ "addr": 44135,
+ "ja": "黒2[68]に [59]を うばわれると し[AF]ぱいです。",
+ "en": "IF BLACK 2 STEALS , IT WILL BE EXPENSIVE."
+ },
+ {
+ "addr": 44161,
+ "ja": "むじょうけんで ころします。",
+ "en": "I'M GOING TO KILL YOU."
+ },
+ {
+ "addr": 44178,
+ "ja": "さ[AF]かくしないように。",
+ "en": "DON'T HIDE IT."
+ },
+ {
+ "addr": 44190,
+ "ja": "3[59]<85><9B><83>゛で ころしてください。",
+ "en": "PLEASE ROLL IT WITH 3゛."
+ },
+ {
+ "addr": 44210,
+ "ja": "かんたんに かんがえると し[AF]ぱいします。",
+ "en": "IT'S EASY TO THINK AND ."
+ },
+ {
+ "addr": 44234,
+ "ja": "みくびると おとしあなに はまります。",
+ "en": "WHEN YOU LOOK DOWN, YOU WILL FIT INTO AN ADULT."
+ },
+ {
+ "addr": 44255,
+ "ja": "1ぽ ふみこんだ<90>です。",
+ "en": "1 PO FUMIKONDA ."
+ },
+ {
+ "addr": 44271,
+ "ja": "1せんの 石が きいてきます。",
+ "en": "1 STONE IS HEARD."
+ },
+ {
+ "addr": 44288,
+ "ja": "<FA><F3>では し[AF]ぱいです。",
+ "en": "AT , IS TOO HIGH."
+ },
+ {
+ "addr": 44304,
+ "ja": "<F3><9C><83><9B>゛<93><FC>の <90>すじと わかれば、、、",
+ "en": "IF YOU UNDERSTAND THE LINE OF ゛..."
+ },
+ {
+ "addr": 44328,
+ "ja": "<F3><9C><83><9B>゛<93><FC>の すじです。",
+ "en": "THIS IS THE OUTLINE OF ゛."
+ },
+ {
+ "addr": 44345,
+ "ja": "ちょくせつ せめると し[AF]ぱいします。",
+ "en": "WHEN THE TIME COMES, THE WILL INCREASE."
+ },
+ {
+ "addr": 44366,
+ "ja": "きゅうしょを いちげきしてください。",
+ "en": "PLEASE TAKE CARE OF YOURSELF."
+ },
+ {
+ "addr": 44387,
+ "ja": "<80>゛<92>づまりにして ころしてください。",
+ "en": "゛PLEASE ROLL IT INTO A JAM."
+ },
+ {
+ "addr": 44409,
+ "ja": "せまいところで いきるには、 きゅうしょが たいせつです。",
+ "en": "IF YOU WANT TO LIVE IN A SMALL PLACE, YOU NEED SPACE."
+ },
+ {
+ "addr": 44442,
+ "ja": "<8A><88>[E2]1せんの黒石[E3]が やくにたちます。",
+ "en": "ONE BLACK STONE WILL SOON RISE."
+ },
+ {
+ "addr": 44464,
+ "ja": "[18]を 2つに わけないと 2[18] できません。",
+ "en": "YOU CAN'T MAKE 2 WITHOUT DIVIDING INTO TWO."
+ },
+ {
+ "addr": 44488,
+ "ja": "1せんの2[68]は と[AF]て [18]に ならないことが よくあります。",
+ "en": "2 OF 1ST SENTENCE OFTEN DOES NOT BECOME WITH ."
+ },
+ {
+ "addr": 44520,
+ "ja": "よくばると し[AF]ぱいします。",
+ "en": "WHEN I LOOK AT IT, I GET ANGRY."
+ },
+ {
+ "addr": 44537,
+ "ja": "よく できる すじです。",
+ "en": "THIS IS A VERY WELL DONE LINE."
+ },
+ {
+ "addr": 44553,
+ "ja": "あさからず ふかからず が たいせつです。",
+ "en": "IT IS IMPORTANT THAT IT DOES NOT DRY UP OR DRY UP."
+ },
+ {
+ "addr": 44579,
+ "ja": "<80>゛<92>づまりを りようして ころします。",
+ "en": "゛REMOVE THE JAM AND ROLL IT."
+ },
+ {
+ "addr": 44601,
+ "ja": "2[68]の とりかたに くふうしてください。",
+ "en": "PLEASE FOLLOW THE INSTRUCTIONS IN 2."
+ },
+ {
+ "addr": 44623,
+ "ja": "すみの きゅうしょに う[AF]て いきです。",
+ "en": "I'M GOING TO THE CORNER STATION ."
+ },
+ {
+ "addr": 44645,
+ "ja": "1[68]の とりかたを くふうして <F2><F7>てください。",
+ "en": "PLEASE FOLLOW THE STEPS IN 1 AND PRESS ."
+ },
+ {
+ "addr": 44671,
+ "ja": "かくじつに 2[18]を つくるには[27]",
+ "en": "HOW TO ACTUALLY MAKE 2"
+ },
+ {
+ "addr": 44689,
+ "ja": "<80>゛<92>づまりに きをつけて。",
+ "en": "゛CHECK OUT THE BLOCKAGES."
+ },
+ {
+ "addr": 44705,
+ "ja": "すこし う[AF]かりする<90>です。",
+ "en": "IT'S A LITTLE KARISHU ."
+ },
+ {
+ "addr": 44721,
+ "ja": "1[68]の つぎかたを くふうして いきてください。",
+ "en": "PLEASE FOLLOW THE STEPS IN 1 ."
+ },
+ {
+ "addr": 44748,
+ "ja": "ばらばらに 1[18]ずつ、つくります。",
+ "en": "MAKE 1 PIECES SEPARATELY."
+ },
+ {
+ "addr": 44769,
+ "ja": "ひろくて まよいますが、ひたすら 2[18]を めざしてください。",
+ "en": "IT'S TOO BIG, BUT PLEASE KEEP AIMING FOR 2."
+ },
+ {
+ "addr": 44803,
+ "ja": "[28]<F1><80><98>に ならないように。",
+ "en": "AVOID ."
+ },
+ {
+ "addr": 44818,
+ "ja": "石が せ[AF]しょくしているところは 1つです。",
+ "en": "THERE IS ONLY ONE PLACE WHERE THERE ARE STONES ."
+ },
+ {
+ "addr": 44843,
+ "ja": "[29]さそうに みえても、、、",
+ "en": "EVEN IF IT SEEMS UNLIKELY..."
+ },
+ {
+ "addr": 44857,
+ "ja": "せいりょくと なるか、よわい石に なるか、 わかれ[59]です。",
+ "en": "IT'S HARD TO DECIDE WHETHER YOU'LL BECOME A STONE OR A STONE."
+ },
+ {
+ "addr": 44888,
+ "ja": "黒の よわいところは どこでしょうか[27]",
+ "en": "WHERE IS THE DARK SIDE OF BLACK?"
+ },
+ {
+ "addr": 44910,
+ "ja": "せりあ[AF]ています。まえの<90>が わかれば、 つぎの1<90>は かんたんです。",
+ "en": "SERIA IS HERE. IF YOU UNDERSTAND THE PREVIOUS , THE NEXT ONE IS EASY."
+ },
+ {
+ "addr": 44950,
+ "ja": "じみな <90>ですが、、、",
+ "en": "I'M FAMILIAR WITH , BUT..."
+ },
+ {
+ "addr": 44965,
+ "ja": "いそがば まわれ、てあつい1<90>です。",
+ "en": "ISOGABA MAWARE, HOT 1."
+ },
+ {
+ "addr": 44987,
+ "ja": "つながりながら きる<90>は よい<90>です。",
+ "en": "A THAT CAN BE COMPLETED WHILE CONNECTED IS A GOOD ."
+ },
+ {
+ "addr": 45010,
+ "ja": "まえの白の1<90>を かんがえると、 つぎの1<90>は、、、",
+ "en": "CONSIDERING THE PREVIOUS WHITE 1, THE NEXT 1 IS..."
+ },
+ {
+ "addr": 45039,
+ "ja": "まもるべきか、せめるべきか。 こうげきは さいだいの ぼうぎょです。",
+ "en": "SHOULD I PROTECT IT OR AT LEAST BLAME IT? KOUGEKI IS THE BIGGEST BUG."
+ },
+ {
+ "addr": 45081,
+ "ja": "すみを せいする 1<90>です。",
+ "en": "IT'S 1 THAT WILL SAVE THE CORNER."
+ },
+ {
+ "addr": 45097,
+ "ja": "黒の石を あんていさせるには、、、",
+ "en": "TO MAKE THE BLACK STONE SHINE..."
+ },
+ {
+ "addr": 45115,
+ "ja": "白の こんきょを うば[AF]てください。",
+ "en": "PLEASE GIVE ME THE WHITE ONE."
+ },
+ {
+ "addr": 45136,
+ "ja": "し[AF]かりした 1<90>です。",
+ "en": "IT'S 1."
+ },
+ {
+ "addr": 45150,
+ "ja": "黒の あんていを える1<90>です。",
+ "en": "THIS IS 1 THAT SHOWS THE BLACK SPIRIT."
+ },
+ {
+ "addr": 45168,
+ "ja": "せめと まもりを かねた1<90>です。",
+ "en": "THIS IS 1 THAT SERVED AS SEME AND MAMORI."
+ },
+ {
+ "addr": 45187,
+ "ja": "あいてを ふうさするのは よい<90>です。",
+ "en": "IT IS GOOD TO OPEN THE AIR."
+ },
+ {
+ "addr": 45208,
+ "ja": "白は じょうせきの あとしまつを わすれています。",
+ "en": "WHITE HAS FORGOTTEN THE TRAILING EDGE OF THE FLOWER."
+ },
+ {
+ "addr": 45235,
+ "ja": "たがいの こんきょに かかわる <90>です。",
+ "en": "THIS IS , WHICH IS RELATED TO EACH OTHER'S INTERACTIONS."
+ },
+ {
+ "addr": 45258,
+ "ja": "ここに うつと 黒が いいかたちに なります。",
+ "en": "THIS IS WHERE THE DEPRESSION AND BLACK COME INTO PLAY."
+ },
+ {
+ "addr": 45283,
+ "ja": "ここは いそがず じ[AF]くりと。",
+ "en": "THIS IS ISOGAZUJI KURITO."
+ },
+ {
+ "addr": 45302,
+ "ja": "白の け[AF]かんを ついてください。",
+ "en": "PLEASE PAY ATTENTION TO THE WHITE MARK ."
+ },
+ {
+ "addr": 45321,
+ "ja": "どれにも うちたいところですが、 さいだいの 1<90>は[27]",
+ "en": "I WOULD LIKE TO USE ANY OF THEM, BUT THE MOST IMPORTANT ONE IS"
+ },
+ {
+ "addr": 45353,
+ "ja": "じょうせきの とちゅうです。",
+ "en": "THIS IS TOCHU FROM JOSEKI."
+ },
+ {
+ "addr": 45370,
+ "ja": "ちょ[AF]と みると [29]さそうですが、、、",
+ "en": "IF YOU LOOK AT , IT DOESN'T SEEM LIKE , BUT..."
+ },
+ {
+ "addr": 45392,
+ "ja": "石が せ[AF]しょくしているところは[27]",
+ "en": "WHERE THERE ARE STONES"
+ },
+ {
+ "addr": 45411,
+ "ja": "どれも [16]きな<90>ですが、 せめと まもりの きゅうしょは、、、",
+ "en": "ALL OF THEM ARE KINA, BUT SEME AND MAMORI'S KYUSHO ARE..."
+ },
+ {
+ "addr": 45446,
+ "ja": "なんとかには なんとか、の1<90>です。",
+ "en": "SOMEHOW, SOMEHOW, IS 1."
+ },
+ {
+ "addr": 45466,
+ "ja": "この1<90>で 白は ばらばらです。",
+ "en": "IN THIS 1, THE WHITE IS SCATTERED."
+ },
+ {
+ "addr": 45487,
+ "ja": "石を れんらくするということは とても だいじなことです。",
+ "en": "CLEANING STONES IS A VERY IMPORTANT THING."
+ },
+ {
+ "addr": 45520,
+ "ja": "なんとかの あたまは みず なんとか、です。",
+ "en": "SOMEHOW'S HEAD IS WATER SOMEHOW."
+ },
+ {
+ "addr": 45545,
+ "ja": "さきに こうげきされないように。",
+ "en": "DON'T LET ME GET MAD AT YOU."
+ },
+ {
+ "addr": 45563,
+ "ja": "みかたの あんていは たいせつです。",
+ "en": "MIKATA'S RELATIONSHIP IS IMPORTANT."
+ },
+ {
+ "addr": 45583,
+ "ja": "せりあいの さいちゅうの <90>ぬきは だいたい よくない<90>です。",
+ "en": "THE LAST OF THE COMPETITION IS USUALLY A BAD ."
+ },
+ {
+ "addr": 45617,
+ "ja": "白の こんきょを なくしてください。",
+ "en": "PLEASE GET RID OF THE WHITE SPOTS."
+ },
+ {
+ "addr": 45637,
+ "ja": "さきに こうげきしてください。",
+ "en": "PLEASE GIVE ME A CALL FIRST."
+ },
+ {
+ "addr": 45655,
+ "ja": "せりあいの さいちゅうです。",
+ "en": "THIS IS THE BEST PART OF THE AUCTION."
+ },
+ {
+ "addr": 45671,
+ "ja": "せめと もよう[E2]せいりょくけん[E3]、 い[AF]せきにちょうの すばらしい<90>は[27]",
+ "en": "SEMETO MOYO SEIRYOKUKEN , I SEKINICHO'S WONDERFUL IS"
+ },
+ {
+ "addr": 45709,
+ "ja": "白の3[68]を とる<90>すじは[27]",
+ "en": "TAKE WHITE'S 3 LINE IS"
+ },
+ {
+ "addr": 45724,
+ "ja": "しぼりの すじで 3[68]が とれます。",
+ "en": "3 CAN BE REMOVED WITH THE SQUEEZE LINE."
+ },
+ {
+ "addr": 45747,
+ "ja": "せめあいです。黒が まけそうですが よい<90>が あります。",
+ "en": "IT'S A CLOSE MATCH. IT LOOKS LIKE I'M GOING TO LOSE BLACK, BUT I HAVE A GOOD ."
+ },
+ {
+ "addr": 45781,
+ "ja": "せめあいです。さがる ほうこうに きをつけましょう。",
+ "en": "IT'S A CLOSE MATCH. LET'S PUT A MARK ON THE LANTERN THAT GOES DOWN."
+ },
+ {
+ "addr": 45810,
+ "ja": "すみは とくしゅな ところです。 <94><FD><83><85><FC>に してください。",
+ "en": "THE CORNER IS A SPECIAL PLACE. PLEASE CHANGE TO ."
+ },
+ {
+ "addr": 45844,
+ "ja": "3[68]が <94><F2><94><84><FC>で とれます。",
+ "en": "3 CAN BE OBTAINED BY ."
+ },
+ {
+ "addr": 45863,
+ "ja": "う[AF]かりする<90>が せいかいです。",
+ "en": "UKARISU IS IMPORTANT."
+ },
+ {
+ "addr": 45882,
+ "ja": "白の2[68]の <80>゛<92>の つめかたに きをつけて。",
+ "en": "NOTE HOW TO FILL IN ゛ OF WHITE 2 ."
+ },
+ {
+ "addr": 45906,
+ "ja": "1[68]に [59]が くらまないように。",
+ "en": "DON'T LET GET BLINDED BY 1."
+ },
+ {
+ "addr": 45924,
+ "ja": "1[68]を たすけだします。",
+ "en": "I WILL HELP YOU WITH 1."
+ },
+ {
+ "addr": 45938,
+ "ja": "<F1><80><98>にしても とれません。",
+ "en": "I CAN'T GET IT TO WORK EVEN WITH ."
+ },
+ {
+ "addr": 45953,
+ "ja": "[A0]の なかに <90>があるものです。 3[68]を と[AF]てください。",
+ "en": "IS IN . PLEASE 3."
+ },
+ {
+ "addr": 45986,
+ "ja": "4[68]を き[AF]て と[AF]てください。",
+ "en": "PLEASE READ 4 AND THEN ."
+ },
+ {
+ "addr": 46004,
+ "ja": "いがいな<90>で 2[68]が とれます。",
+ "en": "YOU CAN GET 2 WITH THE STRONG ."
+ },
+ {
+ "addr": 46024,
+ "ja": "わたりを とめてください。",
+ "en": "PLEASE STOP CROSSING."
+ },
+ {
+ "addr": 46039,
+ "ja": "<FC><8E>゛<98>の すじです。",
+ "en": "THIS IS THE OUTLINE OF ゛."
+ },
+ {
+ "addr": 46053,
+ "ja": "4[68]すべて と[AF]てください。",
+ "en": "4 ALL AND PLEASE."
+ },
+ {
+ "addr": 46070,
+ "ja": "5[68]を き[AF]て と[AF]てください。",
+ "en": "PLEASE READ 5 AND THEN ."
+ },
+ {
+ "addr": 46088,
+ "ja": "白の4[68]を と[AF]てください。",
+ "en": "PLEASE THE WHITE 4 ."
+ },
+ {
+ "addr": 46104,
+ "ja": "しぼ[AF]て 黒の <90>かずを のばします。",
+ "en": "GRASP AND SPREAD OUT THE BLACK KAZU."
+ },
+ {
+ "addr": 46127,
+ "ja": "<80>゛<92>づまりにして 3[68]を とります。",
+ "en": "MAKE ゛ AND TAKE 3."
+ },
+ {
+ "addr": 46148,
+ "ja": "りょうほうの じゃくてんを さぐ[AF]て 4[68]を とります。",
+ "en": "SEARCH FOR THE LAST STAR AND GET 4 ."
+ },
+ {
+ "addr": 46179,
+ "ja": "白の4[68]を と[AF]てください。 けいまに <82><F9><FA><FC>あり、と いいます。",
+ "en": "PLEASE THE WHITE 4 . IT SAYS THAT THERE IS IN KEIMAN."
+ },
+ {
+ "addr": 46215,
+ "ja": "<94><F2><94><84><FC>の すじです。",
+ "en": "THIS IS THE OUTLINE OF ."
+ },
+ {
+ "addr": 46230,
+ "ja": "<94><F2><94><84><FC>が ねらいの すじです。",
+ "en": "IS THE AIM."
+ },
+ {
+ "addr": 46251,
+ "ja": "いちばん とくをするには どうしたら よいでしょうか[27]",
+ "en": "WHAT SHOULD I DO TO BE THE MOST SPECIAL?"
+ },
+ {
+ "addr": 46282,
+ "ja": "[18]のある石と ない石の たたかい[E2][18]あり [18]なし[E3]を さけて <FA><F3>に してください。",
+ "en": "AVOID THE BATTLE BETWEEN THE STONE WITH AND THE STONE WITHOUT WITH AND GO TO ."
+ },
+ {
+ "addr": 46326,
+ "ja": "いそがば まわれです。",
+ "en": "ISOGABA IS MAWARE."
+ },
+ {
+ "addr": 46341,
+ "ja": "3[68]を き[AF]てください。 けいまに なんとかあり、と いいます。",
+ "en": "PLEASE READ 3. KEIMAN SAYS THAT SOMEHOW THINGS ARE GOING WELL."
+ },
+ {
+ "addr": 46375,
+ "ja": "<94><F2><94><84><FC>の すじに なります。",
+ "en": "IT FOLLOWS THE LINE ."
+ },
+ {
+ "addr": 46393,
+ "ja": "すて石を つかい <94><F2><94><84><FC>にして 白の2[68]を と[AF]てください。",
+ "en": "USE THE STONE TO AND THE WHITE 2 ."
+ },
+ {
+ "addr": 46427,
+ "ja": "あわてると <94><F2><94><84><FC>に なります。",
+ "en": "IF YOU PANIC, IT WILL BECOME ."
+ },
+ {
+ "addr": 46446,
+ "ja": "すて石を りようして せめあいに か[AF]てください。",
+ "en": "PLEASE TRY TO REMOVE THE STONE AND GIVE IT TO ME AS SOON AS POSSIBLE."
+ },
+ {
+ "addr": 46473,
+ "ja": "<F1><80><98>の しかたに きをつけてください。",
+ "en": "PLEASE EXPLAIN HOW TO USE ."
+ },
+ {
+ "addr": 46495,
+ "ja": "3[68]を き[AF]て と[AF]てください。",
+ "en": "3 PLEASE READ AND THEN ."
+ },
+ {
+ "addr": 46513,
+ "ja": "よく でてくる <90>すじです。",
+ "en": "THIS IS A STREAK THAT OFTEN APPEARS."
+ },
+ {
+ "addr": 46531,
+ "ja": "<94><F2><94><84><FC>の すじで 4[68]を とります。",
+ "en": "TAKE 4 FROM THE LINE ."
+ },
+ {
+ "addr": 46554,
+ "ja": "白が はいれないところを つくる<90>すじです。",
+ "en": "THIS IS A LINE THAT CREATES A PLACE WHERE WHITE CANNOT FIT."
+ },
+ {
+ "addr": 46580,
+ "ja": "<94><F2><94><84><FC>で 4[68]が とれます。",
+ "en": "YOU CAN GET 4 WITH ."
+ },
+ {
+ "addr": 46599,
+ "ja": "すて石を りようして 白の2[68]を と[AF]てください。",
+ "en": "REMOVE THE STONE AND TAKE THE WHITE 2 WITH ."
+ },
+ {
+ "addr": 46626,
+ "ja": "すて石が いります。",
+ "en": "I NEED A STONE."
+ },
+ {
+ "addr": 46638,
+ "ja": "きるときに つかわれる すじです。",
+ "en": "THIS IS THE STREAK USED WHEN CUTTING."
+ },
+ {
+ "addr": 46658,
+ "ja": "1せんに さが[AF]た石が <8E>゜<F2><9D><84>です。 白の3[68]を と[AF]てください。",
+ "en": "THE STONE THAT WAS IN 1ST YEAR IS ゜. PLEASE THE WHITE 3 ."
+ },
+ {
+ "addr": 46698,
+ "ja": "<94><F2><94><84><FC>の <90>すじです。",
+ "en": "THIS IS THE LINE OF ."
+ },
+ {
+ "addr": 46714,
+ "ja": "すみは とくしゅな ところです。も[AF]とも はたらいた<90>で 1[68]を と[AF]てください。",
+ "en": "THE CORNER IS A SPECIAL PLACE. PLEASE USE WITH 1 IN WHICH ALSO WORKED WITH ."
+ },
+ {
+ "addr": 46759,
+ "ja": "1[68]の も[AF]とも とくをする とりかたを かんがえてください。",
+ "en": "1 PLEASE THINK ABOUT HOW TO MAKE A DIFFERENCE BETWEEN AND ."
+ },
+ {
+ "addr": 46793,
+ "ja": "とられない <F7>゛<98><F7>゛<98>まで はい[AF]てください。",
+ "en": "NOT TAKEN ゛゛ YES PLEASE."
+ },
+ {
+ "addr": 46820,
+ "ja": "すて石を つかうほうが とくです。",
+ "en": "IT IS BETTER TO USE A STONE."
+ },
+ {
+ "addr": 46840,
+ "ja": "うかつに よくばると おおぞんします。",
+ "en": "IF YOU THINK ABOUT IT CARELESSLY, YOU'LL BE SURPRISED."
+ },
+ {
+ "addr": 46862,
+ "ja": "とられている 2[68]を かつようします。",
+ "en": "LET'S TAKE THE 2 THAT HAS BEEN TAKEN."
+ },
+ {
+ "addr": 46882,
+ "ja": "[16]きく とくをする<90>が あります。",
+ "en": "THERE IS TO LISTEN TO."
+ },
+ {
+ "addr": 46901,
+ "ja": "すこし とくを してください。",
+ "en": "PLEASE BE A LITTLE MORE CAREFUL."
+ },
+ {
+ "addr": 46918,
+ "ja": "すて石を つか[AF]て、1せんまで きかします。",
+ "en": "PICK UP THE STONE AND PLAY UP TO 1 SENTENCE."
+ },
+ {
+ "addr": 46942,
+ "ja": "せまいところですが とくをする<90>が あります。",
+ "en": "ALTHOUGH IT IS A SMALL PLACE, THERE IS A SPECIAL ."
+ },
+ {
+ "addr": 46969,
+ "ja": "わた[AF]て かえる<90>が とくを します。",
+ "en": "THE COTTON WILL CHANGE AND WILL TAKE CARE OF YOU."
+ },
+ {
+ "addr": 46990,
+ "ja": "せまいところですが うまい<96>[A3]の <90>すじが あります。",
+ "en": "IT'S A SMALL PLACE, BUT THERE IS A NICE STRIP."
+ },
+ {
+ "addr": 47022,
+ "ja": "1せんに さが[AF]た石が やくに たちます。",
+ "en": "THE STONES THAT ARE FOUND IN THE FIRST PLACE FALL QUICKLY."
+ },
+ {
+ "addr": 47046,
+ "ja": "<F3><9C><83><9B>゛<93><FC>の <90>すじが かかわります。",
+ "en": "THE LINE OF ゛ IS INVOLVED."
+ },
+ {
+ "addr": 47070,
+ "ja": "すて石で そとから白を かたまりにする<90> [E2]<FC><8E>゛<98>[E3]の すじが かかわります。",
+ "en": "THE LINES OF ゛ ARE INVOLVED, WHICH CLUMPS THE WHITE FROM THE OUTSIDE WITH A STONE."
+ },
+ {
+ "addr": 47114,
+ "ja": "せまい ところなので きをつけて とくをしてください。",
+ "en": "IT'S A SMALL PLACE, SO PLEASE BE CAREFUL AND SET ASIDE."
+ },
+ {
+ "addr": 47144,
+ "ja": "すて石を りようするのですが、、、",
+ "en": "I'M TRYING TO REMOVE A STONE..."
+ },
+ {
+ "addr": 47164,
+ "ja": "そとがわから 白石を かたまりに する<90> [E2]<FC><8E>゛<98>[E3]の すじで かてます。",
+ "en": "IF YOU KNOW WHERE IT IS, YOU CAN USE THE LINES OF ゛ TO MAKE WHITE STONES INTO CHUNKS."
+ },
+ {
+ "addr": 47206,
+ "ja": "<F3><9C><83><9B>゛<93><FC>の すじに なります。",
+ "en": "IT FOLLOWS THE LINE ゛."
+ },
+ {
+ "addr": 47226,
+ "ja": "すて石を つか[AF]て、とるか とられるかの たたかいに か[AF]てください。",
+ "en": "PICK UP A STONE AND FIGHT TO TAKE IT OR BE TAKEN."
+ },
+ {
+ "addr": 47263,
+ "ja": "じかに はい[AF]てこれない かたち [E2]<94><FD><83><85><FC>[E3]に します。",
+ "en": "DIRECTLY YES IT WILL BE IN A FORM ."
+ },
+ {
+ "addr": 47295,
+ "ja": "2[68]を すて石にして、[16]きく白の[A0]を へらす<90>が あります。",
+ "en": "THERE IS A THAT USES 2 AS A THROWING STONE AND REDUCES AND THE WHITE ."
+ },
+ {
+ "addr": 47327,
+ "ja": "1[59]でも とくをしてください。",
+ "en": "1BUT PLEASE TAKE CARE."
+ },
+ {
+ "addr": 47345,
+ "ja": "黒の1[68]を かつようして 白の2[68]か4[68]を と[AF]てください。",
+ "en": "USE THE BLACK 1 AND THEN THE WHITE 2 OR 4 ."
+ },
+ {
+ "addr": 47377,
+ "ja": "白の[A0]を いちばん へらす<90>は どれでしょうか[27]",
+ "en": "WHICH WILL REDUCE WHITE'S THE MOST?"
+ },
+ {
+ "addr": 47405,
+ "ja": "つぎかたを くふうして とくをしてください。",
+ "en": "PLEASE FOLLOW THE INSTRUCTIONS BELOW AND SECURE IT."
+ },
+ {
+ "addr": 47430,
+ "ja": "つぎかたを くふうして、みぎがわに 白が はねて つぐ<90>に そなえてください。",
+ "en": "CREATE A SPLICING PATTERN, AND LET THE WHITE SPLATTERS SPREAD OVER THE TOP OF THE RUG."
+ },
+ {
+ "addr": 47476,
+ "ja": "[A0]の なかに <90>があるものです。 さて どれが せいかいでしょうか。",
+ "en": "IS IN . NOW, WHICH ONE IS THE BEST?"
+ },
+ {
+ "addr": 47516,
+ "ja": "ゆうめいな <96>[A3]の <90>すじです。",
+ "en": "THIS IS THE SUMMARY OF YUMEINA ."
+ },
+ {
+ "addr": 47535,
+ "ja": "白が でできたとき、しんろを とめる、とは かぎりません。",
+ "en": "WHEN A WHITE COLOR IS FORMED, IT DOES NOT NECESSARILY MEAN THAT THE WHITE COLOR WILL STOP."
+ },
+ {
+ "addr": 47569,
+ "ja": "すて石を つかい、とくをしてください。",
+ "en": "PLEASE USE A STONE AND CARVE IT."
+ },
+ {
+ "addr": 47590,
+ "ja": "すこし むずかしいですが、白を かたまりに して[E2]<FC><8E>゛<98>[E3][A0]を かためてください。",
+ "en": "IT'S A LITTLE DIFFICULT, BUT PLEASE MAKE WHITE INTO A LUMP AND MAKE ゛."
+ },
+ {
+ "addr": 47637,
+ "ja": "からんで せめられる いい<90>が あります。",
+ "en": "THERE IS A GOOD THAT CAN BE USED IN TANDEM."
+ },
+ {
+ "addr": 47661,
+ "ja": "[21]の へんの 3[68]を まも[AF]てください。",
+ "en": "PLEASE WAIT FOR 3 NEXT TO ."
+ },
+ {
+ "addr": 47683,
+ "ja": "うちこまれると、ばらばらになる ところが あります。",
+ "en": "THERE ARE PARTS WHERE IT WILL FALL APART IF IT GETS HIT."
+ },
+ {
+ "addr": 47713,
+ "ja": "すべて [16]きいですが、さいだいの<90>は どれでしょう[27]",
+ "en": "ALL ARE GOOD, BUT WHICH ONE IS THE BIGGEST ?"
+ },
+ {
+ "addr": 47746,
+ "ja": "せめられないように まも[AF]てください。",
+ "en": "PLEASE WAIT SO THAT I DON'T GET HARASSED."
+ },
+ {
+ "addr": 47767,
+ "ja": "きょうだいな あつみ[E2]かべ[E3]を はたらかせる 1<90>です。",
+ "en": "THIS IS 1 THAT WORKS WITH SIBLINGS ATSUMI AND WALL ."
+ },
+ {
+ "addr": 47799,
+ "ja": "[29]さそうに みえても 石の あんていに かかわるところは [16]きい。",
+ "en": "EVEN IF IT DOESN'T SEEM LIKE IT, IT'S BEAUTIFUL WHEN IT COMES TO STONE SUPPORT."
+ },
+ {
+ "addr": 47833,
+ "ja": "黒の あんていに かかわる<90>です。",
+ "en": "THIS IS , WHICH IS RELATED TO BLACK ANTEI."
+ },
+ {
+ "addr": 47852,
+ "ja": "ある かたちが さいごまで おわ[AF]ていません。",
+ "en": "A CERTAIN FORM HAS NOT BEEN COMPLETED UNTIL THE END."
+ },
+ {
+ "addr": 47879,
+ "ja": "せめを ゆうせんしてください。",
+ "en": "PLEASE EXCUSE ME."
+ },
+ {
+ "addr": 47896,
+ "ja": "1[68]の かくほの しかたです。",
+ "en": "THIS IS THE METHOD OF WRITING 1."
+ },
+ {
+ "addr": 47913,
+ "ja": "せめと まもりの いい<90>は どこでしょうか[27]",
+ "en": "WHERE IS SEMETO MAMORI'S GOOD ?"
+ },
+ {
+ "addr": 47938,
+ "ja": "せめの きゅうしょに う[AF]てください。",
+ "en": "PLEASE GO TO THE NEAREST STATION."
+ },
+ {
+ "addr": 47959,
+ "ja": "せめを みた<90>が も[AF]とも [16]きいです。",
+ "en": "THE THAT SAW THE SOUND IS ALSO AND ."
+ },
+ {
+ "addr": 47982,
+ "ja": "もよう[E2]せいりょくけん[E3]の かくだいを はかる <90>すじです。",
+ "en": "THIS IS A SUMMARY THAT MEASURES THE WORK OF MOYO SEIRYOKUKEN ."
+ },
+ {
+ "addr": 48016,
+ "ja": "ちゅうおうを <90>あつくされては、いけません。",
+ "en": "DON'T LET YOURSELF GET TOO EXCITED ."
+ },
+ {
+ "addr": 48039,
+ "ja": "きれ[59]が しんぱいです。",
+ "en": "THE CUT IS STRONG."
+ },
+ {
+ "addr": 48055,
+ "ja": "もよう[E2]せいりょくけん[E3]を かくだいする <90>です。",
+ "en": "THIS IS , WHICH WILL BE USED TO COMPOSE MOYO SEIRYOKUKEN ."
+ },
+ {
+ "addr": 48083,
+ "ja": "3<90>[59]に [18]を とる<90>すじが でます。",
+ "en": "3 A STREAK APPEARS THAT TAKES TO ."
+ },
+ {
+ "addr": 48106,
+ "ja": "すて石を つか[AF]て ころします。",
+ "en": "PICK UP A STONE AND ROLL IT ."
+ },
+ {
+ "addr": 48123,
+ "ja": "<94><F2><94><84><FC>の <90>すじを つかいますが、 とりかたに きをつけて。",
+ "en": "USE THE LINE OF , BUT BE CAREFUL HOW YOU USE IT."
+ },
+ {
+ "addr": 48158,
+ "ja": "<94><F2><94><84><FC>の すじで いきます。",
+ "en": "LET'S GO WITH ."
+ },
+ {
+ "addr": 48177,
+ "ja": "ころしにいくなら、うつ<90>は 1つです。",
+ "en": "IF YOU GO TO KOSHI, UTSU IS ONE."
+ },
+ {
+ "addr": 48198,
+ "ja": "[16]きく ふみこんで、1せんに さが[AF]た石を つかいます。",
+ "en": "LISTEN AND USE A STONE WITH A SHAPE ON THE FIRST LINE."
+ },
+ {
+ "addr": 48229,
+ "ja": "きゅうしょに 置いて、ころします。",
+ "en": "PLACE IT ON THE TABLE AND ROLL IT."
+ },
+ {
+ "addr": 48247,
+ "ja": "へんを [18]なしに してください。",
+ "en": "PLEASE CHANGE THE PART WITHOUT ."
+ },
+ {
+ "addr": 48265,
+ "ja": "せめあいは どうなりますか、、、",
+ "en": "WHAT WILL HAPPEN TO THE RELATIONSHIP?"
+ },
+ {
+ "addr": 48283,
+ "ja": "きをつけないと、つめられなくなります。",
+ "en": "IF YOU DON'T TAKE GOOD CARE OF IT, IT WON'T HOLD UP."
+ },
+ {
+ "addr": 48303,
+ "ja": "わたりを ふせぐ<90>で はたらいた うちかたは どれでしょう。",
+ "en": "WHAT KIND OF PERSON WORKED IN PREVENTING CROSSING ?"
+ },
+ {
+ "addr": 48338,
+ "ja": "白の じゃくてんは どこでしょうか。",
+ "en": "WHERE IS THE WHITE JADE?"
+ },
+ {
+ "addr": 48360,
+ "ja": "みぎ[21]の すみの あつみ[E2]かべ[E3]を はたらかせてください。",
+ "en": "PLEASE LET ATSUMI AND WALL WORK IN THE CORNER OF MIGI ."
+ },
+ {
+ "addr": 48393,
+ "ja": "せめを みた<90>が せいかいです。",
+ "en": ", WHICH SAW SEME, IS SEIKAI."
+ },
+ {
+ "addr": 48412,
+ "ja": "せりあいの きゅうしょが あります。",
+ "en": "THERE IS A DEADLINE FOR COMPETITION."
+ },
+ {
+ "addr": 48432,
+ "ja": "この<90>で じょうせきが かんせいです。",
+ "en": "IN THIS , THE INFORMATION IS IMPORTANT."
+ },
+ {
+ "addr": 48456,
+ "ja": "白は だいじな まもりを わすれています。",
+ "en": "WHITE HAS FORGOTTEN ITS IMPORTANT PROTECTION."
+ },
+ {
+ "addr": 48480,
+ "ja": "い[AF]ぽうてきに きられるのは よくありません。",
+ "en": "IT'S NOT GOOD TO BE SCOLDED BY SOMEONE."
+ },
+ {
+ "addr": 48505,
+ "ja": "きれ[59]の かずは すくないほうが いいです。",
+ "en": "IT IS BETTER TO HAVE FEWER SCRAPS ."
+ },
+ {
+ "addr": 48531,
+ "ja": "あいてに きれ[59]が できれば、 とくが おおいです。",
+ "en": "IF YOU CAN CLEAR IN ADVANCE, THEN THE TOKU WILL BE COVERED."
+ },
+ {
+ "addr": 48563,
+ "ja": "はたらいた つぎかたは どれでしょう。",
+ "en": "WHICH IS THE NEXT WAY YOU WORKED?"
+ },
+ {
+ "addr": 48586,
+ "ja": "2[59]の あたまの かたちです。",
+ "en": "IT IS IN THE SHAPE OF A 2 HEAD."
+ },
+ {
+ "addr": 48603,
+ "ja": "おなじ きる<90>なら、なるべく あいてに ひびかせてください。",
+ "en": "IF IT'S THE SAME , PLEASE LET ME KNOW AS MUCH AS POSSIBLE."
+ },
+ {
+ "addr": 48638,
+ "ja": "白に よゆうを あたえない<90>です。",
+ "en": "THIS IS , WHICH DOES NOT GIVE ANY MEANING TO WHITE."
+ },
+ {
+ "addr": 48657,
+ "ja": "のぞかれている かたちです。 すなおな 1<90>です。",
+ "en": "IT IS A FORM THAT IS BEING LOOKED INTO. THIS IS SUNONA 1."
+ },
+ {
+ "addr": 48686,
+ "ja": "<82><F9>には <8A><88>よ、と いいます。",
+ "en": "SAYS ."
+ },
+ {
+ "addr": 48703,
+ "ja": "白石が く[AF]ついていますので、 黒も つなが[AF]て うつのが ふつうです。",
+ "en": "SINCE THE WHITE STONES ARE ATTACHED , IT IS NORMAL FOR THE BLACK ONES TO BE CONNECTED AS WELL."
+ },
+ {
+ "addr": 48745,
+ "ja": "石の かずが 黒のほうが おおいので たたかうと ゆうりです。",
+ "en": "THE BLACK STONE IS THICKER, SO IF YOU HIT IT, YOU WILL LOSE WEIGHT."
+ },
+ {
+ "addr": 48782,
+ "ja": "れんらくの しかたです。",
+ "en": "THIS IS HOW TO RIDE."
+ },
+ {
+ "addr": 48796,
+ "ja": "おなじ れんらくでも 白に ひびくように。",
+ "en": "EVEN THOUGH IT'S THE SAME LIGHT, IT ECHOES IN WHITE."
+ },
+ {
+ "addr": 48821,
+ "ja": "へいぼんに うつのが せいかいです。",
+ "en": "IT'S BECAUSE OF THE DEPRESSION IN HEIBON."
+ },
+ {
+ "addr": 48843,
+ "ja": "きれ[59]が きになりますが、ここは つよく うちましょう。",
+ "en": "THE WIND WILL BE A PROBLEM, BUT LET'S BE CAREFUL HERE."
+ },
+ {
+ "addr": 48874,
+ "ja": "すこしでも はたらいた つぎかたを かんがえてください。",
+ "en": "PLEASE THINK ABOUT THE NEXT STEPS THAT WORKED."
+ },
+ {
+ "addr": 48907,
+ "ja": "うけかたです。あんぜんな<90>は どれでしょうか[27]",
+ "en": "HERE'S HOW TO ACCEPT IT. WHICH IS THE INAPPROPRIATE ?"
+ },
+ {
+ "addr": 48935,
+ "ja": "3[68]を せめる かのうせいも あります。",
+ "en": "THERE ARE ALSO CASES WHERE YOU CAN GET 3."
+ },
+ {
+ "addr": 48956,
+ "ja": "れんらくしながら、も[AF]とも ふみこんだ<90>です。",
+ "en": "THIS IS , WHICH IS FUN AND ENJOYABLE."
+ },
+ {
+ "addr": 48983,
+ "ja": "あいての むりには、はんぱつしてください。",
+ "en": "IF YOU HAVE A HARD TIME, PLEASE HANG OUT."
+ },
+ {
+ "addr": 49007,
+ "ja": "いらない しんぱいは しないように。",
+ "en": "DON'T DO UNNECESSARY THINGS."
+ },
+ {
+ "addr": 49027,
+ "ja": "せりあいでの よわきは きんもつです。",
+ "en": "IT'S EASY TO MOVE AT THE AUCTION."
+ },
+ {
+ "addr": 49049,
+ "ja": "白の いきすぎを とがめる<90>は[27]",
+ "en": "CRITICIZES WHITE'S EXCESS"
+ },
+ {
+ "addr": 49107,
+ "ja": "<80>[78][A9] <8D> <EE>も",
+ "en": "TOO"
+ }
+] \ No newline at end of file
diff --git a/tools/title_screen.py b/tools/title_screen.py
new file mode 100644
index 0000000..2d50c81
--- /dev/null
+++ b/tools/title_screen.py
@@ -0,0 +1,594 @@
+"""Build the authentic Japanese-styled English title screen (Screen 0).
+
+Matches the original 1991 I'MAX Famicom title screen layout, palettes,
+clouds, and animation 1-for-1:
+ - Left badge (rows 4-5, cols 2-9, pal 2): bold orange-red "FAMICOM(R)"
+ with crisp 1px white outline (matching the original ファミコン® badge).
+ - Main logo (rows 2-6, cols 11-29, pal 0): large calligraphic "GO BASICS"
+ in bright green -> horizontal green/black scanline stripe -> jet black
+ with crisp 1px white outline (matching 囲碁入門).
+ - Stamp (CHR bank 7 sprites 0-13, original $E57E OAM coords, pal 3):
+ crisp 56x16 white stamp "NIHON KIIN / APPROVED" (matching 日本棋院推薦).
+ - Menu items (rows 20-27, pal 3): bold pixel-serif "GO LESSONS",
+ "PLAY GO", and "RANK TEST" in the original white -> cream-gold ->
+ coral-orange sunset gradient, aligned beside the white Go-stone cursor.
+ - Strictly preserves all 53 runtime animation tiles (rows 11-17), the
+ Mount Fuji frame/sprites, all white clouds, and "(c)1991 I'MAX".
+"""
+from PIL import Image, ImageDraw, ImageFont
+import make_book
+
+# Every CHR bank 0 tile ever written by the title sunrise/light-ray animation
+# across frames 31..700 (verified via nametable trace on the JP ROM).
+ANIM_TILES = {
+ 0x1C, 0x6D, 0x6E, 0x6F, 0x7C, 0x7D, 0x7F, 0x8D, 0x9D, 0xAD, 0xAE,
+ 0xBD, 0xBE, 0xBF, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xDB, 0xDC, 0xDD,
+ 0xDE, 0xDF, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9,
+ 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4,
+ 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFE,
+}
+
+FONT_LOGO = '/usr/share/fonts/noto/NotoSerif-BlackItalic.ttf'
+
+# Crisp hand-crafted 4x5 uppercase pixel font for the 56x16 white stamp.
+FONT_4X5 = {
+ 'A': [".##.", "#..#", "####", "#..#", "#..#"],
+ 'B': ["###.", "#..#", "###.", "#..#", "###."],
+ 'C': [".###", "#...", "#...", "#...", ".###"],
+ 'D': ["###.", "#..#", "#..#", "#..#", "###."],
+ 'E': ["####", "#...", "###.", "#...", "####"],
+ 'G': [".###", "#...", "#.##", "#..#", ".###"],
+ 'H': ["#..#", "#..#", "####", "#..#", "#..#"],
+ 'I': ["###", ".#.", ".#.", ".#.", "###"],
+ 'K': ["#..#", "#.#.", "##..", "#.#.", "#..#"],
+ 'N': ["#..#", "##.#", "#.##", "#..#", "#..#"],
+ 'O': [".##.", "#..#", "#..#", "#..#", ".##."],
+ 'P': ["###.", "#..#", "###.", "#...", "#..."],
+ 'R': ["###.", "#..#", "###.", "#.#.", "#..#"],
+ 'S': [".###", "#...", ".##.", "...#", "###."],
+ 'T': ["###", ".#.", ".#.", ".#.", ".#."],
+ 'V': ["#..#", "#..#", "#..#", ".##.", ".##."],
+ 'Y': ["#.#", "#.#", ".#.", ".#.", ".#."],
+ ' ': ["..", "..", "..", "..", ".."],
+}
+
+# Hand-crafted 7x11 bold retro pixel glyphs for "FAMICOM" badge (italicized
+# 1px to the right on the top half to evoke the classic Famicom wordmark).
+FAMICOM_GLYPHS = {
+ 'F': [
+ "######",
+ "######",
+ "##....",
+ "##....",
+ "#####.",
+ "#####.",
+ "##....",
+ "##....",
+ "##....",
+ "##....",
+ "##....",
+ ],
+ 'A': [
+ "..###..",
+ ".#####.",
+ "##...##",
+ "##...##",
+ "##...##",
+ "#######",
+ "#######",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ ],
+ 'M': [
+ "##...##",
+ "###.###",
+ "#######",
+ "##.#.##",
+ "##.#.##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ ],
+ 'I': [
+ "####",
+ "####",
+ ".##.",
+ ".##.",
+ ".##.",
+ ".##.",
+ ".##.",
+ ".##.",
+ ".##.",
+ "####",
+ "####",
+ ],
+ 'C': [
+ ".#####.",
+ "######.",
+ "##...##",
+ "##.....",
+ "##.....",
+ "##.....",
+ "##.....",
+ "##.....",
+ "##...##",
+ "######.",
+ ".#####.",
+ ],
+ 'O': [
+ ".#####.",
+ "#######",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "#######",
+ ".#####.",
+ ],
+}
+
+# Crisp hand-crafted 7x13 bold pixel-serif letters for the sunset title menu
+# (GO LESSONS / PLAY GO / RANK TEST). 2px vertical stems and clean serifs
+# keep every letter razor-sharp across the white -> cream -> coral gradient.
+MENU_SERIF = {
+ 'A': [
+ "..###..",
+ "..###..",
+ ".##.##.",
+ ".##.##.",
+ ".##.##.",
+ "##...##",
+ "##...##",
+ "#######",
+ "#######",
+ "##...##",
+ "##...##",
+ "##...##",
+ "###.###",
+ ],
+ 'E': [
+ "#######",
+ "#######",
+ ".##...#",
+ ".##....",
+ ".##..#.",
+ ".#####.",
+ ".#####.",
+ ".##..#.",
+ ".##....",
+ ".##....",
+ ".##...#",
+ "#######",
+ "#######",
+ ],
+ 'G': [
+ ".#####.",
+ "#######",
+ "##...##",
+ "##.....",
+ "##.....",
+ "##.....",
+ "##..###",
+ "##..###",
+ "##...##",
+ "##...##",
+ "##...##",
+ "#######",
+ ".#####.",
+ ],
+ 'K': [
+ "###..##",
+ ".##.##.",
+ ".##.##.",
+ ".####..",
+ ".###...",
+ ".###...",
+ ".####..",
+ ".##.##.",
+ ".##.##.",
+ ".##..##",
+ ".##..##",
+ ".##..##",
+ "###..##",
+ ],
+ 'L': [
+ "####...",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##...#",
+ ".##...#",
+ "#######",
+ "#######",
+ ],
+ 'N': [
+ "###..##",
+ "###..##",
+ "####.##",
+ "####.##",
+ "##.####",
+ "##.####",
+ "##..###",
+ "##..###",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "###..##",
+ ],
+ 'O': [
+ ".#####.",
+ "#######",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "##...##",
+ "#######",
+ ".#####.",
+ ],
+ 'P': [
+ "######.",
+ "#######",
+ ".##..##",
+ ".##..##",
+ ".##..##",
+ ".##..##",
+ ".######",
+ ".#####.",
+ ".##....",
+ ".##....",
+ ".##....",
+ ".##....",
+ "####...",
+ ],
+ 'R': [
+ "######.",
+ "#######",
+ ".##..##",
+ ".##..##",
+ ".##..##",
+ ".##..##",
+ ".######",
+ ".#####.",
+ ".##.##.",
+ ".##.##.",
+ ".##..##",
+ ".##..##",
+ "###..##",
+ ],
+ 'S': [
+ ".#####.",
+ "#######",
+ "##...##",
+ "##.....",
+ "###....",
+ ".#####.",
+ "..#####",
+ "....###",
+ ".....##",
+ "##...##",
+ "##...##",
+ "#######",
+ ".#####.",
+ ],
+ 'T': [
+ "#######",
+ "#######",
+ "#..#..#",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ ".#####.",
+ ],
+ 'Y': [
+ "###.###",
+ "##...##",
+ "##...##",
+ ".##.##.",
+ ".##.##.",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ "..###..",
+ ".#####.",
+ ],
+}
+
+
+def _draw_famicom_badge():
+ """64x16 orange-red FAMICOM(R) badge with crisp 1px white outline (pal 2)."""
+ W, H = 64, 16
+ mask = [[False] * W for _ in range(H)]
+ cx = 2
+ for ch in 'FAMICOM':
+ g = FAMICOM_GLYPHS[ch]
+ gw = len(g[0])
+ for y, row in enumerate(g):
+ # Subtle 1px forward slant on upper half for retro Famicom energy.
+ slant = 1 if y < 5 else 0
+ for x, pix in enumerate(row):
+ if pix == '#':
+ xx = cx + x + slant
+ yy = 3 + y
+ if 0 <= xx < W and 0 <= yy < H:
+ mask[yy][xx] = True
+ cx += gw + 1
+
+ out = [[0] * W for _ in range(H)]
+ for y in range(H):
+ for x in range(W):
+ if mask[y][x]:
+ out[y][x] = 2 # vibrant orange-red
+ else:
+ for dy in (-1, 0, 1):
+ for dx in (-1, 0, 1):
+ yy, xx = y + dy, x + dx
+ if 0 <= yy < H and 0 <= xx < W and mask[yy][xx]:
+ out[y][x] = 1 # crisp 1px white outline
+ break
+ if out[y][x]:
+ break
+
+ # Crisp registered-trademark (R) circle on the right (white, color 1)
+ reg = [
+ "..####..",
+ ".#....#.",
+ "#.#..#.#",
+ "#.##.#.#",
+ "#.#.#..#",
+ "#.#..#.#",
+ ".#....#.",
+ "..####..",
+ ]
+ for ry, row in enumerate(reg):
+ for rx, ch in enumerate(row):
+ if ch == '#':
+ out[3 + ry][56 + rx] = 1
+ return out
+
+
+def _draw_main_logo(text='GO BASICS'):
+ """152x40 bold calligraphic logo in exact JP 囲碁入門 palette & striping."""
+ W, H = 152, 40
+ f = ImageFont.truetype(FONT_LOGO, 136)
+ dr0 = ImageDraw.Draw(Image.new('L', (10, 10)))
+ bb = dr0.textbbox((0, 0), text, font=f)
+ tw, th = bb[2] - bb[0], bb[3] - bb[1]
+ tmp = Image.new('L', (tw + 32, th + 32), 0)
+ ImageDraw.Draw(tmp).text((16 - bb[0], 16 - bb[1]), text, font=f, fill=255)
+ target_w, target_h = W - 6, H - 6
+ tmp = tmp.resize((target_w, target_h), Image.Resampling.LANCZOS)
+ px = tmp.load()
+
+ mask = [[False] * W for _ in range(H)]
+ for y in range(target_h):
+ for x in range(target_w):
+ if px[x, y] >= 118:
+ mask[y + 2][x + 3] = True
+
+ # Remove isolated 1px speckles so serifs stay crisp.
+ clean = [row[:] for row in mask]
+ for y in range(1, H - 1):
+ for x in range(1, W - 1):
+ if mask[y][x]:
+ nb = (mask[y - 1][x] + mask[y + 1][x] +
+ mask[y][x - 1] + mask[y][x + 1])
+ if nb == 0:
+ clean[y][x] = False
+ mask = clean
+
+ # Exact 囲碁入門 horizontal stripe gradient:
+ # bright green top -> alternating green/black stripes -> jet black bottom
+ stripe_map = {17: 3, 18: 2, 19: 3, 20: 3, 21: 2, 22: 2, 23: 3}
+ out = [[0] * W for _ in range(H)]
+ for y in range(H):
+ for x in range(W):
+ if mask[y][x]:
+ if y < 17:
+ out[y][x] = 2 # bright green
+ elif y in stripe_map:
+ out[y][x] = stripe_map[y]
+ else:
+ out[y][x] = 3 # jet black
+
+ # Crisp 1px white outline all around the logo.
+ for y in range(H):
+ for x in range(W):
+ if mask[y][x]:
+ continue
+ for dy in (-1, 0, 1):
+ for dx in (-1, 0, 1):
+ yy, xx = y + dy, x + dx
+ if 0 <= yy < H and 0 <= xx < W and mask[yy][xx]:
+ out[y][x] = 1 # white outline
+ break
+ if out[y][x]:
+ break
+ return out
+
+
+def _draw_menu_letter(ch):
+ """8x16 bold pixel-serif letter in JP sunset gradient (pal 3)."""
+ g = MENU_SERIF[ch]
+ # Exact JP vertical sunset bands (matching jp_menu_2x.png):
+ # top white(1) -> cream-gold(2) -> alternating coral/cream -> coral(3)
+ band = [1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3]
+ out = [[0] * 8 for _ in range(16)]
+ for y, row in enumerate(g):
+ for x, pix in enumerate(row):
+ if pix == '#':
+ out[2 + y][1 + x] = band[2 + y]
+ return out
+
+
+def _draw_subtitle_stamp(chr_):
+ """Draw crisp 56x16 white stamp 'NIHON KIIN / APPROVED' into CHR bank 7.
+
+ Uses the exact 14 sprite tiles of the original 日本棋院推薦 stamp at
+ their original $E57E OAM positions (x=152..208, y=55..71, sprite pal 3:
+ color 1 = white box, color 3 = crisp black ink).
+ """
+ W, H = 56, 16
+ # Solid white stamp (color 1) with clean 1px transparent padding on top/bot
+ # would shrink height; original JP stamp fills the full 56x16 white box
+ # (1px white border inside the 56x16 rectangle, black text in color 3).
+ canvas = [[1] * W for _ in range(H)]
+
+ def put_4x5(text, y0):
+ # Measure width (4px per char except I=3, space=2; 1px spacing)
+ total_w = sum(len(FONT_4X5[c][0]) for c in text) + len(text) - 1
+ x0 = (W - total_w) // 2
+ cx = x0
+ for ch in text:
+ g = FONT_4X5[ch]
+ for gy, row in enumerate(g):
+ for gx, p in enumerate(row):
+ if p == '#':
+ canvas[y0 + gy][cx + gx] = 3 # black ink
+ cx += len(g[0]) + 1
+
+ put_4x5('NIHON KIIN', 2)
+ put_4x5('APPROVED', 9)
+
+ top_tiles = [0x95, 0x96, 0x97, 0x98, 0x74, 0x75, 0x76]
+ bot_tiles = [0xA5, 0xA6, 0xA7, 0xA8, 0x84, 0x85, 0x86]
+ for row_idx, tile_row in enumerate((top_tiles, bot_tiles)):
+ for col_idx, t in enumerate(tile_row):
+ base = 7 * 4096 + t * 16
+ for y in range(8):
+ lo = hi = 0
+ for x in range(8):
+ v = canvas[row_idx * 8 + y][col_idx * 8 + x]
+ if v & 1:
+ lo |= 1 << (7 - x)
+ if v & 2:
+ hi |= 1 << (7 - x)
+ chr_[base + y] = lo
+ chr_[base + 8 + y] = hi
+
+
+def build(b3, chr_):
+ """Rewrite CHR bank 0, CHR bank 7 stamp, and return compressed Screen 0."""
+ s0 = bytearray(make_book.decompress(b3, 0)[0])
+
+ # Reserve every tile used by the mountain frame, runtime animation, clouds,
+ # and "(c)1991 I'MAX" so nothing animated or decorative is ever touched.
+ keep = set(ANIM_TILES) | {0x00}
+ for r in range(30):
+ for c in range(32):
+ in_fam = (4 <= r <= 5 and 2 <= c <= 9)
+ in_logo = (2 <= r <= 8 and 11 <= c <= 29)
+ in_menu = ((20 <= r <= 21 and 8 <= c <= 18) or
+ (23 <= r <= 24 and 6 <= c <= 17) or
+ (26 <= r <= 27 and 4 <= c <= 16))
+ if not (in_fam or in_logo or in_menu):
+ keep.add(s0[r * 32 + c])
+ else:
+ s0[r * 32 + c] = 0
+
+ free = sorted(set(range(256)) - keep)
+ pi = 0
+ tile_cache = {}
+
+ def get_tile(pix):
+ nonlocal pi
+ if all(v == 0 for row in pix for v in row):
+ return 0
+ key = tuple(tuple(row) for row in pix)
+ if key in tile_cache:
+ return tile_cache[key]
+ assert pi < len(free), f'ran out of free CHR0 title tiles ({pi}/{len(free)})'
+ code = free[pi]
+ pi += 1
+ tile_cache[key] = code
+ for y in range(8):
+ lo = hi = 0
+ for x in range(8):
+ v = pix[y][x]
+ if v & 1:
+ lo |= 1 << (7 - x)
+ if v & 2:
+ hi |= 1 << (7 - x)
+ chr_[code * 16 + y] = lo
+ chr_[code * 16 + 8 + y] = hi
+ return code
+
+ def blit(canvas, r0, c0):
+ H, W = len(canvas), len(canvas[0])
+ for ty in range(H // 8):
+ for tx in range(W // 8):
+ tile = [[canvas[ty * 8 + y][tx * 8 + x] for x in range(8)]
+ for y in range(8)]
+ s0[(r0 + ty) * 32 + (c0 + tx)] = get_tile(tile)
+
+ def set_attr(tr, tc, pal):
+ idx = 960 + (tr // 4) * 8 + (tc // 4)
+ sh = ((tr % 4) // 2) * 4 + ((tc % 4) // 2) * 2
+ s0[idx] = (s0[idx] & ~(3 << sh)) | ((pal & 3) << sh)
+
+ # 1. Left badge: FAMICOM(R) in rows 4-5, cols 2-9 (Palette 2).
+ blit(_draw_famicom_badge(), 4, 2)
+ for r in (4, 5):
+ for c in range(2, 10):
+ set_attr(r, c, 2)
+
+ # 2. Main calligraphic logo: GO BASICS in rows 2-6, cols 11-29 (Palette 0).
+ blit(_draw_main_logo('GO BASICS'), 2, 11)
+ for r in range(2, 7):
+ for c in range(11, 30):
+ set_attr(r, c, 0)
+
+ # 3. Sunset menu items aligned beside the white Go-stone cursor (Palette 3).
+ menu_items = [
+ (20, 8, 'GO LESSONS'),
+ (23, 6, 'PLAY GO'),
+ (26, 4, 'RANK TEST'),
+ ]
+ letter_cache = {}
+ for r0, c0, word in menu_items:
+ for i, ch in enumerate(word):
+ if ch == ' ':
+ continue
+ if ch not in letter_cache:
+ g = _draw_menu_letter(ch)
+ letter_cache[ch] = (get_tile(g[:8]), get_tile(g[8:]))
+ t0, t1 = letter_cache[ch]
+ s0[r0 * 32 + c0 + i] = t0
+ s0[(r0 + 1) * 32 + c0 + i] = t1
+ for r in (r0, r0 + 1):
+ for c in range(c0, c0 + len(word)):
+ set_attr(r, c, 3)
+
+ # 4. Subtitle stamp in CHR bank 7 (original $E57E OAM positions untouched).
+ _draw_subtitle_stamp(chr_)
+
+ comp = make_book.compress(s0)
+ print(f'title screen: {pi}/{len(free)} CHR0 tiles, compressed {len(comp)}/{0x020A} bytes')
+ return comp