DarkPhear

Sunday, July 19, 2009






A full console-style classic RPG, done by me. DarkPhear was originally released for DOS in 2001, unfortunately, the DOS platform was already dying at that time. But this is no longer a problem. Now, thanks to FreeBASIC , DarkPhear is ported to more modern platforms. The game includes support for mouse, joystick, selection of language Portuguese / English, four levels of speed, sprite/pixel-based graphics, turn based battles, digital sound, and excellent songs composed by my friend Jeremy Eller. This new version has a few improvements and bug fixes, keeping the gameplay pretty much intact.

Title: DarkPhear ®

Platforms: Linux / Windows / wine
License : Freeware game / GPL code.
Status: Complete.


DarkPhear has been granted the FamousWhy Editor's Pick Award:

DarkPhear


DOWNLOAD NOW

DarkPhear is Copyright (C) 2010 Cleber de Mattos Casali. All rights reserved.

Read more...

DarkPhear






Um RPG clássico estilo console, completo, feito por mim. DarkPhear foi originalmente lançado em 2001 para DOS; infelizmente, a plataforma DOS já estava morrendo naquela época. Mas isto não é mais problema. Graças ao FreeBASIC, DarkPhear foi portado para as plataformas mais modernas. O jogo inclui suporte a mouse, joystick, seleção de idiomas Português / Inglês, quatro níveis de velocidade, gráficos baseados em sprite/pixel, batalhas por turnos, som digital, e excelentes músicas compostas por meu amigo Jeremy Eller. Esta nova versão trouxe algumas melhorias e correção de bugs, mantendo a jogabilidade praticamente intacta.

Título : DarkPhear ®

Plataformas : Linux / Windows / wine
Licença : Jogo freeware / código GPL.
Status : Completo.


DarkPhear has been granted the FamousWhy Editor's Pick Award:

DarkPhear


BAIXAR AGORA


DarkPhear is Copyright (C) 2010 Cleber de Mattos Casali. All rights reserved.

Read more...

Joystick : Remapeando botões e eixos no Linux

Saturday, July 4, 2009

Tenho muitos joypads / joysticks com muitos esquemas diferentes botão, e utilizando este simples utilitário posso reconfigurar o layout dos botões, executando um simples script, ao invés de reconfigurar todos os jogos e emuladores sempre que eu quiser usar um joystick diferente.

Faça o DOWNLOAD aqui:
http://www.mediafire.com/?msitbdej0ad
http://ubuntuforums.org/attachment.php?attachmentid=66632&d=1208782381

É uma versão alterada do utilitário "jscal" do pacote "joystick". Este utilitário permite o remapeamento de botões e eixos diretamente junto ao driver.

Compilei para o Ubuntu 7.10 AMD64, mas vai funcionar com qualquer versão posterior. Além disso, você pode recompila-lo para qualquer versão, ao fazer um "make clean; make"

Procurei uma ferramenta que me permitisse fazer isso durante muito tempo. Encontrei-a aqui: http://bugs.debian.org/cgi-bin/bugreport.cgi? bug = 444142

Citando o autor do patch (traduzido com Google translator):


Citação:
Pacote: joystick
Versão: 20051019-1
Severity: wishlist
Tags: patch

Motivação

Eu encontrei nenhuma ferramenta simples que remapear o joystick eixos
e botões no dispositivo controlador nível (joydev módulo), enquanto que o condutor
prevê claramente a interface para isso. Meu sistema estende-se a
capacidades de jscal, a fim de remapear eixos e botões. Enquanto
remapeamento X no ficheiro de configuração é possível, que o mapeamento não
aparentemente para ajudar em todos os jogos.


Detalhe

Eu comprei uma Trust GM-2550 Predator joystick no outro dia, e eu reparei
que os eixos foram mapeados incorretamente: a borboleta no lugar do
leme, bem como o botão do pinky eixos foram deslocados até 1 ranhura no eixo
mapa. Eu encontrei nenhuma ferramenta para re-mapear os eixos sobre o driver de dispositivo (joydev)
nível. Embora remapeamento é possível, no X config, esta situação não se resolve
para o problema - por exemplo - SearchAndRescue.

Também achei nada para remapear os botões do joystick driver de dispositivo
nível. Isto é muito necessário, por exemplo, para tuxkart, porque alguns dos
utiliza os botões do jogo são, infelizmente, inacessível, mantendo
confortavelmente o joystick (alguns botões estão demasiado longe no stick).

Achei que o módulo do kernel joydev API para não fornecer os eixos e
botão remapeamento. Eu adicionei duas opções de linha de comando para jscal e dois
respectivas funções que utilizam a API e remapear botões e eixos.
Eu testei os eixos e remapeamento botão, e ele funciona como se pretende. I
podem trocar botões e eixos como eu desejo.


Implementação

Por favor, localize o diff do joystick jscal.c em anexo (joystick.diff).

A modificação jscal.c acrescenta dois argumentos da linha de comando:

-q - print-mapeamentos Imprimir o actual eixo eo botão
mapeamentos jscal como uma linha de comando

e

-u n_of_buttons, btnmap1, btnmap2,
...> - Set-Define mapeamentos eixo eo botão mapeamentos para o
valores especificados

Um exemplo de saída de-q parece com isso (./jscal -q /dev/input/js0):

jscal -u
10,0,1,2,5,6,16,17,40,41,42,13,288,289,290,291,292, 293.294.295.296.297.298.299.300
/dev/input/js0

O joystick tem 10 eixos e 13 botões. Se agora é a de um interruptor eixos 2
e 5 (para obter o leme e do acelerador à direita), um tem de executar:

jscal -u
10,0,1,5,2,6,16,17,40,41,42,13,288,289,290,291,292, 293.294.295.296.297.298.299.300
/dev/input/js0

mudando 2,5 para 5,2 na linha.

Remapeamento botões é feito da mesma maneira.


Além disso, existe um método muito bom de carregar a configuração automaticamente quando você conecta seu joystick, usando o udev.

Primeiro você deve criar uma regra udev. Esta é a minha:

##/etc/udev/rules.d/85-joy-config.rules

# # digiusb 0e8f: 0013
BUS == "usb", ACTION == "add", attrs (idVendor) == "0e8f", attrs (idProduct) == "0013", RUN + = "/usr/bin/joy-config-digiusb.sh"

# # genesis6b 0f00: 0008
BUS == "usb", ACTION == "add", attrs (idVendor) == "0f00", attrs (idProduct) == "0008", RUN + = "/usr/bin/joy-config-genesis6b.sh"


Como você pode ver, a regra irá executar o script especificado, logo que o dispositivo com o dado idVendor e idProduct for conectado.

E assim eu fiz os scripts:

"/usr/bin/joy-config-digiusb.sh"
#!/bin/bash
# digiusb 0e8f: 0013
# /usr/bin/joy-config-digiusb.sh
sleep 1
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js0
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js1
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js2
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js3


"/usr/bin/joy-config-genesis6b.sh"
#!/bin/bash
#genesis6b 0f00: 0008
#/usr/bin/joy-config-genesis6b.sh
sleep 1
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js0
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js1
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js2
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js3


Acrescentei um "sleep 1" apenas no caso de o driver não carregar a tempo.

Importante: não se esqueça do "#!/bin/bash" ou tudo vai falhar silenciosamente.

Além disso, os meus scripts tentarão aplicar o layout para js0-3, uma vez que isso só terá êxito se o dispositivo corresponder ao layout de botões / eixos. Eu não pude descobrir uma solução mais elegante, mas esta funciona para mim.

Espero que você ache útil.

Divirta-se.

Read more...

Remapping joystick buttons and axes on Linux

I have many joypads / joysticks with many different button layouts, and by using this simple utility I can reconfigure the button layout by running a simple script, intead of reconfiguring every game and emulator everytime I want to use a different joystick.

DOWNLOAD it here:
http://www.mediafire.com/?msitbdej0ad
http://ubuntuforums.org/attachment.php?attachmentid=66632&d=1208782381

It's a patched version of the jscal utility from the joystick package. It will allow the remapping of buttons and axes directly into the driver.

It's compiled for Ubuntu 7.10 AMD64, but it will work with any later version. Also, you can recompile it to any version by doing a "make clean;make"

I have been looking for something like this for ages. Found it here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444142

Quoting the patch author:


Quote:
Package: joystick
Version: 20051019-1
Severity: wishlist
Tags: patch

Motivation

I found no simple tool that would remap the joystick axes
and buttons on the device driver level (joydev module), while the driver
clearly provides the interface for this. My patch extends to
capabilities of jscal in order to remap axes and buttons. While
remapping in the X configuration file is possible, that mapping does not
seem to help in all games.


Detail

I bought a Trust GM-2550 Predator joystick the other day, and I noticed
that the axes were mapped incorrectly: the throttle in place of the
rudder, and the pinky button's axes were shifted up 1 slot in the axis
map. I found no tool to re-map the axes on the device driver (joydev)
level. While remapping is possible in the X config, this did not solve
the problem for - for example - SearchAndRescue.

Also I found no way to remap joystick buttons on the device driver
level. This is quite necessary for example for tuxkart, because some of
the buttons the game uses are unfortunately unreachable while holding
the joystick comfortably (some buttons are too far on the stick).

I found that the joydev kernel module does provide the API for axes and
button remapping. I added two command line options to jscal and two
corresponding functions that utilize the API and remap buttons and axes.
I have tested the axes and button remapping, and it works as intended. I
can swap buttons and axes as I wish.


Implementation

Please find the diff of jscal.c in joystick attached (joystick.diff).

The modified jscal.c adds two command line arguments:

-q --print-mappings Print the current axis and button
mappings as a jscal command line

and

-u n_of_buttons,btnmap1,btnmap2,
...> --set-mappings Sets axis and button mappings to the
specified values

An example output of -q looks like this (./jscal -q /dev/input/js0):

jscal -u
10,0,1,2,5,6,16,17,40,41,42,13,288,289,290,291,292 ,293,294,295,296,297,298,299,300
/dev/input/js0

The joystick has 10 axes and 13 buttons. If now one is to switch axes 2
and 5 (to get the rudder and the throttle right), one has to execute:

jscal -u
10,0,1,5,2,6,16,17,40,41,42,13,288,289,290,291,292 ,293,294,295,296,297,298,299,300
/dev/input/js0

changing 2,5 to 5,2 on the line.

Remapping buttons is done the same way.


Then, there is a very good way to load the joystick layout configuration automatically when you plug the device, with udev.

First you must create a udev rule. This is mine:

##/etc/udev/rules.d/85-joy-config.rules

##digiusb 0e8f:0013
BUS=="usb",ACTION=="add",ATTRS{idVendor}=="0e8f",ATTRS{idProduct}=="0013",RUN+="/usr/bin/joy-config-digiusb.sh"

##genesis6b 0f00:0008
BUS=="usb",ACTION=="add",ATTRS{idVendor}=="0f00",ATTRS{idProduct}=="0008",RUN+="/usr/bin/joy-config-genesis6b.sh"


As you can see the rule will execute the specified script as soon as the device with given idVendor and idProduct is plugged.

This is how I did the scripts:

"/usr/bin/joy-config-digiusb.sh"
#!/bin/bash
#digiusb 0e8f:0013
#/usr/bin/joy-config-digiusb.sh
sleep 1
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js0
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js1
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js2
jscal -u 4,0,1,16,17,10,289,290,291,293,294,295,296,297,288,292 /dev/input/js3


"/usr/bin/joy-config-genesis6b.sh"
#!/bin/bash
#genesis6b 0f00:0008
#/usr/bin/joy-config-genesis6b.sh
sleep 1
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js0
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js1
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js2
jscal -u 2,0,1,16,309,310,311,312,313,314,308,316,317,318,319,315,304,305,306,307 /dev/input/js3


I have added a "sleep 1" just in case the driver doesn't get ready on time.

Important: don't miss the "#!/bin/bash" or it will silently fail.

Also, my scripts will attempt to apply the layout to js0-3, as it will only succeed if the device matches the button/axis layout. I couldn't figure out a more elegant solution, but this one works for me.

Hope you find it useful.

Have fun.

Read more...
Easy-Share


template by Ourblogtemplates.com
©Copyright 2009, Cleber de Mattos Casali. All rights reserved.