c0pperdragon / C64-Video-Enhancement

Component video modification for the C64 8-bit computer
MIT License
255 stars 36 forks source link

C128 support or version #4

Closed bodgit closed 3 years ago

bodgit commented 5 years ago

I presume it should be possible to do the same video enhancement on a C128? As I understand it, the VIC-IIe chip has 8 additional pins for a total of 48, however they're apparently for the Z80 CPU and the extra keys on a C128.

I'm guessing the modulator is going to be a different part so there might also be some changes needed for everything to line up such as the TRRS jack and mode switch to line up with the holes in the case. I can check this on my C128 unless you have one to hand.

bodgit commented 3 years ago

I don't think you can ship the PCB with solder paste applied; it has specific storage requirements and it might even be classed as hazardous. It probably wouldn't remain in the right place on the board either.

If you've never hand soldered something that fine pitch before, my advice is to practice on something similar first. The FPGA isn't super expensive, but I'd rather not ruin one using it to hone my technique. You will inevitably get a bridge somewhere so be prepared for that.

I think my components are finally shipping today after I ordered them last week; Mouser are taking a lot longer to process orders compared to Digikey.

nickgoodmanuk commented 3 years ago

I don't think you can ship the PCB with solder paste applied; it has specific storage requirements and it might even be classed as hazardous. It probably wouldn't remain in the right place on the board either.

If you've never hand soldered something that fine pitch before, my advice is to practice on something similar first. The FPGA isn't super expensive, but I'd rather not ruin one using it to hone my technique. You will inevitably get a bridge somewhere so be prepared for that.

I think my components are finally shipping today after I ordered them last week; Mouser are taking a lot longer to process orders compared to Digikey.

If you have some spare and gonna build them id definately like to buy one from you, I suspect a few others would too. I have an OSSC and all my other consoles/computers now output RGB but I have nothing to convert the composite/s-video of my 128, and would rather do the component mod on that rather than buy an retrotink just for this computer.

bodgit commented 3 years ago

I'm just at the point of working out how long a piece of ribbon cable to use that works with all C128 models. It turns out I have a fairly unusual C128 in that it's a flat CR, board assembly 250783, so it has the later 8568 VDC with 64 KB of RAM:

IMG_2703

I presume the DCR board is going to be fairly similar in layout to this, and I can see in the other photos that the modulator is aligned more to the middle of the enclosure of the VIC-IIe and VDC chips on the earlier boards so I'll try and use a longer length to suit those which should leave a small amount of excess cable on the C128(D)CR boards.

bodgit commented 3 years ago

I've finally built and tested five FPGA boards and their VIC-IIe adapters: IMG_2720

I've never shouted at an inanimate object as much as I've shouted at my clone Altera USB cable, I think there is a reason they are cheap! I've found with a couple of boards that Quartus will report 100% programming success but the board doesn't produce any picture, flash it again to 100% success and it then works. I also had better luck against random failures using Quartus in a Windows VM annoyingly, compared to running it in a Linux VM.

I've installed one board in my C128CR: IMG_2723

I think I need to tweak the install and make sure none of the original caps interfere with the VIC adapter but I do get a nice stable picture: IMG_2721

Because I can't now fit the lid on the VIC/VDC enclosure and refit the RF shielding I should get some heatsinks for the now-exposed chips before I try and use this board for any prolonged period of time.

nickgoodmanuk commented 3 years ago

@bodgit Looking good ! - you're not living up to your username !

c0pperdragon commented 3 years ago

That is very good! So my purely theoretical design seems to actually work. One good test would be to try some game or demo with sprites, because their DMA behaviour did cause issues on various VIC variants.

JDet-74 commented 3 years ago

@bodgit well done. I will try my luck later. The most challenge would be to flash the FPGA. I have also a cheap programming cable, so I am looking forward for a lot swearing.

laubzega commented 3 years ago

