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: 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
2011-10-18 16:54
Burglar

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

Registered: Jan 2003
Posts: 1932
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
zscs
leonofsgr/Singular C..
macx
LordCrass
Guests online: 92
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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