Tuesday, 12 January 2016

I was thinking about the implementation of VTL-2.


One thing that dawned on me was that the monitor and VTL-2 won’t share much code , except the Maths routines – VTL-2 will have its own i/o routines with proper scrolling rather than the rolly-to-the-top thing I have now.

VTL-2 will not have the requirement to operate with 128 bytes of RAM minimum (as the Monitor uses about 60 bytes, and the stack probably 20 or so , this doesn’t leave a huge amount of memory).

This is a problem for the random number generator ; out of all the routines, this is the only one that uses a fixed memory slot, 2 bytes (at $C1E) which is the current seed, the only static value in the mathematics routines. If I use this, I am beholden to the memory layout in the monitor.

So, I’ve decided to simply cut the routine altogether and replace it with an Integer -> ASCII routine which won’t have that problem – like the other routines it communicates via the stack and P1.

I could’ve passed a pointer to the seed in, but that just seems messy.

This might mean I have to lose the beep on start up, or the text message ; I can live without those .... just. Surely a beep is mandatory in a retrocomputer.

No comments:

Post a Comment