;;####################################################################
;;# GNU Free Documentation License                                   #
;;# Version 1.3, 3 November 2008                                     #
;;#                                                                  #
;;# Copyright (C) 2021 Lumina                                        #
;;# (Paula Garcia Morales, Laura Gil Lopez, Jorge Perez Dominguez)   #
;;#                                                                  #
;;# Everyone is permitted to copy and distribute verbatim copies     #
;;# of this license document, but changing it is not allowed.        #
;;####################################################################


.include "cpctelera.h.s"

.area _DATA
.area _CODE

.globl cpct_disableFirmware_asm

.globl man_menu_init
.globl man_game_init
.globl man_game_play
.globl render_init
.globl interr_musica
.globl interr_musica_over
.globl set_tilemap
.globl reset_nivel
.globl reset_level


set_interr::
   ld hl, #0x38
   ld (hl), #0xC3
   inc hl
   ld (hl), #<interr_musica
   inc hl
   ld (hl), #>interr_musica
   inc hl
   ld (hl), #0xC9
ret

set_interr_over::
   ld hl, #0x38
   ld (hl), #0xC3
   inc hl
   ld (hl), #<interr_musica_over
   inc hl
   ld (hl), #>interr_musica_over
   inc hl
   ld (hl), #0xC9
ret

_main::
   ;; Disable firmware to prevent it from interfering with string drawing
   call cpct_disableFirmware_asm

   ;;si se hace settilemap hay que hacer si o si drawtilemap
   call set_tilemap

   llamadas_principales::

   call reset_nivel
   call reset_level

   call set_interr_over
   
   call man_menu_init

   llamada_siguiente::

   call set_interr

   call man_game_init

   call man_game_play