Sunday, 20 May 2012

In Which We're Ready For Our Close-Up


One of the things I love best about the scientific rigour and precision of software engineering is how, sometimes, magical things happen. I don't mean that as a metaphor for 'amazingly cool things', although I usually do mean it in that sense - but in this case, I actually mean it in terms of 'weird shit I can't explain'. Like the other day, when I spent two smegging hours trying to find a fault in a simple bit of code that highlights numbers in inverse-mode on the screen, and eventually gave up because I was going around in circles getting nowhere. I committed the code to Subversion, and went and did something else. I kept mulling it over in my head though, trying to see where the error could be occurring, and in the end I decided I must just be missing something stupid because I couldn't find any logical flaw with what I was doing.

The next day I fired-up the development environment and bashed a three-line test into the code to intercept the routine and give me a breakpoint to start laboriously tracing from. A fast DASM cycle later, and VIC++ is running with my test in place - and working faultlessly. WTF? So I quickly re-assemble without the test (this wouldn't be the first time I've had a bit of code where crossing a memory boundary has caused a glitch) and run it again - the code is now back to the state it was in to begin with - and it STILL works faultlessly! At this point, I concede that the Universe is infinite, and being infinite it must have room for infinite possibilities, and somewhere there must be a place where the possibility that magic works has proven true, and sometimes the possibility arises that some of that magic strays across the vastness of the Deep Black and interacts with the various bits of carbon and silicon on this little rocky ball, and code that was Definitely Not Working before is then wonderfully transformed into code that Works As Expected now.

Like I said - weird shit.

Anyway, cursor movement appears to be working nicely, there's been quite a lot of tuning and tweaking under the covers, and I've given the visuals a bit of a makeover to highlight the fact that the system is now actually quite close to doing something useful - i.e. being able to accept keyboard input and do things in response to it. Accordingly, we've gone up a minor point release, because the code is starting to look a little bit like an operating system rather than just a loose association of interesting utility routines.

So it's demo time. Here's a short video showing the power-on sequence and 'start-up' screen, for various memory configurations. The last two show a standard VIC-20 XVIC start-up with all blocks populated, followed by VIC++ with the same memory configuration - check the 'Bytes Free' number and contrast with VIC++ and - if you're bored - compare the start-up times (VIC++ is about half-a-second faster to start even though it's testing and using all memory blocks). :)

Whilst you're looking at that, I'm going to get keyboard-scanning working.

No comments:

Post a Comment