[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
Manic Miner
Posts: 247
Joined: Mon Dec 04, 2017 8:55 pm

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

Post by namco »

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.
User avatar
R-Tape
Site Admin
Posts: 6353
Joined: Thu Nov 09, 2017 11:46 am

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

Post by R-Tape »

namco wrote: Thu Jun 20, 2019 12:39 pm 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!
namco
Manic Miner
Posts: 247
Joined: Mon Dec 04, 2017 8:55 pm

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

Post by namco »

Thanks! :)
Post Reply