News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Sega Saturn: Nanatsu Kaze no Shima Monogatari  (Read 25595 times)

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #20 on: October 05, 2016, 02:08:30 am »
0 1 2 3 4 5 6 7 8 9 A B C D E F
--------------------------------------
00. 0 1 2 3 4 5 6 7 8 9 黒 木 家 実 青 石
01. A B C D E F G H I J K L M N O
02. P Q R S T U V W X Y Z 空 飛 根 銀 羽
03. ? a b c d e f g h i j k l m n o
04. p q r s t u v w x y z 神 左 手 右 帽
05. ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く
06. ぐ け げ こ ご さ ざ し じ す ず せ ぜ そ ぞ た
07. だ ち ぢ っ つ づ て で と ど な に ぬ ね の は
08. ば ぱ ひ び ぴ ふ ぶ ぷ へ べ ぺ ほ ぼ ぽ ま み
09. む め も ゃ や ゅ ゆ ょ よ ら り る れ ろ ゎ わ
0A. ゐ ゑ を ん 子 水 玉 猫 毛 布 帆 真 赤 車 輪 虫
0B.     ァ ア ィ イ ゥ ウ ェ エ ォ オ カ ガ キ ギ ク
0C. グ ケ ゲ コ ゴ サ ザ シ ジ ス ズ セ ゼ ソ ゾ タ
0D. ダ チ ヂ ッ ツ ヅ テ デ ト ド ナ ニ ヌ ネ ノ ハ
0E. バ パ ヒ ビ ピ フ ブ プ へ ベ ペ ホ ボ ポ マ ミ
0F. ム メ モ ャ ヤ ュ ユ ョ ヨ ラ リ ル レ ロ ヮ ワ
10. ヰ ヱ ヲ ン ヴ ヵ ヶ 一 笑 人 形 風 葉 粉 胸 満
11. 月 三 日 骨 草 小 目 四 角 片 岩 白 升 天 竜 牙
12. 本 入 道 供 魚 使 物 選 択 ☓ 種 像 板 御 札
13. 前 足 珠 歯 洞 腕 尾 時 色 々 (R)(L)取 機 釣
14. 竿 出 笛 黄 番 呼 頭 幼 音 (X.L)(Y)   (Z.R) 捕

This is a pre-coffee post, so it might need a proofread from someone else in the thread but I hope this helps. <3
It's funny you posted this at this time because I asked a friend about this very thing a couple days ago. I've been itching for a text dump to toy with translating. Since you've looked into the images, did you see if the storybook pages were all images too? I always assumed so, but I want to know from someone who has actually looked inside.

Very nice, I think 0x002E might be 鈴 instead of 銀 but otherwise it looks perfect to my untrained eye :thumbsup:

In regards to the storybook pages, you can find all the little graphics and what looks like the font in the BOOK_JYU folder, so they should exist as plaintext somewhere. I haven't quite worked out the way these are stored so they're a bit garbled:

"B2C01001.png"

"B0_C02000.png"

They can be found in BOOK_JYU/B2C01001 (palette in B2P01001) and BOOK_JYU/B0C02000 (palette in B0P02000) respectively.
« Last Edit: August 02, 2018, 09:30:22 pm by Frozen_Fish »

Cargodin

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Doushiuh☆oh翻訳
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #21 on: October 05, 2016, 05:51:34 am »
Very nice, I think 0x002E might be 鈴 instead of 銀 but otherwise it looks perfect to my untrained eye :thumbsup:

In regards to the storybook pages, you can find all the little graphics and what looks like the font in the BOOK_JYU folder, so they should exist as plaintext somewhere. I haven't quite worked out the way these are stored so they're a bit garbled:


They can be found in BOOK_JYU/B2C01001 (palette in B2P01001) and BOOK_JYU/B0C02000 (palette in B0P02000) respectively.

OH, sounds cool! I'll dig around for anything to see if I can find it if it is in plaintext. The only things I've ever written down for having text in them were TEXTDATA.BIN and 0KRNL.BIN, but I'd be happy to check while I'm awake tonight. I can only guess though that if it is in plaintext and I can't find it anywhere that, like the kanji in the 0KRNL screenshot that I posted before, it's referenced in the hexdata but not explicitly shown, but pffft what do I know. ; D

And indeed it does look like it. My bad! I should have caught that given they look nothing alike on hindsight. Thanks for catching it.

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #22 on: October 05, 2016, 08:22:05 am »
OH, sounds cool! I'll dig around for anything to see if I can find it if it is in plaintext. The only things I've ever written down for having text in them were TEXTDATA.BIN and 0KRNL.BIN, but I'd be happy to check while I'm awake tonight. I can only guess though that if it is in plaintext and I can't find it anywhere that, like the kanji in the 0KRNL screenshot that I posted before, it's referenced in the hexdata but not explicitly shown, but pffft what do I know. ; D

