universal2600 Posted August 2, 2015 Share Posted August 2, 2015 Hello, as the title suggests im planning to build a from scratch z80 computer and wanted to know if a TIA from a 2600 can be used with a z80 cpu or is it designed solely for the 6502(7) i figured i'd use it since i have several of them laying around, i just dont want to have 4 main chips with a plethora of ic's just to communicate between the z80 and TIA. thanks Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 2, 2015 Share Posted August 2, 2015 One problem is Z80 uses more cycles per typical instruction, since you have to hit registers on TIA on the fly for video generation it might be a problem. Object positioning probably the biggest - IIRC hitting the register for coarse positioning relies on delay loops that are multiples of 5 cycles. Likely the problems could be overcome - for starters you could probably run the Z80 at the same 3.6 MHz speed as TIA. Though it expects register accesses to occur at 1/3rd that speed, it shouldn't be too hard to sync accesses on a 1.16 MHz clock. Quote Link to comment Share on other sites More sharing options...
universal2600 Posted August 2, 2015 Author Share Posted August 2, 2015 (edited) One problem is Z80 uses more cycles per typical instruction, since you have to hit registers on TIA on the fly for video generation it might be a problem. Object positioning probably the biggest - IIRC hitting the register for coarse positioning relies on delay loops that are multiples of 5 cycles. Likely the problems could be overcome - for starters you could probably run the Z80 at the same 3.6 MHz speed as TIA. Though it expects register accesses to occur at 1/3rd that speed, it shouldn't be too hard to sync accesses on a 1.16 MHz clock. yeah that's why i posted since they created the tia to eliminate the need for a framebuffer,so you need to change values on the fly, but i was thinking is it possible to have lets say an 8k ram chip between the z80 and tia, the z80 will write to the ram, the tia would pull what it needs from the ram, i guess adding a framebuffer in a rough sense Edited August 2, 2015 by universal2600 Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 3, 2015 Share Posted August 3, 2015 Some sort of intermediate hardware which automated the display would be a cool idea. Problem is you've got all of 40 pixels playfield which is represented in the hardware by 20 bits which you either have replicated or mirrored or you have to store again with the CPU for unique graphics on the right of the display, plus you need to get the PMs into action for detail and text. Then it comes back to cycle critical timing and the CPU doing things like writing player graphics registers at appropriate time or hitting the VDELAY register to bring buffered player graphics into play. Maybe some sort of PIC with access to an SRAM, the Z80 would need access as well. Then devise a psuedo instruction set that the PIC can run during the display, maybe some sort of way cut down 6502 emulation. Quote Link to comment Share on other sites More sharing options...
universal2600 Posted August 3, 2015 Author Share Posted August 3, 2015 (edited) Some sort of intermediate hardware which automated the display would be a cool idea. Problem is you've got all of 40 pixels playfield which is represented in the hardware by 20 bits which you either have replicated or mirrored or you have to store again with the CPU for unique graphics on the right of the display, plus you need to get the PMs into action for detail and text. Then it comes back to cycle critical timing and the CPU doing things like writing player graphics registers at appropriate time or hitting the VDELAY register to bring buffered player graphics into play. Maybe some sort of PIC with access to an SRAM, the Z80 would need access as well. Then devise a psuedo instruction set that the PIC can run during the display, maybe some sort of way cut down 6502 emulation. Yeah I was thinking about using a micro i do have a few pic18f4550, one of those 40 pdip pic mcu with all the bells and whistles, even has usb capability on chip, maybe it could be possible to use the pic and TIA to produce two video modes, tia would be lowres graphical mode, pic would be hi res but fewer colors. I think the what's the hard part is that to a cpu a tia is just a few bytes ram the tia isn't really much of a processor from the cpu point of view, just a bunch of latched memory addresses Edited August 3, 2015 by universal2600 Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 4, 2015 Share Posted August 4, 2015 Likely the problems could be overcome - for starters you could probably run the Z80 at the same 3.6 MHz speed as TIA. Though it expects register accesses to occur at 1/3rd that speed, it shouldn't be too hard to sync accesses on a 1.16 MHz clock. Wickeycolumbus did an experiment a few years ago where he had a 65C02 running at the same clock rate as TIA, TIA appeared to work fine with that. Quote Link to comment Share on other sites More sharing options...
universal2600 Posted August 4, 2015 Author Share Posted August 4, 2015 Wickeycolumbus did an experiment a few years ago where he had a 65C02 running at the same clock rate as TIA, TIA appeared to work fine with that. that's cool but he is using a newer 6502 variant, im using a old 4Mhz NEC D780c z80, and 6502 has a noticeable speed difference at any given clock, z80 takes ~2-4 cycles more to complete an instruction vs the 6502. nice read though, thanks for the info! Quote Link to comment Share on other sites More sharing options...
universal2600 Posted August 11, 2016 Author Share Posted August 11, 2016 apologies for the necrobump, but i have gone back and actually started work, i have got a 4 MHz z80, tia, 6532, and two pic16f628a (why not), my question is with the tia, one is that is clock frequency MUST be 3.58MHZ, or can it be overclocked; lets say clock the tia @ 4HMZ and have the cpu run of the div by 3 osc from the tia and still have it function (i was thinking to have a 4MHZ "master" clock and wire it to have a slow and fast switch from the 4 MHZ to the tia div by 3 for the cpu if thats possible), and two with tia drawing the frame, is hardware controlled to a 160 x 192 resolution or can it be programmed to draw at higher resolutions? mainly speaking since that the z80 has a full 16-bit address space instead of the 6507 13bit, I can address 64k at a time instead of 4k of the 6507 (iirc) so i have alot more addressable memory?(i was thinking of putting 8 or 16k of ram to start haven't decided yet depends if can find my 32k chip wherever it is) Quote Link to comment Share on other sites More sharing options...
Osgeld Posted August 11, 2016 Share Posted August 11, 2016 3.57blah blah blah is used for NTSC color generation Quote Link to comment Share on other sites More sharing options...
universal2600 Posted August 11, 2016 Author Share Posted August 11, 2016 3.57blah blah blah is used for NTSC color generation so i just lose the ability of color if i dont use the 3.5759575 (that's probably wrong but close enough)? as the clock for the tia and i would just get a black and white output? Quote Link to comment Share on other sites More sharing options...
7800fan Posted August 11, 2016 Share Posted August 11, 2016 TIA doesn't have a frequency lock, the signal output is completely dependent on correct clock being used. Also it doesn't have video RAM, every single pixel has to be manually drawn on the fly. It is part of 2600's quirk that makes it a bit hard to program for. One cycle short or one cycle too many on a single line, you would have video tearing. A few lines short or too many lines and older TV will roll. Newer TV may cut off extra or refuse the signal. Good luck with your project and do let us know! Quote Link to comment Share on other sites More sharing options...
universal2600 Posted August 11, 2016 Author Share Posted August 11, 2016 TIA doesn't have a frequency lock, the signal output is completely dependent on correct clock being used. Also it doesn't have video RAM, every single pixel has to be manually drawn on the fly. It is part of 2600's quirk that makes it a bit hard to program for. One cycle short or one cycle too many on a single line, you would have video tearing. A few lines short or too many lines and older TV will roll. Newer TV may cut off extra or refuse the signal. Good luck with your project and do let us know! that brings another question is it feasible to store the tia frame in ram and have the tia pull it from memory? Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted August 11, 2016 Share Posted August 11, 2016 You'd be better off using the 7800s MARIA and interfacing it to the Z80's BUSREQ# and BUSACK# signals. Quote Link to comment Share on other sites More sharing options...
Osgeld Posted August 11, 2016 Share Posted August 11, 2016 As 7800 said the tia won't do much tight without a proper clock based around video timings 3.57xxxxy was chosen as the color burst reference cause it's a multiple of the line draw rate, sooo messing with it to much will result in a unusable video signal Quote Link to comment Share on other sites More sharing options...
Osgeld Posted August 11, 2016 Share Posted August 11, 2016 that brings another question is it feasible to store the tia frame in ram and have the tia pull it from memory? Tia doesn't pull anything you have to say OI TIA and start shoving it data Quote Link to comment Share on other sites More sharing options...
7800fan Posted August 12, 2016 Share Posted August 12, 2016 Tia doesn't pull anything you have to say OI TIA and start shoving it data And it has to be done continuously other than while waiting for vblank and vsync to end. TIA is not really going to be easy to use at all. You should use anything else instead. Quote Link to comment Share on other sites More sharing options...
universal2600 Posted September 9, 2016 Author Share Posted September 9, 2016 how possible would it be to draw the take a Tia frame, with the z80 writing the values into a reserved are of ram like a buffer,a frame ahead of the current frame, have a micro ( I have two pic16f628a aswell a 74hc595 shift register) and just have the pic relay the frame into the Tia, and allow the CPU to work on other instructions, and just by poking new values in the ram space to control the Tia since there is 8k ram + 128 byte onboard the riot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.