kirby's dead land is a mod that puts kirby in dead cells. it does not redraw him. the real game from 2008, kirby super star ultra, runs hidden inside an emulator, sixty times a second, and dead cells borrows its hero: his jump, his sword, his appetite. to wire one game into another like that, the guest has to be known from the inside. so the cartridge was read, end to end. this is what is in there.
every number below was measured on that hidden game, on a workbench copy of the emulator, with nothing on screen.1
the cartridge holds 134 megabytes and the game fills 76 of them. most of that is not game at all. it is fifty-one cutscenes.
61 in 100 bytes of the game are cutscenes.
| megabytes | |
|---|---|
| cutscenes | 46.40 |
| every level, in one file | 10.65 |
| the program | 5.80 |
| kirby's sprites | 2.73 |
| a copy to send to a second console | 1.65 |
| all the sound | 1.28 |
| menus, enemies and the rest | 7.57 |
the sound is the neat part. 114 pieces of music and 452 effects fit in 1.28 MB, because nothing in there is a recording: it is sheet music and a few short samples, played live by the console. and the file still carries the names its makers gave each one.
a DS has four megabytes of memory. the program alone is 5.8. it cannot all be in memory at once, and it never is: 5.3 of those megabytes are cut into 157 overlays, pieces of program that are loaded when they are needed and thrown out when they are not. every enemy is one. so are the bosses.
this is memory while kirby stands in green greens, the first level:
| piece | starts at | bytes | what it is |
|---|---|---|---|
| the core | 0x02000000 | 291320 | always there: the system under everything |
| overlay 23 | 0x02071240 | 23744 | hits and collisions |
| overlay 24 | 0x0207f180 | 131520 | the level, and what appears in it |
| overlay 25 | 0x020a0080 | 110240 | the player, whoever it is |
| overlay 26 | 0x020bc180 | 592896 | kirby: every action and all 24 abilities |
| overlay 27 | 0x0214cd80 | 143552 | the lists of enemies and bosses |
| overlay 28 | 0x021700a0 | 163424 | what all enemies have in common |
| overlay 29 | 0x02197f20 | 19680 | waddle dee |
| four more chairs | 0x0219cc00 | 43488 | room for four other enemies, as the next part tells |
| the rest | 0x021a75e0 | 2460192 | bosses when there are any, the second processor's program, and everything the game is working on |
overlay 26 is kirby himself: 2,212 functions in 593 kilobytes. the hero is twice the size of the core of his own game. and at the far end, in 19 kilobytes, sits the smallest thing with a mind in it: a waddle dee.
each ordinary enemy is a small program of its own, between 1 and 20 kilobytes. and each of those programs was built to sit at one of five fixed places in memory. two enemies built for the same place cannot be in a room together: loading one would write over the other. every room of the original game is musical chairs, with five chairs.
| chair | at | built to sit there |
|---|---|---|
| 1 | 0x021a2b00 | bomber, cappy, kabu, laser ball, moto shotzo, coconut |
| 2 | 0x02197f20 | waddle dee and waddle doo, blade knight, sword knight, walky, chilly, burning leo, plasma wisp, bio spark, capsule j |
| 3 | 0x021a4ce0 | shotzo, grizzo, gim, knuckle joe, jungle bomb, birdon, tac |
| 4 | 0x0219f2a0 | sir kibble, twizzy, gator, scarfy, poppy bros. jr., gip, bandana waddle dee |
| 5 | 0x0219cc00 | noddy, bronto burt, rocky, broom hatter, simirror, wheelie, squishy, lovely, flotzo |
so a waddle dee and a blade knight never share a room, anywhere in the game. green greens seats waddle dee and waddle doo, who are one program, then cappy, bronto burt and twizzy: four chairs, one of each.
this matters to the mod. every dead cells enemy near kirby gets a stand-in inside the hidden game, so that the original's own code decides what his sword touches. the stand-ins are all waddle dees, in chair 2. the table says which real enemies could sit beside them, and which never could. one of them was tried, further down.
each enemy also carries a small record of who it is. read out of all of them, and set against kirby's own 76 points of health:2
| health | |
|---|---|
| bandana waddle dee | 250 |
| kirby | 76 |
| grizzo | 55 |
| sword knight | 48 |
| rocky | 42 |
| flotzo | 32 |
| knuckle joe | 30 |
| blade knight | 24 |
| waddle doo | 18 |
| waddle dee | 16 |
| shotzo | 1 |
| enemy | health | swallowed, gives | a touch costs kirby | chair |
|---|---|---|---|---|
| bandana waddle dee | 250 | nothing | 7 | 4 |
| grizzo | 55 | nothing | 11 | 3 |
| sword knight | 48 | sword | 8 | 2 |
| rocky | 42 | stone | 10 | 5 |
| flotzo | 32 | nothing | 6 | 5 |
| knuckle joe | 30 | fighter | 8 | 3 |
| moto shotzo | 26 | nothing | 8 | 1 |
| blade knight | 24 | sword | 8 | 2 |
| chilly | 20 | ice | 8 | 2 |
| simirror | 20 | mirror | 7 | 5 |
| sir kibble | 20 | cutter | 10 | 4 |
| capsule j | 18 | jet | 9 | 2 |
the one filed as magical | 18 | nothing | 7 | 2 |
| waddle doo | 18 | beam | 8 | 2 |
| a second swimmer | 16 | nothing | 10 | 2 |
| a swimmer | 16 | nothing | 7 | 2 |
| birdon | 16 | wing | 8 | 3 |
| bomber | 16 | crash | 7 | 1 |
| broom hatter | 16 | nothing | 7 | 5 |
| burning leo | 16 | fire | 10 | 2 |
| gator | 16 | nothing | 8 | 4 |
| gim | 16 | yo-yo | 8 | 3 |
| jungle bomb | 16 | bomb | 8 | 3 |
| kabu | 16 | nothing | 7 | 1 |
| scarfy | 16 | crash | 7 | 4 |
| squishy | 16 | nothing | 6 | 5 |
| waddle dee | 16 | nothing | 7 | 2 |
| walky | 16 | mike | 7 | 2 |
| wheelie | 14 | wheel | 6 | 5 |
| cappy | 12 | nothing | 7 | 1 |
| noddy | 12 | sleep | 8 | 5 |
| plasma wisp | 10 | plasma | 10 | 2 |
| a small swimmer | 8 | nothing | 7 | 2 |
| bio spark | 8 | ninja | 6 | 2 |
| bronto burt | 8 | nothing | 7 | 5 |
| gip | 8 | nothing | 7 | 4 |
| laser ball | 8 | beam | 6 | 1 |
| tac | 8 | copy | 6 | 3 |
| twizzy | 6 | nothing | 6 | 4 |
| twizzy, second kind | 6 | nothing | 7 | 4 |
| coconut | 1 | nothing | 7 | 1 |
| shotzo | 1 | nothing | 8 | 3 |
sixty times a second the game asks one question about kirby: what is he doing? the answer is a number, his action. there are 44. standing is 6, walking is 11, a jump is 13, falling 14, floating 15, being hurt 29 and dying 33.
nearly every action is run by the same five routines. what sets one apart is a single question of its own: which move? a move is the exact way of doing the action. walking has three: plain, with a mouthful, and wading through water. so the game keeps two bookmarks for kirby, the kind of thing he is doing and exactly how, and the second is the one that knows his mouth is full.
| from | to | when |
|---|---|---|
| stand | walk | hold a direction |
| walk | dash | tap it twice |
| dash | skid | turn round |
| stand | jump | A |
| jump | fall | at the top |
| fall | land | the floor |
| fall | float | A again |
| land | stand | 6 frames on |
| stand | use the ability | B |
| use the ability | stand | done |
the blue road, measured. kirby leaves the ground in a burst, 10.5 pixels in the first frame, then 8.0, 5.4 and 2.9. after that the game takes about a sixth of a pixel off his speed every frame, until he is falling at 3.5 pixels a frame and it lets him fall no faster.
| frame | pixels off the floor |
|---|---|
| 0 | 0 |
| 1 | 10.5 |
| 4 | 26.8 |
| 7 | 34.5 |
| 10 | 40.6 |
| 13 | 45.2 |
| 16 | 48.2 |
| 19 | 49.7 |
| 22 | 49.7 |
| 25 | 48.1 |
| 28 | 45.0 |
| 31 | 40.3 |
| 34 | 36.3 |
| 37 | 29.0 |
| 40 | 20.2 |
| 43 | 10.0 |
| 46 | 0 |
to the program, a copy ability is one pointer. when kirby swallows a blade knight, a single routine says goodbye to the old ability, looks sword up in a list, and swaps the table of moves his actions read from. nothing else about him changes. that is why the mod can hand him any ability: it calls that one routine, and the original does the rest.
each ability was then given the same ten presses, alone in an empty room, and every hit it made was written down.3
| damage | |
|---|---|
| crash | 160 |
| hammer | 80 |
| paint | 70 |
| cook | 70 |
| stone | 50 |
| mike | 40 |
| parasol | 28 |
| wing | 26 |
| ninja | 25 |
| sword | 24 |
| wheel | 23 |
| cutter | 22 |
| mirror | 22 |
| fighter | 22 |
| ice | 20 |
| fire | 20 |
| beam | 18 |
| yo-yo | 18 |
| suplex | 16 |
| bomb | 16 |
| jet | 14 |
| copy | 10 |
| plasma | 8 |
and this is one of those moves from the inside. what follows is not a picture of the game. it is sword's standing slash as the program sees it: the hit boxes, frame by frame, exactly where the game put them.
the slash starts over his head, comes down in front from above his hat to under the floor, and then, for two frames, there is a box behind him. the follow-through hits too.
the mod gives kirby a second pocket. dead cells has a key for healing, F, which kirby has no use for, so it holds one of the four abilities that get used up: crash, paint, mike or cook. a press lends him that ability through the same routine a swallow uses, lets him fire it, and hands him back his own.
one moment broke it: kirby with his mouth full. asked what he is doing, the game answers standing, because a full mouth keeps the action numbers of standing, walking and jumping. so the mod saw a kirby standing still, and lent him the crash. if he swallowed then, the swallow won. on the workbench he came out of it with the swallowed ability, and the crash in his pocket was lost.
the game itself is never fooled. kirby's record keeps a byte that the original reads before it picks how he stands: 1 for an empty mouth, 2 for a full one. and the move it then picks, the second bookmark from earlier, is a different one. the mod reads both now, and F waits for the mouth to be empty.
the byte has two more values, for water: 4 with an empty mouth, 5 with a full one. the mod checked only for the 2, so in a pool F could still lend the crash to a full mouth. the fix checks for the 5 as well.
| kirby | action | the mouth byte | move |
|---|---|---|---|
| standing | 6 | 1 | 021314d8 |
| mouth full | 6 | 2 | 02131508 |
| after the spit | 6 | 1 | 021314d8 |
| in water | 6 | 4 | 021314f0 |
| mouth full, in water | 6 | 5 | 02131520 |
and this is the same moment in the mod, in one of its test runs, against a real dead cells zombie.4




