ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 1.
Hexadecimal [16-Bits]



                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Viking Hangover
                              3 ;;  Copyright (C) 2021 Ahmed Begga / Érika Moreno / Adriana Morejón (@ComputosGame)
                              4 ;;
                              5 ;;  This program is free software: you can redistribute it and/or modify
                              6 ;;  it under the terms of the GNU Lesser General Public License as published by
                              7 ;;  the Free Software Foundation, either version 3 of the License, or
                              8 ;;  (at your option) any later version.
                              9 ;;
                             10 ;;  This program is distributed in the hope that it will be useful,
                             11 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             12 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             13 ;;  GNU Lesser General Public License for more details.
                             14 ;;
                             15 ;;  You should have received a copy of the GNU Lesser General Public License
                             16 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             17 ;;-------------------------------------------------------------------------------
                             18 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 2.
Hexadecimal [16-Bits]



                             19 .include "generator.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Viking Hangover
                              3 ;;  Copyright (C) 2021 Ahmed Begga / Érika Moreno / Adriana Morejón (@ComputosGame)
                              4 ;;
                              5 ;;  This program is free software: you can redistribute it and/or modify
                              6 ;;  it under the terms of the GNU Lesser General Public License as published by
                              7 ;;  the Free Software Foundation, either version 3 of the License, or
                              8 ;;  (at your option) any later version.
                              9 ;;
                             10 ;;  This program is distributed in the hope that it will be useful,
                             11 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             12 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             13 ;;  GNU Lesser General Public License for more details.
                             14 ;;
                             15 ;;  You should have received a copy of the GNU Lesser General Public License
                             16 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             17 ;;-------------------------------------------------------------------------------
                             18 
                             19 ;;=======================
                             20 ;;=======================
                             21 ;;  GENERATOR SYSTEM
                             22 ;;=======================
                             23 ;;=======================
                             24 
                             25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             26 ;;                      Const                            ;;
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 
                     000A    29 init_max2wait=10
                     000F    30 Minwait2gen=15
                     000A    31 min_nshots=10
                     0064    32 maxShots=100
                     0001    33 Subwait2gen=1
                     000F    34 Addn_shots=15
                     001E    35 ahmed = 30
                     0028    36 SpeedUp1=40
                     003C    37 SpeedUp2=60
                             38 
                             39 
                             40 
                             41 ;;---------------------
                             42 ;; PERSONAJE PRINCIPAL
                             43 ;;---------------------
                             44 .globl _spr_viking
                             45 
                             46 ;;--------------------------------
                             47 ;; PERSONAJE PRINCIPAL ANIMATION
                             48 ;;---------------------------------
                             49 .globl _spr_viking_animation
                             50 ;;-----------
                             51 ;; CHUPITOS
                             52 ;;-----------
                             53 .globl _spr_vaso_amarillo
                             54 .globl _spr_vaso_azul
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 3.
Hexadecimal [16-Bits]



                             55 .globl _spr_vaso_morado
                             56 .globl _spr_vaso_naranja
                             57 .globl _spr_vaso_rojo
                             58 .globl _spr_vaso_verde
                             59 
                             60 ;;-----------------------
                             61 ;;  CHUPITOS ANIMATIONS
                             62 ;;-----------------------
                             63 
                             64 .globl _spr_vaso_amarillo_animation
                             65 .globl _spr_vaso_azul_animation
                             66 .globl _spr_vaso_morado_animation
                             67 .globl _spr_vaso_naranja_animation
                             68 .globl _spr_vaso_rojo_animation
                             69 .globl _spr_vaso_verde_animation
                             70 
                             71 ;;-----------------
                             72 ;; BOTELLA AGUA
                             73 ;;-----------------
                             74 .globl _spr_botella
                             75 
                             76 ;;-------------------------
                             77 ;; BOTELLA AGUA ANIMATION
                             78 ;;--------------------------
                             79 .globl _spr_botella_animation
                             80 
                             81 ;;----------
                             82 ;; VIDA
                             83 ;;----------
                             84 .globl _spr_vida_0
                             85 .globl _spr_vida_1
                             86 .globl _spr_vida_2
                             87 .globl _spr_vida_3
                             88 
                             89 ;;-----------------
                             90 ;; GANAR BOTELLAS
                             91 ;;-----------------
                             92 .globl _spr_botella_winner_0
                             93 .globl _spr_botella_winner_1
                             94 .globl _spr_botella_winner_2
                             95 .globl _spr_botella_winner_3
                             96 .globl _spr_botella_winner_4
                             97 .globl _spr_botella_winner_5
                             98 
                             99 
                            100 ;;----------
                            101 ;; GRASS
                            102 ;;----------
                            103 .globl _spr_grass
                            104 .globl _spr_aranya
                            105 
                            106 ;;;;;;;;;;;;;;;;;;;;;;;;;;
                            107 ;;  GENERAL FUNCTIONS   ;;
                            108 ;;;;;;;;;;;;;;;;;;;;;;;;;;
                            109 .globl sys_generator_init_game
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 4.
Hexadecimal [16-Bits]



                            110 ;;.globl sys_generator_init_menu
                            111 .globl sys_generator_update
                            112 
                            113 .globl sys_generator_expShot
                            114 .globl sys_generator_expBottle
                            115 
                            116 
                            117 .globl initVida
                            118 .globl initBottle
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 5.
Hexadecimal [16-Bits]



                             20 .include "animations.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Viking Hangover
                              3 ;;  Copyright (C) 2021 Ahmed Begga / Érika Moreno / Adriana Morejón (@ComputosGame)
                              4 ;;
                              5 ;;  This program is free software: you can redistribute it and/or modify
                              6 ;;  it under the terms of the GNU Lesser General Public License as published by
                              7 ;;  the Free Software Foundation, either version 3 of the License, or
                              8 ;;  (at your option) any later version.
                              9 ;;
                             10 ;;  This program is distributed in the hope that it will be useful,
                             11 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             12 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             13 ;;  GNU Lesser General Public License for more details.
                             14 ;;
                             15 ;;  You should have received a copy of the GNU Lesser General Public License
                             16 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             17 ;;-------------------------------------------------------------------------------
                             18 
                             19 ;;=======================
                             20 ;;=======================
                             21 ;;  ANIMATIONS SYSTEM
                             22 ;;=======================
                             23 ;;=======================
                             24 
                             25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             26 ;;                      Const                            ;;
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 
                             29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             30 ;;                      Public functions                 ;;
                             31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             32 
                             33 .globl sys_animations_update
                             34 .globl animation_viking
                             35 .globl animation_shot1
                             36 .globl animation_shot2
                             37 .globl animation_shot3
                             38 .globl animation_shot4
                             39 .globl animation_shot5
                             40 .globl animation_bottle
                             41 .globl animation_explosion_shot
                             42 .globl animation_explosion_botella
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 6.
Hexadecimal [16-Bits]



                             21 .include "../man/game.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Viking Hangover
                              3 ;;  Copyright (C) 2021 Ahmed Begga / Érika Moreno / Adriana Morejón (@ComputosGame)
                              4 ;;
                              5 ;;  This program is free software: you can redistribute it and/or modify
                              6 ;;  it under the terms of the GNU Lesser General Public License as published by
                              7 ;;  the Free Software Foundation, either version 3 of the License, or
                              8 ;;  (at your option) any later version.
                              9 ;;
                             10 ;;  This program is distributed in the hope that it will be useful,
                             11 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             12 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             13 ;;  GNU Lesser General Public License for more details.
                             14 ;;
                             15 ;;  You should have received a copy of the GNU Lesser General Public License
                             16 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             17 ;;-------------------------------------------------------------------------------
                             18 
                             19 ;;=======================
                             20 ;;=======================
                             21 ;;  GAME MANAGER
                             22 ;;=======================
                             23 ;;=======================
                             24 
                             25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             26 ;;                      Const                            ;;
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 
                     002D    29 Invulnerability=45
                     0002    30 InvulnerabilityTime=2
                             31 
                             32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             33 ;;                      Public functions                 ;;
                             34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             35 
                             36 .globl man_game_init
                             37 .globl man_game_play
                             38 .globl man_game_player_colision_shot
                             39 .globl man_game_player_colision_bottle
                             40 ;;.globl interruption 
                             41 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 7.
