Rabu, 26 Desember 2012

Minecraft Joypad Mod 0.12.1

Minecraft Joypad Mod 0.12.1


Minecraft forum user under the name "Maguin" noticed that the "shift click" functionality used to quickly transfer items between the containers is not working correctly in the 0.12, so I'm releasing the fix.

Changelog for version 0.12.1:
-[fix] fixed the "shift click" functionality

Thanks for noticing it!

Download the Joypad / SplitScreen mod 
Password; getitnow

Selasa, 04 Desember 2012

Playing backups on GameCube - making your own XenoGC

When faced with the problem of scratching discs one starts to seek the alternatives to wearing out once expensive GameCube games. One solution is making a backup copies of our games and playing (and inevitably scratching) them while the original ones sit safely on the shelf.
Creating and playing backups is not endorsed by Nintendo so we need to somehow fit our GameCube with the possibility to load copies on our own. Popular choices include SD Media Launcher as a non-intrusive solution or the variety of modchips which have to be soldered to the drive control board in order to operate. A few short years ago the XenoGC modchip was amongst the most used chips on the market due to it's low price, relatively easy installation and good compatibility. Unfortunately, nowadays it's quite rare to stumble upon an affordable and available modchip. It seems that the XenoGC authors have ended the production and the few units resellers still have in stock have reached the high price level. Thankfully the authors have also released the full sources of the XenoGC firmware, so with a bit of determination and right tools we can change a small, cheap heap of electronics into a working XenoGC modchip.


All you need now is a hammer


Important note: this guide includes instructions for opening your console and messing up with its internals. Be particularly attentive of the part where you apply 200° C hot solder to the delicate pins of the debug port on the motherboard. And all other dangerously sounding parts too.

Author of this article takes no responsibility for any kind of damage caused by following these instructions, including, but not limited to continuing sadness, depression, feel of emptiness, and/or others. You are following the instructions on your own responsibility.

Basics

In order to create a XenoGC replica we need a decent soldering skills, a soldering iron, and a way to program Atmel Atmega8 MCU. It can be programmed using a regular AVR ISP programmer, an Adruino, or a hanful of home made programmers. I plan to write a blog post about turning Arduino Uno into an ISP programmer, but for now lets presume we have a working AVR programmer.
The parts themselves should not cost more than 10 euros in total, not counting tools.

The XenoGC is based on the Atmel Atmega8L microcontroller, but we can alternatively also use Atmega8 or Atmega8A instead, as they're all compatible from the point of view of creating a XenoGC-like chip. That part alone costs a couple of euros, the rest are mainly supporting components: 

  • two 100nF capacitors 
  • one 1K reistor 
  • two 220/330R resistors 
  • two LEDs, preferrably in different colours, and 
  • a length of thin insulated wire. 

Optionally you'd also need a perforated pertinax board, a 28pin narrow IC socket and a hot glue gun, but this varies based on how are you going to accommodate the space inside the GameCube, as it's generally a limited commodity. I opted for building a robust version with as much redundancy in cabling and space as seemed appropriate, but I ended unable to fit it inside the console's casing. If I were to do it again I would use my experience to build a smaller version.

Note that you'll also need a big gamebit screwdriver in order to open the GameCube.

Burn it

We're going to start with programming the Atmega MCU with the precompiled XenoGC binary, which can be downloaded from here. The package includes the full source code which can be useful for further development, as well as few binaries for different versions of XenoGC firmware. The differences between files can be read on the GC Forever Wiki. It makes no big difference which file we decide to use, as far as we pick the working version and suitable for our console's region.

I used the Arduino Uno as an AVR ISP programmer and avrdude as the software. The command for checking whether the MCU was properly detected was as follows:
avrdude -p m8 -c avrisp -P COM3 -b 19200


Note that I had to override the baudrate or the avrdude would bomb out. In your case you should adjust the programmer and serial port params if they differ.

Next, I burned the fuses:
avrdude -p m8 -c avrisp -P COM3 -b 19200 -v -U lfuse:w:0xC4:m -U hfuse:w:0xD9:m

Finally, the hex itself:
avrdude -p m8 -c avrisp -P COM3 -b 19200 -v -U flash:w:your_file_name:i

Build it


Soldering the XenoGC board is not particularly hard. The one important thing worth taking into consideration is the difference between the Atmega8/8A and 8L MCUs. The latter has the continuity between the VCC and AVCC pins, while the former doesn't. This means the 8/8A MCUs needs the second 100nF capacitor between the AVCC and GND, while the 8L doesn't.

LED's are not required but useful to confirm the XenoGC was installed (and is functioning) correctly.
Original design used green one on pin 4 and red one on pin 5, but you can use whatever colours you want.

You should solder the MCU and leave the long-ish strip of thin wires for the connection to the debug port. If you make your board small and compact you might cram it inside the GameCube, otherwise plan how to attach it outside of the casing. 

When you have soldered the board you should open your console and lift the drive control board to access the debug port.


Note that the pins of the port are very small. You have to have thin wires and a steady hand in order to solder them properly and not short any connections. In the case of trouble desoldering tape is your friend. 

Word of notice: the top left pin of the port is the 3.3V. It is suitable for Atmega 8L, but Atmega8 requires 5V, which you should get from elsewhere, for example from the bottom of the board:

This is how I soldered the wires:
Some hot glue ensured the wires stay in place well insulated:

Don't actually put the hot glue until you verified it working. The easiest way to do so is to power up the console and watch the LEDs. The red LED should light up and after a few seconds be replaced by the green one, like on the following video:

Note that in my case, the XenoGC would not work every time. It seems that each time I power up the console, there's around 25% chance of the LEDs not powering up, or just the red one staying lit. I don't know what exactly it is related to, nor whether this issue appeared on the original XenoGC, but it's not very annoying, just keep the LED on the visible spot, and reset the console until the green one lights up.

Afterwards the MCU board should be permanently attached to the GameCube, wherever you find enough space. I placed it on the outside, attached to the back of the console with some more hot glue:
Two DE-15 connectors were used to be able to detach the MCU from the board in the future if the need arises.

Our GameCube is now happy to boot some backup media. Yay!

More pics

Rabu, 18 Juli 2012

Minecraft Joypad Mod v0.11.3





Hello,

After quite some time I've decided to port my Joypad Mod to the newest version of Minecraft - 1.3.2. I'm happy to announce that the work is done, and the version 0.11.3 - released. Read more for some back story.

This was the first time I updated the mod to the different version of Minecraft. Thanks to the awesome work the MCP team is doing in decompiling the original jar file it was not too hard to do.

But since I had some long standing issues with the mod functionality I wanted to tackle, I took some time to figure things out, and not just simply port the old code.

This first and maybe the most important problem was the inability to map all of the game features to all kinds of input events. Some actions like jumping and attacking had to be assigned to buttons, while moving the player and camera required using analog sticks. This made attacking with analog triggers as well as moving with a directional pad impossible. Since some people don't have two analog sticks on their controllers, and the XBox 360 gamepad has analog triggers (instead of shoulder buttons) this was quite an issue.

The problem lied in the way the Minecraft and lwjgl together handle the input. Lwjgl provides the Controller object which can give the state of all its inputs, but each kind of input is accessed by different methods with different signatures. Reading button's state gives you a boolean, reading a pov leaves you with an integer, while an axis returns a float. This forced the programmer to make certain assumptions about input handling, and either duplicate a lot of code, or stick to known input combinations.

In order to handle this kind of variety I added a bunch of abstraction. ControllerInputEvent interface which provides access to methods like isPressed() and getAnalogReading(), and a specific implementations for each kind of input event which do the work. This, together with the new format of the settings file string made possible to bind any action to any event.

Changing the controls by editing the settings file was complicated for many users, and an additional level of complexity was not making it any easier, so in order to take an advantage of the new architecture and still be accessible to the users I decided to implement the controller settings right into the game options screen.



While doing so I improved the way buttons are selected by the controller using all four directional buttons, so navigating the menus is now much easier. One thing that is still left to be finished is navigation through the lists, for example the "Select world" screen.

At the end I took some time for fun features, so I decided to implement visual in-game hints for the controls. Those can be disabled from the menu.



I also kinda reintroduced the "interact" feature, which currently acts as a way to open doors and switch levers without a risk of accidentally placing a block in hand.

Toggle-sneak is also now an option which you can turn off, going back to the standard Minecraft way of sneaking.


Changelog for version 0.11.3:

  • [update] updated the mod to the Minecraft 1.3.2
  • [add] added ability to map any mod feature to any input action. It's now possible for example to map the movement to D-Pad or jump to an axis. This was added mostly to support controllers with unsufficient amount of analog axes (i.e. pure digital controllers) and controllers which have an analog triggers in place of shoulder buttons (all XInput-compatible controlles, including an XBox360 controller)
  • [add] added possibility to change the most of the mod settings (including controls) via in-game settings screen.
  • [add] displaying on-screen controls hints (can be disabled in the settings)
  • [add] XInput-compatible controllers (XBox360, Logitech Chillstream) will have friendly button names displayed (A,X,LB,LT etc)
  • [add] option to switch off toggle-able sneak
  • [update] improved menu and inventory navigation
  • [update] made the default controls vaguely reassabmle the controls on the XBox360
  • [add] separated the gui left and right movement from the changing held item controls
  • [fix] fixed interact action in multiplayer
  • [fix] fixed game crash at startup when the controls refer to non-existing controllers, axis or buttons.

IMPORTANT: If upgrading from the previous version, backup and delete your old options.txt in order for the new options to generate properly.


Download from here: Minecraft Joypad Mod v0.11.3.

Senin, 30 April 2012

Minecraft Joypad Mod v0.10

Minecraft Joypad Mod v0.10
Hello,

Last couple of days I've been working on improving the Joypad Mod. I'm happy to announce that the version 0.10 is ready for testing.



I've tackled the problem of menu navigation. The first working solution is included in 0.10 - up and down buttons on the D-pad allow you to navigate through the list of all buttons on the screen. Nothing fancy, but allows you to make your way out of the main menu, bed and death screens. Still have some work to do to make the list navigation functional - so that singleplayer and multiplayer screens function properly.

I've fixed the inventory in the Creative mode. It's not super handy, but usable at least.

I've also included the shift-click functionality (button number configurable in options.txt) which should make the navigation in container screens a bit faster.

Quite some time was spent to make the Enchantment table behave acceptably. Since it includes a grid of slots and custom controls for crafting, I applied a considerable amount of conditional 'glue' to make everything appear remotely consistent.

The people which had the problem of uneven camera sensitivity tied to the varying FPS might be interested in the new experimental option which can be turned on in the options file to make the camera controls independent of the FPS. It's turned off by default as it sometimes require you to enter the world twice in order for the controls to work (WTF).

Last but not least, I've added the configuration utility which can be used to figure out the joypad and button id's. Might be handy for the people struggling with the configuration. In the future I can turn it into a config file generator if such need arises. For now it only displays the id's of the controls you press.

I have still not worked on the solution for the triggers on the XBox 360 controller. Have to leave something for the next release ;).



Full changelog ahead:


  • [add] added "shift-click" functionality (mapped to a button)
  • [add] added navigation map for Enchatnment Table. Player should be able to operate it now.
  • [add] added possibility to open the main menu
  • [add] added a menu navigation (works on buttons, still doesn't work on lists though) - this makes a main menu, death screen, bed screen usable now. Only up/down d-pad button are used, so it sometimes looks funky, but works.
  • [add] added experimental constant-camera-movement mode. It makes the camera movement independent of FPS. It should help the people for whom the camera sensitivity skyrckets after the world fully loads. Turned off by default, as it sometimes requires you to enter the world twice for it to work correctly. The config file option is named "useConstantCameraMovement"
  • [add] added a small utility program which shows joypad id's, as well as id's of buttons and axes. The aim is to help people to properly configure the mod
  • [improvement] tooltip and icon follows the item instead of the mouse curosr while using the container gui's
  • [fix] fixed error preventing Creative gui screen from working correctly

IMPORTANT: If upgrading from the previous version, backup and delete your old options.txt in order for the new options to generate properly.


Download from here: Minecraft Joypad Mod v0.10.

Rabu, 11 April 2012

Minecraft Joypad Mod v0.9

Hi,

I've released an update to the Minecraft Joypad Mod. Here's the changelog:


[add] added fully analog movement
[fix] fixed sneaking at walk speed (oops)
[fix] fixed OutOfBounds exception when using a joypad with less than 4 axes
[fix] fixed large chest navigation (you can reach all items now)
[fix] improved navigation in dispenser and brewing stand (you can't exit the boudaries anymore)
[fix] tweaked navigation in other screens (mostly wrapping in corner cases)


It's compatibile with the Minecraft 1.2.5. Get it here.
You can leave feedback in the comments, or in the thread on the Minecraft forums.

Next on my TODO list are:

  • possibility to use axes as button inputs (usable for Xbox 360 controller's triggers - LT, RT)
  • smoother camera rotation
  • graphical settings
Till next time!