Garry (Rybags z AtariAge) prosil mnie abym przedstawil jego prace na naszym forum
zapewne wiele osob widzialo juz ten watek na AtariAge, a moze nawet chcialo by moze cos sprobowac z tematem zrobic dalej
tymczasem z tad mozna pobrac binarke programiku wykozystujacego ta technike
sama technika nie jest skomplikowana, a jako ze urzadzenia typu TV sa standardowo przystosowane do wyswietlania takiego obrazu nie jest to tak uciazliwe jak w przypadku zwyklego interlace w ktorym chodzi o wieksza liczbe kolorow
polaczenie tej techniki z vbxe moze dac nam ladne 640x480 w 16 kolorach - a to jakby troche wiecej niz moze zdzialac ST czy STE w tym temacie
do pelni szczescia brakuje juz tylko karty turbo, ale to tez nie na dlugo...
A to kod, ktory mozna wykozystac do wlasnych prob wykozystania tej techniki:
;
; Initialization routine. Call once Display List is set up
; Display List should have a blank line with DLI at the top
; and a Mode 2,3 or F line with DLI as it's last display instruction
;
lda #0
sta nmien
ldx #<vblank
ldy #>vblank
stx $222
sty $223
lda #$40
sta nmien
; lda pactl
; and #$fb
; sta pactl
; lda #$80
; sta porta
; lda pactl
; ora #4
; sta pactl
rts
.byte 0,0,0,0; filler
waitvc
cmp vcount
bne waitvc
rts
vblank
lda #$c0
sta nmien
ldx #<dli1
ldy #>dli1
stx $200
sty $201
lda 20
lsr a
bcc vblank2
jmp vblankend
vblank2
lda #$88
jsr waitvc
; *****************************************************************************
; Important - don't modify anything between this comment and the next "Important" comment
; *****************************************************************************
lda #0
sta $d017
sta $d018
sta $d01a
sta wsync
sta porta
ldy #3
sta wsync
sta wsync
; first line of vsync... half line at blanking level, second half at sync level
nop; 105
sty dmactl; 109
ldx #7; 111
; Refresh cycles 26 30 34 38 42 46 50 54 58
vbwait1
dex
bne vbwait1; 5*X-1=34=31 (+2 Ref)= 33
ldx #3; 36 (1)
nop; 39 (1)
nop; 41
nop; 44 (1)
nop; 47 (1)
nop; 49
sta dmactl; 55 (2)
nop; 57
stx vscount; 62 (1)
ldx #7; 63
; Refresh cycles 26 30 34 38 42 46 50 54 58
vbloop1
vbwait3
dex
bne vbwait3; 5*X-1 = 34 = 97,
sty dmactl; 101 get HSync pulses back in normal order
nop; 103
nop; 105
nop; 107
sta dmactl; 111
dec vscount; 116 = 2
beq vsyncend; 4
ldx #5; 6
vbwait2
dex
bne vbwait2; 5*X-1 = 24 (+ 2 Ref) = 32
ldx #6; 35 (1)
nop; 37
nop; 40 (1)
nop; 43 (1)
nop; 45
sty dmactl; 51 (2)
nop; 53
sta dmactl; 59 (2)
nop; 61
nop; 63
nop; 65
jmp vbloop1; 68
; Refresh cycles 26 30 34 38 42 46 50 54 58
vsyncend
lda #1
jsr waitvc
vblankend
; *****************************************************************************
; Important - don't modify anything between this and the previous "Important" comment
; *****************************************************************************
lda sdmctl
sta savesdmctl
lda #$20
sta sdmctl
; lda #$80
sta wsync
; sta porta
; Following NOPs just padding for patches etc. Can be safely removed
.byte 234,234,234,234
.byte 234,234,234,234
.byte 234,234,234,234
jmp $e45f
savesdmctl .byte 0
; Following zeros just padding
.word 0,0,0,0,0,0,0,0
dli1
pha
lda savesdmctl
sta sdmctl
sta wsync
sta dmactl
lda #<dli2
sta $200
lda #>dli2
sta $201
pla
rti
dli2
pha
lda #0
sta wsync
sta dmactl
pla
rti
Jeszcze notka od Garrego:
For some reason the process of saving SDMCTL before the Stage 2 VBlank, then restoring it later would sometimes get messed up and you'd wind up with a blank screen.
I just fixed it by hardcoding the first DLI to always store #$22 in DMACTL.The proper fix would be to just save the value when calling the init routine, then load the value from the saved copy in the first DLI. I implemented the save/restore thing to cater for values other than the default $22. The entire clumsy process has to be done that way because you need the screen left blank in the offscreen areas to avoid corruption, then you need Display List access still (value = $20) so that the first DLI will occur.
For the source I release, I'll be sure to implement the "proper" fix.