Hexadecimal [16-Bits]



                             22 .include "../man/entity.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Viking Hangover
                              3 ;;  Copyright (C) 2021 Ahmed Begga / Érika Moreno / Adriana Morejón (@ComputosGame)
                              4 ;;
                              5 ;;  This program is free software: you can redistribute it and/or modify
                              6 ;;  it under the terms of the GNU Lesser General Public License as published by
                              7 ;;  the Free Software Foundation, either version 3 of the License, or
                              8 ;;  (at your option) any later version.
                              9 ;;
                             10 ;;  This program is distributed in the hope that it will be useful,
                             11 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             12 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             13 ;;  GNU Lesser General Public License for more details.
                             14 ;;
                             15 ;;  You should have received a copy of the GNU Lesser General Public License
                             16 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             17 ;;-------------------------------------------------------------------------------
                             18 
                             19 ;;=======================
                             20 ;;=======================
                             21 ;;  ENTITY MANAGER
                             22 ;;=======================
                             23 ;;=======================
                             24 
                             25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             26 ;;                      Const                            ;;
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                     001D    28 entity_size=29 
                     0028    29 entity_array_size=40
                     0488    30 entity_array_bytes_size=entity_size*entity_array_size
                             31  
                             32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             33 ;;                      Index                            ;;
                             34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                     0000    35 e_type=0
                     0001    36 e_x=1
                     0002    37 e_y=2
                     0003    38 e_vx=3
                     0004    39 e_vy=4
                     0005    40 e_w=5
                     0006    41 e_h=6
                     0007    42 e_ia2=7
                     0008    43 e_ia1=8
                     0009    44 e_coli2=9
                     000A    45 e_coli1=10
                     000B    46 e_phy2=11
                     000C    47 e_phy1=12
                     000D    48 e_sprite2=13
                     000E    49 e_sprite1=14
                     000F    50 e_prevPos2=15
                     0010    51 e_prevPos1=16
                     0011    52 e_score=17
                     0012    53 e_subType=18
                     0013    54 e_anime2=19
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 8.
Hexadecimal [16-Bits]



                     0014    55 e_anime1=20
                     0015    56 e_count_anime=21
                     0016    57 e_current_anime=22
                     0017    58 e_currentpos2=23
                     0018    59 e_currentpos1=24
                     0019    60 e_count_ia=25
                     001A    61 e_w2rmv=26
                     001B    62 e_h2rmv=27
                     001C    63 e_movement_ia=28
                             64 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             65 ;;                      Types                            ;;
                             66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                     0000    67 e_cmp_invalid=0x00
                     0001    68 e_cmp_render=0x01
                     0002    69 e_cmp_mov=0x02
                     0004    70 e_cmp_input=0x04
                     0008    71 e_cmp_ia=0x08
                     0010    72 e_cmp_colision=0x10
                     0020    73 e_cmp_colide=0x20
                     0040    74 e_cmp_anime=0x40
                     0080    75 e_cmp_dead=0x80
                     007F    76 e_cmp_default=0x7f
                             77 
                     0001    78 type_shot=0x01 
                     0002    79 type_bottle=0x02
                     0004    80 type_static=0x04
                             81 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             82 ;;                      Public functions                 ;;
                             83 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             84 .globl man_entity_init
                             85 .globl man_entity_create
                             86 .globl man_entity_destroy
                             87 .globl man_entity_set4_destroy
                             88 .globl man_entity_destroy_dead
                             89 .globl man_entity_forall
                             90 .globl man_entity_forall_match
                             91 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 9.
Hexadecimal [16-Bits]



                             23 
                             24 
   6DA2                      25 animation_viking:
   6DA2 05                   26     .db #5                 
   6DA3 08 52                27     .dw #_spr_viking
   6DA5 05                   28     .db #5                 
   6DA6 C8 51                29     .dw #_spr_viking_animation
   6DA8 00                   30     .db #0
   6DA9 A2 6D                31     .dw #animation_viking
                             32 
   6DAB                      33 animation_shot1:
   6DAB 05                   34     .db #5                 
   6DAC 48 50                35     .dw #_spr_vaso_rojo
   6DAE 05                   36     .db #5                 
   6DAF 68 4E                37     .dw #_spr_vaso_rojo_animation
   6DB1 00                   38     .db #0
   6DB2 CF 6D                39     .dw #animation_shot5
                             40 
   6DB4                      41 animation_shot2:
   6DB4 05                   42     .db #5                 
   6DB5 D8 50                43     .dw #_spr_vaso_morado
   6DB7 05                   44     .db #5                 
   6DB8 08 4F                45     .dw #_spr_vaso_morado_animation
   6DBA 00                   46     .db #0
   6DBB BD 6D                47     .dw #animation_shot3
                             48 
   6DBD                      49 animation_shot3:
   6DBD 05                   50     .db #5                  ;;actual=0
   6DBE 78 51                51     .dw #_spr_vaso_amarillo
   6DC0 05                   52     .db #5                  ;;actual=3
   6DC1 A8 4F                53     .dw #_spr_vaso_amarillo_animation
   6DC3 00                   54     .db #0
   6DC4 AB 6D                55     .dw #animation_shot1
                             56 
   6DC6                      57 animation_shot4:
   6DC6 05                   58     .db #5                 
   6DC7 28 51                59     .dw #_spr_vaso_azul
   6DC9 05                   60     .db #5                 
   6DCA 58 4F                61     .dw #_spr_vaso_azul_animation
   6DCC 00                   62     .db #0
   6DCD B4 6D                63     .dw #animation_shot2
                             64 
   6DCF                      65 animation_shot5:
   6DCF 05                   66     .db #5                 
   6DD0 F8 4F                67     .dw #_spr_vaso_verde
   6DD2 05                   68     .db #5                 
   6DD3 18 4E                69     .dw #_spr_vaso_verde_animation
   6DD5 00                   70     .db #0
   6DD6 C6 6D                71     .dw #animation_shot4
                             72 
   6DD8                      73 animation_bottle:
   6DD8 05                   74     .db #5                 
   6DD9 C8 4D                75     .dw #_spr_botella
   6DDB 05                   76     .db #5                 
   6DDC 78 4D                77     .dw #_spr_botella_animation
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 10.
Hexadecimal [16-Bits]



   6DDE 00                   78     .db #0
   6DDF D8 6D                79     .dw #animation_bottle
                             80 
   6DE1                      81 animation_explosion_shot:
   6DE1 03                   82     .db #3                 
   6DE2 F8 42                83     .dw #_spr_brigui
   6DE4 03                   84     .db #3          
   6DE5 F8 42                85     .dw #_spr_brigui
   6DE7 03                   86     .db #3          
   6DE8 F8 42                87     .dw #_spr_brigui
   6DEA 03                   88     .db #3          
   6DEB F8 42                89     .dw #_spr_brigui
                             90 
   6DED                      91 animation_explosion_botella:
   6DED 03                   92     .db #3                  
   6DEE B8 42                93     .dw #_spr_brigui_agua
   6DF0 03                   94     .db #3          
   6DF1 B8 42                95     .dw #_spr_brigui_agua
   6DF3 03                   96     .db #3          
   6DF4 B8 42                97     .dw #_spr_brigui_agua
   6DF6 03                   98     .db #3          
   6DF7 B8 42                99     .dw #_spr_brigui_agua
                            100 
                            101 
                            102 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            103 ;;Description:                                           ;;                                                          
                            104 ;;   Checks if any entity colided                        ;;
                            105 ;;                                                       ;;
                            106 ;;Required:                                              ;;
                            107 ;;     -                                                 ;;  
                            108 ;; Return:                                               ;;                                                  
                            109 ;;     -                                                 ;;
                            110 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   6DF9                     111 sys_animations_update_one:
   6DF9 DD 7E 15      [19]  112     ld a, e_count_anime(ix)
   6DFC 3D            [ 4]  113     dec a
   6DFD DD 77 15      [19]  114     ld e_count_anime(ix),a
   6E00 C0            [11]  115     ret nz 
                            116 
   6E01 06 03         [ 7]  117     ld b, #3
   6E03 DD 7E 16      [19]  118     ld a, e_current_anime(ix)
   6E06 80            [ 4]  119     add a, b
   6E07 DD 77 16      [19]  120     ld e_current_anime(ix), a
                            121 
   6E0A                     122     load_anim:
   6E0A DD 6E 13      [19]  123         ld l, e_anime2(ix)
   6E0D DD 66 14      [19]  124         ld h, e_anime1(ix)
   6E10 DD 4E 16      [19]  125         ld c, e_current_anime(ix)
   6E13 06 00         [ 7]  126         ld b, #0
                            127 
   6E15 09            [11]  128         add hl, bc
   6E16 7E            [ 7]  129         ld a, (hl)
   6E17 B7            [ 4]  130         or a
   6E18 CA 36 6E      [10]  131         jp z, reset_anim
   6E1B DD 77 15      [19]  132         ld e_count_anime(ix), a
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 11.
Hexadecimal [16-Bits]



   6E1E CD 22 6E      [17]  133         call actualiza_sprite
   6E21 C9            [10]  134     ret
                            135 
   6E22                     136 actualiza_sprite:
   6E22 23            [ 6]  137         inc hl
   6E23 7E            [ 7]  138         ld a, (hl)
   6E24 DD 77 0D      [19]  139         ld e_sprite2(ix), a
                            140         
   6E27 23            [ 6]  141         inc hl
   6E28 7E            [ 7]  142         ld a, (hl)
   6E29 DD 77 0E      [19]  143         ld e_sprite1(ix), a
   6E2C C9            [10]  144     ret
                            145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            146 ;;Description:                                           ;;                                                          
                            147 ;;   Checks if all entity colided                        ;;
                            148 ;;                                                       ;;
                            149 ;;Required:                                              ;;
                            150 ;;     -                                                 ;;  
                            151 ;; Return:                                               ;;                                                  
                            152 ;;     -                                                 ;;
                            153 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   6E2D                     154 sys_animations_update::
   6E2D 3E 40         [ 7]  155     ld a, #e_cmp_anime
   6E2F 21 F9 6D      [10]  156     ld hl, #sys_animations_update_one
   6E32 CD 16 74      [17]  157     call man_entity_forall
   6E35 C9            [10]  158     ret
   6E36                     159 reset_anim:
   6E36 DD 36 16 00   [19]  160     ld e_current_anime(ix), #0
   6E3A C3 0A 6E      [10]  161     jp load_anim
