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 Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 2.
Hexadecimal [16-Bits]



                             22 .include "colisions.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;  CONSTANTS
                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 
                             25 
                             26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             27 ;;  PUBLIC FUNCTIONS
                             28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             29 
                             30 .globl sysColisionsUpdate
                             31 .globl sysColisionsDestroy
                             32 .globl sysColisionsEnemy
                             33 .globl sysColisionsSubEnemy
                             34 .globl sysColisionsEnemy1
                             35 .globl sysColisionsEnemy2
                             36 .globl sysColisionsEnemy3
                             37 .globl sysColisionsEnemy5
                             38 .globl sysColisionsEnemy7
                             39 .globl sysColisionsEnemyBullet
                             40 .globl sysColisionsPlayer
                             41 .globl sysColisionsBullet
                             42 .globl sysColisionPUScore
                             43 .globl sysColisionPUBullet
                             44 .globl sysColisionsStar
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 3.
Hexadecimal [16-Bits]



                             23 .include "generator.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;  CONSTANTS
                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 
                     0019    25 InitMaxTime2Generate=25
                     0014    26 MinTime2Generate=20
                             27 
                     000A    28 InitMinNumberEnemies=10
                     0032    29 MaxNumberEnemies=50
                             30 
                     0001    31 SubTime2Generate=1
                     0005    32 AddNumberEnemies=5
                             33 
                     0014    34 SpeedUp1=20
                     0028    35 SpeedUp2=40
                             36 
                             37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             38 ;;  PUBLIC FUNCTIONS
                             39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             40 
                             41 .globl sysGeneratorInit
                             42 .globl sysGeneratorInitGame
                             43 .globl sysGeneratorInitGameOver
                             44 .globl sysGeneratorInitGameOver2
                             45 .globl sysGeneratorInitMenu2
                             46 .globl sysGeneratorInitMenu
                             47 .globl sysGeneratorInitMenuCredit
                             48 .globl sysGeneratorMenuErase
                             49 .globl sysGeneratorMenuSpace
                             50 .globl sysGeneratorMenuInsertCoin
                             51 .globl sysGeneratorUpdate
                             52 .globl sysGeneratorBulletCreator
                             53 .globl sysGeneratorPU
                             54 .globl sysGeneratorExp1
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 4.
Hexadecimal [16-Bits]



                             55 .globl sysGeneratorExp2
                             56 .globl sysGeneratorExp3
                             57 .globl sysGeneratorExp4
                             58 .globl sysGeneratorStar
                             59 
                             60 .globl sysGeneratorSetEnemy1
                             61 .globl sysGeneratorSetEnemy2
                             62 .globl sysGeneratorSetEnemy3
                             63 .globl sysGeneratorSetEnemy3Full
                             64 .globl sysGeneratorSetBoolEnemy3Full
                             65 
                             66 .globl _spr_idle
                             67 .globl _spr_idle2
                             68 .globl _spr_down1
                             69 .globl _spr_down2
                             70 .globl _spr_up1
                             71 .globl _spr_up2
                             72 
                             73 .globl _spr_jetpack1
                             74 .globl _spr_jetpack2
                             75 .globl _spr_jetpack3
                             76 
                             77 .globl _spr_robo
                             78 .globl _spr_robo2
                             79 .globl _spr_robo3
                             80 
                             81 .globl _spr_octo
                             82 .globl _spr_octo2
                             83 
                             84 .globl _spr_drone
                             85 .globl _spr_drone2
                             86 
                             87 .globl _spr_newdrone1
                             88 .globl _spr_newdrone2
                             89 .globl _spr_newdrone3
                             90 
                             91 .globl _spr_knight1
                             92 .globl _spr_knight2
                             93 .globl _spr_knight3
                             94 
                             95 .globl _spr_newrobot1
                             96 .globl _spr_newrobot2
                             97 .globl _spr_newrobot3
                             98 .globl _spr_newrobot4
                             99 
                            100 .globl _spr_ffirehs
                            101 .globl _spr_ffirehs2
                            102 
                            103 .globl _spr_doblescore1
                            104 .globl _spr_doblescore2
                            105 
                            106 .globl _spr_powerup1
                            107 .globl _spr_powerup2
                            108 .globl _spr_powerup3
                            109 .globl _spr_powerup4
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 5.
Hexadecimal [16-Bits]



                            110 .globl _spr_powerup5
                            111 .globl _spr_powerup6
                            112 .globl _spr_powerup7
                            113 .globl _spr_powerup8
                            114 
                            115 .globl _spr_floor1
                            116 .globl _spr_floor2
                            117 .globl _spr_floor3
                            118 
                            119 .globl _spr_floor11
                            120 .globl _spr_floor22
                            121 .globl _spr_floor33
                            122 
                            123 .globl _spr_rainbow
                            124 .globl _spr_wobniar
                            125 
                            126 .globl _spr_hud_0
                            127 .globl _spr_hud_1
                            128 .globl _spr_hud_2
                            129 .globl _spr_hud_3
                            130 
                            131 .globl _spr_stars0
                            132 .globl _spr_stars1
                            133 .globl _spr_stars2
                            134 .globl _spr_stars3
                            135 
                            136 .globl _spr_explosion10
                            137 .globl _spr_explosion11
                            138 .globl _spr_explosion12
                            139 .globl _spr_explosion13
                            140 .globl _spr_explosion14
                            141 
                            142 .globl _spr_explosion20
                            143 .globl _spr_explosion21
                            144 .globl _spr_explosion22
                            145 .globl _spr_explosion23
                            146 .globl _spr_explosion24
                            147 
                            148 .globl _spr_explosion30
                            149 .globl _spr_explosion31
                            150 .globl _spr_explosion32
                            151 .globl _spr_explosion33
                            152 .globl _spr_explosion34
                            153 
                            154 .globl _spr_explosion40
                            155 .globl _spr_explosion41
                            156 .globl _spr_explosion42
                            157 .globl _spr_explosion43
                            158 .globl _spr_explosion44
                            159 
                            160 .globl _spr_marcoleft
                            161 .globl _spr_marcoright 
                            162 .globl _spr_marcobot_0
                            163 .globl _spr_marcotop_0
                            164 .globl _spr_marcobot_1
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 6.
Hexadecimal [16-Bits]



                            165 .globl _spr_marcotop_1
                            166 
                            167 .globl _spr_cosmic1
                            168 .globl _spr_gatlin
                            169 .globl _spr_hashtag
                            170 .globl _spr_highscore
                            171 .globl _spr_francesc
                            172 .globl _spr_javier
                            173 .globl _spr_insert
                            174 .globl _spr_credit0
                            175 .globl _spr_credit1
                            176 
                            177 .globl _spr_continue
                            178 .globl _spr_gameover
                            179 .globl _spr_space
                            180 .globl _spr_star
                            181 .globl _spr_star2
                            182 .globl _spr_star3
                            183 
                            184 
                            185 
                            186 .globl initStars
                            187 .globl initEnemy1
                            188 .globl initEnemy2
                            189 .globl initEnemy3
                            190 .globl initEnemy4
                            191 .globl initEnemy5
                            192 .globl initEnemy6
                            193 .globl initEnemy7
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 7.
Hexadecimal [16-Bits]



                             24 .include "prerender.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;  CONSTANTS
                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 
                             25 
                             26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             27 ;;  PUBLIC FUNCTIONS
                             28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             29 
                             30 .globl sysPreRenderUpdate
                             31 .globl sysPreRenderUpdateOne
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 8.
Hexadecimal [16-Bits]



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



                             26 .include "../man/entity.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;  CONSTANTS
                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 
                             25     ;; ENTITY INFO
                     001C    26 EntitySize=28 
                     0028    27 EntityArraySize=40
                     0460    28 EntityArrayBytesSize=EntitySize*EntityArraySize
                             29 
                     0028    30 Fila1=40
                     0050    31 Fila2=Fila1+40
                     0078    32 Fila3=Fila2+40
                             33 
                     000D    34 Offset=12+1
                             35 
                     001B    36 EFila1=Fila1-Offset
                     0043    37 EFila2=Fila2-Offset
                     006B    38 EFila3=Fila3-Offset
                             39 
                             40     ;; INDEX FOR IX/IY
                     0000    41 indType=0
                     0001    42 indX=1
                     0002    43 indY=2
                     0003    44 indVx=3
                     0004    45 indVy=4
                     0005    46 indWidth=5
                     0006    47 indHeight=6
                     0007    48 indAI2=7
                     0008    49 indAI1=8
                     0009    50 indColision2=9
                     000A    51 indColision1=10
                     000B    52 indPhysics2=11
                     000C    53 indPhysics1=12
                     000D    54 indSprite2=13
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 10.
Hexadecimal [16-Bits]



                     000E    55 indSprite1=14
                     000F    56 indPrevPos2=15
                     0010    57 indPrevPos1=16
                     0011    58 indScore=17
                     0012    59 indSubType=18
                     0013    60 indAnim2=19
                     0014    61 indAnim1=20
                     0015    62 indAnimCounter=21
                     0016    63 indAnimActual=22
                     0017    64 indActualPos2=23
                     0018    65 indActualPos1=24
                     0019    66 indAICounter=25
                     001A    67 indDelWitdh=26
                     001B    68 indDelHeight=27
                             69 
                             70     ;; ENTITY TYPES
                     0000    71 ETypeInvalid=0x00
                     0001    72 ETypeRenderable=0x01
                     0002    73 ETypeMovable=0x02
                     0004    74 ETypeInput=0x04
                     0008    75 ETypeAI=0x08
                     0010    76 ETypeColisionable=0x10
                     0020    77 ETypeColider=0x20
                     0040    78 ETypeAnimated=0x40
                     0080    79 ETypeDead=0x80
                     007F    80 ETypeDefault=0x7f
                             81 
                     0001    82 AITypeEnemy=0x01
                     0002    83 AITypePU=0x02
                     0004    84 AITypeBullet=0x04
                     0008    85 AITypeInmortal=0x08
                             86 
                     0010    87 RenderTypeStatic=0x10
                             88 
                             89 
                             90 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             91 ;;  PUBLIC FUNCTIONS
                             92 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             93 
                             94 .globl manEntityInit
                             95 .globl manEntityCreate
                             96 .globl manEntityDestroy
                             97 .globl manEntityMarkToDestroy
                             98 .globl manEntityDestroyDead
                             99 .globl manEntityForAll
                            100 .globl manEntityForAllMatching
                            101 .globl getFreeSpace
                            102 .globl getNextFreeEntity
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 11.
Hexadecimal [16-Bits]



                             27 .include "../man/game.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;  CONSTANTS
                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 
                     003C    25 MaxPlayerInvulnerability=60
                     0002    26 MaxPlayerInvSubTime=2
                             27 
                     000F    28 SingleBulletTime=15
                     0005    29 MultiBulletTime=5
                     0028    30 PUTime=40
                             31 
                             32 
                             33 
                             34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             35 ;;  PUBLIC FUNCTIONS
                             36 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             37 
                             38 .globl manGameInit
                             39 .globl manGamePlay
                             40 .globl manGameBulletCreator
                             41 .globl manGamePlayerColision
                             42 .globl manGamePUBulletColision
                             43 .globl manGamePUScoreColision
                             44 
                             45 .globl manGameScore
                             46 .globl manGameSubScore
                             47 .globl manGameGetHighscore
                             48 
                             49 .globl waitHalt
                             50 
                             51 
                             52 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 12.
Hexadecimal [16-Bits]



                             28 .include "render.h.s"
                              1 ;;-----------------------------LICENSE NOTICE------------------------------------
                              2 ;;  This file is part of Cosmic Gatlin: An Amstrad CPC Game 
                              3 ;;  Authors: 
                              4 ;;      Javier Botella Martínez (@javierbotella)
                              5 ;;      Francesc Martinez Torregrosa (@mellamofrancesc)
                              6 ;;
                              7 ;;  This program is free software: you can redistribute it and/or modify
                              8 ;;  it under the terms of the GNU Lesser General Public License as published by
                              9 ;;  the Free Software Foundation, either version 3 of the License, or
                             10 ;;  (at your option) any later version.
                             11 ;;
                             12 ;;  This program is distributed in the hope that it will be useful,
                             13 ;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
                             14 ;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                             15 ;;  GNU Lesser General Public License for more details.
                             16 ;;
                             17 ;;  You should have received a copy of the GNU Lesser General Public License
                             18 ;;  along with this program.  If not, see <http://www.gnu.org/licenses/>.
                             19 ;;------------------------------------------------------------------------------
                             20 
                             21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             22 ;;  CONSTANTS
                             23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             24 
                     F820    25 ScreenScore=0xF820
                             26 
                             27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 ;;  PUBLIC FUNCTIONS
                             29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             30 
                             31 .globl sysRenderInit
                             32 .globl sysRenderInitMenu
                             33 .globl sysRenderUpdate
                             34 .globl sysRenderBorrado
                             35 .globl sysRenderUpdateOne
                             36 .globl sysRenderDrawOnce
                             37 .globl sysRenderScore
                             38 .globl sysRenderGameOverCount
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 13.
Hexadecimal [16-Bits]



                             29 
                             30 .globl _pew
                             31 
                             32 .globl cpct_akp_SFXInit_asm
                             33 .globl cpct_akp_SFXPlay_asm
                             34 .globl cpct_akp_SFXStop_asm
                             35 
                             36 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             37 ;;      sysColisionsUpdateOne
                             38 ;; Requisitos:
                             39 ;;      ix -> Posicion inicial de memoria de la entidad colisionable
                             40 ;;      iy -> Posicion inicial de memoria de la entidad bala
                             41 ;; Return:
                             42 ;;    -
                             43 ;; Descripcion:
                             44 ;;    Comprueba si dos entidades han colisionado o no
                             45 ;;
   77BC                      46 sysColisionsUpdateOne:
                             47 
                             48     ;; x dentro de rango?
                             49 
   77BC FD 7E 01      [19]   50     ld a, indX(iy)      ;; x del colisionable
   77BF 3D            [ 4]   51     dec a
                             52 
   77C0 F5            [11]   53     push af
                             54 
   77C1 DD 7E 01      [19]   55     ld a, indX(ix)      ;; x de la bala
   77C4 DD 46 05      [19]   56     ld b, indWidth(ix)
   77C7 80            [ 4]   57     add a, b
                             58 
   77C8 47            [ 4]   59     ld b, a
                             60 
   77C9 F1            [10]   61     pop af
   77CA B8            [ 4]   62     cp b
                             63 
   77CB D0            [11]   64     ret nc ;; No hay carry-> x + width de la bala < x del colisionable  
                             65 
   77CC 3C            [ 4]   66     inc a
   77CD FD 4E 05      [19]   67     ld c, indWidth(iy)
   77D0 81            [ 4]   68     add a, c
                             69 
   77D1 DD 46 01      [19]   70     ld b, indX(ix)      ;; x de la bala
   77D4 B8            [ 4]   71     cp b
                             72 
   77D5 D8            [11]   73     ret c ;; No hay carry-> x + width de colisionable < x de la bala
                             74 
                             75 
                             76     ;; y dentro de rango?
                             77 
   77D6 FD 7E 02      [19]   78     ld a, indY(iy)      ;; y del colisionable
   77D9 3D            [ 4]   79     dec a
                             80 
   77DA F5            [11]   81     push af
                             82 
   77DB DD 7E 02      [19]   83     ld a, indY(ix)      ;; y de la bala
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 14.
Hexadecimal [16-Bits]



   77DE DD 46 06      [19]   84     ld b, indHeight(ix)
   77E1 80            [ 4]   85     add a, b
                             86 
   77E2 47            [ 4]   87     ld b, a
                             88 
   77E3 F1            [10]   89     pop af
                             90 
                             91 
   77E4 B8            [ 4]   92     cp b
                             93 
   77E5 D0            [11]   94     ret nc ;; No hay carry-> y + height de la bala < y del colisionable  
                             95 
   77E6 3C            [ 4]   96     inc a
   77E7 FD 4E 06      [19]   97     ld c, indHeight(iy)
   77EA 81            [ 4]   98     add a, c
                             99 
   77EB DD 46 02      [19]  100     ld b, indY(ix)      ;; y de la bala
   77EE B8            [ 4]  101     cp b
                            102 
   77EF D8            [11]  103     ret c ;; No hay carry-> y + height de colisionable < y de la bala
                            104 
   77F0 FD 7E 12      [19]  105     ld a, indSubType(iy)
                            106     
   77F3 CD 09 78      [17]  107     call sysColisionsBehaviour
                            108 
   77F6 DD 7E 12      [19]  109     ld a, indSubType(ix)
                            110 
   77F9 DD E5         [15]  111     push ix         ;; Switch ix and iy
   77FB FD E5         [15]  112     push iy
   77FD DD E1         [14]  113     pop ix
                            114     
   77FF CD 09 78      [17]  115     call sysColisionsBehaviour
                            116 
   7802 DD E5         [15]  117     push ix         ;; Switch ix and iy again
   7804 FD E1         [14]  118     pop iy
   7806 DD E1         [14]  119     pop ix
                            120 
   7808 C9            [10]  121 ret
                            122 
                            123 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            124 ;;      sysColisionsBehaviour
                            125 ;; Requisitos:
                            126 ;;      -
                            127 ;; Return:
                            128 ;;      -
                            129 ;; Descripcion:
                            130 ;;      -
                            131 ;;
   7809                     132 sysColisionsBehaviour:
                            133 
   7809 DD 66 0A      [19]  134     ld h, indColision1(ix)
   780C DD 6E 09      [19]  135     ld l, indColision2(ix)
                            136 
   780F 01 14 78      [10]  137     ld bc, #salirColision
   7812 C5            [11]  138     push bc
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 15.
Hexadecimal [16-Bits]



                            139 
   7813 E9            [ 4]  140     jp (hl)
                            141 
   7814                     142     salirColision:
                            143 
   7814 C9            [10]  144 ret
                            145 
                            146 
                            147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            148 ;;      sysColisionsDestroy
                            149 ;; Requisitos:
                            150 ;;      -
                            151 ;; Return:
                            152 ;;      -
                            153 ;; Descripcion:
                            154 ;;      -
                            155 ;;
   7815                     156 sysColisionsDestroy:
                            157 
   7815 CD 1C 71      [17]  158     call manEntityMarkToDestroy
                            159 
   7818 C9            [10]  160 ret
                            161 
                            162 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            163 ;;      sysColisionsStar
                            164 ;; Requisitos:
                            165 ;;      -
                            166 ;; Return:
                            167 ;;      -
                            168 ;; Descripcion:
                            169 ;;      -
                            170 ;;
   7819                     171 sysColisionsStar:
                            172 
   7819 CD 05 83      [17]  173     call sysPreRenderUpdateOne
                            174 
   781C 06 3F         [ 7]  175     ld b, #63
   781E DD 70 01      [19]  176     ld indX(ix), b
                            177 
   7821 CD 05 83      [17]  178     call sysPreRenderUpdateOne
   7824 CD AA 77      [17]  179     call sysRenderBorrado
                            180 
   7827 C9            [10]  181 ret
                            182 
                            183 
                            184 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            185 ;;      sysColisionsEnemy1
                            186 ;; Requisitos:
                            187 ;;      -
                            188 ;; Return:
                            189 ;;      -
                            190 ;; Descripcion:
                            191 ;;      -
                            192 ;;
   7828                     193 sysColisionsEnemy1:
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 16.
Hexadecimal [16-Bits]



                            194 
   7828 CD 05 80      [17]  195     call sysGeneratorExp1
   782B CD 58 78      [17]  196     call sysColisionsEnemy
                            197 
   782E C9            [10]  198 ret
                            199 
                            200 
                            201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            202 ;;      sysColisionsEnemy2
                            203 ;; Requisitos:
                            204 ;;      -
                            205 ;; Return:
                            206 ;;      -
                            207 ;; Descripcion:
                            208 ;;      -
                            209 ;;
   782F                     210 sysColisionsEnemy2:
                            211 
   782F CD 1C 80      [17]  212     call sysGeneratorExp2
   7832 CD 58 78      [17]  213     call sysColisionsEnemy
                            214 
   7835 C9            [10]  215 ret
                            216 
                            217 
                            218 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            219 ;;      sysColisionsEnemy3
                            220 ;; Requisitos:
                            221 ;;      -
                            222 ;; Return:
                            223 ;;      -
                            224 ;; Descripcion:
                            225 ;;      -
                            226 ;;
   7836                     227 sysColisionsEnemy3:
                            228 
   7836 CD 33 80      [17]  229     call sysGeneratorExp3
   7839 CD 58 78      [17]  230     call sysColisionsEnemy
                            231 
   783C C9            [10]  232 ret
                            233 
                            234 
                            235 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            236 ;;      sysColisionsEnemy5
                            237 ;; Requisitos:
                            238 ;;      -
                            239 ;; Return:
                            240 ;;      -
                            241 ;; Descripcion:
                            242 ;;      -
                            243 ;;
   783D                     244 sysColisionsEnemy5:
                            245 
   783D DD 7E 12      [19]  246     ld a, indSubType(ix)
   7840 06 08         [ 7]  247     ld b, #AITypeInmortal
   7842 A0            [ 4]  248     and b
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 17.
Hexadecimal [16-Bits]



                            249 
   7843 C8            [11]  250     ret z
                            251 
   7844 CD 2F 78      [17]  252     call sysColisionsEnemy2
                            253 
   7847 C9            [10]  254 ret
                            255 
                            256 
                            257 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            258 ;;      sysColisionsEnemy7
                            259 ;; Requisitos:
                            260 ;;      -
                            261 ;; Return:
                            262 ;;      -
                            263 ;; Descripcion:
                            264 ;;      -
                            265 ;;
   7848                     266 sysColisionsEnemy7:
                            267 
   7848 3E 00         [ 7]  268     ld a, #0
   784A CD 81 80      [17]  269     call sysGeneratorSetEnemy3Full
                            270 
   784D CD 36 78      [17]  271     call sysColisionsEnemy3
                            272 
   7850 C9            [10]  273 ret
                            274 
                            275 
                            276 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            277 ;;      sysColisionsEnemyBullet
                            278 ;; Requisitos:
                            279 ;;      -
                            280 ;; Return:
                            281 ;;      -
                            282 ;; Descripcion:
                            283 ;;      -
                            284 ;;
   7851                     285 sysColisionsEnemyBullet:
                            286 
   7851 CD 4A 80      [17]  287     call sysGeneratorExp4
   7854 CD 58 78      [17]  288     call sysColisionsEnemy
                            289 
   7857 C9            [10]  290 ret
                            291 
                            292 
                            293 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            294 ;;      sysColisionsEnemy
                            295 ;; Requisitos:
                            296 ;;      -
                            297 ;; Return:
                            298 ;;      -
                            299 ;; Descripcion:
                            300 ;;      -
                            301 ;;
   7858                     302 sysColisionsEnemy:
                            303 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 18.
Hexadecimal [16-Bits]



   7858 CD 1C 71      [17]  304     call manEntityMarkToDestroy
   785B CD C7 75      [17]  305     call manGameScore
                            306 
   785E C9            [10]  307 ret
                            308 
                            309 
                            310 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            311 ;;      sysColisionsSubEnemy
                            312 ;; Requisitos:
                            313 ;;      -
                            314 ;; Return:
                            315 ;;      -
                            316 ;; Descripcion:
                            317 ;;      -
                            318 ;;
   785F                     319 sysColisionsSubEnemy:
                            320 
   785F CD 1C 71      [17]  321     call manEntityMarkToDestroy
   7862 CD EF 75      [17]  322     call manGameSubScore
                            323 
   7865 C9            [10]  324 ret
                            325 
                            326 
                            327 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            328 ;;      sysColisionsPlayer
                            329 ;; Requisitos:
                            330 ;;      -
                            331 ;; Return:
                            332 ;;      -
                            333 ;; Descripcion:
                            334 ;;      -
                            335 ;;
   7866                     336 sysColisionsPlayer:
                            337 
   7866 06 01         [ 7]  338     ld b, #AITypeEnemy
   7868 A0            [ 4]  339     and b
                            340 
   7869 C8            [11]  341     ret z           ;; Si es un enemigo, llama a la funcion
                            342 
   786A CD 52 75      [17]  343     call manGamePlayerColision
                            344 
   786D C9            [10]  345 ret
                            346 
                            347 
                            348 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            349 ;;      sysColisionsBullet
                            350 ;; Requisitos:
                            351 ;;      -
                            352 ;; Return:
                            353 ;;      -
                            354 ;; Descripcion:
                            355 ;;      -
                            356 ;;
   786E                     357 sysColisionsBullet:
                            358 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 19.
