Subject: Re: [stella] Variable cycle delays From: Erik Mooney <emooney@xxxxxxxxxxxxxxxx> Date: Wed, 18 Mar 1998 16:31:32 -0500 (EST) |
> Here's a way to implement single cycle resolution without the use of the > carry flag (which adds overhead in the setup and at the end): > > ; A is assumed to hold the delay value plus the offset address of JumpTable. > ; Or, you can align JumpTable to a page boundary. > > sta indjmp > jmp (indjmp) ; point indjmp+1 to JumpTable somewhere in your init code > > JumpTable: > dc.b $C9 > dc.b $C9 > ; repeat as many $C9's as you need for the maximum number of cycles you > ; you need to delay by. > dc.b $C9 ; opcode: CMP immediate (4 cycles: uses the $C5, executes > ; the NOP below.) > dc.b $C5 ; opcode: CMP zero page (3 cycles, uses up the NOP as a > ; destination address of $EA) > nop ; opcode: NOP (2 cycles by itself) That's... incredibly wizardly. But isn't something backwards? The way I see it, won't a larger value in the accumulator cause it to jump farther into the table, skipping more instuctions and delaying fewer cycles? -- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/stella.html Don't post pirate BINs to Stellalist. Be a programmer, not a pirate. Write the best game, win framed autographs of famous Atari alumni!!
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[stella] Variable cycle delays, Jim Nitchals | Thread | Re: [stella] Variable cycle delays, Chris Wilkson |
[stella] Variable cycle delays, Jim Nitchals | Date | Re: [stella] Variable cycle delays, Chris Wilkson |
Month |