aboutsummaryrefslogtreecommitdiff
path: root/definitions.gbasm
blob: d44be4023d2dc55a23bbad1c17796b8035024b87 (plain)
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
.DEFINE reg_joypad ($00)
.DEFINE reg_lcd_controller ($40)
.DEFINE reg_lcd_status ($41)
.DEFINE reg_viewport_y ($42)
.DEFINE reg_viewport_x ($43)
.DEFINE reg_bg_palette ($47)
.DEFINE reg_obj0_palette ($48)
.DEFINE reg_interrupt_enable ($ff)

.DEFINE VRAM_start $8000
.DEFINE OAM_start $FE00

.DEFINE dungeon_generation_step $20
.DEFINE intial_duplication_probablity $01

.DEFINE mem_button_direction ($c002)
.DEFINE mem_moving_animation_step ($c004)
.DEFINE mem_bunny_sprite ($c980)
.DEFINE mem_bunny_x ($c981)
.DEFINE mem_bunny_y ($c982)
.DEFINE mem_bunny_direction ($c983)
.DEFINE mem_viewport_x ($c008)
.DEFINE mem_viewport_y ($c009)
.DEFINE mem_rng_state_1 ($c00a) ; 2 bytes
.DEFINE mem_rng_state_2 ($c00b) ; 2 bytes

.DEFINE mem_map_loading_flags ($c00c)
; bit 0: if the object should be reloaded (scroll or first load)
; bit 1: has a movement ended (objects interaction should be checked, entities should update their positions)
; bit 2: if the prepared block should be updated at the next frame

.DEFINE mem_prepared_block_tile ($c00d)
.DEFINE mem_prepared_block_position_1 ($c00e)
.DEFINE mem_prepared_block_position_2 ($c00f)

.DEFINE mem_object_load_counter ($c010)

.DEFINE next_free_head_higher_bytes $c7
.DEFINE mem_next_free_head_lower_bytes ($c6ff)

.DEFINE mem_dungeon_generation_heads $c700 ; Takes the memory from c700 to c717
; struct head {
; 	direction: u8 (really u3 but padding),
; 	x: u8,
;	y: u8,
; }

; a bit of 1 is equivalent to an entity being on the tile
.DEFINE mem_entities_collisions $c780 ; Takes the memory from c780 to c7ff

; a bit of 1 is equivalent to the tile being free
.DEFINE mem_dungeon_map $c800 ; Takes the memory from c800 to c87f
.DEFINE mem_dungeon_map_high $c8

.DEFINE mem_room_list $c880 ; Takes the memory from c880 to c89f
.DEFINE mem_number_of_rooms ($c8a0)
; struct room {
;   x: u8,
;   sizex: u8,
;   y: u8,
;   sizey: u8,
; }

.DEFINE mem_object_list $c900 ; Takes the memory from c900 to c97f
; struct objects {
;	sprite: u8,
; 	x: u8,
;	y: u8,
;	interaction: u16
; 	_padding: u24
; }

.DEFINE mem_entities_list $c980 ; Until c9ff
; struct entity {
;	sprite: u8,
;	x: u8,
;	y: u8,
;	direction: u8 (bit 3 = is_moving, bit 2-0: direction),
;	ai_function_pointer: 16
;	_padding: u16
; }

.DEFINE mem_oam_buffer $ca00 ; Until $ca9f
.DEFINE mem_oam_buffer_high $ca

.DEFINE enum_direction_left $01
.DEFINE enum_direction_right $02
.DEFINE enum_direction_up $03
.DEFINE enum_direction_down $04

; HIGH_RAM:
;
; 80-85 ; Free to use as temporary variables
.DEFINE tmp_var_1 ($80)
.DEFINE tmp_var_2 ($81)
.DEFINE tmp_var_3 ($82)
.DEFINE tmp_var_4 ($83)
.DEFINE tmp_var_5 ($84)
.DEFINE tmp_var_6 ($85)

; 86-90 ; OAM_DMA_Transfer_routine
.DEFINE OAM_DMA_Transfer_routine $ff86

; 90-fe ; Stack