Hexadecimal [16-Bits]



   786E 06 02         [ 7]  359     ld b, #AITypePU
   7870 A0            [ 4]  360     and b
                            361 
   7871 C0            [11]  362     ret nz       ;; Si es un power-up, NO llama a la funcion
                            363 
   7872 CD 15 78      [17]  364     call sysColisionsDestroy
                            365 
   7875 11 BC 03      [10]  366     ld de, #_pew
   7878 CD E0 8C      [17]  367    call cpct_akp_SFXInit_asm
                            368 
   787B 2E 01         [ 7]  369    ld l, #1
   787D 26 0F         [ 7]  370    ld h, #15
   787F 1E 2D         [ 7]  371    ld e, #45
   7881 16 00         [ 7]  372    ld d, #0
   7883 01 00 00      [10]  373    ld bc,#0
   7886 3E 0A         [ 7]  374    ld a, #10
   7888 DD E5         [15]  375    push ix 
   788A CD 06 8D      [17]  376    call cpct_akp_SFXPlay_asm
   788D DD E1         [14]  377    pop ix 
                            378 
   788F C9            [10]  379 ret
                            380 
                            381 
                            382 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            383 ;;      sysColisionPUScore
                            384 ;; Requisitos:
                            385 ;;      -
                            386 ;; Return:
                            387 ;;      -
                            388 ;; Descripcion:
                            389 ;;      -
                            390 ;;
   7890                     391 sysColisionPUScore:
                            392 
   7890 06 04         [ 7]  393     ld b, #AITypeBullet
   7892 A0            [ 4]  394     and b
                            395 
   7893 C0            [11]  396     ret nz       ;; Si es una bala, NO llama a la funcion
                            397 
   7894 CD 12 76      [17]  398     call manGamePUScoreColision
   7897 CD 1C 71      [17]  399     call manEntityMarkToDestroy
                            400 
   789A C9            [10]  401 ret
                            402 
                            403 
                            404 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            405 ;;      sysColisionPUBullet
                            406 ;; Requisitos:
                            407 ;;      -
                            408 ;; Return:
                            409 ;;      -
                            410 ;; Descripcion:
                            411 ;;      -
                            412 ;;
   789B                     413 sysColisionPUBullet:
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 20.
Hexadecimal [16-Bits]



                            414 
   789B 06 04         [ 7]  415     ld b, #AITypeBullet
   789D A0            [ 4]  416     and b
                            417 
   789E C0            [11]  418     ret nz       ;; Si es una bala, NO llama a la funcion
                            419 
   789F CD 0B 76      [17]  420     call manGamePUBulletColision
   78A2 CD 1C 71      [17]  421     call manEntityMarkToDestroy
                            422 
   78A5 C9            [10]  423 ret
                            424 
                            425 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            426 ;; sysColisionsUpdate
                            427 ;; Requisitos:
                            428 ;;    -
                            429 ;; Return:
                            430 ;;    -
                            431 ;; Descripcion:
                            432 ;;    Inversion de control para la colision de todas las entidades.
                            433 ;;
   78A6                     434 sysColisionsUpdate::
                            435 
   78A6 21 BC 77      [10]  436     ld hl, #sysColisionsUpdateOne
   78A9 3E 20         [ 7]  437     ld a, #ETypeColider
   78AB 06 10         [ 7]  438     ld b, #ETypeColisionable
   78AD CD 57 71      [17]  439     call manEntityForAllMatching
                            440 
   78B0 C9            [10]  441 ret
