<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 20 Nov 2009 20:35:00 +0000
From   : mfirth@... (Michael Firth)
Subject: Is there a 65Tube-style BBC emulator

michael.firth@... wrote:
>> -----Original Message-----
>> From: 
>> bbc-micro-bounces+michael.firth=bt.com@... 
>> [mailto:bbc-micro-bounces+michael.firth=bt.com@...
>> .uk] On Behalf Of Steven Flintham
>> Sent: 20 November 2009 16:42
>> To: bbc-micro@...
>> Subject: Re: [BBC-Micro] Is there a 65Tube-style BBC emulator 
>> available forLinux?
>>
>> On Fri, 2009-11-20 at 16:20 +0000, michael.firth@... wrote:
>>     
>>> Years ago (around 15!) I wrote a very primitive BBC emulator in C,
>>> which I think might actually match your needs.
>>>
>>> It does a basic 6502 CPU emulation, and emulates the OS calls enough
>>> that BBC Basic can run, but (for example) OSWRCH just maps onto
>>> "putchar", rather than doing anything clever.
>>>
>>> If you (or anyone else) want a copy, let me know and I'll put it
>>> somewhere it can be downloaded.
>>>       
>> Hi Michael,
>>
>> That sounds pretty good. If it's not a problem for you to upload it
>> somewhere I'd certainly like to take a look. I actually 
>> started writing
>> something similar myself when I was at university, but I don't think I
>> ever finished coding up all the instructions and I don't know 
>> if I could
>> still find it anyway.
>>
>>     
> I've uploaded it to:
> http://www.firths.org/bbc/bbc-emu.tgz
>
> Mine was written just after I'd finished Uni, when I was still enthusiastic
about writing C code in my spare time!
>
>   
>> At the risk of looking a gift horse in the mouth, how well tested was
>> your 6502 emulation? Did you run much stuff on it?
>>
>>     
> The emulation wasn't that well tested at the time, but I've actually fixed 
a fairly fundamental bug with it this year, which means I think its at least 
usable (previously it was putting the address bytes on the stack the wrong
way around for a JSR, which worked for a standard JSR/RTS, but not if code
tinkered with its return address)
>
> It works well enough for BBC Basic 2 to run, and if you connect a BBC Micro
to a serial port on the Linux system, then the test app "Sphere" (included
in the distribution) runs, and gives the expected graphical output on the BBC.
>
> If you find any issues let me know, and I'll have a look at what's going on.
>   
Apologies to anyone who downloaded the archive I uploaded earlier, there 
were a couple of problems with it.

Firstly, the "sphere" test program was corrupted (it seemed to have been 
through an ASCII mode FTP at some point in its life, stripping out all 
&0Ds, which isn't good for a BASIC program), I've replaced this with a 
fixed version (which was already in the archive as "sphere2". Also, 
there was some debugging left in in the OSFILE support, which I've now 
commented out.
Finally, Ed Spittles pointed out that there was still a problem with the 
JSR/RTS handling,
I've applied his patch to fix this.

I've uploaded a new archive with these fixes in, but it looks like there 
are still some issues in the 6502 emulation, particularly a lack of 
handling the wrap correctly with zero page indirect accesses.

I'll try and rediscover how the code operates enough to fix some more of 
the problems in the next few days.

Regards

Michael
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>