[A83] Re: GeoMaster


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

[A83] Re: GeoMaster




Hi. I am new to ASM and I am writing a small demo "game". It consists of 
ship that can move around the screen and a "enemy" that moves on the top of 
the screen. However, I am having trouble with 2 things:

1. When exiting my program... my calculator does very wierd stuff... 
distorts the screen. And sometimes it asks if I want to install new TI-OS 
(However... i am using safe ram... so I am confused... i dont think i am 
accessing memory that I shouldnt be)
2. Here is the real big problem I am having. I want the enemy ship to move 
without stopping... however... the current way I have my code structured 
the enemy ship stops moving while the "player_ship" is moving.

If someone could shed some light on these two areas, and any other 
tips/hints/suggestions/etc it would be much appricated.

.nolist
#include "ion.inc"
KDown .equ 254
KLeft .equ 253
KRight .equ 251
KUp .equ 247
KClear .equ 191
Xpos = saferam2
Ypos = saferam2 + 1
EXpos = saferam2 + 2
Temp = saferam2 + 3
Temp2 = saferam2 + 4
.list
#ifdef TI83P
.org progstart-2
.db $BB,$6D
#else
.org progstart
#endif
ret
jr nc,begin
.db "Space Invaders",0
begin:
res statsvalid,(iy+statflags)
bcall(_clrLCDFull)
ld b,8
ld a,40
ld l,50
ld (Xpos),a
ld a,l
ld (Ypos),a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
ld b,8
ld a,0
ld l,0
ld (EXpos),a
ld ix,enemy_ship
call ionPutSprite
call ionFastCopy
ld a,0
ld (Temp),a
ld (Temp2),a
Main_Loop:
call enemy_move
jp GetKey
GetKey:
ld a,0ffh
out (1),a
ld a,0feh
out (1),a
in a,(1)
cp kLeft
jp z,Left
cp kRight
jp z,Right
cp kLeft
jp z,Left
cp kRight
jp z,Right
cp kDown
jp z,Down
cp kUp
jp z,Up
ld a,0ffh
out (1),a
ld a,0fdh
out (1),a
in a,(1)
cp kClear
jp z,Quit
jp Main_Loop
Left:
ld b,8
ld a,(Ypos)
ld l,a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
ld b,8
ld a,(Ypos)
ld l,a
ld a,(Xpos)
dec a
ld (Xpos),a
ld ix,player_ship
call ionPutSprite
call ionFastCopy
jp Main_Loop
Right:
ld b,8
ld a,(Ypos)
ld l,a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
ld b,8
ld a,(Ypos)
ld l,a
ld a,(Xpos)
inc a
ld (Xpos),a
ld ix,player_ship
call ionPutSprite
call ionFastCopy
jp Main_Loop
Up:
ld b,8
ld a,(Ypos)
ld l,a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
ld b,8
ld a,(Ypos)
ld l,a
dec l
ld a,l
ld (Ypos),a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
jp Main_Loop
Down:
ld b,8
ld a,(Ypos)
ld l,a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
ld b,8
ld a,(Ypos)
ld l,a
inc l
ld a,l
ld (Ypos),a
ld a,(Xpos)
ld ix,player_ship
call ionPutSprite
call ionFastCopy
jp Main_Loop
enemy_move:
ld a,(Temp)
inc a
ld (Temp),a
cp 100
jp nz,Quit
ld a,0
ld (Temp),a
ld a,(Temp2)
inc a
ld (Temp2),a
cp 100
jp nz,Quit
ld l,0
ld a,(EXpos)
ld b,8
ld ix,enemy_ship
call ionPutSprite
call ionFastCopy
ld l,0
ld a,(EXpos)
ld b,8
inc a
ld (EXpos),a
ld b,8
ld ix,enemy_ship
call ionPutSprite
call ionFastCopy
ld a,0
ld (Temp),a
ld (Temp2),a
jp Quit
Quit:
ret
player_ship:
.db %0001000
.db %0011100
.db %1011101
.db %1011101
.db %1011101
.db %1011101
.db %1111111
.db %1111111
enemy_ship:
.db %01111110
.db %11000011
.db %10111101
.db %10111101
.db %01111110
.db %01011010
.db %00100100
.db %00011000
.end
END






Follow-Ups: References: