maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Atari800 v2.2.1 port and xkbd (https://talk.maemo.org/showthread.php?t=81629)

shawnjefferson 2012-01-15 19:13

Atari800 v2.2.1 port and xkbd
 
I've been using the port of Atari800 by tobiasj of the Atari800 emulator, and it's fine, but there are a couple of problems that I have:

- old Atari800 version (2.0.3)
- key bindings interfere with ASUI and Telescope, which is annoying.

So I started to port version 2.2.1 of Atari800 (SDL). I've got a working port, compiled with --enable-veryslow, --enable-pagedattrib and --disable-monitorbreak which seems to help emulation speed combined with the -refresh runtime parameter (emulated Atari runs very close to 100% and sound is working pretty well.) I've made a few changes to key input to allow xkbd to work for the console keys and fixed the Enter key so it sends Return to the atari.

I decided to avoid all the hardware keys that are bound to system functions, so you really need to use this with xkbd. I've started building a virtual keyboard with atari 800 functions on it, which works pretty well. Right now the keyboard only has Reset, Option, Select, Start, Help, and Break on it, but I'd like to add a few other key presses that are difficult to achieve on the N810 keyboard.

I have some questions about xkbd though... is there a way to send combination keypresses with xkbd? Like "Alt-D" or "Ctrl-Shift-Home" with one button in xkbd?

Addison 2012-01-15 21:49

Re: Atari800 v2.2.1 port and xkbd
 
3 Attachment(s)
Quote:

have some questions about xkbd though... is there a way to send combination keypresses with xkbd? Like "Alt-D" or "Ctrl-Shift-Home" with one button in xkbd?
Xkbd by itself, no, it can't do this.

FIrst off, better version of Xkbd.
http://talk.maemo.org/showpost.php?p=408688&postcount=1

The delay between the keys being repeated by accident is much better in this one. You can forget all of the other junk inside that Keyboards folder.

This could be done using Xbindkeys and XTE on an N810.

For an N800, it would be a little tricky.

Define one of your keys in Xkbd as something obscure, like F12.

In Xbindkeys have something like this.

/home/user/.xbindkeysrc
xte 'keydown Control_L' 'key r' 'keyup Control_L'
F12

or maybe it's
"xte 'keydown Control_L' 'key r' 'keyup Control_L'"
F12

I also attached Xmodmap just in case you need to change the output of a key as well.

If you're making your own buttons, here's a great site if you would like to visually make them more appealing on the screen.
http://cooltext.com/Ghost-Button

To convert your image to .xpm.
http://www.convertmyimage.com/index.php

Any questions and I'll be happy to help. :)

Johnnie Price 2012-01-15 23:03

Re: Atari800 v2.2.1 port and xkbd
 
Just as a note, xbindkeys and xmodmap are available in extas-devel.

shawnjefferson 2012-01-16 19:01

Re: Atari800 v2.2.1 port and xkbd
 
Quote:

Originally Posted by Addison (Post 1151033)
FIrst off, better version of Xkbd.
http://talk.maemo.org/showpost.php?p=408688&postcount=1

The delay between the keys being repeated by accident is much better in this one.

Thanks, I'll try that one out. There is an issue with repeating keypresses with the version I have, but if you press fast it isn't so bad... :)

Quote:

This could be done using Xbindkeys and XTE on an N810.
Frankly most of that was over my head!

I'm still having some trouble with the emulator recognizing certain keypresses (Insert, Delete, Home, End)The problem seems to be with the way the emulator is checking the keyboard, or an interaction with that and xkbd. Testing xkbd with xev shows the keys being pressed.

But for the majority of the others I have assigned them to F-keys, so almost all the functionality of the Atari keyboard is available now. If you know the Atari computer, here is what I'm missing still:

Ctrl/Shift-Insert
Ctrl/Shift-Clear
Tab

and the only hardware buttons assigned:

volume down: Start
volume up: Select
Menu button: Atari800 emulator menu
ESC button: ESC

plays much nicer with Telescope.

Quote:

If you're making your own buttons, here's a great site if you would like to visually make them more appealing on the screen.
http://cooltext.com/Ghost-Button
Thanks for that. What I want to do in the future is create keyboards with graphics of the actual keys from the Atari keyboard, at least for the stuff I'm using xkbd for.

