_                            ____       _                               
    | | __ _ _ __  ___  ___ _ __ |  _ \ _ __(_) ___ ___   ___ ___  _ __ ___  
 _  | |/ _` | '_ \/ __|/ _ \ '_ \| |_) | '__| |/ __/ _ \ / __/ _ \| '_ ` _ \ 
| |_| | (_| | | | \__ \  __/ | | |  __/| |  | | (_|  __/| (_| (_) | | | | | |
 \___/ \__,_|_| |_|___/\___|_| |_|_|   |_|  |_|\___\___(_)___\___/|_| |_| |_|

Jansen Price

Blog Post

Wednesday, February 3rd, 2010

Where, Whither, Whence and Other Adverbs

There are some words in the English language that are not used so much in modern speech that I think are cool. Today, I am thinking of three adverbs of location (where, here, there) that have associated adverbs of motion.

The first one is whither. Whither means "to where". Although it is acceptable to say "where are you going?" A way to express yourself more precisely would be say "whither are you going?". The word where implies that you are currently situated at some location, whereas whither implies you are moving to a new location.

Whither has a companion, named whence. Whence means "from where". So, if I wanted to know where you came from, I could ask, "whence do you come?".

The word here has associated motion words named hither and hence. Hither means "to here", and hence means "from here". "Come hither, my child and see what snack I hold in my hands" and "This party is somewhat boring and I am leaving hence" are good examples of these two words in a sentence.

Also note that hence has another meaning of "therefore".

The word there has two associated motion words that follows the same pattern: thither and thence. Thither means "to there" and thence means "from there". Example sentences include "I heard there was a giant living in that mountain, but I never went thither to find out" and "The townsfolk knew of a giant living in that mountain and when they saw him, they figured he had come thence".

You may not choose to use these words when speaking, since they may sound old-fashioned, but you totally can! It's fun and allows you to be more precise in your speech.

You may also encounter these words when reading literature and this little lesson may help you better understand certain passages where they appear. These words are also used in other compound words, like henceforth, which means "from now on", and whithersoever, which means "to wherever".

Here is a table to sum up the 9 adverbs discussed.

Question where whither whence
Near here hither hence
Far there thither thence


Permalink - 10 comments

Blog Post

Tuesday, January 26th, 2010

Extracting Data from Wii Fit Plus Savegame Files

One neat feature about Nintendo's Wii Fit and Wii Fit Plus is that it tracks your BMI (body mass index) and weight daily. You can view your progress of weight loss in a nice graph on your TV. I have been interested in extracting this data so that I can have it available elsewhere besides on the TV with the Wii on. Through some internet research and some examination of the Wii Fit Plus savegame files I have been able to access this data and get it on my computer.

Save Game to SD card

The first step is to create the savegame file from the Wii console. This can be done by going to the Wii Menu and saving the game data for Wii Fit Plus onto an SD card. This is a feature provided by the Wii in order to save a backup of your game data. Once that has been saved, you can insert the SD card into your card on your computer and access the file. But, it is an encrypted binary file, so we'll need to unpack and decrypt the filedata.

Install Segher's Wii.git

To extract the data files, you'll need to use Segher's Wii.git tools for Linux. Segher's Wii.git is a bunch of programs for Wii homebrew. The tool we'll need is called tachtig which will decode and unpack the savegame file for us. On Windows you can use FE100, but I have no experience with this tool.

On Linux, the easiest way to get the tool is to download the source code for Segher's Wii.git and compile it. On Ubuntu, all I had to do is the following:

1. Install git-core (if you don't already have it) - this is to get the code from the git repository.

$ sudo apt-get install git-core

2. Install openssl and libssl-dev - these two packages are required to compile the code, and you may not have them installed yet.

$ sudo apt-get install openssl libssl-dev

3. Grab the code from the repository

$ git clone git://git.infradead.org/users/segher/wii.git

This will create a folder called wii with the source code for the utilities.

4. Compile it

$ cd wii
$ make

This will compile the code and you will then have the executable 'tachtig', which is what we'll need to unpack and decrypt the Wii Fit savegame file.

To make it easier, you can copy the tachtig file to a location in your $PATH. (sudo cp tachtig /usr/local/bin)

The tachtig tool relies on some files that need to be created and added to a dotfile in your user's home directory. Create a directory called .wii in your home directory. You will need to add the following three files: sd-key, sd-iv and md5-blanker. The contents of each file should be 16 bytes in size and contain the respective keys found on this page. SD key (ab01b9d8e1622b08afbad84dbfc2a55d), SD IV (216712e6aa1f689f95c5a22324dc6a98) and the MD5 blanker (0e65378199be4517ab06ec22451a5793). You have to convert those hex strings into binary equivalent. I think I did this using xxd.

Unpack and Decode the Data

Okay, for Wii Fit Plus, the savegame file is stored on the SD card in the following location: private/wii/title/RFPE/data.bin

Grab that file off the SD card and copy it to your hard drive. Run tachtig on it to extract the file.

$ tachtig data.bin

You should get output similar to the following:

NG id: 028ab4e3
3 files
file: size=0003c000 perm=35 attr=00 type=01 name=FitPlus2.dat
file: size=00094000 perm=35 attr=00 type=01 name=FitPlus1.dat
file: size=00094000 perm=3f attr=00 type=01 name=FitPlus0.dat
ok: 1

It will create a directory named something like 0001000452465045, and put into it 6 files: 3 header files: ###banner###.ppm, ###icon###.ppm, ###title###, and 3 files with our Wii Fit data: FitPlus0.dat, FitPlus1.dat, FitPlus2.dat. FitPlus0.dat and FitPlus1.dat are both identical files with a size of 592K.

Parse and Interpret the Data

The next part is the fun part. If you examine the file with a hex editor you will be able to find the data you will want at the following locations:

File FitPlus0.dat
Byte Offset | Length | Description
0x0 | 8 | RPHE0000 (header)
0x8 | 22 | Name of Mii
0x1E | 1 | Unknown
0x1F | 1 | Height (in cm)
0x20 | 4 | Date of birth (stored in BCD: e.g. 1980 0228)
0x24 | | Unknown
0x95 | | Dates with data (rowlen=10)
0x35CF | | Start of some other section (unknown)
0x38A1 | | Body Test measurement data section (rowlen=21)
+0 | 4 | Date (in bitfield format)
+4 | 2 | Weight (in kg * 10)
+6 | 2 | BMI (* 100)
+8 | 2 | Balance percent (* 10)
+10 | 2 | simple value 4 ??
+12 | 1 | extended 1 ??
+13 | 1 | extended 2 ??
+14 | 1 | extended 3 ??
+15 | 1 | extended 4 ??
+16 | 2 | extended 5 ??
+18 | 1 | extended 6 ??
+19 | 1 | extended 7 ??
0x9288 | 1 | Last byte of profile

From this table you should be able to see where to get the data from the file. Basically, the important stuff is at offset 0x38A1. This section consists of data rows each with a length of 21 bytes. Each row represents the data gathered when you take the Body Test daily in the game.

Here is the first row in my FitPlus0.dat file for example (at 0x38A1):

7D874C29 030B 0964 01F9 010F 01AC 2A 02 04 0015 00 00

The first 4 bytes is the datetime stored in a bitfield format. I got the format from this thread on stackoverflow: http://stackoverflow.com/questions/719129/datetime-hex-format. It is a basic bitfield representation of a date. This particular one (7D874C29) is 2008-08-09 16:41.

The next two bytes (030B) is the weight in kilograms * 10 stored as a 2 byte integer (big-endian). This value is 779, so that means 77.9 kg.

The next two bytes (0964) is the bmi * 100. So this value is 2404, or 24.04 bmi.

The next two bytes (01F9) is the balance percentage (when measuring your balance during the test). This value is 505. Divide by 10 to get the value 50.5%. I am not sure if this represents the percent of your body leaning to the left or the right.

The rest of the data I am not sure about, but I do know that the last nine bytes are only when you do the long test. (Half way throught the body test in the game it asks you if you want to end or continue). I know this because the numbers are always 0, except for the last byte.

This data is for the first profile in your game. If you have multiple Mii profiles on Wii Fit, the rest of the data will be in the same format, starting with the second profile at byte position 0x9289.

I was able to create a web page with a graph of my weight data, pulled from the Wii Fit Plus savegame.

Note, if you already have the savegame file saved on the SD card, trying to save it again will fail, since it says the file is already saved on the SD card. So, for example if you have some more Body Test data that you want to save, you will have to first delete the data.bin file from the SD card and then save it again from the Wii Menu.

Also note: I looked at a Wii Fit savegame file and it appeared to have the same format as Wii Fit Plus, so if you don't have Wii Fit Plus, I am sure you will be able to find your way around the file with no problem.

Permalink - 5 comments

Blog Post

Saturday, November 17th, 2007

The Mouse Needs a New Name

I have always hated the term "mouse" used for the computer mouse. I think we should call it something else instead.

A while back, a friend and I were chatting about what other possible names the device could have. One we came up with was "Keyboard-less access Interface (KAI)". We had a few good ideas, as I remember, but none so great as what the original name of the device was as in the patent for it, from 1970. In the patent it is called the "X-Y Position Indicator"

We should all call it that instead, the XYPI. Pronounce it "zippy". Please, please, please, let us all stop calling it the mouse, now. Let's get back to its roots!

Due to good luck, and chat logs, my friend I mentioned above was able to find our conversation we had on the topic, and here is an exhaustive list of all the ideas we brainstormed that day, 2 years ago...

  • Hand interface
  • Palm interface
  • Pointer controller
  • Pointer controller interface
  • Pointer interface controller (PIC)
  • Pointer interface control (PIC)
  • Pointer Interface Control Keyboardless (PICK)
  • Graphical Input Device
  • Coordinate Coordinator (core-core)
  • Mouselike Outboard Pointing Edifice Device
  • Mouselike Outboard Pointer (MOP)
  • Simple digit interface
  • Point and click pointer interface control (PACPIC, PACer)
  • Klik Device
  • Clicker/Double-Clicker (CDC)
  • Cursor Mover
  • Cursor Moving Device
  • Graphical Cursor Moving Device
  • Cursor Outboard Moving Beacon (COMB)
  • Mouselike Outboard User Sorting Ediface (MOUSE)
  • Lazy User Mover Pointer (LUMP)
  • Pathetic Ugly Non-Keyboard
  • Limited Input Device
  • Limited User Mover/Pointer
  • Minimum Input Mindless Operating Tool (MIMOT)
  • Minimum Operation Unfortunate Stupid Ediface
  • Keyboardless Access Interface
  • Mice Operate Unfortunately Somewhere Everywhere
  • Additional Argument Aggregator
  • Cartesian Input Controller

This is an image of the patent for the xypi, by Doug Engelbart, it turns out, he was quite an amazing guy with a lot of dang good ideas back in the 1960's that seem to be exactly what modern computing has turned out to be.

Permalink - 0 comments

Blog Post

Saturday, July 14th, 2007

Our House, in the Middle of our Street

It was the middle of summer and we all were sitting in our family room. A cool breeze blew through the window. It was nice to have a cross-breeze in our house. It was especially nice of certain hot days. But not today, however; today it is cool outside.

It doesn't feel like July, actually, because it is so cool. I remember past years where July days are so hot, that the heat is unbearable.

I remember riding my bike on hot summer days and coming home and sweating and drinking lemonade. I would also make a peanut butter and jelly sandwich and eat it. I would enjoy that sandwich so much that I would always end up making another one and eating it too.

To be continued...

Permalink - 0 comments

Blog Post

Wednesday, May 17th, 2006

Playgrounds and Parks

I had a random thought today that there should be more playgrounds and parks in the world. I didn't think that for any particular reason, it just kind of popped into my head. After I had some time to think about it, I realized maybe it is because it is fun to go to playgrounds and play.

I love going down slides, but not when there is too much static electricity. I never really got into monkey bars, but I love objects to climb around on and hide behind. I had a lot of fun as a child playing tag on playgrounds.

Parks are good too. I like parks with ponds and trees and paths and grass and hills, etc. The ponds with fountains are quite dandy.

So, what do you like about playgrounds and parks?

Permalink - 0 comments