Re: SLEEP macro (was: [stella] 6502 Less Than / Greater Than Help!)

Subject: Re: SLEEP macro (was: [stella] 6502 Less Than / Greater Than Help!)
From: Jeff Johnston <jeffryj@xxxxxxxxxxxxx>
Date: Sat, 6 Jul 2002 08:43:50 -0700 (MST)
I didn't actually use NOP, but I think the idea was similar:

	LDX	ROUGHP0 	;  number of times to loop
POSP0	DEX			;\ loop to waste time
	BPL	POSP0		;/
	STA	RESP0		;\ set player position
	STA	HBLANK		;/

Each X value put the sprite a little further over on the screen (about 14
pixels).  Then, I used HM to place it exactly.

Now I need to see if I can understand that polar -> rect conversion code,
because that would be very useful in my game over what I was planning on
doing.

calamari



On Sat, 6 Jul 2002, Thomas Jentzsch wrote:

> Kirk wrote:
> > And glad to hear the NOP/ trick works well...I'll
> > probably be using the same technique a few iterations
> > from now.
>
> I have a macro that makes using NOP much easier:
>
>   MAC SLEEP
>     IF {1} = 1
>       ECHO "ERROR: SLEEP 1 not allowed!"
>       ERR
>     ENDIF
>     IF {1} & 1
>       nop $00
>       REPEAT ({1}-3)/2
>         nop
>       REPEND
>     ELSE
>       REPEAT ({1})/2
>         nop
>       REPEND
>     ENDIF
>   ENDM
>
> For using nop $00, your DASM version must be compiled for accepting
> illegal opcodes. Else you could use bit $00 (changes some flags) or
> write .byte $04, $00 ($04 = opcode for nop zp) instead.
>
> Just include it in your code and call e.g. SLEEP 5
>
> Have fun!
> Thomas
> _______________________________________________________
> Thomas Jentzsch         | *** Every bit is sacred ! ***
> tjentzsch at web dot de |
>
> ----------------------------------------------------------------------------------------------
> Archives (includes files) at http://www.biglist.com/lists/stella/archives/
> Unsub & more at http://www.biglist.com/lists/stella/
>

----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread