| |
lft
Registered: Jul 2007 Posts: 369 |
Improved clock-slide
If you use timer-based jitter correction, or just VSP, here's a way to shave off one cycle:
http://codebase64.org/doku.php?id=base:improved_clockslide |
|
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
There is a special satisfaction for when one makes a thorn into a rose... the French probably have a word for it... but that is what I felt when I read that. |
| |
Trash
Registered: Jan 2002 Posts: 122 |
Not only a cycle, a byte also... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
that optimization is so obvious... i feel silly now :( |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Now put that bpl at $00ff to shave off another byte and cycle and do the jitter-compensation and IRQ-handling on $01xx. |
| |
lft
Registered: Jul 2007 Posts: 369 |
I'm afraid that would leave the page-boundary in the wrong place. |
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
Nicely done. Bravo. |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: I'm afraid that would leave the page-boundary in the wrong place.
True. at $00fx then. But this of course applies to the standard method aswell. |
| |
Copyfault
Registered: Dec 2001 Posts: 478 |
So simple, so beautiful ;)
Now that I come to think of this, it should be possible to shave off another byte by utilising that other additional branch cycle (in case of a taken branch).
Assuming that the accu holds the no. of bytes to skip (which is common for this approach) we could do the following:
;-----------------------------
;A=0..n-1=no.of bytes to skip
;must have been calculated
;directly before to ensure
;correct setting of the z-flag
;-----------------------------
sta bra+1
bra bne *
nop ;2 cycles
lda #$a9 ;2
lda #$a9 ;2
lda #$a9 ;2
lda $ea ;3
;-----------------------------
;page break here
;-----------------------------
code ...
If A=0, the branch is not taken; thus the total sum of cycles will be 11. In case of a non-vanishing A, the NOP-instruction is skipped (-2 cycles) but the additional "branch taken"-cycle comes in. Mind that if you want to slide down to 2 cycle-delay the page break is mandatory! A one-cycle delay is not possible but this is the same with the "BPL"-instruction which always comes with that additional cycle. |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
I think the best part is that LFT wrote a Codebase article about it *before* I had to ask him about it. |
| |
lft
Registered: Jul 2007 Posts: 369 |
Copyfault, that is an excellent improvement! |
... 16 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 - Next |