Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:12 02 Aug 2025 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 : CMM2: Frustration with arrays....

     Page 3 of 3    
Author Message
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 10:04pm 13 Sep 2020
Copy link to clipboard 
Print this post

Top left is 0,0
On the graphics screen as in the editor. Would you like line 0 of your program to be the last line?  ;-)
Visit Vegipete's *Mite Library for cool programs.
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 341
Posted: 12:37am 14 Sep 2020
Copy link to clipboard 
Print this post

  mkopack73 said  
  jpusztai said  
  mkopack73 said  ... long term ability of the community to share code and make bigger more complex software over time. If you guys don't see the utility of that, then I don't know what to tell you...   This isn't about "Mike Wants this for Mike" ... this is "Mike wants this to make things better for everyone"(


Speaking as a member of the “retrocomputing hobbyist” segment of the MM community, what you are describing is counterintuitive. I don’t agree that “bigger and more complex” is “better”, and if I wanted complex code libraries, there are hundreds of other platforms, frameworks and languages I could choose (e.g. Python on a Raspberry Pi).

The appeal of the CMM2 for me is it’s simplicity and the fact that I can “do stuff” immediately. A MMBasic code library, with rigid function calls and entry and exist points, is kind of alien to the Maximite “DIY” ethos, as well as the 8-bit world I grew up with (e.g. the vast majority of software in those days was written by one or two guys, working without the benefit of complex frameworks and toolchains, and even assembling machine code by hand).

In my view, the impetus for any sort of code reuse is primarily a commercial one i.e. enabling a large team of developers to produce quality code more efficiently. I have none of those considerations - in fact, working slowly by myself and learning by trial and error is kind of the point of a hobby.

Yes, there are commercial applications of the Maximite platform, and it’s great to have the camaraderie and contributions of this vibrant community to learn from and share with,  but the overarching appeal for me is that you are intimate with what every line of code is doing... usually because you wrote it yourself.

I apologize if I’m misunderstanding or misrepresenting your intent - maybe it will be clearer when I see some examples of what you have in mind.


Yeah I think you're misunderstanding...  I'm not suggesting making bigger libraries that are more complex to USE... If anything, what I'm suggesting will ensure that they will be easier to use because you can use them no matter how you wish to set the various OPTION settings in your main program...  It'll make things more complex for the authors of the reusable libraries IF and ONLY IF they want to support all the various OPTIONS settings. But, if they do, they can ensure that the widest audience can use their library.

Some things you could do to make the library easier to use, could make it more complex to read and understand the library code. If you're writing or using a program that uses a library and want to fully understand how it works, reading the library code can be part of that.
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 02:41am 14 Sep 2020
Copy link to clipboard 
Print this post

  capsikin said  
Some things you could do to make the library easier to use, could make it more complex to read and understand the library code. If you're writing or using a program that uses a library and want to fully understand how it works, reading the library code can be part of that.


For the Array handling stuff I think I've got ways to do things that actually makes it pretty easy to understand. But yeah, if you're trying to do drawing on the screen of graphics and/or text and trying to do it in a screen res + y_axis independent way, that could CERTAINLY get pretty complex and ugly to understand.

It's always a trade off. I figure most people who are using a library only want to know WHAT it does, and probably aren't going to get too deep into HOW it works. They're using it because they have some other project they want to do and the library is helping jump start them towards the finish line.

If they're using it to learn from, then yeah, probably not the best example in some cases, at least not for beginners...
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 06:49am 14 Sep 2020
Copy link to clipboard 
Print this post

  jpusztai said  Regarding the potential to flip the Y-axis direction, I was wracking my brains last week doing some "coordinate math", and to be honest, I can't think of one good reason why computer graphics coordinate systems place the (0,0) origin at the top left instead of the lower left like the rest of the Cartesian-plotting world.

It was the convention widely adopted by (all of?) the 8-bit BASICs, but was there a reason for it? Was it "easier" to implement somehow

The screens of the time (TVs etc) scan from top left so the video out did that too and I think whoever wrote the s/w just reflected what the h/w did.

It was common for VDUs (hehe, I'm old, look it up) to be that way (top left = 0,0) for the same reason.

Much of software was & is determined by h/w...

John
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 08:11pm 14 Sep 2020
Copy link to clipboard 
Print this post

Aw heck, it goes back further than the early CRT monitors. Printing a data table or array structure from Hollerith cards to a line printer is really easy if you go from top left to bottom right. Try making a line printer roll the paper back in.

I'm probably older than you are.

Paul in NY
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 08:33pm 14 Sep 2020
Copy link to clipboard 
Print this post

  Paul_L said   . . . Try making a line printer roll the paper back in.

In 1974, to visually check the digitizing, I printed a map of the digitized streets in Austin, Texas on a line printer, with "X" representing a pixel. I don't remember how wide and deep it was--at least 12x12 sheets.

Top to the right and down was the only way. Then start again for the next 132 pixels of width. Hardware-dependent coordinate system for sure.

(But I'm not going to claim to be older than Paul.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2170
Posted: 10:31pm 14 Sep 2020
Copy link to clipboard 
Print this post

  mkopack73 said  
0,0 being top left is likely a hold over from the CRT days because the raster refresh was top to bottom. So it made sense that the first line drawn would have the 0 index and thus be at the top...


The first time (and only since then) I encountered it was with VB. In a windowing environment, the top left co-ordinate is the one pixel guaranteed to be visible and so it makes sense to have it as the origin.

It is hateful though, co-ordinates should be positive in the upper right quadrant like a piece of graph paper, not lower right. I suppose it doesn't really matter much but it is what is easiest on the brain - nice sensible cartesian system.

A few years back I wrote some wrappers to get around this (and provide legacy drawing commands) http://www.fruitoftheshed.com/MMBasic.Sensible-Cartesian-Co-ordinate-graphics-pack.ashx They are designed for the micromite but I reckon they will work pretty easily on CMMtoo   I use them all the time when i am doing anything with graphical displays (which isn't terribly often), but not having my brain tied in knots makes this sort of interface easy https://www.youtube.com/watch?v=wP46Ie4o3F8&ab_channel=captainboing
Edited 2020-09-15 08:43 by CaptainBoing
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 12:53am 15 Sep 2020
Copy link to clipboard 
Print this post

  CaptainBoing said  
  mkopack73 said  
0,0 being top left is likely a hold over from the CRT days because the raster refresh was top to bottom. So it made sense that the first line drawn would have the 0 index and thus be at the top...


The first time (and only since then) I encountered it was with VB. In a windowing environment, the top left co-ordinate is the one pixel guaranteed to be visible and so it makes sense to have it as the origin.

It is hateful though, co-ordinates should be positive in the upper right quadrant like a piece of graph paper, not lower right. I suppose it doesn't really matter much but it is what is easiest on the brain - nice sensible cartesian system.

A few years back I wrote some wrappers to get around this (and provide legacy drawing commands) http://www.fruitoftheshed.com/MMBasic.Sensible-Cartesian-Co-ordinate-graphics-pack.ashx They are designed for the micromite but I reckon they will work pretty easily on CMMtoo   I use them all the time when i am doing anything with graphical displays (which isn't terribly often), but not having my brain tied in knots makes this sort of interface easy https://www.youtube.com/watch?v=wP46Ie4o3F8&ab_channel=captainboing


Heh, you think it's bad now, wait till you deal with trying to convert cartesian map coordinates (with 0 being north) into 3D graphics where Z is front-back, X is left right and Y is up-down!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 07:29pm 15 Sep 2020
Copy link to clipboard 
Print this post

Interestingly, Gordon Henderson's RTB (Return To Basic) for the RPi puts graphic 0,0 at the bottom left by default. It can be moved using the ORIGIN command so that negative values can be plotted.

I've not investigated it much, but it's pleasantly idiosyncratic in several other ways too. Including not having an OPTION BASE command. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 3 of 3    
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025