Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:51 29 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Pseudo-Multi-tasker for MMBasic for DOS

Author Message
flip
Senior Member

Joined: 18/07/2016
Location: Australia
Posts: 114
Posted: 03:37am 28 Aug 2017
Copy link to clipboard 
Print this post

Hi all,
Going nuts (in a good way) with MMBasic for DOS, and would like to share where I want to go with it.
This is a DOS-based windows look-alike, with Function keys, Frames & Controls, Cursors, pseudo events, etc.

I think it's safe (doesn't alter anything)...it currently will crash under some conditions (e.g. string length >255)
Plans for Immediate future is uM scan and chat, program pass-through to uM (extension of one of my previous), and edit.

It is pretty rough and by no means a comprehensive thing
I suggest you Read the 'About...' Window and use as a guide to the current very limited functionality.

2017-08-28_133202_MultiTasker.zip Requires Latest Beta 7 for MMasic for DOS

Hope you enjoy playing with it as much as I enjoyed developing it !!
EDIT: A few bugs squashed and cleaned up a bit (much more to do)
2017-08-29_032038_MultiTasker0.2.zip
EDIT: And another..
2017-08-29_053415_MultiTasker0.3.zip
No more edits until I add some new features (and restructure it a bit more object orientedly).. MM DOS seems to be 100% stable so far with the punishing this code is giving it... (the only 'crashes' are not crashes per-say, but my bugs)...a real credit to Geoff's great work.

Regards,
Phil


Edited by flip 2017-08-30
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 05:31pm 21 Sep 2020
Copy link to clipboard 
Print this post

Phil--this is quite fine and fun work. Very compact code, but I could follow it well. It deserves more attention--perhaps screen shots would help. This is what you get when you run the code as-is:



This is after I spent about an hour puzzling things out and trying to make my own windows:



(Warning--there is no code to do what the window headings imply can be done.)

This is just what I've been looking for (and it's been sitting here neglected all along.)

I've started to try to port it to the CMM2--initial issues are with cursor (I think I got that) and then with the other problems which arise from having mm.hres and mm.vres in pixels rather than in characters as in DOS MMBasic.

Your comment in the other thread that you've made enhancements is intriguing. Can you share them? Immediate thoughts would be vertically scrolling lines and more enhanced editing.

Thanks again for this powerful piece of code--50 windows (well, in theory).

Lance
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 227
Posted: 08:36pm 21 Sep 2020
Copy link to clipboard 
Print this post

Is this a live implementation of the kind of TUI functionlity wished for here?
https://www.thebackshed.com/forum/ViewTopic.php?TID=12759&P=1

Looks cool if would work on the CMM2.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 08:51pm 21 Sep 2020
Copy link to clipboard 
Print this post

  elk1984 said  Is this a live implementation of the kind of TUI functionlity wished for here?

Yes it is. Very much live, with tabbing to windows and activation of the cursor and editing in active windows (and untouchable text in inactive windows), with 12 function keys ready to be programmed.

As published, it is not the full TUI of old, but Phil has said that he has progressed, and in any case it is a very capable framework. I should note that it is a "window" builder--it does not create controls within a window, like buttons or listboxes or radiobuttons or textboxes.
Edited 2020-09-22 07:35 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
flip
Senior Member

Joined: 18/07/2016
Location: Australia
Posts: 114
Posted: 12:38am 22 Sep 2020
Copy link to clipboard 
Print this post

Thanks for the interest Lizby.
Have only really developed by deconstructing and modularising it using the Builder but not much in terms of functionality, so nothing immediately available for use yet sorry.

All roads I was following led to one blocker - having a suitable database for object storage & retrieval. This has just been solved, so main focus for me (should be ready in a month or so) is publishing what I hope will be a simple, fast, flexible,  database module that should reside in about 20k or so and usable for all mites having native file storage. This will be the basis of my own integrated *mite environment, but will be free for any *mite use.

From this I hope development can become easier and more modularisable for all.

Thanks again for your interest...you have inspired me to continue, and thanks to all contributors to this great mitey ecosystem  
Phil
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 11:35am 23 Sep 2020
Copy link to clipboard 
Print this post

Continuing to progress. Drawing lines on the CMM2, but I haven't gotten all of the complications resulting from DOS hres and vres in characters being in pixels on the CMM2.

I said above that "it does not create controls within a window, like buttons or listboxes or radiobuttons or textboxes", but I hadn't thought it through.

A label can be nothing more than a window with text which cannot receive the focus and which might or might not have a border. (I haven't checked to see if borderless windows are implemented, but if not, it shouldn't be hard). Textbox is implemented. Momentary pushbutton is only a textbox which only accepts <Enter> as input. Same with on/off button. Same with checkbox. Radiobuttons need only to be grouped with code such that selecting one (with <Enter>) deselects the others (perhaps within a bordering window).

Course-grained horizontal and vertical sliders could be made from rows or columns of single-character pushbutton windows.

A table is just a set of nested windows.

So what are these controls starting to sound like? . . . HTML. In theory, this program could be extended so that the windows it draws are derived from parsing restricted and/or extended HTML code.

