|
Post by roolandoo on Feb 1, 2021 11:05:44 GMT
Hello, let's see if any of the geniuses here can solve these little doubts in MPAGD
1) Is there a way to do something like WAITKEY without the action stopping? I need to read the press of all the keys but without the sprites stop moving (the player is not on the screen).
2) Is it possible to use the double colour palette (shiny and non-shiny) in sprites? I have tried different combinations of "spriteink" but only the basic palette (7 colours) appears.
3) Is it possible to make a beep sound when using DIG? But only when a block disappears (not always).
Thanks and regards.
|
|
|
Post by jltursan on Feb 5, 2021 14:44:27 GMT
1) I'm sure it can be done...; but not now with the actual engine. WAITKEY loops over the vsync routine that does several things (scroll, particles,etc.); but doesn't updates the event processing and sprite updates. Anyway, if it's one of the AGD controlled keys and you don't want to stop action maybe you can use KEY to read it? 2) This must be answered by the Speccy experts! 3) Same answer as 1), not now, the DIG routine simply erases the fodder block, you can't really know if something is erased or not.
|
|
|
Post by roolandoo on Feb 5, 2021 20:25:58 GMT
Many thanks @jtursan
"maybe you can use KEY to read it?" The problem is that with KEY it can only detect one key and I need it to detect any key.
|
|
|
Post by Jonathan Cauldwell on Feb 9, 2021 12:11:55 GMT
The first point requires a user routine. Just write something like this:
call 654 ld a,e ld (vark),a ret
then put the keyword USER in your code and the key status will be placed in the K variable, 255 if no key is pressed.
Your second point requires a very simple modification to EngineZX.asm. Right at the top of the code you'll see a line like this:
SIMASK equ 248
Change it to this:
SIMASK equ 184
Then you'll be able to set the BRIGHT bit with SPRITEINK.
Point three requires another modification to EngineZX.asm. Look for the routine fdchk in the engine. At the bottom of this routine you'll see the lines that remove the fodder block:
xor a ; block to write. call pattr ; write block. pop hl ; restore block pointer. ret
Just insert these two lines between call pattr and pop hl.
xor a ; block to write. call pattr ; write block. ld a,20 ; duration of beep. ld (sndtyp),a ; activate beep routine. pop hl ; restore block pointer. ret
Hope that helps!
|
|
|
Post by roolandoo on Feb 10, 2021 16:42:02 GMT
Perfect!!, Thank you very much Jonathan Cauldwell . I only have one question: Why is the second point not implemented by default? Does it suppose something negative? EDIT: I've tried it and it doesn't seem to work. For example: light red should be "Spriteink 66", right? Well it appears dark red (Spriteink 2)
|
|