Attack of the PETSCII Robots
Michael's misc. reverse engineering notes:
For those not familiar with the PRG format it has this format:
* 2-byte header, little endian load address
* n bytes of data
That is why all these files appear to be 2 bytes bigger then they need to be.
| File Name | Size | Glyphs | Width | Height | Comment |
|:------------|-----:|-------:|------:|-------:|:--------------|
| PETFONT.PRG | 2050 | 256 | 8 px | 8 px | 8 bytes/glyph |
| GFXFONT.PRG | 4098 | 512 | 8 px | 8 px | 8 bytes/glyph |
| TILESET.C64 | 5121 | 640 | 8 px | 8 px | 16x16px tile |
| LEVEL-? | 8962 | | 128 | 64 |768 byte header|
| in game | n/a | n/a | 11 | 7 | |
To view LEVEL-A.PRG into GIMP:
1. Rename the file to have an .data extension
2. File > Open
3. Select File Type: Raw image data
4. Image Type: Gray 8 bits
5. Offset: 770 <-- 2 bytes PRG header + 768 byte header!
6. Width: 128
7. Height: 64
Screen is 40x25 chars
Game window is 33x21 chars
Tiles are 16x16 px, or 2x2 chars.
The screen is laid out like this:
0 1 2 3 x
0123456789012345678901234567890123456789 y
00 02 04 06 08 0A 0C 0E 10WEAPON 00
01 03 05 07 09 0B 0D 0F | 01
11 13 15 17 19 1B 1D 1F 21 02
12 14 16 18 1A 1C 1E 20 | 03
22 24 26 28 2A 2C 2E 30 32 04
23 25 27 29 2B 2D 2F 31 | 05
33 35 37 39 3B 3D 3F 41 43------ 06
34 36 38 3A 3C 3E 40 42 | ITEM 07
44 46 48 4A 4C 4E 50 52 54 08
45 47 49 4B 4D 4F 51 53 | 09
55 57 59 5B 5D 5F 61 63 65 10
56 58 5A 5C 5E 60 62 64 | 11
66 68 6A 6C 6E 70 72 74 76 12
67 69 6B 6D 6F 71 73 75 |------ 13
77 79 7B 7D 7F 81 83 85 87 KEYS 14
78 7A 7C 7E 80 82 84 86 | 15
88 8A 8C 8E 90 92 94 96 98 16
89 8B 8D 8F 91 93 95 97 +------ 17
99 9B 9D 9F A1 A3 A5 A7 A9 18
9A 9C 9E A0 A2 A4 A6 A8 | 19
AA AC AE B0 B2 B4 B6 B8 BA 20
--AB--AD--AF--B1--B3--B5--B7--B9-|------ 21
|HEALTH 22
|xxxxxx 23
|++++++ 24
The Rulers (x axis and y axis) are in Decimal
The sprite location is in hex
NOTE: You will need to REVERSE the bits to see the graphics properly on the Apple 2
i.e.
Glyph "@"
From: 1C 22 4A 56 4C 20 1E 00
To..: 38 44 52 6A 32 04 78 00
With VICE (C64 Emulator) press Alt-H to enter the debugger
NOTE: The default debugger font makes characters to be unreadable garbage.
To change it so it is readable:
Settings > Settings (Alt-O) > Host > Monitor > Monitor Font
To view registers:
R
To view help:
help
To view LEVEL-A in memory as a hexdump:
M 5D00
There is a function at 3F67 that scans the level header data (map state?)
D 3F67
Michael