Earthshaker recreation – Retro game remake

Published by:

I started working on a computer science assignment then got distracted, I ended up starting to write a remake of the old classic Earthshaker which was on the ZX Spectrum. I’m not sure if this game was released outside of Europe so it way not be too well known.

I used a copy of the sprites from the original game as well as some sounds. I captured as much as I could via an emulator.

The levels are loaded from ASCII files and I created the first level from the game and it appears to work somewhat as the original. The gravity and the player movements aren’t quite right yet but the basic rules of the game physics are working as intended.

The level is called “Room for improvement” and as you can see, the interface definitely has room for improvement.

I wrote it all in Java, I used a tutorial from MrJavaHelp on YouTube to start me off with the basic drawing image to a window and getting keyboard input routines then I expanded it from there. His video is here if you’re interested.

I will eventually make the code open source and upload it on this page, but I’m using a library from my university that I don’t know if I can distribute, I plan to replace that library with some of my own routines eventually (it’s just ASCII file loading methods I’m using from it). I’m also worried about copyright issues with the graphics and sound as they are from the original game, I don’t intend to sell it and the original game was distributed for free with a magazine back in the day. It loads the levels, graphics and sound resources from external files so they can be changed at the will of the user.

More details (and hopefully a download link) will be coming soon…

Samsung HT-X200 Teardown – LED display control

Published by:

In the recent YouTube video I uploaded I went into detail to show how to write to the display, which has 3 PT6961 IC’s, from an Arduino

Below is the chart that I put together to map the physical locations to the logical locations.

note: the data bytes are actually used in reverse order on the IC’s so they will need to be flipped when copying data from the buffer to the actual display.

The code is as follows:

/*
 LED Display test
 By Peter Murray
 Writes to PT6961 IC's
*/

#define CMD1 0b00000011 // Display mode setting command
#define CMD2 0b01000000 // Data setting command
#define CMD3 0b11000000 // Address setting command
#define CMD4 0b10001111 // Display control command
#define CLK 2
#define DAT 3
#define S1 6
#define S2 5
#define S3 4

unsigned long dBuffer[7]; // Display buffer - last 3 bits are ignored.

void writeByte(byte toWrite)
{
 int x;
 for (x=0;x<8;x++)
 {
 digitalWrite(CLK,LOW);
 if (bitRead(toWrite,x))
 {
 digitalWrite(DAT,HIGH);
 }
 else
 {
 digitalWrite(DAT,LOW);
 }
 digitalWrite(CLK,HIGH);
 }
}

void writeByteReverse(byte toWrite)
{
 int x;
 for (x=0;x<8;x++)
 {
 digitalWrite(CLK,LOW);
 if (bitRead(toWrite,7-x))
 {
 digitalWrite(DAT,HIGH);
 }
 else
 {
 digitalWrite(DAT,LOW);
 }
 digitalWrite(CLK,HIGH);
 }
}

void displayBuffer()
{
 int x;
 digitalWrite(S1,LOW); digitalWrite(S2,LOW); digitalWrite(S3,LOW);
 writeByte(CMD2);
 digitalWrite(S1,HIGH); digitalWrite(S2,HIGH); digitalWrite(S3,HIGH);

 digitalWrite(S1,LOW);
 writeByte(CMD3);
 for (x=0;x<7;x++)
 {
 writeByteReverse(dBuffer[x]>>24);
 writeByteReverse(dBuffer[x]>>16);
 }
 digitalWrite(S1,HIGH);

 digitalWrite(S2,LOW);
 writeByte(CMD3);
 for (x=0;x<7;x++)
 {
 writeByteReverse(dBuffer[x]>>13);
 writeByteReverse(dBuffer[x]>>5);
 }
 digitalWrite(S2,HIGH);

 digitalWrite(S3,LOW);
 writeByte(CMD3);
 for (x=0;x<7;x++)
 {
 writeByteReverse(dBuffer[x]>>2);
 writeByte(0x00);
 }
 digitalWrite(S3,HIGH);
}

void setup()
{
 pinMode(CLK, OUTPUT);
 pinMode(DAT, OUTPUT);
 pinMode(S1, OUTPUT);
 pinMode(S2, OUTPUT);
 pinMode(S3, OUTPUT);
 digitalWrite(S1,HIGH);
 digitalWrite(S2,HIGH);
 digitalWrite(S3,HIGH);
 dBuffer[0] = 0b10000000000010000000000010000000;
 dBuffer[1] = 0b01000000000101000000000101000000;
 dBuffer[2] = 0b00100000001000100000001000100000;
 dBuffer[3] = 0b00010000010000010000010000010000;
 dBuffer[4] = 0b00001000100000001000100000001000;
 dBuffer[5] = 0b00000101000000000101000000000100;
 dBuffer[6] = 0b00000010000000000010000000000010;
}

void scrollScreen()
{
 bool y;
 int x;

 for (x=0;x<7;x++)
 {
 y = bitRead(dBuffer[x],31);
 dBuffer[x]<<=1;
 if (y)
 {
 dBuffer[x]+=1;
 }
 }
}

