| |
terric Account closed
Registered: Feb 2009 Posts: 47 |
63 cycles on this machine?
I lately been coding on a code which detects 63 cycles and
puts $d021 to white.I must admit that i have a large peace of code detecting it but currently the only way for me.
I am not into detecting pal/ntsc. It appears to work, and
not 100% sure why i succeded.
Read below code too.
Here is the uncommented code.
lda #$00
sta $46
ldx #15
stx $48
ldy #$00
sty $49
rasterloop
- lda $d011
bmi -
- lda $d011
bpl -
- lda $d011
bmi -
ldx $d012
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
nop
nop
ldy $d012
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
lda $0200
ora $05
ldx $d012
sty $44
stx $45
lda $45
clc
sbc $44
sta $d020
ldx $d020
cpx $46
beq +
inc $49
+
stx $46
dec $48
beq +
jmp rasterloop
+
lda $49
sta $d021 #pal and background becomes white
Anyone feel like taking on the challenge?
Creating a smaller or more clever piece of code.
/terric |
|
| |
TWW
Registered: Jul 2009 Posts: 545 |
I have no idea what you are trying to achieve but anyway:
lda $d011
bmi *-3
lda $d011
bpl *-3
ldx $d012
ldx #$0a
dex
bne *-1
nop
ldy $d012
stx $d020
sty $d021
rts |
| |
Burglar
Registered: Dec 2004 Posts: 1101 |
lda $02a6
sta $d021
rts |
| |
Count Zero
Registered: Jan 2003 Posts: 1932 |
http://codebase64.org/doku.php?id=base:detect_pal_ntsc |
| |
terric Account closed
Registered: Feb 2009 Posts: 47 |
@Count Zero: I actually missed this cycle code. I will have a closer look at it.
lower
lda $d011
bmi lower
higher
lda $d011
bpl higher
;Confusion for me here, always 6 cycles closer to $d012 ;becoming #$01 :D |