Keitai Denjuu Telefang/Notes

From Data Crystal
Jump to navigation Jump to search

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.

RNG

In Telefang, random events rely on a random number generator. The randomizer is identical to the one in Medarot 3, except for different RAM addresses. It is generated using the following variables:

  • The frame counter, located at 0xC3C0 in RAM. This is an 8-bit number, and it increments by 1 for every frame that passes (1 frame = 1/60 second). However, it temporarily freezes in certain situations, such as when voice samples are played. The frame counter makes random actions frame dependent.
  • Seed 1, located at 0xC41F in RAM. This value is also an 8-bit number, and it changes every time a random event occurs, and its value depends on the current value of the frame counter, as well as the current values of both seeds.
  • Seed 2, located at 0xC420 in RAM. This 8-bit value functions similarly to Seed 1, although it influences the randomly generated number more than Seed 1.
  • Seed sum, the 8-bit sum of the two seeds, located at 0xC4A0 in RAM. This is the randomly generated number, most directly used to determine random events.

The RNG function is located at 0x04DE in ROM.

Seed calculation

First, the game takes the current value of the frame counter and uses a formula to calculate a new 16-bit number, which is later added to the seeds.

F = (Frame counter * 256) + ((int(((Swap nibbles(Frame counter) + 1) mod 256) / 2) + 135) mod 256)

Next, the game calculates a number based on the current value of the two seeds. This formula is simpler:

S = Seed 1 * 256 + Seed 2

To obtain seed 1:

Seed 1new = ((F+S) mod 256)

To obtain seed 2:

Seed 2new = (int(((F+S) mod 65536)/256)) xor ((F+S) mod 256)

The seeds are then added together (reduced to 8 bits), and this is the randomly generated number.

Wild Denjuu

Species

Located at ROM offset 3C57

Random number range Probability Denjuu Group
0-24 10% Denjuu 4
25-75 20% Denjuu 3
76-152 30% Denjuu 2
153-255 40% Denjuu 1

Level

Located at ROM offset 701B8

Random number range Probability Level offset
0-63 25% +1
64-127 25% -1
128-255 50% 0

Personality

Located at ROM offset 702A1

Random number range Probability Personality
0-19, 240-255* 14% 0 - のんびり
20-39 8% 1 - ちょーのんびり
40-59 8% 2 - あわてもの
60-79 8% 3 - ちょーあわてもの
80-99 8% 4 - わがまま
100-119 8% 5 - ちょーわがまま
120-139 8% 6 - おくびょう
140-159 8% 7 - ちょーおくびよう
160-179 8% 8 - おこりんぼ
180-199 8% 9 - ちょーおこりんぼ
200-219 8% 10 - りちぎ
220-239 8% 11 - ちょーりちぎ

Battle events

Move accuracy

Located at ROM offset 167E9

More research needed!

(<0xD597>/8 + 245 - <0xD49B>/2)/256

Little is known about 0xD597, but preliminary research suggests that it's based on the speed of the attacking Denjuu. Accuracy modifiers seem to increase this value, but this appears to max out at a certain value (which seems to vary based on other variables), possibly to prevent overflow in the formula. Likewise, little is known about 0xD49B, but preliminary research suggests that it's based on the speed of the defending Denjuu. Evasion modifiers seem to increase this value (there may be a limit, but it isn't known yet). Despite the values being based off of the speed stat, speed modifiers don't affect this value.

If the move used doesn't target the opponent Denjuu (i.e. it affects itself, like a stat boosting move), then both of these values seem to be based on the Speed stat (likely with evasion modifiers applied, but this is not confirmed) of the opponent Denjuu.

Critical hits

Located at ROM offset 1707B

Random number range Probability Effect
0-15 6.25% Critical hit!
16-255 93.75% Regular hit

Damage calculation

Added effects of moves

Status effects

Personality flaws

Located at ROM offset 154BE (for personalities 0-3); 13746 (for personalities 4-5); 16D0C (for personalities 6-7); 14B38 (for personalities 8-9) --> More research needed!

For some personalities, including 0 (のんびり), 1 (ちょーのんびり), 2 (あわてもの), 3 (ちょーあわてもの) (late to arrive), 6 (おくびょう), 7 (ちょーおくびよう) (prone to run away), 8 (おこりんぼ), and 9 (ちょーおこりんぼ) (attacking on its own):

Random number range Probability Effect
Probability: ((FD*2+55) mod 256)/256
When FD = 1:
0-56 22% Act normal
57-255 78% Misbehave
When FD = 100:
0-254 99.6% Act normal
255 .4% Misbehave

For other personalities, including 4 (わがまま) and 5 (ちょーわがまま) (refusing to attack):

Random number range Probability Effect
Probability: ((FD+155) mod 256)/256
When FD = 1:
0-155 61% Act normal
156-255 39% Misbehave
When FD = 100:
0-254 99.6% Act normal
255 .4% Misbehave

Notes:

  • In both cases, due to an oversight, when FD = 100, there is a 1/256 chance that the Denjuu will misbehave, which occurs when the random number comes up as 255. This is similar to the 99.6% accuracy glitch in early Pokémon games.
  • There is a glitch that makes it possible to make the Denjuu's FD exceed 100. Since the formulas are not meant for the FD to exceed 100, an integer overflow glitch occurs, making the probability of the Denjuu acting normal very low.

AI

Target selection
Move selection

Escaping

Located at ROM address 70A99 More research needed!

When 0xD504 <= 0xD546 (note: these addresses' behavior aren't completely known; see below):

Random number range Probability Effect
0-199 78% Unable to escape
200-255 22% Able to escape

When 0xD504 > 0xD546 (note: these addresses' behavior aren't completely known; see below):

Random number range Probability Effect
0-84 33% Unable to escape
85-255 67% Able to escape

Little is known about 0xD504, although it appears to be based on the Speed of the user's leading Denjuu. This appears to be affected by speed modifiers as well. Likewise, little is known about 0xD546, although it appears to be based on the Speed of the opponent's leading Denjuu, and may also be affected by speed modifiers (although this is not confirmed).

Before a battle, however, these values are always 0. Therefore, when trying to escape before the battle starts, the probability of being able to escape is always 22%.

Note: In some battles, particularly where a boss or other NPC is fought, the RNG is not invoked, and the player will never be able to escape.

Denjuu giving out number

Located at ROM offset 741C9

If player does not yet have any other befriended Denjuu of the same species:

Random number range Probability Effect
0-152 60% Denjuu offers number
153-255 40% Denjuu does not offer number

If player has at least one other befriended Denjuu of the same species:

Random number range Probability Effect
0-15 6.25% Denjuu offers number
16-255 93.75% Denjuu does not offer number