the same move can tell more than the mouth: whether kirby is wading, and which of an ability's attacks he is making. the mod asked it only about the mouth, until the two fixes that follow.
kirby and the hero of dead cells do not move at the same pace. so on dry floor the mod lets the original take every step, then carries kirby a little further the same way, until he covers the ground dead cells' hero would. in water it leaves the original's pace alone.
a pool deep enough to swim in has a floor, and kirby can walk along it. to the game that is still walking, action 11, the same number as a stroll in the sun. only the move is different: the wade. so the mod saw a walk and hurried him along the bottom, 1.79 pixels a frame where the game had him at 0.94, with his legs sped up to match.
the wade has a pace of its own. coming in from a run, kirby starts it at 0.375 pixels a frame, gains 3/64 of a pixel every frame, and settles at 0.9375: 56 pixels a second, where a walk on dry floor is 1.375. the fix reads the move, and leaves the wade at the game's own pace, as the mod already did with swimming.
| frame | the game | the mod, before the fix |
|---|---|---|
| 1 | 0.42 | 0.81 |
| 2 | 0.47 | 0.90 |
| 3 | 0.52 | 0.99 |
| 4 | 0.56 | 1.07 |
| 5 | 0.61 | 1.16 |
| 6 | 0.66 | 1.25 |
| 7 | 0.70 | 1.34 |
| 8 | 0.75 | 1.43 |
| 9 | 0.80 | 1.52 |
| 10 | 0.84 | 1.61 |
| 11 | 0.89 | 1.70 |
| 12 | 0.94 | 1.79 |
| 13 | 0.94 | 1.79 |
| 14 | 0.94 | 1.79 |


