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 "difficulty.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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             23 ;;  CONSTANTS
                             24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             25 
                     000D    26 MAXDIFFICULTYLVL=13
                             27 
                             28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             29 ;;  PUBLIC FUNCTIONS
                             30 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             31 
                             32 .globl manDifficultyInit
                             33 .globl manDifficultyUpdate
                             34 .globl manDifficultyIncrease
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 3.
Hexadecimal [16-Bits]



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



                             25 .include "../sys/ai.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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             28 ;;  PUBLIC FUNCTIONS
                             29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             30 
                             31 .globl sysAIInit
                             32 .globl sysAIUpdate
                             33 .globl sysAIMoveLeft
                             34 .globl sysAIEnemy1
                             35 .globl sysAIEnemy2
                             36 .globl sysAIEnemy3
                             37 .globl sysAIEnemy5_1
                             38 .globl sysAIEnemy5_2
                             39 .globl sysAIEnemy6_1
                             40 .globl sysAIEnemy6_2
                             41 .globl sysAIEnemy7_1
                             42 .globl sysAIEnemy7_2
                             43 .globl sysAIEnemyBullet
                             44 .globl sysAIExplosion
                             45 .globl sysAIExplosion2
                             46 
                             47 .globl sysAISetAICounter
                             48 .globl sysAISetSpeedAILeft
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 5.
Hexadecimal [16-Bits]



                             26 .include "../sys/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 6.
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 7.
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 8.
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 9.
Hexadecimal [16-Bits]



                             27 
                             28 
                             29 
                             30 
   72E3                      31 difficultyLvl:
   72E3 00                   32     .db #0
                             33 
   72E4                      34 difficultyArray:
   72E4 1D 73                35     .dw #manDifficultyLvl0  ;;0
   72E6 28 73                36     .dw #manDifficultyLvl1  ;;2
   72E8 2E 73                37     .dw #manDifficultyLvl2  ;;4
   72EA 35 73                38     .dw #manDifficultyLvl3  ;;6
   72EC 3C 73                39     .dw #manDifficultyLvl4  ;;8
   72EE 43 73                40     .dw #manDifficultyLvl5  ;;10
   72F0 4F 73                41     .dw #manDifficultyLvl6  ;;12
                             42 
                             43 
                             44 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             45 ;; manDifficultyInit
                             46 ;; Requisitos:
                             47 ;;      -
                             48 ;; Return:
                             49 ;;      -
                             50 ;; Descripcion:
                             51 ;;      -
                             52 ;;
   72F2                      53 manDifficultyInit::
   72F2 3E 00         [ 7]   54     ld a, #0
   72F4 32 E3 72      [13]   55     ld (difficultyLvl), a
   72F7 C9            [10]   56 ret
                             57 
                             58 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             59 ;; manDifficultyUpdate
                             60 ;; Requisitos:
                             61 ;;      -
                             62 ;; Return:
                             63 ;;      -
                             64 ;; Descripcion:
                             65 ;;      -
                             66 ;;
   72F8                      67 manDifficultyUpdate::
                             68 
   72F8 3A E3 72      [13]   69     ld a, (#difficultyLvl)
   72FB 21 E4 72      [10]   70     ld hl, #difficultyArray
                             71 
   72FE 4D            [ 4]   72     ld c, l
   72FF 1E 00         [ 7]   73     ld e, #0
                             74 
   7301 81            [ 4]   75     add c
   7302 6F            [ 4]   76     ld l, a
                             77     
   7303 7C            [ 4]   78     ld a, h
   7304 8B            [ 4]   79     adc e
   7305 67            [ 4]   80     ld h, a
                             81 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 10.
Hexadecimal [16-Bits]



   7306 5E            [ 7]   82     ld e, (hl)
   7307 23            [ 6]   83     inc hl
   7308 56            [ 7]   84     ld d, (hl)
                             85 
   7309 EB            [ 4]   86     ex de, hl
                             87     
   730A 01 0F 73      [10]   88     ld bc, #endDifficultyUpdate
   730D C5            [11]   89     push bc
                             90     
   730E E9            [ 4]   91     jp (hl)
                             92 
   730F                      93 endDifficultyUpdate:
   730F C9            [10]   94 ret
                             95 
                             96 
                             97 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             98 ;; manDifficultyIncrease
                             99 ;; Requisitos:
                            100 ;;      -
                            101 ;; Return:
                            102 ;;      -
                            103 ;; Descripcion:
                            104 ;;      -
                            105 ;;
   7310                     106 manDifficultyIncrease::
                            107 
   7310 3A E3 72      [13]  108     ld a, (#difficultyLvl)
   7313 3C            [ 4]  109     inc a
   7314 3C            [ 4]  110     inc a
                            111 
   7315 06 0D         [ 7]  112     ld b, #MAXDIFFICULTYLVL
   7317 B8            [ 4]  113     cp b
                            114     
   7318 D0            [11]  115     ret nc
                            116 
   7319 32 E3 72      [13]  117     ld (#difficultyLvl), a
                            118 
   731C C9            [10]  119 ret
                            120 
                            121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            122 ;; manDifficultyLvl0
                            123 ;; Requisitos:
                            124 ;;      -
                            125 ;; Return:
                            126 ;;      -
                            127 ;; Descripcion:
                            128 ;;      -
                            129 ;;
   731D                     130 manDifficultyLvl0:
                            131 
   731D 3E 01         [ 7]  132     ld a, #1
   731F CD E0 81      [17]  133     call sysAISetAICounter
   7322 3E FF         [ 7]  134     ld a, #-1
   7324 CD E4 81      [17]  135     call sysAISetSpeedAILeft
                            136 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 11.
Hexadecimal [16-Bits]



   7327 C9            [10]  137 ret
                            138 
                            139 
                            140 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            141 ;; manDifficultyLvl1
                            142 ;; Requisitos:
                            143 ;;      -
                            144 ;; Return:
                            145 ;;      -
                            146 ;; Descripcion:
                            147 ;;      -
                            148 ;;
   7328                     149 manDifficultyLvl1:
                            150 
   7328 3E 00         [ 7]  151     ld a, #0
   732A CD E0 81      [17]  152     call sysAISetAICounter
                            153 
   732D C9            [10]  154 ret
                            155 
                            156 
                            157 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            158 ;; manDifficultyLvl2
                            159 ;; Requisitos:
                            160 ;;      -
                            161 ;; Return:
                            162 ;;      -
                            163 ;; Descripcion:
                            164 ;;      -
                            165 ;;
   732E                     166 manDifficultyLvl2:
                            167 
   732E 21 BB 79      [10]  168     ld hl, #initEnemy6
   7331 CD 7D 80      [17]  169     call sysGeneratorSetEnemy3
                            170 
   7334 C9            [10]  171 ret
                            172 
                            173 
                            174 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            175 ;; manDifficultyLvl3
                            176 ;; Requisitos:
                            177 ;;      -
                            178 ;; Return:
                            179 ;;      -
                            180 ;; Descripcion:
                            181 ;;      -
                            182 ;;
   7335                     183 manDifficultyLvl3:
                            184 
   7335 21 83 79      [10]  185     ld hl, #initEnemy4
   7338 CD 75 80      [17]  186     call sysGeneratorSetEnemy1
                            187 
   733B C9            [10]  188 ret
                            189 
                            190 
                            191 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 12.
Hexadecimal [16-Bits]



                            192 ;; manDifficultyLvl4
                            193 ;; Requisitos:
                            194 ;;      -
                            195 ;; Return:
                            196 ;;      -
                            197 ;; Descripcion:
                            198 ;;      -
                            199 ;;
   733C                     200 manDifficultyLvl4:
                            201 
   733C 21 9F 79      [10]  202     ld hl, #initEnemy5
   733F CD 79 80      [17]  203     call sysGeneratorSetEnemy2
                            204 
   7342 C9            [10]  205 ret
                            206 
                            207 
                            208 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            209 ;; manDifficultyLvl5
                            210 ;; Requisitos:
                            211 ;;      -
                            212 ;; Return:
                            213 ;;      -
                            214 ;; Descripcion:
                            215 ;;      -
                            216 ;;
   7343                     217 manDifficultyLvl5:
                            218 
   7343 21 D7 79      [10]  219     ld hl, #initEnemy7
   7346 CD 7D 80      [17]  220     call sysGeneratorSetEnemy3
                            221 
   7349 3E 01         [ 7]  222     ld a, #1
   734B CD 85 80      [17]  223     call sysGeneratorSetBoolEnemy3Full
                            224 
   734E C9            [10]  225 ret
                            226 
                            227 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                            228 ;; manDifficultyLvl6
                            229 ;; Requisitos:
                            230 ;;      -
                            231 ;; Return:
                            232 ;;      -
                            233 ;; Descripcion:
                            234 ;;      -
                            235 ;;
   734F                     236 manDifficultyLvl6:
                            237 
   734F 3E FE         [ 7]  238     ld a, #-2
   7351 CD E4 81      [17]  239     call sysAISetSpeedAILeft
                            240 
   7354 21 BB 79      [10]  241     ld hl, #initEnemy6
   7357 CD 7D 80      [17]  242     call sysGeneratorSetEnemy3
                            243 
   735A 3E 00         [ 7]  244     ld a, #0
   735C CD 85 80      [17]  245     call sysGeneratorSetBoolEnemy3Full
                            246 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 13.
Hexadecimal [16-Bits]



   735F C9            [10]  247 ret