void loop()
{
 // put your main code here, to run repeatedly:
 displayBuffer();
 delay(100);
 scrollScreen();
}

Hipstreet Phoenix tablet to TV box conversion

Published by:

Ok, so the Hipstreet Phoenix tablet that I repaired the power button on a few months back got knelt on. The screen didn’t like it very much and refuses to work now due to a crack.

Looking at the bottom edge of the tablet you notice there is a nice selection of features.

From left to right: Headphone/Headset (Covered by my thumb), Mic, Micro USB, Mini HDMI, A 5V charging port, reset button, microSD card socket.

I decided to order some items in to see if I could use these ports instead of relying on the LCD/touchscreen interface.

Here is the board in all it’s glory. a fraction of the size of the case it is in.

Firstly I have already ordered in some USB OTG cables. (Actually ordered a set 4 months ago on ebay and not seen any, and ordered a set 2 months ago and still waiting for both). They haven’t arrived so I did a quick bodge to use USB OTG without the proper cable as you will see in the picture below. I’ll detail that soon.

Next I got a HDMI cable, turns out I purchased a MicroHDMI cable 😛 but I went out today and got the MiniHDMI cable and plugged it into the tablet and switched it on. Nothing appeared on the screen until it was a good minute into the booting but it worked ok, it was a little too large for my screen but I have an old TV so I found that with a lot of things, but the main point is that it works on HDMI!

I found that I could use the tablet by pressing on the touchscreen but it’s somewhat hard to know where your touching when the LCD is broken and your watching it on a TV.

Next I turn my attention to the USB OTG situation. I heard that you can plug in a mouse and/or a keyboard and use them with Android based devices, I have never seen this before myself so I was curious. The only spare keyboard I have is an old PS/2 Style keyboard so I plugged in my PS/2 to USB adaptor, the keyboard initialised (as noticed by the lights coming on for a second) but I did notice the display flickered while doing so but it didn’t seem to do any kind of input. Maybe it was drawing too much current and was disconnected by the tablet after initialising, I will find a USB keyboard and try again later.

Next I try a USB mouse, the only one I have at hand is a cheapo wireless once from Dollarama, this appeared to work fine, I tested it and had a quick game of solitaire to test it.

Ok, so the bodge that I did to get USB OTG up and running is based on instructions I found here:

Image from: http://tech.firstpost.com/news-analysis/how-to-make-your-own-usb-otg-cable-for-an-android-smartphone-29503.html

What I did was locate pin 4 on the microUSB socket on the PCB and trace it to a point where I could solder on a wire, luckily I found a test point and used that, I also attached a 2nd wire to GND and brought them both out (The orange and white wires). In order to use USB OTG I just short them together. Now I needed a microUSB to Female USB-A connection, I simply took an old dual USB socket and bridged the 2 connections together at it’s cable header, turning it effectively into a crude gender changer for USB-A then used a normal microUSB-USB-A cable to connect it to the table. voila!

This is only a temporary solution until my proper cable arrives.

This is the current state of the device.

Plans for the future:

  • Put the PCB in a small plastic box make new buttons on the front
  • use external power into the 5V charger port
  • Use a small USB hub (preferably powered) with a proper USB OTG cable to allow keyboard, mouse, and other USB devices
  • Modify the Android OS on the device to allow me to use it for something useful

That’s all for now, hopefully more to come soon.


Quick update:

I made a proper USB OTG cable (Using the website mentioned above) and found a USB keyboard, this worked great 🙂 I then found a small USB hub, this one is a 4-port USB 1.1 hub unfortunately but it’s good enough for mouse and keyboard use, which it did 🙂

I also found a 5V charger with the same connector as the one found on the bottom of the tablet and it is now currently charging.

I unplugged the LCD and Digitiser cables and it still takes a while until it enables the HDMI, I did a factory reset too and it had nothing on the HDMI for quite a while, I was a little worried that it was showing something on the LCD asking me to confirm something during startup. This worries me about re-flashing the firmware as I’ve seen some devices require you to do some selections on the bootloader, I have to rebuild the volume button set in order to test this but I will have to see if it will initialise the HDMI.

Using ROM’s as combinational logic (Updated)

Published by:

Someone commented on my youtube video about the EPROM as combinational logic stating that the video was too quiet. Unfortunately my original footage is no longer available to re-upload so I decided to redo it. This time I decided to expand upon the concept by including other ROM types than just the EPROM since the concept does apply to all parallel ROM’s.

The software I designed should work the same for different types of ROM’s since they follow the same concept.

A new page has been created with the document on it here: http://39k.ca/using-roms-as-combinational-logic/

The new video can be found here: https://www.youtube.com/watch?v=t6alYGpdrqU

 

Using EPROMs and simple combinational logic

Published by:

This post has been replaced by a newer version:

Using ROM’s as combinational logic (Updated)


A few years back I came across something in an old Z80 book that mentioned that EPROMs can be used a crude logic devices, though only supporting combinational logic, you could craft the data to mimic logic. Recently I tried it out and found it to work really well.