And indeed it does look like it. My bad! I should have caught that given they look nothing alike on hindsight. Thanks for catching it.

Found it ;D (note the 7's)

"textreplace.png"

In BOOK_JYU there's a bunch of files named B?S????? (where ? are numbers) the storybook text can be found within them, the text above is found in B2S01001. Like with 0KRNL.BIN it's a 2-byte encoding based on this image:

"B0C02000 grid.png"

There's no English characters in this one though so it will need editing I guess.

Also, some info about the font graphic format:

BOOK_JYU/B0C02000 (image data):
4bpp indexed colour
Little-Endian
16x16 tiled

BOOK_JYU/B0P02000 (palette):
BGR colour order
2 bytes per colour
Little-Endian
« Last Edit: August 02, 2018, 06:42:59 pm by Frozen_Fish »

Cargodin

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Doushiuh☆oh翻訳
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #23 on: October 08, 2016, 08:42:38 am »
Found it ;D (note the 7's)

In BOOK_JYU there's a bunch of files named B?S????? (where ? are numbers) the storybook text can be found within them, the text above is found in B2S01001. Like with 0KRNL.BIN it's a 2-byte encoding based on this image:


My dunce cap is probably showing, but I'm having a doozy of a time spotting any text in the B?S series via Windhex, including B2S01001 (I didn't see any 7s either). Are you using something else? Sorry if that's a dumb question.
On another note, if each of these files is supposed to represent a page each, that's something else. Perhaps it was easier to format each block of text and pseudo-wrap them around images without making other pages go to hell.  :P

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #24 on: October 08, 2016, 01:00:04 pm »
My dunce cap is probably showing, but I'm having a doozy of a time spotting any text in the B?S series via Windhex, including B2S01001 (I didn't see any 7s either). Are you using something else? Sorry if that's a dumb question.
On another note, if each of these files is supposed to represent a page each, that's something else. Perhaps it was easier to format each block of text and pseudo-wrap them around images without making other pages go to hell.  :P

Sorry if I was unclear, the text in those files is encoded like the menu/inventory strings in 0KRNL.BIN, 2 bytes per character, starting from 0x0000, but this time based on the font graphic in my last post. So another table that transcribes that image will need to be created if you want to actually see anything in WindHex. The 7's were added by me and just demonstrating that I'd found the right text and could replace it.

Cargodin

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Doushiuh☆oh翻訳
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #25 on: October 08, 2016, 03:04:42 pm »
Sorry if I was unclear, the text in those files is encoded like the menu/inventory strings in 0KRNL.BIN, 2 bytes per character, starting from 0x0000, but this time based on the font graphic in my last post. So another table that transcribes that image will need to be created if you want to actually see anything in WindHex. The 7's were added by me and just demonstrating that I'd found the right text and could replace it.

Wow okay hahaha, I was simply accepting the 777 stuff there as grammatically it worked(in a way) and I havent replayed the game. Totally ignore that then. Good to know how that works for sure. I dont have much know-how on that at all.

julayla

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #26 on: October 09, 2016, 10:10:10 pm »
It's such a shame that I don't have a Japanese PC or can write Japanese (I usually have to use a translator like Google or Babel back then when I use to try to translate things) or I'd help. And it looks like a pretty nice game. I wonder why the company didn't want this one released in the first place (besides the 16 bit graphics)?

EDIT: Wait, I think I found a way to type in Japanese symbols, but it will take time to learn how to use the language using the IME program.
« Last Edit: October 09, 2016, 10:47:40 pm by julayla »

Cargodin

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Doushiuh☆oh翻訳
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #27 on: October 10, 2016, 06:44:46 am »


    1 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
-------------------------------------------------------
000  ー ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く
001  ぐ け げ こ ご さ ざ し じ す ず せ ぜ そ ぞ た
002  だ ち ぢ っ つ づ て で と ど な に ぬ ね の は
003  ば ぱ ひ び ぴ ふ ぶ ぷ へ べ ぺ ほ ぼ ぽ ま み
004  む め も ゃ や ゅ ゆ ょ よ ら り る れ ろ ゎ わ
005 -------を ん------------------------------------
006      ァ ア ィ イ ゥ ウ ェ エ ォ オ カ ガ キ ギ ク
007 グ ケ ゲ コ ゴ サ ザ シ ジ ス ズ セ ゼ ソ ゾ タ
008 ダ チ ヂ ッ ツ ヅ テ デ ト ド ナ ニ ヌ ネ ノ ハ
009 バ パ ヒ ビ ピ フ ブ プ へ ベ ペ ホ ボ ポ マ ミ

00A / ム メ モ ャ ヤ ュ ユ ョ ヨ ラ リ ル レ ロ ヮ 
00B ワ[10][11]ヲ ン ヴ ヵ ヶ 0 1 2 3 4 5 6 7
00C 8 9 「 」 、 。 , . ・ : ? ! … <END>
00D 風 竜 人 大 好 言 前 身 年 経 七 島 降 立 嫌 扉
00E 顔 木 家 上 認 主 現 在 完 成 直 後 両 手 使 草
00F 切 奇 心 旺 盛 子 供 名 場 所 岩 小 吹 割 生 終

010 見 知 自 分 葉 回 歩 何 地 面 光 黒 飛 抜 続 青
011 空 落 丘 形 最 初 考 実 答 出 向 投 緑 色 煙 宙
012 消 芽 入 獣 紀 気 話 恵 本 彼 度 読 難 聞 秒 間   
013 頭 今 昔 全 問 時 忘 物 語 新 第 章 未 音 根 着
014 一 休 外 水 流 階 段 準 備 先 建 行 来 部 屋 集
015 探 浮 喜 返 角 笛 少 離 森 中 眠 誰 起 体 声 届
016 息 吸 々 笑 婆 商 虫 取 機 差 跳 思 会 持 待 渡
017 匹 目 礼 呼 鳴 序 当 組 怒 様 勝 負 強 敵 押 再
018 捕 晴 力 良 売 広 飽 男 開 散 通 道 頼 引 対 法
019 必 死 響 泣 帰 枯 高 始 突 然 下 逃 追 無 事 楽

01A 急 欲 込 挨 拶 覚 世 界 伝 去 残 四 教 丸 底 沈
01B 友 達 迷 違 調 緒 同 発 二 亀 裂 呑 洞 窟 石 奥
01C 進 変 運 選 三 番 資 格 車 弾 乗 受 得 吠 告 羽
01D 泉 解 路 真 西 東 右 左 謎 夢 振 合 試 五 湖 暗
01E 配 巨 願 悩 絶 注 意 静 壊 悲 橋 動 戻 方 法 処
01F 叫 怖 腎 巡 元 助 嬉 球 雨 記 録 書 怪 我 役 長

020 老 順 苦 八 瞬 姿 末 赤 止 日 噛 歌 守 白 求 採
021 創 感 謝 満 足 努 結 果 痛 毒 傷 治 暖 効 匂 輪
022 育 兄 弟 連 土 裏 寝 粉 局 耳 数 約 束 伸 枝 困
023 退 早 速 相 皆 周 隠 望 住 山 ロ 喋 胸 転 近 拾
024 鍾 乳 握 閉 髪 寄 指 到 混 乱 恐 秘 密 倒 品 震
025 原 因 子 歯 背 尾 波 辺 工 房 盗 砂 浜 海 労 像
026 穴 植 黄 協 幹 忙 性 央 付 珍 美 紅 並 称 簡 単
027 釣 次 趣 味 収 悪 被 害 者 深 墓 黙 多 特 徴 的
028 魚 鼻 歳 与 談 北 氷 南 漠 療 際 暇 愛 標 踊 表
029 素 質 芝 居 由 岸 貝 細 砕 築 装 飾 泳 逆 固 有

02A 温 厚 貴 重 示 贈 優 雅 激 術 授 図 和 影 保 護
02B 定 傾 幻 種 族 正 式 存 & 双 想 坊 減 女 交 軽
02C 月 化 誕 失 都 説 異 常 扱 柔 範 囲 布 具 個 研
02D 究 象 慣 習 極 作 片 材 料 加 造 机 棚 命 欠 頃
02E 曲 打 甲 羅 模 鑑 賞 頑 丈 支 用 途 域 野 巻 反
02F 代 別 不 明 犬 技 縮 喉 破 睡 沿 各 情 宿 慢 帽

