-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemory_layout.z80
103 lines (88 loc) · 2.71 KB
/
memory_layout.z80
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
; we put the DUMP instruction in main.z80 but basically we're
; laying out code that will be loaded into address 32768 onwards.
org 32768 ; Org to same address. No clever paging needed here.
; page 1 - main game
; (TODO page 1 will probably be splash / main menu / level select / etc)
; but for now 'start game immediately and play level 1' is hardcoded
INCLUDE "init.z80"
INCLUDE "level.z80"
INCLUDE "match.z80"
INCLUDE "input.z80"
INCLUDE "input_raw.z80"
INCLUDE "draw.z80"
INCLUDE "game_state.z80"
INCLUDE "clock.z80"
INCLUDE "vsync_utils.z80"
INCLUDE "sliders\slider.z80"
INCLUDE "cursor.z80"
INCLUDE "music.z80"
INCLUDE "sfx.z80"
INCLUDE "dirty_tiles.z80"
INCLUDE "falling.z80"
INCLUDE "score.z80"
INCLUDE "bonus.z80"
INCLUDE "remaining.z80"
INCLUDE "puzzle_init.z80"
INCLUDE "clear.z80"
INCLUDE "text.z80"
INCLUDE "game_loop.z80"
INCLUDE "glint.z80"
INCLUDE "random.z80"
INCLUDE "retry.z80"
IF DEBUG==1
INCLUDE "debug.z80"
ENDIF
INCLUDE "palette.z80"
INCLUDE "bitmaps.z80"
INCLUDE "text_bitmaps.z80"
INCLUDE "bonus_bitmaps.z80"
bitmap_end: defb 0 ; help understand where bitmaps end in .map file
; we would have already assembled first/main/everything into pages 1 and 2
; so we're probably around the top of page 2 now
; ORG was 0x8000 so around the top of page 2 we're close to 0xFFFF
; check that we haven't accidentally wrapped to around 0x0000!
; but also check that we're indeed at the end of page 2 and NOT somewhere need just the end of page 1
ASSERT $ > 32768 ; obv. we're beyond the start of page 1 - UNLESS WE WRAPPED (bad)
ASSERT $ > 49152 ; we expect to be well into page 2 too
; DS ALIGN 16384 will get us to the start of page 3
;
DS ALIGN 16384
; page 3 - puzzle data
; when paged into section a, this would be offset 0x0000
; question - do we need any code in this page? maybe something like puzzle_init could just live here too.
INCLUDE "puzzles.z80"
DEFB 0
DS ALIGN 16384
; page 4 - not yet used.
; optional tile sets? (i.e. instead of default tile sets?)
DEFB 0
DS ALIGN 16384
; page 5 - not yet used.
; level select mechanism, menu system, high score table?
DEFB 0
DS ALIGN 16384
; page 6 - not yet used.
DEFB 0
DS ALIGN 16384
; page 7 - not yet used.
DEFB 0
DS ALIGN 16384
; page 8
; the video ram is paged here (page8+9)
; handy to put data (and small code) here that we're likely to use
; many times for different parts of the runtime e.g. fonts
; (we're making use of the 'spare' area after the frame buffer)
ORG 0
DEFS 24576
DS ALIGN 256
glint_bitmaps:
MDAT "glint.b"
; TODO think about memory map. only one brick bitmap is used for each level,
; so it's a bit weird to put all the bricks for all levels in the same page
; as frame buffer
DS ALIGN 256
bricks_bitmaps:
MDAT "bricks.b"
ds ALIGN 256
fatnums:
MDAT "fatnums.b"