Z80 Computer Part 21 - VRAM Memory Map
HTML-код
- Опубликовано: 10 сен 2024
- I need to make some adjustments to the memory map and associated glue logic circuits to incorporate an 8K video RAM into my system.
I start by looking at both the existing and new memory maps. I explain the required circuits to make it work. I then show a small Z80 assembly language program to test the video RAM, and final I show the program running.
what an adventure! i wish I could dedicate as much time to my own z80 pc. i very much want to build a z80 pc.
Hey Steve, if you would avoid needing to read from video ram (by the cpu that is) you could make the video ram make write only and have it parallel to the read only rom and can have 32k vram AND 32k rom
Yes it's a good idea and something I have thought about. There isn't really that much need for the CPU to read from video RAM. We also never need to write to ROM. However from my memory of making games on the Z80, I would often read from video ram to know what was on the screen at certain points. Usually for collision detection of the player. That would make me think I would need to retain a duplicate of the screen data in normal RAM. It is a nice idea though. There are a lot of scenarios where we never need to read from Video RAM.
@@SteveRaynerMakes yes I thought about this too, but doing collision detection this way is very time consuming and if you do paint you sprites and background bitmaps all on one plane you probably would want to read back from vram anyway for proper masking. For fast flexible game graphics in an 8 bit system I would either implement at least two independently scrollable layers: background probably as tiles/multicolor text like the c64 but double the resolution and a color bitmap overlay where I paint my sprites without having to extensively mask out existing graphics at the same time. Colission detection can now be done by the layer compositing logic of the video circuit which can capture the bitmap counter position if both bitmap and background have pixel values than 0 (or any other value in a comparison register - depends on the complexity one would like implement)sprites to sprite colission can be detected while writing to the vram by reading the value first in an register (done in hardware) and comparing the byte to be written with the old one. If bits are different and different from 0 it would be a collision. Both would trigger an interrupt where the game could do its thing then.
@@0toleranzalready before the NES games actually had a background. This made the collision detection in C64 useless. This is why you need a z ordinate or even two playfields. Z can be encoded in the palette, but I hate palette. Give me RGB 332 direct cokors.
Z buffer in n64 is on a different page to not slow down Video DMA. On Jaguar it is on the third phrase.
I propose deferred rendering. First draw each sprite into one of the 8 bit per pixel and check for collision. Then replace with the winner sprites color. Can even do translucency or “shadow sprites”.
Another way of mapping the video ram is to put into the i/o space. The Z80 effectively has 6kBb of i/o space since it puts the B reg on the top 8 bits of the address, so you can think of it as 256 pages of 256 bytes, You can also copy data to it using the OTDR instruction and similar which is pretty fast.
This would have been cool to use on the 8088 to address palette entries or sound channels.
Very nice craftsmanship!
thanks
any more robots? quite like the one you made 2 years ago
It's still there. I just need to motivate myself to continue working on it.
Hi, I'm writing to you because I bought a box with thousands of components in a flea market, I understood that there was something good in the middle. in fact I managed to find different versions of the z80, as well as intel 8041,8085,8088,8086, ram, rom, eeprom, plus hundreds of TTLs as well as thousands of transistors, capacitors, .... etc. I wanted to know if you could help me choose the best versions of components and build a computer from scratch. It has always been a passion of mine. If you want I'll send you photos of the components I found, I'm cataloging them.. I hope you can help me, thanks...
That sounds like an awesome pick up. I would love to build computers based around all of those ICs. Unfortunately I know next to nothing about the 80xx series of CPUs. That's one reason I went with the Z80, because I had some past experience. My advice would probably to start small with something simple. Try to find an existing project design that you can copy. If you have any specific questions I would do my best to try to help. But bear in mind my knowledge is probably not that much better than yours. If you go to my channel page and click the little arrow to expand the description you will see my about page where you can view my email address. Feel free to drop me an email.
RUclips would be so boring without your videos