TRIANGULAR μOS 1.11-1.19 for VIC-20 in BASIC

Basic and Machine Language

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4849
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: TRIANGULAR 1.10ALPHA2 for VIC-20 5KB

Post by Mike »

I tried the newest 1.10alpha3 on real hardware, and unfortunately, it did hang at the hourglass intro when loading the file "BIOS". Loading the file directly with LOAD also left me with an unresponsive VIC-20. A sharper look with MINIMON tells me the file has an invalid "end of program" marker:

Image

I filled the BASIC RAM with the value $2A to make it easier to spot the end of the file. The last BASIC line begins at $1B28 and there, the link pointer points to $1B2E. At $1B2E however, the value is not $0000 (i.e., two bytes $00) to signify "end of program", but actually $00 $02 - address $0200. The BASIC line relinker called at the end of the LOAD command thus proceeds beyond that invalid EOP marker, and adds a "junk" BASIC line. Or at least tries to. Depending on what is in memory behind the last line, the relinker may hang itself up. This happens when there are more than 255 consecutive non-$00 bytes in that "junk" line.

There is something fishy with either your (cross-)developing environment or the program you use to build the *.d64 file.

BTH, I only spotted the issue, as my real h/w VIC-20 does not show that usual $FF/$00 RAM pattern on power-up. The relinker just did not find another $00 byte within a 255 byte index range, and from there everything went downhill ...


Update: I checked the other files in the *.d64 image: only the file "BIOS" is affected - the other PRG files have a proper EOP marker.
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10ALPHA2 for VIC-20 5KB

Post by TRIANGULAR OS »

Mike thanks for input. I will upload tomorrow a newer alpha version with improved CMD and I will (re)create this disk anew. Probably this will help with this bug.

For development I use CBM prg Studio 3.14.0 and test it in WinVICE 3.6 GTK3 version. I build disks that is create file/format them in WinVice VIC-20 emu and eventually change their content in DirMaster v3.1.5.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10ALPHA2 for VIC-20 5KB

Post by TRIANGULAR OS »

TRIANGULAR 1.10alpha4 for VIC-20 5KB. Some small bugfixes & improvements. CMD have disk type database implemented.

@ Mike: Hope it will work on Your VIC-20

Download:
TRIANGULAR OS 1.10alpha4 VIC-20.d64.zip
(7.22 KiB) Downloaded 47 times

Still waiting for some input on mouse cursor design. I don't know what type of mouse to choose. All of them here(white background & black cursor, black background & white cursor, cursor color neutral, cursor background color neutral):
ttps://youtu.be/iTdJrrvYXiI

Let me know, which one You prefer
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10ALPHA4 for VIC-20 5KB

Post by TRIANGULAR OS »

TRIANGULAR 1.10alpha5 for VIC-20 5KB. Some small bugfixes & improvements. CMD added help + many bugfixes. Slightly changed layout, especially in SETTINGS. In BIOS launching screen build version displayed (A5 for alpha5).

Mike did You tried it? How it works? If You or anyone is interested I have commented my code in CBM prg Studio and can provide .bas files or even zipped projects.

DOWNLOAD:
TRIANGULAR OS 1.10alpha5 VIC-20.d64.zip
(7.55 KiB) Downloaded 49 times
Still waiting for some input on mouse cursor design. I don't know what type of mouse to choose. All of them here(white background & black cursor, black background & white cursor, cursor color neutral, cursor background color neutral):


Let me know, which one You prefer.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
Mike
Herr VC
Posts: 4849
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: TRIANGULAR 1.10ALPHA4 for VIC-20 5KB

Post by Mike »

TRIANGULAR OS wrote:Mike did You tried it? How it works?
Together with a good friend who also is interested in this topic, I did try out the alpha4 yesterday, and yes, it starts through to the Desktop on my VIC-20 without any issues. We also checked the BIOS setup; the setup could not recognize the type of my SD2IEC device though.

Everything is still somewhat rough though. When a file is not found, the loading screen leaves the user with no apparent message that the file could not be loaded. The interface then should show an error, and then return to the Desktop.

It would also be nice, if the Hourglass was animated. Here's how it could be done in BASIC - I chose a suggestive implementation to ease you the translation to machine code (download):

Code: Select all

