Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > 63 cycles on this machine?
2011-10-18 15:14
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
2011-10-18 16:05
TWW

Registered: Jul 2009
Posts: 541
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
2011-10-18 16:54
Burglar

Registered: Dec 2004
Posts: 1031
lda $02a6
sta $d021
rts
2011-10-18 20:21
Count Zero

Registered: Jan 2003
Posts: 1821
http://codebase64.org/doku.php?id=base:detect_pal_ntsc
2011-10-18 20:58
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
cba
zscs
commodore_freak
Sokrates
Higgie/Kraze/Onslaught
Guests online: 120
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.039 sec.