aboutsummaryrefslogtreecommitdiff
path: root/definitions.gbasm
blob: 2d7420ab4d411cee3d29ca69d74383cc25cb3d0d (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.DEFINE reg_joypad ($00)
.DEFINE reg_interrupt_flags ($0f)
.DEFINE reg_lcd_controller ($40)
.DEFINE reg_lcd_status ($41)
.DEFINE reg_lyc ($45)
.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_button_action ($c003)
.DEFINE mem_moving_animation_step ($c004)
; frame 0 (or 1 ?): movement can be initiated when with button actions
; frame 2: applying bunny attack damages
; frame 3: checking entities health and death if 0
; frame 4: entity collision map is being updated
; frame 15: movement is ended and coordinates are updated

.DEFINE mem_bunny_sprite ($cb00)
.DEFINE mem_bunny_x ($cb01)
.DEFINE mem_bunny_y ($cb02)
.DEFINE mem_bunny_direction ($cb03)
; aaaamddd: a = animation, m = is_moving, d = direction
.DEFINE mem_bunny_health ($cb06)
.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
; bit 3: animation step is going up (?)

.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 mem_prepared_viewport_x ($c011)
.DEFINE mem_prepared_viewport_y ($c012)

.DEFINE mem_display_flag ($c013)
; bit 0: if dialogue box is displayed

.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_oam_buffer $ca00 ; Until $ca9f
.DEFINE mem_oam_buffer_high $ca

.DEFINE mem_entities_list $cb00 ; Until cbff
; struct entity {
;	sprite: u8,
;	x: u8,
;	y: u8,
;	direction: u8 (animation = bit 7-4, bit 3 = is_moving, bit 2-0: direction),
;	turn_function_jump_table_index: u8
;	action_function_jump_table_index: u8
;	health: u8 (DAA decimal !!)
;	_padding: u72
;
;	# SANTA CHRISTMAS LIST PLEASE #
;	health, max health, list of possible attacks, maybe remaining attacks ? AI status (blind, scared, slow, etc..)
; }

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

.DEFINE palette_normal $e4
.DEFINE palette_bold_font $f4
.DEFINE palette_thin_font $c4

.DEFINE lcdc_window_enabled $8d
.DEFINE lcdc_window_disabled $87

; 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