ZX Spectrum Screen Memory Addresses

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
namco
Manic Miner
Posts: 247
Joined: Mon Dec 04, 2017 8:55 pm

ZX Spectrum Screen Memory Addresses

Post by namco »

I created this last night (I have an offline version) to help me with the screen memory addresses and I'm just sharing in case it helps someone else.

The coloured sections are the zones - the same sections you see when the picture screen is loaded during the tape loading process.

Edit:

New link - try this:

https://docs.google.com/spreadsheets/d/ ... sp=sharing
Last edited by namco on Fri Aug 07, 2020 8:17 pm, edited 1 time in total.
User avatar
Turtle_Quality
Manic Miner
Posts: 502
Joined: Fri Dec 07, 2018 10:19 pm

Re: ZX Spectrum Screen Memory Addresses

Post by Turtle_Quality »

Seems you have to request access to see the spreadsheet
Definition of loop : see loop
namco
Manic Miner
Posts: 247
Joined: Mon Dec 04, 2017 8:55 pm

Re: ZX Spectrum Screen Memory Addresses

Post by namco »

I'll see if I can fix that.

My Google Sheet-fu isn't all that!
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: ZX Spectrum Screen Memory Addresses

Post by RMartins »

This excel like sheet, might be more confusing then useful.

You should try and and look at addresses as Hex numbers, since they are easier to visualize, because they have a direct easy mapping to bits. Each Hex digit (0 to F) maps directly to 4 bits.

What you need to know the memory frame buffer addresses, is to understand how the bits are used.

There are several sources online, but you can have a peak at this one for example:
http://www.breakintoprogram.co.uk/compu ... ory-layout

Focus on this image in particular
Image
namco
Manic Miner
Posts: 247
Joined: Mon Dec 04, 2017 8:55 pm

Re: ZX Spectrum Screen Memory Addresses

Post by namco »

This just helps me with writing the algorithm (the fun part! ;) )

The column on the left is in Hex.

If you draw an 8x8 block from 4000H to 4700H and examine it, you can see that the 2nd number in that address refers to the y position of each individual lines (0 - 7). To get to the next character block, you just need to add 20H and reset the 2nd number from 7 to 0 e.g.
4000H
4100H
4200H
4300H
4400H
4500H
4600H
4700H
4020H
4120H
4220H
...

The x position is easier to understand as each number across (4000H, 40001H etc) are made up of 8 bits. I have visualised it this way as some people may find it easier to work it out like that.
azesmbog
Manic Miner
Posts: 306
Joined: Sat May 16, 2020 8:43 am

Re: ZX Spectrum Screen Memory Addresses

Post by azesmbog »

RMartins wrote: Fri Aug 07, 2020 9:17 pm This excel like sheet, might be more confusing then useful.
https://docs.google.com/spreadsheets/d/ ... sp=sharing
two years ago I drew for myself, in Excel, for clarity. Here I tried to push the dock in Google. Maybe someone else is good for it :)

At the bottom, you can switch a third of the screen.

I did this so that you could make inscriptions anywhere on the screen. For SAA1099 test
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: ZX Spectrum Screen Memory Addresses

Post by RMartins »

Looking at addresses in decimal is a confusing thing.

This is one of the problems of ZX Basic, it doesn't support HEX notation or any functions to convert to/from DECimal <-> HexDecimal.
So if you are using basic, a table like this might be useful in that specific case.

But if you are really serious to program anything on ZX, you will have to go the Assembly or C.
azesmbog
Manic Miner
Posts: 306
Joined: Sat May 16, 2020 8:43 am

Re: ZX Spectrum Screen Memory Addresses

Post by azesmbog »

RMartins wrote: Sat Aug 08, 2020 6:00 pm But if you are really serious to program anything on ZX, you will have to go the Assembly or C.
I program in assembler, but I did the table in Exel, if Exel supports hex arithmetic, then there is absolutely no problem to remake the table. Everything is done on addition formulas there.
But it was already useful to me, any assembler supports decimal numbers.
It doesn't bother me.
User avatar
Seven.FFF
Manic Miner
Posts: 735
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: ZX Spectrum Screen Memory Addresses

Post by Seven.FFF »

azesmbog wrote: Sat Aug 08, 2020 6:33 pm if Exel supports hex arithmetic, then there is absolutely no problem to remake the table. Everything is done on addition formulas there.
DEC2HEX()
HEX2DEC()
DEC2BIN()
BIN2DEC()
HEX2BIN()
BIN2HEX()
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
azesmbog
Manic Miner
Posts: 306
Joined: Sat May 16, 2020 8:43 am

Re: ZX Spectrum Screen Memory Addresses

Post by azesmbog »

RMartins wrote: Sat Aug 08, 2020 6:00 pm Looking at addresses in decimal is a confusing thing.
Finally I redid the table :)
https://docs.google.com/spreadsheets/d/ ... =162900183
Post Reply