Wednesday, April 24, 2024

Re: Response to "The 6502 CPU Powered a Whole Generation!'

For some reason, Gmail sometimes destroys my formatting.  This was a problem with cutting and pasting.

Here is a corrected version:



 https://www.youtube.com/watch?v=acUH4lWe2NQ

I programmed the SNES, Sony PlayStation, and Gameboy Color for a couple of major video game developers. My experience with Z80 and 6502 programming goes back to the 1970s.

I love how efficient the 6502 processor is. I have no doubt that for 8-bit operations it is twice as fast as a Z80. The first chess computers were 4 Mhz Z80s, but manufacturers switched to the 6502, starting at 2, 3, and 4 MHz, and eventually going up to 6 MHz.

The Z80 has almost twice as many transistors as the 6502, but the 6502 was wisely designed to be fast and cheap.

However, I have to cry foul when it is stated that the Z80 takes an average of 13 clock cycles per instruction.

The Z80 has extra capabilities like 16-bit math and loads. When we compare 8-bit to 8-bit then the 6502 is at most twice as fast.

The Z80 index registers are very inefficient so I never used these registers.

Eight-bit load instructions take 4 to 7 clock cycles depending on the instruction type. Indexed 8-bit loads take a whopping 19 clock cycles.

16-bit loads take 10 to 20 clock cycles depending on the instruction type.

Eight-bit math takes 4 to 7 clock cycles depending upon the type of instruction. Incrementing or decrementing a memory location takes 11 clock cycles, and once again using the inefficient index registers takes 22 clock cycles.

Sixteen-bit math takes 6 to 11 clock cycles, and the indexed registers take 15 clock cycles.

Bit shifting the accumulator takes 4 clock cycles. Bit shifting other registers takes 8 clock cycles. Bit-shifting memory takes 14 clock cycles.

The block memory copy instruction takes a whopping 22 cycles per byte. For copying the same bytes into a block of memory, one can hijack the SP for an average of 5.5 clock cycles per byte not counting control instructions. (There are efficient ways to write this.)


I take issue with your criticism of the Timex Sinclair 2068 computer. I am one of many people who are still fans of this computer. This has much to do with the cost of the computer. The C64 cost $595 when released, which is about $1900 today adjusted for inflation. There was absolutely no way I could afford a C64, but the 2068 was actually a pretty good computer for $200 which I could afford. For me, it was a choice of the 2068 or no computer at all. (You claimed that the C64 was also selling for $200, but this is not what I saw back in 1983. It was hundreds of dollars more. You pointed to an ad that listed the C64 for $200, but I looked at the fine print which showed it was $400 with free software supposedly worth $200.)

The 2068 had a better BASIC with a 24K ROM and additional instructions for accessing graphics and sound.

The C64 definitely had better graphics capabilities for games with sprites and smooth scrolling. However, it was still possible to write games for the 2068. I wrote and self-published a Boulder Dash clone for the 2068 called "Diamond Mike". There are videos of it here on YouTube.

If I were comparing only the processors, I would choose a 3.58 Mhz Z80 over a 1 Mhz 6502. Obviously, I would prefer a faster 6502. I very much enjoyed programming on the SNES with the 3.58 Mhz 65C816. (The reason the speed 3.58 Mhz was used for multiple computers and video game systems is it is 1/4 the speed of the color signal crystal. They used one crystal to drive both things as a cost-savings measure.)

Best wishes,

John Coffey

Response to "The 6502 CPU Powered a Whole Generation!'


