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



                              1 ;; MIT License
                              2 ;; 
                              3 ;; Copyright (c) 2021 capAI / Aitana Devis  Ávila (@AitanaDevis) / Carlos Peñarrubia Morcillo  (@carlospm12) / Pablo Ruiz Ponce (@pabloruizp)
                              4 ;; 
                              5 ;; Permission is hereby granted, free of charge, to any person obtaining a copy
                              6 ;; of this software and associated documentation files (the "Software"), to deal
                              7 ;; in the Software without restriction, including without limitation the rights
                              8 ;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
                              9 ;; copies of the Software, and to permit persons to whom the Software is
                             10 ;; furnished to do so, subject to the following conditions:
                             11 ;; 
                             12 ;; The above copyright notice and this permission notice shall be included in all
                             13 ;; copies or substantial portions of the Software.
                             14 ;; 
                             15 ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
                             16 ;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                             17 ;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
                             18 ;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                             19 ;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
                             20 ;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
                             21 ;; SOFTWARE.
                             22 
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 2.
Hexadecimal [16-Bits]



                             23 .include "man/interrupt.h.s"
                              1 ;; MIT License
                              2 ;; 
                              3 ;; Copyright (c) 2021 capAI / Aitana Devis  Ávila (@AitanaDevis) / Carlos Peñarrubia Morcillo  (@carlospm12) / Pablo Ruiz Ponce (@pabloruizp)
                              4 ;; 
                              5 ;; Permission is hereby granted, free of charge, to any person obtaining a copy
                              6 ;; of this software and associated documentation files (the "Software"), to deal
                              7 ;; in the Software without restriction, including without limitation the rights
                              8 ;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
                              9 ;; copies of the Software, and to permit persons to whom the Software is
                             10 ;; furnished to do so, subject to the following conditions:
                             11 ;; 
                             12 ;; The above copyright notice and this permission notice shall be included in all
                             13 ;; copies or substantial portions of the Software.
                             14 ;; 
                             15 ;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
                             16 ;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                             17 ;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
                             18 ;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                             19 ;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
                             20 ;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
                             21 ;; SOFTWARE.
                             22 
                             23 .globl man_interrupt
                             24 .globl cpct_akp_stop_asm
ASxxxx Assembler V02.00 + NoICE + SDCC mods  (Zilog Z80 / Hitachi HD64180), page 3.
Hexadecimal [16-Bits]



                             24 
                             25 .globl cpct_disableFirmware_asm
                             26 .globl _man_game_logic
                             27 .globl cpct_setVideoMode_asm
                             28 .globl cpct_setPALColour_asm
                             29 .globl _pal_main
                             30 .globl _pal_main2
                             31 .globl cpct_setPalette_asm
                             32 .globl cpct_setInterruptHandler_asm
                             33 
                             34 .area _CODE
                             35 
   3F13                      36 _main::
                             37    
   3F13 31 00 80      [10]   38    ld sp, #0x8000    ;; CAMBIAMOS LA POSICION DEL STACK
                             39    
   3F16 CD 56 56      [17]   40    call cpct_disableFirmware_asm    ;; DESABILITAMOS EL FIRMWARE
                             41 
   3F19 0E 00         [ 7]   42    ld c, #0
   3F1B CD 3E 56      [17]   43    call cpct_setVideoMode_asm       ;; CAMBIAMOS A MODO 0
                             44 
   3F1E 21 00 14      [10]   45    ld hl, #0x1400
   3F21 CD 5D 4C      [17]   46    call cpct_setPALColour_asm       ;; SETEAMOS EL FONDO NEGRO
                             47    
   3F24 21 10 14      [10]   48    ld hl, #0x1410
   3F27 CD 5D 4C      [17]   49    call cpct_setPALColour_asm       ;; PINTAMOS EL BORDE DE NEGRO
                             50 
   3F2A 21 15 34      [10]   51    ld hl, #_pal_main2
   3F2D 11 10 00      [10]   52    ld de, #16                    ;;TAMAÑO DE LA PALETA 
   3F30 CD 4A 4C      [17]   53    call cpct_setPalette_asm    ;;SETEAMOS LA PALETA DEL SPRITE DOGGO
                             54 
                             55   
   3F33 21 00 80      [10]   56    ld hl, #0x8000
   3F36 11 01 80      [10]   57    ld de, #0x8001
   3F39 01 FF 3F      [10]   58    ld bc, #0x4000-1
   3F3C 36 00         [10]   59    ld (hl), #0
   3F3E ED B0         [21]   60    ldir
                             61 
                             62    ;;;;;; MUSIC MANAGER ;;;;;;;;
   3F40 21 D0 4A      [10]   63    ld hl, #man_interrupt ;;function that will handle interrupts from now on
   3F43 CD 16 4C      [17]   64    call cpct_setInterruptHandler_asm ;;destroys A, HL
                             65    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                             66 
   3F46 CD DF 49      [17]   67    call _man_game_logic
   3F49 18 FE         [12]   68    jr .
                             69    