030 親 遠 普 活 天 弱 折 内 獲 端 要 群 伸 鉱 般 夜
031 透 液 乾 燥 衝 撃 唯 掘 憶 柄 句 源 尻 他 惑 似
032 偶 擬 態 誤 潰 汁 比 較 香 茶 非 幼 貰 食 理 編
033 走 狂 栄 養 襲 隅 独 刺 状 増 宝 災 駆 星 操 花
034 鉄 等 産 隣 陸 驚 恨 程 綿 毛 率 低 賭 皮 肉 児
035 更 半 暴 可 能 湿 筈 執 筆 期 視 六 勇 慌 確 線
036 報 舌 観 察 過 安 輝 復 派 任 偽 適 敢 換 揺 雰
037 景 凶 御 神 託 鍵 瞳 慎 霧 塔 吐 眼 虚 鐘 舞 触
038 什 洛 漂 崩 識 序 章 第 [第1章][第2章][第3章][第4章]
039 [第5章] [第6章][第7章][第8章][第9章][第10章][第11章][第終 章]
03A [番外編] [執筆中] 詳 帆 玉 劇 台 猫 文 板 削 馬
03B 冷 腹 勢 照 張 利 便 以 座 故 陰 揃 繰 避 摘 横
03C 脚 淑 縄 札 殻 議 樹 祝 福 昨 号 字 咲 訪 烈 臭
03D 限 崖 警 戒 敏 応 壱 弐 参 伍 断

It's a doozy of a thread post, but here. : D

julayla

  • Full Member
  • ***
  • Posts: 163
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #28 on: October 10, 2016, 03:25:10 pm »
You know, I think I may have figured out a better title for the English translation of this game. I'm not sure if this would work out for you, but it's just a suggestion I thought I might give you to help shorten the logo. How about either "The Creature of Sky Island" or "A Sky Island Story"? Just a thought

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #29 on: October 11, 2016, 05:15:12 am »
You know, I think I may have figured out a better title for the English translation of this game. I'm not sure if this would work out for you, but it's just a suggestion I thought I might give you to help shorten the logo. How about either "The Creature of Sky Island" or "A Sky Island Story"? Just a thought

The direct translation is definitely very clunky, I'm partial to "Island of the Seven Winds" myself :)

LaLaPico

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #30 on: October 20, 2016, 05:03:18 pm »
The direct translation is definitely very clunky, I'm partial to "Island of the Seven Winds" myself :)

Oh man, I decided to check this thread and was pleasantly surprised! Wow, awesome work Frozen_Fish and Cargodin!

I am really only a passing amateur on the advanced methods of editing text, inserting/editing font graphics and the such. From my understanding, directly changing the text in the files isn't practical, because obviously, you will run out of space and bleed into the next hex location (boinking everything up). That is, if the game is using a TOC to make sure everything is the correct byte length

So, the remedy for this? Pointers? Compression? Or...?

October 20, 2016, 05:20:13 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
    1 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
-------------------------------------------------------
000  ー ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く
001  ぐ け げ こ ご さ ざ し じ す ず せ ぜ そ ぞ た
002  だ ち ぢ っ つ づ て で と ど な に ぬ ね の は
003  ば ぱ ひ び ぴ ふ ぶ ぷ へ べ ぺ ほ ぼ ぽ ま み
004  む め も ゃ や ゅ ゆ ょ よ ら り る れ ろ ゎ わ
005 -------を ん------------------------------------
006      ァ ア ィ イ ゥ ウ ェ エ ォ オ カ ガ キ ギ ク
007 グ ケ ゲ コ ゴ サ ザ シ ジ ス ズ セ ゼ ソ ゾ タ
008 ダ チ ヂ ッ ツ ヅ テ デ ト ド ナ ニ ヌ ネ ノ ハ
009 バ パ ヒ ビ ピ フ ブ プ へ ベ ペ ホ ボ ポ マ ミ

00A / ム メ モ ャ ヤ ュ ユ ョ ヨ ラ リ ル レ ロ ヮ 
00B ワ[10][11]ヲ ン ヴ ヵ ヶ 0 1 2 3 4 5 6 7
00C 8 9 「 」 、 。 , . ・ : ? ! … <END>
00D 風 竜 人 大 好 言 前 身 年 経 七 島 降 立 嫌 扉
00E 顔 木 家 上 認 主 現 在 完 成 直 後 両 手 使 草
00F 切 奇 心 旺 盛 子 供 名 場 所 岩 小 吹 割 生 終

