[Z80]: 16k org and last known position from drawline/plot

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

[Z80]: 16k org and last known position from drawline/plot

Post by namco » Thu Jun 20, 2019 11:39 am

Just a couple of quick z80 questions:

1) I've got a game I coded for the 48k and uses an org of 30000 but it's small enough to be a 16k title. What org setting should I use to ensure this (as I'm sure that 30000 is too much for the 16k)?
[Edit]: Thinking about it the question should really be what's the lowest org number I can use for maximum memory use on a 16k? I keep forgetting whether the org number is decimal or not!

2) I'm using the draw line function (via Z80) and I've been testing it's drawing through a keypress. I've noticed that it seems to know the last position that was drawn and it carries on drawing from the last point. Where do I find the x,y position of the last plot/draw line?

Thanks.
0 x

User avatar
R-Tape
Site Admin
Posts: 2591
Joined: Thu Nov 09, 2017 11:46 am

Re: [Z80]: 16k org and last known position from drawline/plot

Post by R-Tape » Thu Jun 20, 2019 12:22 pm

namco wrote:
Thu Jun 20, 2019 11:39 am
Just a couple of quick z80 questions:

1) I've got a game I coded for the 48k and uses an org of 30000 but it's small enough to be a 16k title. What org setting should I use to ensure this (as I'm sure that 30000 is too much for the 16k)?

2) I'm using the draw line function (via Z80) and I've been testing it's drawing through a keypress. I've noticed that it seems to know the last position that was drawn and it carries on drawing from the last point. Where do I find the x,y position of the last plot/draw line?

Thanks.
How big is the code?

Either way, CLEAR 23999 and put your code at 24000 is safe (assuming you don't have a sizeable BASIC program as well).

Addresses 23677, 23678 store the last plotted X,Y so you can get or modify the value of these in your program.

Looking forward to seeing the game!
2 x

namco
Dizzy
Posts: 98
Joined: Mon Dec 04, 2017 8:55 pm

Re: [Z80]: 16k org and last known position from drawline/plot

Post by namco » Sun Jun 23, 2019 6:20 pm

Thanks! :)
0 x

Post Reply