Re: A83: why doesn't this code work?


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

Re: A83: why doesn't this code work?




You reversed up and down, you SUB when going up and ADD when going down.

BTW, You can use sub 8 or add 8, you don't need to put 8 into b.

I suggest you clear the screen between draws, so you don't get an inverting 
etch-a-sketch.


also, change  ".db $BB,6D" to ".db $BB,$6D"  Mirageos won't detect your 
program unless you do that, all the old documentation for ION was way off.


>From: Jeff Ruud <pyroboy_04@yahoo.com>
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: A83: why doesn't this code work?
>Date: Mon, 19 Feb 2001 18:55:39 -0800 (PST)
>
>
>Can someone please tell me why this code doesn't work?  BTW, it's for 83+ 
>ION
>
>.nolist
>         #include "ion.inc"
>         #include "extra.inc"
>.list
>
>#ifdef TI83P
>         .org    progstart-2
>         .db     $BB,6D
>#else
>         .org    progstart
>#endif
>         xor a
>         jr      nc,Start
>         .db     "Game Name",0
>y = SAFERAM1
>x = SAFERAM1+1
>Start:
>  bcall(_indicatorOff)
>  xor a
>  ld (x),a
>  ld (y),a
>GetAKey:
>  bcall(_getcsc)
>  cp GDown
>  jp z,DownK
>  cp GLeft
>  jp z,LeftK
>  cp GRight
>  jp z,Rightk
>  cp GUp
>  jp z,UpK
>  cp GClear
>  ret z
>  jp GetAKey
>DownK:
>  ld a,(y)
>  cp 48
>  jp z,GetAKey
>  ld b,8
>  sub b
>  ld (y),a
>  jp DrawCursor
>LeftK:
>  ld a,(x)
>  cp 0
>  jp z,GetAKey
>  ld b,8
>  sub b
>  ld (x),a
>  jp DrawCursor
>RightK:
>  ld a,(x)
>  cp 48
>  jp z,GetAKey
>  add a,8
>  ld (x),a
>  jp DrawCursor
>UpK:
>  ld a,(y)
>  cp 0
>  jp z,GetAKey
>  add a,8
>  ld (y),a
>  jp DrawCursor
>DrawCursor:
>  ld b,8
>  ld a,(y)
>  ld l,a
>  ld a,(x)
>  ld ix,Cursor
>  call ionPutSprite
>  call ionFastCopy
>  jp GetAKey
>
>  ret
>Cursor:
>  .db %11111111
>  .db %11111111
>  .db %11111111
>  .db %11111111
>  .db %11111111
>  .db %11111111
>  .db %11111111
>  .db %11111111
>.end
>End
>
>
>
>---------------------------------
>Do You Yahoo!?
>- Get personalized email addresses from Yahoo! Mail Personal Address  - 
>only $35 a year!

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com