Addison 2012-01-18 23:33

Re: Atari800 v2.2.1 port and xkbd
 
In that above link I provided, keep it all on your memory card and in Xterm, try this...

xkbd -geometry +65536+65536 -k /media/mmc2/N800/Keyboards/RightDosbox2.xkbd & xkbd -geometry +722+65536 -k /media/mmc2/N800/Keyboards/RightDosbox.xkbd

You should get this on your screen.
http://img803.imageshack.us/img803/2...2011817510.png

Xkbd can only do one graphic per key if you want to go that way. So you can't have it change from a lower case letter to an upper case one. This means you can't change the graphic when you press a key either.

Once you have the correct keyboard layout that you want, let me know what special bindings you need for any of them and I'll give you the xte scripts to do those. :)

Addison 2012-01-18 23:42

Re: Atari800 v2.2.1 port and xkbd
 
Here's a quick read on using graphics with Xkbd.

http://talk.maemo.org/showpost.php?p...&postcount=139

Best of luck with your project on this. :)

Addison 2012-01-19 02:14

Re: Atari800 v2.2.1 port and xkbd
 
One other thing.

To have full use of all the function keys, you can do this in Xterm.

/etc/init.d/mce stop

To restore your tablet back.

sudo /etc/init.d/mce start

Be very careful with this though since you'll lose your Task Navigator while running this emulator.

shawnjefferson 2012-01-19 04:00

Re: Atari800 v2.2.1 port and xkbd
 
5 Attachment(s)
Hi,

@Addison:
I tested with the keyboard you showed in your post and the Insert and Delete keys have the same non-effect, so I have to look into the code a bit more on that. I also want to avoid stopping MCE, so I am not using any hardware keys that are used by Telescope (I guess some people may have other hardware keys stole for system functions?)

I'm attaching the version I compiled for anyone who wants to try it out. Install the atari800 package that already available for Diablo (in another thread by tobiasj) first. Copy the atari.bin to the /usr/games/ directory overwriting the original (I made a backup of it first myself).

In that zip file is also the keyboard I'm using. You can see there is very few keys on it, just what you can't produce with the N810 keyboard easily (sorry those with N800s will have to use a more full-featured xkbd!) I also edited the atari800 launch script in /usr/games a bit too...

I added a line to launch my keyboard, and to run the emulator with a larger window by default (you can always go to full screen by pressing the full screen hardware key.)

exec xkbd -k /usr/share/xkbd/atari800.text.xkbd &
exec ${0}.bin -windowed -stretch 1.9 -bpp 16 "$@"


Here's some screenshots as well (taking a screenshot kills the emulator speed!)

Addison 2012-01-19 04:03

Re: Atari800 v2.2.1 port and xkbd
 
Nice!

I'll give a try later tonight and post back.

Thanks Shawn! :)

Addison 2012-01-19 06:52

Re: Atari800 v2.2.1 port and xkbd
 
Quote:

exec xkbd -k /usr/share/xkbd/atari800.text.xkbd & exec ${0}.bin -windowed -stretch 1.9 -bpp 16 "$@"
Is this correct because I receive the following error.

-bash: exec: -b: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]

Also, do I rename atari800.bin to atari800 because that's the original file name I have in /usr/games unless I'm using the wrong version.

Cheers. :)

shawnjefferson 2012-01-19 19:48

Re: Atari800 v2.2.1 port and xkbd
 
I think you need a newline after the &

That`s meant to put xkbd into the background.

Addison 2012-01-20 00:01

Re: Atari800 v2.2.1 port and xkbd
 
Could you copy and paste those two commands that you posted in Xterm?

I keep getting a big error of unhappiness for some reason.

And again, do I rename your atari800.bin file?

Thanks. :)

shawnjefferson 2012-01-20 01:08

Re: Atari800 v2.2.1 port and xkbd
 
1 Attachment(s)
Hi,

You shouldn't rename the atari800.bin file, no. In your /usr/games directory you should have two files:

atari800
atari800.bin

atari800 is just a small script to call the atari800.bin file. Here's the contents of mine after making some small modifications to the original:

Code:

#!/bin/sh
# wrapper for proper WM_CLASS name in SDL apps (needed for icon in taskbar)
#BASEDIR=`dirname $0`
BASENAME=`basename $0`
export SDL_VIDEO_X11_WMCLASS=${BASENAME}
export ATARI_MAEMO_DEVICE=$(awk '/^product/ { print $2;}' /proc/component_version)
exec xkbd -k /usr/share/xkbd/atari800.text.xkbd &
exec ${0}.bin -windowed -stretch 1.9 -bpp 16 "$@"


Addison 2012-01-20 01:45

Re: Atari800 v2.2.1 port and xkbd
 
I'm sorry for being such a pain Shawn. :)

I copied your script, named it at, and made this an executable.

I do have atari800 (old release) and your new atari800.bin in /usr/games.

Anyway, I get this message...

at
/usr/bin/at: line 5: /usr/bin/at.bin: No such file or directory
/usr/bin/at: line 5: exec: /usr/bin/at.bin: cannot execute: No such file or directory

shawnjefferson 2012-01-20 01:56

Re: Atari800 v2.2.1 port and xkbd
 
Hi,

It needs to be called "atari800". When you installed the original Atari800 package, it puts two files into /usr/games: atari800 and atari800.bin. I'm replacing the atari800.bin and making only a small modification to the atari800 file. If you edit the atari800 file to match what I have and replace the atari800.bin with my version from the zip file, you should be good to go.

Addison 2012-01-20 02:06

Re: Atari800 v2.2.1 port and xkbd
 
I'm so lost. *lol*

When I installed Atari, it only put atari800 into /usr/games.

There was no atari800.bin to overwrite with yours that you posted here.

I don't understand. You want me to replace the entire atari800 file (365,681 bytes) with your small launch script?

Is this correct?

Addison 2012-01-20 02:14

Re: Atari800 v2.2.1 port and xkbd
 
I originally installed atari800 2.0.3-2.3 if this means anything.

shawnjefferson 2012-01-20 03:02

Re: Atari800 v2.2.1 port and xkbd
 
Hmm, sorry i guess you have a different version installed of 2.0.3 than i do. In that case you can rename your existing atari800 file and then rename my atari800.bin to atari800. Sorry for the confusion i assumed it would be the same!

Addison 2012-01-20 03:21

Re: Atari800 v2.2.1 port and xkbd
 
Okay.

So I have
atari800
atari800.bin (this is yours)
/usr/bin/at (your launch script)

http://img69.imageshack.us/img69/406...2011922151.png

What do I rename for each of these?

Thanks Shawn. :)

shawnjefferson 2012-01-20 06:48

Re: Atari800 v2.2.1 port and xkbd
 
If you want to keep the old version of Atari800 around (I wonder which you installed and why it's different than the one I have?):

You should be able to rename the "atari.bin" file to "at.bin" (the launch script assumes that the .bin file has the same beginning of the name-I didn't write it, it was part of the tobiasj package that I have installed on my tablet.) You may/will have to move the launch script into /usr/games too.

Whew! That should get it working for you.

Addison 2012-01-20 06:52

Re: Atari800 v2.2.1 port and xkbd
 
Awesome!

Thanks!

Now your script makes complete sense to me. :)

Sorry for being a little slow witted but I can't read code very well.

Anyway, I'm pretty sure I installed this version.
http://talk.maemo.org/showpost.php?p=162401&postcount=1

I don't believe I have ever seen it available for download in the App Manager so that's where I got it from.

Addison 2012-01-20 07:13

Re: Atari800 v2.2.1 port and xkbd
 
Okay.

I deleted the old atari800.

Renamed atari800.bin to atari.bin

Renamed at to atari and put this in /usr/games/

I'm now getting this message....


[1|user@Nokia-N800-43-7|~]/usr/games/atari
/usr/games/atari.bin: error while loading shared libraries: libncurse sw.so.5: cannot open shared object file: No such file or directory

shawnjefferson 2012-01-21 01:40

Re: Atari800 v2.2.1 port and xkbd
 
It would probably be better if I packaged this up as a deb. There is a prerequisite of the ncurses library for this version. I'll try to track down the actual name of the library, I didn't pay attention to what it was exactly.

Addison 2012-01-21 01:44

Re: Atari800 v2.2.1 port and xkbd
 
Thanks Shawn.

I do have libncurses5_5.7+20081213-1_armel but it stated that an update was available but the deb was not installable so I gave up. :)

Addison 2012-01-24 23:20

Re: Atari800 v2.2.1 port and xkbd
 
Hey Shawn.

Any luck with building a deb for this?

If not, could you post a link to all of the dependencies needed and the order in which to install them?

Thanks. :)

shawnjefferson 2012-01-26 02:17

Re: Atari800 v2.2.1 port and xkbd
 
Sorry, no, I haven't had a chance to figure out how to create a deb install yet.

As far as dependencies go, I think libncurses is the only one. I did:

apt-get install libncurses5

I'll have to sort all that out for creating an install package, just need to sit down and actually do it sometime. :)

Addison 2012-01-26 02:22

Re: Atari800 v2.2.1 port and xkbd
 
Okay. I just tried your suggestion.

[1|root@Nokia-N800-43-7|~]apt-get install libncurses5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libncurses5 is already the newest version.
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
gpspmgui: Depends: libqtcore4 (>= 4.5.0) but it is not going to be installed
Depends: libqtgui4 (>= 4.5.0) but it is not going to be installed libqjson: Depends: libqt4-core but it is not going to be installed
libsdl-haa1.2-1: Depends: libsdl1.2 (>= 1.2.10-1) but 1.2.8-23 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


If you can point me to the dependencies, I'll manually install them instead.

shawnjefferson 2012-02-02 03:10

Re: Atari800 v2.2.1 port and xkbd
 
I've got a deb packaged, but it needs to be refined a bit.

Here's the dependencies:

Depends: libc6 (>= 2.5.0-1), libncursesw5 (>= 5.4-1), libpng12-0 (>= 1.2.8rel), libsdl1.2, zlib1g (>= 1:1.2.1)

[sbox-DIABLO_X86: ~/atari800-2.2.1] > ldd atari800
libncursesw.so.5 => /usr/lib/libncursesw.so.5 (0x00b17000)
libm.so.6 => /lib/libm.so.6 (0x00d48000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00791000)
libz.so.1 => /usr/lib/libz.so.1 (0x00b6f000)
libSDL-1.2.so.0 => /usr/lib/libSDL-1.2.so.0 (0x00dc7000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00e42000)
libc.so.6 => /lib/libc.so.6 (0x00943000)
/lib/ld-linux.so.2 (0x00c4e000)
libdl.so.2 => /lib/libdl.so.2 (0x001c7000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x001cb000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x00db4000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00cc9000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x004d5000)

It looks like libncursesw5 is the one you need maybe?

Addison 2012-02-02 03:17

Re: Atari800 v2.2.1 port and xkbd
 
I have ncurses-base_5.4-3.osso1_all installed but I deleted your Atari junk.

I'll start over again and post back tomorrow if I have any luck with this. :)

Addison 2012-02-03 05:48

Re: Atari800 v2.2.1 port and xkbd
 
I'm still so lost on your project Shawn.

I'm sorry.

/usr/games/atari800.bin: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory

libncurses5 is already the newest version and I've also installed ncurses-base_5.4-3.osso1_all.

If you could post exactly each step to install this, I promise I can follow. :)

szopin 2012-02-03 08:18

Re: Atari800 v2.2.1 port and xkbd
 
libncursesw is not the same as libncurses

Addison 2012-02-03 10:01

Re: Atari800 v2.2.1 port and xkbd
 
Joy!

I ended up finding libncursesw from this thread.
http://talk.maemo.org/showthread.php?t=27051

She's working now.

Thanks for this Shawn. :)

shawnjefferson 2012-02-04 04:06

Re: Atari800 v2.2.1 port and xkbd
 
Great, I'm glad that it works for you now. I have created a garage page for this and when I get the deb fine tuned, I'll post it up there along with the source code (not many changes).

https://garage.maemo.org/projects/atari800


All times are GMT. The time now is 16:47.

vBulletin® Version 3.8.8