Applecorn icon indicating copy to clipboard operation
Applecorn copied to clipboard

Make more space in Aux LC by moving some stuff to main

Open bobbimanners opened this issue 2 years ago • 14 comments

Non performance-critical code can be moved to main mem.

We have 866 bytes of Aux LC left at the time of writing.

bobbimanners avatar Dec 29 '22 01:12 bobbimanners

Font-exploding code can move, for a start.

bobbimanners avatar Dec 29 '22 06:12 bobbimanners

Most likely the SHR line-drawing stuff can live in main memory. It is not going to slow it down appreciably.

bobbimanners avatar Dec 29 '22 06:12 bobbimanners

Moved font exploding code and coordinate conversion to main memory.

823 bytes left in aux LC. (We added support for VDU 23 also, which explains why the number didn't go up more.)

This is a decent base for adding SHR graphics in main memory.

bobbimanners avatar Dec 30 '22 00:12 bobbimanners

How much space is left in mainmemory? The code goes up to about 6000, how far can it go?

jgharston avatar Dec 31 '22 07:12 jgharston

The absolute limit is BFFF. ProDOS keeps some stuff up there so you can't go all the way to the top. There is quite a lot of free space in main mem. I am planning on putting all the line drawing code in main memory, but even so, we have oodles.

bobbimanners avatar Dec 31 '22 07:12 bobbimanners

On 31-12-2022 07:25, Bobbi Webber-Manners wrote:

The absolute limit is BFFF. ProDOS keeps some stuff up there so you can't go all the way to the top. There is quite a lot of free space in main mem. I am planning on putting all the line drawing code in main memory, but even so, we have oodles.

I've been pondering how much of the VDU code could move over. The main non-VDU-call stuff that needs to be exposed is the flashing cursor and reading characters from the copy cursor. Most of the other stuff looks easy enough to do via a shim, read pos/vpos, read vduvar, read point colour, read character bitmap.

-- J.G.Harston - @.*** - mdfs.net/jgh

jgharston avatar Dec 31 '22 07:12 jgharston

Well I guess it depends on how much new functionality we are planning to add :)

I think I have enough space to finish up SHR graphics. Just line drawing and clipping left now really. The rest is there.

And there is a fair bit of SHR code that I could easily move to main memory (the colour and palette stuff.)

bobbimanners avatar Dec 31 '22 07:12 bobbimanners

So I guess I am saying, I wouldn't sweat it too much at the moment!

bobbimanners avatar Dec 31 '22 07:12 bobbimanners

Moved all SHR palette setting code to mainmem.

bobbimanners avatar Jan 14 '23 07:01 bobbimanners

173 bytes free in aux LC at present. Planning to push the SHR cursor code over to main memory which will maybe save another 100-200 bytes in aux LC.

bobbimanners avatar Jan 17 '23 03:01 bobbimanners

After moving SHR cursor stuff to main ... 232 bytes free in aux LC.

bobbimanners avatar Jan 17 '23 03:01 bobbimanners

I'm going to investigate moving some of the keyboard driver into main.

jgharston avatar Jan 21 '23 16:01 jgharston

There's the coordinate clipping stuff mentioned in the other issue. I think this would be easier to deal with after moving the code into main. I think I might need to print out some listing to work out where in the code to switch banks and pass info across. I think that the whole of VDU25 might be the easiest, just make VDU25 a stub that switches banks, and the the code in main reads across the VDU queue. And once that's done, I think there's quite a bit of code the HGR and SHR drivers can share.

jgharston avatar Jan 21 '23 20:01 jgharston

That may make sense. For MODE 0 / MODE 1 I do the clipping after the coordinate transformation to physical coords, which may not fit with that plan. Also note that because the "Super High Res" mode is a GS feature only, I can use 65816 code in the SHR code, which makes doing 16 bit ops a lot nicer. Lots of trade-offs here.

bobbimanners avatar Jan 22 '23 18:01 bobbimanners