I programmed the SNES, Sony PlayStation, and Gameboy Color for a couple of major video game developers. My experience with Z80 and 6502 programming goes back to the 1970s. I love how efficient the 6502 processor is. I have no doubt that for 8-bit operations it is twice as fast as a Z80. The first chess computers were 4 Mhz Z80s, but manufacturers switched to the 6502, starting at 2, 3, and 4 MHz, and eventually going up to 6 MHz. The Z80 has almost twice as many transistors as the 6502, but the 6502 was wisely designed to be fast and cheap. However, I have to cry foul when it is stated that the Z80 takes an average of 13 clock cycles per instruction. The Z80 has extra capabilities like 16-bit math and loads. When we compare 8-bit to 8-bit then the 6502 is at most twice as fast. The Z80 index registers are very inefficient so I never used these registers. Eight-bit load instructions take 4 to 7 clock cycles depending on the instruction type. Indexed 8-bit loads take a whopping 19 clock cycles. 16-bit loads take 10 to 20 clock cycles depending on the instruction type. Eight-bit math takes 4 to 7 clock cycles depending upon the type of instruction. Incrementing or decrementing a memory location takes 11 clock cycles, and once again using the inefficient index registers takes 22 clock cycles. Sixteen-bit math takes 6 to 11 clock cycles, and the indexed registers take 15 clock cycles. Bit shifting the accumulator takes 4 clock cycles. Bit shifting other registers takes 8 clock cycles. Bit-shifting memory takes 14 clock cycles. The block memory copy instruction takes a whopping 22 cycles per byte. For copying the same bytes into a block of memory, one can hijack the SP for an average of 5.5 clock cycles per byte not counting control instructions. (There are efficient ways to write this.) I take issue with your criticism of the Timex Sinclair 2068 computer. I am one of many people who are still fans of this computer. This has much to do with the cost of the computer. The C64 cost $595 when released, which is about $1900 today adjusted for inflation. There was absolutely no way I could afford a C64, but the 2068 was actually a pretty good computer for $200 which I could afford. For me, it was a choice of the 2068 or no computer at all. (You claimed that the C64 was also selling for $200, but this is not what I saw back in 1983. It was hundreds of dollars more. You pointed to an ad that listed the C64 for $200, but I looked at the fine print which showed it was $400 with free software supposedly worth $200.) The 2068 had a better BASIC with a 24K ROM and additional instructions for accessing graphics and sound. The C64 definitely had better graphics capabilities for games with sprites and smooth scrolling. However, it was still possible to write games for the 2068. I wrote and self-published a Boulder Dash clone for the 2068 called "Diamond Mike". There are videos of it here on YouTube. If I were comparing only the processors, I would choose a 3.58 Mhz Z80 over a 1 Mhz 6502. Obviously, I would prefer a faster 6502. I very much enjoyed programming on the SNES with the 3.58 Mhz 65C816. (The reason the speed 3.58 Mhz was used for multiple computers and video game systems is it is 1/4 the speed of the color signal crystal. They used one crystal to drive both things as a cost-savings measure.)

Thursday, April 11, 2024

Old Tube TVs

For those who don't remember, powering up really old televisions would start as an expanding dot in the middle of the screen.  It would only take a few seconds to reach full size.  Old televisions used vacuum tubes instead of transistors, which needed warming up.  They glowed orange.  You could see them through the heat vents in the back.  In a dark room, the TV would light up the wall behind it.

I remember going to a repair shop that had dozens of different types of replacement tubes.   A local drug store used to have a tube tester by the door.

Starting in the mid-1970s, manufacturers advertised televisions that were "Instant On".  I noticed these TVs kept some vacuum tubes powered up even when the TV was "off".

Old TVs put out a great deal of heat.

Friday, April 5, 2024

Columbus Commons Mall



I very much miss the Columbus Commons Mall in downtown Columbus. In the early history of Columbus, many shops were concentrated in the southwest corner of the city, but this would change as businesses moved to the major roads. Most of this mall has been remodeled to be offices for Cummins Engine Company. A small part remains as a public space.

The mall was built when I was around age 12 or 13. For me, it was a great place to explore. I mostly liked the arcade, but I also liked the bookstore, the ice cream shop, and the hamburger place. In the mid-70s there were vendors selling treats, like popcorn and baked goods. There was also an electronics store that I liked and I became friendly with one of the employees.

Columbus opened a new mall on 25th Street, but that failed and is now being remodeled into some sort of recreation center combined with medical offices.

Sunday, March 24, 2024

Recovered?

Yesterday:

Although I still cough, it has diminished. However, the aftereffects of COVID make me feel like I am not yet fully recovered.

This experience makes me think that I was a bit unhealthy to begin with, and that I need to try to improve my overall health.

Today:

I feel better today than have for the last six weeks. I keep saying stuff like this, but my improvement has been very slow.

My coughing is often worse at bedtime.

My lungs feel more clear although I can tell that whatever was bothering them and making me cough has not completely gone away.

Friday, March 15, 2024

The Game of Risk - Numberphile

https://www.youtube.com/watch?v=RdooKXXcWWc

I wrote a Risk AI for the Sega Genesis in the mid-90s.  My algorithm was brute force trying to look a few moves ahead.  It was computationally intensive and evaluated moves on the chances of success.  This resulted in an aggressive approach that wanted to move a large army attacking countries one at a time.

The lead programmer didn't like my AI and wanted to use his own.  I convinced his manager that my algorithm was winning and he told the lead programmer to use my code.  However, the lead programmer used his own AI instead.

Tuesday, March 12, 2024

Former Columbus, Indiana Mall

I went for a walk in the "mall". The old mall failed and the city is converting it into some sort of recreational center.

