|
Post by TheMVRules on Mar 27, 2010 12:20:44 GMT -5
You don't have to copy the whole thing! You can alter it to stop walking when collide with a table. But you're right at the end, even though this whole thread is full with that comment.
|
|
|
Post by theelf on Apr 11, 2010 17:49:22 GMT -5
Hi, a question to all people here, how i can read the collission VDP registry (genvdp.txt say "d5 - Sprite collision") and save in a variable? Something like this: collission_var=collission_asm
Declare Asm Function collission_asm() ?¿?¿ end sub
If two sprites are in collission, collission_var is 1, if not, is 0 If someone can explain how to do, save my day THANXS!!
|
|
|
Post by TheMVRules on Apr 13, 2010 3:33:59 GMT -5
Try this:
move.w (C00004),d0 btst #5,d0 Most likely it won't work, since I'm not home and thus code not tested. EDIT: it does not work But it's something like that... read C00004 (the control port), then test bit 5 of it You know you could use PEEK(int) and argunerics for that in basic
|
|
|
Post by theelf on Apr 13, 2010 6:27:05 GMT -5
Yes, dont work, but i understand what do you try to do, but i dont have idea how to fix
here is the compilation error out
The problem i think is in " (#C00004) " ?¿, because if i change the value, compile ok (but dont work)
No i really dont know the peek command. I read the help, and now understand how works, but i cannot make a collision routine with peek
colicion=PEEK(#C00004) dont work
|
|
|
Post by TheMVRules on Apr 14, 2010 13:07:55 GMT -5
Oh, that was what I understanded from that document
colicion=PEEKINT($C00004) colicion=colicion.5' Extract bit 5
|
|
|
Post by theelf on Apr 14, 2010 14:21:23 GMT -5
Thanxs, but bad luck not work. Tonight i try more combinations.. ;D
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Apr 14, 2010 15:21:31 GMT -5
In BEX, to represent hexadecimal numbers, you use the &h sign. Yea, it's all because of the crummy expression parser (which will confuse $ with a string)
if peekint(&hC00004).5 then print "2 sprites collided!"
|
|
|
Post by theelf on Apr 14, 2010 15:39:00 GMT -5
Hi, thanxs, but today is not my lucky day, because dont work. I use you example of collision and change with peek command, not work too. What im doing wrong? a=addsprite(1,1) b=addsprite(1,1) propsprite a,1,1 propsprite b,2,2 movesprite a,256,256 c=263 while 1 movesprite b,256,c ' sleep 1 c=c-1 d=peekint(&hC00004).5 locate 0,0 print d wend Thanxs for the help!!!
|
|
|
Post by theelf on Apr 14, 2010 18:29:34 GMT -5
OK, i reply myself.. this is weird
Devster your code is right, works!! thanxs Mairtrus sendme a ASM code that works too...
now the weird thing... this codes, work in gens+, but in Fusion NOT... ?¿?¿
In gens+ i detect collision, in Fusion no...
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Apr 14, 2010 21:38:53 GMT -5
OK, i reply myself.. this is weird Devster your code is right, works!! thanxs Mairtrus sendme a ASM code that works too... now the weird thing... this codes, work in gens+, but in Fusion NOT... ?¿?¿ In gens+ i detect collision, in Fusion no... Different emulators may do different things. Because we're dealing directly with the hardware instead of BEX, it is good to refer to a hardware manual . So according to the great Charles MacDonald: You're probably trying to read Bit 5 at the end of the frame, or at the beginning of the display (line 0). Try to change your sleep 1 to sleep 1, TVBLANK, and it may work. Adding TVBLANK to the end of sleep makes sure that the program returns back when we are in vertical blank
|
|
|
Post by theelf on Jul 13, 2010 9:24:39 GMT -5
Hi! long time.. im still don´t find a solution to read the collision hardware flag
Two codes to make the same:
Both works ok in some emulators, but NOT in real hardware.
I know is difficult to test in real hardware, but in KEGA Fusion not work too, in fact, is the only emulator where the code not work...
Someone can have a idea, why this happen?
|
|
|
Post by theelf on Aug 8, 2010 4:50:44 GMT -5
Hi, i post this problem in spritesmind forum, and a user called Eke give me this answer...
But i don´t have any idea of asm..
But if someone understand, and read that this is the solution to the problem, and have time, please translate to basic... ;D jaja
Thanks
|
|
|
Post by TheMVRules on Aug 8, 2010 5:51:34 GMT -5
Read the god-damned documentation!
HBLANK 0 on hblank gosub blah enable interrupt hblank
blah: etc.
This will slow down your code, so don't use it always. If you're making an RPG, only use it on the map, not during battle.
|
|
|
Post by theelf on Aug 8, 2010 6:33:29 GMT -5
I do not understand all the documentation even if i read it a thousand times. You don´t know how much hours i spend reading the help (or making test), before ask in the forum I do not think it was rude to you, then do not be rude to me
Thanks for this, i test this code and..
a=addsprite(1,1) b=addsprite(1,1) propsprite a,1,1 propsprite b,2,2 movesprite a,256,256 c=300 while 1 movesprite b,256,c c=c-4 HBLANK 0 on hblank gosub colision enable interrupt hblank waitraster 224 locate 0,0 print d wend
colision: d=peekint(&hC00004).5 return
Not work the collision, and hangs in Gens.
If i change a line to this
HBLANK 224 on hblank gosub colision enable interrupt hblank
Now works and check collision in Gens, but not in fusion
I try to change waitraster to sleep 1, sleep 1,TVblank.. etc no luck
I keep trying this days...
|
|
|
Post by Tom Maneiro on Aug 8, 2010 13:09:43 GMT -5
BEX documentation is not MSDN, yo Seriously, BEX needs a goddamned wiki NOW!
|
|