Page 5 of 14

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 19 Dec 2021 12:35
by Smonson
Icky wrote: 18 Dec 2021 12:49 One option is to make the Phoenix Shifter core do this. I'll see if I can modify it to replicate your circuit @sporniket. Unfortunately I am not able to test as all my Atari stuff is in storage still.
Yeah. As mentioned earlier, this is very straightforward.

Increase the number of bits in r, g, and b from four to five:

Code: Select all

	output [3:0] r;
	output [3:0] g; 
	output [3:0] b;
Increase the number of bits in each palette entry from twelve to fifteen:

Code: Select all

	reg [11:0] palette [15:0];
Add the extra bits from the palette to the r, g, b calculation here:

Code: Select all

	assign r = resolution == 2 ? mono_intensity : 
		    {palette[palette_index][10:8], palette[palette_index][11]};
	assign g = resolution == 2 ? mono_intensity :
		    {palette[palette_index][6:4], palette[palette_index][7]};
	assign b = resolution == 2 ? mono_intensity :
		    {palette[palette_index][2:0], palette[palette_index][3]};
Connect the extra bits in the palette to the data bus when reading from the shifter:

Code: Select all

	assign data_out = addr[4] == 1 ? {6'b0, resolution, 8'b0} : {4'b0, palette[addr[3:0]]};


... and similarly when writing:

Code: Select all

	// register writes
	always @(posedge CLOCK_32) begin
		if (reset) begin
			resolution <= 2'b0;
		end else if (!cs && !rw) begin
			if (addr == 16) begin
				resolution <= data[1:0];
			end else begin
				palette[addr[3:0]] <= data[11:0];
			end
		end
	end
And then connect physical wires to those IO ports in the FPGA compiler software.

If you wanted to go up to 8 bits per colour, just use eight bits instead of five, and then use address $ff8262 bit 4 as a flag to indicate that future writes to the palette will be for the higher bits of each palette entry (this is to remain compatible with 256-colour mode that is already implemented).

E.g.

Code: Select all

$ff8262 = $0    == Writes to palette entry 0 to 15 are for lower bits of palette 0 to 15
$ff8262 = $1    == Writes to palette entry 0 to 15 are for lower bits of palette 16 to 31
   ...
$ff8262 = $f    == Writes to palette entry 0 to 15 are for lower bits of palette 240 to 255

$ff8262 = $10   == Writes to palette entry 0 to 15 are for higher bits of palette 0 to 15
$ff8262 = $11   == Writes to palette entry 0 to 15 are for higher bits of palette 16 to 31
   ...
$ff8262 = $1f   == Writes to palette entry 0 to 15 are for higher bits of palette 240 to 255
I hope that makes sense.

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 22 Dec 2021 18:07
by sporniket
my belly is not the only thing that need a little bit of diet...

2021-12-22--a-little-bit-wide.jpg

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 22 Dec 2021 19:01
by DoG
sporniket wrote: 22 Dec 2021 18:07 my belly is not the only thing that need a little bit of diet...
:lol:

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 23 Dec 2021 18:57
by sporniket
Much better... but because of some resistors, one will need long pins for the connector to the socket.

2021-12-23--fitting-01.jpg
2021-12-23--fitting-02.jpg
2021-12-23--fitting-03.jpg

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 23 Dec 2021 19:40
by Icky
sporniket wrote: 23 Dec 2021 18:57 Much better... but because of some resistors, one will need long pins for the connector to the socket.
Or use a turned pin DIL socket to stack the board higher :) Nice work BTW @sporniket

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 23 Dec 2021 21:28
by sporniket
Icky wrote: 23 Dec 2021 19:40 Or use a turned pin DIL socket to stack the board higher :)
Good suggestion, thanks :)
Icky wrote: 23 Dec 2021 19:40 Nice work BTW @sporniket
Thanks, I will shave a little bit of the length as I can do it on the side of the Shifter socket, to get a wider margin, and it will be good to me.

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 04 Jan 2022 18:00
by mrbombermillzy
Any updates @sporniket ? :)

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 04 Jan 2022 19:52
by sporniket
@mrbombermillzy I have let some time pass after shortening a little bit the length on the pcb, in case someone make a feedback. By next week I will make a gerber and order a small batch to check that in effect, it fits inside the shield of the shifter.

The latest commit is tagged as v1.0.0-xprc2 (a.k.a eXPerimental Release Candidate 2).

I also started to make a project on mouser, to make a bom.

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 04 Jan 2022 20:38
by mrbombermillzy
Great!

So is the palette access still going to be:

GRGBRRRRGGGGBBBB (5444032103210321)?

Re: 32768 color dual Shifter ST mod - schematics lost?

Posted: 04 Jan 2022 21:40
by sporniket
Yes, that's the spirit, with legacy STe bits being the Most Significant Bits though, meaning the final mix that I devised would be, with your notations :

Code: Select all

R_analog = 321043
G_analog = 321045
B_analog = 321043
Meaning that between green levels 0..32767 (0b000000 .. 0b011111), greys are obtained with the LSB at '0', and for green levels 32768..65535, greys are obtained with the LSB at '1'.

I hope I am clear enough, however here are how I expect the 32 shades of greys (provided I did no errors with all those out of order bits...) :

Code: Select all

0000.0000.0000.0000 -- Black
0111.0000.0000.0000 -- Grey 1/31
0000.1000.1000.1000 -- ...
0111.1000.1000.1000
0000.0001.0001.0001
0111.0001.0001.0001
0000.1001.1001.1001
0111.1001.1001.1001
0000.0010.0010.0010
0111.0010.0010.0010
0000.1010.1010.1010
0111.1010.1010.1010
0000.0011.0011.0011
0111.0011.0011.0011
0000.1011.1011.1011 -- ...
0111.1011.1011.1011 -- Grey 15/31 -- Lower half 
1000.0100.0100.0100 -- Grey 16/31 -- Higher half
1111.0100.0100.0100 -- ...
1000.1100.1100.1100
1111.1100.1100.1100
1000.0101.0101.0101
1111.0101.0101.0101
1000.1101.1101.1101
1111.1101.1101.1101
1000.0110.0110.0110
1111.0110.0110.0110
1000.1110.1110.1110
1111.1110.1110.1110
1000.0111.0111.0111
1111.0111.0111.0111 -- ...
1000.1111.1111.1111 -- Grey 30/31
1111.1111.1111.1111 -- White