Claim set · data/claims/konamis-baseball.yaml

Konami's Baseball (antxiko's commented disassembly of the MSX cartridge)

Game: Konami's Baseball.

In Konami's Baseball a meter runs on every frame of a match until the pitch starts: a three-digit decimal count that starts at 70, rises by one per frame to 160, then falls by one per frame, and is reset to 70 and rising when it falls back to 70. A speed index starts at 0, rises by one each time the count passes a ten on the way up, and falls by one each time the count's units digit wraps from 0 to 9 on the way down (80 to 79), so it is the count's tens less 7: 0 at 70 to 79, 8 at 150 to 159, and 9 only at the peak of 160 (computed). Pressing a button with no direction, or with down (bit 1, which the disassembly's comment on the arrow-key table names as down), starts the wind-up, which stops the meter. The speed index then picks the ball's step from a 12-entry table, 358 to 910 in 1/256 pixel (about 1.40 to 3.55 pixels), added toward the plate each time the pitch routine runs, which is on even frames only; the meter alone gives indexes 0 to 9. In flight a first counter (0xE127) is lowered by the pixels moved each run and reloaded with 3 more when it wraps; only on runs where it has just wrapped, a second counter (0xE128, starting at 10) is lowered too, and when that one wraps it is reset to 10 and the index falls by one, not below 0, and the step is re-read, so the pitch slows on its way (the atlas's reading). konamis-baseball/pitch-speed

About: Konami's Baseball Pitch control

Value
{
 "meter": [
  70,
  160
 ],
 "speed_index": [
  0,
  9
 ],
 "steps_256ths": [
  358,
  404,
  464,
  534,
  578,
  613,
  648,
  706,
  780,
  820,
  860,
  910
 ]
}
CodeKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L601-L607DATOS tabla_de_flechas: Traduce las cuatro flechas de la fila 8 del teclado … lo que sale lleva bit 0 arriba, bit 1 ; abajo, bit 2 izquierda y bit 3 derecha.Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L32-L68interrupcion: ; El manejador que INIT engancha en H.KEYI. Todo el juego corre aqui dentro … (0xE003): solo con la partida en marcha corren las tres rutinas de abajo … call lleva_el_medidorKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L2125-L2168lleva_el_medidor: ; El medidor que se llena mientras el lanzador prepara. … sube_el_medidor: ; Suma uno en BCD al contador de 0xE361 … inc (hl) … ; (0xE363), un paso mas … cp 060h … ; en 60 se da la vueltaKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L2176-L2223baja_el_medidor: ; Lo mismo del reves: resta uno en BCD … dec (hl) … ; (0xE363), un paso menos … cp 070h … ; 0x70: se acabo … jp pone_el_medidor_a_cero … ld (hl),001h … ; (0xE360) := 1: de bajadaKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L2551-L2562pone_el_medidor_a_cero: ; Deja el medidor listo: contador en 0x70 … ld (hl),070h … ; (0xE361) := 0x70, el contador … ld (hl),a … ; (0xE363) := 0Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1621-L1641and 0f0h … ; los cuatro bits altos: sin nada pulsado no pasa nada … bit 1,b … ; el bit 1, abajo jr nz,arma_el_brazo … and 00dh … ; los bits 0, 2 y 3 jr z,arma_el_brazoKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1655-L1692ld a,(0e363h) … ; (0xE363), la velocidad … ld hl,04f97h … ; tabla_4f97, indexada por la velocidad por dos … ld (de),a … ; ...es el paso de la pelotaKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L2088-L2093DATOS pasos_de_la_pelota: Doce parejas de 16 bits: el paso por cuadro de la … ; pelota para cada velocidad de lanzamiento.Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1773-L1812lleva_la_pelota_en_el_aire: ; La pelota volando hacia el bateador. … adc hl,de … ; sumados … ld hl,0e130h … ; HL = 0xE130, la columna de la pelota add a,(hl) … ; mas lo andadoKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1876-L1908ld hl,0e127h … ; HL = 0xE127, el contador de posturas … sub b … ; menos lo andado … ld (hl),00ah … ; diez cuadros para el siguiente … cp 0ffh … ; agotado el efecto, ya no se toca mas … ld hl,04f97h … ; tabla_4f97 otra vez, con la velocidad nueva … ld hl,0e125h … ; y el paso de la pelota se rehaceKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L6447-L6452ld a,(0e000h) … ; el contador de cuadros rrca … ; su bit 0 decide la mitad jr c,la_otra_mitad_del_cuadro … call lleva_el_lanzamientoChecked by claude, 2026-10-22 — read lleva_el_medidor, pone_el_medidor_a_cero, lleva_el_lanzamiento, arma_el_brazo, the step table's header, lleva_la_pelota_en_el_aire, sigue_la_pelota_en_vuelo, and the frame split at the pinned commit, and worked the count and index through by hand

