| | 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.... |
| | 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! |
| | Flavioweb
Registered: Nov 2011 Posts: 463 |
Soci: how did you made your dump? |
| | chatGPZ
Registered: Dec 2001 Posts: 11354 |
compile VICE in debug mode and use debug options :) |
| | Oswald
Registered: Apr 2002 Posts: 5086 |
yeah btw, Soci, THANKS! :) |
| | 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... |
| | 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 | |