Chroma 81 - SCART and Colour interface for the ZX81

Discussions about Sinclair ZX80 and ZX81 Hardware
Fruitcake
Posts: 147
Joined: Wed Sep 01, 2010 10:53 pm
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by Fruitcake » Wed Nov 12, 2014 9:53 pm

kmurta wrote:I used his code from a PT3 player to handle and display the ZX Spectrum .SCR files directly. Of course that the program is for use with ZXPand.
Great stuff!! :D

There is one small bug. Upon returning to the menu the screen colours are still visible. They need to be disabled otherwise it is very difficult to see the menu.

Could the program be made to automatically cycle through the screens?

Fruitcake
Posts: 147
Joined: Wed Sep 01, 2010 10:53 pm
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by Fruitcake » Wed Nov 12, 2014 10:07 pm

stefano wrote:the R register does not stay the same for long enough so the picture gets garbled.
I see corruption in the SCART picture and the RF picture on real hardware.
stefano wrote:The nasty background colors are put in by purpose
I don't see any colours on the real hardware, and the picture is centred (in JSZeddy it is shown to the left).

olofsen
Posts: 162
Joined: Wed Jan 08, 2014 12:29 pm

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by olofsen » Wed Nov 12, 2014 10:29 pm

JSZeddy expects 256x192; it might be that 136x128 will have more artefacts apart from not being centered...

User avatar
kmurta
Posts: 147
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by kmurta » Thu Nov 13, 2014 12:49 am

Fruitcake wrote:There is one small bug. Upon returning to the menu the screen colours are still visible. They need to be disabled otherwise it is very difficult to see the menu.
Oh damn! I thought about it, but I forgot to turn off the colors. But it has now been corrected. ;)
Fruitcake wrote:Could the program be made to automatically cycle through the screens?
Yes, see the updated file in the previous post.
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org

User avatar
stefano
Posts: 391
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by stefano » Thu Nov 13, 2014 2:12 pm

How did you make it on the first attempt ???
I'm getting crazy :/ ...by the way that driver is a fantastic piece of code: I'm still trying to figure out how it works :oops:

My 136 pixel driver will probably never work well, but it taught me a couple of intersting things about the emulators features and limits ;)
EightyOne was unvaluable to get the picture centered, i.e. !

Do you mind to try a similar trick in mode 0 ?

I'm attaching it.
Attachments
a3.P
One more attempt, mixed techniques. Shouldn't be necessary but JSSpeccy seems to react better..
(7.04 KiB) Downloaded 64 times
a2.P
136x128 (17x128 attributes) mode 0 test
(7.03 KiB) Downloaded 63 times

Fruitcake
Posts: 147
Joined: Wed Sep 01, 2010 10:53 pm
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by Fruitcake » Tue Nov 18, 2014 12:48 am

stefano wrote:Do you mind to try a similar trick in mode 0 ?
I have tried the programs on real hardware. Both produce the image centred on the screen but with corruption (like it was in the previous version). There are no colours displayed.

User avatar
stefano
Posts: 391
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by stefano » Tue Nov 18, 2014 8:00 am

Ok, thanks for the report. Corruption was expected, but it is now clear that my idea does not work.. the only useful result is that now I should be able to add an optional mod to the z88dk's drivers and shrink the display horizontally.

By the way the kmurta's work is now tested, so we all have a great hint already ;)

User avatar
kmurta
Posts: 147
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by kmurta » Tue Nov 18, 2014 7:50 pm

stefano wrote:How did you make it on the first attempt ???
The credits is all for zsolt, I only change the code to work with a full dummy dfile ;)

Here are the version used on the scr viewer:

Code: Select all

; ##############################################################
; #             HR Driver from Sponzy, by zsolt.               #
; # This driver simulate in ZX81 the ZX Spectrum Screen format #
; ##############################################################

HRON
        LD IX,HRDRV
        ret

HROFF:
        ld a,$1e        ; restore pattern table pointer
        ld i,a
        ld ix,$0281     ; The 'VIDEO-1' routine
        xor a		; disable the color mode
        ld bc,$7fef
        out (c),a
        ret


SAVE_SP dw 0

HRDRV
        LD A,R      	;delay  [9]
        LD B,$05	;delay  [7]
DLY     DJNZ DLY	;delay  [13/8]

        LD (SAVE_SP),SP		; 4	! 20	! SAVE SP.
        LD SP,NMISTACK		; 3	! 10	! because of nonlinear HFILE 

        POP HL			; 1	! 10	! 1st ROWADDRESS FROM NMISTACK
        POP IX			; 2	! 14	! "ld ix,DFILE"

        RET			; 1	! 10	! jump to DF_EXEC via NMISTACK

; -------------------------------------------------------
;	End of displaytask: 
DF_EXIT
        LD SP,(SAVE_SP)		 ; 4	! 20	! restore SP

        call    $292         ;return to application program
        call    $220         ;extra register push and vsync
        ld      ix,HRDRV     ;load the hr vector
        jp      $2a4         ;return to application program


;	
; ------------------------------------------------------------------------------ 
;	Executing D-File cont. (from NMISTACK)
; ------------------------------------------------------------------------------ 
DF_0100
        and (hl)		; 1     ! 7     ! delay
        and (hl)		; 1     ! 7     ! delay
        ld bc,$0100		; 3	! 10	! an offset value for computing
        add hl,bc		; 1	! 11	! address of the next row
DF_EXEC
        LD A,H			; 1	! 4	! high byte of rowaddr.
        LD I,A			; 2	! 9	! to "I" reg.
        LD A,L			; 1	! 4	! low byte of rowaddr.
        LD R,A			; 2	! 9	! to "R" reg.
        JP (IX)			; 2	! 8	! execute DFILE echo
;        32x NOP			; 32	! 128	!
;        RET (from DFILE)	; 1	! 10	! => "RET" to DF_xxxx
				;	!	! or "RET" to DF_EXIT
;
; ----------------------- 
DF_00A0
        ld bc,$00a0		; 3	! 10	! an offset value...
        add hl,bc		; 1	! 11	! address of the next row
        pop ix			; 2	! 14	! "ld ix,DF_LINxx"
        LD A,H			; 1	! 4	! high byte of rowaddr.
        LD I,A			; 2	! 9	! to "I" reg.
        LD A,L			; 1	! 4	! low byte of rowaddr.
        LD R,A			; 2	! 9	! to "R" reg.
        JP (IX)			; 2	! 8	! execute DFILE echo
;
; ----------------------- 
DF_F8A0
        ld bc,$f8a0	; 3	! 10	! 164	! an offset value...
        add hl,bc		; 1	! 11	! address of the next row
        pop ix			; 2	! 14	! "ld ix,DF_LINxx"
        LD A,H			; 1	! 4	! high byte of rowaddr.
        LD I,A			; 2	! 9	! to "I" reg.
        LD A,L			; 1	! 4	! low byte of rowaddr.
        LD R,A			; 2	! 9	! to "R" reg.
        JP (IX)			; 2	! 8	! execute DFILE echo;
; ----------------------- 
DF_F920
        ld bc,$f920	; 3	! 10	! 164	! an offset value...
        add hl,bc		; 1	! 11	! address of the next row
        pop ix			; 2	! 14	! "ld ix,DF_LINxx"
        LD A,H			; 1	! 4	! high byte of rowaddr.
        LD I,A			; 2	! 9	! to "I" reg.
        LD A,L			; 1	! 4	! low byte of rowaddr.
        LD R,A			; 2	! 9	! to "R" reg.
        JP (IX)			; 2	! 8	! execute DFILE echo
;
; ----------------------- 
DF_F9A0
        ld bc,$f9a0	; 3	! 10	! 164	! an offset value...
        add hl,bc		; 1	! 11	! address of the next row
        pop ix			; 2	! 14	! "ld ix,DF_LINxx"
        LD A,H			; 1	! 4	! high byte of rowaddr.
        LD I,A			; 2	! 9	! to "I" reg.
        LD A,L			; 1	! 4	! low byte of rowaddr.
        LD R,A			; 2	! 9	! to "R" reg.
        JP (IX)			; 2	! 8	! execute DFILE echo
;
; ------------------------------------------------------------------------------ 
;
NMISTACK
        dw $807E                ; the addr. of scanline 1 - corrected for 'JP (IX)'
                                ; because the refresh register (R) increments by 2,
                                ; but the 7th bit of 'R' not changes!!!
        dw DF_LIN00+$8000       ; this becomes to 'IX' (for jump to D-FILE execution)
        dw DF_EXEC              ; the entry point of the display generator
        ;
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN01+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN02+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN03+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F9A0,DF_LIN04+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN05+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN06+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN07+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_00A0,DF_LIN08+$8000

        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN09+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN10+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN11+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F9A0,DF_LIN12+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN13+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN14+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN15+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_00A0,DF_LIN16+$8000

        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN17+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN18+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN19+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F9A0,DF_LIN20+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F8A0,DF_LIN21+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN22+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_F920,DF_LIN23+$8000
        dw DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_0100,DF_EXIT

DummyDfile:
DF_LIN00 fill 32,$00 \ db $c9
DF_LIN01 fill 32,$00 \ db $c9
DF_LIN02 fill 32,$00 \ db $c9
DF_LIN03 fill 32,$00 \ db $c9
DF_LIN04 fill 32,$00 \ db $c9
DF_LIN05 fill 32,$00 \ db $c9
DF_LIN06 fill 32,$00 \ db $c9
DF_LIN07 fill 32,$00 \ db $c9

DF_LIN08 fill 32,$00 \ db $c9
DF_LIN09 fill 32,$00 \ db $c9
DF_LIN10 fill 32,$00 \ db $c9
DF_LIN11 fill 32,$00 \ db $c9
DF_LIN12 fill 32,$00 \ db $c9
DF_LIN13 fill 32,$00 \ db $c9
DF_LIN14 fill 32,$00 \ db $c9
DF_LIN15 fill 32,$00 \ db $c9

DF_LIN16 fill 32,$00 \ db $c9
DF_LIN17 fill 32,$00 \ db $c9
DF_LIN18 fill 32,$00 \ db $c9
DF_LIN19 fill 32,$00 \ db $c9
DF_LIN20 fill 32,$00 \ db $c9
DF_LIN21 fill 32,$00 \ db $c9
DF_LIN22 fill 32,$00 \ db $c9
DF_LIN23 fill 32,$00 \ db $c9
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Ringo R470, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org

User avatar
PokeMon
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by PokeMon » Wed Nov 19, 2014 4:49 pm

I wonder if this driver works on real hardware.
I think the interrupt routine at $0038 is not used as interrupts are not allowed (no EI instruction) ?
So how are the horizontal syncs created ?
As known from the ZX80 schematics these are build with two flipflops, initiated from an INT ACK cycle ?
:?

User avatar
stefano
Posts: 391
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Chroma 81 - SCART and Colour interface for the ZX81

Post by stefano » Wed Nov 19, 2014 8:07 pm

It is an unusual piece of code indeed.. but if understood correctly it has been tested on a real ZX81 connected to the Chorma-81 interface.

Did I get it right ?

Post Reply