The amount of hair pulled out due to Altera Blaster was the direct reason for adding USB->JTAG to BeamRacer. Using FT2232D it increases BoM by about $8, but you cannot put a price on sanity. Also, cheaper chips could be used, if slower programming is acceptable (it's ~4s with the FTDI chip).

bodgit commented 3 years ago

That is very good! So my purely theoretical design seems to actually work. One good test would be to try some game or demo with sprites, because their DMA behaviour did cause issues on various VIC variants.

I've tried a couple of minutes of the Uncensored and Edge of Disgrace demos and they both seem to work ok, C64 games seem to be fine as well. Not sure if there's anything C128-specific I can try, the only C128 demos I know of are for the 80 column mode using the VDC.

lolof70 commented 3 years ago

Hi all,

Trying to build one for my 128DCR too... Here a picture from where I am now.....

Just started to try to program it as it is now. The Altera software programmer can't see the FPGA....

While trying to program, I am powering the board with a 5V coming from USB source, I put the 5V on the 1st pin on refcon2. Is it enought to power the FPGA to program it ?

As Regulators, I am using 2 AMS1117-3.3. Should be the same equivalent from the BOM one... The video connector and switch are still missing but this should not be a problem to program the max10...

Tried on Quartus 16.1 and 20.1 with USB-blaster.... With this setup, I can program my Vampire 600 on amiga...

Same with 2 Boards, Quartus can't see the FPGAs Chain. Error 35...

Thanks for your help.

IMG_5108

c0pperdragon commented 3 years ago

Your board looks actually quite good. For programming outside of the computer, you need to apply +5V to pin 1 of RFCONC2 (as you did) and GND to one of the GND5 pins. Maybe you have attached your GND to pin 4 of RFCONC2?
This is really a bad trap, because this pin is only connected to the analog circuit that is responsible for amplifying the orginal output of the VIC-II. The FPGA is connected to ground via GND5.

c0pperdragon commented 3 years ago

Sorry, I meant to write "pin 3 of RFCONC2", which is connected to the analog ground plane.

lolof70 commented 3 years ago

ohhhh ! Thank you very much. That was the problem. I used RFCON2 pin 3 as GND.....

I used GND5 and it's perfect. Both are programmed. It's a pity I do not have the switch and Audio jack.... I will have to find this very quickly :-) Thanks a lot for the very quick help.

lolof70 commented 3 years ago

A small update from my 128DCR. I got switches and jack connectors. I just tested the boards on my CDR... Working very well, I've never seen a picture like this on a 128 on TVs.... Thank you very much, brillant device ! I just have to integrate it fully in the DCR....

Here pictures from first quick test. It's still more beautiful in real than on the pictures !!

IMG_20210425_124416

IMG_20210425_124422

IMG_20210425_124644

IMG_20210425_124627

Edit : and all installed, all going at a 0,5mm maybe :-)

IMG_20210425_185306

lolof70 commented 3 years ago

Just one question, is it normal that the 128 startup screen is more blue than black ? I saw in this thread a picture where it's more black.... Maybe my TV or the default setting in FPGA ?

c0pperdragon commented 3 years ago

Maybe some resistors of the DAC have a problem. You could check this by flashing the test firmware that just displays some color and gradient bars: https://github.com/c0pperdragon/A-VideoBoard/releases/tag/1.1 Especially the three gradient bars should have 32 distinct segments each. Maybe just post a picture. I can then easily see which part is wrong.

lolof70 commented 3 years ago

Thank you for your help.

Maybe it's not so important but just in case because it's srtange, I bought my cable from Amazon. When connecting the cable by colours, Blue/green/Red from cable to Blue/green/red to TV, it showed to much red and no blue in games and for example in the EF3 menu. But the 128 Startup screen was more correct with it colours.... I reverted red and blue and in games/ EF3 menu it was OK as on the pictures I posted before. But 128 Startup screen was not so good, as the picture I posted before...

EDIT : I checked my cable with the pinout from here, ring 1 and ring 2 are inverted in my cable. That's notmal I have to revert it connecting to my tv....

The first pictures is the tv I am using usually in svideo.... It seems it do with too much blue in YPbBr..... I can't set it up correctly.

The second TV is better, I would say normal. I have to switch to another TV to have better result and forget the one I usually used in svideo... I think the problem is not the resistors but the TV....

1619470238100

1619470238096

1619470238104

1619470456946

c0pperdragon commented 3 years ago

The bottom two pictures show that the DACs are working correctly and your TV can hancle YPbPr just well. But you obviously need to extchange the Pb and Pr lines. The color stripe at the right should resemble the 16 colors of the C64, like in this picture here: https://www.c64-wiki.de/wiki/Datei:c64_16farben.png Your other TV really seems to have faulty inputs.

lolof70 commented 3 years ago

I did the test again. Here pictures. One with cable as yesterday and one with Pb Pr line reverted. None are as the picture from your link.

The one from left side is the closest. May I consider it as good ?

Screenshot 2021-04-27 at 11 21 13
c0pperdragon commented 3 years ago

I would say this is pretty close and the mod is working fine. Maybe overall brightnes is a bit low. Your dark grey looks nearly black on this screen. Try to adjust your screen brightnes so the five greyscales are about evenly spaced.

c0pperdragon commented 3 years ago

I created a new thread for this toppic, at this here is already much too long: https://github.com/c0pperdragon/C64-Video-Enhancement/issues/64