The count is two BCD bytes, 0xE362 (hundreds) and 0xE361; the index is 0xE363. The step is 8.8 fixed point with the whole pixels in the high byte, so the pixel figures are the steps over 256; the table's comment calls them per frame, but the routine that adds them runs on even frames only. A button with up, left, or right takes a different branch, which the disassembly's comment says cancels the pitch; the atlas hasn't read what it does. 0xE364, which the comments call the chosen break (efecto), rises and falls with the count (it starts at 70) and is copied to 0xE121 at the wind-up, and the flight lowers it as it goes; the atlas found no other read of it by address. After the pitch, escribe_la_cuenta draws the count's three digits followed by three fixed tiles (0xA2 to 0xA4), which the atlas hasn't seen. The computer's pitcher (suelta_el_lanzamiento) waits for 0xE364's high nibble to match a value from its own table and then writes a button press into its controller byte.

Cited by: Konami's Baseball, Pitch control

In Konami's Baseball, once the pitch is in the air the routine that moves the ball also reads a controller and moves the ball's row, across its path to the plate. The disassembly's labels and comments call this part the bat; the atlas reads it as the pitcher's, because it calls the same controller routine (el_mando_del_que_ataca) as the code that starts the pitch, while the batter's routine calls the other one (el_mando_del_que_defiende). The first press of bit 1, 2, or 3 of the controller byte fixes the direction: bit 3 moves the row by +1, bit 1 or 2 alone by -1. The disassembly's comment on the arrow-key table names those bits down (1), left (2), and right (3), which makes it right for +1 and down or left for -1. The row then moves one pixel every n runs of the routine, which runs on even frames. For speed indexes 0 to 7, n starts at 8 and, while one of those directions stays held, becomes 4 after 8 runs, 3 after 4 more, and 2 after 3 more, where it stays; letting go keeps the current n (computed). The values come from four identical table rows of 8, 4, 3, 2, 1 (the 1 is never reached), the row picked by the pitch's speed index halved and capped at 4. At speed index 8 or 9 that is a fifth row, past the table's end, so n is read from the first bytes of the next routine: 33 runs per pixel at first, then a 0, which the countdown treats as 256, so the fastest pitches barely move across (the atlas's reading, computed). konamis-baseball/pitch-steer

About: Konami's Baseball Pitch control

Value
{
 "n_runs_per_pixel": [
  8,
  4,
  3,
  2
 ],
 "runs_before_next_n": [
  8,
  4,
  3
 ],
 "speed_8_9_n": [
  33,
  256
 ]
}
CodeKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L601-L607DATOS tabla_de_flechas: Traduce las cuatro flechas de la fila 8 del teclado … lo que sale lleva bit 0 arriba, bit 1 ; abajo, bit 2 izquierda y bit 3 derecha.Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1621-L1632lleva_el_lanzamiento: ; El cuadro del lanzador. … call el_mando_del_que_ataca … ; lee el mando del jugador que lanzaKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4653-L4665lleva_al_bateador: ; El cuadro del bateador. … call el_mando_del_que_defiende … ; lee el mando del bateadorKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1909-L1937mira_el_mando_del_bateador: ; Con 0xE12A a cero todavia no se ha empezado a batear … call el_mando_del_que_ataca … ; lee el mando del bateador … and 00eh … ; los bits 1, 2 y 3 … bit 3,a … ; el bit 3 elige el sentido del bate … inc (hl) … ; la primera postura del bateKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1938-L1968ld hl,04faah … ; HL = 0x4faa, la tabla de posturas … djnz salta_una_fila_de_posturas … cp 005h … ; de la quinta en adelante... … ld a,004h … ; ...se queda en la cuarta … ld (hl),b … ; guardado … ld (hl),b … ; y el tercero siempreKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1969-L2003sigue_el_bate: ; Con el bate ya en marcha: mientras se siga pulsando, cada vuelta del contador cambia de postura … and 00eh … ; las tres direcciones … mueve_el_bate_de_fila: ; El contador de 0xE12C manda: cada vez que da la vuelta, la fila de la pelota sube o baja un pixel … ld b,0ffh … ; hacia el otro lado, -1 … ld hl,0e131h … ; HL = 0xE131, la filaKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L2108-L2119DATOS posturas_del_bate: Cuatro filas de cinco tiles … 0x4faf..0x4fc3 (20 bytes)Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L1687-L1699srl a … ; la velocidad partida por dos... cp 004h … ld a,004h … ; ...y recortada a 4 como mucho … ld (hl),a … ; la potencia, ya recortada … xor a … ; y los tres bytes siguientes de la ficha, a ceroKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L2125-L2126lleva_el_medidor: … ld hl,0e100h … ; HL = 0xE100, la palabra de estadoKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L5104-L5116el_mando_del_que_defiende: ; Devuelve en HL el hueco de los bits recien pulsados del jugador que defiende … el_mando_del_que_ataca: ; Lo mismo pero para el otro, con el acarreo cambiadoKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L663-L677calcula_flancos: ; Para cada jugador, deja en el tercer byte de su bloque solo los bits RECIEN pulsados … cp (hl) … ; contra la del fotograma anterior … jr nz,L_43EE … inc hl … ld (hl),aChecked by claude, 2026-10-22 — read lleva_el_lanzamiento, lleva_al_bateador, mira_el_mando_del_bateador through corrige_la_fila, the table header at 0x4faf, arma_el_brazo's cap, lleva_el_medidor's first instruction, the two controller routines, calcula_flancos, and the arrow-key table's comment at the pinned commit; worked the countdowns through by hand

The routine stores n in three bytes: 0xE12B counts the runs held before the next step, 0xE12C counts down to the next pixel (set only when it is empty, so a new n takes effect at the next pixel), and 0xE12D reloads 0xE12C. The fifth row starts at 0x4fc3, the first instruction of lleva_el_medidor (ld hl,0e100h, then ld a,(hl)), whose bytes 0x21, 0x00, 0xE1, 0x7E give n = 33, 0 (256), 225, 126 in turn. The controller byte both routines read is written by calcula_flancos only when a reading matches the previous frame's, so it holds a held direction; its comment calls it newly pressed bits. Up isn't in the mask. Which screen direction the row's +1 is hasn't been checked.

Cited by: Konami's Baseball, Pitch control

In Konami's Baseball a swing starts on a button press and, while a button is held, steps to the next bat pose every 3 runs of the batter routine, which runs on odd frames. A hit needs the bat in pose 2, 3, or 4 and the ball inside a contact box around the bat's position, one box per batting side, so a held swing can hit for 9 runs (computed). Letting go leaves the bat in its pose, and unless that is the fifth the contact test goes on (the routine's comment says letting go ends the swing). The angle the ball flies off at comes from a table by pose and by the pose's step counter, 3, 2, or 1 while the button is held, plus 0 to 3 from the Z80's R register. On one batting side, pose 2 gives 48 to 56, pose 3 28 to 36, and pose 4 8 to 16 (before the random part); the other side's table is the mirror image, so early and late contact send the ball toward opposite ends of the range. A second value is the ball's row plus 3 less the bat's point at 0xE144 plus an offset (16 on one side, 2 on the other), negated on the second side: 0 to 9 hits, and anything else misses. It picks the value the comment calls the ball's starting height, highest at 4. When the computer bats, a value of 0 or of 8 and over, including one that would miss, becomes 6. konamis-baseball/batting

About: Konami's Baseball Batting timing

Value
{
 "pose_runs": 3,
 "hit_poses": [
  2,
  3,
  4
 ],
 "angles_side_a": {
  "pose2": [
   48,
   52,
   56
  ],
  "pose3": [
   28,
   32,
   36
  ],
  "pose4": [
   8,
   12,
   16
  ]
 },
 "random_add": [
  0,
  3
 ],
 "heights_by_value": [
  272,
  304,
  344,
  424,
  512,
  472,
  360,
  328,
  272,
  240
 ]
}
CodeKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4653-L4670lleva_al_bateador: ; El cuadro del bateador. … rrca … ; el bit 0: ya esta bateando jr c,lleva_el_bateo … and 0f0h … ; los cuatro bits altos: los botones … set 0,(hl) … ; el bit 0: a batearKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4726-L4757lleva_el_bateo: ; Con el bateo ya en marcha: mientras el mando siga pulsado el bate avanza de postura cada tres cuadros, y en cuanto suelta o llega a la sexta se acaba … and 030h … ; los botones … jr nz,pasa_la_postura_del_bate … cp 005h … ; la quinta es el final del recorrido … jp z,acaba_el_bateo … jr mira_si_le_da_a_la_pelota … …Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4757-L4800mira_si_le_da_a_la_pelota: ; Con el bate en la postura 2, 3 o 4 y la pelota dentro de la caja de contacto … call mira_si_esta_en_la_caja … ; la prueba … cp 002h … ; antes de la 2 no hay golpe … cp 005h … ; y de la 5 en adelante, tampoco … ld c,(hl) … ; C = la columna del bate … ld hl,07285h … ; HL = 0x7285, los angulos de un lado … …Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4801-L4818cp 008h … ; con la maquina bateando, el golpe se ajusta … ld b,006h … ; B = 6, un golpe del monton … cp 00ah … ; de 10 para arriba no hay golpe ret ncKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4985-L5007DATOS angulos_del_golpe: Dos tandas de quince, una por lado del bateador … DATOS alturas_del_golpe: Diez palabras: la altura de partida de la pelota … ; segun la fuerza del golpe, de 0x0110 a 0x0200. La ultima se mete dos bytes ; en la tabla de al ladoKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L4824-L4831ld hl,072a8h … ; HL = 0x72a8, las alturas rlca … ; por dos: son palabrasKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L5142-L5162mide_donde_da_en_el_bate: ; La distancia entre la fila de la pelota y el punto del bate … add a,003h … ; tres mas … ld a,(0e144h) … ; (0xE144), el punto del bate … ld d,010h … ; D = 0x10, el desplazamiento de un lado … ld d,002h … ; o 0x02, el del otro … sub c … ; la distancia … …Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L5036-L5037mira_si_esta_en_la_caja: ; Prueba si el punto (D,E) cae dentro de la caja del punto (B,C).Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L6447-L6456la_otra_mitad_del_cuadro: ; Los cuadros impares … call lleva_al_bateadorChecked by claude, 2026-10-22 — read lleva_al_bateador, lleva_el_bateo, pasa_la_postura_del_bate, mira_si_le_da_a_la_pelota through monta_el_golpe, mide_donde_da_en_el_bate, mira_si_esta_en_la_caja, the angle and height tables, and the frame split at the pinned commit; read the table rows by hand

The angle row is found by adding 5 per pose (pose 2 lands on 0x728a, the table's start); the column is 0xE141, which the comment calls the bat's column and which the swing routine reloads with 3 at each pose step and counts down. Columns 0 and 4 (60 and 44, 24 and 4 on the first side) aren't reached with the button held. Heights are 16-bit values (0x0110 to 0x0200); the tenth comes from the next table's first bytes, as the comment says. The value's low two bits and one more random bit then pick a pair the comments call the ball's two components (0x72ba). The contact boxes are at 0x730a (12 bytes, three boxes; the third isn't used here). Which end of the angle range is the pull side hasn't been checked. A separate routine, ajusta_el_golpe_de_la_maquina, changes the computer's hits when the score is level; the atlas hasn't claimed it.

Cited by: Batting timing, Konami's Baseball

Konami's Baseball ends a match when the inning counter at 0xE40B reaches 9. The counter rises by one each time the second team's half ends, and no branch lets a tie go on, so a level score after nine innings ends the match (the atlas's reading). When the counter reads 8, the index of the ninth cell in each team's scoreboard row, two checks end the match early. At the end of the first team's half, if the second team's total is higher, the game writes tile 0xE7 into the second team's ninth cell and ends the match without the bottom half. While the second team bats in that inning, the match ends as soon as a run puts it ahead. Both checks compare the totals' tens and then their units. The disassembly's comment on the first check reads it as extra innings on a tie; the code continues on a tie and ends the match when the second team leads. konamis-baseball/innings

Value
{
 "innings": 9,
 "extra_innings": false,
 "skip_bottom_ninth_when_ahead": true,
 "walk_off": true
}
CodeKonami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L6379-L6427cambia_el_turno: ; El estado 1: … rr (hl) … ; el bit 0 de 0xE402, del reves ccf … rl (hl) … bit 0,(hl) … ld hl,0e40bh … ; HL = 0xE40B, la entrada jr nz,mira_si_hay_prorroga … …Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L6106-L6163escribe_el_marcador: ; Suma B carreras a la casilla de la entrada que toque y al total … ld hl,0e410h … ; HL = 0xE410, la fila de un equipo … ld hl,0e420h … ld a,(0e40bh) … ; (0xE40B), la entrada call suma_a_hl … ld a,(hl) … ; la casilla de esa entrada … ld a,00bh … ; HL += 11: el total …Konami's Baseball (MSX), commented disassembly (antxiko) · src/baseball.asm#L6640-L6658mira_si_hay_empate: ; Compara las dos casillas de total de los dos equipos -0xE41A y 0xE42A, con sus dos cifras- y devuelve el acarreo puesto cuando son iguales ld hl,0e41ah … ; HL = 0xE41A, el total de uno ld de,0e42ah … ; DE = 0xE42A, el del otro ld a,(de) … cp (hl) … ; la primera cifra jr z,la_segunda_cifra_del_total … ret … cp (hl) … ; iguales? jr z,hay_empate …Checked by claude, 2026-10-22 — read cambia_el_turno through acaba_el_partido and mira_si_hay_prorroga, escribe_el_marcador with its ninth-inning check, and mira_si_hay_empate at the pinned commit; worked the compare's carry through for each order of the totals

Each team's row is 12 bytes, a digit tile per inning at the counter's index (0xE410 and 0xE420) and the total's tens and units at offsets 10 and 11 (0xE41A, 0xE42A), so 0xE428 is the second team's ninth cell. mira_si_hay_empate returns carry on equal totals and, from the same cp, when the second team's is lower; it returns no carry only when the second team's is higher. Bit 0 of 0xE402 marks the second team's turn: after it flips, set means the first team's half has just ended. The repository's write-up (docs/THE-GAME.md, "How many innings") also reads the check as extra innings on a tie and marks it as an assumption, since nobody has played a match through. What tile 0xE7 shows hasn't been checked. In the demo, a change of sides ends the match.

Cited by: Konami's Baseball