I recently uploaded a YouTube video showing my experiment.

In the video I hand-crafted the code to go into the EPROM, this took a while just to act as 2 logic gates, so I decided to have a go at writing a bit of software to do it for me.

Boolean to ROM conversion software

boolean2rom

I wrote this in Delphi and you can put up to 8 boolean algebraic expressions into the boxes, one for each data line output. You select how many address lines you are using (you can put only the number your actually using and ground the rest in hardware) Then you hit the “Parse” button and it will go through each address combination using the boolean expression to create the required data for each location.

This is only a first version so may have some kinks that need to be ironed out. The handling of parenthesis is very crude and does not take them into consideration with order of operation. it does somewhat process the order as ~(NOT), * (AND), +(OR), ^(XOR).

Valid inputs are A-P (not case sensitive), these are representative of A0-A15 inputs. Unused Data lines can be unchecked to not have them used

Once you have parsed what you need, you can view the data to the right on the table. Note: These numbers are all in Decimal!

You can then hit the “Save…” button and select where you want to save the binary file. Note: you need to add you own .bin extension, I’ve not added it yet.

 

Hopefully this will be of some use to people, it’s certainly an interesting concept.

 

Dave Jones from the EEVBlog used a similar method to make a finite state machine PLC back in 2000 : http://alternatezone.com/electronics/plc.htm

 

bye for now, if you have any questions, suggestions, etc.. please contact me:  peter AT 39k.ca

Kepco JQE75-1.5M PSU refurbishment – Part 3 (Finale)

Published by:

So I finally have finished the refurbishment of the Kepco JQE75-1.5M PSU.

I forgot to upload this post so it is about a week late unfortunately, but better late than never.

 

In this final instalment I have already finished the first PSU, then I do the entire 2nd PSU the same way as the first to show you what I went through to get the finished product.

The total cost of this project was around $35

  • $10 each for the PSU’s
  • $9.74 for a pair of screens
  • couple of dollars worth of resistors and diodes
  • few cents worth of solder and heatshrink

It took a good few hours to do each modification, the longest part was grinding down the metal to fit the IEC connector. This would have been seconds with the proper tools but I didn’t have them 😛

 

The PSU’s appear to be working fine, though I need to do a proper burn-in test to be 100% certain of their stability.

 

Hopefully more projects to come soon.

Thanks for watching!

Kepco JQE75-1.5M PSU refurbishment – Part 2

Published by:

So I continue my refurbishment of the Kepco JQE75-1.5M PSU.

My LED displays arrived from Ebay so I decided it’s time to fit them, and time to replaced the neon power indicator with an LED.

 

I could not find a stable voltage (as in, not changing when adjusting the current/voltage pot) so I opted to find an AC voltage either on the board or on the transformer itself.

After 2 attempts I found an unused 24Vac winding on the transformer and hooked up the following circuit to the LED display and power LED which replaces the neon bulb.

 

mod

(Note: there is a 330uF 50V electrolytic reservoir cap across the DC output voltage I forgot to draw in)

 

This seems to work fine, now I just need to fit an IEC connector and a bezel for the LED display on the front panel.

2016-03-19 01.08.00

How I reverse engineer digital circuits

Published by:

2016-03-12 19.56.14

It’s been a while since I’ve posted to my blog, but here is a video I just uploaded showing how I reverse engineer digital circuits.

I’ve been doing this sort of thing for as long as I can remember and I find it very relaxing at times. Nothing better than throwing some nice music on and doing a bit of reverse engineering.

I was recently given a dot matrix LED display by a friend and decided to reverse engineer it so we both can run them, he still has one of his own.

There is a damaged chip on the board which meant that some of the displays didn’t display their 2 bottom rows but I will be tackling this issue in a later video. I will also be transferring the control to a PIC instead of the Arduino as it was not fast enough to get a good refresh rate, and this is without any external communication facilities being addressed.

Here is the video:

The arduino sketch can be downloaded here

and the Design Spark schematic file can be found here

the PDF of this file can be found here

*There are a few parts not finished in the schematic, but there is enough to provide functional detail.

I hope you enjoy the video, I will eventually follow it up with the repairs and the porting to PIC.

bye for now!

Kepco JQE75-1.5M PSU refurbishment – Part 1

Published by:

I found myself some PSU’s at a flee market a few weeks back and decided to pull out the matching pair of 75V PSU’s for some inspection. Much to my delight, they both appear to work fine.

The only issues with them is the neon power indicators are not working (or barely working), and the voltage/current multiply switches for the analogue movements are crusty. And not to mention a non-standard power connector on the rear. These will all be replaced and updated in future videos.

I have decided to replace the analogue meters with LED modules (just waiting for them to be shipped from China on the slow boat) then I will hook them into to sense the output terminals and find a way to recess it in places of the old meters.

For the power indicator, I will find a voltage rail inside the PSU (most likely an opamp rail) and fit an LED in place of the neon lamp.

Please keep tuned for more!

You can subscribe to my YouTube channel to get updates on my progress too.