.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 mem_current_mode ($c014) .DEFINE mem_requested_mode ($c015) .DEFINE enum_dungeon_mode $00 .DEFINE enum_dungeon_menu_mode $01 .DEFINE enum_dungeon_dialogue_mode $02 .DEFINE enum_loading_mode $03 .DEFINE mem_menu_cursor_position ($c016) .DEFINE mem_last_button_direction ($c017) .DEFINE dialogue_menu_choice1_routine $c018 ; Takes also $c019 .DEFINE dialogue_menu_choice2_routine $c01a ; Takes also $c01b .DEFINE dialogue_menu_choice3_routine $c01c ; Takes also $c01d .DEFINE dialogue_menu_choice3_routine $c01e ; Takes also $c01f .DEFINE mem_last_button_action ($c020) .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_jump_table_index: u8 ; _padding: u32 ; } .DEFINE mem_oam_buffer $ca00 ; Until $ca9f .DEFINE mem_oam_buffer_high $ca .DEFINE dialogue_buffer $caa0 ; Until $cad6 .DEFINE dialogue_first_line $caa0 .DEFINE dialogue_second_line $cab2 .DEFINE dialogue_third_line $cac4 .DEFINE dialogue_menu_choice1 $caa1 .DEFINE dialogue_menu_choice2 $caaa .DEFINE dialogue_menu_choice3 $cac5 .DEFINE dialogue_menu_choice4 $cace .DEFINE dialogue_menu_choice1_cursor ($caa0) .DEFINE dialogue_menu_choice2_cursor ($caa9) .DEFINE dialogue_menu_choice3_cursor ($cac4) .DEFINE dialogue_menu_choice4_cursor ($cacd) .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