data/claims/genghis-khan-ii-snes-battle.yamlGenghis Khan II (SNES) battles, read and called in the ROM (no disassembly)
The game draws its random numbers from a linear congruential generator with the constants of the example rand() in the C standard: each draw multiplies a 32-bit seed by 1,103,515,245, adds 12,345, and returns bits 16 to 30 of the new seed, a number from 0 to 32,767. A draw below n is that number's remainder by n. genghis-khan-ii-snes-battle/random
Value: multiplier 1103515245 · increment 12345 · shift 16 · mask 32767 · seed $7E4DCE
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x44688-0x446F5 — $C4:4688: the seed at $7E:4DCE (32 bits) times $41C64E6D plus $3039, stored back, then shifted right 16 and masked with $7FFF; $C4:46E2, a draw below n (its argument): 0 when n is 0, else the draw's remainder by nISO/IEC 9899:TC3, Committee Draft (N1256) · p. 312, §7.20.2.2 — the standard's example of a portable rand(); its result is bits 16 to 30 of the new seed, as the game's isnext = next * 1103515245 + 12345; return (unsigned int)(next/65536) % 32768;Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: it calls $C4:46E2 from written seeds for n of 0, 1, 3, 5, 100 and 32,767, and each result and new seed equals the model'sRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjs$C4:46D4 sets the seed's low word from its argument and clears the high word. The supply and combat-turn routines below draw through $C4:46E2. Where the game seeds it isn't read.
Cited by: Genghis Khan II: Clan of the Gray Wolf, Romance of the Three Kingdoms II
The main display names the season by the season counter, which runs 0 to 3 from the first season of the year: Spr, Sum, Atm and Win, that is spring, summer, autumn and winter. Scenario 1 starts in spring. genghis-khan-ii-snes-battle/season-names
Value: counter $7E48E5 · names Spr, Sum, Atm, Win
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x44AE0-0x44B2E — $C4:4AE0, the date on the main display: the season counter ($7E:48E5) times 3 plus $C6:9A49 ($C1:FD8D), and the 24-bit address found there passed to the print routine ($C7:3CA5) with the format at $C4:CDC5Genghis Khan II - Clan of the Gray Wolf (USA) · 0x69A49-0x69A64 — four 3-byte addresses, then the names Spr, Sum, Atm and Win, each ended by a 0Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C4:4AE0 called with the counter at 0, 1, 2 and 3 picks the entries naming Spr, Sum, Atm and Win, and Scenario 1's main display draws Spr with the counter at 0Revised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsThe probe calls $C4:4AE0 with the counter at 0 to 3, stops once the entry is picked ($C4:4B1C), and follows the entry's address to the name; it also plays Scenario 1 to the main display, where the counter is 0 and the date drawn reads Spr. $C6:7F30 picks the name the same way for another display, not traced. The seasons in weather and weather-chances, and the economy set's season counter (genghis-khan-ii-snes/disaster-schedule), are named from this.
Cited by: Genghis Khan II: Clan of the Gray Wolf
When legions meet, the combat display lasts a random number of turns set by the battle's weather: 9 to 13 when it is sunny or cloudy, 7 to 11 in rain, and 5 to 9 in snow and in the four severe weathers, heat wave, sandstorm, storm and heavy snow. The count is the base plus a draw below 5. genghis-khan-ii-snes-battle/combat-turns
About: Genghis Khan II: Clan of the Gray Wolf Turn order
Value: base 9, 9, 7, 5, 5, 5, 5, 5 · draw 5 · weather $7E2225 · turns $7E563C
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x75F4C-0x75F92 — $C7:5F4C: a draw below 5, plus 9 when the weather byte $7E:2225 is 0 or 1, 7 when it is 2, else 5; $C7:61F8 calls it and stores the result in $7E:563C as the combat display opensGenghis Khan II - Clan of the Gray Wolf (USA) · 0x2CB1D-0x2CB71 — the weather names, eight 24-bit pointers in the weather byte's order: Sunny, Cloudy, Rainy, Snow, Heat wave, Sandstorm, Storm, Heavy snowGenghis Khan II - Clan of the Gray Wolf (USA) · 0x761F8-0x76203 — $C7:61F8: JSL $C7:5F4C, then STA $7E:563C of its result (8-bit)Genghis Khan II - Clan of the Gray Wolf (USA) · 0x39A5D-0x39A69 — $C3:9A5D: LDA $7E:563C, DEC, STA $7E:563CGenghis Khan II - Clan of the Gray Wolf (USA) · 0x30C1A-0x30C25 — $C3:0C1A, in the weather draw $C3:0A1B: LDA $7E:2225, ORA #$04, STA $7E:2225, when a flag the draw sets is onChecked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C7:5F4C called for each of the eight weather bytes with seeds that give each draw 0 to 4 returns the base plus the draw, through the branch the weather names; and in a played battle (Scenario 1, Temujin's one legion against the Tartars at Kerulen River on its first day, cloudy) the combat display shows the count $7E:563C holds, within 9 to 13Revised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsThe manual says only that the weather sets the number of combat turns (genghis-khan-ii/combat). The weather draw ($C3:0A1B) stores 0 to 3 in the weather byte and then may add $04 ($C3:0C1A); with the names' order that pairs each severe weather with a mild one (Sunny 0 and Heat wave 4, Cloudy 1 and Sandstorm 5, Rainy 2 and Storm 6, Snow 3 and Heavy snow 7), a pairing read from the order, not tested. A draw below 5 from 15 bits is near-even: 0 to 2 come up 6,554 times in 32,768 and 3 and 4 6,553. $C3:9A5D counts $7E:563C down by one; that it does so once a combat turn isn't run.
Cited by: Genghis Khan II: Clan of the Gray Wolf
Each time the battle map draws its weather, every legion's supply falls by a draw below 3, plus 1 in rain or snow and 2 in severe weather, but not below 0. A legion left with no supply loses a tenth of each unit's soldiers, rounded down. The tenth is taken of the soldier count's low byte, so a count above 255 loses a tenth of its remainder by 256. genghis-khan-ii-snes-battle/supply
Value: draw 3 · rain or snow 1 · severe 2 · loss percent 10 · supply +7 · soldiers +2
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x30FAB-0x311B8 — $C3:0FAB: a draw below 3, plus 2 when the weather byte has $04 set, else plus 1 when it is 2 or 3; then for each of the ten legion records ($7E:26C4, 15 bytes each) the supply byte +7 falls by the smaller of itself and that amount ($C4:4519, which returns what is left); when 0 is left and the legion is in the battle (bit 3 of +14), each live unit (bit 7 of its first byte; 4-byte records from $7E:275A, four a legion) loses soldiers × 10 ÷ 100 ($C4:42F4, of the low byte +2) from that byte. When the legion's +14 lacks bit 4 ($10) and it has live units, the message routine follows (read, not run)Genghis Khan II - Clan of the Gray Wolf (USA) · 0x313A9-0x313B5 — $C3:13A9, the routine's one caller: the weather draw ($C3:0A1B), then this routine, then $C3:11E8Genghis Khan II - Clan of the Gray Wolf (USA) · 0x30A1B-0x30C46 — $C3:0A1B, the weather draw: STA $7E:2225 of 0 ($C3:0A7C), 1 ($C3:0AD4, $C3:0C0B), 2 ($C3:0AE1) or 3 ($C3:0B85), then the $04 of severe weather ($C3:0C22)Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C3:0FAB called for each of the eight weather bytes and each draw 0 to 2, with supply 0, 1, 2 and 5 (so legions already out, running out, and keeping some), on a legion of four units (37, 9 and 300 men, and a dead unit of 50): supply and soldiers match the model in every case (37 loses 3, 300 loses 4, a tenth of 44); a second legion record without bit 3, also out of supply, loses no men; and in the played battle (Scenario 1) the legion sent with no food has supply 0Revised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsA legion with no supply loses a tenth of its men each time the routine runs, and one that runs out loses it the time it does; the manual says only that "Units with low supply are more liable to lose Soldiers" (genghis-khan-ii/army). The supply byte is named by the played battle: the probe's legion, sent with no food, has 0 there. What calls $C3:13A9 isn't read, so that the routine runs once a battle day is inferred, not shown. The probe sets $10 in +14 so that no message waits for a button; what $10 marks isn't read.
Cited by: Genghis Khan II: Clan of the Gray Wolf
Each of the 16 unit types has a row of eight numbers. Three are attack ratings, one for each of the two close attacks and one for a third attack, and one is a defence rating, which the loss in close combat reads. One of the close attacks also tests another number of the row before it is made. genghis-khan-ii-snes-battle/unit-ratings
0x38606-0x38641 — $C3:8606: the byte at the combat record's type (+1) times 8 plus the column, from $C2:CB72Genghis Khan II - Clan of the Gray Wolf (USA) · 0x2CB72-0x2CBF1 — the bytes the table spec readsGenghis Khan II - Clan of the Gray Wolf (USA) · 0x3E8EB-0x3E9A6 — the bytes the table spec readsGenghis Khan II - Clan of the Gray Wolf (USA) · 0x26330-0x2634B — $C2:6330: takes 3 from $7E:563B, then calls the strength routine $C2:5AE4 with attack column 2Genghis Khan II - Clan of the Gray Wolf (USA) · 0x38642-0x3865E — $C3:8642: the type's byte at column 5 ($C3:8606); 0 when it is 5, else 1Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: the strength routine, called for every type with each of the three attacks, and the loss routine, called for six types, return what this table's Attack and Defence columns giveRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsSixteen rows of eight bytes, a row a unit type in the unit types list's order, whose names the unit column reads from that list (genghis-khan-ii-snes-tables/unit-types). $C3:8606 returns the byte of a combat record's type (its +1) at a column it is given. The strength routine ($C2:5AE4) reads column 3 plus its second argument (strength): the close attack that costs 3 passes 0 (Attack A) and the one that costs 5 passes 1 (Attack B) (damage's $C2:621F and $C2:6505), and the attack at $C2:6330, which also costs 3, passes 2 (Attack C); the loss routine ($C2:5DE5) reads column 6 (Defence) (damage). The costs come off the acting unit's points ($7E:563B), which the game's "Not enough mobility" message suggests are its mobility; the commands' names on the menu aren't read. $C3:8642 returns 0 for a type whose Attack C is 5 and 1 otherwise; it is called from the combat command code ($C3:AA3B) and from $C7:6AC3, neither read, so that it says whether a unit can make the third attack is inferred; the bow units (Shortbow, Longbow, Crossbow, Archers) all have it, which suggests a ranged attack, an inference. Column 1 (+1) is added to a legion number before a test the 5-point attack makes ($C2:6524: their sum divided by 64 must not be 0) and in the Revive chance (revive). +2 runs from 5 to 11, with the Mongols' 11 the highest, and is likely the basic mobility the manual names (genghis-khan-ii/combat), not read. +0 (0, 1 or 2) and +7 (255, or 1 to 3 for Artillery, Elephants and Catapult) aren't read.
Cited by: Genghis Khan II: Clan of the Gray Wolf
In close combat a unit's strength is its soldiers, times its type's rating for the attack plus 1 (a rating of 5 counts as 0), times the sum of three parts: its legion's level plus 1; the legion's supply and its army's arms and training levels, added, divided by 30 and halved; and its commander's war grade plus 1, counted twice for the unit he leads and 0 for a legion with no commander. Each division rounds down. genghis-khan-ii-snes-battle/strength
Value: divisor 30 · rating plus 1 · rating mod 5 · led 2
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x25AE4-0x25BFC — $C2:5AE4 (a combat record, an attack column): L = the legion's +7, plus the side record's +3 and +2, ÷ 30; R = the type's byte at column 3 + the attack ($C3:8606), mod 5, + 1, × the record's +8 (soldiers); P = ((+9 + 1) × 2 + L) ÷ 2; W = 0 when the legion's commander pointer (+0 to +2) is 0, else his war grade ($C4:65E3) + 1, doubled when the record's first byte has $04; returns R × P + R × W in 16 bitsGenghis Khan II - Clan of the Gray Wolf (USA) · 0x3858A-0x385BB — $C3:858A: a combat record's legion: (record − $7E:5646) ÷ 13 ÷ 4 picks the byte at $7E:28D7 or $7E:28D8, a legion number, and $C3:75F5 gives its record at $7E:26C4 + 15 × nGenghis Khan II - Clan of the Gray Wolf (USA) · 0x375CD-0x37625 — $C3:75CD, a side record at $7E:26B2 + 9 × side; $C3:760B, a legion record's side, (record − $7E:26C4) ÷ 15 ÷ 5Genghis Khan II - Clan of the Gray Wolf (USA) · 0x38AC9-0x38B3C — $C3:8AC9, after "Will you lead the unit": ORA #$04 into the unit's combat record, the flag that doubles the war partChecked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C2:5AE4 called on written combat, legion and side records for all 16 types and three attack columns, soldiers 0 to 255, levels 0 to 9 and 255, supply and state numbers 0 to 255 (sums either side of 30), war grades 0 to 5, with and without a commander and the led flag: every strength matches the modelRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsCombat records are 13 bytes from $7E:5646, four a side: +0 flags ($80 alive, $08 confused, $04 led by the commander), +1 type, +5 the row on the combat map, +8 soldiers (a byte). The played battle's records hold the units' types and soldiers ($7E:275A). The level is the legion's +9 (legion-level). The two state numbers are the side record's +2 and +3, copied from the state's +39 and +40 ($C7:4AD3, legion-level), its Arms Level and Training Level (genghis-khan-ii-snes/soldiers-pay); supply is the legion's +7 (supply). In the played battle (Scenario 1) they are 30 and 91 for Temujin's army and 57 and 59 for the Tartars'. A strength above 65,535 keeps its remainder by 65,536, since the routine returns 16 bits; whether play can reach that isn't worked out. The war grade is the character record's (+16, bits 4-6; genghis-khan-ii-snes-tables/character-data).
Cited by: Genghis Khan II: Clan of the Gray Wolf
A close attack costs both units soldiers at once. The target's share of the two strengths, in percent, is rounded down and held between 1 and 99 (50 when both are 0); the attacker's share is the rest. The target loses its soldiers times a random 90 to 109%, times the attacker's share squared over the sum of both shares squared, divided by 5 plus its type's defence rating, at most 200; plus the attacker's share divided by its own; doubled if the target is confused; plus a random 1 to 3. The attacker loses the same with the shares swapped, never doubled. Each division rounds down. A unit loses at most the soldiers it has, and only the loss's remainder by 256. In some battles a unit of the second side, in one of the combat map's first four rows, adds a tenth or a twentieth of the battle's state's defense strength to its defence. genghis-khan-ii-snes-battle/damage
Value: spread 90, 20 · cap 200 · defence plus 5 · extra 3 · bonus div 10, 20 · rows 3 · low 50 · clamp 1, 99
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x26080-0x2621E — $C2:6080 (attacker, target, attack column): r = $C4:455D(strength of target, strength of attacker); the target's loss = $C2:5DE5(target, (100 − r)², r² + (100 − r)²) + (100 − r) ÷ r, doubled when the target's flags have $08, + a draw below 3 + 1; then the confusion test and $C2:5D3B(target, loss); the attacker's = $C2:5DE5(attacker, r², the same sum) + r ÷ (100 − r) + a draw below 3 + 1, its test, $C2:5D3B(attacker, loss); then $C2:5902(attacker), and $C2:5902(target) only when that returns 0Genghis Khan II - Clan of the Gray Wolf (USA) · 0x4455D-0x445AB — $C4:455D(a, b): 50 when both are 0, else a × 100 ÷ (a + b) (32-bit product, the sum in 16 bits) held between 1 and 99Genghis Khan II - Clan of the Gray Wolf (USA) · 0x25DE5-0x25EC8 — $C2:5DE5(unit, a, b): the unit's soldiers × (90 + a draw below 20) ÷ 100 ($C4:42F4), × a ÷ b ($C4:42CF), ÷ (its type's column 6 + 5 + B), at most 200 ($C4:4199); B is the byte at +19 of the state record $7E:28B4 points to, ÷ 10 when $7E:28DA is 1 and ÷ 20 when it is 2, if $C2:584C holdsGenghis Khan II - Clan of the Gray Wolf (USA) · 0x2584C-0x258AB — $C2:584C(unit): $7E:28DA is 1 or 2, the unit's legion is on side 1, and its record's +5 (the row) is at most 3Genghis Khan II - Clan of the Gray Wolf (USA) · 0x25D3B-0x25DE4 — $C2:5D3B(unit, loss): $C4:4519 takes the smaller of the soldiers and the loss's low byte from +8; at 0 soldiers the unit's $80 and $08 are cleared and the death display followsGenghis Khan II - Clan of the Gray Wolf (USA) · 0x2621F-0x2623B — $C2:621F: takes 3 from $7E:563B, then calls $C2:6080 with attack column 0Genghis Khan II - Clan of the Gray Wolf (USA) · 0x26505-0x2655C — $C2:6505: takes 5 from $7E:563B, and if the legion's +8 plus the type's +1, divided by 64, isn't 0, calls $C2:6080 with attack column 1Genghis Khan II - Clan of the Gray Wolf (USA) · 0x3AB31-0x3AB4B — $C3:AB31: the acting unit ($7E:5641) as the first argument and the record in its $26 as the second, to $C2:6505; $C3:AB40 the same to $C2:621FChecked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C4:455D at the clamps, the zero case and a wrapping sum; $C2:5DE5 for draws 0, 7 and 19, six types, place bytes 0 to 3, rows 0 to 4 and 255, both sides; and the exchange ($C2:6096 to $C2:6204) over 160 random pairs of units and the edge cases below (deaths, a doubled loss past 255, the bonus): every unit's soldiers and flags match the modelRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsWhich argument is the attacker is read from the callers: the two attack commands take their cost from the acting unit's points ($7E:563B), and the combat command code ($C3:AB31) passes them the acting unit first, and the loss routine clears those points when the unit that dies is the acting one ($7E:5641). The draws come in order: the target's 90 to 109%, its 1 to 3, the 2% confusion draw if it is made (confusion), then the same three for the attacker. The loss is worked out in 16 bits; the confusion test sees all of it, and $C4:4519 takes only its low byte: a confused unit of 255 soldiers against one with 1% of the strength loses 282 by the formula, which takes 26. The shares' sum wraps at 65,536 (two strengths of 32,768 give 99). The defence bonus: in the played battle (Scenario 1, at Kerulen River) $7E:28DA is 1, $7E:28B4 points to Kerulen River's state record, whose +19 is 10, and the defending units start in row 0 and the attacker's in row 12; +19 is the state's Defense Strength (genghis-khan-ii-snes/state-drift); what $7E:28DA marks isn't read. The second side is the legion that $7E:28D8 names, whose units are combat records 4 to 7 (strength's $C3:858A); in the played battle it is the Tartars', defending Kerulen River, and its units start in the rows the bonus covers, so that the bonus is the defender's in its starting rows is suggested by that battle only. The probe calls the exchange from $C2:6096, after a display call ($C2:4586), and stops at $C2:6204, before $C2:5902, which isn't read; a new confusion and a death stop it earlier, at their displays.
Cited by: Genghis Khan II: Clan of the Gray Wolf
A unit hit in close combat for more than a fifth of its soldiers becomes confused; a smaller hit confuses it 2% of the time. The test comes before the soldiers are taken and sees the whole loss. A unit already confused stays so, and one with no soldiers isn't confused. genghis-khan-ii-snes-battle/confusion
Value: fifth 4 · chance 2
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x26138-0x26172 — $C2:6138: the target's soldiers ÷ its loss, compared with 4 ($C1:FCD6: 1 when it is above 4); above, $C4:4667(2) (a draw below 100 less than 2) decides; when the test passes, $C2:6025(target). The attacker's test, $C2:61BD to $C2:61F7, is the sameGenghis Khan II - Clan of the Gray Wolf (USA) · 0x26025-0x2607F — $C2:6025: when the unit's flags lack $08 and its soldiers aren't 0, ORA #$68, then the display ($C2:5EC9, $C3:9161), then AND #$9F, which leaves $08 setGenghis Khan II - Clan of the Gray Wolf (USA) · 0x385F5-0x38605 — $C3:85F5: a combat record's flags AND $08, the test the recovery routine starts with (recovery)Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: in the exchange, each unit's test reaches $C2:6025 where the model confuses it, for heavy hits and for 2% draws of 0 and 1, and passes it for draws of 2 and 99; for each unit, soldiers of exactly 5 times its loss go on to the 2% draw and 1 fewer confuse it; $C2:6025 called alone sets $08 on a unit that lacks it and leaves a confused unit and one with no soldiers as they wereRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsSoldiers ÷ loss, rounded down, is 4 or less exactly when the loss is more than a fifth of the soldiers. That $08 is confusion is read from the recovery routines, which test it and clear it (recovery, revive). A confused target takes twice the loss (damage). The probe stops at the call of $C2:6025, which runs the confusion display, and calls $C2:6025 by itself to its store, $C2:6061, before the display.
Cited by: Genghis Khan II: Clan of the Gray Wolf
A confused unit recovers with a chance of 2% times one more than its legion's level, 2 to 10%, and twice that for the unit its commander leads. genghis-khan-ii-snes-battle/recovery
Value: per 2 · led 2
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x397E4-0x39877 — $C3:97E4: for the acting unit ($7E:5641), 0 when $C3:85F5 finds it not confused; else (legion +9 + 1) × 2, doubled when its flags have $04, to $C4:4667; on a pass AND #$F7 and the display, returning 0, else 1Genghis Khan II - Clan of the Gray Wolf (USA) · 0x3994B-0x3997F — $C3:994B, the combat turn's loop: each entry of the order list with points left makes its unit the acting one; when $C3:85E4 holds, $C3:97E4, and a result of 1 skips the unit's actionChecked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C3:97E4 called for levels 0 to 4, led and not, with draws at the chance and one below it, reaches the recovery branch where the model recovers and returns 1 where it doesn't; a unit not confused goes straight to the routine's endChecked by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsThe manual credits leadership with quicker recovery (genghis-khan-ii/ability-effects); this test reads the legion's level, and the Revive command reads leadership (revive). The combat turn's loop runs the test as the unit's action comes up, and a unit that stays confused loses that action, as the loop reads (not run); what $C3:85E4 tests isn't read.
Cited by: Genghis Khan II: Clan of the Gray Wolf
The Revive command frees a confused unit with a chance in percent of a third, rounded down, of three numbers added: its commander's leadership grade times 10 plus 20 (10 with no commander), a number of its legion's up to 100, and a number of its unit type's. genghis-khan-ii-snes-battle/revive
Value: per 10 · plus 20 · none 10 · div 3
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x3885B-0x38961 — $C3:885B: takes 4 from $7E:563B; 10, or the commander's leadership grade ($C4:65FE) × 10 + 20; plus the legion's +8 and the type's +1; ÷ 3 to $C4:4667; on a pass AND #$F7 and the displayGenghis Khan II - Clan of the Gray Wolf (USA) · 0x3B495-0x3B4DC — $C3:B495: "No unit is confused" or "Revive which unit?", then the choice; the command's name is the second message'sChecked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C3:885B called with leadership grades 0 to 4 and no commander, legion numbers and types, and draws at the chance and one below it, reaches the clearing branch where the model frees the unit and the other where it doesn'tChecked by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsThe legion's number is its +8, at most 100 when the legion forms (legion-level); the type's is the ratings table's +1 (unit-ratings). The leadership grade is the character record's +17 bits 0-2 (genghis-khan-ii-snes-tables/character-data, where leadership is inferred). The command costs 4 of the acting unit's points.
Cited by: Genghis Khan II: Clan of the Gray Wolf
A legion's level, 0 to 4, comes from twice a number of the legion's (at most 100) and its army's arms and training levels, added and divided by 3: 100 or more is level 4, 70 to 99 level 3, 50 to 69 level 2, 30 to 49 level 1, and less is 0. genghis-khan-ii-snes-battle/legion-level
Value: thresholds 30, 50, 70, 100
Code notesGenghis Khan II - Clan of the Gray Wolf (USA) ·0x74636-0x746D9 — $C7:4636: the legion's +8 = the smaller of 100 and a sum of three numbers; then (+8 × 2 + the side record's +2 and +3) ÷ 3 against 100, 70, 50 and 30, and the level stored at +9Genghis Khan II - Clan of the Gray Wolf (USA) · 0x74AD3-0x74B08 — $C7:4AD3: the side record's +2 and +3 from the state's +39 and +40 ($C4:6481)Revised after a check by a second AI model, 2026-11-16.Read, not run. The side record's +2 and +3 are copied from the state's +39 and +40, its Arms Level and Training Level (genghis-khan-ii-snes/soldiers-pay). The played battle's legions hold levels 4, 4 and 3 at +9 and 100, 92 and 69 at +8. The three numbers summed into +8 aren't read, and the routine's callers aren't traced, so when the level is worked out (when a legion forms, or again later) isn't known. The level feeds strength and recovery.
Cited by: Genghis Khan II: Clan of the Gray Wolf
Each of the eight climates has a chance of sunny weather and a chance of cloudy weather for each season, and a chance that winter rain falls as snow. genghis-khan-ii-snes-battle/weather-chances
0x3EAD7-0x3EB1E — the bytes the table spec readsChecked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: the weather draw, called for every climate and season, chooses as these chances say at each chance's edgeRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsEight rows of eight bytes at $C3:EAD7, a row a climate (the top three bits of the state's +42, read by $C4:6700) and two bytes a season ($7E:48E5, 0 to 3); then eight bytes at $C3:EB17, a climate's snow chance. Seasons 0 to 3 are spring to winter, as the main display names them (season-names). The cloudy chance applies only to a day that isn't sunny (weather). Which climate is which isn't known (the same open question as in genghis-khan-ii-snes/disaster-chances).
Cited by: Genghis Khan II: Clan of the Gray Wolf
The battle map's weather is drawn from its state's climate and the season: sunny with the climate's sunny chance, else cloudy with its cloudy chance, else rain, which in winter falls as snow with the climate's snow chance. A state that carries the mark a drought or blizzard leaves has a 5% chance of a heat wave on a sunny summer day and of heavy snow on a snowy one. The mark of a typhoon or sandstorm turns summer and autumn rain into a storm half the time, and a spring day that isn't rainy into a sandstorm 5% of the time. genghis-khan-ii-snes-battle/weather
Value: heat 5 · storm 50 · heavy snow 5 · sandstorm 5 · weather $7E2225 · season $7E48E5
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x30A1B-0x30C46 — $C3:0A1B: the row at $C3:EAD7 + climate × 8 + season × 2; chance(the first byte): 0, and in season 1 when the state's +43 has $04 ($C4:6D7D), chance(5) sets the severe flag; else chance(the second byte): 1; else 2, and in seasons 1 and 2 when +43 has $02 ($C4:6D65), chance(50) sets it; in season 3, chance($C3:EB17 + climate): 3, and with $04, chance(5) sets it. Then in season 0, unless the weather is 2, with $02, chance(5) stores 1 and sets it. The severe flag ORs $04 into $7E:2225 and runs a displayGenghis Khan II - Clan of the Gray Wolf (USA) · 0x46D65-0x46D94 — $C4:6D65 and $C4:6D7D: the state's +43 AND $02, and AND $04Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C3:0A1B called for the eight climates, four seasons and four sets of marks, with seeds that put each of its draws just under and at its chance: the weather byte and the severe flag match the model in every caseRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsSeasons 0 to 3 are spring to winter, as the main display names them (season-names). The state is the one $7E:28B4 points to, Kerulen River's in the played battle (damage). chance(n) is $C4:4667, a draw below 100 less than n. Each test draws only when it is reached, so a state without the mark makes no draw for it. The marks are those of genghis-khan-ii-snes/rate's notes: $02 for a sandstorm or typhoon and $04 for a blizzard or drought. With the weather names' order (combat-turns), the severe flag makes sunny a heat wave, cloudy a sandstorm, rain a storm and snow heavy snow; the spring sandstorm stores cloudy first, so it replaces a sunny day too. The routine runs before the supply routine at each call of $C3:13A9 (supply); that this is once a battle day is inferred. The probe stops at $C3:0C16, before the display.
Cited by: Genghis Khan II: Clan of the Gray Wolf
On the combat display a unit's mobility is the third number of its type's ratings row, times 10 plus the smaller of its legion's level plus 1 and its commander's leadership grade plus 1 (0 with no commander), divided by 10 and rounded down, at least 5 and at most 15. Units act in order of mobility, highest first; of units with equal mobility the one earlier in the combat records acts first. genghis-khan-ii-snes-battle/mobility
Value: scale 10 · max 15 · min 5 · list $7E5762
VerifiedGenghis Khan II - Clan of the Gray Wolf (USA) ·0x76B26-0x76DEE — $C7:6B26: for each of the eight combat records whose flags have $80 ($C3:85E4), m = the smaller ($C4:4199) of the legion's +9 + 1 and, when it has a commander, his leadership grade ($C4:65FE) + 1, else 0; the mobility is the type's +2 × (10 + m) ÷ 10 ($C4:42CF), at least 5 ($C4:41AA) and at most 15; then eight times the record with the highest mobility (the first of equals) goes into the list at $7E:5762, a record's number and its mobility, until none is left above 0Genghis Khan II - Clan of the Gray Wolf (USA) · 0x3994B-0x3997F — $C3:994B: the combat turn's loop takes each list entry's record and mobility, the latter as the acting unit's points ($7E:563B)Checked by claude, 2026-11-16 — ran probes/genghis-khan-ii/battle/battle.mjs in MesenCE: $C7:6B26 called on eight written combat records of every type, levels 0 to 4, leadership 0 to 4 and no commander, with dead units and ties: the order list matches the model in every caseRevised after a check by a second AI model, 2026-11-16.Probe: probes/genghis-khan-ii/battle/battle.mjsThe manual says mobility comes from basic mobility, legion level and the commander's leadership, at most 15 (genghis-khan-ii/combat); the code takes the smaller of the level and the leadership, so a legion's level caps what its commander's leadership adds. That the ratings row's third number (+2, unit-ratings) is the manual's basic mobility is inferred; it runs from 5 to 11, so the floor of 5 never acts. The list's mobility is the points the unit's commands spend: the close attacks cost 3 and 5, Revive and leading a unit 4 (damage, revive, strength); "Not enough mobility" is the game's message. Records 0 to 3 are the units of the legion $7E:28D7 names (strength's $C3:858A); in the played battle that is Temujin's, attacking, so there his units come first among equals. Whether the attacker's legion is always the first isn't read. Where the routine is called ($C7:77CC) isn't traced further, so when the order is drawn up, once a combat or each turn, isn't known.
Cited by: Genghis Khan II: Clan of the Gray Wolf