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 "colisions.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 ;;  COLISIONS SYSTEM
                             22 ;;=======================
                             23 ;;=======================
                             24 
                             25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             26 ;;                      Const                            ;;
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 
                             29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             30 ;;                      Public functions                 ;;
                             31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             32 
                             33 .globl sys_colisions_update
                             34 .globl sys_colisions_destroy
                             35 .globl sys_colisions_enemy
                             36 .globl sys_colisions_sub_enemy
                             37 .globl sys_colisions_shot
                             38 .globl sys_colisions_bottle
                             39 .globl sys_colisions_player
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 3.
Hexadecimal [16-Bits]



                             20 .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 4.
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 5.
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 6.
Hexadecimal [16-Bits]



                             21 .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 7.
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 8.
Hexadecimal [16-Bits]



                             22 .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 9.
Hexadecimal [16-Bits]



                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 ;;Description:                                           ;;                                                          
                             25 ;;   Checks if any entity colided                        ;;
                             26 ;;                                                       ;;
                             27 ;;Required:                                              ;;
                             28 ;;     IX                                                ;;  
                             29 ;;     IY                                                ;;
                             30 ;; Return:                                               ;;                                                  
                             31 ;;     -                                                 ;;
                             32 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   68A4                      33 sys_colisions_update_one:
                             34     ;;Aqui comprobamos que nos se ha chocado en el eje x
   68A4 CD CA 68      [17]   35     call viking_colides_shot
   68A7 D0            [11]   36     ret nc
                             37     
   68A8 3C            [ 4]   38     inc a
   68A9 FD 4E 05      [19]   39     ld c, e_w(iy)
   68AC DD 46 01      [19]   40     ld b, e_x(ix) 
   68AF 81            [ 4]   41     add a, c
   68B0 B8            [ 4]   42     cp b
   68B1 D8            [11]   43     ret c
                             44     ;;Aqui comprobamos que nos se ha chocado en el eje y
   68B2 CD DA 68      [17]   45     call viking_colides_shot_y
   68B5 D0            [11]   46     ret nc
                             47 
   68B6 3C            [ 4]   48     inc a
   68B7 FD 4E 06      [19]   49     ld c, e_h(iy)
   68BA 81            [ 4]   50     add a, c
   68BB B8            [ 4]   51     cp b
   68BC D8            [11]   52     ret c
                             53          
   68BD FD 7E 12      [19]   54     ld a, e_subType(iy)
   68C0 CD F3 68      [17]   55     call sys_colisions_typecoli
   68C3 DD 7E 12      [19]   56     ld a, e_subType(ix)
   68C6 CD E3 68      [17]   57     call _switch_array
   68C9 C9            [10]   58 ret
   68CA                      59 viking_colides_shot:
   68CA FD 7E 01      [19]   60     ld a, e_x(iy)      
   68CD 3D            [ 4]   61     dec a
   68CE F5            [11]   62     push af
                             63     
   68CF DD 46 05      [19]   64     ld b, e_w(ix)
   68D2 DD 7E 01      [19]   65     ld a, e_x(ix)      
   68D5 80            [ 4]   66     add a, b
   68D6 47            [ 4]   67     ld b, a
   68D7 F1            [10]   68     pop af
   68D8 B8            [ 4]   69     cp b
   68D9 C9            [10]   70     ret
   68DA                      71 viking_colides_shot_y:
   68DA FD 7E 02      [19]   72     ld a, e_y(iy)      
   68DD DD 46 02      [19]   73     ld b, e_y(ix)      
   68E0 3D            [ 4]   74     dec a
   68E1 B8            [ 4]   75     cp b
   68E2 C9            [10]   76     ret
   68E3                      77 _switch_array:
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 10.
Hexadecimal [16-Bits]



   68E3 DD E5         [15]   78     push ix         
   68E5 FD E5         [15]   79     push iy
   68E7 DD E1         [14]   80     pop ix
   68E9 CD F3 68      [17]   81     call sys_colisions_typecoli
   68EC DD E5         [15]   82     push ix         
   68EE FD E1         [14]   83     pop iy
   68F0 DD E1         [14]   84     pop ix
   68F2 C9            [10]   85     ret
   68F3                      86 sys_colisions_typecoli:
   68F3 DD 66 0A      [19]   87     ld h, e_coli1(ix)
   68F6 DD 6E 09      [19]   88     ld l, e_coli2(ix)
   68F9 01 FE 68      [10]   89     ld bc, #_out_coli
   68FC C5            [11]   90     push bc
   68FD E9            [ 4]   91     jp (hl)
   68FE                      92     _out_coli:
   68FE C9            [10]   93 ret
                             94 
   68FF                      95 sys_colisions_destroy:
   68FF CD 03 74      [17]   96     call man_entity_set4_destroy
   6902 C9            [10]   97 ret
   6903                      98 sys_colisions_shot:
   6903 CD 48 6D      [17]   99     call sys_generator_expShot
   6906 CD 0A 69      [17]  100     call sys_colisions_enemy
   6909 C9            [10]  101 ret
   690A                     102 sys_colisions_enemy:
   690A CD 03 74      [17]  103     call man_entity_set4_destroy
   690D C9            [10]  104 ret
   690E                     105 sys_colisions_sub_enemy:
   690E CD 03 74      [17]  106     call man_entity_set4_destroy
   6911 C9            [10]  107 ret
                            108 
   6912                     109 sys_colisions_bottle:
   6912 CD 03 74      [17]  110     call man_entity_set4_destroy
   6915 CD 2C 76      [17]  111     call man_game_player_colision_bottle
   6918 C9            [10]  112 ret
                            113 
   6919                     114 sys_colisions_bottle_reward:
   6919 CD 03 74      [17]  115     call man_entity_set4_destroy
   691C C9            [10]  116 ret
                            117 
   691D                     118 sys_colisions_player:
   691D 06 01         [ 7]  119     ld b, #type_shot
   691F A0            [ 4]  120     and b
   6920 C8            [11]  121     ret z
   6921 CD BE 75      [17]  122     call man_game_player_colision_shot
   6924 C9            [10]  123 ret
                            124 
                            125 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            126 ;;Description:                                           ;;                                                          
                            127 ;;  updates all the entities with the flag e_cmp_colision;;
                            128 ;;Required:                                              ;;
                            129 ;;     -                                                 ;;  
                            130 ;; Return:                                               ;;                                                  
                            131 ;;     -                                                 ;;
                            132 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 11.
Hexadecimal [16-Bits]



   6925                     133 sys_colisions_update::
   6925 21 A4 68      [10]  134     ld hl, #sys_colisions_update_one
   6928 3E 20         [ 7]  135     ld a, #e_cmp_colide
   692A 06 10         [ 7]  136     ld b, #e_cmp_colision
   692C CD 3E 74      [17]  137     call man_entity_forall_match
   692F C9            [10]  138 ret
