EEA index
FileStore ExecutableSD card
Intro |
An E01S emulator!First, let's admit one thing. I have been ill recently. A nasty cold. Spells sitting on the bog for longer than nature intended. You don't need details. Now, I don't know if it is a whole lot of snot stuffed into my head and compressing my brain, or what, but when I find myself feeling like this, I usually get the thought of "gee, why don't I write an emulator" (and if that's not a sign of terminal geekiness, I don't know what is!). The Amélie emulator was written in bouts of feeling unwell (since, erm, 2003...). I have written an emulator of a Casio calculator (complete with a photo, press the keys!) but I don't know where the code for that is. In fact I was so muddled I'm not even sure I can remember what operating system it was for! I also once wrote an emulation of a 2K phone book databank thingy complete with fake Japanese messages! だめ! こんにちは!This year? Specifically April 2009. I began work on a FileStore emulator...
Like, um, why?Two reasons, actually. The first reason is because I have never actually written an emulator for a specific hardware device to run specific code on. I mean, Amélie is a 6502-based computer board to run my own BIOS and firmware, but the problem is that it is my emulation of a 6502 as I understand it, and it is my firmware coded for the 6502 as I understand it. Which may not match reality. Let me give you an example. It would be trivial to 'decide' to word-align the 6502 opcodes to make debugging easier. While I am there I can add a few 16 bit operations (although the 6502 cycle for cycle can already kick a Z80's butt). Oh, and an instruction to swap X and Y. No reason, except it looks like it is missing one. All good and well... until I run the code on a real 6502 and it crashes after a milli-microsecond...These are all radical examples, but it is possible that I have misunderstood some tiny little nuance, like what exactly Carry does in SBC and then write the firmware based upon this error, and the (incorrect) firmware will work fine on the (incorrect) emulator... ...so it will be a refreshing change to implement a system (correctly or otherwise!) which will be running code from someplace ELSE. The firmware is correct. It may not be 100% bug-free, but we have the definite advantage of:
The second reason is because I would like to add a harddisc to my FileStore. No real reason really as I don't exactly use the FileStore much nowadays, but I have a suspicion that there are a number of people who would be eager to have some options with their own FileStores.
Can the FileStore access an entire ~200Mb drive? If not, why not? SIN limitation? Can we partition it, or will we need to section off a bit and 'pretend' the rest does not exist? Can we be flexible in what harddiscs we will work with? The FileStore apparently has some level of notoriety for being overly fussy about what it will accept - why? limitations in hardware? limitations in software? or both? I really do not expect to whack in a 64Gb SCSI-3 drive. Don't get me wrong here. But do be aware that the world has more than enough good SCSI-1 drives in the range of 200-600Mb. The specific correct 20Mb and 40Mb Rodime drives are somewhat thin on the ground, and actual proper Acorn-formatted ones are, frankly, non-existant. It seems to me to be stupid verging on annoying for a piece of functional hardware to be limited in such a pointless way. Why can't I locate an old original-SCSI disc, plug it in, and have some sort of useful result? This is where the emulator comes in. For I fear it will be a case of hacking the hell out of the firmware... There is a third reason: why not? There are a number of emulators for more common 6502-based machines - the Beeb, the AppleII, even the Oric.
Why not amend an existing emulator?This might have been a possibility, to tweak one of a number of BBC Micro emulators or ask the relevant programmer(s) if they would be interested.This is indeed possible, but may not be viable, for a number of reasons. Firstly, I am not aware of a Master Compact emulation on any of the current emulators. Fair enough, what a Compact can do, a Master can do better. However it shows that there is perhaps not enough call for specific emulation of one of the less popular machines. Now let's look at the FileStore. It was written by Acorn. It's heart is a 65C102 (which I think is close enough to a 65C02 to pass). It contains a VIA. It contains an ADLC. Ummm... That's it. Sorry. While there are numerous BBCisms in the firmware, like OSBYTE and such, this is of little relevance to the emulation.
Shall we look at the differences now? 64K EPROM copied into 64K RAM, EPROM then mapped out. Expects two floppy drives and perhaps a harddisc. NVRAM, same as in the Master or not? [I'll need to check this] No output, no VDU, just a printer port. All hardware is memory-mapped in page &FC (aka FRED in BBC parlance). It's a 2793 FDC as opposed to the 8271 and 1770 variants used in the eight bit machines. In order to aid in screwing around with the firmware, it might be useful to have a 'window' on the status of the hardware, disassembly, memory editor, etc. Most 6502 simulators have this functionality, but it is not common on emulators. So, therefore, I figured the best option was to try to "roll my own". And I invite you to help me. Join in! Download and hack away! Let's get this thing built! ☺
State of playThis emulator is written in Visual Basic.Okay, you can stop laughing now. I wanted to concentrate on the task of writing the actual emulator, without wading though the multiple screenfuls of crap required to get a Windows program written in C to do anything at all. Sure, it would be so much easier in C - for a start VB (up until .Net?) does not have any way to binary shift. You need to mul or div by two for each bit shift which is bordering on the retarded. Anyway, we aren't in this for speed. We aren't here for zippedy-dodah. We aren't here to run some fussy hardware-beating retro game. In fact, I am going to have to concentrate long and hard on making the disassembler, breakpoint, and debug tools be friendly and useful, for I suspect we'll be there a lot. So the CPU runs 2,000,000 cycles (one second) in around 4 seconds (450MHz CPU). SO WHAT? To know in more detail what the emulator can and can't do, refer to the sources, the versions log, or download it and try it!
|