User Tools

Site Tools


base:detect_pal_ntsc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
base:detect_pal_ntsc [2020-11-10 21:55] – [Source Code] copyfaultbase:detect_pal_ntsc [2020-11-10 21:59] copyfault
Line 850: Line 850:
  
  
-==== Source Code ====+=== Source Code ===
 <code> <code>
 chk:           chk:          
Line 862: Line 862:
  
 Why that [''ldx #$aa'']? There's a small probability that the routine starts when we accidently **are** on line $0 (or $100). The [''bne chk+1''] would not branch, i.e. the check-for-line$0-loop would end promptly, without any backup value stored in X yet. Thus, we need an init value for X that forces the line$0-check to be repeated in this rare case. It could by any value with MSB set, but using $aa (=TAX as opcode) contributes to making the whole routine as short as possbile. Why that [''ldx #$aa'']? There's a small probability that the routine starts when we accidently **are** on line $0 (or $100). The [''bne chk+1''] would not branch, i.e. the check-for-line$0-loop would end promptly, without any backup value stored in X yet. Thus, we need an init value for X that forces the line$0-check to be repeated in this rare case. It could by any value with MSB set, but using $aa (=TAX as opcode) contributes to making the whole routine as short as possbile.
 +
 +
 +===== Very short full VIC-type detection =====
 +
 +Count cycles galore
 +
 +=== Source Code ===
 +<code>
 +yet
 +to
 +come
 +</code>
base/detect_pal_ntsc.txt · Last modified: 2020-11-11 01:49 by copyfault