an ability's attacks are moves too. each of the twenty-four abilities keeps its moves in a table of its own, and the twenty-four tables sit side by side in memory, from cutter's to sleep's, below the moves that every kirby shares. so the move answers two questions at once: is kirby attacking, and with which attack?
to learn how a press turns into an attack, each ability was given the button standing, held down, in the air and from a dash, and every move was written down. a press starts an attack on the frame it is made, or a frame later for fighter. a press made in the middle of an attack is kept until the attack can take its next step: sword's next slash came five, seven or ten frames after it. some attacks go on by themselves, like beam's whip after its wind-up, or cutter's blade coming back. and many presses in the middle of an attack do nothing at all.
that matters because in the mod an ability comes as a dead cells item, and an item can carry extras, such as an arrow that flies with every attack or a cut that bleeds. the mod spent them at every press of the button, even at a press that started nothing. the fix spends them when the game starts an attack for a press. a press waits as long as the attack runs, and ten frames more.
..p...p...p...p...p...p...p...p...p...p...p...p...p...p...p.
..1111222222333333333311112222223333333333111122222233333333
..x...x.....x.........x...x.....x.........x...x.....x.......
p a press of the button. before the fix, each one spent the item1 sword's first slash2 the second3 the thirdx the item spent, with the fix. four frames

