Author |
Topic: BBC Emulators (Read 1755 times) |
|
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
|
|
|
|
|