1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
TODO: structure-ize the descriptors in the .info file, so dasm
will politely generate labels for all the subroutines and map data.
At $A000 in the ROM, there's a block of 64 bytes per level (12 blocks,
768 bytes total). Each block describes a level of the game, so I'm calling
them level descriptors. Pretty much everything about a level *except* its
name is stored here. The names are stored separately in a table at $BB00.
Level descriptors get copied to $07C0 as part of level entry. Possibly
the copy gets modified as the level plays.
Swapping the descriptors for the first two levels results in Electrocution
being the first level, except the game says it's called Nothing To
It. It plays normally, with electric floors, and displays L=1 in the
status window. The next level is Nothing To It (but the game calls it
Electrocution), which also plays normally and displays L=2.
Anything that refers to a level below as levelXX is using one-based
numbering (level01 = first level, aka Nothing To It).
Level descriptor structure:
Offset 0, size 2:
Level number displayed in the status window, 2 digits, screen codes.
Levels <10 have $10 (the 0 character) as the first byte, but the code
that draws the status window replaces it with a $00 (space). Possibly
the decision to use e.g. 'L= 1' rather than 'L=01' was made late in
the development process?
Offset 2, size 2:
A subroutine that gets called during the level (or $00 $00 for 'none').
Not sure exactly when it gets called though.
Offset 4, size 2:
Another subroutine or $00 $00 for none..
Offset 6, size 2:
Another subroutine or $00 $00 for none..
Offset 8, size 2:
Another subroutine or $00 $00 for none..
Offset 10, size 1:
Number of bombs to pick up on this level.
Offset 12, size 1:
Jumpman's starting X position.
Offset 13, size 1:
Jumpman's starting Y position.
Offset 14, size 2:
No idea, but it's always $00 $06 (looks like a pointer to page 6).
Offset 16, size 1:
Always $64. Amount of points per bomb pickup. Interesting that this
is potentially different per level, even though nothing was done with it.
Offset 17, size 2:
Amount of time bonus, e.g. $e8 $03 for Nothing To It (1000), $d0 $07 for
Electrocution (2000).
Offset 19, size 1:
No idea. Always zero.
Offset 20, size 2: don't know yet. **TODO** looks like a ROM address after all
Offset 22, size 2:
Address of the map for this level. When I figure out how the map
format works, I'll document it in a file that will likely be called
level_maps.txt.
Offset 24, size 2:
ROM address, more map data? (same areas of ROM)
Offset 26, size 2:
ROM address, more map data? (same areas of ROM)
Offset 28, size 2:
$00,$00 on most levels, else a ROM data table address.
Offset 30, size 2:
Always $00 $00.
Offset 32, size 2:
$06E6 for most levels, otherwise it's a subroutine in ROM.
Offset 34, size 2:
$06E6 for a few levels, otherwise it's a subroutine in ROM.
Offset 36, size 2 (?):
$40,$97 on every level.
Offset 38, size 2:
$06E6 for all levels except level08, where it's $AF58 (which is
a subroutine in ROM).
Offset 40, size 6:
All $00 on all levels.
Offset 46, size 2 (?):
Unknown. Not a ROM address.
Offset 48, size 2 (?):
Unknown. Not a ROM address.
Offset 50, size 1:
$0C on most levels except:
$18 on level02
$4C on level04
$04 on level06
Offsets 51-54: unknown.
Offset 55, size 1 (?):
$00 on every level.
Offset 56, size 2:
$00,$00 on every level.
Offset 58, size 2 (?):
Unknown. Not a ROM address.
Offset 60, size 4:
$00,$00,$00,$00 on every level except level06 (Walls) where it's
$FF,$FF,$FF,$FF.
|