View Full Version : Killer Poke and how to check for it

February 12th, 2017, 09:20 PM
The killer poke is a side effect of a workaround to increase draw speed on older model Commodore PETs. To summarize the problem, on early PETs an undocumented pin register was set low to disable waiting for the beam to return to the top left before accessing video memory. As Commodore made hardware changes for different models or to reduce cost the circuitry around the pin was redesigned. When the same register was changed on later models it caused a voltage drop on the flyback signal to the CRT. This could cause permanent hardware damage to the PET. If you want more in depth information about the killer poke, you should check out the 6502 page on the subject here: http://www.6502.org/users/andre/petindex/poke/index.html .

When I first got my PET 4032 I had started researching it as much as I could. I found info on the killer poke early and immediately became hesitant to run any software I found on it. I did want to try some games so I set about to find a way to check for the poke. The first program I wanted to try was Lunar Lander so I loaded it over a datasette with a cassette to 3.5mm audio adapter. I thought I could just look through the code to see if it was there. Ha. That was naive. After watching `LIST` scroll for a while I knew I would need to do this on a modern PC. After finding a couple useful programs for working with TAPs and PRG files I have a workflow that allows program files to be searched for `59458` which is the killer poke register address.

This primarily covers BASIC programs for now. If you have a machine language program you want to check you may be able to just use a hex editor on the extracted PRG file and search for `E810`. I have somewhat tested this but I don't have a program at this time that is known to have a killer poke I can't know what a match would look like for sure.

The programs you will need are:

TAPClean, TAP PRG extracting: https://sourceforge.net/projects/tapclean/
droiD64, D64 PRG extractign: https://sourceforge.net/projects/droid64/
BasEdit, A PRG BASIC editor: https://sourceforge.net/projects/baseditnet/
Bless, A HEX editor: http://home.gna.org/bless/index.html

Programs that you may want

VICE PET Emulator: http://vice-emu.sourceforge.net/
CBM Studio, A native and more complex BASIC IDE: http://www.ajordison.co.uk/

TAPClean and Bless have versions for all three major OSes. droiD64 is a jar so is also multiplatform. BasEdit is windows only and uses it's own UI design but works fine under wine-1.6.2 on Ubuntu 16.04. I'm open to suggestions for BASIC editors that are cross platform.

This procedure will convert a TAP or D64 file into a PRG file and open it to search for the poke address.

1-TAP: Run TAPClean from the command line on your TAP file with the following parameters "tapclean -20 -no64eof -noaddpause -o file.tap -doprg" it will generate a folder with the PRG files from the TAP
1-D64: Run the droiD64 jar file. It's an Orthodox File Manager (https://en.wikipedia.org/wiki/File_manager#Orthodox_file_managers) like Star/Midnight Commander. On one side open your D64 file. On the other side navigate to where you want to save the PRG file. Then select the PRG from the disk and click copy at the bottom.
2: Start up BasEdit and open the PRG file. If the program is short look for a line with "SYS". That means you have a machine language program.
3-BASIC: Hit F3 to search the file. Type in, yeah no paste, "59458" to look for killer pokes
3-MACHINE: Same disclaimer as before, I don't have a known killer machine program so I cannot guarantee the that is is correct. Open the PRG file with the hex editor and search for `E842`.

This should be all you need to check for a killer poke in a program you want run on your real pet.

Other notes:
`POKE 59468` is used to set the case of the letters. It looks similar to `95458` but is fine.

February 13th, 2017, 09:58 AM
If you test any files doing this I would appreciate it if you would respond to this thread with the name of the program you tested, whether it has the poke, the MD5 checksum of the TAP/D64 and PRG file you extracted, and whether it was BASIC or machine so others in the future can refer to the following list. If the file is available to download you can include the URL and I'll link it here as well to build a PET library. I'm going to start off the list by testing all the programs from Tezza's download page (http://www.classic-computers.org.nz/blog/2011-02-27-pet-programs-for-download.htm).

The hope with this list is that someone can just md5 hash their files to avoid needing to go through the procedure themselves.

Here is how Windows users can calculate a checksum: https://support.microsoft.com/en-us/help/889768/how-to-compute-the-md5-or-sha-1-cryptographic-hash-values-for-a-file. MacOS users can use `md5`, and Linux users can use `md5sum` from the command line.

No Killer Poke

Name Type Source PRG Notes
aid2.tap (http://www.classic-computers.org.nz/blog/files/PetTap/aid2.tap)Machine9a37327eb2c391050ad1924666dad83b25 90088a07d11e43974d8b30b32c7d98
ambush.tap (http://www.classic-computers.org.nz/blog/files/PetTap/ambush.tap)BASIC623130e91894ed2daa383dd90c691daa4d 5a2aea6a38f378532b2dfbc72cbb52
blackjack.tap (http://www.classic-computers.org.nz/blog/files/PetTap/blackjack.tap)BASIC69b26de6a0c1a7b86118cf1bcdf9e16 652e971585dcff2d07a5150d7bca89b57
checkers.tap (http://www.classic-computers.org.nz/blog/files/PetTap/checkers.tap)BASICa70b258bd256034ad4bab975b44014d8 16f5ad156c4aed569bb342377f5c24cc
chessTM.tap (http://www.classic-computers.org.nz/blog/files/PetTap/chessTM.tap)BASIC1b74c2e4feaf523aabbfff6a4e04d496c 7991718e54b5da13395e2aa9969b60c
diamond-hunt-II.tap (http://www.classic-computers.org.nz/blog/files/PetTap/diamond-hunt-II.tap)BASICce503ec7ef6d160424de62b94c86d1989b609a 0c09a90fb820cd4805dfb71e22
dog-star-adventure.tap (http://www.classic-computers.org.nz/blog/files/PetTap/dog-star-adventure.tap)BASIC4526e20786d1331ef50a6792afaf92e 0eae3dea38236acfbd548a121c6322284
everest.tap (http://www.classic-computers.org.nz/blog/files/PetTap/everest.tap)BASICd3e0513da2a7dd475715af863568b2906 9ae0c06490b9e8f48e5e9761c0a7e10
fire!.tap (http://www.classic-computers.org.nz/blog/files/PetTap/fire!.tap)BASIC10200f96525c8098a4951f84da460193a68 85249c6ad998ce9a54a09577f2a0d
gammon.tap (http://www.classic-computers.org.nz/blog/files/PetTap/gammon.tap)BASIC4d82676af354176c0fbacba313783ddcf1 1413286ad191ea748f4918e2e675e4
journey-to-atlantis.tap (http://www.classic-computers.org.nz/blog/files/PetTap/journey-to-atlantis.tap)BASIC8952f160f13057187aa8c2455053ed01 518e9bb52f151cc3ce1994c48881b8f3
lunar-lander.tap (http://www.classic-computers.org.nz/blog/files/PetTap/lunar-lander.tap)BASIC72e7a4657aa732dfd0d66f870ac237acc1 8c8cd0926479d5b26a887bf009d938
millipede.tap (http://www.classic-computers.org.nz/blog/files/PetTap/millipede.tap)Machine20449880e2ab8e95ffb978be4eb4a c0bfe45a508371429b73ae29dfc3812026cKeys aren't correct in VICE or on my real PET. Crashed to sys while trying to figure out what the keys are.
[td]racer.tap (http://www.classic-computers.org.nz/blog/files/PetTap/racer.tap)BASICcc5715a70580b67d66afabfd370e2bcb927 530e0053164e663331bfc24899b9a
sheep.tap (http://www.classic-computers.org.nz/blog/files/PetTap/sheep.tap)BASIC36760d45a5cc2cacf17857cb153088afe62 4b2a6d579393c4134cc923f977e05
space-invaders.tap (http://www.classic-computers.org.nz/blog/files/PetTap/space-invaders.tap)Machine31fc8feaa6fe0b50eb47fbbaa7a256 30cd3cebefee6ec8b356662bc32e86c8e8
star-trek-6.8.tap (http://www.classic-computers.org.nz/blog/files/PetTap/star-trek-6.8.tap)FAILf3fc69a0a1a98487657440a6c3ab3ce5Fails in TAPClean and can't load in VICE
supermon2-4.tap (http://www.classic-computers.org.nz/blog/files/PetTap/supermon2-4.tap)Machine728edecf5cf79e886b5eb1a67d30592bc7a3b b70ae7569108bef23d24bb59075
supermon-2-4-instructions.tap (http://www.classic-computers.org.nz/blog/files/PetTap/supermon-2-4-instructions.tap)BASICd3a00ef2b6b7fa248d4e6438694c 517db8e304c349969b60d1d16a69969d6d20
tanks.tap (http://www.classic-computers.org.nz/blog/files/PetTap/tanks.tap)BASICac3a0ac4a22fd4e16ff49cb160dda90f364 f80dbafb31a6ea846f65936f58c34Fails in TAPClean at 99% integrity but runs fine after cleaned.

Has Killer Poke

Name Type Source PRG Notes
spelunker.prg (http://www.filedropper.com/spelunker)BASICPRG Only2b864bc7e9b2aa7c16295116478eb81a