A83: Having a compiling error
[Prev][Next][Index][Thread]
A83: Having a compiling error
When I compile this code I get an error that on a line (203 I think) it expects
a "%" but it's in movax's sprite routine and it's a comment (sorta). Please help
me!
---------------------------------------
Michael Cook
MBCook@MBCook.com (website related)
ICQ: 1145861
---------------------------------------
www.MBCook.com (Main Site)
www.MBCook.com/netsmart.html (NetSmart Homepage)
---------------------------------------
E-Mail for PGP key
---------------------------------------
I pledge allegiance to the compatibles of IBM, and to the developers for which
it stands, one platform, under Bill, indestructible, with peripherals and
multimedia for all.
.NOLIST 
#define equ .equ 
#define EQU .equ 
#define end .end 
#define Sprite 8265h
#include "ti83asm.inc"                                  ; Needed Files
#include "tokens.inc" 
LIST
.org 9327h                                              ; Start of program
Start:
	call _RUNINDICOFF                               ; Turn off the run indicator
	ld a, 0
	ld (Sprite), a                                  ; Set sprite
Main:
	call _CLRLCDFULL                                ; Clear the screen
	ld a, (Sprite)                                  ; Get current sprite
	call Show_Sprite                                ; Do it
	call _GETKEY                                    ; Get a key
	cp 03h                                          ; Is it up?
	jp z, Up
	cp 04h                                          ; Is it down?
	jp z, Down
	cp 09h                                          ; Is it [clear]?
	jp z, Quit
	jp nz, Main                                     ; Nothing happened so start over
Up:
	ld a, (Sprite)                                  ; Get sprite
	cp 4                                            ; Make shure we're not out of sprites
	jp z, Main
	inc a                                           ; Must have room so go up and store it
	ld (Sprite), a
	jp Main                                         ; Now we're done
Down:
	ld a, (Sprite)                                  ; Get sprite
	cp 0                                            ; Make shure we're not out of sprites
	jp z, Main
	dec a                                           ; Must have room so go up and store it
	ld (Sprite), a
	jp Main                                         ; Now we're done
Quit:
	set appTextSave, (iy+appFlags)                  ; Make shure that we clear the backup
	call _CLRSCRNFULL                               ; Clear the screen
	res appTextSave, (iy+appFlags)                  ; Always reset flags
	call _HOMEUP
	ei                                              ; Make shure interupts are on
	ret                                             ; Exit
Show_Sprite:
	ld a, (Sprite)                                  ; Get sprite
	ld hl, Sprite_Data                              ; Get sprite start address
	ld bc, 0                                        ; Set sprite Number
	add a, a                                        ; (have to double it)
	ld (OP1), a                                     ; (Then multiply by 8)
	ld a, 8
	ld (OP2), a
	call _FPMULT
	ld a, (OP1)
	ld c, a                                         ; Now we've got the offset in BC
	add hl, bc                                      ; Get final address in HL
	ld a, 0                                         ; Set cords to upper left
	ld e, a
	call DRWSPR                                     ; Show sprite
	ret                                             ; Return
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ÛÛÛÛÛ Z80 ÛÛÛÛÛÛ³    Sprite83    ³ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ³ movax ³ÛÛÛÛÛÛÛÛÛÛÛÛ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÙ
; Sprite draw routine v1.0 and sprite clear routine v1.0
; Coded by Hannes Edfeldt in 1997
; With these two routines you can draw and clear non-aligned sprites. See
; sprdemo.z80 for an example of how to use these routines.
; Feel free to use these routines in your own productions as long as you give
; me some credit.
; This file should of course be viewed in a DOS texteditor ;)
; Hannes Edfeldt -+- movax@algonet.se -+- http://www.algonet.se/~movax
;ÜÛÛÛÛÛÛÛÛÛÛÛÛß DRWSPR ßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Draw 8x8 sprite þ a=x, e=y, hl=sprite address                              ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
DRWSPR:
        push    hl              ; Save sprite address
;ÛÛÛÛ   Calculate the address in graphbuf   ÛÛÛÛ
        ld      hl,0            ; Do y*12
        ld      d,0
        add     hl,de
        add     hl,de
        add     hl,de
        add     hl,hl
        add     hl,hl
        ld      d,0             ; Do x/8
        ld      e,a
        srl     e
        srl     e
        srl     e
        add     hl,de
        ld      de,8e29h
        add     hl,de           ; Add address to graphbuf
        ld      b,00000111b     ; Get the remainder of x/8
        and     b
        cp      0               ; Is this sprite aligned to 8*n,y?
        jp      z,ALIGN
;ÛÛÛÛ   Non aligned sprite blit starts here   ÛÛÛÛ
        pop     ix              ; ix->sprite
        ld      d,a             ; d=how many bits to shift each line
        ld      e,8             ; Line loop
LILOP:  ld      b,(ix+0)        ; Get sprite data
        ld      c,0             ; Shift loop
        push    de
SHLOP:  srl     b
        rr      c
        dec     d
        jp      nz,SHLOP
        pop     de
        ld      a,b             ; Write line to graphbuf
        or      (hl)
        ld      (hl),a
        inc     hl
        ld      a,c
        or      (hl)
        ld      (hl),a
        ld      bc,11           ; Calculate next line address
        add     hl,bc
        inc     ix              ; Inc spritepointer
        dec     e
        jp      nz,LILOP        ; Next line
        jp      DONE1
;ÛÛÛÛ   Aligned sprite blit starts here   ÛÛÛÛ
ALIGN:                          ; Blit an aligned sprite to graphbuf
        pop     de              ; de->sprite
        ld      b,8
ALOP1:  ld      a,(de)
        or      (hl)            ; xor=erase/blit
        ld      (hl),a
        inc     de
        push    bc
        ld      bc,12
        add     hl,bc
        pop     bc
        djnz    ALOP1
DONE1:
        ret
;ÜÛÛÛÛÛÛÛÛÛÛÛÛÜ DRWSPR ÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;ÜÛÛÛÛÛÛÛÛÛÛÛÛß CLRSPR ßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ Clear 8x8 sprite þ a=x, e=y, hl=sprite address                             ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
CLRSPR:
        push    hl              ; Save sprite address
;ÛÛÛÛ   Calculate the address in graphbuf   ÛÛÛÛ
        ld      hl,0            ; Do y*12
        ld      d,0
        add     hl,de
        add     hl,de
        add     hl,de
        add     hl,hl
        add     hl,hl
        ld      d,0             ; Do x/8
        ld      e,a
        srl     e
        srl     e
        srl     e
        add     hl,de
        ld      de,8e29h
        add     hl,de           ; Add address to graphbuf
        ld      b,00000111b     ; Get the remainder of x/8
        and     b
        cp      0               ; Is this sprite aligned to 8*n,y?
        jp      z,ALIGN2
;ÛÛÛÛ   Non aligned sprite erase starts here   ÛÛÛÛ
        pop     ix              ; ix->sprite
        ld      d,a             ; d=how many bits to shift each line
        ld      e,8             ; Line loop
LILOP2: ld      b,(ix+0)        ; Get sprite data
        ld      c,0             ; Shift loop
        push    de
SHLOP2: srl     b
        rr      c
        dec     d
        jp      nz,SHLOP2
        pop     de
        ld      a,b             ; Write line to graphbuf
        cpl
        and     (hl)
        ld      (hl),a
        inc     hl
        ld      a,c
        cpl
        and     (hl)
        ld      (hl),a
        ld      bc,11           ; Calculate next line address
        add     hl,bc
        inc     ix              ; Inc spritepointer
        dec     e
        jp      nz,LILOP2       ; Next line
        jp      DONE5
;ÛÛÛÛ   Aligned sprite erase starts here   ÛÛÛÛ
ALIGN2:                         ; Erase an aligned sprite in graphbuf
        pop     de              ; de->sprite
        ld      b,8
ALOP2:  ld      a,(de)
        cpl
        and     (hl)
        ld      (hl),a
        inc     de
        push    bc
        ld      bc,12
        add     hl,bc
        pop     bc
        djnz    ALOP2
DONE5:
        ret
;ÜÛÛÛÛÛÛÛÛÛÛÛÛÜ CLRSPR ÜÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
;ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄ¿
;³ÛÛÛÛÛ Z80 ÛÛÛÛÛÛ³    Sprite83    ³ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ³ movax ³ÛÛÛÛÛÛÛÛÛÛÛÛ³
;ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÙ
Sprite_Data:
	.db 11111111%                                   ; Solid
	.db 11111111%
	.db 11111111%
	.db 11111111%
	.db 11111111%
	.db 11111111%
	.db 11111111%
	.db 11111111%
	.db 11111111%                                   ; Horzontal Lines
	.db 00000000%
	.db 11111111%
	.db 00000000%
	.db 11111111%
	.db 00000000%
	.db 11111111%
	.db 00000000%
	.db 10101010%                                   ; Virticle Lines
	.db 10101010%
	.db 10101010%
	.db 10101010%
	.db 10101010%
	.db 10101010%
	.db 10101010%
	.db 10101010%
	.db 01111110%                                   ; Computer
	.db 01000010%
	.db 01000010%
	.db 01000010%
	.db 01000010%
	.db 11111111%
	.db 10000001%
	.db 11111111%
	.db 00111100%                                   ; Smily
	.db 01000010%
	.db 10100101%
	.db 10000001%
	.db 10100101%
	.db 10011001%
	.db 01000010%
	.db 00111100%
.end
end
Follow-Ups: