How do you make a QL emulator?

Discussion and advice about emulating the QL on other machines.
User avatar
XorA
Super Gold Card
Posts: 646
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: How do you make a QL emulator?

Postby XorA » Wed Feb 19, 2020 8:49 pm


an extremely large penis



Wait if I learn JavaScript it comes with benefits?


User avatar
vanpeebles
Commissario Pebbli
Posts: 2459
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: How do you make a QL emulator?

Postby vanpeebles » Thu Feb 20, 2020 9:30 am

Yuck! Java ! Bllurrrrrggg!


User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Thu Feb 20, 2020 5:15 pm

I agree about Java, and the coffee of that same name.

I had to write a parser in Java, I hate it.


Cheers,
Norm.

PS. I suspect you know, but, Java <> JavaScript. ;)


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
Pr0f
Super Gold Card
Posts: 703
Joined: Thu Oct 12, 2017 9:54 am

Re: How do you make a QL emulator?

Postby Pr0f » Fri Feb 21, 2020 7:39 am

But the mobile phone companies love it - they even have Java VM's in the silicon to process the code 'natively'.

I own a couple of TINI boards from Dallas Semiconductors - these use Java so I had to try and learn the language to use them. Inheritance - like inheritance - like inheritace... ;)


User avatar
Ruptor
Trump Card
Posts: 205
Joined: Fri Dec 20, 2019 2:23 pm

Re: How do you make a QL emulator?

Postby Ruptor » Fri Feb 21, 2020 10:48 am

I see from the discussion you guys have used lots of languages. If I wanted to write an app that uses a serial port or wireless and could run on any device what language should you use? The app is not time critical it is just for set up purposes like a remote control and bare in mind I have a brain the size of a pea so learning a complex language is not an option. :?

If an RPI is booted as a QL emulator how would anybody know it was not a QL wasn't really answered. Is it because you need to do things in Linux outside of the emulation to keep the system running? I can't see any problems since it is the same as any embedded program that uses a particular processor for its own ends.


User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Fri Feb 21, 2020 4:11 pm

Afternoon Ruptor,

Ruptor wrote:I see from the discussion you guys have used lots of languages. If I wanted to write an app that uses a serial port or wireless and could run on any device what language should you use? The app is not time critical it is just for set up purposes like a remote control and bare in mind I have a brain the size of a pea so learning a complex language is not an option. :?


Like many things, the answer will have to be "it depends". You say that it isn't time critical but serial comms does rely on almost precision timing at both ends. However, to run on "any" platform, I would probably stick with vanilla C as opposed to C++ or Go or Assembly (!) etc. There are plenty of useful C libraries to facilitate serial comms and networking - I'm half way through a "revision" of a book on the very matter - "Network Programming with C". The libraries are well tested and well used and reasonably easy to use.

If, by "any" you include iPhones/iPads <hack, spit> or Android phones/tablets etc - maybe you might have problems. As far as I know, Apple coding is done in C (or something similar - happy to be corrected) while Android is usually Java - but can be C or even Python or HTML.

It's probably not possible to run the same program unchanged (in the source) on many different platforms - there would need to be some fiddling, usually at low level, to get screen handling etc consistent - unless, of course, somethings like QT was available on all the platforms. That's a pretty good cross platform development system (C++).


Ruptor wrote:If an RPI is booted as a QL emulator how would anybody know it was not a QL wasn't really answered. Is it because you need to do things in Linux outside of the emulation to keep the system running? I can't see any problems since it is the same as any embedded program that uses a particular processor for its own ends.


To all intents and purposes, the emulator is running on a 680xx processor on the Pi. But does that processor emulate everything that the hardware does? I know not. How I would know which machine it is running on is relatively simple, after booting up, I would do something like

Code: Select all

PRINT MACHINE, PROCESSOR


and see what I got back. Check out https://superbasic-manual.readthedocs.i ... chine.html for details of the MACHINE command. Also, the PROCESSOR function would tell me about the particular processor (or emulation) I was running on - https://superbasic-manual.readthedocs.i ... #processor.

Does the software care? I suspect not - unless it's specifically looking for a certain processor type etc.

HTH

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
User avatar
Ruptor
Trump Card
Posts: 205
Joined: Fri Dec 20, 2019 2:23 pm

Re: How do you make a QL emulator?

Postby Ruptor » Fri Feb 21, 2020 9:11 pm

Hi Norm
From the previous discussions I thought someone would just say Python or Javascript that seemed like the choices. :roll: The app on computer or phone is only going to be used to set parameters on a piece of hardware & start or stop it. I want one app that runs on any platform so there is only one copy or is that still not possible after 50 years of computers? Python sounds like it is the simple one but I have no idea hence the question. :|


User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Fri Feb 21, 2020 10:42 pm

Hi Ruptor,

for the vast majority of the last 50 years, computer manufacturers made sure that only their software ran on their machines. As far as possible. Even on systems using the same processor, the operating system was different. Almost zero compatability.

Then came C. With libraries written for the host OS, the same source code could, mostly, be compiled for different machines. When I first started coding, C was how it was done. Even the QL had, for example, Emacs (yuk!), compiled from source. Pretty much unchanged - if I remember correctly.

QT, a C++ development system, wxWindows (changed to wxWidgets when Microsoft got stroppy), Fox toolkit etc, started to get seriously cross platform. I used QT for my QStripper utility and compile the exact same code, with no need for "#ifdef" etc, on Linux and Windows 32 and 64 bit, Raspberry Pi too. Easy. QT now also supports Android and I think, Apple kit too.

Then Java appeared. It is (or was/might still be) bytecode interpreted rather than compiled, but the same compiled "binary" runs on "any" platform and inside web browsers too.

Python is similar in that it is interpreted bytecode, even when compiled.

All these cross platform stuff needs OS specific bits to make them work on each different OS, but it's far better now than when I started. But it's still not perfect.

So, use the language that you know best, and which is supported on the platform(s) you are developing on, and which has the libraries/features to do what is needed. That should work.

HTH

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890
stevepoole
Gold Card
Posts: 342
Joined: Mon Nov 24, 2014 2:03 pm

Re: How do you make a QL emulator?

Postby stevepoole » Fri Feb 21, 2020 11:23 pm

Hi Ruptor,
Javascript is definitely easier to learn than plain 'C'.

I see you wrote << I wanted to write an app that uses a serial port or wireless >>.
I have never got deep into such applications. But from recent experience, Javascript (which writes out in HTML5) has disabled some of its functionalities, no doubt for security reasons....
For example, one program I wrote would read data from files on the device used, (via the internal network), in .json format. This was possible six months ago, but has been disabled by a recent browser update. A workaround is needed, if at all possible !

So I would imagine that serial port access to write parameters has also been disabled ?
Maybe it is possible from within 'C', but I do not know that language in sufficient detail to be able to advise....

Steve.


User avatar
NormanDunbar
Forum Moderator
Posts: 1227
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: How do you make a QL emulator?

Postby NormanDunbar » Sat Feb 22, 2020 12:50 am



Why do they put lightning conductors on churches?
Author of Arduino Software Internals - https://www.amazon.co.uk/Arduino-Softwa ... 1484257898, https://www.apress.com/gb/book/9781484257890

Who is online

Users browsing this forum: No registered users and 2 guests