A86: 2 More Questions


[Prev][Next][Index][Thread]

A86: 2 More Questions




Question 1) Say I use this equate:  Xcoord    =  _textshadow
                  How would I load data into or use data from Xcoord ?
Question 2) Thanks to David Phillips, I updated my code for my program which
moves two sprites, but it will not work correctly.  It doesn't crash, but it
won't run correctly.  If someone could just tell me what I'm doing wrong, I am
trying to do 4 things:
1. If the left key has been pressed, move the triangle-looking sprite to the
left one pixel.
2. If the right key has been pressed, move the triangle-looking sprite to the
right one pixel.
3. If the 2nd key has been pressed, begin the rectangular-looking sprite at
four pixels above the base of the triangle-looking sprite and have the
rectangle continue going up (as if fired from the triangle) until it is about
8 pixels from the top of the screen.
4. If the exit key has been pressed, end the program.

Here's the code:
____
#include "ti86asm.inc"
#include "asm86.h"

.org _asm_exec_ram

MainLoop45: 
 call _clrLCD
 call BUSY_OFF
 ld ix,NewSprite
 ld bc,$4028
 call PutSprite
ASK_FOR_KEY: 
 call _getky
 cp K_LEFT
 jr z,LEFT
 cp K_RIGHT
 jr z,RIGHT
 cp K_SECOND
 jr z,SECOND
 cp K_EXIT
 jr z,EXIT
 jr ASK_FOR_KEY
LEFT:
 ld a,16
 cp b
 jr z,ASK_FOR_KEY
 dec b
 ld ix,NewSprite
 call PutSprite
 jr ASK_FOR_KEY
RIGHT:
 ld a,112
 cp b
 jr z,ASK_FOR_KEY
 inc b
 ld ix,NewSprite
 call PutSprite
 jr ASK_FOR_KEY
SECOND:  
 dec c
 dec c
 dec c
Loop:
 dec c
 ld ix,NewSprite2
 call PutSprite
 ld a,8
 cp c
 jr z,ABOUT_TO_ASK_FOR_KEY
 jr Loop
EXIT:
 call _clrLCD
 ret

ABOUT_TO_ASK_FOR_KEY:
 ld c,$28
 jr ASK_FOR_KEY

[PutSprite Routine]

NewSprite:
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00000000
     .db %00011000
     .db %00111100
     .db %01111110
     .db %11111111

NewSprite2:
	.db %00000000
	.db %00000000
	.db %00000000
	.db %00000000
	.db %00011000
	.db %00011000
	.db %00011000
	.db %00011000

.end

Thanx for any help.