[cc65] OT: Where to get some help?

From: Payton Byrd <plbyrd1gmail.com>
Date: 2010-04-24 02:40:52
I am moving right along on my project, but I've run into a common problem
that windowing libraries have solved time and again and I'm looking for
advice on how to implement a solution in C.

The problem is that when I draw a drop down menu (or a pop-up window) I want
to preserve the text under the menu and restore it when the menu goes away.
 I can see three approaches, but I'm not sure if there are C functions to
aid either or if I'm going to have to roll-my-own code.

Approach 1: Copy the entire screen to another page in memory and move the
start memory for the current screen to the copy, then draw the menu.  When
I'm done with the menu, set the screen pointer back to the original screen
and keep going.  What concerns me is the amount of time it would take to
copy the screen using C, so I'm thinking this might be a job for some inline
assembler, unless there's already a function out there to do this.

Approach 2: Copy the contents of the screen where the menu is to be
displayed into an array where the size of the array is height * width, then
write the contents of the array back to the screen one line at a time.  I
see two problems with this approach: first, the array might get quite big
and I don't know the maximum size of an array in CC65; second, how do I
obtain the contents of the screen?  Should I use the screen codes from
memory and write the screen codes back to memory?  If I'm going to be
writing screens directly to memory then what's the point of using CONIO?

Approach 3: Simply invalidate the screen and force a full refresh.  This may
be the simplest, but it could be expensive as the screen may be very
complex.  Plus, if there's some text that was generated organically and
can't be repeated then such text would be lost.  I'm not fond of this
approach, but if all else fails....

Maybe I'm going about this all wrong!  Does anyone know of a publicly
available windowing library for text mode on CBM machines?  A port of curses
for CC65 would rule the world, if there's enough resources on our machines
to handle such a library.
-- 
Payton Byrd
<http://www.paytonbyrd.com>
<http://it.toolbox.com/blogs/paytonbyrd>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Apr 24 02:41:19 2010

This archive was generated by hypermail 2.1.8 : 2010-04-24 02:41:21 CEST