diff options
-rw-r--r-- | animation.gbasm | 39 | ||||
-rw-r--r-- | animations/laser.gbasm | 9 | ||||
-rw-r--r-- | animations/rotatingball.gbasm | 9 | ||||
-rw-r--r-- | animations/sparkles.gbasm | 9 | ||||
-rw-r--r-- | definitions.gbasm | 24 | ||||
-rw-r--r-- | enemiesattacks/basic.gbasm | 33 | ||||
-rw-r--r-- | enemiesattacks/freeze.gbasm | 11 | ||||
-rw-r--r-- | enemiesattacks/laser.gbasm | 1 | ||||
-rw-r--r-- | entity/actions.gbasm | 16 | ||||
-rw-r--r-- | entity/bunny.gbasm | 8 | ||||
-rw-r--r-- | entity/cat.gbasm (renamed from entity/frog.gbasm) | 9 | ||||
-rw-r--r-- | entity/display.gbasm | 13 | ||||
-rw-r--r-- | entity/fox.gbasm | 6 | ||||
-rw-r--r-- | entity/list.gbasm | 4 | ||||
-rw-r--r-- | entity/penguin.gbasm | 6 | ||||
-rw-r--r-- | gui.gbasm | 8 | ||||
-rw-r--r-- | main.gbasm | 5 | ||||
-rw-r--r-- | map/objects.gbasm | 6 | ||||
-rw-r--r-- | playerattacks/earcoptr.gbasm | 19 | ||||
-rw-r--r-- | playerattacks/heal.gbasm | 3 | ||||
-rw-r--r-- | sprites/gui/floor.png | bin | 0 -> 195 bytes |
21 files changed, 169 insertions, 69 deletions
diff --git a/animation.gbasm b/animation.gbasm index 7bc997a..b7891f4 100644 --- a/animation.gbasm +++ b/animation.gbasm @@ -30,12 +30,12 @@ Display_Animation: POP HL LD A, L - ADD $04 + ADD $08 LD L, A RET -Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E +Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E, entity_effect in D PUSH HL PUSH AF @@ -44,7 +44,7 @@ Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E CP (HL) JP Z, =Try_Launch_Animation.Free_slot_Found - LD A, $04 + LD A, $08 ADD L LD L, A @@ -52,7 +52,7 @@ Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E CP (HL) JP Z, =Try_Launch_Animation.Free_slot_Found - LD A, $04 + LD A, $08 ADD L LD L, A @@ -60,7 +60,7 @@ Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E CP (HL) JP Z, =Try_Launch_Animation.Free_slot_Found - LD A, $04 + LD A, $08 ADD L LD L, A @@ -78,6 +78,7 @@ Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E LD (HL+), A LD A, E LD (HL+), A + LD (HL), D POP HL RET @@ -87,6 +88,34 @@ Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E POP HL RET +End_animation: + LD A, L + AND $f8 + LD L, A + LD (HL), $00 + LD A, L + ADD $04 + LD L, A + + LD A, $f0 + AND (HL) + CP $10 + RET NZ + + LD A, (HL) + AND $0f + SWAP A + + PUSH HL + ADD $07 + LD L, A + LD H, high($mem_entities_list) + + SET 3, (HL) + POP HL + + RET + Animation_Jump_table: ; 00 RET diff --git a/animations/laser.gbasm b/animations/laser.gbasm index e466652..c76b464 100644 --- a/animations/laser.gbasm +++ b/animations/laser.gbasm @@ -49,7 +49,7 @@ Laser_Animation: LD A, (HL) SUB $02 - JP C, =.End_animation + JP C, =End_animation LD E, A LD (HL), A @@ -128,10 +128,3 @@ Laser_Animation: POP HL RET - - .End_animation: - LD A, L - AND $fc - LD L, A - LD (HL), $00 - RET diff --git a/animations/rotatingball.gbasm b/animations/rotatingball.gbasm index e7e4cbd..68f5b54 100644 --- a/animations/rotatingball.gbasm +++ b/animations/rotatingball.gbasm @@ -44,7 +44,7 @@ Rotating_Ball_Animation: LD E, (HL) DEC E CP E - JP C, =.End_animation + JP C, =End_animation LD (HL), E LD A, $30 @@ -87,10 +87,3 @@ Rotating_Ball_Animation: POP HL RET - - .End_animation: - LD A, L - AND $fc - LD L, A - LD (HL), $00 - RET diff --git a/animations/sparkles.gbasm b/animations/sparkles.gbasm index f91f45c..fe9c8ae 100644 --- a/animations/sparkles.gbasm +++ b/animations/sparkles.gbasm @@ -43,7 +43,7 @@ Sparkle_Animation: DEC E XOR A CP E - JP Z, =.End_animation + JP Z, =End_animation LD (HL), E LD A, $20 SUB E @@ -97,10 +97,3 @@ Sparkle_Animation: POP HL RET - - .End_animation: - LD A, L - AND $fc - LD L, A - LD (HL), $00 - RET diff --git a/definitions.gbasm b/definitions.gbasm index 6a8aeaf..1e46ccf 100644 --- a/definitions.gbasm +++ b/definitions.gbasm @@ -32,14 +32,6 @@ .DEFINE mem_bunny_x ($cb01) .DEFINE mem_bunny_y ($cb02) .DEFINE mem_bunny_direction ($cb03) -; aaaamddd: a = animation, m = is_moving, d = direction -; animations: -; nothing = 0 -; action = 1 -; death = 2 -; superjump = 3 -; shaking = 4 -; blinking = 5 (Blink with both loading steps and animation step) .DEFINE mem_bunny_health ($cb06) .DEFINE mem_bunny_flags ($cb07) @@ -117,6 +109,8 @@ .DEFINE mem_bunny_next_mana_regen ($c035) +.DEFINE mem_blinking_animation_counter ($c036) + .DEFINE mem_next_free_head_lower_bytes ($c6ff) .DEFINE mem_dungeon_generation_heads $c700 ; Takes the memory from c700 to c717 @@ -174,12 +168,16 @@ .DEFINE mem_last_animation_low_pointer ($cadf) -.DEFINE mem_animation_list $cae0; Until $caef +.DEFINE mem_animation_list $cae0; Until $caff ; struct animation { ; jump_table_index: u8, ; x: u8, ; y: u8, ; step: u8, +; entity_effect: u8, +; high(u4): effect to start (0 = nothing, 1 = blinking) +; low(u4): entity_id +; _padding: u24, ; } .DEFINE mem_entities_list $cb00 ; Until cbff @@ -188,6 +186,13 @@ ; x: u8, ; y: u8, ; direction: u8 (animation = bit 7-4, bit 3 = is_moving, bit 2-0: direction), +; aaaamddd: a = animation, m = is_moving, d = direction +; animations: +; nothing = 0 +; action = 1 +; death = 2 +; superjump = 3 +; shaking = 4 ; turn_function_jump_table_index: u8 ; action_function_jump_table_index: u8 ; health: u8 (DAA decimal !!) @@ -195,6 +200,7 @@ ; bit 0: speed 2x ; bit 1: shadow mode ; bit 2: end of turn attack mode +; bit 3: blinking mode ; status: u8 ; ; bit 0: whether or not turns should be skipped ; mana: u8 diff --git a/enemiesattacks/basic.gbasm b/enemiesattacks/basic.gbasm index ed2a633..2f08858 100644 --- a/enemiesattacks/basic.gbasm +++ b/enemiesattacks/basic.gbasm @@ -3,19 +3,16 @@ Basic_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D OR $10 LD D, A - ; For Future Attacks: This is an attack that would freeze the bunny and move -4 x the entity - ; LD A, $01 - ; LD $mem_bunny_status, A - ; LD A, $02 - ; LD $mem_bunny_flags, A - ; LD A, $mem_bunny_direction - ; AND $07 - ; LD $mem_bunny_direction, A - ; CALL =Fix_Bunny_screen - - ; LD A, B - ; SUB $04 - ; LD B, A + PUSH BC + LD A, $mem_bunny_direction + AND $08 + LD B, A + LD A, $mem_bunny_flags + AND $01 + OR B + CP $09 + POP BC + RET Z LD A, $mem_bunny_health SUB $01 @@ -29,4 +26,14 @@ Basic_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D LD $mem_bunny_health, A .Skip_health_underflow_fix: + LD A, $mem_bunny_flags + SET 3, A + LD $mem_bunny_flags, A + + LD A, $mem_moving_animation_step + LD B, A + LD A, $1f + SUB B + LD $mem_blinking_animation_counter, A + RET diff --git a/enemiesattacks/freeze.gbasm b/enemiesattacks/freeze.gbasm index ba393c8..4c755fd 100644 --- a/enemiesattacks/freeze.gbasm +++ b/enemiesattacks/freeze.gbasm @@ -3,6 +3,17 @@ Freeze_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D OR $10 LD D, A + PUSH BC + LD A, $mem_bunny_direction + AND $08 + LD B, A + LD A, $mem_bunny_flags + AND $01 + OR B + CP $09 + POP BC + RET Z + LD A, $01 LD $mem_bunny_status, A LD A, $02 diff --git a/enemiesattacks/laser.gbasm b/enemiesattacks/laser.gbasm index 4a0d029..2c1cebb 100644 --- a/enemiesattacks/laser.gbasm +++ b/enemiesattacks/laser.gbasm @@ -76,6 +76,7 @@ Laser_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D POP BC LD A, D + LD D, $10 CALL =Try_Launch_Animation LD A, $enum_animation_wait_mode diff --git a/entity/actions.gbasm b/entity/actions.gbasm index d6977e9..11951e6 100644 --- a/entity/actions.gbasm +++ b/entity/actions.gbasm @@ -55,6 +55,13 @@ Entity_Action: RET Update_Animation_Steps: + LD A, $mem_blinking_animation_counter + DEC A + CP $ff + JR Z, =.Skip_blinking_update + LD $mem_blinking_animation_counter, A + .Skip_blinking_update: + LD A, $mem_map_loading_flags BIT 3, A JR Z, =.update_mode @@ -112,7 +119,7 @@ Turn_Jump_table: NOP ; 03 - JP =Frog_Turn + JP =Cat_Turn NOP ; 04 @@ -202,5 +209,10 @@ Enemy_Interaction: LD A, (HL) DEC A DAA - LD (HL), A + LD (HL+), A + + SET 3, (HL) + LD A, $24 + LD $mem_blinking_animation_counter, A + RET diff --git a/entity/bunny.gbasm b/entity/bunny.gbasm index 4b9bba7..f8e07ac 100644 --- a/entity/bunny.gbasm +++ b/entity/bunny.gbasm @@ -51,6 +51,10 @@ Move_Bunny: LD A, $mem_map_loading_flags SET 3, A LD $mem_map_loading_flags, A + + LD A, $mem_bunny_flags + RES 3, A + LD $mem_bunny_flags, A RET .no_skip: @@ -72,6 +76,10 @@ Move_Bunny: SET 3, A LD $mem_map_loading_flags, A + LD A, $mem_bunny_flags + RES 3, A + LD $mem_bunny_flags, A + LD A, $mem_button_action BIT 1, A JR NZ, =.Start_action_or_movement.cancel_movement diff --git a/entity/frog.gbasm b/entity/cat.gbasm index 428e88a..35d0b0c 100644 --- a/entity/frog.gbasm +++ b/entity/cat.gbasm @@ -1,4 +1,4 @@ -Frog_Turn: +Cat_Turn: LD A, $mem_map_loading_flags BIT 3, A RET Z @@ -80,6 +80,12 @@ Frog_Turn: CP $00 JP NZ, =.Start_action_or_movement.end + LD A, L + AND $f0 + OR $07 + LD L, A + RES 3, (HL) + .Try_Basic_Attack: CALL =Check_player_next_to LD A, E @@ -97,6 +103,7 @@ Frog_Turn: LD A, $mem_moving_animation_step CP $0f JP NZ, =.End_movement.end + LD A, D AND $07 BIT 3, D diff --git a/entity/display.gbasm b/entity/display.gbasm index 69da0ab..75b1e29 100644 --- a/entity/display.gbasm +++ b/entity/display.gbasm @@ -103,21 +103,22 @@ Display_Entity: .Moving_Animation.end: .Blinking_Animation: - LD A, D + LD A, L AND $f0 - CP $50 - JR NZ, =.Blinking_Animation.end + OR $07 + LD L, A + BIT 3, (HL) + JR Z, =.Blinking_Animation.end - LD A, $mem_moving_animation_step + LD A, $mem_blinking_animation_counter PUSH DE LD E, A LD A, $mem_loading_step XOR E POP DE AND $02 - CP $00 + CP $02 JP Z, =.skip - .Blinking_Animation.end: diff --git a/entity/fox.gbasm b/entity/fox.gbasm index d82cc66..5e225ec 100644 --- a/entity/fox.gbasm +++ b/entity/fox.gbasm @@ -82,6 +82,12 @@ Fox_Turn: LD A, L AND $f0 + OR $07 + LD L, A + RES 3, (HL) + + LD A, L + AND $f0 ADD $09 LD L, A XOR A diff --git a/entity/list.gbasm b/entity/list.gbasm index 054a563..acbe12d 100644 --- a/entity/list.gbasm +++ b/entity/list.gbasm @@ -10,7 +10,7 @@ Entity_list: .DB $01 ; Starting health - .DB $04 + .DB $02 ; Starting mana .DB $05 @@ -64,7 +64,7 @@ Entity_list: .DB $01 ; Starting health - .DB $05 + .DB $01 ; Starting mana .DB $03 diff --git a/entity/penguin.gbasm b/entity/penguin.gbasm index 363516b..0078fb9 100644 --- a/entity/penguin.gbasm +++ b/entity/penguin.gbasm @@ -80,6 +80,12 @@ Penguin_Turn: CP $00 JP NZ, =.Start_action_or_movement.end + LD A, L + AND $f0 + OR $07 + LD L, A + RES 3, (HL) + LD A, $mem_bunny_status CP $01 JR NZ, =.Try_Freeze_Attack @@ -203,12 +203,18 @@ Reload_EP_Cost: LD HL, =Attack_List LD A, L ADD E - ADD $04 LD L, A LD A, H ADC D LD H, A + LD A, L + ADD $04 + LD L, A + LD A, H + ADC $00 + LD H, A + LD A, (HL) LD $mem_current_focused_attack_ep_cost, A @@ -98,9 +98,10 @@ Entrypoint: New_Dungeon: LD SP, $fffe LD HL, $mem_loaded_enemies_indices - LD A, $00 + LD A, $02 LD (HL+), A LD (HL+), A + LD A, $00 LD (HL+), A LD A, $03 LD (HL+), A @@ -283,7 +284,7 @@ STAT_Entrypoint: .INCLUDE "entity/init.gbasm" .INCLUDE "entity/bunny.gbasm" .INCLUDE "entity/fox.gbasm" -.INCLUDE "entity/frog.gbasm" +.INCLUDE "entity/cat.gbasm" .INCLUDE "entity/penguin.gbasm" .INCLUDE "entity/actions.gbasm" .INCLUDE "entity/collisions.gbasm" diff --git a/map/objects.gbasm b/map/objects.gbasm index edf276f..dd89e87 100644 --- a/map/objects.gbasm +++ b/map/objects.gbasm @@ -165,8 +165,11 @@ Heal_Action: LD A, $mem_bunny_y LD C, A LD A, $01 + PUSH DE LD E, $20 + LD D, $00 CALL =Try_Launch_Animation + POP DE POP BC LD (HL), $00 @@ -188,8 +191,11 @@ Restore_EP_Action: LD A, $mem_bunny_y LD C, A LD A, $01 + PUSH DE LD E, $20 + LD D, $00 CALL =Try_Launch_Animation + POP DE POP BC LD (HL), $00 diff --git a/playerattacks/earcoptr.gbasm b/playerattacks/earcoptr.gbasm index 123ec86..cc47672 100644 --- a/playerattacks/earcoptr.gbasm +++ b/playerattacks/earcoptr.gbasm @@ -51,10 +51,6 @@ Earcoptr_Attack_Loading_Regular: RET NC INC C - LD A, (BC) - AND $0f - OR $50 - LD (BC), A LD A, C ADD $03 @@ -63,6 +59,18 @@ Earcoptr_Attack_Loading_Regular: SUB $01 RET C LD (BC), A + + INC C + LD A, (BC) + SET 3, A + LD (BC), A + + LD A, $mem_moving_animation_step + LD B, A + LD A, $1f + SUB B + LD $mem_blinking_animation_counter, A + RET Earcoptr_Attack: @@ -72,8 +80,11 @@ Earcoptr_Attack: LD A, $mem_bunny_y LD C, A LD A, $02 + PUSH DE LD E, $30 + LD D, $00 CALL =Try_Launch_Animation + POP DE POP BC LD BC, =Earcoptr_Attack_Loading_VBlank diff --git a/playerattacks/heal.gbasm b/playerattacks/heal.gbasm index 789afac..72f83fe 100644 --- a/playerattacks/heal.gbasm +++ b/playerattacks/heal.gbasm @@ -14,8 +14,11 @@ Heal_Attack: LD A, $mem_bunny_y LD C, A LD A, $01 + PUSH DE LD E, $20 + LD D, $00 CALL =Try_Launch_Animation + POP DE POP BC LD A, $enum_dungeon_mode diff --git a/sprites/gui/floor.png b/sprites/gui/floor.png Binary files differnew file mode 100644 index 0000000..3ab9420 --- /dev/null +++ b/sprites/gui/floor.png |