every creature in the game starts from four bytes.
| field | bytes | what it holds |
|---|---|---|
| class | 1 | what kind of thing this is, 0 to 59 |
| copy ability | 1 | what kirby becomes if he swallows it |
| health | 2 | how much it starts with |
here are two enemies, as they are stored:
00 00 10 00
00 14 10 00
14 is twenty in hexadecimal, and ability twenty is parasol.that second byte is the whole of kirby's most famous trick. it is also the byte the mod writes on its stand-ins, which is how a dead cells zombie can taste of sword.
everything left to chance in the game, 86 places in the program, goes through one routine of two lines:
seed = (seed * 61 + 1401) & 0xFFF; // twelve bits
return (seed * n) >> 12; // 0 to n - 1
try it. with the seed at 0, the next seed is , and a die of six faces thrown with it shows .
the two numbers are well chosen: the seed walks through all 4,096 values before it comes back to the first. but 4,096 is very few. the whole future of the game's luck is a loop that short, and whoever knows where the seed stands knows every throw to come.
a DS draws 59.83 frames a second. in each one its main processor has 560,190 ticks to spend, and when the work is done it sleeps until the next. standing still in green greens, kirby's game is mostly asleep.
35 in 100 ticks of a quiet frame are spent working.
and almost none of the working part is kirby.
| share | |
|---|---|
| the core | 73.7% |
| the level | 17.9% |
| the player | 3.9% |
| hits and collisions | 2.4% |
| the lists of enemies | 1.6% |
| kirby's actions and abilities | 0.3% |
then the room fills. in the mod, each dead cells enemy near kirby is one more stand-in for the original to look after, and kirby may have a helper walking beside him. this is how full the frame gets:
| stand-ins | on average | the worst frame in twenty | the worst frame |
|---|---|---|---|
| 0 | 40.3% | 47.6% | 57.1% |
| 8 | 47.7% | 61.3% | 94.8% |
| 16 | 54.0% | 67.2% | 84.1% |
| 24 | 60.6% | 88.0% | 100% |
| 31 | 63.8% | 83.8% | 100% |
when a frame does not fit, the original does what every console game of its time did: it lets the picture go by and finishes the work in the next one. on a DS that is a moment of slow motion, a lag frame. in the mod it was worse. dead cells went on drawing while the hidden game was half way through its sums, and kirby was shown one tile away from where he stood: a flicker. the mod now waits for the original to finish, which is right, and is still a stutter.
so, an experiment. the console in the mod is not real. its processor can be told it is twice as fast.
| stand-ins, with a helper | the real speed | twice the speed |
|---|---|---|
| 16 | 0 | 0 |
| 24 | 5 | not run |
| 31 | 2 | 0 |
the part that makes it usable: with no crowd, and with a crowd of eight, kirby's path through six hundred frames is the same at both speeds, byte for byte. a faster processor changes nothing until the moment the slow one would have dropped a frame.
dead cells has 16.7 ms for each of its frames, and the hidden console is paid out of that. it can be run two ways. an interpreter reads the game's instructions one at a time and acts each one out, every time it meets it. a recompiler translates a stretch of them into the host machine's own language once, and runs the translation from then on. the mod used the first, and since 14 october it uses the second.
| kirby alone | 31 stand-ins and a helper | |
|---|---|---|
| interpreter, as the mod ran it | 2.41 | 3.71 |
| recompiler | 1.31 | 1.71 |
| recompiler, unseen screen not drawn | 0.93 | 1.24 |
the last row is a small thing with a large effect. the mod draws kirby itself, from the sprites the original lists, so most of the time nobody looks at the picture the hidden console paints. not painting it saves more than a quarter of what is left.
drawing kirby has a smaller bill of its own. after every frame the mod reads the list of sprites the game wants on screen, 128 of them in a kilobyte, and the 512 bytes of their colours. it read them the way the game's own processor does, one byte at a time: 1,024 knocks on the door for the list alone. the fix copies each one whole.
| a byte at a time | whole | |
|---|---|---|
| the list of sprites, 1,024 bytes | 3.62 | 0.41 |
| their colours, 512 bytes | 2.02 | 0.40 |
whatever can hit or be hit in kirby's game borrows a record for it: its four sets of hit boxes and its health, 580 bytes. the records come from one pool, which the game fills with forty-eight at the start of every stage. for the rooms of the original, it was enough.
a stand-in holds one record, for its body, and every hit borrows one more for about seven frames, while the enemy flinches. thirty-one stand-ins, one swing of the sword that hits twenty-four of them, and the pool is empty. the twenty-fourth flinch was handed a record that is not there, address zero, and the game wrote the enemy's health into it all the same.
what came next depended on how the console was run. the game itself tells the processor never to write there, and the interpreter, which keeps that rule as the console does, stopped the processor for good: the hidden game froze in the middle of the fight, and dead cells went on around a kirby who could no longer move. the recompiler does not check the rule. it let the write land in the processor's own fast memory, and six bytes of a routine kept there were quietly overwritten. it was never seen running in play, which is luck, not design.
the mod's answer changes not one instruction of the original. it lets the game build its forty-eight at the start of a stage, then makes sixty-four more, two for every stand-in, out of memory the room does not use, and puts them at the end of the pool. the game hands them out as its own.
| records | |
|---|---|
| the game's 48, one sword swing | 0 |
| 112, the same swing | 48 |
| 112, crash | 80 |
| 112, the worst of 96 attacks | 44 |
one idea in the list below was first set aside without a try: real enemies in the chairs the stand-ins leave free, so that a dead cells enemy tasting of fighter could be a real knuckle joe. the reasons were good on paper. the stand-ins are never drawn, so a real enemy would be as invisible as the waddle dee it replaced. and it would bring everything the stand-in was set up not to have: its own attacks, its own touch that hurts and its own way of dying.
then it was tried. in green greens, where the hidden game runs, chair 3 is the free one, and chair 3 is where knuckle joe, gim, jungle bomb, birdon and tac were built to sit. the game has a routine that gets an enemy ready, its program into its chair and its pictures into sprite memory, the way a new room does. it was called in the middle of play for each of the five, and a stand-in's record was told to be that enemy. each was in place within two frames, its program the same as the cartridge's to the last byte, and the mod took it for a stand-in like any other. then kirby stood still 42 pixels away for five seconds, and tried to swallow it.5
| enemy | hurt kirby | swallowed |
|---|---|---|
| knuckle joe | yes 76 to 50 | no |
| gim | yes 76 to 66 | yes yo-yo |
| jungle bomb | no | yes bomb |
| birdon | no | yes wing |
| tac | no | yes copy |
| knuckle joe, tamed | yes 76 to 60 | yes fighter |
| the stand-in | no | yes fighter |
it went the way the paper said. a real enemy brings its own program, and the program fights kirby, while the dead cells enemy over it is fighting him too. nobody would see it do so: at the two moments it was checked, the hidden game's list of sprites had no entry for knuckle joe, and none for the stand-in. tamed with the stand-in's program, it gives the ability the stand-in already gives, and keeps a touch of its own. and the free chair seats one kind of enemy, where up to thirty-one dead cells enemies at a time each taste of an ability of their own. the routine stays written down, for a day the mod needs something only a real enemy has, such as one of its sounds.
the first three went into the mod on 14 october, on by default: the translation, the faster processor and the unpainted screen. in the game itself, one run each, the hidden game's frame went from 2.8 ms to 1.5 ms with kirby walking alone, and from 3.6 ms to 1.8 ms among twenty zombies. three more were built and tested the same day, and went in that evening. of the last three, two were built and tested that night and went in on 15 october, and the third was tried and set aside.
| idea | where it stands | what it showed |
|---|---|---|
| translate, do not interpret | in the mod | about half the cost of every frame, and the same kirby |
| a processor twice as fast | in the mod | no frame of the original left unfinished, even in a crowd of 31 |
| do not paint what nobody sees | in the mod | 0.4 ms a frame |
| read the move, not only the action | in the mod, for the mouth | the mod asks the game whether kirby's mouth is full, instead of guessing from his pose |
| read the move for the rest | in the mod | a wade at the game's own pace, a full mouth under water, and the item spent once an attack |
| a bigger pool of hit records | in the mod | a crowd no longer freezes the hidden game, or writes over its program |
| less bookkeeping | in the mod | the mod's own work of pairing zombies with stand-ins, among 31 of them: from 0.51 ms a frame to 0.35 |
| read the sprites whole | in the mod | three millionths of a second a frame |
| real enemies in the empty chairs | tried, and set aside | a real knuckle joe fought kirby unseen, and tamed, gave only what a stand-in gives |
the disassembly, the doctored emulator and the cartridge stay private. what is here is what they said.4