question

B

Bill Cunningham

I have a C question that may be OT so if no one wants to respond that's
their perogative.
Using standard C as a base. How can one begin to build a GUI system?
Obviously there must be access to memory IO and the System calls of the OS
if not the kernel. I mean from scratch not from a layer another developer
has designed though that may be convenient.

Bill
 
M

Mark McIntyre

I have a C question that may be OT so if no one wants to respond that's
their perogative.
Using standard C as a base. How can one begin to build a GUI system?

You asked this already, and if not you, someone else recently. You
can't do it in standard C. Therefore its OT here, so please don't
solicit answers. The answer will be different depending on your H/W
and OS, anyway.
 
R

Richard Bos

Bill Cunningham said:
I have a C question that may be OT so if no one wants to respond that's
their perogative.
Using standard C as a base. How can one begin to build a GUI system?
Obviously there must be access to memory IO and the System calls of the OS
if not the kernel. I mean from scratch not from a layer another developer
has designed though that may be convenient.

You know how, when you SAVE "filename" SCREEN$ in BASIC, that basically
does the same thing as SAVE "filename" CODE 16384,6912? Well, then,
obviously screen memory starts at 16384 and takes 6912 bytes. If you can
get a pointer to 16384, and poke into the bytes there, you can
manipulate the screen directly, bypassing <stdio.h>. You'll need

unsigned char *pixel_memory=(unsigned char *)16384;

and then you can read and assign whatever pixels you need to display, 8
pixels to an unsigned char. The bitwise operators will come in useful
for this job. A nice point for the GUI writer is that you need many
horizontal lines, which mostly boil down to blotting a lot of bytes with
0xff, except for the ends.
Note that you _can_ also change the attributes through this, but it's
probably more convenient to also have

unsigned char *attrib_memory=(unsigned char *)22528;

You can find the layout of the screen memory in any decent reference
book; it's not as straightforward as one would like it to be.

Richard
 
J

Joona I Palaste

You know how, when you SAVE "filename" SCREEN$ in BASIC, that basically
does the same thing as SAVE "filename" CODE 16384,6912? Well, then,
obviously screen memory starts at 16384 and takes 6912 bytes.

This is implementation-defined as it's more a feature of the underlying
machine architecture than of BASIC. Not all BASIC dialects support that
syntax of SAVE in the first place.
 
R

Richard Bos

Joona I Palaste said:
This is implementation-defined as it's more a feature of the underlying
machine architecture than of BASIC. Not all BASIC dialects support that
syntax of SAVE in the first place.

Erm... yes. That was more or less the point.

Richard
 
J

Joona I Palaste

Erm... yes. That was more or less the point.

Next time, mark subtleties more clearly. Such as with a <subtlety> tag.
So that idiots like me will also be able to spot them.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Outside of a dog, a book is a man's best friend. Inside a dog, it's too dark
to read anyway."
- Groucho Marx
 
D

Dan Pop

In said:
This is implementation-defined as it's more a feature of the underlying
machine architecture than of BASIC. Not all BASIC dialects support that
syntax of SAVE in the first place.

Have I ever recommended you to engage your brain before posting? You have
*completely* missed Richard's excellent point. And you have proved, once
more, that you're completely humour impaired...

Dan
 
R

Richard Bos

Joona I Palaste said:
Next time, mark subtleties more clearly. Such as with a <subtlety> tag.
So that idiots like me will also be able to spot them.

's your own fault for not having programmed on the One True Home
Computer. So there.

Richard, 14 again
 
J

Joona I Palaste

's your own fault for not having programmed on the One True Home
Computer. So there.
Richard, 14 again

Erm, Richard, aren't you, like, Dutch and stuff? I thought that computer
was only for them Britons. I, being Scandinavian, chose the C=64, AS ANY
FULE KNO.
 
J

Joe Wright

Joona said:
Erm, Richard, aren't you, like, Dutch and stuff? I thought that computer
was only for them Britons. I, being Scandinavian, chose the C=64, AS ANY
FULE KNO.
Scandinavia 1. region in N Europe including Norway, Sweden, Denmark, and
sometimes Iceland & the Faeroe Islands.

When did Finland join Scandinavia?
 
M

Mark McIntyre

Scandinavia 1. region in N Europe including Norway, Sweden, Denmark, and
sometimes Iceland & the Faeroe Islands.

When did Finland join Scandinavia?

You're assuming that
a) Joona was born in Finland and
b) Your (probably american) dictionary knows better than the Finns
whether they're in Scandinavia.

YMMV, but I know which I think is right !

And FWIW, dictionary.com says
"A region of northern Europe consisting of Norway, Sweden, and
Denmark. Finland, Iceland, and the Faeroe Islands are often included
in the region"
 
S

Sheldon Simms

Scandinavia 1. region in N Europe including Norway, Sweden, Denmark, and
sometimes Iceland & the Faeroe Islands.

When did Finland join Scandinavia?

http://www.m-w.com

Main Entry: Scan·di·na·via
Usage: geographical name
1 peninsula N Europe occupied by Norway & Sweden
2 Denmark, Norway, Sweden, & sometimes also Iceland, the Faeroe Islands,
& Finland

http://www.bartleby.com (American Heritage Dictionary)

Scandinavia
SYLLABICATION: Scan·di·na·vi·a
A region of northern Europe consisting of Norway, Sweden, and Denmark.
Finland, Iceland, and the Faeroe Islands are often included in the
region.

http://dictionary.cambridge.org

Scandinavia noun
a region including the countries of Sweden, Denmark, Norway,
and sometimes Finland and Iceland
 
J

Joe Wright

Mark said:
You're assuming that
a) Joona was born in Finland and
b) Your (probably american) dictionary knows better than the Finns
whether they're in Scandinavia.

YMMV, but I know which I think is right !

And FWIW, dictionary.com says
"A region of northern Europe consisting of Norway, Sweden, and
Denmark. Finland, Iceland, and the Faeroe Islands are often included
in the region"
I did quote a dictionary entry (above) but it is not the dictionary
which prevails. That common usage includes Finland in Scandinavia does
not make it right. In this thread I will defer of course to Joona but..
Finland does not share language roots, culture or anything else with
Scandinavia. Finland was occupied by Sweden for a time and might have
been considered 'Swedish' during the period. Finland is no longer
occupied, no longer Swedish and not Scandinavian. I could be wrong of
course..
 
J

Joona I Palaste

You're assuming that
a) Joona was born in Finland and

I *was* born in Finland.
b) Your (probably american) dictionary knows better than the Finns
whether they're in Scandinavia.
YMMV, but I know which I think is right !
And FWIW, dictionary.com says
"A region of northern Europe consisting of Norway, Sweden, and
Denmark. Finland, Iceland, and the Faeroe Islands are often included
in the region"

This is the definition I had in mind.
 
R

Richard Bos

Joe Wright said:
Finland does not share language roots, culture or anything else with
Scandinavia.

Neither do the Sami. So? Is Lappland not Scandinavia?

Richard
 
D

Dan Pop

In said:
Erm, Richard, aren't you, like, Dutch and stuff? I thought that computer
was only for them Britons. I, being Scandinavian, chose the C=64, AS ANY
FULE KNO.

Due to its outstanding price/capabilities ratio, the Spectrum was
THE choice of anyone with a limited budget. Heavily cloned on the "wrong"
side of the Iron Curtain, too, by replacing the ULA chip by a few dozen
74 series ICs.

That's the machine I've learned both Pascal and C on. Also rewrote part
of the firmware, for a clone that was actually executing it from
write-protected RAM.

Dan
 
R

Richard Bos

Joona I Palaste said:
Erm, Richard, aren't you, like, Dutch and stuff? I thought that computer
was only for them Britons.

No, the glorious Sinclair ZX Spectrum was for everybody who recognised a
fine machine when they saw one. Except Germans, who were probably
required by law to use the inferior home-grown product.
I, being Scandinavian, chose the C=64, AS ANY FULE KNO.

Heathen!

Richard
 
I

Irrwahn Grausewitz

No, the glorious Sinclair ZX Spectrum was for everybody who recognised a
fine machine when they saw one. Except Germans, who were probably
required by law to use the inferior home-grown product.

What? Ah... hehehe. No, wait... Huh? Who?? Err... what???

I'm not sure I really get the joke...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,220
Latest member
AugustinaJ

Latest Threads

Top