010 見 知 自 分 葉 回 歩 何 地 面 光 黒 飛 抜 続 青
011 空 落 丘 形 最 初 考 実 答 出 向 投 緑 色 煙 宙
012 消 芽 入 獣 紀 気 話 恵 本 彼 度 読 難 聞 秒 間   
013 頭 今 昔 全 問 時 忘 物 語 新 第 章 未 音 根 着
014 一 休 外 水 流 階 段 準 備 先 建 行 来 部 屋 集
015 探 浮 喜 返 角 笛 少 離 森 中 眠 誰 起 体 声 届
016 息 吸 々 笑 婆 商 虫 取 機 差 跳 思 会 持 待 渡
017 匹 目 礼 呼 鳴 序 当 組 怒 様 勝 負 強 敵 押 再
018 捕 晴 力 良 売 広 飽 男 開 散 通 道 頼 引 対 法
019 必 死 響 泣 帰 枯 高 始 突 然 下 逃 追 無 事 楽

01A 急 欲 込 挨 拶 覚 世 界 伝 去 残 四 教 丸 底 沈
01B 友 達 迷 違 調 緒 同 発 二 亀 裂 呑 洞 窟 石 奥
01C 進 変 運 選 三 番 資 格 車 弾 乗 受 得 吠 告 羽
01D 泉 解 路 真 西 東 右 左 謎 夢 振 合 試 五 湖 暗
01E 配 巨 願 悩 絶 注 意 静 壊 悲 橋 動 戻 方 法 処
01F 叫 怖 腎 巡 元 助 嬉 球 雨 記 録 書 怪 我 役 長

020 老 順 苦 八 瞬 姿 末 赤 止 日 噛 歌 守 白 求 採
021 創 感 謝 満 足 努 結 果 痛 毒 傷 治 暖 効 匂 輪
022 育 兄 弟 連 土 裏 寝 粉 局 耳 数 約 束 伸 枝 困
023 退 早 速 相 皆 周 隠 望 住 山 ロ 喋 胸 転 近 拾
024 鍾 乳 握 閉 髪 寄 指 到 混 乱 恐 秘 密 倒 品 震
025 原 因 子 歯 背 尾 波 辺 工 房 盗 砂 浜 海 労 像
026 穴 植 黄 協 幹 忙 性 央 付 珍 美 紅 並 称 簡 単
027 釣 次 趣 味 収 悪 被 害 者 深 墓 黙 多 特 徴 的
028 魚 鼻 歳 与 談 北 氷 南 漠 療 際 暇 愛 標 踊 表
029 素 質 芝 居 由 岸 貝 細 砕 築 装 飾 泳 逆 固 有

02A 温 厚 貴 重 示 贈 優 雅 激 術 授 図 和 影 保 護
02B 定 傾 幻 種 族 正 式 存 & 双 想 坊 減 女 交 軽
02C 月 化 誕 失 都 説 異 常 扱 柔 範 囲 布 具 個 研
02D 究 象 慣 習 極 作 片 材 料 加 造 机 棚 命 欠 頃
02E 曲 打 甲 羅 模 鑑 賞 頑 丈 支 用 途 域 野 巻 反
02F 代 別 不 明 犬 技 縮 喉 破 睡 沿 各 情 宿 慢 帽

030 親 遠 普 活 天 弱 折 内 獲 端 要 群 伸 鉱 般 夜
031 透 液 乾 燥 衝 撃 唯 掘 憶 柄 句 源 尻 他 惑 似
032 偶 擬 態 誤 潰 汁 比 較 香 茶 非 幼 貰 食 理 編
033 走 狂 栄 養 襲 隅 独 刺 状 増 宝 災 駆 星 操 花
034 鉄 等 産 隣 陸 驚 恨 程 綿 毛 率 低 賭 皮 肉 児
035 更 半 暴 可 能 湿 筈 執 筆 期 視 六 勇 慌 確 線
036 報 舌 観 察 過 安 輝 復 派 任 偽 適 敢 換 揺 雰
037 景 凶 御 神 託 鍵 瞳 慎 霧 塔 吐 眼 虚 鐘 舞 触
038 什 洛 漂 崩 識 序 章 第 [第1章][第2章][第3章][第4章]
039 [第5章] [第6章][第7章][第8章][第9章][第10章][第11章][第終 章]
03A [番外編] [執筆中] 詳 帆 玉 劇 台 猫 文 板 削 馬
03B 冷 腹 勢 照 張 利 便 以 座 故 陰 揃 繰 避 摘 横
03C 脚 淑 縄 札 殻 議 樹 祝 福 昨 号 字 咲 訪 烈 臭
03D 限 崖 警 戒 敏 応 壱 弐 参 伍 断

It's a doozy of a thread post, but here. : D

Since there is no English characters in the storybook fonts, would step one be to edit some of the existing kanji/kana fonts and make them into english?

If so, I could get started ---- if someone point out what program can be used to properly edit/save the font files.
« Last Edit: October 20, 2016, 05:20:13 pm by LaLaPico »

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #31 on: October 27, 2016, 06:24:22 am »
Since there is no English characters in the storybook fonts, would step one be to edit some of the existing kanji/kana fonts and make them into english?

If so, I could get started ---- if someone point out what program can be used to properly edit/save the font files.

Hey LaLaPico. I actually had something to that end in the works. I was hoping to have it working a bit more generically before posting it here but I've been busy lately :P

"text-replace.png"

It's a basic Python script that will extract out and allow you to re-insert the storybook font graphic (BOOK_JYU/B0C02000 and B0P02000), it might work with other graphics but due to the hardcoded dimensions probably not at the moment.

It's written for Python 2.7 but may work with Python 3. In addition to Python, you also need Pillow installed which you can get it by running the following at the command line:
pip install pillow

Code: [Select]
import argparse
import struct
from PIL import Image

IMAGE_DIMENSIONS = (256, 1200)
TILE_WIDTH = 16
BYTES_PER_TILE = (TILE_WIDTH * TILE_WIDTH) / 2  # 4 bits per pixel
TILES_PER_ROW = IMAGE_DIMENSIONS[0] / TILE_WIDTH


def main():
    parser = argparse.ArgumentParser(description='NKnSM Storybook font converter')
    subparsers = parser.add_subparsers(help="mode of operation")

    parser_import = subparsers.add_parser('import', help='converts an image file to game compatible format')
    parser_import.add_argument('image', metavar='image-file')
    parser_import.add_argument('palette', metavar='palette-file')
    parser_import.add_argument('output', metavar='output-file')
    parser_import.set_defaults(func=insert)

    parser_export = subparsers.add_parser('export', help='converts game format to image file')
    parser_export.add_argument('bitmap', metavar='bitmap-file')
    parser_export.add_argument('palette', metavar='palette-file')
    parser_export.add_argument('output', metavar='output-file')
    parser_export.set_defaults(func=extract)

    args = parser.parse_args()
    args.func(args)


def extract(args):
    im = Image.new('RGB', IMAGE_DIMENSIONS)

    with open(args.bitmap, 'rb') as f:
        bitmap = f.read()
    with open(args.palette, 'rb') as f:
        palette = f.read()

    tile = []

    index = 0
    tile_x = 0
    tile_y = 0

    for bitmap_byte in bitmap:
        temp = struct.unpack('B', bitmap_byte)[0]
        pixel1 = temp & 0xF
        pixel2 = (temp >> 4) & 0xF

        pixel1col = struct.unpack('>H', palette[(pixel1 * 2):(pixel1 * 2) + 2])[0]
        pixel2col = struct.unpack('>H', palette[(pixel2 * 2):(pixel2 * 2) + 2])[0]

        pixel1rgb = short_to_rgb(pixel1col)
        pixel2rgb = short_to_rgb(pixel2col)

        tile.append(pixel2rgb)
        tile.append(pixel1rgb)

        index += 1

        if index % BYTES_PER_TILE == 0:
            put_tile(im, tile, tile_x * 16, tile_y * 16)
            tile = []

            tile_x += 1

            if tile_x == TILES_PER_ROW:
                tile_x = 0
                tile_y += 1

    im.save(args.output)


def insert(args):
    im = Image.open(args.image)

    if im.mode != 'RGB':
        im = im.convert('RGB')
       
    pal_im = Image.new('P', im.size)  # empty Image just to hold our palette

    with open(args.palette, 'rb') as f:
        palette = f.read()

    pal_expanded = []
    for i in xrange(0, len(palette), 2):
        pixel_short = struct.unpack('>H', palette[i:i + 2])[0]
        pixel_rgb = short_to_rgb(pixel_short)
        pal_expanded.append(pixel_rgb[0])
        pal_expanded.append(pixel_rgb[1])
        pal_expanded.append(pixel_rgb[2])

    pal_im.putpalette(pal_expanded)
    im = im.quantize(palette=pal_im)

    out_bin = ''

    for y in xrange(0, im.height, 16):
        for x in xrange(0, im.width, 16):
            tile = get_tile(im, x, y)

            for i in xrange(0, len(tile), 2):
                part1 = tile[i + 1]
                part2 = tile[i]

                final = (part1 & 0xF) | ((part2 & 0xF) << 4)

                out_bin += struct.pack('B', final)

    with open(args.output, 'wb') as f:
        f.write(out_bin)


def short_to_rgb(short):
    r = short & 0x1F
    r = (r * 256 / 32)

    g = (short >> 5) & 0x1F
    g = (g * 256 / 32)

    b = (short >> 10) & 0x1F
    b = (b * 256 / 32)

    return r, g, b


def rgb_to_short(rgb):
    r = (rgb[0] * 32 / 256)
    g = (rgb[1] * 32 / 256)
    b = (rgb[2] * 32 / 256)

    return (r & 0x1F) | ((g & 0x1F) << 5) | ((b & 0x1F) << 10)


def put_tile(im, tile, x, y):
    init_x = x

    for rgb in tile:
        im.putpixel((x, y), rgb)

        x += 1

        if (x - init_x) % TILE_WIDTH == 0:
            x = init_x
            y += 1


def get_tile(im, x, y):
    init_x = x
    init_y = y

    tile = []

    for y in xrange(0, TILE_WIDTH):
        for x in xrange(0, TILE_WIDTH):
            tile.append(im.getpixel((init_x + x, init_y + y)))

    return tile


main()

Usage:

Extraction:
python script.py export bitmap-file palette-file output-image.png

Insertion:
python script.py import input-image.png palette-file output-game-data.bin

So to get the font:

Extraction:
python script.py export B0C02000 B0P02000 output.png

Insertion:
python script.py import output.png B0P02000 B0C02000-new

Here's the edited font graphic I used:
"font-new.png"

And in game compatible format:
https://mega.nz/#!MAwkBKYS!inF9a1hrVxQQhPXvqf2h86N7mVq8ccc2cUlvcnOTqXs

Hope that helps :thumbsup:
« Last Edit: August 02, 2018, 06:44:13 pm by Frozen_Fish »

LaLaPico

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #32 on: October 27, 2016, 05:26:13 pm »
That is legit badassery.

Creating a new table file associated with the new font graphic, the story book shouldn't be an issue any longer? Or are the storybook data unable to view through hex?

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #33 on: October 28, 2016, 03:08:09 am »
That is legit badassery.

Creating a new table file associated with the new font graphic, the story book shouldn't be an issue any longer? Or are the storybook data unable to view through hex?

You can view and edit them in something like WindHex using Cargodin's table. Each page is a B?S????? (where ? are numbers) file in /BOOK_JYU. Lines terminate with 0xFFF1 and the file (page) terminates with 0xFFFF. Also you're going to have to deal with the 16 characters per line, 12 lines per page limit.

No idea if adding pages is at all possible.

Cargodin

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Doushiuh☆oh翻訳
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #34 on: October 28, 2016, 03:29:53 am »
Wow, lot's of cool stuff happening there, Frozen_Fish! I dig it.  The font you chose is really nice, although it does make me wonder if it would be better to go with something smaller(I say this before any VWF formation has been applied) just in case more pages can't be added cleanly into the game. Esper is looking into dumping the text for me, but the poetic format of the game might be hard to put into English if there isn't room for it on the page. That said, I say we go with what the work you have so far and test it out first once the time comes for it.

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #35 on: October 28, 2016, 04:02:42 am »
Wow, lot's of cool stuff happening there, Frozen_Fish! I dig it.  The font you chose is really nice, although it does make me wonder if it would be better to go with something smaller(I say this before any VWF formation has been applied) just in case more pages can't be added cleanly into the game. Esper is looking into dumping the text for me, but the poetic format of the game might be hard to put into English if there isn't room for it on the page. That said, I say we go with what the work you have so far and test it out first once the time comes for it.

I totally agree about a smaller font, this one was really just intended as a proof of concept. It's ripped straight from a tileset I found on the Dwarf Fortress wiki (thanks AbuDhabi) ;)

LaLaPico

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #36 on: November 08, 2016, 10:26:05 am »
Quick question: I know there is already English fonts in the normal games texts --- but it would still be a better idea to edit the font graphics to make for two-byte characters? (or am I wrong --- are the current english characters already two-byte?)

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #37 on: November 09, 2016, 08:28:00 am »
Quick question: I know there is already English fonts in the normal games texts --- but it would still be a better idea to edit the font graphics to make for two-byte characters? (or am I wrong --- are the current english characters already two-byte?)

Not quite sure what you're asking but I'll try and answer anyway :)

All the text encodings I've encountered so far have been 2 bytes per character. See for example:

"ITEM_N_CG_GRID.png"

All the characters in the image are accessed the same way, through a 2 byte index which tells the game which 16x16 tile to grab. So, yes, all the english characters are already 2 bytes.
I've laid them out in a grid here but it would be just as valid to have one long row of characters.
« Last Edit: August 02, 2018, 06:44:38 pm by Frozen_Fish »

GHANMI

  • Hero Member
  • *****
  • Posts: 703
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #38 on: November 09, 2016, 04:16:38 pm »
Clarification for LaLaPico:
1-byte is written with two characters XX,
2-byte is two bytes XX XX.
Just X is a nibble.

And I'm really grateful for all of you for sharing information here. Especially Cargodin for the kanji identification. Even if this particular effort doesn't bear fruit, it will help people in the future.
I'd like to add that some of the sequences were stored in the disc pre-rendered, text and all over events that seem at first glance in-engine, as videos. I have no idea how to modify Cinepack Saturn videos, however in this particular case with MPC and the latest codecs you can mount the ISO in Windows and see the videos (without sound, but that might be intended). These videos will need editing.

As for the text...

The text needs to be stored internally as 1-byte per letter.

If I knew Saturn assembly, I'd try something like adding a custom control code in the routine the game uses to process the game's text. It would be two bytes, with the second byte being the number of single bytes to read ahead (an even number, to avoid throwing off the game too badly). Then after that there's the text, in 1-byte per letter format.

This "master" control code will interpret each byte, and for each one it will call the programming for one dual-byte Shift-JIS character.

I'd suggest the 0x20 to 0xFF characters call characters from the 0x0120 to 0x01FF range, of course with the kanji characters replaced in the font graphic with a character from the ASCII 1252 set (the more, the merrier, not just the 0x20 to 0x7F range).

As for characters 0x00 to 0x1F, they could serve as replacement 1-byte control codes for frequently used control codes in the original like line breaks, timers, button prompts, end text, and even custom control code like separate bold and italicized characters stored in the font in other ranges, say 0x0220 instead of 0x0120 for italicized text (so, if we have 0x11 mean "italicize", it will call characters after if from that range instead, until another control code tells it to start calling regular characters instead), but the one that would be needed would be a control code calling for more spaces because it's needed in the story page text formatting.
I wouldn't bother with coming up with replacements for anything not text related, like event logic. I'd just have the "master" control code end just before it.

Having a dictionary implementation (as long as there's space in the RAM for it: why not overwrite the extra unused kanji graphics?) could help with the pointers in case they're too rigid.

And then after this "master" control code is done reading that number of characters, it will have the text reading routine skip further to the 2-byte character / control code just after it. This would help avoiding any potential problems with the existing control codes (I think someone was trying to get Swordcraft Story 3 to read text as 1-byte per character but he tried making all existing control codes for events, internal logic, and all... a massive endeavor, and understandably he abandoned. One of the Policenauts PSX romhackers suggested in a tutorial storing the text in the disc in 1-byte and then have the game "decompress" it to 2-bytes for the copy in the RAM it will be reading and processing, but then pointers and potential overflow in a limited RAM would be a looming issue).

After this, there's the more complicated hacking involving the graphical engine (VDP1 or VDP2, I don't know... :P ).
People would say a variable-width font is needed, but I think fixed width readjusted to 8 pixel width is perfectly acceptable as well. Monospaced would help with the storybook page formatting, as stated before in the thread.

Frozen_Fish

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
Re: Sega Saturn: Nanatsu Kaze no Shima Monogatari
« Reply #39 on: November 11, 2016, 10:29:45 am »
I'd like to add that some of the sequences were stored in the disc pre-rendered, text and all over events that seem at first glance in-engine, as videos. I have no idea how to modify Cinepack Saturn videos, however in this particular case with MPC and the latest codecs you can mount the ISO in Windows and see the videos (without sound, but that might be intended). These videos will need editing.

Oh, thanks for reminding me, this was something else I'd been looking into, so I'll post what I know.

Annoyingly they aren't Cinepak but Duck True Motion S, meaning they're a bit of a pain to re-encode. libavcodec has a decoder but the only encoder I'm aware of is the leaked Saturn developer disc and requires XP or earlier to run.

Some links with more info:
http://vberthelot.free.fr/SX/satdev/Tools.html (See "TrueMotion Libraries" for the dev disc)
https://segaxtreme.net/threads/truemotion-library-needs-keystring.16720/ (See Torico's posts)
https://segaxtreme.net/threads/how-to-encode-truemotion-movies-for-saturn.15692/

I got as far as following Torico's instructions in a XP VM but kept running into errors when trying to open any video files in VidEdit (probably need to install a VWF codec).
Yep, installing ffdshow tryouts allows the files to open in VideEdit but now I run into "General Protection Fault" or crashes when attempting to preview/export as True Motion. An XP or Virtual Machine issue maybe?
« Last Edit: November 11, 2016, 11:43:11 am by Frozen_Fish »