It still looks like a mall but they have added on to it. It still has one sporting goods store, three restaurants, and a video game arcade.

On the west end they have a surprisingly large area devoted to medical offices.

I get the impression that the city is trying to get many different uses out of the former mall space.

Tuesday, March 5, 2024

ReviewTechUSA


ReviewTechUSA
8 hours ago
I think gonna make a video on being an old as ass gamer and seeing how much the industry has changed over my lifetime, and how lost it is now. Would you watch it?



@john2001plus
8 hours ago
You are not old. I am going on 64.  I started gaming as a teenager in the 1970's with coin-operated mechanical games and moving on to Pong and other early video games.  Eventually, I would become a video game programmer.


Highlighted reply

@bedtimestories1065
17 minutes ago
Dude you're like a legend. I'm 23 and a software developer myself. I don't know how you guys did it "back in the day" with no internet for assistance. Mad respect for you man.


Reply

@john2001plus
0 seconds ago
 @bedtimestories1065  My first real video game was called Diamond Mike in 1985 for the Timex Sinclair 2068 computer.  There are videos of it here on YouTube.  My problem is that I didn't have any development tools.  So I wrote a Z80 Assember in BASIC which was very slow.  I sped it up a little by writing a string search routine in machine code, but the program was a two-pass assembler that would still take six hours to assemble my game.  I was working a Data Entry job, living in my parent's apartment, and trying to write the game in my bedroom.  So roughly every eight hours I would test the game, make a change, and start the assembly process over again.

The following year I would write the same game for the Atari ST.  This time I had development tools with a C compiler that also supported assembly code.

After working a few years as a database programmer, I got a job as a video game programmer with Sculptured Software in Utah in 1993.  We had real development tools, but most of the work was in assembly language.  In 1999 I went to work for Xantera writing Gameboy Color games using Z80 assembly again.



Saturday, February 17, 2024

My COVID-19 experience

I am seeing some improvement.  My experience with COVID-19 has been like a mild cold changing to a moderate cold, then to a severe cold, and finally back to a mild cold on the 5th day.  It appears that the Paxlovid has helped.  I am told that without it this can drag on for much longer.

--

Wednesday, February 14, 2024

COVID-19



I was trying to be careful and not catch COVID-19.  I was still practicing social distancing when possible, but I caught it anyway.  I don't understand how I got it, but it was either at a chess club or from going to Walmart.  I use the curbside pickup at Walmart, but sometimes I also go into the store.

I thought I would be immune because I am fully vaccinated, but the dominant JN-1 variant has a slightly different spike protein, sometimes bypassing vaccine immunity.  The latest vaccine was supposed to offer some protection from this variant.

Yesterday, I had trouble getting Paxlovid because my pharmacy was sold out.  I had to go to three different pharmacies to get it.  I took my first dose last night and my second dose this morning.  I have eight more doses to go.

Paxlovid is supposed to stop the virus from replicating, which would be very nice.  Any virus will grow exponentially until your immune system kicks in and starts destroying the virus.  The Paxlovid might help the immune system to win the war.

Yesterday, on my second day of COVID-19, I felt like I had a bad cold and could not get anything productive done.  I went to sleep at 10:30 which is early for me.  I woke at 5:00 AM feeling fully rested but wishing I had gotten more sleep.  I got up for a couple of hours, but when I started to feel tired I went back to bed.  I didn't think that I would be able to go back to sleep, but I got just enough of a nap to make me feel better.

I can tell that there is a battle going on in my body.  Either the immune system will win, or the virus will.  So far, I feel better today than yesterday, so maybe my immune system is working.

--
Best wishes,

John Coffey

http://www.entertainmentjourney.com

Friday, February 2, 2024

Diamond Mike 1985 by JRC Software Played on Real NTSC Timex Sinclair 2068 Computer


@john2001plus
I'm the author.  I thought the game was lost forever, but David Anderson found a copy.  I still have the Atari ST version I wrote in 1986, but I gave away all my Sinclair stuff (to my cousin who is no longer with us) when I moved to Utah in 1993 to work for the video game developer Sculptured Software.

The way you get through the 4th screen is to move right picking up diamonds while avoiding enemies.  Then you do the same thing on the lower level moving left.  The early levels are designed to be simple to teach the user how to play the game.  I think that some of the higher levels are more interesting.

There are no bonus screens.

Most of the time you don't have to hold the button to grab diamonds, but run through them.

I had better results playing the game with the keyboard.  

I also have trouble running the game under emulation.  I plan to try to find a workaround if one exists.  I think that it has something to do with reading the keyboard not working correctly under emulation.

"Compass" was a compiler-assembler that I wrote.  GGS was "The Great Game and Graphics Show" which was more of a demo of graphics and simple games.  In hindsight, I shouldn't have sold this as a product but offered it as a free demo.

Yes, the game uses the sound chip on the 2068 that wasn't available on the original Spectrum.

The multiple explosions at the end are technically a bug.  I expected the user to hit 'N' to advance to the next screen.  I should have made that automatic.

Friday, January 26, 2024

Push to 3000 on chess.com puzzle rating

The puzzle ratings on chess.com don't correspond in any way to USCF ratings.  I complained about this to chess.com, but they responded that their puzzle ratings are where they want to them to be.  (BTW, the upper limit on puzzle ratings is ridiculously high at around 32768.  Some people have actually reached this limit.  For computer nerds like me, this matches the upper limit on a 16-bit signed number.  This tells me that they are using 16 bits to store ratings in their database.)

I wanted to see if I could push my Chess.com puzzle rating up to 3000.  I've been there before, but it is a hard rating to maintain.  

My puzzle rating averaged around 2935.  At this level, I am almost as likely to fail to solve a puzzle as I am to succeed.

I had a theory that if I did enough puzzles I could reach 3000 through a "random walk".   The idea was that if I bounced up and down enough I would eventually hit 3000 through random variation.  This wouldn't mean that I deserve to be at 3000, but got lucky.

It appears to me that chess.com will present puzzles with a sizeable range of difficulty.  This is where luck plays a factor.  However, every time my rating would creep up, I would face problems that seemed too difficult.  This definitely took me out of my comfort zone.

It took me about 2.5 hours to reach 3000.  However, to get there I had to analyze at a deeper level than I am used to.  Whereas the simple chess problems on my website are designed to build pattern recognition, it seems to me that the puzzles on chess.com are more of a measure of how well a person can analyze.  However, pattern recognition is still a factor.

--

Tuesday, January 16, 2024

Fwd: Pitfall of Extrapolation

FYI.

On Mon, Jan 15, 2024 at 12:14 AM Albert wrote:
Hi John,

Sometimes you run into something that's interesting but you realize that most of your friends either don't care or don't get it. Well, this YouTube video was one of those interesting things. You're the only person I could think of who would find it interesting. I have to start looking for some more smart friends or at least curious friends. lol



On Tue, Jan 16, 2024 at 7:53 AM John Coffey <john2001plus@gmail.com> wrote:
I saw this one.

I am pretty mathematical.  I found it interesting, but not enough to figure out the reason.



---------- Forwarded message ---------
From: John Coffey <john2001plus@gmail.com>
Date: Tue, Jan 16, 2024 at 8:11 AM
Subject: Re: Pitfall of Extrapolation
To: Albert 


I was dumb enough to watch the full video here:


This involves math slightly above my level and lacks relevance to my life.  

Sometimes math goes so far down the rabbit hole that it feels like naval gazing.

I often thought that I should have been a math major.  It would have been more interesting to me than my biology major and fits in well with computer programming.

Wednesday, January 10, 2024

Why did Kids Stop Walking to School?

https://www.youtube.com/watch?v=DqvQ-5784po

For most of my school years, I walked to school.  During High School, I had to take a bus, but if the weather was pleasant, on rare occasions I would walk the mile and a half home just because I liked to walk in good weather.

Tuesday, January 2, 2024

Early Internet

Around the year 2000, I was serving on the board of directors for the Utah Chess Association. We were considering abolishing our state chess newsletter and making a website instead. I pointed out that most people didn't have Internet access yet, but we expected that to change. (In fact, someone had set up a chess hotline with an answering machine, where you could call the phone number to get the latest state chess news.)

It was roughly 20 years ago that I switched from using dial-up Internet to the long-anticipated cable Internet. Getting 3 Mbps was a significant improvement over the roughly 100Kbps I had.

In the early days using slow dial-up modems, like 1200 bps, you would sometimes try to load a web page and get up and do something while the page was loading. I did this all the time.  It was so bad that there were optional programs that would download pages ahead of time so that you didn't have to wait for them to load.

Twenty years ago, just a few websites had video, but because of the limited bandwidth, those videos would occupy only a tiny part of the screen and be very low resolution. Apple's video format, Quicktime, was invented to help deal with low bandwidth.

YouTube was created in 2005. The first videos were at best "Standard Definition", which means that they were low resolution. I don't remember for sure, but the first videos might have had a resolution half that of Standard Definition, or roughly 240 lines. It would take years for Internet speeds to improve so that YouTube could offer higher-resolution videos.