Jump to content
Posted Wed Jun 27, 2018 4:30 AM
Posted Wed Jun 27, 2018 12:29 PM
Posted Thu Jun 28, 2018 8:11 AM
Ok, here is the fix:
In Paul Slocum's songplayer, right below bitMaskArray, I placed
PALSyncPattern byte #%00000000 byte #%00001001 byte #%00010101 byte #%00011011 byte #%00011111 byte #%00111111 byte #%10000001 byte #%10001001 byte #%10010101 byte #%10011011
These are patterns of 6 bits (bits 5..0) each and they correspond to the various TEMPODELAY options (1..10).
I need a single variable to keep track of the number of times tempoCount is reset (it resets every TEMPODELAY frames): PALSyncCounter
Slocum's tracker starts with (at the entry point):
inc tempoCount lda tempoCount eor TEMPODELAY,X bne quitTempo sta tempoCount
The last line resets tempoCount.
Below this (and only for PAL) I place:
; Load PALSyncPattern corresponding to TEMPODELAY of this track lda TEMPODELAY,X tay lda PALSyncPattern-1,Y sta tmp_PALSyncPattern ; If bit 7 is set, we need to INC tempoCount on EVERY reset bpl .SkipFirstINC inc tempoCount
(Note that TEMPODELAY is a table in UT2600, because I have multiple tracks. X is the offset/number of the track. In Paul's original kit TEMPODELAY is a constant.)
I use bit 7 of the pattern to indicate that tempoCount should be incremented EVERY time it is reset. It will then start at 1 instead of 0 and thus the next beat will come one frame earlier.
.SkipFirstINC ; PALSyncPattern is 6 bits long, corresponding to 6 resets of tempoCount inc PALSyncCounter lda PALSyncCounter tay ; If it's at 6, reset to 0 eor #6 bne .SkipResetSyncCounter sta PALSyncCounter .SkipResetSyncCounter ; If bit N (N being PALSyncCounter) of the PALSyncPattern is set, INC tempoCount (again) lda tmp_PALSyncPattern and bitMaskArray+2,Y beq .SkipSecondINC inc tempoCount
I increment PALSyncCounter to select the right bit from the pattern, use bitMaskArray (already in the songplayer) to mask off the other bits and if the result is non-zero, skip (another) tempoCount.
The patterns are carefully chosen to make sure PAL is keeping up pace with NTSC, albeit with some skipping, like the littlest dwarf from the Snow White animated movie trying to walk in sync with the others... As an homage to that I'll call this addition to Slocum's tracker: "The Dopey fix"
Here are PAL and NTSC for comparison:
ut2600-pal.bin 32KB 22 downloads
ut2600-ntsc.bin 32KB 23 downloads
Edited by MLdB, Thu Jun 28, 2018 8:15 AM.
0 members, 0 guests, 0 anonymous users