When I try to compile this code:
Code:
(sorry it's so long)
I get 877 errors. The majority of which are one of:
* can't find label FFH (or similar)
* can't find label jp (or similar)
* label not found: ADD
Please help! It's been a while since I've compiled on a computer, so I'm probably missing some obvious things (thinks about not knowing to change the file name when submitting to archives )
Also, I started adding comments to the code, but obviously enough I have not finished.
BTW, optimizations are welcomed
Code:
.nolist
#include "ti83plus.inc"
.list
.org $9D93
.db t2ByteTok, tAsmCmp
DI
b_call (_RUNINDICOFF)
RES 5,(IY)
b_call (_CLRSCRNFULL)
;kill the run indicator and done message
LD HL,0202H
LD (CURROW),HL
LD HL,STXT3
b_call (_PUTS)
;display the Penguin Studios logo
LD D,FFH
LD E,80H
LD B,D
CALL PLAYNOTE
LD B,FFH
CALL PLAYNOTE
CALL QQQ
LD B,90H
CALL PLAYNOTE
CALL QQQ
LD B,90H
CALL PLAYNOTE
CALL QQQ
LD B,90H
CALL PLAYNOTE
LD E,30H
LD B,FFH
CALL PLAYNOTE
CALL QQQ
LD E,A0H
LD B,FFH
CALL PLAYNOTE
LD E,80H
LD B,FFH
CALL PLAYNOTE
LD B,FFH
CALL PLAYNOTE
;play the opening music
JP MENU
QQQ:
LD BC,500
QQQ2:
DEC BC
JR NZ,QQQ2
RET
;delaying between notes
MENU:
b_call (_CLRSCRNFULL)
b_CALL (_HOMEUP)
LD HL,STXT
SET 3,(IY+5) ;set text inverse
B_CALL (_PUTS)
LD HL,STXT2
RES 3,(IY+5) ;reset text inverse
BCALL PUTS
;displays the menu
MENUL:
LD D,$FF
LD E,$90
LD B,$20
CALL PLAYNOTE ;first note to play
LD E,$B0
LD B,$10
CALL PLAYNOTE ;2nd note to play
LD A,$BF
OUT (1),A ;send the key group to check for 2nd/mode
IN A,(1) ;read the key port
BIT 6,A ;check for mode
JP Z,END2
BIT 5,A ;check for 2nd
JP NZ,MENUL
LD HL,0
LD (SCORE),HL ;reset the score
LD A,48
LD (XPOS),A
LD A,32
LD (YPOS),A ;load the starting position
LD A,0
LD (EATEN),A ;reset the amount of dots eaten
LD A,255
LD (EATEN+1),A ;reset the current level
;play some notes while waiting for either 2nd or MODE to be pressed
NEWLEV:
LD A,0
LD (EATEN),A
LD A,(EATEN+1)
INC A
LD (EATEN+1),A ;add one to the level
LD HL,PLOTSSCREEN
LD DE,PLOTSSCREEN+1
LD BC,02FFH
LD (HL),0 ;clear the plot screen
LDIR
LD HL,CLN
LD DE,PLOTSSCREEN
LD BC,12
LDIR ;draw the top line
LD HL,CLN
LD DE,PLOTSSCREEN+756
LD BC,12
LDIR ;draw the bottom line
LD D,0
LD L,1
LD E,63
CALL DRAWVERT ;draw the left line
LD D,95
LD L,1
LD E,63
CALL DRAWVERT ;draw the right line
LD A,(EATEN+1)
OR A
JR Z,DONESDRAW ;done drawing if on level 1
LD D,32
LD L,10
LD E,53
CALL DRAWVERT ;add a verticle line
LD D,64
LD L,10
LD E,53
CALL DRAWVERT ;add another verticle line
LD A,(EATEN+1)
CP 1
JR Z,DONESDRAW ;done drawing if on level 2
LD DE,PLOTSSCREEN+384
LD BC,12
LD HL,CLN2
LDIR
;draw another horizontal line
DONESDRAW:
CALL SAFECOPY
NEWRAND:
LD HL,(WINY)
CALL GETPIX
XOR (HL)
LD (HL),A
BADRAND:
LD HL,(RANDREF)
LD A,(HL)
RES 7,A
RES 6,A
LD (WINY+1),A
INC HL
LD A,(HL)
RES 7,A
RES 6,A
RES 5,A
LD B,A
ADD A,B
ADD A,B
LD (WINY),A
INC HL
LD (RANDREF),HL
LD HL,(WINY)
CALL GETPIX
OR (HL)
CP (HL)
JP Z,BADRAND
LD (HL),A
CALL SAFECOPY
MOVE:
LD HL,NOTES
LD A,(NREF)
CP 32
CALL Z,RESNREF
LD D,0
LD E,A
ADD HL,DE
INC A
LD (NREF),A
LD E,(HL)
LD D,FFH
LD B,15H
CALL PLAYNOTE
LD HL,(SCORE)
INC HL
LD (SCORE),HL
LD A,(DIR)
OR A
JP Z,MDOWN
DEC A
JP Z,MLEFT
DEC A
JP Z,MUP
LD HL,XPOS
INC (HL)
JP DRAW
MUP:
LD HL,YPOS
DEC (HL)
JP DRAW
MLEFT:
LD HL,XPOS
DEC (HL)
JP DRAW
MDOWN:
LD HL,YPOS
INC (HL)
DRAW:
LD A,(YPOS)
LD B,A
LD A,(WINY)
CP B
JP Z,CHECKX
NOWIN:
LD HL,(YPOS)
CALL GETPIX
OR (HL)
CP (HL)
JP Z,END
LD (HL),A
CALL SAFECOPY
KEY:
LD A,FFH
OUT (1),A
DEC A
OUT (1),A
IN A,(1)
LD HL,MOVE
PUSH HL
LD HL,DIR
RRA
JR NC,UP
RRA
JR NC,LEFT
RRA
JR NC,RIGHT
RRA
JR NC,DOWN
RET
DOWN:
LD (HL),2
RET
LEFT:
LD (HL),1
RET
RIGHT:
LD (HL),3
RET
UP:
LD (HL),0
RET
CHECKX:
LD A,(XPOS)
LD B,A
LD A,(WINY+1)
CP B
JP NZ,NOWIN
LD C,100
LD B,0
LD HL,(SCORE)
ADD HL,BC
LD (SCORE),HL
LD A,(EATEN)
INC A
LD (EATEN),A
CP 3
JP Z,NEWLEV
LD D,FFH
LD E,2AH
LD B,90H
CALL PLAYNOTE
JP NEWRAND
END:
B_CALL (_CLRSCRNFULL)
B_CALL (_HOMEUP)
LD HL,TXT
B_CALL (_PUTS)
LD HL,(SCORE)
B_CALL (_DISPHL)
LD D,FFH
LD E,0
LR:
INC E
LD B,04H
CALL PLAYNOTE
LD A,FDH
OUT (1),A
IN A,(1)
RRA
JP NC,MENU
DJNZ LR
DEC B
LD E,B0H
CALL PLAYNOTE
LD B,C0H
LD E,80H
CALL PLAYNOTE
LD B,FFH
LD E,B0H
CALL PLAYNOTE
JP END
END2:
EI
B_CALL (_CLRSCRNFULL)
B_CALL (_HOMEUP)
RET
PLAYNOTE:
LD C,B
PLAYN:
LD B,D
PLAY2:
LD A,D1H
OUT (0),A
DJNZ PLAY2
LD B,E
PLAY3:
LD A,D0H
OUT (0),A
DJNZ PLAY3
DEC C
JR NZ,PLAYN
RET
DRAWVERT:
LD A,E
SUB L
RET Z
PUSH AF
LD H,D
CALL GETPIX
POP BC
LD DE,12
LD C,A
PLOTLOOP:
LD A,C
OR (HL)
LD (HL),A
ADD HL,DE
DJNZ PLOTLOOP
RET
GETPIX:
LD A,H
LD H,0
LD E,L
LD D,H
ADD HL,DE
ADD HL,DE
ADD HL,HL
ADD HL,HL
LD E,A
SRL E
SRL E
SRL E
ADD HL,DE
LD DE,PLOTSSCREEN
ADD HL,DE
AND 7
INC A
LD B,A
LD A,1
GETPIXLOOP:
RRCA
DJNZ GETPIXLOOP
RET
RESNREF:
LD A,0
LD (NREF),A
RET
SAFECOPY:
LD C,10H
LD A,80H
CALL LCDDELAY
OUT (10H),A
LD A,20H
CALL LCDDELAY
OUT (10H),A
LD HL,9334H
LD DE,12
SAFECPY1:
LD B,64
EX AF,AF'
SAFECPY2:
ADD HL,DE
LD A,(HL)
CALL LCDDELAY
OUT (11H),A
DJNZ SAFECPY2
EX AF,AF'
LD H,93H
INC L
INC A
CALL LCDDELAY
OUT (10H),A
CP 2CH
JR NZ,SAFECPY1
RET
LCDDELAY:
IN (C)
RET P
JP LCDDELAY
EATEN:
.DB 0,255
RANDREF:
.DW 1000H
WINY:
.DB 0,0
NREF:
.DB 0
NOTES:
.DB 90H,90H,90H,B8H,B8H,B8H,B8H,A0H,A0H,A0H,A0H,A0H,56H,56H,56H,A0H,58H,63H,FFH,23H,23H,23H,64H,64H,64H,64H,64H,64H,64H,64H,64H,64H
STXT2:
.DB "[2ND]-Play [MODE]-Quit",0
STXT3:
.DB "(C) 5-2-2007 A Penguin Studios Production",0
SCORE:
.DW 0
MUS:
.DW 0
DIR:
.DB 0
YPOS:
.DB 32
XPOS:
.DB 48
TXT:
.DB "Your Score: ",0
CL:
.DB 0,0,0,0,0,0,0,0,0,0,0,0
CLN2:
.DB 80,0,0,0,FFH,FFH,FFH,FFH,0,0,0,1
CLN:
.DB FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH,FFH
STXT:
.DB "Nibls With Music",0
.end
.end
(sorry it's so long)
I get 877 errors. The majority of which are one of:
* can't find label FFH (or similar)
* can't find label jp (or similar)
* label not found: ADD
Please help! It's been a while since I've compiled on a computer, so I'm probably missing some obvious things (thinks about not knowing to change the file name when submitting to archives )
Also, I started adding comments to the code, but obviously enough I have not finished.
BTW, optimizations are welcomed