Since finishing the bitmap mode, I've been experimenting with a few other features for the project. These are mostly unfinished and still being tested, and I wouldn't count on them to work as is in the code. For reasons I'll explain later, I don't know at this point if these ever will be completed.
The first feature I worked on implementing for a while is a affine transform background layer. This layer takes over the memory spaces normally used for the two background tile layers, and creates instead a single layer of 128 x 128 tile layer, which can then be stretched, rotated, or otherwise deformed by multiplication by an affine transformation matrix. This feature was directly inspired by the Mode 7 graphics on the SNES, which can be used for various pseudo-3D effects. I wanted to see if I could make this work, and I figured it would be possibly useful for certain games and graphical effects.
The affine tile map is larger than the normal tile maps would be, and takes up the memory that both of them would. I did later figure out a more complex memory mapping that allowed one or two of the normal tile background layers to be used at the same time as the affine tile layer. This does come at the expense of using up most of the sprite graphics memory in the process, so I don't know how useful it would actually be in practice.
The affine layer can apply a simple rotation, scaling, or skew to the entire tile layer. In order to get a perspective effect such as what you'd need for a racing game, the affine transform registers need to be updated with every horizontal scan line. The SNES and similar gaming systems either use a dedicated DMA driven by the horizontal blanking interrupt, or interrupt-driven code in the CPU to update these registers as needed. I didn't have an easy way to implement this that would work easily through my BASIC interpreter.
Instead, I decided to try something more ambitious: creating my own custom bespoke coprocessor function in the FPGA. This is a somewhat unusual 16 bit custom purpose processor, intended to be triggered by various interrupt sources inside the FPGA to perform simple math and update affine transform registers as needed with every horizontal line. It also can update other registers such as the tile layer horizontal scroll registers for parallax scrolling, or the bitmap palette registers for increasing the limited color palette in certain bitmap modes.
The design of this started out as one inspired by the Copper function from the Amiga computer chipsets, but evolved into an actual CPU with its own internal registers and an actual RISC-like instruction set. It's still a somewhat odd processor. No stack, limited indirection ability, and it can only address the first 128 bytes of the FPGA's memory space, but it has dedicated instructions for multiplication, sine and cosine, even division and square root through lookup tables, as well as flow control instructions which cause the coprocessor to wait for specific horizontal lines or screen states before continuing.
Unfortunately, this feature is currently largely untested and probably unfinished, along with the affine transform background layer. I haven't had time to do any significant work on this project in about a year. Other projects and general life issues have been taking higher priority, and the homebrew computer project has been gathering dust on a shelf in my workshop.
Part of the problem has been the question that I've never been really able to answer, which is what this project would ultimately be for if it was ever really completed. I had some possible ideas about having a custom circuit board made, and putting it in a commodore-64-like case with a mechanical keyboard and everything, but that seemed like a lot of cost and work for a one of a kind prototype. I've even considered the idea of mass-producing and selling these machines, but quickly realized that supporting that effort would be far more work than I wanted to put in to this project. The operating system on the MCU is extremely kludgy and needs a lot of re-writing to be usable as an actual commercial product, and small run circuit board production is still pretty expensive. Besides, I'd just be in direct competition with existing, established products like the Commander 64.
I've also considered my original idea of putting a FPGA on a carrier board that can be plugged into a hobby breadboard 6502 computer to act as a GPU (and possibly other functions such as DMA, interrupt controller, address decoder, or other useful bits of glue logic). I even have some preliminary PCB designs with a FPGA and required support circuitry on a little PCB the size and shape of a 40 pin DIP chip that could plug right into a breadboard. This is still something I could pursue, if there was any interest in it. It would require a bit of redesign of the interface logic on the FPGA.
Other than that, this has been a fun programming project over the years, and has taught me a lot more about FPGA programming in particular, but it's on indefinite hold until I get inspiration to start working on it again.









