2-Player Karateka for Commodore 64
I heard about Charles Mangin’s hack to make the Apple II version of Karateka a 2-player game and I wondered if I could do the same thing with the Commodore 64 version.
The C64 version of Karateka has notorious levels of copy protection. In fact, I remember trying to run a pirated copy of it on my new 1541 disk drive in late 1984, and it left my drive inoperable for a couple horrific hours as I tried to figure out what went wrong and fix it. I think the copy protection forced the drive head to the extreme end of the guide rails, and it got stuck there. Eventually I freed it. It had been one of the worst days of my 12-year-old life.
To perform the hack on, I went to the best available crack of the game. As is often the case, it’s by the legendary Jack Alien/Remember: Remember’s crack of Karateka
The patch notes from Charles were useful as I tracked down the location of the code in the C64 version. The port is closely tied to the Apple II code, and much of the game logic is identical, though at times the code is offset by 16 bytes in memory.
The code to read the Apple II keyboard was adapted to instead read the port 1 joystick on the C64. Port 2 controls the regular player as usual. Pushing up on the port 1 joystick now causes the enemy fighter to punch, pushing down, to kick. The AI still controls the height of the punches and kicks, as with the Apple II hack. It’d be interesting to dig deeper and allow the enemy player full control over the attacks, like the regular player has.
Joystick left causes the enemy fighter to advance to the left. I wasn’t happy with the Apple II omission of allowing retreat to the right, so I disassembled more of the game until I found a solution. The routine at $6C62 causes the enemy to advance. It starts with a LDA #$01. If that routine is called at $6C64 with the accumulator loaded with #$FF, then the enemy steps back.
These are the 4 patches I made to the game:
>6c21 ad 01 dc 29 01 c9 01 f0 15 a9 d7 ea (push up to punch)
>6c30 ad 01 dc 29 02 c9 02 f0 06 a9 c5 ea (down to kick)
>6bab ad 01 dc 29 0c c9 0c f0 04 4c 00 c0 ea (left/right to walk, part 1)
>c000 c9 08 d0 03 4c 62 6c c9 04 d0 05 a9 ff 4c 64 6c 4c b8 6b (left/right to walk, part 2)
Once the patches were working when applied live to the game, I needed to unpack the Remember release, removing the intros, instructions, and trainers. This is a somewhat tedious process made a lot easier by the monitor in the VICE emulator. Set a break point, and once the break occurs, disassemble code and determine the next break point, repeat. It involves some trial and error, mostly looking for JMPs that end a section of code. Once these layers were removed, I could then apply the patches, and save the binary. Then I packed it with Exomizer and arranged the disk image.
Here’s the final product: Download 2-Player Karateka for C64

August 22nd, 2018 at 6:41 pm
Good idea to make this game for 2-player simultan, but in the Remember hack, when you play a one player game, the movement is different and much better in my opinion. There you can control if you want to hit/punch high, middle or low height. It`s possible to choose the height of the punch/kick, when playing with a joystick or with keyboard. This is gone here now and the AI selects the height. Personally i dont like this, but i dont know if these changes maybe are necessary, because Player-2 can control the enemys now? But even when the full movement is not possible anymore now, there should be searched for a better movement control. As it is now, it’s not solved ideal in my opinion.
Second thing i mentioned when i tried the hack is, that the enemy seems to be slower in making the hits/punches than the normal player-sprite. At least i had this feeling when playing. Don’t know if this was only imagination when i tried it, but in my opinion the normal player sprite is faster in making his moves.
I don’t want to criticize theproject, because as i wrote in the beginning this hack is a great idea, i just want to make suggestions for improvement.
Best regards
Maybe
August 23rd, 2018 at 12:37 am
Hi, thanks for the comments. Yes, it would definitely be better if the enemy joystick controls were identical to the regular player controls. Being able to punch or kick at the 3 different levels would be ideal. The problem is we haven’t understood enough of the machine language to figure out how to patch that. The guy that did the Apple II hack figured out how to trigger punches and kicks which is a great start, but we’ll have to go deeper. I spent some more hours today on the problem, and got a bit closer, but it seems there’s a lot longer to go.
I also noticed that the enemy player seems to be a bit slower to respond to controls. I’m not sure if this is a bug in my patch or just the way the enemy responds to input.
My main goal with this little project was to duplicate the Apple II patches on the C64 version, and I managed that and a little bit better (allowing walking both left and right) but I agree it could be improved more. Hopefully we’ll manage that, or someone else will come along and figure it out.
August 23rd, 2018 at 12:05 pm
Thanks for fast responding.
Ah okay, then i was right with my feeling that enemy player is a little bit slower. Could it have something to do with the fact, that this is the first enemy of all and in the original game the fighting-level rises with any of the enemys. First one if the easiest, maybe one of the reason is, that the AI makes the hits/punches slower to make it easier for the human player when fighting against this enemy. Could the slower movement have something to do with this? Enemys of the later levels fight much better and react faster, then such an enemy would be needed for second human player to control? Can it have something to do with this?
Because of the understanding of the machine language – maybe it would be possible to contact either “Robert Cook” or “Jordan Mechner” (the programers), because of this thing. Don’t know if they are alive and healthy (hope so of course) after all these years, but maybe there can be found an Email adress from one of the both somewhere in the net or in any of the retro-forums. Often former programers are members now in any of the famous C64 forums. Could be worth a try to find a contact-adress, maybe?
August 23rd, 2018 at 1:31 pm
I have a suggestion for another game, in which a 2-player-simultan-hack would be fantastic !!!
It’s the game “The Grand Monster Slam”. If the cpu-players, could be steered by a second human player it would be fantastic.
Maybe you could have a look if possible, after you finished this project here? Would be great !!!
September 21st, 2019 at 12:07 am
Nice hack. Now if only every player would have the three different punches and three different kicks, then it would be ideal, especially when the players then would map these keys with Xpadder to their controllers.
February 19th, 2020 at 12:51 am
Thanks, I have recently been looking for info about Karateka for ages and yours is the best I’ve discovered so far.
regards