This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
MaxVT103


Member


Joined: 24 Aug 2003
Posts: 109

Posted: 24 Aug 2003 02:23:28 pm    Post subject:

I am having trouble getting my routine to work at all. I know theirs got to be some major mistakes in it somewhere but it would be a big help if someone could help me fix it so that I can finish writing my hockey game. Here's the code and the idea behind it. Hopefully someone can help me with my shear stupidity on this.

;the idea behind this routine is to input the 2 points to create a box and then check and see of a variable such as a cursor is in the area to be checked by
;increasing the b and c valuse then multiplying them together and taking the h and l valus and comparing bc to hl.
;the registers are b,c,d,e
;to input these into the program please make sure they are in this order for it to work.
; top left point (b,c)
; I I
; I I
; d = width of box
; e = height of box
;
;For the selected input of what is to e in this area use the variable h(xcor) and l(ycor) = hl
;Output: Register A will either be on with a value of 1 or off with a value of 0
#ifdef cselect
checkselect:
jp checkselect_2
checkselect_1:
ld a,b
cp d+1 ;compares B to the width of the area checked, if it is equal to width+1 it checks the next line.
jp z,checkselect_newline
inc a ;increases to the next xcor checked.
ld b,a ;
jp checkselect_2
checkselect_newline:
sub d,b ;subtracts d from b to restore b to its origional place. If this does not work, try pushing b in the begining and pop b later.
ld a,c
inc a
ld c,a
ld a,c ;compares where the current line being checked is and makes sure it is not one line further than e.
cp e+1
jp z,endselectoff
jr checkselect_1
checkselect_2:
ld a,bc ;compares register bc to register hl.
cp hl
jp z,endselecton
jr checkselect_1
endselecton:
ld a,1 ;this ends the subroutine with leaving a as on.
ret
endselectoff:
ld a,0 ;this ends the subroutine with leaving a as off.
ret
#endif

I know theirs lots of mistakes in it but I'm just not a good enough programmer Sad to figure them out yet.

Donald Wacko
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 25 Aug 2003 06:26:59 am    Post subject:

I recommend going to MaxCoderz, and getting the 'fastmap' package. However you will need to edit the keys for 4-way or 8-way scrolling because currently it is made for things like mario, sonic, and such
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 25 Aug 2003 05:39:40 pm    Post subject:

um, i dont think u understand what he wants...
lets see if im right...
ok, u want a program that checks if the cursor is in a hotspot (rectangle)? is that right? or is a scrolling thing what u really wanted?
Back to top
Tyler


Advanced Member


Joined: 29 May 2003
Posts: 352

Posted: 27 Aug 2003 07:20:28 am    Post subject:

Quote:
; d = width of box
; e = height of box


Ahh, yes, I need to read more carefully! I'm not too good with this stuff though. Sorry!
Back to top
MaxVT103


Member


Joined: 24 Aug 2003
Posts: 109

Posted: 29 Aug 2003 06:57:54 pm    Post subject:

yeah, I just want to see if it is in a box pretty much.
Back to top
MaxVT103


Member


Joined: 24 Aug 2003
Posts: 109

Posted: 01 Sep 2003 11:53:18 am    Post subject:

So, if anyone knows of a routine already written or can help me write one, please contact me.

Donald
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement