Author Topic: Cyber Knight translation  (Read 10348 times)

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #30 on: February 07, 2014, 03:01:37 AM »
Yeah, I think I'll probably have to write my own extraction tool (once I find out how to access all of the script) and a parser to load the 'swap' logic as each string is read - for example, the dual line thing doesn't make any sense as I can just lookup the correct symbol for a character with a dakuten/handakuten when I write the script file to disk (I'm hoping that the SNES translator will be willing to part with a copy of the translated script for that version).

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Cyber Knight assets (tiles/text)
« Reply #31 on: February 07, 2014, 03:16:16 AM »
You already seem proficient in C, you should just write your own. I always write my own extractors and inserters.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #32 on: February 07, 2014, 04:48:28 AM »
your table must have some mistakes, so try working from the data already in the game to rebuild it to match what the game expects.

hiragana and katakana are 1:1, so try making a table (from known data in the rom, not data you have changed to try and figure out what gets displayed from each value) just for hiragana...
then, the katakana part occupies that same space.
シ and し are both 0xBC in the game script. in this case they happen to be in different parts of vram, but that doesn't really matter if you're just trying to make a table

I think this is the problem - I've got very little to go on, which is why I've been picking out phrases with at least some ASCII codes in them, as without that, I've got nothing to search for in a hex editor.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #33 on: February 07, 2014, 09:00:52 PM »
I've been using the menu screen to go through and make a new table. First off I did all combinations from 0x20 - 0xff and it matches my existing table. I've now added the 0x5c control code at the beginning and am doing a second column - so far it does seem to be a 1:1 mapping between Katakana and Hiragana, I think they switch places, but need to complete the table to confirm this.

e.g.
pre-0x5c a 0xFD = ン

after a 0x5c a 0xFD = ん

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #34 on: February 08, 2014, 02:28:44 AM »
Ok, I now have a translation of all fonts in the game, both those before a 0x5c control code, and those displayed after a 0x5c sequence.

There are about half a dozen fonts I cannot identify from the very small tiles included in the game, I may need some help with those at some point, but I have around 200 characters identified now.
« Last Edit: February 08, 2014, 02:42:40 AM by megatron-uk »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Cyber Knight assets (tiles/text)
« Reply #35 on: February 08, 2014, 02:54:40 AM »
Have you figured out the pointer system yet?

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #36 on: February 08, 2014, 03:09:18 AM »
Not yet, I haven't really thought about where to start with that yet - Ive just been using some obvious text strings to work out the fonts, but I don't know how to start looking for all the locations of the text.

Any "pointers"? :lol:

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Cyber Knight assets (tiles/text)
« Reply #37 on: February 08, 2014, 03:48:08 AM »
Lol.

If there's a chunk of text, the pointer block might be near by. You can usually identify a pointer block, visually, in a hex editor. The values in the pointer block might be relative, might 10bit, or might be logical (16bit). Or possibly something weird in format.

 Give me an address to some text, and I'll take a look.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #38 on: February 08, 2014, 04:03:03 AM »
These are the three main sections I've been using to extract the font details as they have ASCII characters in the display...

Main menu
Description, the main game menu.
Text reads CYBER KNIGHT
ROM location: 0001CB00
0D 06 43 59 42 45 52 20 4B 4E 49 47 48 54 00

Opening Cinematic
One of the first dialogue boxes displayed as the players ship starts to take fire. I would think most text in the game would be in a similar format or pointed to in the same way as this as it seems quite standard with all of the other dialogue box text (0x3c at the start and 0x04 at the end).
Text reads システムに EMPタメ‐シ!
ROM location: 0002A142
3C 0C BC BD C3 D1 5C C6 20 45 4D 50 5C C0 DE D2 B0 BC DE 21 04

Scrolling Intro
The intro text scrolls up the screen once the intro cinematic has finished and before the game begins.
Test begins AD2352.11.21 (and continues over several lines)
ROM location: 0001BAD6
41 44 32 33 35 32 2e 31 31 2e 32 31 00
« Last Edit: February 08, 2014, 04:08:23 AM by megatron-uk »

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #39 on: February 08, 2014, 11:29:27 AM »
It's go-to-bed time here, but before I do, someone on RHDN shared a few interesting pieces of information from his looking at Cyber Knight quite a number of years ago:

0xC7EC - font decompression routine
0x2C21F - compressed font (*16:001F logical)
0x28200 PC - some dialogue, pointers seem to be 2-byte, little endian
$CEF5 - dialogue load routine


Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Cyber Knight assets (tiles/text)
« Reply #40 on: February 08, 2014, 05:31:17 PM »
It's go-to-bed time here, but before I do, someone on RHDN shared a few interesting pieces of information from his looking at Cyber Knight quite a number of years ago:

0xC7EC - font decompression routine
0x2C21F - compressed font (*16:001F logical)
0x28200 PC - some dialogue, pointers seem to be 2-byte, little endian
$CEF5 - dialogue load routine

 I saw that table. But the text in the beginning of the game appeared to use hard offsets. So I didn't get any break points on that table yet. But I only took a 5 minute glance at it.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #41 on: February 08, 2014, 10:25:42 PM »
Looks to be a possibility of a second (slightly bigger) pointer table at 0x2D409 (rom + header) / 0x2D209 (no header).

I can't figure out the address format for either though - relative to start of the table, absolute plus some offset, nor how many entries are supposed to be in the table. More testing to do!

EDIT: Now found what appears to be yet another table at 0x26F4A (no header).
« Last Edit: February 08, 2014, 10:52:39 PM by megatron-uk »

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: Cyber Knight assets (tiles/text)
« Reply #42 on: February 09, 2014, 12:54:12 AM »
Quote from: megatron-uk
I haven't done any hacking before :D
Well, looks like you have a knack for it then.

Yeah, could've fooled me!! Well, welcome to the fan tran club then, megatron. ;) I thought you were just knee deep in that Everdrive tinkering and what not. I didn't expect to find this all of a sudden from ya! Good luck, at any rate.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #43 on: February 09, 2014, 01:18:48 AM »
Ha ha! Thanks :) Still early days yet though.

Right now I'm trying to get my head around where these pointers are actually referencing - I've read David Shadoff's post here and it makes sense, seeing as the PCE only maps an 8k window onto the rom at any point in time.

What I probably need to do is find an in-game piece of text, such as something said by one of the villagers in the first settlement you visit, work out the hex for the text being displayed, find the match in rom, and then try and find it in the CPU logical view in mednafen stepping through just before the dialogue displays.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Cyber Knight assets (tiles/text)
« Reply #44 on: February 09, 2014, 02:22:40 AM »
Found what should be a helpful piece of dialogue text to track down what pointers are being used:

ROM position: 0x01DEFE (without header)
Hex sequence: 4D 49 43 41 A2 BB B8 BE DD 5C B4 D8 B1 5C B6 D7 20 CA BD DE DA C3 B2 CF BD A3 08

It's a phrase from MICA, the ships computer that appears whenever you try and wander off just after landing - basically if you go anywhere other than the city or your ship, that phrase appears.

Now I need to step through what happens just after triggering that phrase to see where the pointer to it is being loaded from.