Yeah you will be able to fit it all into internal block RAM no problem as long as you keep framebuffers small since those tend to be the largest. Indeed taking baby steps is the way to go... But still getting a cheap FPGA devboard and just having at it with simple projects is the best way to start.
I think I'm going to make a start fairly soon with my Cyclone II. Yes it's old, but I should be able to get a VGA text display up and running, perhaps even with some basic graphics, in the short term. When the Spartan 6 (LX16) dev board turns up, I'll move development to that and start looking at the switch to HDMI and building out the resolutions a little further, with more work on the GPU side to flesh out the graphics capabilities.
As far as the
Intel MAX 10 series goes, I agree they're the probably the best I can get in a package that I am (and more importantly, others are) able to solder by hand. I'm thinking for the sake of another fiver (~$6), I'll get the 10M50 which has over 200 KB of RAM and should give me all the room I need to do what I want with the graphics and sound.
This leads me on to choice of a development board for the 10M50, though. Sheesh - they're not cheap for a hobbyist at my level! I've had a look at these two:
AliExpress DE10 Lite 10M50 CPLD Development Board with VGA - £74
AliExpress 10M50 Eval Kit with HDMI - £130
Now, out of the two I prefer the 10M50 Eval Kit - yes, it's nearly £50 more expensive, but it has less rubbish on it that I won't use taking up IO pins and it has an HDMI port built-in.
Anyone have any opinions on these or suggestions for alternatives?
...So the CPU here has very little work to do as its only running the game logic, updating positions of all enemies, changing coordinates of the layers to make them move in that sweet parallax way and commanding the bitlit to fill in the edges with more of the level as needed.
I guess there's no reason why the FPGA won't be a graphics co-processor and blitter in one device if I can build those functions into it. What was it, jhpadjustable? Agnus, Denise and Paula rolled into one?
Two notes as preface: 1. There are MOS 6581 IP cores available, which you can instantiate just like any other VHDL entity, hook up address/data buses, supply with appropriate clocks, and connect to the DAC of your choice.
Yes, I've found AY-3-891x VHDL code as well, so it looks relatively easy to sort out. It could just be consideration how I get that audio data down the line to the TV.
2. Back in my home computer days, sound programming was my specialty. Over the course I have developed some Opinions on this matter.
Ah, pull up a chair and have a beer. I may need to pick your brains later on when (if!) I get to the point of sorting out audio in VHDL!!
The Amiga sound hardware was remarkably simple, and it's worth considering as a guide. Each channel isn't much more than a period down-counter, an address up-counter, a sample length down-counter, and a few double-buffered latches. Being relatively insensitive to latency, a double-buffer for sample data allows you to take your sweet time reading the next sample(s) from memory and simplifies its integration into the system. Very likely you have hardware multipliers on the FPGA for volume control, AM effects, and so on. I2S is a standard interface to audio codecs and is pretty easy to use for just digital output: a continuously-running clock, a shift register, and a word (left/right channel) select is about it.
You make it sound so easy!
I can just about play the theme tune to Red Dwarf on a keyboard. There endeth my knowledge and skills on the subject of audio and music!
I2S? Audio codecs? Digital output? So I could output in MP3 or something?
You can use those block RAMs as FIFOs very easily (example user guides from Xilinx, Altera). You can stream the entire next raster line from the external RAM into them at the fastest pace it allows then deal with it locally according to the pixel rate, a la hierarchical memory. In fact, this allows you to decouple the RAM clock from the pixel clock which makes your job a lot easier, enough that you can incorporate existing DRAM/SDRAM/DDR controller cores to expand the framebuffer (or can we now call it "chip") memory without limit.
Okay, that's an interesting idea for when/if I get round to using external RAM (it'd make the FPGA choice a lot cheaper!) Set up a couple of pixel stream FIFOs in internal RAM and use the external SDRAM to burst-read into the one not being read from at that moment, so access to the external RAM would be in short bursts to read the contents, allowing the GPU to access it for data writes etc. in-between?
Eventually. Multi-playfields are largely about memory organization and bandwidth. One key is to decouple the pixel fetch start/stop timing, memory addressing, and row stride from the display window start/stop timing, so that the former can be moved around independently of the latter, and only require that the CPU redraw the columns/rows that would be revealed in the next frame before moving the pixel start address around. Another key observation is that Amiga etc. video memory was often planar-organized to conserve frame buffer memory and use the memory cycles allocated to the pixel data most efficiently. With bit planes being indexed, addressed, and fetched entirely independently, the addition of a dual-playfield mode requires no modifications to the memory fetching system, only a bit of steering logic in the pixel pipeline and a priority encoder to establish Z-index relationships. Have as many playfields as you like.
There's a heck of a lot of jargon in there I just don't understand - "pixel fetch start/stop timing", "row stride", "display window start/stop timing"... so much to learn. Is there a book on this stuff anywhere, or a website, or more YT videos? I have yet to sit down with some spare time and go through some of the linked videos in the YT links people have made in previous replies, though...
Understand that DVI transmitter cores are free available. I'm not sure about HDMI (maybe copyrights, but a public domain transmitter may exist), however when saying sound, this means whatever your sound generator generates, you would need re-sample convert any audio generated to the standard fixed 48Khz audio within the HDMI standard. Also, HDMI is YUV not RGB like DVI, so, you will also need a color space converter. (easy peasy as it is nothing more than 3x3 multiply adds...)
Just clear up a little confusion for me - DVI sort of equals HDMI? Would I be able to use an HDMI connection to a TV with a DVI IP core?
The colour space converter sounds like a simple bit of VHDL to add to the project, but what about the audio conversion? Are there IP cores for that sort of thing?
Also, on your video output mux output layers with translucent colors, don't forget to add pixel / sprite collision detection registers.
That'll come later, but yes I'll need to think about how to add collision detection etc.
You would never have to worry about external Dram access or memory interleave timing.
I do like the sound of that. It's just a high price to pay and I can see that I'll want to try to overcome the issues with external RAM so that I can use a smaller/cheaper FPGA.
...but realize you may need to use a byte write enable depending on how your CPU or graphics image processor may move individual bytes around for effects like fill, copy, clear and stencil.
Huh? Sorry, I don't follow. Could you expand on this a little, please?