Fbcon, cross compile

Hello world!

In joy I upgraded to the newly 1.0 but some things trouble my
mind (or code :wink: ), maybe some of you can enlighten me…

----- fbcon bug ?

try the following:
switch to a new console, e.g. number 2
start a SDL test program, e.g. graywin±-------+
| ###### |
| ###### |
| ###### |
±-------+

is the image, centered on the screen, looks ok as it should

do some shell stuff, console screen starts to scroll
scroll like about half a y screensize
start a SDL program again

±######-+
| ###### |
| |
±-------+

instead of drawing centered to full screen like before, SDL doesn’t seem
to notice that the screen scrolled a little meanwhile

my G200 card seems to use the full video mem to save things which scroll
out on top, SDL doesn’t know and always draws to beginning of video mem ?

another way to see a bug (is it the same bug?):
switch to console 1
switch to console 2
(the graphic demo like above works now, scrollback buffer is lost and SDL
guesses video start correct)

start e.g.
xxx:/bla/bla # ./testvidinfo

xxx:/bla/bla #
5 blank lines!

switch to console 1 (alt f1)
switch to console 2 (alt f2)
and now the picture looks like:

xxx:/bla/bla # ./testvidinfo
Current display: 32 bits-per-pixel
Red Mask = 0x00ff0000
Green Mask = 0x0000ff00
Blue Mask = 0x000000ff
Video hardware has 8192K of video memory
xxx:/bla/bla #

how it should look in the first place

weird ? why is it necessary to switch consoles back and forth to see what
text was just written to the screen ?
are these 2 bugs related ?
or is it just my fbcon implementaion ?
I’m running a G200 with a 2.2.12

----- cross compile SDL + cygwin

I’m trying in porting a application from Linux to Windoze.
Core code, crosscompiled using a Linux hosted Cygwin, works fine so far.
On the Linux side I ported the keyboard and graphic i/o to SDL.
What I forgot in my plans is that SDL requires Mingw for crosscompile
and my application the Cygwin emulation layer to run on Win.

Is it possible to crosscompile from Linux to Windows a program which
requires both Cygwin and SDL?

I tried that already early this year but miserably failed. I got as far
as the compile and link by miracle worked, but whenever I tried starting
the executable on Win it segfaulted. So obviously something was wrong.
Since then SDL has matured and during christmas I may find time to setup
the cross toolchain again. But before I try again maybe somebody has the
same problems like me or has good advice.
I don’t have M$ Windows available for testing so I have to crosscompile
and I have nearly zero knowledge about Mingw vs. Cygwin runtime and
conflicts arising because one part of the programm requires this and
another that runtime.
Is it perhaps possible to compile the SDL .dlls with Mingw and the main
code as usual with Cygwin and link both of them together … ?!?

----- mailing list

I guess I’m missed something, but where on the new website are the
pointers to the mailing list and archives ?

Any help, advice or patches appreciated.

Regards,
Martin

Hello world!

Hello!

In joy I upgraded to the newly 1.0 but some things trouble my
mind (or code :wink: ), maybe some of you can enlighten me…

----- fbcon bug ?

try the following:
switch to a new console, e.g. number 2
start a SDL test program, e.g. graywin
±-------+
| ###### |
| ###### |
| ###### |
±-------+

is the image, centered on the screen, looks ok as it should

do some shell stuff, console screen starts to scroll
scroll like about half a y screensize
start a SDL program again

±######-+
| ###### |
| |
±-------+

Sounds like a bug to me.
Can you print the xoffset and yoffset values in the vinfo structure
in FB_VideoInit()?

----- cross compile SDL + cygwin

I’m trying in porting a application from Linux to Windoze.
Core code, crosscompiled using a Linux hosted Cygwin, works fine so far.
On the Linux side I ported the keyboard and graphic i/o to SDL.
What I forgot in my plans is that SDL requires Mingw for crosscompile
and my application the Cygwin emulation layer to run on Win.

Is it possible to crosscompile from Linux to Windows a program which
requires both Cygwin and SDL?

I have no idea, I’ve never tried it. You might be able to build a
cygwin version of SDL. ??

Is it perhaps possible to compile the SDL .dlls with Mingw and the main
code as usual with Cygwin and link both of them together … ?!?

Try the mingw32 binary archive on the SDL 1.0 download page. It contains
a stub library for SDL that allows your application to link with the SDL.dll
instead of a static library. You might have better success with this since
it’s just like linking with any other Win32 DLL.

----- mailing list

I guess I’m missed something, but where on the new website are the
pointers to the mailing list and archives ?

I’ll try to put a page up tomorrow - remind me if I forget! :slight_smile:

The mailing list archives can be found at:
http://www.lokigames.com/ml/sdl/

The list is also gatewayed to a newsgroup at:
news://news.lokigames.com/loki.open-source.sdl

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

----- fbcon bug ?

try the following:
switch to a new console, e.g. number 2
start a SDL test program, e.g. graywin
±-------+
| ###### |
| ###### |
| ###### |
±-------+

is the image, centered on the screen, looks ok as it should

do some shell stuff, console screen starts to scroll
scroll like about half a y screensize
start a SDL program again

±######-+
| ###### |
| |
±-------+

Sounds like a bug to me.
Can you print the xoffset and yoffset values in the vinfo structure
in FB_VideoInit()?

I inserted print code just after the
/* Determine the screen depth (use default 8-bit depth) */
if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {

On a newly switched to console vinfo.xoffset and vinfo.yoffset are 0
I scroll about half a screen, test program draws wrong
values: 0 and 272
Considering I’m running 800x600, 272 stinks exactly like the # pixel lines
which scrolled up
So I guess the bug is SDL should add yoffset*linesize to drawbufferstart…

Another thing I found when I did my usual check of the system log:
Running a fbcon SDL program …
Dec 9 13:25:57 xxx /usr/sbin/gpm[151]: Error in protocol
Dec 9 13:25:57 xxx /usr/sbin/gpm[151]: Error in protocol
Dec 9 13:25:57 xxx /usr/sbin/gpm[151]: Skipping a data packet (?)
… floods the log with errors, mouse movement doesn’t work
I didn’t find that sooner because my app doesn’t need a mouse

Is there a way to completely deactivate the mouse on fbcon but keep it in X?
(meanwhile I’m just killing gpm…)

----- mailing list

I guess I’m missed something, but where on the new website are the
pointers to the mailing list and archives ?

I’ll try to put a page up tomorrow - remind me if I forget! :slight_smile:

just to remind you … :wink:

Regards,
Martin

On a newly switched to console vinfo.xoffset and vinfo.yoffset are 0
I scroll about half a screen, test program draws wrong
values: 0 and 272
Considering I’m running 800x600, 272 stinks exactly like the # pixel lines
which scrolled up

Yup, it sounds exactly right. Try the latest CVS snapshot code, it
should fix the problem.

----- mailing list

I guess I’m missed something, but where on the new website are the
pointers to the mailing list and archives ?

I’ll try to put a page up tomorrow - remind me if I forget! :slight_smile:

just to remind you … :wink:

Okay, once more… (i’m going home…)

See ya,
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Sam Lantinga wrote:

On a newly switched to console vinfo.xoffset and vinfo.yoffset are 0
I scroll about half a screen, test program draws wrong
values: 0 and 272
Considering I’m running 800x600, 272 stinks exactly like the # pixel lines
which scrolled up

Yup, it sounds exactly right. Try the latest CVS snapshot code, it
should fix the problem.

got the CVS version
took the src/video/fbcon/SDL_fbvideo.c from CVS and replaced the
1.0 version
build 1.0
installed
tried

yes, now SDL programs always draw centered fullscreen.

but upon exit SDL doesn’t seem to restore the fb settings as they were
before starting the SDL app
sometimes I see a shell prompt,
sometimes I see the screen at the moment SDL quit and no prompt, I press
blind return until the (not visible?) shell screen scrolls and poof the
shell text is visible again

and bug 2, the blank lines thing is still there, too

good night,
Martin