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 ;;-------------------------------------------------------------------------------
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 2.
Hexadecimal [16-Bits]



                             18 .include "physics.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 ;;  PHYSICS SYSTEM
                             22 ;;=======================
                             23 ;;=======================
                             24 
                             25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             26 ;;                      Const                            ;;
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 
                             29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             30 ;;                      Public functions                 ;;
                             31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             32 .globl sys_physics_update
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 3.
Hexadecimal [16-Bits]



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



                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;Description:                                           ;;                                                          
                             23 ;;      Modifies every entity with mov flag, updating vx ;;
                             24 ;;     and vy                                            ;;
                             25 ;;Required:                                              ;;
                             26 ;;     IX -> Position of the array entities              ;;  
                             27 ;; Return:                                               ;;                                                  
                             28 ;;     -                                                 ;;
                             29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   6E3D                      30 sys_physics_update_one:
   6E3D CD 62 6E      [17]   31     call mueve_x
   6E40 F5            [11]   32     push af
                             33     
   6E41 3E 4C         [ 7]   34     ld a, #76
   6E43 D1            [10]   35     pop de   
   6E44 BA            [ 4]   36     cp d
   6E45 DA 56 6E      [10]   37     jp c, _set2destroy
   6E48 DD 72 01      [19]   38     ld e_x(ix), d
                             39 
   6E4B CD 6A 6E      [17]   40     call mueve_y
   6E4E 3D            [ 4]   41     dec a
   6E4F B9            [ 4]   42     cp c
   6E50 D0            [11]   43     ret nc
   6E51 3C            [ 4]   44     inc a
   6E52 DD 77 02      [19]   45     ld e_y(ix), a
   6E55 C9            [10]   46     ret
   6E56                      47 _set2destroy:
   6E56 DD 66 0C      [19]   48     ld h, e_phy1(ix)
   6E59 DD 6E 0B      [19]   49     ld l, e_phy2(ix)
   6E5C 01 61 6E      [10]   50     ld bc, #_out_physics
   6E5F C5            [11]   51     push bc
   6E60 E9            [ 4]   52     jp (hl)
   6E61                      53     _out_physics:
   6E61 C9            [10]   54     ret
   6E62                      55 mueve_x:
   6E62 DD 46 03      [19]   56     ld b,e_vx(ix)
   6E65 DD 7E 01      [19]   57     ld a,e_x(ix)
   6E68 80            [ 4]   58     add a,b
   6E69 C9            [10]   59     ret
   6E6A                      60 mueve_y:
   6E6A DD 46 04      [19]   61     ld b, e_vy(ix)
   6E6D DD 7E 02      [19]   62     ld a, e_y(ix)
   6E70 80            [ 4]   63     add a, b
   6E71 0E 8A         [ 7]   64     ld c, #138
   6E73 C9            [10]   65     ret
                             66 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             67 ;;Description:                                           ;;                                                          
                             68 ;;    Updates all physics                                ;;
                             69 ;;Required:                                              ;;
                             70 ;;     IX -> Position of the array entities              ;;  
                             71 ;; Return:                                               ;;                                                  
                             72 ;;     -                                                 ;;
                             73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   6E74                      74 sys_physics_update::
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 6.
Hexadecimal [16-Bits]



   6E74 21 3D 6E      [10]   75     ld hl, #sys_physics_update_one
   6E77 3E 02         [ 7]   76     ld a, #e_cmp_mov
   6E79 CD 16 74      [17]   77     call man_entity_forall
   6E7C C9            [10]   78     ret
