Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Rodrigo Yeowtch ! (Registered 2024-11-24) You are not logged in - nap
CSDb User Forums


Forums > CSDb Entries > Release id #141145 : Planet 5200
2015-09-14 18:58
Heaven
Account closed

Registered: Jul 2008
Posts: 102
Release id #141145 : Planet 5200

new CIA 4x4

this is basicly the source I have for 4x4:

;-------- init4x4 ----------------------
;blockbegin



.align $0100

init_4x4
sei
; lda #$35 ...already set
; sta $01

lda #$7f
sta $dd0d
lda $dd0d
ldx #<(fake_nmi)
ldy #>(fake_nmi)
stx $fffa
sty $fffb
ldx #<(timer_test)
ldy #>(timer_test)
stx $dd04
sty $dd05
lda #$11
sta $dd0e
lda #$81
sta $dd0d
.byte $ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea
fake_nmi
ldx $dd04
lda #$7f
sta $dd0d
lda $dd0d
plp
pla
pla
cpx #3
beq old_cia
lda #$24 ; bit zp
sta cia_mod
sta cia_mod2
.byte $ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea
.byte $ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea
.byte $ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea,$ea
old_cia
ldx #<(nmi)
ldy #>(nmi)
stx $fffa
sty $fffb
ldx #<(timer_a)
ldy #>(timer_a)
stx $dd04
sty $dd05
ldx #<(timer_b)
ldy #>(timer_b)
stx $dc06
sty $dc07
.page
PalTiming
ldx #3
cpx $d012
bne *-3
ldy #9
dey
bne *-1
cmp ($00),y
inx
cpx $d012
beq PalTiming2
cmp ($00),y
PalTiming2
ldy #9
dey
bne *-1
nop
nop
nop
inx
cpx $d012
beq PalTiming4
b_rts = *+1
cmp $60
PalTiming4
ldy #10
dey
bne *-1
nop
inx
cpx $d012
bne PalTiming6
PalTiming6
.endp
pha
pla
pha
pla
cia_mod cmp #$DB
.if !below_io
bit $DB
.fi
lda #$11
sta $dd0e
ldy #5
dey
bne *-1
cia_mod2 cmp $DB,x
.if below_io
bit $DB
.fi
sta $dc0f
lda #$40
sta b_rti

lda #$7f
sta $d019
sta $dc0d
lda $dc0d
ldx #<(vic_irq_start)
ldy #>(vic_irq_start)
stx $fffe
sty $ffff
lda #ras_start
sta $d012
lda #$1b
sta $d011
lda #1
sta $d01a
lda #$34
sta $01
cli
rts

;lda #%00011000
;lda #%00101000

nmi
sta nmi_accu+1
lda #15
.if below_io
sta $01 ; timing critical^
.fi
eor $dc06
sta timeit+1
.page
timeit bpl timeit+2
.byte $a9,$a9,$a9,$a9,$a9,$a9,$24,$ea
.endp

scrmod1 lda #%10101000
sta $d018
d11b lda #$1f
sta $d011
d11a lda #$1b
sta $d011
scrmod2 lda #%10111000
sta $d018


.if below_io
bit $dd0d
lda #$30 ; not timing critical
sta $01
nmi_accu lda #$FF
rti
.else
nmi_accu lda #$FF
jmp b_rti
.fi

.align $0100
vic_irq_start
sta irq_start_accu+1
.if below_io
lda #$35 ; not timing critical
sta $01
.fi
lda #ras_stop
sta $d012
bit $dd0d

lda #$81
sta $dd0d
sta $d019
lda #<(vic_irq_stop)
sta $fffe
.if below_io
lda #$30 ; not timing critical
sta $01
.fi
irq_start_accu
lda #$FF
rti

vic_irq_stop
sta irq_stop_accu+1
.if below_io
lda #$35 ; not timing critical
sta $01
.fi
.if open_border
lda #$13
sta $d011
.fi
lda #ras_start
sta $d012
lda #1
sta $dd0d
sta $d019
lda #<(vic_irq_start)
sta $fffe

.if below_io
lda #$30 ; not timing critical
sta $01
.fi
irq_stop_accu
lda #$FF
rti

question...

what does the .page command do?
 
... 20 posts hidden. Click here to view all posts....
 
2015-09-16 11:01
Heaven
Account closed

Registered: Jul 2008
Posts: 102
ah... now that sounds like a plan.

Thanks Oswald... lesson learned... without Sprite logo before init it works!
2015-09-16 15:05
Flavioweb

Registered: Nov 2011
Posts: 463
Soci: how did you made your dump?
2015-09-16 19:25
chatGPZ

Registered: Dec 2001
Posts: 11354
compile VICE in debug mode and use debug options :)
2015-09-16 20:19
Oswald

Registered: Apr 2002
Posts: 5086
yeah btw, Soci, THANKS! :)
2015-09-17 03:10
soci

Registered: Sep 2003
Posts: 479
Quote: Soci: how did you made your dump?

Flavioweb: What Groepaz said.

It was suspect that there were sprites in use, and had a look just in case... Bingo! ;)

Should have checked it before I did that quick CIA hack which is crashing every now and then.

Heaven: You don't need to remove the logo as it resides in the visible area and the timing measurement is under the border, so in theory they should normally never meet.

But they still do meet, why? (hint: fcevgr L cbfvgvba if. enfgre pbhagre)

If you make sure that sprites are turned off under the border when your timing loop runs then it'll be fine.

Oswald: you may retain your card ;)

I go back to fixing my own bugs, there are plenty...
2015-09-17 11:22
Flavioweb

Registered: Nov 2011
Posts: 463
I enabled debug in the past, but since i totally missed how powerful dump is, i turned it off.
Thanks a lot for this tip!
Previous - 1 | 2 | 3 - Next
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
wacek/arise
Hani
Jazzcat/Onslaught
Unlock/Padua/Albion
Dave/SIDNIFY
Brittle/Dentifrice^(?)
Murphy/Exceed
Bob/Censor Design
WVL/Xenon
primek/Lepsi DE ^ Bo..
deetsay
curtcool
Perff/No Name
wil
Brush/Elysium
Digger/Elysium
Sychamis
saimo/RETREAM
kbs/Pht/Lxt
Knut Clausen/SHAPE/F..
Guests online: 133
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Comaland 100%  (9.6)
10 What Is The Matrix 2  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Censor Design  (9.3)
Top Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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