I would donate - Porting SymbOS

Anything QL Software or Programming Related.
User avatar
bwinkel67
QL Wafer Drive
Posts: 1518
Joined: Thu Oct 03, 2019 2:09 am

Re: I would donate - Porting SymbOS

Post by bwinkel67 »

So the Workbench demo is just that zip file that I posted here. There is no project to create a Workbench-like GUI and unfortunately I don't have time to start that. I'm still not finished with ZXSimulator...maybe once I finish it I would look into going further with an actual prototype written in Digital 'C' SE (that's my favorite QL environment to code). I think it would be interesting just to create a workable mock-up of Workbench 2.1 to show all those Amiga users that it's not that impossible to recreate :-)

The ZXSimulator is not open source in the sense that it's a project that others work on. I did include the code so people can see an example of an interpreter in C (in the form of a recursive descent parser).


User avatar
Popopo
Gold Card
Posts: 393
Joined: Wed Apr 07, 2021 10:37 am

Re: I would donate - Porting SymbOS

Post by Popopo »

bwinkel67 wrote: Thu Dec 05, 2024 12:09 am So the Workbench demo is just that zip file that I posted here.
....
maybe once I finish it I would look into going further with an actual prototype written in Digital 'C' SE (that's my favorite QL environment to code). I think it would be interesting just to create a workable mock-up of Workbench 2.1 to show all those Amiga users that it's not that impossible to recreate :-)
So, May I take this code in Digital C and use it on my own to play around with it?
I want to do some "funny and crazy" projects (all OpenHardware & OpenSource) and yours is a beautiful point to start introducing myself in coding for QL. Why not?
If you allow me, I will take it and use it freely. Otherwise I will use another one to start with. That's fine and your work is magic itself and a great demo about how a GUI alternative would be for QL.

Of course, in case you allows me to do with the code any modification or distribute it as I please, I will mention you on it (credits).
Just I am afraid to use a code to work around and suddenly discover an author that claim for rights with all my effort falling apart (noway).

So, do you allow me?


User avatar
bwinkel67
QL Wafer Drive
Posts: 1518
Joined: Thu Oct 03, 2019 2:09 am

Re: I would donate - Porting SymbOS

Post by bwinkel67 »

Popopo wrote: Thu Dec 05, 2024 8:57 am So, May I take this code in Digital C and use it on my own to play around with it?
I share the code so someone can learn how to write a simple BASIC interpreter.
Popopo wrote: Thu Dec 05, 2024 8:57 am If you allow me, I will take it and use it freely. Otherwise I will use another one to start with. That's fine and your work is magic itself and a great demo about how a GUI alternative would be for QL.
You misunderstand, the Digitial 'C' code does not do anything with a GUI, it's just a BASIC interpreter. Again, the thing that implements the Workbench-like GUI is mostly QDOS with a small SuperBASIC program (below). That's the program you want to modify and it's written in SuperBASIC, so easy to understand:

Code: Select all

10 REMark Amiga on QL
15 MODE 4: PRINT #0,"Device? ";:INPUT #0,_mdv$
20 LET adr=RESPR(17396): LBYTES _mdv$&"tk2_bin",adr: CALL adr+1380
25 SPJOB 0,0,128
30 EXEC _mdv$&"WBLines_exe"
35 EXEC _mdv$&"WBBasic_exe"
40 INPUT #0,"At OK prompt write BASIC program, switch with Ctrl-C & enter to continue."; stop$
45 LBYTES _mdv$&"QLWB21_scr",131072
50 WINDOW #0,470,64,16,182: PAPER #0,5: INK #0, 0
55 WINDOW #1,470,64,16,182: PAPER #1,5: INK #1, 0
60 WINDOW #2,470,64,16,182: PAPER #2,5: INK #2, 0
65 FOR i=1 TO 7: PRINT #0: PRINT #1: PRINT #2


User avatar
bwinkel67
QL Wafer Drive
Posts: 1518
Joined: Thu Oct 03, 2019 2:09 am

Re: I would donate - Porting SymbOS

Post by bwinkel67 »

Popopo wrote: Thu Dec 05, 2024 8:57 am Of course, in case you allows me to do with the code any modification or distribute it as I please, I will mention you on it (credits).
Just I am afraid to use a code to work around and suddenly discover an author that claim for rights with all my effort falling apart (noway).

So, do you allow me?
I should probably add a README file to my ZXSimulator distribution because looking at the code it isn't clear what my intentions (wishes) are. Each .c and .h module has a GPL v3 marking in the header and I'm fine with someone using any portion of that code to add to their project -- i.e. if you want a simple interpreter (or parts of one) that you want to add to your project, use and change that code as you want.

What I wouldn't want is for someone to take the ZXSimulator project as a whole, put it on GitHub, and subsequently started releasing variations of my emulator (I might put it on GitHub someday when I have a bit more time). So the project as a whole is not under GPL v3...again, I need a README to specify that. The QL community is so small that I've never been worried about that and so, as a teacher, I kind of wanted the code shared as a learning tool and if parts of it could help someone, that would be excellent.


