;;==== GLOBALES DEL SISTEMA DE RENDER ======================
        .globl render_title
        .globl render_game
        .globl render_entity
        .globl render_update
        .globl render_deadPlayer
        .globl render_endgame
        .globl render_points
        .globl render_finished
;;===========================================================

;;---------------------------------
;;      SET SPRTIE TO ENTITY
;;---------------------------------
;;  INPUT : POINTER AL SPRITE
;;---------------------------------

.macro ChangeSpriteDirection _sprite
        
        ld hl, #_sprite
        ld e_sprite_ptr_l(ix),  l
        ld e_sprite_ptr_h(ix),  h

.endm

;;---------------------------------
;;    CHANGE SCREEN TO MODE 1
;;---------------------------------
;;  INPUT : POINTER AL SPRITE
;;---------------------------------

.macro SetScreenImageMode1 _image_or_not, _decomp_img_end,  _string, _x, _y, _c_fg, _c_bg 

        cpctm_clearScreen_asm 0         ;;  LIMPIA LA PANTALLA ANTERIOR DE TITULO

        ;;      SET VIDEO MODE
        ld  c,  #v_mode_title     
        call    cpct_setVideoMode_asm   ;;  INPUT : "C" , SET VIDEO MODE TO 1

        ;;      SET PALETTE
        ld  hl, #_g_palette_mode_1
        ld  de, #pal_size_title
        call    cpct_setPalette_asm     ;;  INPUT : "HL", SET PALETTE SIZE TO 4
        
        cpctm_setBorder_asm HW_BLACK

        ;;      CHECK IF IMAGE OR NOT
        ld a, #_image_or_not
        dec a
        jr nz, only_string_'_string
        ;;=======================================
        ;;            DECOMPRESSION
        ;;  Descomprimimos la imagen de titulo
        ;;=======================================
                ld de, #screen_end
                ld hl, #_decomp_img_end
                call cpct_zx7b_decrunch_s_asm   ;;  INPUT : "DE": DIRECCION DE FIN DE PANTALLA
                                                ;;          "HL": DIRECCION DE FIN DE COMPRESSED FILE
        ;;=======================================
        ;;      DRAW STRING
        only_string_'_string: 

                ld c, #_c_fg                    ;;  Color elementos primer plano
                ld b, #_c_bg                    ;;  Color elementos background
                ld hl, #_string                 ;;  Pointer to the string

                cpctm_screenPtr_asm de, CPCT_VMEM_START_ASM, _x, _y

                call cpct_drawStringM1_f_asm    ;;  INPUTS C: COLOR, B: BG_COLOR, DE: VMEM , HL: STRING_PTR
.endm