Image Map Image Map
Results 1 to 9 of 9

Thread: Homemade Z80 machine

  1. #1
    Join Date
    Jul 2017
    Location
    South Carolina, USA, Earth, the Universe
    Posts
    55

    Default Homemade Z80 machine

    Hello,
    So recently I put together a "computer" with a Z80 cpu. I haven't connected and memory yet, but I know it
    is functional because I have control over some of the pins through the front panel. So far, it is basically just the cpu. I haven't connected any memory yet because I needed
    to take some time to consider just what I am trying to do. Then I got the idea of trying to make it run the arcade game donkey kong(favorite game) on a tv
    because the arcade version of donkey also uses a z80 cpu. I am wondered if this is even possible and some help on how to do it would be appreciated
    because I am not the most experienced with this kind of stuff. One of my main concerns is: Is it possible to make the donkey kong program output to
    a more modern tv(not a crt) using the yellow connector which I think is called composite or with the coax like the atari 2600 used.

    I used this website: http://wiki.donkeykonggenius.com/Donkey_Kong_Code
    to look at the code and I think a 16k rom would be needed for the actual program and I could just make the rest 48k ram.

    What I don't understand is how I would display the video Ram
    Does anybody know how this works?
    #7400-77ff Video RAM
    ; top left corner: #77A0
    ; bottom left corner: #77BF
    ; top right corner: #7440
    ; bottom right corner: #745F
    Last edited by CollinB1; September 19th, 2017 at 06:00 PM.

  2. #2

    Default

    The general idea is that there's a section of RAM that's basically a bitmap of what's on the screen. Thing is, this usually isn't just hooked up to the cpu like regular RAM, because it needs to be read by whatever's displaying it on a screen. Can't very well have two chips trying to pump an address into the same chip!

    That's what CRT controllers are used for. It's a large dedicated chip made exactly for this sorta thing. you CAN do without it, the very cheap microcomputers like the ZX-81 and SPECTRUM did, but that's NOT a trivial task. If you just want it to run DK, i think you'd be well off findng and studying schematics of one such z80 arcade machine. If you DO wanna design it yourself, I'd research the CRT controllers, and look for 'typical application' circuits of these.

    On all the DIY computers i've designed, I've avoided graphics for this reason. RS232 and a terminal is a breeze compared to this. Good luck!

    -Chris


    Current systems: PDP11/23, ZX-spectrum, MEK-6802D5, Ampex 210 CRT terminal, ZX-spectrum
    Current projects: 8085 Altair 8800 compatible
    Looking for: DEC RX-50 drive, QBUS ROM card, intel 8288

  3. #3

    Default

    The absolutely easiest would be to use some kind of graphics controller, like the TMS9918 or V9938/V9958 used in the TI-99 and MSX-class of machines. These controllers have their own memory separate from CPU memory, so you don't get the problem with access-collision. All interfacing between the CPU and this line of graphics controllers are by IO ports.
    Current systems owned by me:
    Vintage:IBM PC/XT submodel 087 ( 1983 ), [Kon]tiki-100 rev. C (1983), Compaq Portable I ( 1984 ), IBM PC/XT submodel 078 ( 1985 ), IBM PC/XT286 ( ~1986 ), 3x Nintendo Entertainement Systems ( 1987 ).
    Obsolete:Commodore A500 ( ~1990 ), IBM PS/2 model 70/386 type 8570-161 ( 1991 ), Atari Lynx II ( ~1992 ), Generic Intel 486SX PC ( ~1993 ), AT/T Globalyst Pentium w/FDIV bug MB ( 1994 ), Compaq 486DX4 laptop ( ~1995 ).

  4. #4

    Default

    Try studying the MAME source for the Donkey Kong driver (dkong.cpp). There are multiple files in the source code with the same filename, all relating to mainboard, video and sound hookups. They also have tons of useful info, including interrupt hookups, translated video schematics, and much more.
    Join your local penny pincher movement today!

  5. #5
    Join Date
    Jul 2017
    Location
    South Carolina, USA, Earth, the Universe
    Posts
    55

    Default

    Thanks guys ill take a look at all of this information.

  6. #6
    Join Date
    Jul 2017
    Location
    South Carolina, USA, Earth, the Universe
    Posts
    55

    Default

    So I think I'll go with what per said and use the TMS9918 or V9938/V9958, since it is the easiest and I am not trying to over-complicate this.
    Now here's what I don't understand:
    According to this website: http://wiki.donkeykonggenius.com/Donkey_Kong_Code the video ram is #7400-77ff, which is 1k of RAM.
    Am I missing something, or is this not even close to enough RAM for a bitmap of a donkey kong screen.
    Thanks a lot for all the help! This is still a major learning experience for me, so I am just about clueless when it comes to graphics.

  7. #7

    Default

    Most arcade machines (especially of that era) didn't use a bitmap. The screen was split into a grid of e.g. 8x8 pixel tiles, and each tile would be a pre-drawn graphic stored in ROM. You only need enough video memory to store the tile number for each grid position - perhaps 32x24 or 40x24 cells. Think of it like a basic text mode, except the "font" is a set of 8x8 multi-colour graphics tiles instead of text characters.

    The TMS99xx/V99x8 chips your looking at support this style of graphics as well as more conventional bitmap-based modes.

  8. #8
    Join Date
    Jul 2017
    Location
    South Carolina, USA, Earth, the Universe
    Posts
    55

    Default

    That makes more sense now Fishfinger.
    So these are all the memory locations of dkong:

    ; #0000-3fff ROM

    ; #6000-6fff RAM

    ; #6900-6a7f sprites

    ; #7000-73ff Sprite RAM (copied from #6900-6a7f via DMA)

    ; #7400-77ff Video RAM
    ; top left corner: #77A0
    ; bottom left corner: #77BF
    ; top right corner: #7440
    ; bottom right corner: #745F

    Does this mean that #6900-6a7f sprites are all in a ROM as sprites?
    And one more thing, what is the difference between #7000-73ff Sprite RAM (copied from #6900-6a7f via DMA) and #7400-77ff Video RAM?

  9. #9

    Default

    Arcade video hardware can be quite complicated. The video system is often more or less separate from the CPU and the graphics ROM is not mapped into the CPU's address space at all. The CPU tells the video system which tiles to display by writing the tile numbers to VRAM, but beyond that the video hardware is self-contained and does everything such as looking up the tile graphics and colours in the graphics ROM and displaying them on the screen without any input from the CPU.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •