And now for something completely different
Friday, 17th November 2006
A long time ago I thought I'd try my hand at this emulation malarkey.

The hardware is the Z80-based Sega Master System and Game Gear.
Due to the design, it was a huge, messy, poorly written series of hacks that could just about produce the above result if you didn't breathe too hard.
After finding this document, I had a bit of a blast at rearranging the Z80 core and timing the video hardware a bit more correctly. Here's that old Fire Track project:

All this does is run the emulation for 100 scanlines on a Timer's tick, hence the low reported clock speed.

The Game Gear's LCD cropped the output screen, so you wouldn't see the junk to the sides of the display here.
My implementation of the VDP doesn't support sprites yet.
Of course, these are the most exciting screenshots:


Two versions of ZEXALL, one that displays the results on the SMS screen, the other in an SDSC debug console.
One day I shall purge all of these CRC errors. One day! But not now, as I don't have the time to put any work on this (I stole a couple hours for the above), and in spare time (hah!) I should really focus on the Latenite software. Which, whilst it doesn't provide such pretty screenshots, is a great deal more useful.
Text mode graphics and help file indexing
Monday, 6th November 2006
In light of the TMDC, I thought I'd package up the .NET class for easy text-mode graphics I'd been throwing together.
Once initialised, all you need are two things; the Graphics object it provides to handle your drawing, and the Refresh() method to update the console with whatever it is you've been composing.
It relies on a fairly large palette (128KB) which is hugely wasted in the current version - it maps every 16-bit colour value (R5G6B5) to an attribute/character pair. For the purpose of not looking extremely ugly, the palette provided only uses a few basic characters, not the full range, hence that 128KB could be reduced somewhat.
If you want to provide your own palette, it's just a sequence of two byte pairs (character then attribute) for each of the 16-bit colour values.
You'll need to compile with the unsafe flag set.
Download VC♯ project (with a quick-and-dirty sample program - an oldschool flame that spins around, some curves and some alpha-blended text). ClearType does make the text look a bit odd.
// Set window to 80x50 TextSharp TS = new TextSharp(80, 50); // Set window title text TS.Title = "TextSharp Demo"; // Set up some pleasant antialiasing/filtering TS.Graphics.SmoothingMode = SmoothingMode.HighQuality; TS.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; // Now use the Graphics object like any other TS.Graphics.Clear(Color.White); TS.Graphics.DrawLine(Pens.Black, 0, 0, 80, 50); // Update console window TS.Refresh();
The document browser progresses (slowly) - it now exports and imports to/from a single file (the .docpack) and has a nifty search-as-you-type index.

Why is it that all you need to do to solve all your .NET WinForms woes is to make the control invisible then visible again? When clearing/adding large numbers of nodes to a TreeView control, you get a dancing scrollbar that pauses the app for a second or so - make the control invisible then visible again and it's instant. (This is using Clear and AddRange - it's not as if I'm adding them one-by-one).
Documentation
Monday, 30th October 2006
This is a standalone application I've been sporadically working on which will be bundled with Latenite, but is perfectly usable away from it.
It's a plugin-extendable document browser. You can use it to manage a library of documents and display them in the tabbed browser on the right. It comes with plugins supporting text files, Rich Text documents, and anything IE supports (so in this case it's HTML and PDF).
I've also wrapped the XP Picture and Fax viewer as another plugin, but am having a few problems with that so I'm not sure if I'll end up writing my own image viewer. Multipage TIFFs would be nice, though.
Plugins can expose their own toolbars - hence the text file has a dropdown button with a list of encodings, which has been very handy for those hundreds of DOS text files I have knocking around.
The library is stored in an XML document, and I'm intending on devising a format for easy distribution of documentation - probably something as simple as a Zip archive containing the relevant files and a small XML document that can be merged with the main library one.
Two nifty links, if you didn't know about them already - famfamfam's glorious "Silk Icons" set and the oh-so-useful SkyBound Visual styles (notice how my tabs on the left of the screenshots render correctly, even though they're upside down).
It lives..!
Wednesday, 25th October 2006
Thanks for the support, MrEvil, and thanks for noticing my rather dead tutorials section, linkofazeroth. ![]()
Sadly, I've been horribly busy recently - and so very little progress on any project. However, Brass 2 is starting to come together...

Can you guess which device the code is for?
Well, it'll never be an IOTD, but it's something. With the syntax fixed, it does actually work (and outputs a valid binary). I've been trying to work out the syntax used (with valuable input from CoBB over at MaxCoderz). Currently it operates by loading the entire document, trying to work out what each "command" is, before running it and executing the various commands. This has one big problem I can see - macros won't work, as they need to operate on the tokens before they're executed. This is fine, but to declare a macro you'd need to use, for example, a .define directive - which doesn't get executed until long after the source has been loaded and broken into tokens, expressions and commands.
Lack of macros and a horribly incomplete Z80 assembler plugin mean that so far I've been unable to test alongside old calculator Z80 source.
Latenite and Brass 2
Wednesday, 11th October 2006
Both Latenite and Brass are getting a significant upgrade - and both are being written from scratch.
Both will sport a plugin-based architecture. This is most obvious with Brass - where pretty much everything - be it an assembler plugin or output plugin - can be extended by writing your own custom plugins. All Brass does is parse the basic syntax and pass it to the various plugins to work out what to do with it!
Latenite will load Brass and use it to provide feedback - such as error reporting and syntax highlighting - directly to the user.
General discussion is handled here; for what I mean with regards to Brass plugins, there's this post.
The basic idea is that you can plug in your own assembler and use it alongside Brass and Latenite.


