I don't know Z80 ASM, but I can point you in the right direction in terms of outlining what you have to do. It goes something like this:

XOR draw sprite
If keypress = Up
-XOR draw sprite
-X = X + 1
-XOR draw sprite
(repeat for other keys)
There's another topic about exactly this in this subforum. See if you can find it.
I think the code I posted is simple enough. See what code is used to move the sprites. I think you know sufficient ASM now that you can make your own movement routine using getkey from seeing other's code.
ion routines use bcall????

shouldn't it be


Code:
call ionputsprite
call ionfastcopy


??

For sake of ease, you might want to make variables for the x and y coordinate of the sprite, because iirc, those ion routines will destroy the old ones held by those registers.
if you program in ion you have to use bcall for everything because it is compatible with ti-83 and ti-83+
Laughing No you don't. You use call to use the ion libs. Also, if you're going to program for ion, you might as well just program for Mirage as well. Mirage has the ion libs as well as its own libs.
If you were to try to bcall an ion lib, here's what would happen:
1: OS swaps port 6 to ROM page 1, seeing that you're bcalling somewhere between 4000h and 8000h
2: It jumps to where you wanted it to, probably doing something horrible.
You definitely don't want to be blindly jumping into system routines like that.
Lafferjm: you always bcall() to system routines, and call... to RAM routines. Basically only bcall to things starting in an underscore.
KermMartian wrote:
Lafferjm: you always bcall() to system routines, and call... to RAM routines. Basically only bcall to things starting in an underscore.


bcall for ROM pages (Kerm'll explain this when you decide to make APPs)

call for RAM pages (is there really only one RAM page? I get this mixed up because 86 has so many)
something1990 wrote:
0x5 No you don't. You use call to use the ion libs. Also, if you're going to program for ion, you might as well just program for Mirage as well. Mirage has the ion libs as well as its own libs.


i would program for mirage but i can not use it on my calc so there is really no point.
Besides, ION's graphics routines, random routine, and iondetect (still haven't gone back to see what this does XD ) are more than enough.
Liazon wrote:
Besides, ION's graphics routines, random routine, and iondetect (still haven't gone back to see what this does XD ) are more than enough.
Laughing IonDetect is actually quite the useful routine: it will search through the VAT for programs starting with a specified series of bytes.
i know i have asked how to move sprites before but i still have a problem. can some one tell me what is wrong with the code.


Code:

.nolist
#include "ion.inc"
.list
#ifdef ti83p
 .org progstart-2
 .db $BB,6D
#else
 .org progstart
#endif
 ret
 jr nc,begin
 .db "Ion Sprite Move",0
begin:
 bcall(_clrlcdfull)
 bcall(_indicatoroff)
 ld hl,5
 push hl
 ld a,5
 ld l,a
 ld b,8
 ld ix,sprite
 call ionputsprite
 call ionfastcopy
 bcall(_getkey)
 cp kDown
 jr z,down

down:
 call ionputsprite
 pop hl
 ld a,l
 add a,5
 ld l,a
 ld h,0
 push hl
 ld a,l
 ld l,a
 pop hl
 ld b,8
 ld ix,sprite
 call ionputsprite
 call ionfastcopy
 bcall(_getkey)
 ret

sprite:
 .db %00011100
 .db %00011100
 .db %00101010
 .db %00011100
 .db %00001000
 .db %00001000
 .db %00010100
 .db %00100010
.end
END


when i try to compile it it wont compile for some reason. it cant find the kdown in ion.inc. and i do not know any other alternative except to use


Code:

bcall(_getk)
bcall(_op2toop1)
bcall(_convop1)
You never included ti83plus.inc from what I can see Smile

BTW. I believe it's bcall(_runindicoff) not bcall(_indicatoroff).

Plus, even if you somehow want to avoid using ti83plus.inc (why you would want to is beyond me), you could just add the equate in ion that it requests. Simply add
Code:
kdown EQU $04
in ion it is bcall(_indicatoroff) i know this because i usually forget and than run into problems when i compile
Ok...well, did either of my other suggestions work?
Ok, add this at the top of your program:
Code:
#define _getk _getcsc
That should resolve one of the problems. And as Chip said, just get the other defines from ti83asm.inc and ti83plus.inc, respectively.
If you plan on using _getcsc or _getk whatever you're going to call it, remember that it does not wait for a key to be pressed. So you will have to rework your code a bit.
i think i will just rework my code to make it do a key press loop.
lafferjm wrote:
i think i will just rework my code to make it do a key press loop.
The call that you're looking for, I believe, is _getkey.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, 4, 5, 6  Next
» View previous topic :: View next topic  
Page 4 of 6
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement