Is it just my imagination or are X and Y flipped?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
Crayon21
Posts: 357
Joined: Sun Nov 04, 2018 2:33 am

Is it just my imagination or are X and Y flipped?

Post by Crayon21 »

Every time I program a character to move, the screen for X and Y would normally map up to y along with down and left/right to X but on the spectrum (please lord let this be the only 8 bit with this issue) the Y is left/right and the X is up/down. I know my left from my right and up from down, so please tell me I'm not going insane here.

Anyway, programming for movement is a nightmare because I have to rethink the cartesian coordinates system. Moving left and right moves me downward for some reason and moving up is fine but moving down does not work. I've checked and rechecked my code. I know what I'm doing.

I think Sir Sinclair (RIP) failed geometry class or just didn't care. How did programmers get anything done with this insanity?

A normal mapped screen places X at the mid point and Y at the top. The sinclair machines place X and Y at the top left.

I need an aspirin :D :lol:
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
Dim_75
Posts: 80
Joined: Fri Sep 01, 2017 11:04 pm
Location: Paris, FR

Re: Is it just my imagination or are X and Y flipped?

Post by Dim_75 »

As Yoda said :
You must unlearn what you have learned :mrgreen:
Spinnetti
Posts: 255
Joined: Sat Sep 12, 2020 11:29 pm

Re: Is it just my imagination or are X and Y flipped?

Post by Spinnetti »

its maddening to have a messed up coordinate system. In my code, I treat X and Y the "right" way and use the code to transpose as needed.
Zeddy: ZX80, ZX81/ZXpand, TS1000/ZXpand, TS1500/Zxpand+,Printer
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
Moggy
Posts: 3267
Joined: Wed Jun 18, 2008 2:00 pm

Re: Is it just my imagination or are X and Y flipped?

Post by Moggy »

In fairness it's Steve Vickers to blame not Sir Clive.
Crayon21
Posts: 357
Joined: Sun Nov 04, 2018 2:33 am

Re: Is it just my imagination or are X and Y flipped?

Post by Crayon21 »

so Y is X and X is Y?
Christ on a cracker steve!
:lol:
In Heck, there are two options for perpetual torment:

Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
:twisted:
User avatar
1024MAK
Posts: 5118
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Is it just my imagination or are X and Y flipped?

Post by 1024MAK »

I assume you are talking about the PRINT AT a,b ?

In BASIC in general, only TAB is universally supported.

Individual BASIC implementations hence use their own systems. It's just something you have to get used to.

If it helps, it's the character position, hence not graphics related. With a character text screen, the "home" position is top left.

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Post Reply