User avatar
Popopo
Gold Card
Posts: 393
Joined: Wed Apr 07, 2021 10:37 am

Re: I would donate - Porting SymbOS

Post by Popopo »

bwinkel67 wrote: Thu Dec 05, 2024 11:31 am ...
What I wouldn't want is for someone to take the ZXSimulator project as a whole, put it on GitHub, and subsequently started releasing variations of my emulator (I might put it on GitHub someday when I have a bit more time). So the project as a whole is not under GPL v3...again, I need a README to specify that. The QL community is so small that I've never been worried about that and so, as a teacher, I kind of wanted the code shared as a learning tool and if parts of it could help someone, that would be excellent.
Agree with you,
But I am caution about everything lately. Some people get offended, some people offend.


Hi!
After testing it with my real QL and at the end a ram expansion, I don't understand how to get the whole demo working properly.
Do you mind to check this video where I was testing my expansion RAM card (derived from Alvaro's one) and got some troubles to make the demo working as you do in your screenshot?
https://www.facebook.com/551014941/vide ... 082276876/

If all is like that,
probably soon I will start to study the code and modify it in order to don't get those errors.
Thank you :)


User avatar
bwinkel67
QL Wafer Drive
Posts: 1518
Joined: Thu Oct 03, 2019 2:09 am

Re: I would donate - Porting SymbOS

Post by bwinkel67 »

Popopo wrote: Sat Dec 14, 2024 10:35 pm After testing it with my real QL and at the end a ram expansion, I don't understand how to get the whole demo working properly.
Do you mind to check this video where I was testing my expansion RAM card (derived from Alvaro's one) and got some troubles to make the demo working as you do in your screenshot?
https://www.facebook.com/551014941/vide ... 082276876/
So the BASIC script starts up two programs, a compiled BASIC program called Baton Twirler that used Supercharge to compile, and a BASIC interpreter that used Digital 'C' SE to compile. The BASIC interpreter loads fine but the Baton Twriler seems to not load. You seem to get an error from the Supercharged executable that the original BASIC halted at line 140. Here is the original BASIC code:

Code: Select all

100 REMark =============================
105 REMark ********* BATON_bas *********
110 REMark =============================
115 :
120 REMark Graphic Simulation of a Baton
125 REMark    QLWorld Issue May 1990
130 REMark   Contributed by Peter Hale
135 REMark  Modification by Ed Kingsley
140 REMark BATON_ex is a compiled version
145 REMark   Read BATON_doc for Info
150 :
200 WINDOW 512,250,0,0
210 PAPER 0:INK 5:CLS:PRINT\\\"BATON TWIRLER":INK 2:PRINT\\\ "SELECT NUMBER OF TRAILING IMAGES"\"INPUT A NUMBER BETWEEN 1 & 45  ";:INK 7:INPUT R
220 PAPER 0: CLS
230 DIM ypos1(50): DIM xpos1(50)
240 DIM ypos2(50): DIM xpos2(50)
250 x1inc = 1.9 : x2inc = 2.7
260 y1inc = 2.7 : y2inc = 3.1
270 x1pos = 50 : x2pos = 55
280 y1pos = 55 : y2pos = 60
290 xmax = 120
300 ymax = 100
310 index = 0
320 REPeat loop
330  index1=(index) MOD 50
340  index = (index+1) MOD 100
350  INK (2+(index MOD 6))
360  LINE (x1pos),(y1pos) TO (x2pos),(y2pos)
370  xpos1(index1)=x1pos : xpos2(index1)=x2pos
380  ypos1(index1)=y1pos : ypos2(index1)=y2pos
390  x1pos = x1pos+x1inc
400  y1pos = y1pos+y1inc
410  x2pos = x2pos+x2inc
420  y2pos = y2pos+y2inc
430  IF x1pos < 0 THEN 
440    x1inc = -x1inc : x1pos = 0
450  END IF 
460  IF y1pos < 0 THEN 
470    y1inc = -y1inc : y1pos = 0
480  END IF 
490  IF x1pos > xmax THEN 
500    x1pos=xmax : x1inc = -x1inc
510  END IF 
520  IF y1pos > ymax THEN 
530    y1pos=ymax : y1inc = -y1inc
540  END IF 
550  IF x2pos < 0 THEN 
560    x2inc = -x2inc : x2pos = 0
570  END IF 
580  IF x2pos > xmax THEN 
590    x2pos=xmax : x2inc = -x2inc
600  END IF 
610  IF y2pos < 0 THEN 
620    y2inc = -y2inc : y2pos = 0
630  END IF 
640  IF y2pos > ymax THEN 
650    y2pos=ymax : y2inc = -y2inc
660  END IF 
670  index2 =(index-R) MOD 50
680 INK 0
690  LINE (xpos1(index2)),(ypos1(index2)) TO (xpos2(index2)),(ypos2(index2))
700 END REPeat loop
As you can see, 140 is just a REM statement so that's weird. Perhaps what's going on is that a bad medium error caused the program to stop loading at that area. But what's confusing is that's it is compiled code. I'm not quite sure how Supercharge compiles its code...does it keep track of each chunk of code and what line number it is?

I can run it on an unexpanded 128K QL so it's not a memory issue. I'd run the whole thing again to see if you can avoid getting the "bad or changed medium" error, as that was the likely culprit (maybe before you run the whole thing, try running the Baton.exe alone by itself to make sure it can run on your system).


Martin_Head
Aurora
Posts: 967
Joined: Tue Dec 17, 2013 1:17 pm

Re: I would donate - Porting SymbOS

Post by Martin_Head »

bwinkel67 wrote: Sun Dec 15, 2024 5:48 am But what's confusing is that's it is compiled code. I'm not quite sure how Supercharge compiles its code...does it keep track of each chunk of code and what line number it is?
SuperCharge stores the start of each line with a code word, then a word with the line number.

So in your program you would get
.
.
code word,$0087 For an empty line 135
code word,$008C For an empty line 140
code word,$0091 For an empty line 145
.
.

Non empty lines would have code after the line number.

If you think something's gone wrong with the copy, you could try decompiling it


User avatar
Popopo
Gold Card
Posts: 393
Joined: Wed Apr 07, 2021 10:37 am

Re: I would donate - Porting SymbOS

Post by Popopo »

bwinkel67 wrote: Sun Dec 15, 2024 5:48 am As you can see, 140 is just a REM statement so that's weird. Perhaps what's going on is that a bad medium error caused the program to stop loading at that area. But what's confusing is that's it is compiled code. I'm not quite sure how Supercharge compiles its code...does it keep track of each chunk of code and what line number it is?
how strange, I will try to list this line ASAP


bwinkel67 wrote: Sun Dec 15, 2024 5:48 am I can run it on an unexpanded 128K QL so it's not a memory issue.
??? in my stock QL it doesn't work at all. I had to use an expansion RAM to get it run, before only in QEmulator with more than 128K

bwinkel67 wrote: Sun Dec 15, 2024 5:48 am I'd run the whole thing again to see if you can avoid getting the "bad or changed medium" error, as that was the likely culprit (maybe before you run the whole thing, try running the Baton.exe alone by itself to make sure it can run on your system).
After second try it ran as you see in the video. But always I need to run it twice.
I have not other loading ways to use. Except in emulator.


User avatar
Popopo
Gold Card
Posts: 393
Joined: Wed Apr 07, 2021 10:37 am

Re: I would donate - Porting SymbOS

Post by Popopo »

Martin_Head wrote: Sun Dec 15, 2024 2:25 pm
bwinkel67 wrote: Sun Dec 15, 2024 5:48 am But what's confusing is that's it is compiled code. I'm not quite sure how Supercharge compiles its code...does it keep track of each chunk of code and what line number it is?
SuperCharge stores the start of each line with a code word, then a word with the line number.

So in your program you would get
.
.
code word,$0087 For an empty line 135
code word,$008C For an empty line 140
code word,$0091 For an empty line 145
.
.

Non empty lines would have code after the line number.

If you think something's gone wrong with the copy, you could try decompiling it
How could I see those codes? I get what I have shown in the video, just that.
I will try again ASAP


User avatar
bwinkel67
QL Wafer Drive
Posts: 1518
Joined: Thu Oct 03, 2019 2:09 am

Re: I would donate - Porting SymbOS

Post by bwinkel67 »

Popopo wrote: Sun Dec 15, 2024 6:00 pm ??? in my stock QL it doesn't work at all. I had to use an expansion RAM to get it run, before only in QEmulator with more than 128K
I just tried it on Q-emuLator 3.5.1 (the latest version) with 128K and ROMs: QL_ROM_JS & TK2_rom it works. I usually do it in F2, but also tried it to F1. Note it doesn't need TK2_rom since I soft-load it as well. With my stock QL, I use JSU ROM and have the ICE ROM in the back with only 128K.

Now if you look at the BASIC program, there is no reason it shouldn't work. All it does is:
  • Soft-load TK2 (17K of memory) - not needed if you have the TK2 ROM
  • Start a Supercharged program: WBLines_exe (<5K of memory)
  • Start a Digital 'C' SE program: WBBasic_exe (37K of memory)
  • Resizes windows #0, #1, #2 to overlap at bottom of screen making it appear to be single Workbench shell (no memory)
  • Loads Workbench screen to give final appearance of being an Amiga: QLWB21_scr (32K of memory)
That's it, so 74 of 128K of RAM is all this needs. As I said, it's just a BASIC script that runs two programs and loads a screen, all done in a particular order to make it appear it's a Amiga Workbench-like GUI -- though it's not, it's just simulation...there is really nothing to it.

In your video, on real hardware, it crashes on the Supercharged program (Baton.exe but renamed to WBLines.exe for this simulation). You can just reboot your actual QL, insert the cartridge and type EXEC MDV1_WBLines.exe to see if it runs (no reason it shouldn't that I can see)


Post Reply