Menu

Sprites

Sprites, or MOB as they are called in the VIC specification, are really fun. I wanted to post a small video about my progress, but I haven't figured out how to do that. I can't say that everything is in place just yet but now I tested with sprite 0 (the 7 other sprites should work but not yet tested) and it works. I have only implemented this in one-color mode for now, multicolor is to be fixed at a later point.

What came to my mind was that the x-coords doesn't work properly - the first x-coord on screen should be 24 but in my system it is 20. I think I have figured out why. In the VIC-II, the raster counter is updated in 8MHz but the system clock is 1MHz where the CPU and VIC shares every system clock cycle. Both of them access the memory one time each, so from the memory point of view you can say that the system clock is actually 2MHz. So when the data from the memory is available, the x-coord has been updated 4 times.

In my system, the system clock is 25MHz, but only the first 8 clock cycles are available to the VIC and CPU, in practice 8MHz. I also have a 1MHz pulse that tells the VIC when to be active (described in an earlier post) but the thing is that the memory is avalable already at the first clock cycle, the x-coord never changed - hence the 4 pixel discrepancy. So - a bug which I have to fix, and an explanation to why the x-coord is not correct. I suspect this bugfix will be hard to address but it will be done eventually.

The list of things to do is growing, and I also postponed some of the things to get time to do funnier stuff;

  • Some kind of high level design specification... Have to do, but it's not as fun as code.
  • SDRAM module - to get the border area into the VGA video memory. The memory inside the FPGA is not sufficient.
  • Update the debug module to be able to download assembler code, and maybe even BASIC. The only thing in the debug module that's currently working is the keyboard handling. I made some code in a testbench to load HEX-files, so it shouldn't be too hard to implement similar code to the system.
  • Add a PS/2 keyboard. I know how to do, so actually it's just start and fix. Not very fun though.
  • Learn how to make assembler code in the 6510. I mean - I know the assembler stuff like mnemonics and such, but I have to learn a compiler.
  • The x-coord bug mentioned above.
  • A lot of TODO's in the code.

So now I just have to decide what to do...

Posted by Fredrik Beckman 2018-09-28

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.