Dead Gorf

October 4th, 2015

So I found a dead Gorf on Craigslist.  It was an older ad, but was still available when I inquired.  Dude I picked it up from had done some pretty impressive restorations on some other games.

Anyway – it was dead alright.  Shows a blank screen that looked overly blue due to how the monitor was adjusted, no starfield was visible.  Slid the test switch over and power-cycled, but this made no difference either.

The previous owner had mentioned that he had done some work on it.  I saw some of his other previous work on other boards of his and while not perfect (some cold joints, or not enough solder in some places leaving “pits”), it was not horrible and definitely no worse than what I was doing when I started out.

Anyhoo, starting with the power PCB – the previous owner said he had already replaced the caps, but I wanted a second look at it, JIC.  On the solder side of the board, some larger traces has been lifted off the board during some previous repair work (I do not think it was his, maybe someone before him?).

It looked like the someone used a serious soldering gun to do the work, because there were scorch marks on the board(!) and flux was all over the older work too.  Continuity was where it was supposed to be, so I guess that while it was ugly, it worked.

Hit the previous work with a small wire brush to clean up some of the flux, and reflowed solder on it and the connector pins, just to be safe.  While I was doing this I noticed that an IC had two pins soldered together, but each pin had its own separate trace, which looked suspect.  Verified with the schematics that the pins are NOT supposed to be soldered directly together and fixed it (they are actually supposed to be connected through a fuse).

Powered the game back up and it came up with a rolling screen but I could make out score displays at the top.  Also was showing some solid “blocks” that made me nervous and some color distortion.  Was able to get the screen to lock with a simple monitor adjustment.  Blocks were just the test screen – I had forgotten that I left the test switch closed.

Game was already set to free play, so I started a game.  Immediately noticed that some sounds are missing, and no speech.  Adjusting volume controls did nothing to fix it, but I quickly determined it was channel 2 that was broken.

Checking voltages at the channel 2 speaker shows it at a constant ~14 volts!  Metering the input to the amp board shows sensible readings that change while the game is running, so I think the input is good.

Taking the amp board out and metering the transistors shows some strange readings, but they were in-circuit.  Swapped the two audio lines at the connector (pins 4 and 6), and I was able to hear the other set of sounds, but still no speech.  After paying closer attention, I noticed that I was getting a a click or two when I was supposed to be hearing speech.  So I think I verified that the channel 2 section of the amp is bad and  the Votrax SC-01 is bad, too.  That last part really IS bad, because they are not easy to find!

Decided to shotgun the entire channel 2 section of the amp board, JIC – this is old hardware, after all.

After doing that I remembered I forgot to actually check the speaker itself.  Sure enough, it was supposed to be an 8 ohm speaker, but it was shorted.  Replaced the speaker and connected up the repair amp board and now I have all sounds except speech.  The mother ship explosion never sounded so good! :)

The SC-01 chips are getting hard to find and are a bit pricey.  But I do want the game working fully again, so it might be worth it.

Update: Purchased an SC-01 from GameRoomRepair.  Installed and Gorf has its voice once more!

Bringing Joust Back to Life

September 14th, 2015

So it came to pass that I ended up with three cabinets for $100 each.  A Great Golf in a Midway cabaret, some Toaplan run-n-gun in a Taito Qix cabinet, and… A Joust(!) in its original cabinet.

I agreed to purchase all three sight-unseen.  When I get them all home, the golf game worked except for a rolling screen, the run-n-gun has an board issue where some sprites are being displayed at the wrong horizontal locations, and the Joust?

Well, the Joust was dead.  Simple static video (monitor needs a cap kit, too), watchdog barking, no response to  inputs, nothing on the LED on the ROM board.

Image-She's dead, Jim!

She’s dead, Jim!

Read the rest of this entry »

Joust Showing 1 3 5 and a REALLY Effed-Up Screen

September 14th, 2015

[This was extracted from a large article about getting a dead Joust operational.  I thought it made sense to put this part in its own post to help anyone else with a similar issue.  This post may reference content from an earlier post, so keep that in mind when reading.]

So at this point the Joust will run through its self-tests, show 1 3 5 on the LED, and will eventually enter attract mode and can even be coined up and it will play for a few seconds before crashing again.  While the screen is AFU, you can actually read text on it if you look carefully (just turn the audio off).  Pay attention to how the left 1/3 screen is being drawn differently than the rest – this becomes important later:

Read the rest of this entry »

Joust With an Input Problem – 1st Player Always Runs Left

September 14th, 2015

[This was extracted from a large article about getting a dead Joust operational.  I thought it made sense to put this part in its own post to help anyone else with a similar issue.  It may reference content from the previous two posts here and here.]

…So now I have a Joust that boots correctly and comes up into its attract mode normally.  However, after coining it up and starting a game, I still have some issues – player 1 starts running to the left non-stop!

Opening the control panel shows the switch is not stuck, and disconnecting its harness did not change the behavior, so I have another board-level issue to resolve.  The input board multiplexes two sets of switches into a 6821 PIA, and the switches come in through one of two header connectors on the board.

Read the rest of this entry »

Sanyo 20EZ Video Inversion (Parts Kit) Searchable Page

May 15th, 2014

On Bob Roberts site, there is (or was, if the link is broken) a scan of a page that details how to add the missing parts to the monitor chassis to allow it to perform video inversion.  Since the page was scanned and not run through an OCR process, the text is not searchable.  As a service to the arcade collecting/repair community, I provide this HTML based, searchable version of the document.

(Note that I am not responsible for the use or misuse of this information, and I might have copied something incorrectly!  No warranties expressed or implied, and the risk of use lies with YOU!  YMMV.) Read the rest of this entry »

Merit Megatouch 5 Issues

May 8th, 2014

Offered to help out a friend whose husband had an upright Megatouch 5 (CRT-260 motherboard) that had some issues:

  1. Would randomly crash when touching the touchscreen
  2. Would randomly hang or crash even when left alone
  3. After left running for a little while (like, 15 minutes) calibration would “drift,” causing touches to track incorrectly

After opening it up, the touchscreen was covered in dust and the neoprene strips on the edges of it were pretty torn up and had a bunch of debris on them.  Cleaning the screen, strips, and then reapplying the strips with some thin double-sided tape cleared up the touch-the-screen-and-it-dies problem. Read the rest of this entry »

Hopper Error (HE) on Sammy Aladdin Pachislo Machine

January 27th, 2014

I picked this one up last year with a generic E1 error code for $50.  Reseating all connectors and performing a master reset (reset key in and turned, internal power switch cycled, reset key removed) brought it right up.  Been working fine for a little over a year then the hopper quit working.  Display would show “HE” when it tried to spit out tokens.

Removed hopper and inspected it – nothing jammed up, and all switches/optos in the bottom were functioning correctly.  When the hopper is started (using the switch within the cabinet), it moves just a slight amount.  Removing the motor shows that the motor spins about 1/3-1/4 rotation and then stops, with no resistance on the gear/spindle when I turn it manually.  If I leave the motor powered, I can start to smell that electrical smell that tells me something is bad within the motor.

I only know a little about DC motors, so I figured this one would be good to take apart and have a look at.  On the inside, one brush was almost completely worn down and the interior winding of the motor, the stator, and the commutator were also covered in carbon dust.  I noticed that carbon dust was in between the conductors on the commutator (dunno what they are called – the parts on the commutator that connect to the motor winding?), making me think that maybe the dust was causing problems by shorting things out?

Not knowing what else to do, I sprayed the whole thing out with electrical cleaner and cleaned out a bunch of the carbon dust with it (and there was a LOT).  After it dried, I used a small piece of paper folded in half and carefully cleaned between the conductors on the commutator as well.

I also learned what the additional holes in the cover of the motor (which held the brushes) maybe were for.  You can stick an object through them to hold back the brushes as you replace the cover otherwise you will not be able to get them back onto the commutator.

After that, I tried it briefly with the test switch and the motor was spinning happily!  I let it run for a little bit to make sure nothing was burning or gonna catch fire and mounted it back on the hopper.  Replaced and reloaded the hopper and tested it and coins came flying out!  Success!

Did a few test plays and the unit is working correctly.  My first DC motor repair!  Sweet!

Outlook Taking Hours to Download Email

March 21st, 2012

JIC it helps anyone else out there.  For no apparent reason, Outlook 2010 started taking hours to download emails that usually came down in minutes.  And when I say hours, I mean 3-5 hours!  The app would remain responsive for the most part, but would consume 100% of a CPU/core.  It would download a number of messages and then just pause for 45 minutes or more.

Turns out that the problem was my configured %TEMP% directory was filled up with almost 65,000(!) entries.  An automatic update of my Antivirus software failed, and started looping retry attempts.  This filled up the temp directory with little 1KB  files until it crashed.  It also filled up my event log.

Seems that Outlook gets really cranky when it has trouble with its temp directory.

So if you suddenly start having strange issues like this with Outlook, make sure your temp directory is not too full.

Dig Dug with Floating Pins

March 5th, 2012

Going through my boards, I came across a second Dig Dug board.  This one boots to static garbage and no sound.    Watchdog is barking.

Removing one of the CPUs gets different garbage.  Tried replacing with a known good one, no change.

Checking the pins shows me that a couple of the data lines, from D3 to D6 (I cannot remember which ones right now) are completely floating!  Rarely see that.  On a hunch, I replace the CPU’s socket, but this changes nothing.

Board traces go two a few chips (a 7474 and some other multiplexers or demultiplexers), and the floating lines seem to follow them.  But following the traces is tricky, so I gotta dig up some schematics to see what the Hell is going on.

Roc’N Rope PCB Issues

February 19th, 2012

Got an interesting problem with a Roc’N Rope board that I recently connected up to the new JAMMA test rig.  It has all its sounds, and plays correctly, but the text and tiles (e.g. the title graphics and the graphics used to build the levels) are all upside-down!

When the screen is flipped for cocktail mode, the text/tiles are still upside down.

Going digging through the schematics to see what’s what…


Mark Spaeth gave me a lead on a couple chips on the board that may be the cause of the problem.  That, combined with the schematics lead me to find out that I had a 74174 with a stuck output (pin 10).  I first clipped and lifted the pin for that specific output to ensure that nothing else was pulling the output and confirmed that the chip was bad.

After clipping and desoldering  the chip and replacing it with a socketed NOS 74174, all of the text and tiles are right side up again!

RnR Fixed

Also, I found out that I have another RnR board, this one with a graphics issue involving the sprites.  Should be able to get that one fixed as well, and then I will have two original RnR boards (both with their original serial number stickers on ’em).

OK – this other RnR board just had to have some of its chips cleaned and/or reseated.  It is looking good now as well:

Second RnR Board

 Nutshell: Flipped tiles and text, cause was a 74174 at location G15 with a stuck output @ pin 10.

XNA Command Console (XNACC) Added to CodePlex

February 5th, 2011

Well, I finally got off my ass and placed the code for the XNA Command Console that I have been working on (and off) since 2009.  I think it is ready for a public release and is available at:  Have a look if you get a sec.

Manager Red Flags

July 26th, 2010

(Attention lawyers and previous employers: the following information does not specifically identify a particular entity. 
You have nothing to worry about unless you think this represents you or your company and you know there is some truth to it.)

As I have worked with a few different kinds of managers/supervisors throughout the years, I have encountered one or two that had various red flags that I ignored but should have paid attention to.  Here, I share some of these red flags with you in the hopes that you do not end up getting screwed.  Not saying I got screwed (well, much), but you may! :mrgreen:

Red Flag # 1 – People tell you to watch out for her/him.
That should be obvious, but sometimes your first impression (which was good, in my case) clouds your better judgement.  Pay attention to what other people are saying about this person.  Even if you treat it as rumor, keep it in the back of your mind.

Red Flag # 2 – She/he has a long history of dismissing or demoting employees with excuses of “no confidence.”
When this manager joined us, it was because of a merger with another company.  My current manager was demoted in short order because of “no confidence.”  Note that he had been with the original company from the start and had been supervising/managing developers (quite successfully, I might add), up to that point.  Other people in the company (the new one in the merger) often mentioned her/his tendency to do this.

(As an aside, I strongly believe that one of the things that would greatly benefit the business world in general is a process for employees to call for no confidence in their manager/supervisor.  Once managers/supervisors realize that they can be called to task for the otherwise unknown shit they pull on their subordinates, things may change for the better.  Companies need to realize that most of the real work is done by those that have not yet reached their level of incompetence.  It is time to move out the ones that are not just incompetent, but possibly abusive and reduce the productivity of their subordinates.)

Red Flag # 3 – She/he exhibits bipolar behavior.
Not in the clinical sense, but you notice that she/he can run hot and cold at the drop of a hat.  Be more caution if this flipping between states is a result of perceiving you as a threat.  For example, she/he once asked if I wanted to be a manager “because I was good at it,” referring to how I worked with developers.  But when I put on my yearly review form that I wanted to become a lead/manager of the team, I was informed that she/he did not think that I would be good at it.  WTF?

Red Flag # 4 – She/he takes credit for things that she/he has nothing (or very little) to do with.  These types may exaggerate their involvement in the conception and implementation of (novel) solutions, or have their name placed on things that were conceived and implemented long before they were even around.

Red Flag # 5 – She/he is personal friends with one or more people in upper management.  By “personal friends,” I do not mean taking the occasional plane ride together, I mean things like frequently getting together on weekends, crashing at each other’s place, etc.  In some (less professional) companies, this can end up being Carte Blanche to do just about anything.  People in this position can become assholes to their subordinates, just because they can, and they have in the past without being called on it.  As as you may find out, the human resources department is sometimes just upper management’s bitches, so people like this are never correctly identified by their pattern of behavior and removed from the company.

Red Flag # 6 – She/he will undermine your authority over, or the respect you receive from, other developers. 
One specific case I can recall is with a problem one of our plug-ins had with another plug-in from another group.  Both worked fine separately, but when loaded into the same application, the other plug-in would sometimes not cleanup its interface correctly and would leave a window on screen that was broken, and would raise exceptions whenever it was touched.
Now, we had access to that other plug-in’s source code, so I wanted to load it up in the debugger to see what was causing the crash.  My manager at the time effectively berated me for this idea, that it was not the way to do things, and saying that “in her/his time,” we never blamed stuff on other developers.  (I never said it was the other group’s fault, I just wanted to get more details on what was happening.)  And then she/he had me make (random) changes to our code to see if we could get the exception to go away.
After a couple of days(!) if no results, she/he then stated in an open conference call “I guess we will have to find someone that thinks outside the box, then,” with other members of my development team present.

Well, I hope that helps… someone…

Agile Development – Scrum Pitfalls

July 26th, 2010

I have been subjected to a few so-called agile development methodologies over the years.  Most recently, Scrum was the one in question.  Well, it was kinda-sorta-almost Scrummish, which means it was not really Scrum at all, but we will ignore that for now.

All in all, the use of stories and a Wiki to keep track of development, testing, etc. was a really good thing.  It kept developers (er, me) focused on what needed to be done, keep straight how it was gonna get done, and identify any problems that would prevent it from getting done.

Add to that the daily 10 minute standup meetings, which was the place to specify to everyone else on the team what you were going to be working on today, and what, if anything, was standing in your way.


There were also some things that got in the way of using all of these tools, and those things tended to be the immediate (and sometimes upper) management, and the business side people.  Here are the three biggest problems we (I) had with things.

Problem 1 – everyone needs to use the Wiki!

More often than not, stories were written by our immediate supervisor/manager after getting verbal(!) information from our business side person.  The resulting stories were usually spot-on for what the business side had in mind, but not always.  When they did not jive with the expectations of the business side person, the developers were to blame, even though we were just following the story!  The supervisor rarely took direct responsibility for any miscommunication.  This would not have been a problem if the business side (and any other interested parties) used the Wiki for its intended purpose.  At a minimum, they should have looked at the stories written by the supervisor to make sure that everything was kosher.

Problem 2everyone needs to use the Wiki!

The Wiki was used for just about everything development-related.  What needed to be done, how it was going to get done, how it was going to be tested (the QA team members would also use the same Wiki), and, most importantly, show the progress of a story and its tasks.  This was good.

What was bad, is that developers often would get contacted directly by either our supervisor or our business side person to check on the status of things, or get details on what was being done or how it was being done.  We just spent 10 minutes updating our stories so that anyone could find out what is going on just by clicking a few links.  Now we get to spend more time updating this person or that person.  It is not that the time taken is a big deal.  It is the act of being distracted away from whatever we were working on.  Having to switch gears throughout the day to answer questions that have already been answered on the Wiki is not just a waste of our time, it shows a lack of respect for our time and what we do.

Problem 3Everyone…  Needs…  To…  Use…  The…  Wiki!!!

Meetings further exacerbated this problem.  Sometimes, questions would be asked during the standup meeting that were already answered on the Wiki.  Sometimes, hours prior to the standup.  Not only does this show a lack of respect for the developers, it shows a lack of respect for other people in the meeting as well — their time is being wasted here, too.  It also shows a lack of respect for the development process — we have the Wiki there for a reason.  Use It!  If our examples (anyone above us in the food chain) do not respect the system, then why should we?

Standups were not the only problem.  If any meetings were called that involved other people (like the business side), we would often get stuck answering information that was not just recently on the Wiki, but stuff that may have been answered at the start of the iteration, which may have been more than a week ago!  This is not just disrespectful, but it is a waste of money as well.

Assume that we have a 7-member team that has 5 developers, one supervisor and one business side person.  Assume an average salary of $100K for each developer, $175 for the supervisor and $200 for the business side person.  If the business side person takes up 15 minutes of a meeting asking a question (and getting answers) for something that was already on the Wiki, that costs the company $$$ (remember: time is money).  How much money?  Well, going by contractor’s math, a salaried person’s corresponding hourly rate is ~salary * .0005.  Examples:

$100,000/year ~=  $50/hour.   Rational: assume ~250 working days in a year (including 2 weeks vacation), at 8 hours a day, that comes out to 2000 hours.  So, 2000 hours * $50/hr = $100,000/yr.

If the business person spent 15 minutes reading the Wiki, that would only be 15 minutes of their time, so that would cost the company $25.  By wasting 15 minutes of time in a meeting with the developers and the supervisor, this costs the company $109.37.  ($84.37 of everyone else’s time plus the $25 for the business person’s time.)  Check the math yourself if you do not believe me – more than 4 times as much time and money is wasted!  Big difference, eh?  Even by calling a single developer, and chatting for 15 minutes, this costs the company more than necessary – it costs the business person’s time, the developer’s time, and the time for them to switch gears back to whatever they were doing before the unnecessary interruption.  At a minimum, this is $37.50, and 15 minutes of developer time where they were doing something other than development.

A simple way to avoid this problem – everyone in a meeting should assume that everyone else’s time is at least as valuable/important as their own.  Once you start thinking like this, you may stop wasting other people’s time as easily as you once did.

Conclusion: using any agile development methodology and its tools is probably a good thing.  But you must get everyone involved to buy-in and use the system.  Having anyone (including those higher up on the food chain) refuse to use the system can make others wonder why.  If anyone is too good for the system, then why are we saddled with the burden of using it?  If there is a senior-level manager that thinks that they are too important to click a few links on a web page, then fine.  But this should be handled by a lower manager, not by the developers themselves.

The developers have a job to do – let them do it.

Centipede Cocktails — Cocktail #2

December 4th, 2009

My previous post, about Cocktail #1, clearly documents the “easy one.”   This second one is gonna be another story.  It has a very dead monitor, and a non-functional board.  I have not yet benched the monitor, but it has no neck glow, which is never a good sign.

The board has problems, but at least I know it is not the CPU as I already swapped it, and I know that it is not a power problem on the second Cocktail, because the board has the same behavior in Cocktail #1.

Swapped all socketed chips to no effect — they all work on the other board.  Power points seemed right on the board, but I put it into my working cabinet to verify… and while doing so I managed to cross GND with a +5v trace and smoked R30 quite nicely on my AR-II board.

I have replaced it, but am still getting voltages that are too high.  Gonna have to hunt other likley suspects…

As far as the board goes, I am gonna have to break out the Fluke 9010 to work on this one…  Right after building an adapter for it so I cam power it up on the bench.

The monitor I should know more about once I have it on the bench and take a good look at it while I am capping it (and doing the sync upgrade).


Turns out that this one had a cracked flyback.  I ordered a replacement kit (flyback and caps) from The Real Bob Roberts and replaced the flyback (my first flyback replacement!).  Have not yet put it back into the game and fired it up, though.  Maybe after winter…

Centipede Cocktails — Cocktail #1

December 4th, 2009

Well, I ended up taking two Centipede cocktails off of another local collector as a package deal.  Still want that Gorf, though…  Will have to come back to that one soon!

But I digress…  So I have two Centipede cocktails here.  One of them has a dead monitor (and a non-working board, I later discovered), and the other will not sync:

Centipede #1 - No Sync

(Note how dirty the control panel is, as well as the color of the button and trackball to compare with another picture later in this post.)  Checked the wiring, the connectors, adjustments/controls and nothing would get it right, so I went to capping it.  Here is a picture of it half way done on my bench:


After capping it (and also doing the sync improvement upgrade while I was there), all it took was a few adjustments and the screen came up sharp and clear.  This image also shows one of the rebuilt trackballs, which is now running as smooth as when it came out of the crate:


 The text looks a bit blurry, but only in the picture.  The screen is really sharp!  You can also see a new shiny trackball at the bottom too.  Next to it is a really dirty button.  Here is one of the panels (from the other cocktail, because its panels are in better condition) with a replacement button and a (unmounted) rebuilt trackball after being cleaned up a bit:


All in all, not bad for about 3 or so hours of work, if I do say so myself.  (3 hours for everything, not just cleaning this panel! :)

Now, that other cocktail… that one is gonna be a bit harder…

Guide and other nice XNA features…

July 24th, 2009

So I have started playing around with the Guide, signed-in user preferences and information, and the UI features in XNA.  Gotta say, I am impressed so far…

I am currently punting and using the text input feature to get a player’s high score name, defaulting it to the configurd player’s name.  When the game is done, I want to provide a custom-drawn GUI that allows the user to use the gamepad to select and enter letters, just like an old-school game does. 

I am thinking of showing a visual keyboard and allowing the user to select characters from there.  I believe it will be quicker than just using up/down to change the character at the cursor’s position.  Uses either approach allows me to control the characters used, but I think the former will be more fun and a better learning experience.

XNA Studio 3.1 Cures the Audio Memory Leak!

July 17th, 2009

Well, I finally upgraded to XNA Studio 3.1 and the audio-related memory leak appears to be gone now!

That was easy…

Just goes to show you that even in managed environments, you still have to pay attention and know what you are doing when it comes to managing resources…

XNA Audio Troubles…

July 12th, 2009

So as I am adding sound effects to the game, I noticed that over time it would consume more and more memory and start to slow down. Another thing that would happen is that the audio would drag out and get sloooooooooooooooooow.

Now, I consider myself a pretty decent developer and I took steps to ensure that objects are reused where possible, instead of being new-ed up over and over again (.NET may be an environment that takes care of a lot of the dirty work of managing memory, but you still need to remember that it is a limited resource and code accordingly).

I should have taken the slowed sounds as a hint, but I went down the path of tracking objects and Garbage Collections to make sure that the object caches were healthy and the few objects that are destroyed and recreated are cleaned up in an orderly fashion as well.

After going though all that, I realized that the XACT-related classes are the culprits. If I turn off the sound, memory usage remains stable, even after running the game (in its attract mode) for more than 12 hours. It normally started to get slow after 45 minutes or so.

Looking up memory-related issues with audio in XNA, I read that other people have a similar problem, but only if they are not calling Update(…) in the Audio Engine during each frame. However, I AM calling Update(…) and am still having the problem. I even added additional calls to Update(…) from other locations in the code, but to no avail.

I even tried manually managing each Cue instance by storing them in a collection when they are played and then Dispose()-ing them when they are done playing. No difference.

I have temporarily resolved the issue by manually cleaning up and reallocating the Audio Engine at certain times during the game — between the end of a level and the start of a new one, and whenever the Title Screen transitions to the next screen when the game is in attract mode. Kludgy? Yep! But it works, and until an updated version of the XNA Framework is available that possibly fixes this bug, it will have to do.

Oh, and I used The GIMP to create a starburst graphic and am briefly displaying it as a “superluminal flash” (the warp equivlent of a sonic boom) when the player’s ship goes to warp. It looks sweet, even if I do say so myself! :)

XNA Wonderfulness

June 29th, 2009

So having some extra time on my hands, I have started playing around with XNA Game Studio again (version 3.0 this time). I picked up a shooter tutorial created by PHStudios which gives you a functional, but very simple game.

I started about the shooter that I have always wanted to write. It was going to look and behave much like an old arcade shooter. I wanted the details of the game to be just like an arcade game. For example, when it first starts, it will show a garbage screen quickly followed by an alphanumeric test (with some sprites in there), grids and colors, and ROM and RAM test (with successful results, of course), and then jump into attract mode waiting for someone to coin it up.

I have started this dream by taking the shooter tutorial and making extensive changes to it. I have since extended it by adding the following features:

  • Background Stars with multiple behaviors and effects (stopped, moving, warp, etc.)
  • Improved collision detection (only objects “near” each other are checked, and multiple collision rectangles are used for better checks)
  • Multiple enemies, including mini-bosses and bosses
  • Bonus items that “fall” that give you health, weapons, points, etc.
  • Additional weapon types
  • “Buddy” ships that dock to your ship for additional firepower
  • Auto-pilot/behavior for the enemy ships (i.e. what they do when the come on screen)
  • A “story” manager that manages each game level (i.e. what ships appear when and what their behavior is, also handles “waves” of attacks)
  • Explosions
  • Sound
  • A console that you can enter commands on to change/adjust the game’s behavior
  • And more!

Some of the features could be useful to others (like the background star, console, input manager) and I will release them free-for-use once I am done.

I am starting to think that I may be able to actually sell it once it is complete. I think that the retro arcade behavior of the game may appeal to some, and I hope that I can make it fun and challenging enough to get people interested.

Oh, and before I forget, there is a really nice free tool called (sfxr ) that can create sound effects. I am using it for the retro-like sounds in the game. I have also created a bunch of different types of sounds that I will likely also release free just as a time-saver to others.

Another Downside of Browser-Based Apps

November 20th, 2008

I once again find myself having to use a web-based application. This is a often just a fancy name for a bloated set of code that provides a little more functionality than what a set of CGI scripts could provide.

The beauty of CGI apps was that they were often very succinct – they were used to process relatively small amounts of data that were entered in a small form.

Today’s applications give you multiple form fields and expect you to enter larger amounts of data. Some even play fancy DHTML tricks to allow you to dynamically add more fields so you can enter even larger sets of data. Nice, huh?

But what happens if that server goes down while you are entering all that data? Or if the people operating the site do not take into consideration just how long you can be entering data into one of their pages? You usually do not know about this as you are entering the data, and usually are not aware that you are about to lose all of that data you just entered until you press [Submit] and get back an error — too late!

Now, I do not script web pages, so I could be wrong about this… But we are in a world where we can play all kinds of fancy AJAX tricks, so why the HELL do web scripters (not developers, that term is reserved for people that do more than just write fancy client-side script) not just put a little AJAX code that keeps hitting the server to do things like (1) make sure it is still alive, (2) check for impending session timeouts, (3) and other stuff that make web apps appear more robust and professional?

Having a warning that the server has gone down before I submit some data would be great – I could copy my data to Notepad and then get it back when the server comes back. Now, this would be harder for pages that contain too many fields, but that is another indication that your app needs a better platform.

IIRC, even 3270-based form-style applications could handle server disconnections better than today’s equivalent browser-form based applications — at least they had an icon on the status line to indicate session state! That is the ironic part about this… not only did we take a giant backward in UI evolution, but we completely missed the robustness that those older applications had.

Hurray for progress!

Remember kids – while lots of applications can work in a (D)HTML/AJAX browser-based interface, not all of them can work WELL in that interface. Read up on what happened when someone tried to port Lotus 1-2-3 to a 3270-style interface… Wanna guess how well that went?

Assumption is the mother of all Fuckups…

September 25th, 2008

So I find myself in the middle of a posting frenzy regarding a story on The Daily WTF:–More.aspx.

The point of my posts was that by withholding the assumptions made by the interviewer with his “one right answer”-kind of question, you put the interviewee in a bad position. (The link above explains the scenario.) IME, in the absence of specific details, one is likely to draw upon their experience to formulate a solution.

So when I read that according to the interviewer, the one right answer was to use a move operation to relocate the complete data file to where the watcher was looking for it. Of course, my first question was if the move was atomic or not. Far too many posters claimed that it always(!) was, other more intelligent ones indicated that it should be.

So my first post there was asking about different filesystems. For example, the average Linux filesystem can support many different filesystem types: ext2, ext3, ffs, UFS, RiserFS, FAT32, NTFS, etc., and can have filesystem locations on different partitions, drives, and even network locations… So what if the source and destination locations are not on the same device/partition? Are the moves still atomic? My experience with both Linux and Win32 filesystem driver code tells me no, so that is what I posted, indicating that the assumption that everything is on one filesystem/partition must be known.

This post started to draw out lots of interesting people… One started talking about how the POSIX specification states that renames (and moves?) must be atomic, but did not know enough to realize that some systems may play fast-and-loose with the specification (Hello, Windows!). Another started talking about how the rename(…) syscall (the syscall!) is atomic. Well duh – most C-style functions are… it may return to the caller only after the rename (or move) is complete, but that does not mean that the behind-the-scenes action is atomic to an outside (filesystem) observer.

It amazes me how so many people just do not “get it.” Maybe I am not just a good communicator…

Or maybe these people really should stay away from a keyboard as much as possible… :)

Software – Robust vs. Works

April 8th, 2008

I got myself involved in a thread on The Code Project Forums that lead to the idea of Robust software, and one of the posters said:

I call an application robust if it’s in use in the real world for a lengthy period of time and no data has been lost and no one has experienced downtime as a result of a bug in that app.
That’s the bottom line in the real world.

(Obviously, this developer never accidently opened a binary file in Notepad — which it will let you do, and is a very quick way to end up in the “data has been lost” scenario.) To which I responded why I was glad that he did not live in my real world, because the criteria he provided was a very low target in my opinion.

However, upon further reflection, while I still may not want developers like that in my world, I would just love to live in his! Imagine – not having to worry about things like data consistency across distributed systems, ordering, synchronization, and distribution of asynchronous events! Not having to think about the amounts of money that could be affected just by one little bug in the code somewhere because hey! – it did not lose any data, and the trader kept on using the system, right?! That would be heaven!

It would fan-effing-tastic to be able to use Notepad as the model of what “robust” means! When was the last time you used Notepad? How long has it been around? Ever lost data or experienced downtime due to a real bug in it?

Imagine how much more simple developer’s lives would be if that were the case…! Hell, at least I know that I would sleep better at night!

Capping Punch-Out!!

March 30th, 2008

Well, I finally got around to capping the two monitors on my Punch-Out!! game, and let me tell you, it is a serious pain in the ass!

It is bad enough that the Sanyo 20-EZ monitors are pains to cap in the first place, there are even more so when mounted horizontally in a narrow cabinet! Took more than three(!) hours for me to do the first (upper) one. The second one was a bit faster, clocking in at about 1 hour and 45 minutes.

A bit of hard work, to be sure, but the results speak for themselves:

Before: Top Monitor Before

After: Top Monitor Before

Also, note that there is screen burn from the collapsed line that was there before. This means that the game was in operation for a long time while it needed a cap kit!

While working on the monitor chassis boards, I was never more happy to have purchased a soldering and desoldering station a couple of years ago (shown sitting atop the Punch-Out!!):

Soldering/Desoldering Station
And here you can get a shot of how I had to work on the board – dangling out of the cabinet, wires everywhere:

PCB Hanging Out
Oh, and how do ‘ya like my nice little way of securing the PCB in the air while I work on it? :)

Much thanks go to The Real Bob RobertsTM for the cap kits (I purchased the 20EZ Plus kit, which has 9 additional chassis caps), and to Brien King (no, I did not misspell Brien), which has a step-by-step guide to getting the chassis PCB out of the Sanyo 20-EZ monitor at Arcade Restoration Workshop. I used the document for the first monitor, and tackled the second one from memory.

I also cleaned and changed the spring on the joystick. It is no longer as sticky as it was before thanks to getting all that old dirty grease out of it. However, it is still far too loose for my taste. It is playable, and I have played games in the arcade in far worse condition, but it still would be nice to have it a bit stiffer.

Also replaced the batteries in it so that the high score table works correctly again. Surprisingly, there is not a lot of corrosion in there.

OK – I think it may be ready to sell soon…!

Learn your history before you present yourself as an authority

January 2nd, 2008

When you read a book about something, you should be able to safely presume that the author is somewhat of an authority on the subject matter of the book. So when reading an e-book on C#, I was surprised to come across the following Author’s Note:

Author’s Note: struct is not a new concept. In C++, the struct is another way of defining a class (why?). Even though most of the time C++ developers use struct for lightweight objects holding just data, the C++ compiler does not impose this.

I find it interesting that the author of a C# programming book has to ask why “struct is another way of defining a class.” Tip: some things were done for backward compatibility and to make it easier to work with older code. Not to mention that in C++ there actually is a (small) difference between struct and class.

CString misuse #2

August 17th, 2007

Here is another one:

LPCTSTR cpString = _T( "This was some string message..." );
// Later On In Code...
CString str( cpString );
char cChar = str.GetAt( 0 );

If you write code like this, stop now and back slowly away from the keyboard – You’re Doing It Wrong!

The developer here is using a string object for a very simple operation. This is the kind of think people talk about when they say something like “using a shotgun to kill a fly”.

Extracting characters from a string (an array!) is a very basic operation – it is something we learn in our first C/C++ class or read about in our first C/C++ book. This is not something that you need a heavyweight class to help you out with.

Extracting the first character from cpString is as easy as doing one of the following:

char cChar = *cpString;
// -Or-
char cChar = cpString[ 0 ];

Remember – constructing and initializing an object always takes longer (i.e. has more overhead) than not constructing and initializing one. Think about wether or not you really need an object before you create one. If you can get along without it, see if doing so improves things.

For reasons mentioned in a previous post, in this case, the code is better without the CString.

CString misuse #1

August 17th, 2007

This is the first of many examples of ways to misuse and/or abuse MFC’s CString class. While this example (and following ones) are specific to MFC, they likely apply to all string classes (mutable or not). Here is the offending code:

CString str( "First Part Of Message\n" );
str = str + "Second Part Of Message\n";
str = str + "Third Part Of Message";

MessageBox( str );

If you write code like this, stop now and back slowly away from the keyboard – You’re Doing It Wrong!

First, the developer is adding (concatenating) strings together, but these are static/constant strings! They always add up to the same string, and as such can be made into a single constant string:

"First Part Of Message\nSecond Part Of Message\nThird Part Of Message"

So at a minimum, the start of the code should read:

CString str( "First Part Of Message\nSecond Part Of Message\nThird Part Of Message" );

Why not add up the strings separately like the original code did? Two reasons – overhead and exception opportunity. Each use of CString::operator+(…) can result in dynamic memory operations (allocation and deallocation). So you are looking at six potential heap operations (three potential allocations and deallocations including destruction, although in release builds of CString, the number of operations is less). Each operation has the potential to raise an exception and in the absence of per-thread heaps, can effectively bottleneck a multi-threaded application to the performance of a single-threaded one because the heap operations have to be serialized.

So by manually putting the strings together we have reduced heap operations from 6 to 2 – one allocation and one deallocation. That is a pretty good improvement, but we can do better!

The MessageBox(…) function does not take CStrings, it takes pointers to constant strings (LPCTSTR). So why is a CString needed here at all?

MessageBox( "First Part Of Message\nSecond Part Of Message\nThird Part Of Message" );

This final version of the code is simpler, will execute faster, and is more robust. Sounds like a winner to me!

Note: Some of you may be thinking about the preprocessor’s ability to automatically concatenate static strings. Yes it does, but it cannot automatically coalesce the above strings because they are separate – they are being passed (separately) as parameters to a function. If the + operator was not present in-between the parts of the string, they would be coalesced to a single string, but the unnecessary CString would still be there.

You’re Doing it Wrong!

July 31st, 2007

Having been inspired by the amount of photos on the internet showing various forms of spectacular failures (, ranging from failed bunny-hops to the most graceful faceplants, I thought that a coding-equivlent of it might be worth trying out.

To that end, this section will cover little snippets of “wrong” code found in the wild. Unlike the photos, where the failure is usually fairly obvious, the failures present in the code snippets are not always as obvious, so a small discussion explaining the failure will always be present.

OK – enough of the BS…! Let’s get started!

Sprint 2 – Stiff Steering and Hard Shifting

May 23rd, 2007

Problem: Stiff spinning steering modules and hard shifting between gears

(Quick little story – while bringing this beast into its location, I fell and got pinned under it for a few minutes. It is amazing how much having your chest compressed effects your ability to call out for help! :)

OK – onto the next issue… Its steering wheels were pretty stiff, and if you tried to give them a good hard spin they would come to a halt within a couple of turns. Removing and disassembling them was easy. Turns out the problem was that the old grease in them had coagulated/thickened so that it was about as viscous and sticky as cold honey!

Getting the grease out of the barrel and off of the shaft and sleeves literally took ~10 minutes (for each module) with some rubbing alcohol, elbow grease and rags. I had a friend helping me (Sean) and we each tackled one sterring wheel each.

After getting that old gunk out, a quick application of some light lithium grease on everything solves that problem – the wheels will now spin for at least 10 turns easily.

For the shifter modules, I just applied some powered graphite to the shifter “ball” at the opening of the shifter and after a few shifts to get it all around, the shifts are much easier now.

Solution: Cleaned and lubricated the steering modules, lubricated the shifter modules.

Note: One of the steering modules has a broken shaft/cone, which caused the wheel to be off-center, and it was being held in place strictly by the force of the retaining bolt that goes through the entire assembly. I managed to get it a bit straighter than it was before, but it still is broken internally. Not sure if I want to go through sanding down the two halves to try to get them melded or epoxied together – I am afraid of shortening the cone too much and causing problems. The wheel works and the game is playable, so I might just leave it as it is.

Punch-Out vertical foldover/overdraw

May 21st, 2007

The Punch-out that I recently obtained has a monitor issue (a monitors issue, really). Both displays are bring drawn starting ~2″ from the bottom of the monitor, and the upper few inches are being overdrawn on the same horizontal plane.

In other words, the beam is scanning left/right correctly but is starting too low and is not going high enough (vertically) to complete drawing the image correctly – the beam stops going up and keeps trying to draw the rest of the screen on the same horizontal line, causing a higher-intensity line to be seen (images below, apologies for their quality – I guess I shoulda taken off the Plexiglas first).

Top Monitor Overdraw Bottom Monitor Overdraw

The overdraw is visible in the image, but it is not obvious from the images that the bottom of the image is ~2″ higher than it should be. The overdraw looks like a classic capacitor problem to me, although I admit that I am not that familiar with the “starting too high” problem and I am guessing that the two are related. At least, the two things being related kinda makes sense in my mind…

I have cap kits from The Real Bob RobertsTM (highly recommended for all kinds of arcade-related parts, BTW!) for the monitors and will be capping them shortly.

More to follow…

Sprint 2

May 20th, 2007

Problem: Static garbage on screen

Purchased a Sprint 2 in non-working condition. Saw a picture of it, monitor worked – it showing what appeared to be static garbage on it. Got it home and confirmed that yes, it is showing static garbage (first image below). Turning it off for a couple of seconds and then back on again keeps pretty much the same garbage display, but sometimes gets some sounds out of it (engine and/or screeching sounds). Moving the self-test switch does nothing. First suspect that CPU is not running, because the screen is static (i.e. not changing while the game is on).

Sprint 2 - Before

After checking the usual suspects (voltages, loose wires, harness/wire burns because this is an older Atari game…), I yank the CPU to see if I get the same results (to narrow it down to the CPU). This causes a different effect, a screen filled with a single character and I get sound, so I presume for now that the CPU is working and the problem lies elsewhere.

Read the rest of this entry »