Keitai Denjuu Telefang/Notes: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 194: Line 194:
  8 |38|39|3A|3B|3C|3D|3E|3F|
  8 |38|39|3A|3B|3C|3D|3E|3F|
   +--+--+--+--+--+--+--+--+
   +--+--+--+--+--+--+--+--+
= SRAM =
Notes:
* This has been disassembled in the Telefang GitHub diassembly: https://github.com/telefang/telefang/blob/master/components/saveclock/integrity.asm
* The save format in Telefang is very similar to Medarot games on the Game Boy/Color.
== Save file header ==
An ASCII string exists in <code>0:A000-A00F</code>. This is used to determine if a save file is present. In Telefang, the string differs depending on the version (unlike the case with Medarot games):
* Telefang Power: "<code> TELEFANG POWER\x00</code>"
* Telefang Speed: "<code> TELEFANG SPEED\x00</code>"
(Note that <code>\x00</code> denotes a null byte with value <code>00</code>)
This string is compared against ROM offset <code>F61-F70</code> in both versions to determine if a save file is present. If the string is not present, the game assumes that the cartridge is brand new (or has its battery freshly replaced) and initializes the save by copying the string from the aforementioned ROM offset and initializes the save by filling the checksum region (see below) to <code>00</code>.
== Checksum ==
After the title screen, the game runs a checksum, adding up each byte from <code>0:A000-BFEF</code>. The result is a 16-bit number. This is compared to a 16-bit, big endian integer at <code>0:BFFE-BFFF</code>. If this doesn't match, a save file corruption message will appear afterwards, with Crypto crying (the screen is the same in both Power/Speed versions in the retail Japanese games). Once the player presses A to leave this screen, the file is erased.
Medarot 3, 4, and 5 also compute the checksum the same way and have the same SRAM addresses.
== Save file bit ==
At <code>0:BFFD</code> in SRAM, this value is <code>00</code> if a save file is not present, and <code>01</code> if it is.
== Converting saves across versions ==
Due to the difference in save file headers, save files from one version to another are not normally compatible. (Note that this section does not apply to Medarot games since the ASCII strings are the same in both versions of all games.)
To convert a Power Version save to a Speed Version save:
* Change the POWER string at the beginning to SPEED.
* Subtract <code>0x1C</code> from the checksum at <code>0:BFFE-BFFF</code>.
To convert a Speed Version save to a Power Version save:
* Change the SPEED string at the beginning to POWER.
* Add <code>0x1C</code> to the checksum at <code>0:BFFE-BFFF</code>.
{{Internal Data|game=Keitai Denjuu Telefang}}
{{Internal Data|game=Keitai Denjuu Telefang}}

Revision as of 00:23, 21 July 2023

Chip tiny.png The following article is a Notes Page for Keitai Denjuu Telefang.

Item Index Numbers

Here are index numbers for every item in the game. The first column is the name that the bootleg games (Pokémon Diamond/Jade) call it, and the second column is a more accurate translation of the original Japanese game.

00 = A-gun    (Flamethrower)
01 = Gun      (Gun)
02 = Revolver (Revolver)
03 = R-gun    (Bazooka)
04 = Mo-gun   (Machine Gun)
05 = Missile  (Missile)
06 = Bomb     (Bomb)
07 = Ma-gun   (Gatling Gun)
08 = Sabre    (Sabre)
09 = Drill    (Drill)
0A = Jet      (Jet Engine)
0B = Propelle (Propeller Engine)
0C = Dart     (Shuriken)
0D = Battery  (Battery)
0E = Shooter  (Archery Set)
0F = Range    (Microwave)
10 = Flatiron (Iron)
11 = Blender  (Mixer)
12 = Phone    (Telephone)
13 = Antenna  (Antenna)
14 = Spanner  (Spanner)
15 = Saw      (Saw)
16 = ChainSaw (Chainsaw)
17 = L-gun    (Beam Gun)
18 = Axe      (Axe)
19 = Screwdri (Screwdriver)
1A = Screw    (Screw)
1B = Spring   (Spring)
1C = Gear     (Gear)
1D = P-card   (Telecard)
1E = Spear    (Lance)
1F = Crane    (Crane)
20 = Dagger   (Army Knife)
21 = Sickle   (Sickle)
22 = Computer (Computer)
23 = Moving   (Laptop)
24 = Hammer   (Hammer)
25 = Injector (Syringe)
26 = Camera   (Camera)
27 = Video    (Video Camera)
28 = Flying   (Frypan)
29 = Pencil   (Pencil)
2A = Tire     (Tire)
2B = O-bottle (Gas Tank)
2C = Tap      (Faucet)
2D = Bucket   (Bucket)
2E = Cleaner  (Vacuum)
2F = Mouse    (Mouse)
30 = Key      (Key)
31 = Game     (Game Machine)
32 = Toy      (Plush)
33 = Pengpeng (Comic BonBon)
34 = Racket   (Scooter)
35 = Tsita    (Titarium)
36 = Luna     (Lunatium)
37 = Diamond  (Giamond)
38 = L-medal  (Round Medal)
39 = Tayta    (Titanyum)
3A = Reform1  (Mod Pass 1)
3B = Reform2  (Mod Pass 2)
3C = Reform3  (Mod Pass 3)
3D = Test1    (Experimental Pass 1)
3E = Test2    (Experimental Pass 2)
3F = Test3    (Experimental Pass 3)
40 = Baolan   (Biolent3)
41 = Gulap    (Graplight9)
42 = Jigay    (Gigaia00)

Location Index Numbers

Here are index numbers for the locations in the game.

00 - ???
01 - ???
02 - Overworld Map - Upper left quadrant
03 - Overworld Map - Upper right quadrant
04 - Overworld Map - Lower left quadrant
05 - Overworld Map - Lower right quadrant
06 - Antenna Tree - Upper left quadrant
07 - Antenna Tree - Upper right quadrant
08 - Antenna Tree - Lower left quadrant
09 - Antenna Tree - Lower right quadrant
0A - Toronko Village Water Station
0B - Mart/House
0C - Kurinon Village Cave - Floor 1
0D - Kurinon Village Cave - Floor 2
0E - Craft Laboratory
0F - Dementia's Mansion
10 - Tripa Antenna Tree Cave - Floor 1
11 - Tripa Antenna Tree Cave - Floor 2
12 - Tripa Antenna Tree Cave - Floor 3
13 - Tripa Antenna Tree Cave - Floor 4
14 - Tripa Antenna Tree Cave - Floor 5
15 - Peperi Mountain - Floor 1
16 - Peperi Mountain - Floor 2
17 - Peperi Mountain - Floor 3
18 - Peperi Mountain - Floor 4
19 - Peperi Mountain - Floor 5
1A - Kakutos Relic - Floor 1
1B - Kakutos Relic - Floor 2
1C - Kakutos Relic - Floor 3
1D - Kakutos Relic - Floor 4
1E - Kakutos Relic - Floor 5
1F - Kakutos Relic - Floor 6
20 - Kakutos Relic - Floor 7
21 - Kakutos Relic - Floor 8
22 - Burion Relic - Floor 1
23 - Burion Relic - Floor 2
24 - Burion Relic - Floor 3
25 - Burion Relic - Floor 4
26 - Burion Relic - Floor 5
27 - Burion Relic - Floor 6
28 - Burion Relic - Floor 7
29 - Burion Relic - Floor 8
2A - Burion Relic - Floor 9
2B - Human World - Main Area
2C - Human World - Antenna Tree
2D - Human World - Unused Buildings
2E - ???
2F - ???
30 - Room with Second D-Shoot
31 - Room with switch which activates Palm Sea Antenna Tree
32 - Sanaeba Laboratory - Floor 1
33 - Sanaeba Laboratory - Basement 1
34 - Sanaeba Laboratory - Basement 2

Denjuu Index Numbers

In this game, the index number for a Denjuu is the same as its number shown in the game.

Type Index Numbers

Here are index numbers for every type in the game. An accurate translation is listed first, followed by the translation used in the bootleg version.

00 = Mountain (Hill)
01 = Grassland (Land)
02 = Forest (Wood)
03 = Aquatic (Lake)
04 = Sky (Sky)
05 = Desert (Sand)
Anything else = glitch type

Using a glitch type can cause an erratic Exp. growth rate.

Stat Formula

The formula for calculating a Denjuu's stats is as follows:


Stat = Base Stat + (Current Level - 1) * Stat Growth / 2

  • Base Stat = The stat that the Denjuu starts out with at Level 1. This data is located from 1D4B48-1D5627. Each Denjuu has an array of 16 ($10) bytes, and the first six bytes are base HP, Speed, Attack, Defense, Denma Attack, and Denma Defense, in that order. The other ten bytes are unrelated and have other purposes.
  • Current Level = The current level that the Denjuu is at.
  • Stat Growth = This is an integer which determines how rapidly a stat increases every two levels. The data is from 09C715-09CB28, with an array of 6 bytes for every Denjuu. Again, the order is HP, Speed, Attack, Defense, Denma Attack, and Denma Defense.

  • Rounding rule: If a Denjuu is at level 2 or below, and a stat ends up being a non-whole number, it will round up. If it is at a level higher than 2, then it will round down. Note that due to how the formula is set up, a stat will always be a whole number at an odd level, so this rule is only necessary when the current level is even.
  • Max stats: If you know a Denjuu's base stat and stat growth rate, you can figure out the max stat. Since the highest possible level is 99, you can simplify the formula to:

Stat = Base Stat + 49 * Stat Growth

Map Coordinates

This diagram is how the game determines your position on the map. The values inside the cells are what the game uses to know where you are.

    1  2  3  4  5  6  7  8
  +--+--+--+--+--+--+--+--+
1 |00|01|02|03|04|05|06|07|
  +--+--+--+--+--+--+--+--+
2 |08|09|0A|0B|0C|0D|0E|0F|
  +--+--+--+--+--+--+--+--+
3 |10|11|12|13|14|15|16|17|
  +--+--+--+--+--+--+--+--+
4 |18|19|1A|1B|1C|1D|1E|1F|
  +--+--+--+--+--+--+--+--+
5 |20|21|22|23|24|25|26|27|
  +--+--+--+--+--+--+--+--+
6 |28|29|2A|2B|2C|2D|2E|2F|
  +--+--+--+--+--+--+--+--+
7 |30|31|32|33|34|35|36|37|
  +--+--+--+--+--+--+--+--+
8 |38|39|3A|3B|3C|3D|3E|3F|
  +--+--+--+--+--+--+--+--+

SRAM

Notes:

Save file header

An ASCII string exists in 0:A000-A00F. This is used to determine if a save file is present. In Telefang, the string differs depending on the version (unlike the case with Medarot games):

  • Telefang Power: " TELEFANG POWER\x00"
  • Telefang Speed: " TELEFANG SPEED\x00"

(Note that \x00 denotes a null byte with value 00)

This string is compared against ROM offset F61-F70 in both versions to determine if a save file is present. If the string is not present, the game assumes that the cartridge is brand new (or has its battery freshly replaced) and initializes the save by copying the string from the aforementioned ROM offset and initializes the save by filling the checksum region (see below) to 00.

Checksum

After the title screen, the game runs a checksum, adding up each byte from 0:A000-BFEF. The result is a 16-bit number. This is compared to a 16-bit, big endian integer at 0:BFFE-BFFF. If this doesn't match, a save file corruption message will appear afterwards, with Crypto crying (the screen is the same in both Power/Speed versions in the retail Japanese games). Once the player presses A to leave this screen, the file is erased.

Medarot 3, 4, and 5 also compute the checksum the same way and have the same SRAM addresses.

Save file bit

At 0:BFFD in SRAM, this value is 00 if a save file is not present, and 01 if it is.

Converting saves across versions

Due to the difference in save file headers, save files from one version to another are not normally compatible. (Note that this section does not apply to Medarot games since the ASCII strings are the same in both versions of all games.)

To convert a Power Version save to a Speed Version save:

  • Change the POWER string at the beginning to SPEED.
  • Subtract 0x1C from the checksum at 0:BFFE-BFFF.

To convert a Speed Version save to a Power Version save:

  • Change the SPEED string at the beginning to POWER.
  • Add 0x1C to the checksum at 0:BFFE-BFFF.