Skip to content

Category: Mac

Mac

Select-Copy, Middle Click-Paste in Terminal.app

Always annoyed me not to have the beloved ‘Select-Copy, Middle Click-Paste’ thingy on my Macbook. Finnally i figured out how to do it.

1) Install USBOverdrive

2) Fire up its Prefpane, and map the Middle Mouse Button to paste action

3) Install SIMBL

4) Install this SIMBL Plugin for Terminal.app

1 Comment

Ledmatrix Chip-8 Emulator

So the next thing could be an Chip-8 emulator runinng on a medium sized Atmega.

CHIP-8 is an interpreted programming language, developed by the late Joseph Weisbecker. It was initially used on the COSMAC VIP and Telmac 1800 8-bit microcomputers in the mid-1970s. CHIP-8 programs are run on a CHIP-8 virtual machine. It was made to allow video games to be more easily programmed for said computers.

Memory

CHIP-8’s memory addresses range from 200h to FFFh, making for 3,584 bytes. The reason for the memory starting at 200h is that on the Cosmac VIP and Telmac 1800, the first 512 bytes are reserved for the interpreter. On those machines, the uppermost 256 bytes (F00h-FFFh on a 4K machine) were reserved for display refresh, and the 96 bytes below that (EA0h-EFFh) were reserved for the call stack, internal use, and the variables.

Registers

CHIP-8 has 16 8-bit data registers named from V0 to VF. The VF register doubles as a carry flag.
The address register, which is named I, is 16 bits wide and is used with several opcodes that involve memory operations.

The stack

The stack is only used to store return addresses when subroutines are called. The original 1802 version allocated 48 bytes for up to 12 levels of nesting; modern implementations normally have at least 16 levels.

Timers
CHIP-8 has two timers. They both count down at 60 hertz, until they reach 0.

There are two version of the platform, the Chip-8 and schip (Super Chip). The biggest difference is the display size.

Chip-8 64×32
Super Chip 128×64

But most import it has some decent games:

I found some ugly c code code here, cleaned it up and made an SDL version on OS X.

git://github.com/optixx/megaledmatrix.git

chip8sdl.dmg

[flash]http://vimeo.com/2905435 [/flash]

Comments closed

Update: os x and DNS

I found some facts how os x is handling the dns lookups. Because i was wondering why changing the resolv.conf doesnt seem to change Safari’s or Firefox’s lookups. The key to this is lookupd and DNS Service Discovery. Actually i came across this from an iphone related problem, which is quite well documented at saurik webpage.

Comments closed

New iTunes and iPhoto importer

I updated my iTunes and iPhoto import scripts. Added Growl feedback and some hacks to handle iTunes performance problems, some iTunes really gets slow and i had to add timeut exception handling.
So just call this from the terminal:


python addToiTunes.py -d /media/mp3s -r -p

Where all Mp3 Files below the path get imorted to iTunes and playlists get created. The playlist’s name depends on the subfolder structure below the import path. If u have arranged your stuff like /media/mp32/artist/album, u get a proper playlist name “Artist – Album”

The other script is just a bulk importer for iPhoto.


python addToiPhoto.py -d /media/photos -r

Where all pictures below the path are imported and each subfolder yields an new album in iPhoto. Quite simple and less pain if u have to import a huge photo collection. Tried to use Automator for this, but he outcome wasn’t so good.

addToiPhoto.py
addToiTunes.py

Comments closed

Stupid Fritzbox DNS

Since my DSL provider’s DNS updates are really slow i wanted to switch to opendns, which is a good a idea anyways. But wtf i cant change the default dns in my fritzbox. No way to do it via the web admin. Ok why bother i said to my self and went for the shortcut. To find out that Leopard is buggy and u cant unassign the default dns on the Airport device, its simply greyed out. Bummer!

So do it the old school way and editet the resolv.conf. Where nslookup and dig seem to eat this but Firefox and Safari seem to give a flying fuck about this. Even Network pref.panes doesnt seem so sync againt resolv.conf. Seems to be a know problem to the people at the opendns forums.
Ok went back to the fritzbox, and found a way to force the dns via the a config file. Just fillin this:


overwrite_dns1 = 208.67.222.222;
overwrite_dns2 = 208.67.220.220;

Used a java tool to pull and push the config directly from the box. Take a look here

Ja…funny. How easy u can spend an hour in front of a computer, just to take a shortcut for the slow dns cache update…

Comments closed