10 GOTO 28
11 :
12 A=160:Y=0  :POKEAD+Y,A:     :Y=Y+1:POKEAD+Y,A
13 A=95 :Y=22 :POKEAD+Y,A:A=105:Y=Y+1:POKEAD+Y,A
14 A=78 :Y=44 :POKEAD+Y,A:A=77 :Y=Y+1:POKEAD+Y,A
15 A=76 :Y=66 :POKEAD+Y,A:A=122:Y=Y+1:POKEAD+Y,A
16 RETURN
17 :
18 A=79 :Y=0  :POKEAD+Y,A:A=80 :Y=Y+1:POKEAD+Y,A
21 A=160:Y=66 :POKEAD+Y,A:     :Y=Y+1:POKEAD+Y,A
22 RETURN
23 :
24 A=77 :Y=22 :POKEAD+Y,A:A=78 :Y=Y+1:POKEAD+Y,A
25 A=233:Y=44 :POKEAD+Y,A:A=223:Y=Y+1:POKEAD+Y,A
26 RETURN
27 :
28 PRINT"{CLR}";
29 POKE36879,8
30 AD=7888
31 :
32 CO=(ADAND1023)+37888:A=7
33 Y=0 :POKECO+Y,A:Y=Y+1:POKECO+Y,A
34 Y=22:POKECO+Y,A:Y=Y+1:POKECO+Y,A
35 Y=44:POKECO+Y,A:Y=Y+1:POKECO+Y,A
36 Y=66:POKECO+Y,A:Y=Y+1:POKECO+Y,A
37 :
38 N=1
39 ONNGOSUB12,18,24:N=N+1:IFN=4THENN=1
40 FORT=1TO350:NEXT:GOTO39
I'll test the alpha5 over the weekend.

Greetings,

Michael
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

Thanks Mike for reply. Alpha5 is slightly more expanded/improved/bugfixes Alpha4 (mostly added CMD HELP + changed settings window visually) so don't expect much changes.

BIOS Setup has old code line from PET version that check if SD2PET (SD2IEC like solution for PET) is present. This is very experimental. All (CBM legacy) disk drives, when asked a byte (65331 or $FF33 exactly) from disk drive ROM will send that byte and it value can help determine which disk drive type is used. At least SD2PET works different from standard drives, and when consulting creator of it, TheFutureWas8bit, he checked this OS and in his SD2PET he has code 51 (decimal) returned. So that code is assigned to SD2PET. But he could not definitely tell that it will always be that code. How it will look in SD2IEC I don't know. If You run OS into BIOS, You can Run/Stop it and by print peek(905) (if device is used as device #8) get code/byte from 65331/$FF33 memory cell of Your device.

As to loading mechanism. If You noticed it just print LOADING... and hourglass symbol, then Home print (black on black) LOAD "<program name>", 8 and fills keyboard buffer with 6 symbols: Home symbol to place cursor to top, hit enter, then print RUN and once again hit enter. Then sets buffer size to 6 and erase BASIC program with NEW and this triggers key sequence stored in buffer, which essentially is finishing load/run on autopilot. I wanted to hid that underneath of load operation, that's why black on black theme came from. (PET don't have colors, so it is visible). I know it's messy when bug will show, so I will go for cyan text in next (pre-final) builds.

Your hourglass routine is really great, but first I don't how to make it animating in BASIC since loading of program is happening by load and after NEW. It will require going ML, which will probably gradually happen after I complete this version. Second it consumes 663 bytes of RAM, which is not good fit under specification of this OS to be able to run on 5KB machine (that is 3.5KB RAM for Basic programs) and most of my programs are ~3KB in size (add to this up to few hundreds for variables).
Last edited by TRIANGULAR OS on Sat May 14, 2022 6:53 am, edited 2 times in total.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
Mike
Herr VC
Posts: 4849
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by Mike »

TRIANGULAR OS wrote:Your hourglass routine is really great, but first I don't how to make it animating in BASIC since loading of program is happening by load and after NEW. It will require going ML, which will probably gradually happen after I complete this version. Second it consumes 663 bytes of RAM, which is not good fit under specification of this OS to be able to run on 5KB machine (that its 3.5KB RAM for Basic programs) and most of my programs are ~3KB in size (add to this up to few hundreds for variables).
I am aware that the example implementation of the hourglass animation in BASIC, and any translation into machine language, has its own space requirements, but I think that's not the main point. With your given space constraint - everything is supposed to run on the unexpanded VIC-20 - there will always be a resource conflict between the RAM used by your program and any client application. Of course, if you ever embed a ML translated hourglass into TRIA, that would only be a transient tool, only used and present in RAM during load operations - and likely be implemented within an interrupt routine.
BIOS Setup has old code line from PET version that check if SD2PET (SD2IEC like solution for PET) is present. This is very experimental. All (CBM legacy) disk drives, when asked a byte (65331 or $FF33 exactly) from disk drive ROM will send that byte and it value can help determine which disk drive type is used. At least SD2PET works different from standard drives, and when consulting creator of it, TheFutureWas8bit, he checked this OS and in his SD2PET he has code 51 (decimal) returned. So that code is assigned to SD2PET. But he could not definitely tell that it will always be that code. How it will look in SD2IEC I don't know. If You run OS into BIOS, You can Run/Stop it and by print peek(905) (if device is used as device #8) get code/byte from 65331/$FF33 memory cell of Your device.
At this stage of TRIA, that type of drive detection is a bit over the top, IMO. Unless you do very advanced stuff like drive speeders, all drives on the IEC bus provide essentially the same commands for file management operations (delete, rename, etc.).
As to loading mechanism. If You noticed it just print LOADING... and hourglass symbol, then Home print (black on black) LOAD "<program name>", 8 and fills keyboard buffer with 6 symbols: Home symbol to by cursor to top, hit enter, then print RUN and once again hit enter. Then sets buffer size to 6 and erase BASIC program with NEW and this triggers key sequence stored in buffer, which essentially is finishing load/run on autopilot. I wanted to hid that underneath of load operation, that's why black on black theme came from. (PET don't have colors, so it is visible). I know it's messy when bug will show, so I will go for cyan text in next (pre-final) builds.
Rest assured, I know how simulated keypresses work in direct mode. ;) Point is you should check beforehand whether the file you intend to load is present at all. Then, when the file is not present, at least just do nothing instead of letting TRIA 'crash' with an unresponsive "LOADING ..." screen.

That check is easily done by just asking the drive to rename the file into itself (send "R0:name=name" over the command channel), and reading the error channel - if you get "62,FILE NOT FOUND,00,00" the file is not there, if you get "63,FILE EXISTS,00,00", the file - duh! - exists.
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

I am aware that the example implementation of the hourglass animation in BASIC, and any translation into machine language, has its own space requirements, but I think that's not the main point. With your given space constraint - everything is supposed to run on the unexpanded VIC-20 - there will always be a resource conflict between the RAM used by your program and any client application. Of course, if you ever embed a ML translated hourglass into TRIA, that would only be a transient tool, only used and present in RAM during load operations - and likely be implemented within an interrupt routine.
I agree on that argument, but v1.10 spec is how it is: Unexpected and all BASIC - that's my goal right now. Later versions will be more demanding and more RAM obsessed. Client applications generally could be any BASIC or even ML program. And if that program can get back (via similar means it was evoked) to OS element it was started by or DESKTOP it will give feeling of seamless operation. I don't intend v.1.10 to be super versatile, but more focused on apps on system disk. Those will work seamless and error-free. Look at video of OS v1.03 for PET on my YouTube channel. There only BREAKOUT won't go back (because of ML) to GAMES folder.
At this stage of TRIA, that type of drive detection is a bit over the top, IMO. Unless you do very advanced stuff like drive speeders, all drives on the IEC bus provide essentially the same commands for file management operations (delete, rename, etc.).
Agree, but this drive detection is more like fancy stuff. Just to be there, not doing much.
Rest assured, I know how simulated keypresses work in direct mode. ;) Point is you should check beforehand whether the file you intend to load is present at all. Then, when the file is not present, at least just do nothing instead of letting TRIA 'crash' with an unresponsive "LOADING ..." screen.

That check is easily done by just asking the drive to rename the file into itself (send "R0:name=name" over the command channel), and reading the error channel - if you get "62,FILE NOT FOUND,00,00" the file is not there, if you get "63,FILE EXISTS,00,00", the file - duh! - exists.
Thanks for great suggestion. Generally final release will have every loadings worked out, but try-to-rename trick should be great for running 3rd-party programs.

--
I'm fully aware that I'm not great Commodore 8-bit machines programmer, I learn a lot as I write this OS. This OS version is more geared toward look and feel than turboloaders and other fancy stuff. Those come later. Probably very different architecture too.

What I'm doing right now:
Working on DISK window program to browse disk content and run programs.

In future:
All above + MATH calculator will be released as beta version. Then will try work on or adapt some word processor and add other programs/tools and many games (I've seen some dope BASIC 10-liners).
Last edited by TRIANGULAR OS on Sat May 14, 2022 6:58 am, edited 1 time in total.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
Lechuck
Vic 20 Enthusiast
Posts: 182
Joined: Wed Nov 11, 2020 7:23 am
Location: Madrid
Occupation: IT

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by Lechuck »

Just tried alpha 5 (in real VIC) and is looking good....
I assume that 'Games' and 'Office' are not implemented yet, right? (tried them, and it did hang at the hourglass).

Cheers
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

Lechuck: Works only BIOS, DESKTOP, SETTINGS, CMD.

Not working: DISK (working on it right now). OFFICE (icon is relict from PET version, it will be changed to PROGRAMS) and GAMES are not present yet.

Then will add or write some word processor and MATH calculator. Then games and further programs will be added.
Last edited by TRIANGULAR OS on Sat May 14, 2022 7:01 am, edited 1 time in total.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

Update: Beta0 in progress. DISK program works (I will test it more). Calculator app called MATH: work in progress, I'm trying to move it from key operated to cursor operated. Don't had/have time recently, but as I finish those 2 programs I will post OS version Beta0 for testing/try.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10alpha5 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

TRIANGULAR OS 1.10beta0 VIC-20 release. It's first beta or rather pre-beta.

What's new:
- DISK displays disk content in window and will run clicked file
- MATH calculator early BETA version
- Cursor can now move diagonally (e.g.: up and left)
- Minor bugfixes and improvements
- For better testing experience autoloading command now visible (they will revert to black/invisible ones in final release)

Preview (YouTube):


DOWNLOAD (1.10beta0):
TRIANGULAR OS 1.10beta0 VIC-20.zip
(9.13 KiB) Downloaded 43 times

Planned for next release (1.10beta1):
- MATH improved from current state to planed functionality screen:
Image

- MONITOR program will be added
- In Start Menu instead of SETTINGS user can go back to DESKTOP. SETTINGS can be accessed from DESKTOP icon
- Add APPS and GAMES folders with at least 2 programs (MATH & MONITOR) and 1 game in them
- Further improvements of current codebase

After that I will add wordprocessor and that will be full backbone of this system. To that I will be adding 3rd party programs and games + some minor improvements & bugfixes.

Enjoy and stay tuned!
Last edited by TRIANGULAR OS on Sat May 14, 2022 7:02 am, edited 2 times in total.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10beta0 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

TRIANGULAR OS 1.10beta1 VIC-20 release.

What's new:
- MATH calculator allows additional operations
- MONITOR added to edit memory
- APPS and GAMES folders added (GAMES right now is empty)
- DISK and CMD loading mechanism has file not/present detection
- Icons updated
- Start Menu go to DESTOP instead of SETTINGS. SETTINGS icon on desktop
- Minor visual changes and bugfixes

Preview (YouTube):


DOWNLOAD (1.10beta1):
TRIANGULAR OS 1.10beta1 VIC-20.zip
(11.39 KiB) Downloaded 42 times

Next update (beta2) will contain wordprocessor and at least 1 game plus further improvements & bugfixes.
Last edited by TRIANGULAR OS on Sun Jun 12, 2022 11:41 am, edited 4 times in total.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: TRIANGULAR 1.10beta1 for VIC-20 DOWNLOAD

Post by chysn »

I understand that this project is more for amusement than practicality, but at least have the calculator accept keyboard input. Nobody's going to abide a joystick-driven calculator! :D

Also, the monitor should show 8-bit values instead of 16-bit values.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
TRIANGULAR OS
Vic 20 Dabbler
Posts: 87
Joined: Wed Mar 09, 2022 4:53 am
Website: https://www.youtube.com/@triangular_uos
Location: Cracow, Poland

Re: TRIANGULAR 1.10beta1 for VIC-20 DOWNLOAD

Post by TRIANGULAR OS »

chysn: I'm reverting calculator to keyboard operated one since it is rather buggy + cursor/joy operated mechanics take so many RAM, that many operations from PET version won't fit in. Plus it will have similar layout as wordprocessor that I'm currently working on.

MONITOR's command SHOW now displays 2 hex digits.

All these changes will be released soon as beta2.
TRIANGULAR μOS for VIC-20:
http://www.sleepingelephant.com/ipw-web ... =2&t=10352

TRIANGULAR μOS YouTube channel:
https://www.youtube.com/@triangular_uos
Post Reply