LineXY

Everything else that doesn't fall into one of the other PB categories.
Ivan
User
User
Posts: 25
Joined: Fri Sep 11, 2020 1:53 pm

Re: LineXY

Post by Ivan »

Little John wrote:
Ivan wrote:Of course you have to learn new stuff, if you try another languages - what else.
Well, you previously wrote
I assumed that [.. we ..] could use the knowledge we already have.
Hence my respective reply.
In this case I was thinking of "normal" cartesian coordinate system still could be used with the features that PB provides. I was surprised of the upside down way, PB way do graphics.

It's is Basic and should be so easy to use as possible and the logic in turning y-values 180 degrees I don't understand, but that seem to be an issue only for me.

I have just learned a little about the unit circle and when I applied my new knowledge the graphic system in BBC BASIC it worked fine.
Little John wrote:
Ivan wrote:No problem, if you ask me.
I still do not understand why in this message you quoted text from me, and what the purpose of that message was ...
However, when there are no problems, that's fine. :-)
Eh... :-)
Ivan
User
User
Posts: 25
Joined: Fri Sep 11, 2020 1:53 pm

Re: LineXY

Post by Ivan »

oreopa wrote:
Ivan wrote:
oreopa wrote:Does BBC BASIC invert the Y coords? Didn't know that... interesting...
BBC BASIC does what I have learned about coordinate systems.

For me it's logically when y = 0 then you are on the floor and increasing y-values goes upwards.

And that view goes fine with the origin at 0,0 and move in a quadrant or in an octant 0,0,0
It's not an issue for me for you to have your own preference :) I have no comment on that at all...

I should have been clearer. I was simply interested in the way the BBC is handling this internally... it means that bitmap memory is stored left-right/bottom-up? Or that it's just simply a translation in basic interpreter that y=0 is the bottom? Curious... I will look into it...
If I remember correctly about the BBC Micro Basic I would say that the first address on screen was at the top left corner.

Then coloums of 8 pixels downwards from left to right.
KianV
User
User
Posts: 10
Joined: Thu Dec 26, 2019 3:31 pm

Re: LineXY

Post by KianV »

BBC Basic does use 'conventional' coordinates, although it uses 'Graphic Units' in which 1 pixel is equal to 2 g.u. . This of course conflicts with the text coordinate system, unless text was printed at the graphics cursor.
In memory it is stored from the top left corner - getting my head round the way pixels were stored for the different modes gave me many a headache back in the day.
It should be remembered that it was designed primarily as an educational machine so, to me, it would seem to make sense to use the coordinate system that everyone was learning in school.
Having spent years working in assembler, I naturally think of the screen 'expanding' down and right.
Ivan
User
User
Posts: 25
Joined: Fri Sep 11, 2020 1:53 pm

Re: LineXY

Post by Ivan »

KianV wrote:BBC Basic does use 'conventional' coordinates, although it uses 'Graphic Units' in which 1 pixel is equal to 2 g.u. . This of course conflicts with the text coordinate system, unless text was printed at the graphics cursor.
In memory it is stored from the top left corner - getting my head round the way pixels were stored for the different modes gave me many a headache back in the day.
It should be remembered that it was designed primarily as an educational machine so, to me, it would seem to make sense to use the coordinate system that everyone was learning in school.
Having spent years working in assembler, I naturally think of the screen 'expanding' down and right.
I'm currently writing a program with updating rulers because of scrolling. It's fairly easy for me to place the numbers in the right positions at the graphics cursor.

I did write some of Castle Quest clone mostly in 6205 assembler back in the eighties. But that was long before I know of any Cartesian coordinate system.
KianV
User
User
Posts: 10
Joined: Thu Dec 26, 2019 3:31 pm

Re: LineXY

Post by KianV »

I guess everyone's brain just has a preferred way of looking at things.
When using BBC Basic I've always used a function to 'invert' the y coordinate, just because I think of layout that way.
e.g. PLOT 69,xpos%,FN_yinv(pos%)
A minor overhead, but if you're working in interpreted BASIC, you're going for ease of use rather than blistering speed.

Loved Castle Quest too.
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: LineXY

Post by oreopa »

KianV wrote:Having spent years working in assembler, I naturally think of the screen 'expanding' down and right.
This. That's really why I asked the question.
Ivan wrote:I did write some of Castle Quest clone mostly in 6205 assembler back in the eighties.
KianV wrote:Loved Castle Quest too.
That makes 3 of us. The stool/ledge/burning torch/prison cell bed/escape set-piece is one of the coolest things ever in a game.
Proud supporter of PB! * Musician * C64/6502 Freak
Ivan
User
User
Posts: 25
Joined: Fri Sep 11, 2020 1:53 pm

Re: LineXY

Post by Ivan »

I'm currently writing a program for efficient use of expensive fabric and the user starts at the bottom left corner. As a person I'm more practical than theoritical so The Cartesian coordinate suits me fine.

I agre in the "ease" use of Basic is priotized over speed.

I'm surprised how well the present BBC BASIC hold the speed despite I use lot of arrays of structs and collision detectections. That little experience I have with PB also indicates a high speed as well.


Oops not 6205 but 6502... :oops:

I even remember many of the instruktions: LDA, BNE, ADC ect.

Back then you would use inline [assembler] in Basic and a call to get the speed.

I was and am still impressed how Micro Power managed to control the video chip 6845 with flicker free scrolling in mode 2, 160x256 pixels.

I have recently learned that the BBC Micro had 4 MHz ram speed and was one of the reasons why it's Basic was the fastest Basic.
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: LineXY

Post by oreopa »

Ivan wrote:I was and am still impressed how Micro Power managed to control the video chip 6845 with flicker free scrolling in mode 2, 160x256 pixels.
I don't know of this specific case, but that's what I love about 8 bit computers in general... some things actually did seem impossible back becuase of the limitations of the hardware, then until some genius comes up with a solution. Usually using the hardware in a non documented way. I think C64 is a contender for most "appropriatable" 8-bit computer, especially in the GFX dept, but that's debatable. There are so many unconventional tricks on C64 such as scrolling bitmaps with barely any cpu hit and the like. The VIC-II chip is very persuadable :)
Ivan wrote:I'm surprised how well the present BBC BASIC hold the speed despite I use lot of arrays of structs and collision detectections.
I think the BBC Basic was one of the very best implementations in the mass market in the 80s. I know it had things like inline asm and proper procedures/functions. This was lacking in the C64... in fact the C64 basic has to be one of the worst implementations of the 80s :)
Proud supporter of PB! * Musician * C64/6502 Freak
Ivan
User
User
Posts: 25
Joined: Fri Sep 11, 2020 1:53 pm

Re: LineXY

Post by Ivan »

Non documented - Acorn tried unsuccesfully to have users to follow certain rules. :)

David Braben had to break almost all rules to write Elite - World first 3D game.

Especially Sophie Wilson was the master mind of BBC BASIC and the first ARM processor.

https://www.youtube.com/watch?v=jhwwrSaHdh8
Post Reply