Another chapter on C64, explaining how to synchronize the CPU with the raster position, creating a 'stable raster'. And some gratuitous raster bars of course:
http://scalibq.wordpress.com/2013/03/15/just-keeping-it-real-part-9/
Posted on 2013-03-15 19:25:05 by Scali
And another update: http://scalibq.wordpress.com/2013/03/20/just-keeping-it-real-part-10/

This time I explain how to extend the mathematical capabilities beyond just 8-bit addition and subtraction, and how to implement a multiply and divide routine, since the 6510 CPU does not have these instructions in hardware.
Posted on 2013-03-20 08:49:31 by Scali
Working on another blog, with more advanced mathematical trickery.
It's fun to brush up on your maths this way... and a nice reminder of just how limited those early machines were. How you'd need to start at the most basic things like implementing mul and div, and add/sub/shift/compare for numbers of more than just 8 bits.
Makes those C64 demos and games seem all the more hardcore. Just like all those other early 6502 and Z80 systems from Apple, Atari, Commodore, Nintendo, Amstrad etc.

And it seems to be somewhat of a forgotten art. Even on codebase64.org there is no actual explanation of the few math routines that are posted there. They may date back to the late 70s for all we know, having been improved and finetuned bit-by-bit over the years, until nobody remembered where they came from anymore, or what ideas are behind it exactly. I hope I can uncover all that in my upcoming blog.
Some pretty clever programming in there, that's for sure.
Posted on 2013-03-22 14:48:26 by Scali
And here it is: http://scalibq.wordpress.com/2013/03/24/just-keeping-it-real-part-10-1/

Some nice trickery to get more precision and more performance out of the venerable old 6502.
Posted on 2013-03-24 08:36:52 by Scali