[A83] Re: 83 help


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

[A83] Re: 83 help




ok thanks dan, i will try it that way. Anyways, i was doing it by 8 wide
(11111111) and 16 long then making another set of for the other half of the
sprite. Also, i tried using ion calls to move my 8x8 sprite of a little man
i made. But i try to move it an dit says ram or rom (i got both) failed then
mem cleared!! Let m eknow what i did wrong...the code is below.

I set PLAYER_X and PLAYER_Y = to TEXT_MEM2 + 8 / +9
and i also included my sprite

I had it simple, but then it wouldnt work so i got it complicated....it
should move the guy +1 on the X axis everytime a button is pressed
but it shows the guy at first. I press a button and it makes a
8x(screen_height) rectangle and then displays a 0 (zero) in the middle of
the screen
then it says rom failed and mem cleared.

Game:
 ld b,8
 ld a,(PLAYER_Y)
 ld l,a
 ld a,(PLAYER_X)

loop:
 ld ix,SPRITE_MAN
 call ionPutSprite
 bcall(_grbufcpy)

 bcall(_getkey)

 ld c,1
 ld a,(PLAYER_X)
 add a,c
 ld (PLAYER_X),a

 ld a,(PLAYER_Y)
 add a,c
 ld (PLAYER_Y),a

 ld a,(PLAYER_Y)
 ld l,a
 ld a,(PLAYER_X)


 cp 20
 jp nz,loop

 ret

SPRITE_MAN:
 .db %00011000
 .db %01111110
 .db %11111111
 .db %10011001
 .db %00011000
 .db %00111100
 .db %01000010
 .db %11000011


Dustin Davis
Lead Software Developer
Vision Works Studios




References: