Hi,
>> [...] GUI library [...]
>> [...] option to use C as language.
>That would be very cool. [...]
>I'm skeptical that inventing a launching convention just to keep it residen=
>t in memory would be worth it in this day and age, rather than just having =
>each system file keep its own copy. But allowing use from C would be cool. =
In the light of the recent posts in this thread it might make sense to
elaborate a bit more:
I understood that your primary goal was/is to understand A2D in order
to allow to improve it and add additional DAs.
I think the GUI of A2D is great. But that's a "problem": Every system
file you start looks/feels ugly compared to A2D (maybe with the
exception of mousepaint).
If that "problem" could be "solved" the momentum of A2D could reach a
completely new level.
Inorder to do so the GUI of A2D would need to be available for system
files. Either a) with the GUI code staying in RAM and being shared
(like e.g. done with GEOS) or b) with the GUI code becomeing part of
each system file.
The benefit of a) would be that the system files are smaller. GOES
came from the C64 with extemely slow disk i/o and from the time of
1xxkB floppies.
The benefit of b) would be that system files don't depend on being
lanched form A2D and that system files not requiring all of the GUI
code can omit the parts they don't need.
You already expressed that you prefere b) so in order to actually
realize the potential benefit of b) the GUI code should be
modularized. There should be some core always necessary and there
should be modules with optinal parts. I don't know how much effort you
can/want to spend for that modularization, but if you push that
modularization really far then ca65/ld65 is _THE_ tool for you.
E.g. the library for C programs consists of very many very small .s
files. They just export and reference symbols. The ld65 linker checks
which symbols are refenced by the actual user program and pulls in the
code from the .s files exporting those symbols. But that code
references other symbols. So that pulling in of code continues in a
recursive fashion until all references are satisfied. THen the code
pulled in is placed in memory according to the linker config file
rules. The result is a binary that contains only the code acually
required. That code is placed at different locations for every binary
but that doesn't hurt as the linker takes care of everything. And if
you need to find something in RAM afterards then look at the map file
showing what went where.
So you could reengineer the A2D GUI code to work in the same way the
libary for C programs works.
Additionally you can provide a thin layer on top of the API of the GUI
code to make the code callable from C programs. I've done such a
retrofitting of a C callable layer on top of an existing library
recently with the IP65 TCP/IP library. Here's the layer for the C
function dns_resolve() to give you a rough idea:
https://github.com/oliverschmidt/ip65/blob/master/ip65/dns_c.s
However, the C compiler doesn't know of memory bankng so if you want
to make use of AUXMEM then this would need to be done "inside" your
library. Anyhow, if you are interested in the C option then ca65/ld65
is obviously _THE_ tool for you because of the seamless integration of
C code with "real" libraries written in assembly.
Regards,
Oliver