[A83] DEvPac83 Error
[Prev][Next][Index][Thread]
[A83] DEvPac83 Error
The following program gave me an interesting error in DevPac83. It says
that the file is over 26K. I don't think that source is that big, and
assembling shrinks the thing down. If anybody can help, here it is:
tiles.z80:
.nolist
#include "ion.inc"
#include "eztile.z80"
.list
#ifdef TI83P
.org progstart-2
.db $BB,6D
#else
.org progstart
#endif
ret
jr nc,begin ;where to go to start the program
.db "Tiling Demo",0 ;the title
begin:
ld a,3
ld b,10
ld c,20
ld hl,map
push hl
pop de
ld hl,sprites
call eztinit
ld a,2
ld (scrx),a
ld (scry),a
call eztrender
call ionfastcopy
bcall(_getkey)
ret
map:
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1,1,1
sprites:
.db %11111111
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %10000001
.db %11111111
.db %10000001
.db %01000010
.db %00100100
.db %00011000
.db %00011000
.db %00100100
.db %01000010
.db %10000001
.db %00000000
.db %01111110
.db %01111110
.db %01111110
.db %01111110
.db %01111110
.db %01111110
.db %00000000
.end
END
EZTile.z80:
;-----------
;| Defines |
;-----------
#define xdim saferam2+0
#define ydim saferam2+1
#define scrx saferam2+2
#define scry saferam2+3
#define numtiles saferam2+4
#define tileaddr saferam2+5
#define mapaddr saferam2+7
;-----------------------
;| Initialization |
;-----------------------
;| a - Number of Tiles |
;| b - XDim |
;| c - YDim |
;| de - Map Address |
;| hl - Tile Address |
;-----------------------
eztInit:
ld (numtiles),a
ld a,b
ld (xdim),a
ld a,c
ld (ydim),a
ld (tileaddr),hl
push de
pop hl
ld (mapaddr),hl
ret
;-------------
;| Blank Map |
;-------------
eztBlank:
ld a,(xdim)
ld b,a
ld hl,(mapaddr)
initxloop:
push bc
ld a,(ydim)
ld b,a
inityloop:
ld (hl),0
inc hl
djnz inityloop
pop bc
djnz initxloop
ret
;-------------------
;| Put Tile |
;-------------------
;| a - Tile Number |
;| b - XPos |
;| c - YPos |
;-------------------
eztPutTile:
push af
ld a,(ydim)
ld h,a
ld l,b
bcall(_htimesl)
ld b,0
add hl,bc
ex de,hl
ld hl,(mapaddr)
add hl,de
pop af
ld (hl),a
ret
;--------------
;| Get Tile |
;--------------
;| b - XPos |
;| c - YPos |
;--------------
;| a - Result |
;--------------
eztGetTile:
ld a,(ydim)
ld h,a
ld l,b
bcall(_htimesl)
ld b,0
add hl,bc
ex de,hl
ld hl,(mapaddr)
add hl,de
ld a,(hl)
ret
;----------
;| Render |
;----------
eztRender:
ld a,(scrx)
ld b,a
ld a,(scry)
ld c,a
renderloop1:
push bc
ld a,(scrx)
ld d,a
ld a,b
ld b,d
sub b
add a,a
add a,a
add a,a
ld e,a
ld a,(scry)
ld d,a
ld a,c
ld c,d
sub c
add a,a
add a,a
add a,a
ld d,a
pop bc
push bc
call eztgettile
add a,a
add a,a
add a,a
ld b,0
ld c,a
add hl,bc
push hl
pop ix
ld a,e
ld l,d
ld b,8
call ionputsprite
pop bc
inc c
ld a,c
sub 11
ld d,a
ld a,(scrx)
cp d
jp z,nexti
jp renderloop1
nexti:
ld a,(scry)
ld c,a
inc b
ld a,b
sub 7
ld d,a
ld a,(scry)
cp d
ret z
jp renderloop1
References: