Sunday, 26 July 2015

Invaders with Processing


Something I did on a boring Sunday afternoon. It's amazing how quickly these things can be done nowadays, as the programming can be extremely lazy. (Cough) I followed a "if it works don't look back" style of programming so obviously it could be a lot shorter and more efficient. I wanted to relax anyway.

I have no idea if it will work smoothly on different computers. The video shows roughly how it plays on my Linux Mint/Mate with 3GHz and a Radeon EAH5750 display adapter. Different Java implementations may result in different sync.

Install Processing, Copy/paste the following onto the sketch and off you go. The arrow keys control the ship. Up arrow is fire. Q resets the game anytime.

// Invaders game by Tero Heikkinen
// left/right arrows - Move
// up arrow - Fire
// q - restart game
// Made in one evening 26.7.2015

int MAXOBJECTS=100;
int []g_x=new int [MAXOBJECTS];
int []g_y=new int [MAXOBJECTS];
int []g_t=new int [MAXOBJECTS];
int []g_vx=new int [MAXOBJECTS];
int []g_vy=new int [MAXOBJECTS];
int []g_score=new int[10];
int g_pulse,g_level,g_aframe;
boolean g_joyr,g_joyl,g_joyf;

void setup()
{
  size(600,400);noSmooth();noStroke();fill(255,255,255);
  resetgame();
}

void create_wave()
{
  int diffi,xon,flip;
  float floi;
  g_level++;
  diffi=g_level;flip=0;
  if(diffi>10){diffi=10;}
  for(int j=0;j<=3;j++){
    for(int i=0;i<=7;i++){
      floi=0;
      if(g_level==4||g_level==8||g_level==16){
        floi=float(i);
      }
      xon=64*i;
      if(g_level==6||g_level==10||g_level==14||g_level==20){xon=64*i+flip*32;}
      addobject(xon,32+diffi*16+26*j+int(cos(floi)*16),1,0,2);  
      }
    flip++;if(flip>1){flip=0;}
  }
  int mzip=-2;
  if(random(100)<50){mzip=2;}
  //add motherships
  addobject(width*2,32,mzip,0,25); 
  addobject(width*4,32,mzip,0,25);
}

void resetgame()
{
  for(int i=0;i<=9;i++){g_score[i]=0;}
  clearobjects();g_level=0;
  addobject(width/2-16,height-32,0,0,1);
}

void graphic(int x,int y,String gfx)
{
  int xc,yc,xp,yp;
  xc=0;yc=0;
  for (int i=0;i<gfx.length();i++){
  if(gfx.charAt(i)=='1'){
    xp=x+xc*4;yp=y+yc*2;
    if(xp>=0&&xp<=width-4&&yp>=0&&yp<=height-2){
      pixels[xp+(yp)*width]=0xffffffff;
      pixels[xp+(yp)*width+1]=0xffffffff;
      pixels[xp+(yp)*width+2]=0xffffffff;
      pixels[xp+(yp)*width+3]=0xffffffff;
    }
  //rect(x+xc*4,y+yc*2,4,2);
  }
  xc++;
  if(gfx.charAt(i)==' '){xc=0;yc++;}
  }
}

void addobject(int x,int y,int vx,int vy,int t)
{
  int first;
  first=0;
  if(t!=1){first=1;}
  
  //alien bullet check fit
  if(t==4){ 
      for(int i=0;i<MAXOBJECTS;i++){
        if(g_t[i]==2){
          if(x>g_x[i]&&x<g_x[i]+24&&y>g_y[i]-4&&y<g_y[i]+16){
          return;
        }
      }
    }
  }
  
  // add an object
  for(int i=first;i<MAXOBJECTS;i++){
    if(g_t[i]==0){
      g_vx[i]=vx;g_vy[i]=vy;
      g_x[i]=x;g_y[i]=y;g_t[i]=t;return;
    }
  }
}

void clearobjects()
{
  for(int i=0;i<MAXOBJECTS;i++){
    g_t[i]=0;g_vx[i]=0;g_vy[i]=0;g_x[i]=0;g_y[i]=0;
  }
}

void command_fleet(int com)
{
  for(int i=0;i<MAXOBJECTS;i++){
    if(g_t[i]==2){
      if(com<5){
        g_vx[i]=com;
        g_x[i]=g_x[i]+com;
      }
      if(com==16&&g_t[0]==1){
        g_y[i]=g_y[i]+12;
      }
    }
  }
}

void addscore(int ss)
{
  int okay;
  okay=0;
  g_score[0]=g_score[0]+ss;
  while(okay==0){
    okay=1;
    for(int i=0;i<=9;i++){
      if(g_score[i]>9){g_score[i+1]++;g_score[i]=g_score[i]-10;okay=0;}
    }
  }
}

void drawobjects()
{
  int aliens,multip,order;
  loadPixels();
  aliens=0;multip=1;order=0;
  for(int i=0;i<MAXOBJECTS;i++){
    if(g_t[i]==2){aliens++;}
  }
  if(aliens==0){create_wave();}
  if(aliens<=9){multip=2;}
  if(aliens<=3){multip=3;}
  if(aliens==1){multip=4;}
  g_aframe=g_aframe+multip;
  if(g_aframe>31){g_aframe=g_aframe-32;}
  
  for(int i=0;i<MAXOBJECTS;i++){
    switch(g_t[i]){
    case 1:
      graphic(g_x[i],g_y[i],"00011000 00011000 01111110 00111100 11111111 11111111");
    break;
    case 2:
    if(g_aframe<=15){
      graphic(g_x[i],g_y[i],"00000000 11011011 00111100 11011011 11111111 00100100 01100110");
    }
    else
    {
      graphic(g_x[i],g_y[i],"10000001 01011010 00111100 11011011 11111111 01000010 11000011");
    }
       g_x[i]=g_x[i]+g_vx[i]*multip;
       g_y[i]=g_y[i]+g_vy[i]*multip; 
       if(g_y[i]>g_y[0]-16&&g_t[0]==1){g_t[0]=8;}
       if(g_x[i]>width-32){order=1;}
       if(g_x[i]<=0){order=2;}
      aliens++;
      int frate;
      frate=g_level*multip;
      if(frate>200){frate=200;}
      if(random(400)<frate){
        int zzoo;
        zzoo=2;
        if(g_level>=4){zzoo=4;}
        if(g_level>=8){zzoo=6;}
        addobject(g_x[i]+12,g_y[i]+24,0,zzoo,4);
      }
    break;
    case 3:
      graphic(g_x[i],g_y[i],"11 11");
      if(g_y[i]<0){g_t[i]=0;}
      for(int j=0;j<MAXOBJECTS;j++){
        if((g_t[j]==2||g_t[j]==25)&&g_x[i]>g_x[j]-8&&g_x[i]<g_x[j]+32&&g_y[i]>g_y[j]&&g_y[i]<g_y[j]+16){addscore(1*g_t[j]);g_t[j]=8;g_t[i]=0;}
      }
      g_x[i]=g_x[i]+g_vx[i];
      g_y[i]=g_y[i]+g_vy[i]; 
    break;
    case 4:
      graphic(g_x[i],g_y[i],"11 11 11");
      if(g_y[i]>height){g_t[i]=0;}
      int j=0;
      if(g_t[j]==1&&g_x[i]>g_x[j]-6&&g_x[i]<g_x[j]+30&&g_y[i]>g_y[j]&&g_y[i]<g_y[j]+16){g_t[j]=8;g_t[i]=0;}   
      g_x[i]=g_x[i]+g_vx[i];
      g_y[i]=g_y[i]+g_vy[i]; 
    break;
    case 8:
       graphic(g_x[i],g_y[i],"10010011 01010110 00111100 11000011 0111100 01101010 11001001");
       g_vy[i]++;if(g_vy[i]>3){g_vy[i]=0;g_t[i]=9;}
    break;
    case 9:
       graphic(g_x[i],g_y[i],"00000000 01010010 00000000 10000001 0000000 01001010 0000000");
       g_vy[i]++;if(g_vy[i]>3){g_vy[i]=0;g_t[i]=0;}
    break;
    case 25: //mothership
       graphic(g_x[i],g_y[i],"00111110 01010101 01111111 00100010 00011100");
       g_x[i]=g_x[i]+g_vx[i];
       g_y[i]=g_y[i]+g_vy[i]; 
       if(g_x[i]<-32){g_x[i]=width*6;}
       if(g_x[i]>width*6){g_x[i]=-32;}
    break;
    }
  }
  if(order==1){command_fleet(16);command_fleet(-1);}
  if(order==2){command_fleet(16);command_fleet(1);}
  if(g_t[0]==0){
    graphic(32,16,"00111100 01000010 01000010 01010010 01001010 00111100");
  }
  scoreboard();
  updatePixels();
}

void scoreboard()
{
  int s,x,y;
  x=96+4*32;y=16;
  s=1;
  for(int i=0;i<=4;i++){
  switch(g_score[i]){
    case 0:graphic(x,y,"00111100 01000010 01000010 01000010 01000010 00111100");break;
    case 1:graphic(x,y,"00001000 00011000 00101000 00001000 00001000 00111110");break;
    case 2:graphic(x,y,"00111100 01000010 00000010 00111110 01000000 01111110");break;
    case 3:graphic(x,y,"01111110 00000010 00011100 00000010 01000010 00111100");break;
    case 4:graphic(x,y,"00011100 00100100 01000100 01111110 00000100 00000100");break;
    case 5:graphic(x,y,"01111110 01000000 01111100 00000010 01000010 00111100");break;
    case 6:graphic(x,y,"00111100 01000000 01111110 01000010 01000010 00111100");break;
    case 7:graphic(x,y,"01111110 00000010 00011110 00000010 00000100 00001000");break;
    case 8:graphic(x,y,"00111100 01000010 00111100 01000010 01000010 00111100");break;
    case 9:graphic(x,y,"00111100 01000010 01111110 01000010 00000010 00111100");break;
    }
    x=x-32;
  }
}

void keyPressed()
{
  if(key=='q'){resetgame();}
  if(key==CODED){
    if(keyCode==RIGHT)g_joyr=true;
    if(keyCode==LEFT)g_joyl=true;
    if(keyCode==UP)g_joyf=true;
  }
}

void keyReleased()
{
  if(key==CODED){
    if(keyCode==RIGHT){g_joyr=false;}
    if(keyCode==LEFT){g_joyl=false;}
    if(keyCode==UP){g_joyf=false;}
  }
}

void draw()
{
  background(0,0,0);
  drawobjects();
  if(g_joyr){if(g_x[0]<width-36){g_x[0]=g_x[0]+4;}}
  if(g_joyl){if(g_x[0]>4){g_x[0]=g_x[0]-4;}}
  if(g_joyf&&g_pulse==0){g_pulse=10;if(g_t[0]==1){addobject(g_x[0]+12,g_y[0],0,-8,3);}}
  if(g_pulse>0){g_pulse--;}
}


Thursday, 23 July 2015

The Quest for the MSX cross-compilation


My innocent hope was to get MSX cross compiling c/inline z80 assembler working on my Linux.
I thought it would be fairly simple as I already had it running on the Macintosh, and the Linux is supposed to be the coder's friend.

How wrong I was. Well, I didn't destroy anything in a fit of rage, nor did I have to sleep over this, so in a sense this was pretty successful. Also, what I've done here is comparatively simple to actually having done the groundwork, I'm simply trying to get someone else's solutions to work.

Admittedly, some woes came out of my broken Makefile which I had fiddled to get it work on the Mac, making it less general-purpose in the process.

This is not a how-to, just a recollection of how many annoying stages I had to go through.

The evening went something like this:

-Install sdcc from the repositiories. Find out the inline assembler does not compile.
-Get various z80 compilers and fiddle around with the makefile
-Find out that the sdcc version is too new to handle inline z80 in this way
-Remove sdcc
-Get old sdcc sources which won't compile.
-Mess around trying to configure and build the sources, installing stuff like bison in the process.
-Find out the version is too old or inappropriate to build anyways or something.
-Remove sdcc
-Find out there's a ready made version 2.9 that works.
-Download and copy the stuff to /usr/local/bin
-The MSX stuff starts to compile but needs hex2bin
-Get hex2bin sources
-Compile hex2bin
-Copy the stuff to /usr/local/bin
-Now I get the .com out of it but the .dsk outputting does not work. It requires a small thing called wrdisk.
-Find and get wrdisk
-Compile wrdisk
-Copy the stuff to /usr/local/bin
-Install openmsx from the repository
-Find out it does not load anything from disk without a proper MSX system rom.
-Copy the system rom from Macintosh.
-Spend quarter of an hour trying to figure out how openmsx accepts the system rom. From the unnecessarily complex manuals I find it copies into ~/.openmsx/systemroms, but nobody says how to invoke it
-Make several guesses as to what to pass onto the -machine parameter of openmsx.
-Guess correctly that openmsx -machine Toshiba_HX-10 works, even though that is not the filename.
-Find out that as the Toshiba HX-10 does not have a f*cking disk rom, it won't load the .dsk image.
-Copy the MSX2 FS-A1WSX roms but find out the openmsx won't run it as the files are lacking.
-Find out I've actually used a FS-A1WX rom variant, copy them instead.
-openmsx -machine Panasonic_FS-A1WX finally runs an MSX with a disk rom.
-Triumphantly run openmsx -machine Panasonic_FS-A1WX jaa.dsk to run the compiled file...
...to find out the autoexec expects a different name.
-Fiddle some more with the Makefile to get the proper autoexec from the project folder.
-Wait an eternity for the openmsx to boot up and load the command.com and the autoexec and execute the damn file. Curse the entire platform.
-Profit!

I probably can't even remember all the phases. Add to that the constant figuring out of proper terminal syntax and the appropriate folders. Now I'm spent and can't bother to even make the small piece of code adjustment I was supposed to do...

Wow, it was really worth it...

Thursday, 16 July 2015

Return of the Schneider Euro PC



I've bought another Schneider Euro PC. This one has the power supply included+Schneider Joystick and mouse. The computer has a game card installed, which is pretty useless though: it simply has two joystick ports.

The outer appearance was very promising: virtually no yellowing on the computer or the keyboard.

Compare this to my other Euro PC, which I discussed here. In this picture, it's the one below.

The case yellowing is not as visible from the photo, but it's there.

However, a look at the inside revealed a sad truth: the battery has died and corroded some parts of the PCB.

Does not look too bad? Look at the surface mounted chip peeping at the bottom right.
Nurture, not nature. My other Euro PC computer had yellowed heavily, but the board had remained intact. The reverse has happened here, the board has suffered but not the cover.

I of course removed the battery. Also, did some reading on the net, and it appears that the PCB corrosion is a many-splendored thing. It would be best to take a board with this damage to a professional...

Well, I simply lathered the PCB with WD40 (Good enough for your dad, good enough for you) and started cleaning it with Q-tips and scratching between pins with a paper knife. Edit: I've since learned you're NOT supposed to use WD40 for cleaning PCBs.

I'd like to say this heroic activity had some positive outcome. But... no, on power-up the machine just lets out one horrendous wailing beep, and that's it.


Connecting to Commodore 1084S

It's not all sadness and gloom, though. At least I got a proper power supply for my older Schneider Euro PC, which has been proven to work. Also, as I now have a monitor with TTL RGB support I could easily connect my Euro PC to it. I could have arranged both by other means, but it would have been more trouble. 

Now what to do? The Euro PC has the only working PC floppy drive in the house.
I still needed the cable, though. I went to a flea market and bought a fat old SCART cable. My soldering has gotten (more) rusty, so building the cable took a surprisingly long time. Hint: It's worth removing all the unneeded wires near the end so you can fit it into the DIN housing...  It's also a great idea to shove the DIN rubber housing on the cable before soldering the connector.

My monitor has the DIN variant of the TTL RGB, other monitors may have the 9-pin D SUB. Note the absence of SCART type connector.

In the end, contrary to all past experiences, my cable worked on the first go.

The information is not too hard to find out but here are the pinouts anyway:

Euro PC monitor pinout at the back of the computer:
1 Ground
2 Ground
3 Red
4 Green
5 Blue
6 Intensity
7 Monovideo
8 Horizontal Sync
9 Vertical Sync

Commodore 1084S TTL RGB (DIN 45326) at the back of the monitor:

1 Status comp
2 Red
3 Green
4 Blue
5 Intensity
6 Ground
7 Horizontal Sync /CS
8 Vertical Sync

I connected everything directly to their corresponding pins. I connected the two grounds from the Euro PC to the one ground pin of the monitor. The "status comp" I connected to the "Monovideo".

Tuesday, 16 June 2015

Elite

Or, If I made Elite (which I am not doing) it would be like this. The video below shows a small demo/mock-up I made up with Processing already some time back. It incorporates only a small fraction of the game, basically the spaceship motion, game world (sun+planet+space station) and some shooting elements.




(Warning: This post is a bit long.)

When I think about whether Elite needs to be re-made, and what it would be like, my starting point is the ZX Spectrum version. I never thought that games look "worse" or "better" now than they did in the 1980s. It is mostly the inconveniences arising from poor framerate and storage schemes that need to be rethought, and not so much the overall look and sound of the game. For example, the elaborate dashboards in 8-bit games (such as Elite) were part of the character of the game, and making the game full screen with an overlaid display would compromise Elite for me.

Despite what I said about 8-bit visuals, I’d be interested in a higher resolution than the 256x192 available on the ZX Spectrum. I would still keep the amount of detail and information on screen about the same. What I mean, if the resolution is double of the original, such as 512x384, the graphic lines would also be doubly-thick, but there wouldn't be more of them. All the line thicknesses would be in proportion to the lines in the original. I did make the objects with filled polygons, but this is only apparent when objects pass each other.
Left: ZX Spectrum Elite. Right: The Processing mock-up. (The radar looks dull and the font is incorrect)
Of course, there was a sequel to Elite, called Frontier: Elite II. But to cut a long story short, Frontier is to Elite like Encyclopedia Galactica is to the Hitchhiker’s guide to the galaxy: More accurate and brimming with detail, but bureaucratic, pedantic and dull. Much like many others have already said, Elite is first and foremost a game, and only superficially a space simulation. 

To keep Elite the game, one has to accept that the player has an unique, privileged position on the game board. Enemy ships die from a few shots, but the player has strong, regenerating shields. The enemies cannot exploit strategies that the player can and do not work in the universe as the player does. I feel that Elite as a game, rather than a simulation, is a more fruitful starting point for inserting more and varied content.

Here's what I think about some themes:

Multiplayer? I’m not saying multiplayer is impossible (after all, board games work very well with multiple players), but it would need to be thought in so different terms that it would “break” the original Elite rules. The unique position of the player would be lost, and the game logic would have emerge very differently to the original. Maybe multi-player dogfights and skirmishes could be additional content rather than the main game.

New buyable ship types? A
lthough this seems like an obvious addition, I feel it is problematic to allow the player to simply buy a new ship type.

In Frontier:Elite II, the player was instantly allowed to trade the ship for a cheaper one, which left the player with a large amount of surplus credits with which to buy weapons and cargo. The otherwise inferior ship could be almost fully equipped, which largely removed the satisfaction of gradually acquiring new weapons systems. The player could sample different new weapons without having them as "rewards" of continued game play.

Possibly, if some other mechanic than simple buy/sell would be introduced for acquiring the new ships, it might work. Perhaps a ship trading license or licenses for new ship types could be introduced as an element to the later game, to renew player interest. 

Another reason for not including other player ships is "philosophical". If the player can change ships, why can't he leave the ship altogether? Or buy a space station or an apartment? Where does this end meaningfully? One way to define the boundaries Elite is to limit it as a game about one particular space ship type.

As arbitrary boundaries are set in any case, why not set the game boundary to just "Cobra mk. III simulation", just like subLOGIC Flight Simulator was a Cessna simulation? Focus on doing that well, just as it was in Elite. If we take Elite to be a game, then it has set, arbitrary rules, and this single-ship rule can be one of them. Again, it's not a simulation about living your life in the 25th century.


Galactic chart and the local chart from the ZX Spectrum version.
Expanded universe? The galaxies of the original Elite are a fairly uncontrolled random-generated mixture of dangerous and safe worlds. Some structure arises as routes through the galaxies are constrained by the hyperspace range of the Cobra. This range cannot be changed during the game. 

Here the game might benefit from a more structured universe, mostly as a way to control the game difficulty curve, but also to give more character to the localities. In my mind, there could be larger dangerous and alien zones that contain numerous planetary systems. Whole galactic regions might be excluded from a player who does not have enough hyperspace range or well-equipped ship. Portions of the galaxy could remain effectively “locked” for the newbie.


Planet data and market data from the original Elite, mostly an obfuscation.
New tradeable goods? I kind of like what Braben suggested in his Kickstarter pitch for Elite:Dangerous, that there would be uniquely local products that have somewhat different trade logic than the bulk wares sold and bought throughout the galaxy. At the same time I do not think having a longer list of tradeable items would improve the game greatly. It might even make it tedious. 

What would be welcome is a closer integration of the planet data, description and the available and desired goods. What passes for spices in one system might be a narcotic in another. If a planet is engaged in a “brutal civil war”, player could profit greatly with selling weapons to that system. On the other hand, selling weapons to that particular world might be deemed highly illegal by some institution, an act that might have influence somewhere. 

New missions? Certainly. But I dislike the banal generated missions of Frontier: Elite II. I would still keep the missions as fairly rare occurrences, only something that spices up the game now and then and helps maintain an illusion of a limitless universe where anything can happen. Some of the new equipment would be available through successful completion of these missions, just as in the original game.

Adding dimensions to the ordinary game content (Such as the civil war scenario above) would perhaps remove the need of having any generated missions anyway, as interesting situations might rise up from the plain gameplay. Admittedly, perhaps more than with my other suggestions, this is kind of easy to say and harder to put into action.

New weapons? Only in a limited way. I’m not so sure if there is even need for more missile or laser types. Upgrading the ship with the fairly closed set of weapons was part of the well-working interest curve of the original game. After acquiring military lasers, electronic countermeasures and the docking computer there was very little to do expect to grind to the “Elite” rating. Adding more levels inside this progress does not necessarily make it more interesting. 


There might be room for some special weapons, but these ought to trickle down very slowly to the player as very rare items, after having made most out of the basic upgrades. This would hopefully keep the game interesting after majority of the content has been revealed. Having hundreds of different items pop up at all time would, in my mind, dilute the effect of any special equipment, no matter how exceptional they are. 

More realistic flight model? No, not really. This is one of the key elements for keeping the game as a game. However, I don’t think the realistic flight model was a 
failure in Frontier: Elite II, on the contrary, it was very fascinating to explore the gravitational effects of planets. The problem was more with the way combat was then arranged around this concept, and the result was mostly unsatisfying long distance one-on-one fighting. For this reason I would keep the flight style fairly similar to the original because the game play becomes easier to manage. 

There is also something detracting about the way time could be "skipped" in Frontier, which in contrast to the realism of the idea actually tended to undermine the player's sense of "real time". I much prefer the idea of a jump drive, as in the ZX Spectrum Elite.


This is about as close the enemy ships should get in effective, normal combat situations.
I've not played the new Elite:Dangerous, but as the game has become closer to completion, the play videos seem to reveal that the combat takes place at fairly long distances. This is not what i would expect. The tracking gimbal-mounted lasers seem especially troubling, as to me Elite is about maneuvering your ship much like in a World War I aeroplane combat, no matter how unrealistic that is. Routinely reversing your ships thrust should also be discouraged.

The combat system can cheat and deceive to make the combat more interesting. The combat system needs to provide constant intimate situations Elite battles were made of. Possibly this can be achieved in having the perspective and coordinate space "close" to the player. Again, multiplayer hinders this possibility.

NPC and enemy interactions? The encounters with the other ships could be more richer than in the original: Enemy ships could occasionally fight each other, and even use the hyperdrive to escape. Many Elite remakes make use of this. Adding these elements ought to be made carefully, though. For example, the game can still create new enemy ships "out of nothing", when the situation so requires. In any way, coolness and narrative engagement should trump reality.

What else? As an additional point, I also think the player should not be forced to read much more during the game than in the original. It should not incorporate “scripted storylines”, or sprawling radio discussions with the NPC ships. The exception could be the missions, but even there the text ought to be quite terse and to the point.

So, there were my thoughts about what would make a good Elite.


Sunday, 31 May 2015

Day of Anger

It's not often I have the same film in multiple formats and editions, so I decided to make a little comparison from still images.

Day of Anger (I Giorni dell'ira, 1967) was directed by Tonino Valerii and it stars Giuliano Gemma and Lee Van Cleef. I tend to think it as an above average spaghetti western, but not outstanding. Admittedly it belongs to an earlier stage of Italian westerns and thus perhaps more innovative than it now seems.

Well, anyway, to the picture quality. I have an italian DVD from "Medusa", which does not have english dubbing or subtitles. So I eventually acquired the Blu-Ray/DVD combo, recently released by Arrow media.

(To see the bigger images properly, you have to click on the images and open them in a new browser window.)

DVD/ Medusa (position 1:03:10)

Even without having anything to compare to, the Medusa DVD does not seem so good. However, the image quality is much better than many cheap spaghetti releases.


DVD/ Arrow (position 1:04:37)


Focusing only on the horses, there seems to be not that much more detail, but then I realized the cropping in the Medusa version :) Overall, the image is of course sharper and the colors are clearer.


Blu-Ray Disc / Arrow

Looking at a still image, the difference between the Blu-Ray and the good DVD is almost as big as between the two DVDs. When watching the moving image, the difference is not that heightened. There's some film grain noise that's not visible in the lower resolution DVD. Note how the color red was a bit blurry in the DVD but not so here.

Monday, 4 May 2015

Raising the dead

"The Project"

I bought a desktop PC at the very beginning of 2007, built from parts. It was pretty good for a while but I eventually became disappointed with it, not the least because of Windows Vista and some poor behavior with the graphics card. I did change the graphics and the power supply around 2010, but did not go all the way with the updates. Then I got a cheap-ish Mini Mac and sort of cast that noisy hulk aside.

In the back of my head I kept thinking it could be revived with a suitable Linux distribution and some thought-out hardware upgrades. I knew the motherboard, Asus P5B Deluxe, had a good reputation for upgrading and overclocking. Only recently I got around to doing this.

Slowly gathering dust over the years... the front panel may have been shut since 2007.
Here's the changes I made, in order:

New hard drive: This was the first step. It would have been pointless to install Linux only to find it would be slowed down by the old, noisy hard disk. The size was not that important, I changed the old 320 gigabyte drive into a 500 gigabyte one. The price was about 60EUR.

New OS: The Linux Mint/Mate serves as the new operating system. Goodbye stupid Windows Vista.

I may need a bigger screen, though.
New processor: Frankly, I never believed I would switch the processor. But it was now cheap (15EUR) and I also found that changing the processor is simpler than I thought. I did have to buy that silver goo, though. (Something like 10-15EUR too?) From a 2,13GHz E6400 Core 2 Duo I switched to a 3GHz E8400 Core 2 Duo, with the intent to do some mild overclocking.

Left: The old processor. Middle: The new processor. Back: The fan.

Memory: I upgraded from 2 gigabytes to 4. The main reason was that I could with good conscience overclock the processor to 3,6GHz. The 800MHz DDR2 memory can keep up with it. These cost me about 30 EUR.

Craftsmanship: that someone cares what stuff looks even if it's almost never seen.
The overclocking from 3GHz to 3,6GHz was surprisingly painless. The old fan is sturdy enough to keep the temperatures low in everyday use. Here I set the core voltage to 1.25 and have encountered no problems as yet. This overclocking resulted in somewhat less than 20% speed improvement, but I think it was worthwhile. From what I've read on the net, the 3,6GHz ought to be a pretty good sweet spot of overclocking without yet having to worry too much about side effects.

All in all, I think I spent less than 150 Euros to bring back 8-year old hardware to life. The most expensive part was the hard disk which I bought as new. The other stuff was bought from net auctions and Linux is of course free. Obviously the 2010 purchases were a bit more costly but that was a long time ago...

This old horse is now faster than the Mac Mini and a lot faster than my Asus Chromebook C720. I might justify making it again as my main desk computer. I could have gone even further, but more extreme choices could have upped the price with relatively little improvement. Going a lot over 200 Euros I might just as well have bought a new cheap computer.

Edit: I noted that the speed improvement after overclocking was not quite as large as I expected, based on tests with my previous memory. It turned out I had to manually set the memory timings to CL4, that is 4-4-4-12. When I had used the SPD automatic settings it had apparently reverted to CL5 which is somehow worse than the original situation. Now with the manual settings I'm closer to the 20% speed increase.

The rig:

-Asus P5B Deluxe motherboard

-Zalman ZM-600HP PSU, supplying 600W power
-Intel Core 2 Duo E8400 3GHz clocked at 3,6GHz
-Radeon EAH5750 Formula (I think) graphics card
-2 X 2 Gigabyte G.Skill DDR2 800, F2-6400CL4D-4GBPK
-500 Gigabyte Western Digital Hard drive

Autumn 2015 additions:


-2 additional Gigabytes of memory, to a total of 6 (Corsair cm2x1024-6400c4)

-16 Gigabyte SSD drive for system files
-Blu-Ray drive
-Card reader front panel
-3.5" floppy drive
-USB 3.0 card

Note: the small SSD drive, taken out from the C720 chromebook, makes a huge speed difference in boot time and overall desktop experience, even if it is not the main drive. If only I had thought of buying an SSD before instead of the WD drive...

Tuesday, 21 April 2015

Rasp Case v 1.5



I put my Raspberry Pi 2 inside the chipboard/wooden box that previously hosted the old Raspi version. It's not an ideal switch, partly because of certain layout changes in the new Raspberry.

The new Raspi is in some ways better for this type of corner placement than the old, and with the added USB ports I decided not to connect it to a USB hub. However the microSD connector is now hidden inside the case. 

There are now 4 screw positions in the circuit board which is better than the two. The board can be fit very firmly to the case bottom with 3mm machine screws. To fit them I had to drill through the screw holes with a 3mm drill, though. (I don't remember having to do that before)


The USB positioning means the keyboard cable now comes outside from the box and back into the Raspi. I've not had the heart to cut the cable and make some kind of on-board connection. It WOULD have been possible to face the USBs towards the inside just as before, and use the USB hub to pull them out. This would have helpfully exposed the SD card too.

The Network cable output does not need to be extended either. The composite video is not only physically different, it's a bit different to set up in the boot I currently use so I've not connected it to the backside either. Also, it can also be reached from the side of the case.

It's possible that I'll put my old Rasp 1 back into this box and devise something new for the 2B.


A short how-to

Below I have some loose schematics about how the case is built, something that I did not discuss before. The cover that holds the keyboard has the side boards glued into it. The back panel and the case bottom are glued (and screwed) together.

Not to scale.
The cover part is removable and connected with machine screws, as shown in the section image below. This is achieved by embedding M3 size nuts into the side panels, leaving room for the screw to penetrate (all this sounds bit rude). A thin veneer glued to the bottom of the side panel holds the nuts in place. The 3mm holes into the veneer have to be made quite carefully. A thicker material could be used as well.
All this because the machine screws/nuts make the cover more replaceable. Wood screws might also suffice, it's not like they would ruin the parts very quickly.

The picture below shows in elevation how the Raspberry Pi is the connected to the bottom panel. This really does not need much explanation. None of the pictures are in any kind of scale, I'm just showing the basic principle.