;; This file is part of Moonsters
;;  Copyright (C) 2021 Dam Studios
;;
;;     Moonsters is free software: you can redistribute it and/or modify
;;     it under the terms of the GNU General Public License as published by
;;     the Free Software Foundation, either version 3 of the License, or
;;     (at your option) any later version.
;; 
;;     SHOOT TO MOVE is distributed in the hope that it will be useful,
;;     but WITHOUT ANY WARRANTY; without even the implied warranty of
;;     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;     GNU General Public License for more details.
;; 
;;     You should have received a copy of the GNU General Public License
;;     along with Moonsters  If not, see <https://www.gnu.org/licenses/>.



.include "man/entity_manager.h.s"
.include "sys/menu.h.s"
.include "cpctelera.h.s"
.include "assets/assets.h.s"

press_str: .asciz "PRESS ENTER"
ending_victory2:: .asciz "VICTORY! YOU MADE IT!"

esperaTecla: 
    push hl
    call cpct_scanKeyboard_asm
    pop hl
    push hl
    call cpct_isKeyPressed_asm
    pop hl
    jr nz, esperaTecla

    empezar:
    push hl
    call cpct_scanKeyboard_asm
    pop hl
    push hl 
    call cpct_isKeyPressed_asm
    pop hl
    jr z, empezar
    
    ret

sys_menu_start::

    ld c, #0
	call cpct_setVideoMode_asm ;;pone el modo de video a cero

    ld hl, #_sp_reballPal
	ld de, #16
	call cpct_setPalette_asm ;;paleta

    ld hl, #0x000F
    call cpct_setDrawCharM0_asm
    ld iy, #press_str
    ld de, #0xC000
	ld c, #18
	ld b, #180
    call cpct_getScreenPtr_asm
    call cpct_drawStringM0_asm

     ;; Cambiar posición string

    ld hl, #Key_Return
    call esperaTecla

    cpctm_clearScreen_asm 0

ret