Thanks again, Phil. Many capabilities baked in here. If you have code with what you feel is a better layout/methodology, I'd love to be able to start from there to make any changes I feel are required to suit my plans.

Lance

~
Edited 2020-09-23 21:50 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 11:54am 23 Sep 2020
Copy link to clipboard 
Print this post

  flip said  . . . All roads I was following led to one blocker - having a suitable database for object storage & retrieval. This has just been solved, so main focus for me (should be ready in a month or so) is publishing what I hope will be a simple, fast, flexible,  database module that should reside in about 20k or so and usable for all mites having native file storage. This will be the basis of my own integrated *mite environment, but will be free for any *mite use.


I've also started on a database, and have limited implementation of SQL searches for fixed-length text files, but my blocker is a desire for more micro/maximite tools, so I'd put off the database work until later. I'll be very interested to see what you have come up with.

Lance

~
Edited 2020-09-23 21:56 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3807
Posted: 11:57am 23 Sep 2020
Copy link to clipboard 
Print this post

  lizby said  ... but my blocker is a desire for more micro/maximite tools ...


Such as ?

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 02:54pm 23 Sep 2020
Copy link to clipboard 
Print this post

  thwill said  
  lizby said  ... but my blocker is a desire for more micro/maximite tools ...


Such as ?

Tom

Debugger
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3807
Posted: 03:02pm 23 Sep 2020
Copy link to clipboard 
Print this post

  lizby said  
  thwill said  
  lizby said  ... but my blocker is a desire for more micro/maximite tools ...

Such as ?

Debugger


That's what PRINT and TRACE ON|OFF are for, but YMMV especially if you are using CSUBs.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 03:11pm 23 Sep 2020
Copy link to clipboard 
Print this post

  thwill said  That's what PRINT and TRACE ON|OFF are for

Not quite the same.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 12:59pm 31 Oct 2020
Copy link to clipboard 
Print this post

  flip said  . . . a suitable database for object storage & retrieval . . . should be ready in a month or so

Any progress on this? I'd be interested to see it even in a preliminary state--or at least a description of the set of capabilities intended.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3807
Posted: 10:31pm 12 Jul 2021
Copy link to clipboard 
Print this post

  lizby said  I've started to try to port it to the CMM2--initial issues are with cursor (I think I got that) and then with the other problems which arise from having mm.hres and mm.vres in pixels rather than in characters as in DOS MMBasic.


Lance, I have code that allows the CMM2 display so be treated as character mapped and it will render simultaneously to VGA and serial console using VT codes.

https://github.com/thwill1000/cmm2-sptools/blob/master/src/splib/txtwm.inc
https://github.com/thwill1000/cmm2-sptools/blob/master/src/splib/examples/txtwm.bas

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 12:31am 13 Jul 2021
Copy link to clipboard 
Print this post

Tom--I noted your code and actually downloaded it to see how difficult it might be to run on an F4 with 800x480 IPS/OTM8009A 4 inch TFT LCD, which is close enough to CMM2 mode 2 to make it work, but I'm not familiar with the game and I looked at the include files and decided I'd pass for now.

Good work, though.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5645
Posted: 08:32am 13 Jul 2021
Copy link to clipboard 
Print this post

I did a Micromite VT library too, if it's of any use. You even get the DOS-style lines & boxes if you set the Tera Term font suitably.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3807
Posted: 09:02am 13 Jul 2021
Copy link to clipboard 
Print this post

  lizby said  Tom--I noted your code and actually downloaded it to see how difficult it might be to run on an F4 with 800x480 IPS/OTM8009A 4 inch TFT LCD, which is close enough to CMM2 mode 2 to make it work, but I'm not familiar with the game and I looked at the include files and decided I'd pass for now.


Yeah, "txtwm.inc" is rather "hairy"; it wasn't written with "Yellow River Kingdom" in mind and is thus rather more complex than required for this specific case.

I also believe it is currently not easily portable to the Armmite (or Picomite) because they lack MEMORY COPY/SET and doing the equivalent in BASIC would probably be too slow, hence this thread: https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=13968

What "txtwm.inc" does provide is:
   - character rather than pixel mapped display
   - single API to generate same output on VGA and Serial Console (simultaneously)
   - support for multiple windows/panes with vertical scrolling
   - ability to query the character code and attributes of each character cell, though I note now that I didn't actually add a function make that user-friendly

If you did want to port "Yellow River Kingdom" (and personally I wouldn't bother, I'll do it myself for the Picomite if Peter adds the missing commands) then the simplest thing to do is throw away the existing "txtwm.inc" and write a new set of functions to just address the LCD display with this API:

Sub twm.foreground(col%)
Sub twm.background(col%)
Sub twm.bold(z%)
Sub twm.inverse(z%)
Sub twm.print(s$)
Sub twm.print_at(x%, y%, s$)
Sub twm.cls()
Sub twm.enable_cursor(z%)
Sub twm.bell()


In "kingdom.bas" itself you would then eliminate calls to twm.init(), twm.new_win() and twm.switch() and instead everytime something is current being printed to "win2" just add 3 to its X-coordinate.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024