The copy protections
A cartridge writing inside its own space is doing nothing at all: ROM takes no writes, so that instruction looks like dead code. It is not. A pirated cartridge is a copy loaded into RAM, and there the write does land and leaves the game broken somewhere it never returns from.
The pattern was identified by Manuel Pazos
(@ManuelPazosMSX) in his disassembly of
King's Valley (RC-727), where he named the two routines
ReadKeys_AC and VRAM_writeAC. What is here is that same
pattern, looked for across the 95 cartridges in the series.
28 of the 95 write inside their own space, and all
28 are Konami. The family always repeats the same two, in the same
two start-up routines: one puts a pop hl and a ret over
a djnz in the presentation chain, the other leaves a zero in
the operand of a jp, which in memory turns it into
jp 00000h —a dead reset—. That the target is always a
djnz or the operand of a jump, and never a gap in the data, is what
rules out stray writes.
| game | where | what it does | where it lands | what is there |
|---|---|---|---|---|
| Contra | 0x4DDF | ld (08000h),a | 0x8000 | ret — its operand |
| Contra | 0x4DE7 | ld (0a000h),a | 0xA000 | ret — its operand |
| Dunk Shot | 0x5C63 | ld (hl),c | 0x4C52 | ld hl,0014ah |
| Dunk Shot | 0x7E94 | ld (hl),000h | 0x6BAD | jp suelta_sprites — its operand |
| Dunk Shot | 0x8B3F | ld (hl),000h | 0x785B | jp suelta_sprites — its operand |
| Dunk Shot — MSX2 patch | 0x8B3F | ld (hl),000h | 0x785B | jp suelta_sprites — its operand |
| Gekitotsu Pennant Race 2 | 0x7468 | ld (08000h),a | 0x8000 | call 08178h — its operand |
| Gekitotsu Pennant Race 2 | 0x7495 | ld (08000h),a | 0x8000 | call 08178h — its operand |
| Gekitotsu Pennant Race 2 | 0x7505 | ld (08000h),a | 0x8000 | call 08178h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x6257 | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x627B | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x62AE | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x62DA | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x6307 | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x632B | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x635E | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x638A | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x63B2 | ld (08000h),a | 0x8000 | ld (hl),000h — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x6055 | ld (0a000h),a | 0xA000 | ret — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x6060 | ld (0a000h),a | 0xA000 | ret — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x627C | ld (0a000h),a | 0xA000 | ret — its operand |
| Hai no Majutsushi - Mahjong 2 | 0x62EC | ld (0a000h),a | 0xA000 | ret — its operand |
| Hyper Rally | 0x79C8 | ld (06957h),a | 0x6957 | ld a,(0e00ah) |
| Hyper Sports 3 | 0x4013 | ld (0412fh),hl | 0x412F | djnz L_413D |
| Hyper Sports 3 | 0x4040 | ld (0413bh),hl | 0x413B | jp espera_y_pasa — its operand |
| King's Valley | 0x4044 | ld (hl),a | 0x40E4 | djnz tarea_0_dibuja_o_avanza |
| King's Valley | 0x409C | ld (043c0h),de | 0x43C0 | jp nc,cierra_aviso_titulo — its operand |
| King's Valley II | 0x6AB6 | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6ADA | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6B0D | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6B39 | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6B66 | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6B8A | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6BBD | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6BE5 | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6C0D | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6C69 | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6C97 | ld (08000h),a | 0x8000 | ld ix,0e7c0h — its operand |
| King's Valley II | 0x6CB5 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6CD9 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6D0C | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6D38 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6D65 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6D89 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6DBC | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6DE4 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6E0C | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6E68 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| King's Valley II | 0x6E96 | ld (08000h),a | 0x8000 | jr z,$+26 — its operand |
| Knightmare | 0x4028 | ld (04112h),hl | 0x4112 | djnz L_4120 |
| Knightmare | 0x4055 | ld (0411eh),hl | 0x411E | jp L_4187 — its operand |
| Konami's Boxing | 0x470E | ld (04f84h),a | 0x4F84 | pop af |
| Konami's Ping Pong | 0x4013 | ld (040eeh),a | 0x40EE | djnz L_40FA |
| Konami's Ping Pong | 0x4052 | ld (040f8h),hl | 0x40F8 | jp L_4318 — its operand |
| Konami's Synthesizer | 0x56AC | ld (hl),080h | 0x8000 | ret — its operand |
| Konami's Tennis | 0x7A31 | ld (0409ah),a | 0x409A | ret |
| Konami’s Game Master 2 | 0x8E9E | ld (08000h),a | 0x8000 | ld hl,0f11ah |
| Konami’s Soccer | 0x4028 | ld (0410ah),hl | 0x410A | djnz escena_presentacion_3 |
| Konami’s Soccer | 0x4056 | ld (04116h),hl | 0x4116 | jp espera_n_y_avanza_escena — its operand |
| Metal Gear 2: Solid Snake | 0x66DF | ld (08000h),a | 0x8000 | ret — its operand |
| Mopi Ranger | 0x406A | ld (04146h),a | 0x4146 | djnz comprueba_el_arranque |
| Mopi Ranger | 0x406F | ld (04147h),a | 0x4147 | djnz comprueba_el_arranque — its operand |
| Mopi Ranger | 0x40A5 | ld (044dfh),de | 0x44DF | jp L_45FF — its operand |
| Nemesis 2 | 0x40AD | ld (05000h),a | 0x5000 | ret — its operand |
| Nemesis 3 - The Eve of Destruction | 0x6CD0 | ld (08000h),a | 0x8000 | ret nz — its operand |
| Nemesis 3 - The Eve of Destruction | 0x6CF2 | ld (08000h),a | 0x8000 | ret nz — its operand |
| Nemesis 3 - The Eve of Destruction | 0x6D0F | ld (08000h),a | 0x8000 | ret nz — its operand |
| Nemesis 3 - The Eve of Destruction | 0x6D2F | ld (08000h),a | 0x8000 | ret nz — its operand |
| Parodius | 0x55B9 | ld (08000h),a | 0x8000 | jr nz,$+9 — its operand |
| Parodius | 0x55CB | ld (08000h),a | 0x8000 | jr nz,$+9 — its operand |
| Parodius | 0x55E5 | ld (08000h),a | 0x8000 | jr nz,$+9 — its operand |
| Parodius | 0x55F6 | ld (08000h),a | 0x8000 | jr nz,$+9 — its operand |
| Pippols | 0x4033 | ld (040c5h),hl | 0x40C5 | jp SIGUIENTE_ESTADO — its operand |
| Q*bert | 0x4080 | ld (06000h),a | 0x6000 | ret — its operand |
| Q*bert | 0x4084 | ld (08000h),a | 0x8000 | ld hl,00000h — its operand |
| Rastan Saga | 0x6193 | ld (077f8h),a | 0x77F8 | call dano — its operand |
| Rastan Saga | 0x61CB | ld (077f8h),a | 0x77F8 | call dano — its operand |
| Rastan Saga | 0x6200 | ld (077f8h),a | 0x77F8 | call dano — its operand |
| The Goonies | 0x4022 | ld (0411ch),hl | 0x411C | djnz presentacion_anima |
| The Goonies | 0x4050 | ld (04129h),hl | 0x4129 | jp L_41C8 — its operand |
| The Pro Yakyuu Gekitotsu Pennant Race | 0x722D | ld (08000h),a | 0x8000 | ret — its operand |
| The Pro Yakyuu Gekitotsu Pennant Race | 0x725A | ld (08000h),a | 0x8000 | ret — its operand |
| The Pro Yakyuu Gekitotsu Pennant Race | 0x72B0 | ld (08000h),a | 0x8000 | ret — its operand |
| Twin Bee | 0x4028 | ld (04195h),hl | 0x4195 | djnz L_41A3 |
| Twin Bee | 0x4055 | ld (041a1h),hl | 0x41A1 | jp empieza_la_escena_siguiente — its operand |
| Yie Ar Kung-Fu II | 0x4028 | ld (0410dh),hl | 0x410D | djnz L_411B |
| Yie Ar Kung-Fu II | 0x4056 | ld (04119h),hl | 0x4119 | jp L_41FB — its operand |
Page 0 of an MSX is ROM too, so a write there does not land either. But going to the BIOS does not make a write a protection: 5 turn up, and each is either explained or marked as unexplained.
| game | where | what it does | where it lands | what is there |
|---|---|---|---|---|
| Antarctic Adventure | 0x4055 | ldir | 0x0000 | BIOS ROM |
| Dunk Shot | 0x6F43 | ld (hl),c | 0x0022 | BIOS ROM |
| Dunk Shot — MSX2 patch | 0x6F43 | ld (hl),c | 0x0022 | BIOS ROM |
| Exciting Baseball | 0xBB8F | ld (00012h),a | 0x0012 | BIOS ROM |
| Ganbare Goemon! Karakuri Dōchū | 0xAAFE | ld (00075h),a | 0x0075 | BIOS ROM |
Antarctic Adventure. It is the start-up guard: it copies jp 0000h over the BIOS entry point. A fourth build of the game proves it is a protection: identical save for two bytes, exactly the ones that send that same copy to DESPACHA, inside the cartridge itself.
Dunk Shot. Unexplained.
Dunk Shot — MSX2 patch. Unexplained.
Exciting Baseball. Unexplained.
Ganbare Goemon! Karakuri Dōchū. Unexplained.
Of Konami's, 34 cartridges write neither to their own space nor to the BIOS: Athletic Land, Cabbage Patch Kids, Circus Charlie, Comic Bakery, F-1 Spirit — The Way to Formula 1, Frogger, Hinotori, Hyper Olympic 1, Hyper Olympic 2, Hyper Sports 1, Hyper Sports 2, King Kong 2: Yomigaeru Densetsu, Konami's Baseball, Konami's Golf, Konami’s Billiards, Konami’s Game Master, Konami’s Mahjong Dojo, Magical Tree, Metal Gear, Monkey Academy, Nemesis / Gradius, Penguin Adventure, Quarth, Road Fighter, Salamander - Operation X, Shalom: Knightmare III, Sky Jaguar, Space Manbow, Super Cobra, The Maze of Galious, The Treasure of Usas, Time Pilot, Vampire Killer, Yie Ar Kung-Fu.
And none of the 34 cartridges that are not Konami's carries any of this (3D Golf Simulation, Bomber Man, Hole in One, Dunk Shot, Hole in One Professional, Casio World Open, Sparkie, Juno First, Crazy Train, Pitfall!, Rastan Saga, Ski Command, Exciting Baseball, Exciting Jockey, Pachinko U.F.O., Car Fighter, Ice World, Iga Ninpouchou, Exoide-Z, Shindobaddo Nanatsu no Bouken, Eagle Fighter, Exoide-Z Area 5, Iga Ninpouchou Mangetsu-jou no Tatakai, Koneko no Daibouken, Moai no Hihou, The Stone of Wisdom, The Seal of Hades, Youkai Yashiki, Issun-boushi no Donnamondai, Game Land, The Maze of Galious — saves on the Yamanooto, Metal Gear — saves on the Yamanooto, Metal Gear 2: Solid Snake — saves on the Yamanooto, Dunk Shot — MSX2 patch). That is the control: if the sweep swallowed coincidences, they would show up there too.
The two MegaROMs, The Pro Yakyuu Gekitotsu Pennant Race (SCC), Gekitotsu Pennant Race 2 (SCC), Metal Gear 2: Solid Snake (SCC), Space Manbow (SCC), Quarth (SCC), King's Valley II (SCC), Parodius (SCC), Nemesis 3 - The Eve of Destruction (SCC), Hai no Majutsushi - Mahjong 2 (SCC), Contra (SCC), Salamander - Operation X (SCC), Nemesis / Gradius (KONAMI), F-1 Spirit — The Way to Formula 1 (SCC), are checked differently: their listing goes bank by
bank, so their own space is the whole window, 0x4000–0xBFFF,
minus the registers of their mapper, worked out from their own writes. Everything
they write there is a bank switch.
What actually happens when a copy runs in RAM is not measured: that would mean loading a copy and playing it, and no binary is distributed here. What is claimed is what the listing says: where the write is, where it points and what instruction sits at the target.
Nor are these all of them: the sweep sees writes to a fixed address, and
those going through HL or DE loaded just before. One
computing its target on the fly would slip past.