diff options
-rw-r--r-- | TODO | 10 | ||||
-rw-r--r-- | definitions.gbasm | 4 | ||||
-rw-r--r-- | entity/fox.gbasm | 7 | ||||
-rw-r--r-- | entity/init.gbasm | 13 | ||||
-rw-r--r-- | main.gbasm | 39 | ||||
-rw-r--r-- | map/objects.gbasm | 8 | ||||
-rw-r--r-- | playerattacks.gbasm | 15 | ||||
-rw-r--r-- | rng.gbasm | 5 | ||||
-rw-r--r-- | scripts/generate-tiledata.py | 2 | ||||
-rw-r--r-- | sprites/gui/floor.png | bin | 195 -> 163 bytes | |||
-rw-r--r-- | tiles.gbasm | 2 | ||||
-rw-r--r-- | tileset.gbasm | 3 |
12 files changed, 85 insertions, 23 deletions
@@ -1,11 +1,13 @@ Bugs: -> Emulator crash with "not implemented: Only XKB keymaps are supported when unfocused (or workspace change maybe ?) - -> There is no indicator that the max health is 20 - -> object tile only is getting removed, not the effect - -> hop cancelled uses EPs + -> Crash/infinite loop on dungeon generation + -> Hoping over a fox doesn't cancel a laser attack + +Accessibility issues: -> freeze/earcopter attack patterns are not obvious (either needs to be shown on map or add select menu with infos if not possible + tutorial to explain the existence of select menu ?) - -> when stairs spawn in the same room as the bunny, it's not obvious that it's not the stairs we just came from + -> There is no indicator that the max health is 20 -> B + arrow is not obvious (tutorial ?) + -> when stairs spawn in the same room as the bunny, it's not obvious that it's not the stairs we just came from Need to be refactored: -> main is messy and unreadable diff --git a/definitions.gbasm b/definitions.gbasm index c8bfc3a..d3f2ac5 100644 --- a/definitions.gbasm +++ b/definitions.gbasm @@ -122,6 +122,10 @@ .DEFINE mem_additional_loading_block_position_1 ($c03a) .DEFINE mem_additional_loading_block_position_2 ($c03b) +.DEFINE mem_floor_count ($c03c) + +.DEFINE mem_loop_rng_timer ($c03d) + .DEFINE mem_next_free_head_lower_bytes ($c6ff) .DEFINE mem_dungeon_generation_heads $c700 ; Takes the memory from c700 to c717 diff --git a/entity/fox.gbasm b/entity/fox.gbasm index 5e225ec..89df17e 100644 --- a/entity/fox.gbasm +++ b/entity/fox.gbasm @@ -149,9 +149,10 @@ Fox_Turn: JR Z, =.End_movement.end CALL =Laser_sight_check - LD A, E - CP $00 - JR Z, =.laser_sight_check_fail + LD A, D + AND $07 + CP E + JR NZ, =.laser_sight_check_fail CALL =Laser_Enemy_Attack diff --git a/entity/init.gbasm b/entity/init.gbasm index 76c96b4..970607b 100644 --- a/entity/init.gbasm +++ b/entity/init.gbasm @@ -74,8 +74,19 @@ Initialize_Entities: LD A, $00 LD (HL+), A + INC HL ; skip health + + LD A, $00 + + ; Flags + LD (HL+), A + + ; Status + LD (HL+), A + LD A, L - ADD $0a + AND $f0 + ADD $10 LD L, A LD A, $00 @@ -98,6 +98,8 @@ Entrypoint: LD $mem_bunny_health, A LD A, $30 LD $mem_bunny_mana, A + LD A, $01 + LD $mem_floor_count, A New_Dungeon: LD SP, $fffe LD HL, $mem_loaded_enemies_indices @@ -126,13 +128,22 @@ New_Dungeon: CALL =Load_Objects CALL =Reload_Entities_Tile_Data + ; Reset animations + LD HL, $mem_animation_list + LD BC, $1f + CALL =bzero + LD A, $00 - LD $mem_bunny_flags, A LD $mem_display_flag, A LD $mem_moving_animation_step, A LD $mem_animation_wait_frames, A LD $mem_blinking_animation_counter, A + LD A, $mem_bunny_x + LD $mem_bunny_predicted_x, A + LD A, $mem_bunny_y + LD $mem_bunny_predicted_y, A + LD A, $mem_map_loading_flags RES 3, A LD $mem_map_loading_flags, A @@ -154,12 +165,20 @@ New_Dungeon: LD A, $f1 LD ($9d66), A + ; Floor + LD A, $f4 + LD ($9d73), A + .SET_WINDOW_LCDC_E .ENABLE_TOP_BAR .ENABLE_VBLANK_INTERRUPTS EI Wait_for_Interrupt.loop: - HALT + LD A, $reg_interrupt_enable + LD C, A + LD B, $00 + LD A, $reg_interrupt_flags + DBG EI JP =Wait_for_Interrupt.loop @@ -170,8 +189,8 @@ VBLANK_Entrypoint: LD A, $palette_bold_font LD $reg_bg_palette, A - LD HL, $9d72 - LD A, $dbg_var + LD HL, $9d71 + LD A, $mem_floor_count CALL =Print_8bit CALL $OAM_DMA_Transfer_routine @@ -195,14 +214,6 @@ VBLANK_Entrypoint: CALL =Copy_Dialogue_Buffer CALL =Display_dialogue_cursor - LD A, $reg_lcd_status - AND $03 - CP $01 - JR Z, =.skip_stop - ; STOP - .skip_stop: - LD $dbg_var A - ; LYC LD A, $0a LD $reg_lyc, A @@ -238,6 +249,10 @@ VBLANK_Entrypoint: CALL =Display_Animation_List CALL =Display_Entities + LD A, $mem_loop_rng_timer + INC A + LD $mem_loop_rng_timer, A + .ENABLE_VBLANK_INTERRUPTS RET diff --git a/map/objects.gbasm b/map/objects.gbasm index 1745092..80832a7 100644 --- a/map/objects.gbasm +++ b/map/objects.gbasm @@ -155,6 +155,14 @@ Stairs_Action: XOR A LD $reg_lcd_controller, A + LD A, $mem_floor_count + INC A + DAA + JR C, =.skip_update_floor_count + + LD $mem_floor_count, A + + .skip_update_floor_count: CALL =Reset_Map JP =New_Dungeon diff --git a/playerattacks.gbasm b/playerattacks.gbasm index 2257e54..4b72f88 100644 --- a/playerattacks.gbasm +++ b/playerattacks.gbasm @@ -71,6 +71,16 @@ Canceled_Attack: LD A, $mem_bunny_direction OR $40 LD $mem_bunny_direction, A + + LD A, $mem_bunny_mana + LD B, A + LD A, $mem_current_focused_attack_ep_cost + ADD B + DAA + JR NC, =.skip_fallback_max_mana + LD A, $99 + .skip_fallback_max_mana: + LD $mem_bunny_mana, A RET Attack_List: @@ -79,10 +89,11 @@ Attack_List: .DB =Hop_Attack_Menu_Txt ; Attack function - .DB =Hop_Attack + .DB =Stairs_Action + ; .DB =Hop_Attack ; Energy point cost - .DB $01 + .DB $00 .PADTO =.Hop+8 @@ -60,9 +60,14 @@ RNG_Step: LD A, D LD $mem_rng_state_1, A + LD A, $mem_loop_rng_timer + LD D, A + LD A, E LD $mem_rng_state_2, A + ; XOR D + POP DE POP BC RET diff --git a/scripts/generate-tiledata.py b/scripts/generate-tiledata.py index f49db34..0b8cb95 100644 --- a/scripts/generate-tiledata.py +++ b/scripts/generate-tiledata.py @@ -35,6 +35,8 @@ print("\n\t; Cursor") get_sprite_png_parse_output("./sprites/gui/cursor.png") print("\n\t; Disabled Cursor") get_sprite_png_parse_output("./sprites/gui/disabled-cursor.png") +print("\n\t; Floor") +get_sprite_png_parse_output("./sprites/gui/floor.png") sprite_idx = 0x80 print("\nFont_Data:") diff --git a/sprites/gui/floor.png b/sprites/gui/floor.png Binary files differindex 3ab9420..07c3e0a 100644 --- a/sprites/gui/floor.png +++ b/sprites/gui/floor.png diff --git a/tiles.gbasm b/tiles.gbasm index 65655c2..41fbcb9 100644 --- a/tiles.gbasm +++ b/tiles.gbasm @@ -21,7 +21,7 @@ Load_Tile: LD HL, $8f00 LD DE, =Small_sprites - LD BC, $0040 + LD BC, $0050 CALL =memcpy LD HL, $8600 diff --git a/tileset.gbasm b/tileset.gbasm index cb07c51..25c04b3 100644 --- a/tileset.gbasm +++ b/tileset.gbasm @@ -107,6 +107,9 @@ Small_sprites: ; Disabled Cursor .DB $00, $00, $22, $00, $36, $00, $1c, $00, $1c, $00, $36, $00, $22, $00, $00, $00 ; 0xf3 + ; Floor + .DB $10, $10, $38, $28, $7c, $44, $fe, $82, $fe, $ee, $38, $28, $38, $38, $00, $00 ; 0xf4 + Font_Data: .DB $00, $00, $38, $3c, $44, $46, $44, $46, $44, $46, $44, $46, $38, $3c, $00, $00 ; 0x80 .DB $00, $00, $10, $18, $30, $38, $10, $18, $10, $18, $10, $18, $7c, $7e, $00, $00 ; 0x81 |