Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;-----------------------------LICENSE NOTICE------------------------------------
- ;; This file is part of CPCtelera: An Amstrad CPC Game Engine
- ;; Copyright (C) 2018 ronaldo / Fremos / Cheesetea / ByteRealms (@FranGallegoBR)
- ;;
- ;; This program is free software: you can redistribute it and/or modify
- ;; it under the terms of the GNU Lesser General Public License as published by
- ;; the Free Software Foundation, either version 3 of the License, or
- ;; (at your option) any later version.
- ;;
- ;; This program 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 Lesser General Public License for more details.
- ;;
- ;; You should have received a copy of the GNU Lesser General Public License
- ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
- ;;-------------------------------------------------------------------------------
- ;; Include all CPCtelera constant definitions, macros and variables
- .include "cpctelera.h.s"
- ;;
- ;; Start of _DATA area
- ;; SDCC requires at least _DATA and _CODE areas to be declared, but you may use
- ;; any one of them for any purpose. Usually, compiler puts _DATA area contents
- ;; right after _CODE area contents.
- ;;
- .area _DATA
- .area _CODE
- hero_data:
- .db 0x14, 0x21 ;; X, Y
- .db 0x02, 0x08 ;; W, H
- .db 0x0F ;; Color
- enemy_data:
- .db 0x20, 0x01 ;; X, Y
- .db 0x02, 0x08 ;; W, H
- .db 0xFF ;; Color
- ;;
- ;; Declare all function entry points as global symbols for the compiler.
- ;; (The linker will know what to do with them)
- ;; WARNING: Every global symbol declared will be linked, so DO NOT declare
- ;; symbols for functions you do not use.
- ;;
- .globl cpct_disableFirmware_asm
- .globl cpct_drawSolidBox_asm
- .globl cpct_getScreenPtr_asm
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; DIBUJAR UNA ENTIDAD
- ;; REGISTROS DESTRUIDOS: AF, BC, DE, HL
- ;; ENTRADA: IX -> Puntero a entidad
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ent_draw:
- ld de, #0xC000 ;;Comienzo memoria de video
- ld c, 1(ix) ;; C = Entity Y
- ld b, 0(ix) ;; B = Entity X
- call cpct_getScreenPtr_asm
- ex de, hl ;; DE = Puntero a memoria
- ld a, 4(ix) ;; Color
- ld b, 3(ix) ;; alto
- ld c, 2(ix) ;; Ancho
- call cpct_drawSolidBox_asm
- ret
- ;;
- ;; MAIN function. This is the entry point of the application.
- ;; _main:: global symbol is required for correctly compiling and linking
- ;;
- _main::
- ;; Disable firmware to prevent it from interfering with string drawing
- call cpct_disableFirmware_asm
- ld ix, #hero_data
- call ent_draw
- ld ix, #enemy_data
- call ent_draw
- ;; Loop forever
- loop:
- jr loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement