torsdag 15 december 2011

Space invaders High Score list hack - Update

There's a new version of the high score list hack that has been tested on real hardware

Go there

måndag 3 oktober 2011

Mamepanel with Linux

The Mamepanel is great when building an usb arcade controller. It's a customizable (at build time) joystick/keyboard/volume control in one AVR uC. One drawback is that my two joystick setup wasn't recognized as two 8 button joysticks but rather as one joystick with 18 buttons. This is a known problem with using AVRUSB with a Linux-machine.
The only solution i found to the problem was to recompile the Linux usbhid module and mark the Mamepanel as quirky.
This is how I did it on Debian Lenny:
as root:
Get the source
aptitude update
aptitude install linux-source
tar jxvf /usr/src/linux-source-2.6.26.tar.bz2 linux-source-2.6.26/drivers/hid
cd linux-source-2.6.26/drivers/hid
Add these lines where they fit in /usr/src/linux-source-2.6.26/drivers/hid/usbhid/hid-quirks.c. The USB_DEVICE_ID_WIKIDOT_MAMEPANEL32 device id should probably be changed to something else if an ATMEGA8 is used (can be checked with lsusb).
#define USB_VENDOR_ID_VOTI           0x16c0
#define USB_DEVICE_ID_VOTI_MAMEPANEL32       0x05df
{ USB_VENDOR_ID_VOTI, USB_DEVICE_ID_VOTI_MAMEPANEL32, HID_QUIRK_MULTI_INPUT },
Build and load the new module (It's probably a good idea to check that usbhid.ko exists before rmmodding the old one)
make -C /usr/src/linux-headers-$(uname -r) M=$(pwd) modules
cd usbhid/
rmmod usbhid && insmod usbhid.ko
hope for the best.

onsdag 7 september 2011

Space Invaders high score list hack

(edit) Added a new version to the bottom of the post (/edit)

The space invaders high score hack adds a high score list to Space Invaders, the arcade version, when inserted in the original game code.
Two high score list screens are added. One before a demo game begins and one after a player is game over. If the players score is high enough when game over occurs an enter initials screen is shown.

The hack has been developed using a game version using four 2Kbyte roms. 

The time and effort put into this was greatly reduced by using the thorough disassembly comments by Chris Cantrell at http://computerarcheology.com

Screens
Game over screen

High scores shown before demo screen

Enter initials screen


Download
spacehigh000.zip source and patch in hex format. Does NOT contain any roms.
I have only tried this in MAME so there are NO guarantees that it will work on the real hardware.
spacehigh001.zip source and patch in hex format. Does NOT contain any roms.
This version has been successfully tested on real Midway L-shaped hardware strapped for 9316 EPROMs. The f chip was replaced with a ST M2732A.

söndag 9 januari 2011

MobileLCD

Description
MobileLCD is a J2ME (MIDP2.0) implementation of just enough of the commands in the Goldelox MD1 graphical display module command set to make the GOLDELOX driver in serdisplib work. It can be seen as an J2ME serial LCD Emulator.
The application uses the StreamConnection class and has been tested using, but should not be limited to:
  • Serial port
  • Serial port over Bluetooth

Specs
  • Resolutions: 320, 220, 176, 160, 128, 96, 64
  • Implemented commands: 0x42, 0x45, 0x49, 0x55, 0x56, (0x59 returns ACK but doesn't do much)
  • Goldelox MD1 mode
  • Experimental PICASO SGC rev 5 mode
  • No backlight or screensaver control

Usage
Specify serial port
At startup LCDEmu enumerates the serial ports available on the device (not including Bluetooth ports).
  • To open one of the enumerated serial ports use comm:. Example: comm:USB2
  • To make a serial port connection over Bluetooth use btspp://<remote device address> <channel> Example: btspp://001122334455:1
Set resolution
The resolution can be selected using a list of valid values.
Run
When the set up is done press Run.

Using with Linux
USB cable
When connecting a phone to my Debian box using an USB cable three serial ports show up under /dev/ and it's only a matter of pointing serdisplib to the right one
The display can be tested with serdisplibs testserdisp command (make sure you have the correct permissions to use the port:
testserdisp -n GOLDELOX -p "RS232:/dev/ttyACM2" -d 2

Bluetooth
To connect a phone to my Debian box using Bluetooth I use rfcomm (in bluez-utils package?):
# You probably have to pair your phone with the computer before trying this.
# Add a Serial Port Profile to our computer
sdptool add SP
# Wait for phone to connect to channel 1, create /dev/rfcomm2
rfcomm listen 2 1
# Test display
testserdisp -n GOLDELOX -p "RS232:/dev/rfcomm2" -d 2


Lcd4linux talking to MobileLCD running on a Nokia 2760 over Bluetooth:
Lcd4linux talking to MobileLCD running on a SE P990 over USB:

Download

MobileLCD_0.02.jad 

MobileLCD_0.02.jar