Chroma 81 - SCART and Colour interface for the ZX81

Discussions about Sinclair ZX80 and ZX81 Hardware
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 » Mon Nov 10, 2014 3:32 am

stefano wrote:Probably it is something I should have understood myself reading your posts and webpage carefully, but.. is there a way to use colors in WRX graphics mode ? 8-)
I not have a Chroma interface, so I did an experiment with some zx spectrum screens files using only the JSZeddy emulator and the result is here:
prisioner_of _time.png
prisioner_of _time.png (32.52 KiB) Viewed 1820 times
stellar.png
stellar.png (26.13 KiB) Viewed 1820 times
The .scr files were obtained from here: http://zxart.ee/eng/graphics/authors/p/pheel/

would be interesting to someone to test it on a real interface to see if it works well. ;)

In JSZeddy, the screens are loaded e shown but the emulator status some times is "crashed", especially with the file stellar.p.

Edited (11/11/2014): the issue was fixed, now the programs not crash in JSZeddy. Fixed files are below.
Attachments
Chroma WRX Color.zip
(21.16 KiB) Downloaded 82 times
Last edited by kmurta on Tue Nov 11, 2014 4:06 pm, edited 1 time in total.
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

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

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

Post by olofsen » Mon Nov 10, 2014 5:37 pm

Very nice! The LDIR of the screen over the system variables could perhaps explain a screen-dependent crash, as the NMI may depend on the D-FILE variable. Do things improve if the screen is copied to for example $2000?

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 11, 2014 1:20 am

kmurta wrote: Now the colorized Missile Command is working in JSZeddy :P
I would like to know if it works alright in a real ZX81 with Chroma interface.
Yes, it works well on the real hardware and looks really good.

stefano wrote:is there a way to use colors in WRX graphics mode ? 8-)
Not with the typical WRX driver, which executes the same 32 byte buffer for every pixel line. It only changes the refresh address such that different pixel patterns are retrieved for each scan line, but Chroma does not determine the attribute file address based on the data return on the refresh cycle but on the instruction fetch cycle in the display file.

Chroma monitors the 'execution' of bytes from the 'display file', which for the WRX driver is the 32 byte buffer. So if attribute mode is selected then there is only a single row of attribute colours and these are repeated for every scan line shown. This results in columns of colours.

To add colour to a WRX program, the video driver would need to implement a 32 byte buffer for every pixel line and then 'execute' the buffers in sequence. In this way a different attribute file row would be fetched for every scan line. But this would mean a 6K hi-res file and a 6K 'display' file, leaving very little for an actual game. So an improvement would be to adopt the approach used by the Spectrum and create a video driver that repeats the same attribute row for 8 consecutive scan lines, i.e. a 6K hi-res file and a 768 byte 'display' file.

kmurta wrote:would be interesting to someone to test it on a real interface to see if it works well.
I've tried them and neither display correctly. They do not appear to generate a correct 50 Hz frame rate and so Chroma fails to detect the output as valid frames. When viewed using the standard RF connection I see the bottom of the picture at the top of the screen and the top of the picture at the bottom of the screen, which a large white bar in the middle of the screen (presumably where the vertical sync pulse should have been). I have not yet had a chance to investigate further to see where things are going wrong.

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 11, 2014 9:13 am

There is still one detail I did not get fully.
The 32 bytes being "executed" by the WRX driver are just a dummy line. I suppose we also need its ghost copy to put the attributes in ?
If so also the 8x8 attribute stuff would require more than 6144+2*768.
By "more than" I'm referring to the fact that the WRX drivers need also a leading and a trailing instruction per dummy line.

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 » Tue Nov 11, 2014 3:00 pm

stefano wrote:There is still one detail I did not get fully.
The 32 bytes being "executed" by the WRX driver are just a dummy line. I suppose we also need its ghost copy to put the attributes in ?
Most HRG programs execute always the same always while changing the I register to point to the next row to display.

I guess Paul just reads the position of DFILE when accessed and mixes the attributes then.
As far as I understood the documentation there is only character map supported in 2 ways (modes):
Defining the color for specific characters - OR - defining attributes for every char position.
I think the first one is more easy to implement in exisiting games/programs.

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 11, 2014 4:17 pm

olofsen wrote:Do things improve if the screen is copied to for example $2000?
You are right, I change the screen to $4700 and fix the problem. ;)
Fruitcake wrote: I've tried them and neither display correctly. They do not appear to generate a correct 50 Hz frame rate and so Chroma fails to detect the output as valid frames. When viewed using the standard RF connection I see the bottom of the picture at the top of the screen and the top of the picture at the bottom of the screen, which a large white bar in the middle of the screen (presumably where the vertical sync pulse should have been). I have not yet had a chance to investigate further to see where things are going wrong.
Thank you for the feedback.

I guess the issue was fixed and the corrected files are attached in previous post.

Edited: I test the fixed programs on a real ZX81 and the monochrome image is stable :D
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

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 11, 2014 10:30 pm

kmurta wrote:the issue was fixed and the corrected files are attached in previous post.
Both files now work on real hardware. It is amazing to see such detailed, colourful graphics being displayed on a ZX81! They actually look better on my TV than in the screenshots since there is not such a large difference between the bright and dull shades of each colour.

Any chance of turning the screens code into a utility that would allow any Spectrum screen to be selected and converted?

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 12, 2014 11:10 am

>I guess Paul just reads the position of DFILE when accessed and mixes the attributes then.
>As far as I understood the documentation there is only character map supported in 2 ways (modes):
>Defining the color for specific characters - OR - defining attributes for every char position.
>I think the first one is more easy to implement in exisiting games/programs.

Too late :P I was curious to try to get the traditional WRX mode working in colour, so now I'm working on a new weird experimental mode.
The resolution should be 136x128. The D-FILE length will be of 2176 bytes for graphics (it should be possible to place it also outside the conventional memory), plus an unmoveable attributes area of 2304 bytes, permitting one attribute byte per graphics byte (only one byte is wasted each line for the row termination).

Let's call it SBWRX (Stefano Bodrato's WRX variant) :P :

Code: Select all


HRG_handler:
        ld      b,4             ; delay sets the left edge of the screen
HRG_wait_left:
        djnz    HRG_wait_left   ; delay loop
        
        nop                     ; delay fine tuning here! Do not change!
                                ; (Originally the delay was obtained setting B to 7)

        dec     b               ; make Z flag=0

        ld      hl,(base_graphics)

        ld      b,128            ; 128 lines per hires screen

        push	hl
        ld		hl,HRG_LineStart + $8000
        ex		(sp),hl

        ld      de,17           ; 17 bytes offset is added to HL for next hline AND 18 bytes for the next dummy line ptr

HRG_outloop:
        ld      a,h             ; get HGR address MSB from HL
        ld      i,a             ; load MSB into I register which is RFSH address MSB
        ld      a,l             ; get HGR address LSB from HL
		ex		(sp),hl
		
        call	HRG_CallHL		; HRG_LineStart + $8000 + row offset
        inc		e
        add     hl,de           ; add 18 to HL to point to next hline
        ex	  (sp),hl
        dec		e
        add     hl,de           ; add 17 to HL to point to next hline
        dec     b               ; decrement line counter
        jp      nz,HRG_outloop  ; test for last line
		
        pop		hl

; -------------------------------------------------------
;
HRG_postproc:

(...)

;------------------------------------------------------------------------------
	Pivot trick by Stefano Bodrato  :)
;------------------------------------------------------------------------------

HRG_CallHL:
        ld      r,a             ; load LSB to R register which is RFSH address LSB
        jp	(hl)

;------------------------------------------------------------------------------
;
;   This is a dummy-line used for HRG output (17 bytes) repeated 128 times !!!
;
;------------------------------------------------------------------------------

HRG_LineStart:
        defb    0, 0, 0, 0      ; 17 NOPs = 17x8 bits = 136 pixels each HLINE
        defb    0, 0, 0, 0
        defb    0, 0, 0, 0
        defb    0, 0, 0, 0
        defb    0
        ret

        defb    0, 0, 0, 0      ; 17 NOPs = 17x8 bits = 136 pixels each HLINE
        defb    0, 0, 0, 0
        defb    0, 0, 0, 0
        defb    0, 0, 0, 0
        defb    0
        ret
(...)

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 » Wed Nov 12, 2014 2:01 pm

Fruitcake wrote:Both files now work on real hardware. It is amazing to see such detailed, colourful graphics being displayed on a ZX81! They actually look better on my TV than in the screenshots since there is not such a large difference between the bright and dull shades of each colour.
Very good!
Fruitcake wrote:Any chance of turning the screens code into a utility that would allow any Spectrum screen to be selected and converted?
Thanks to sirmorris this is possible ;)

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.

Included are dozens of screen files for imediate use.

Enjoy!
Attachments
SHOWSCR.zip
Now with slideshow
(310.51 KiB) Downloaded 76 times
Last edited by kmurta on Thu Nov 13, 2014 12:50 am, edited 1 time in total.
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 » Wed Nov 12, 2014 3:23 pm

I'm afraid I've been too confident .. the R register does not stay the same for long enough so the picture gets garbled.
Also the WRX mod could not react as I expected when I poke on the ghosted locations.

Is it possible to run my test program on the real hardware ?
The nasty background colors are put in by purpose
The emulators react oddly and differently..
Attachments
a.P
136x128 (17x128 attributes) mode test
(6.96 KiB) Downloaded 69 times

Post Reply