Author |
Topic: BBC Emulators (Read 1753 times) |
|
GordonSweet
Developer
member is offline


Posts: 23
|
 |
BBC Emulators
« Thread started on: Oct 22nd, 2008, 09:51am » |
|
I post this thread based on the way Richard prefers this forum to be used for subjects of minority interest, rather than use the Yahoo one, and he of course prefers BBC4 W to be treated as a serious language, rather than another BBC Micro emulator.
I am wondering if as a there is a way of using a ROM image copy of the 6502 OS the same way BBC emulator as a Library or DLL with BBC4W. That way the door would presumably be open to use more of the code originally used on the original BBC
As a one time owner of many BBC Micros, many being offered for as little as £1 at our Radio Club Auctions, and probably still holding a number of the 6502 chips in my collection, I presume there should be no problem of copyright to using a ROM image.
Gordon
|
|
Logged
|
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: BBC Emulators
« Reply #1 on: Oct 22nd, 2008, 1:59pm » |
|
Hi Gordon,
I presume this relates to your desire to run 6502 assembler programs, since virtually everything else is already provided in BB4W.
To reiterate what has been said many times, BB4W is NOT an emulator - it does not try to be a "BBC computer on a PC", and does NOT emulate the processor of a BBC computer. It is a programming language which tries to provide the same facilities as BBC Basic provided when run on a BBC computer (plus a lot more).
In principle, it would be possible to write an add-on for BB4W that could translate 6502 assembler into 6502 machine code (i.e. convert the mnemonics into 1's and 0's), but since the CPU couldn't do anything with them, it would be a complete waste of time. What YOU want is code that would convert them into 80x86 machine code, but since there isn't anything like direct equivalence of the instruction set, that is a forlorn hope!
Using a ROM image still wouldn't get round the problem that the (80x86 family) processor running the computer won't recognise the machine code instructions designed for a 6502 processor, so you are always going to be on a loser on this one.
The only way you are going to be able to run 6502 machine code on a PC is to use an EMULATOR, which is a software (virtual) computer designed to behave like a BBC computer. such programs exist, but BB4W isn't one of them!
Best wishes,
D
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BBC Emulators
« Reply #2 on: Oct 22nd, 2008, 2:25pm » |
|
Quote:I am wondering if as a there is a way of using a ROM image copy of the 6502 OS the same way BBC emulator as a Library or DLL with BBC4W. |
|
As a general rule, the reason BBC Micro programs don't work is not lack of OS support but lack of CPU support. That is, the issue is not that the 6502 MOS is missing, but that the 6502 itself is missing! So (putting to one side that the 6502 MOS would need a 6502 emulator anyway) incorporating a ROM image wouldn't really achieve anything.
Richard.
|
|
Logged
|
|
|
|
GordonSweet
Developer
member is offline


Posts: 23
|
 |
Re: BBC Emulators
« Reply #3 on: Oct 22nd, 2008, 5:44pm » |
|
Thanks Richard and DDRM. It just shows my ignorance.
Gordon
|
|
Logged
|
|
|
|
Gareth Lock
Guest
|
 |
Re: BBC Emulators
« Reply #4 on: Oct 23rd, 2008, 7:12pm » |
|
OK... So BB4W understandably is not an emulator, nor should be.
What would be handy though, for me at any rate, coming from BBC BASIC under RISC OS would be a DLL that implemented the simple OS calls such as OS_File 17 (Check for existance of a file.) and OS_File 5 (Return the size of a file in bytes.) without having the extra overhead of API calls being directly exposed to the programmer. I'm sure there are other simple ones like this too, but I can't think of them at the moment.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: BBC Emulators
« Reply #5 on: Oct 24th, 2008, 09:00am » |
|
Quote:What would be handy though, for me at any rate, coming from BBC BASIC under RISC OS would be a DLL that implemented the simple OS calls such as OS_File 17 (Check for existance of a file.) and OS_File 5 (Return the size of a file in bytes.) without having the extra overhead of API calls being directly exposed to the programmer. |
|
Is there a particular reason why you want this to be a DLL, rather than a BASIC library? In terms of being "exposed to the programmer" I would have thought a simple library would be sufficient to hide the code away from view.
Code:
DEF FN_fileexists(file$)
LOCAL dir%, sh%
DIM dir% LOCAL 317
SYS "FindFirstFile", file$, dir% TO sh%
IF sh% = -1 THEN = FALSE
SYS "FindClose", sh%
= TRUE
DEF FN_filesize(file$)
LOCAL dir%, sh%
DIM dir% LOCAL 317
SYS "FindFirstFile", file$, dir% TO sh%
IF sh% = -1 THEN = 0
SYS "FindClose", sh%
= dir%!32 The usual caveats about such things apply. FN_fileexists only tells you that the file existed a short time ago; it might have been deleted by another application before you get a chance to open it. FN_filesize only works correctly if the file size is less than 2 Gbytes.
Richard.
|
|
Logged
|
|
|
|
JGHarston
Junior Member
member is offline


Gender: 
Posts: 52
|
 |
Re: BBC Emulators
« Reply #6 on: Aug 6th, 2010, 2:42pm » |
|
on Oct 23rd, 2008, 7:12pm, Guest-Gareth Lock wrote:What would be handy though, for me at any rate, coming from BBC BASIC under RISC OS would be a DLL that implemented the simple OS calls such as OS_File 17 (Check for existance of a file.) and OS_File 5 (Return the size of a file in bytes.) |
|
I wrote generalised versions of libraries I previously used on BBCs and RISC OS to provide the same functions on Windows to do exactly that. For instance, mdfs.net/blib/Generic/FileIO provides the same FNfile(), PROCgpbp(), FNargs(),etc. calls so preexisting code that did, for instance, filetype%=FNfile(path$,5) (which called OS_File 5) or PROCgbpb(out%,write,mem%,num%,ptr%) would perform the same function on Windows.
I think Gordon would make his own life easier if he stopped insisting on refering to some imagingary product called BBC4W, as it's making him think he's using a BBC for Windows, rather than BBC BASIC for Windows.
|
|
Logged
|
|
|
|
GordonSweet
Developer
member is offline


Posts: 23
|
 |
Re: BBC Emulators
« Reply #7 on: Aug 6th, 2010, 5:29pm » |
|
Quite correct. But you must accept there are many Amateur programmers like me who delight in the way BBC4W is able to still run many of the hundreds of original BBC Programs. Though the resulting graphics and sounds pale compared with the full capabilities of modern software, the results are often amusing if only for sentimental reasons.
For example not everyone is capable of understanding fully the capabilities of BBC4W. But can see by the success I have had in producing a variety of free software available from my site mostly using BBC4W, and the way a number of distributors have been keen to host much of it. It is obvious many of those continually downloading my efforts take very little interest in any expertise or technicalities of HOW the software is produced, only in the end results.
|
|
Logged
|
|
|
|
|