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.)

Saturday, April 20, 2024

Apple's Silicon Magic Is Over!

https://youtu.be/AOlXmv9EiPo?si=j_EAv_ahdgcmzEvI

Chips are reaching the physical limits of what is possible. According to a video I watched today, an experimental 1 nm process only has 1 atom per transistor. That doesn't sound right to me, but if true, then you can't go smaller than that.

There might still be some room for improvement, but smaller circuits tend to fail because quantum effects cause electrons to jump between circuits.

Someday computers might have circuits that use light instead of electricity, but right now the technology is not even close.

What would it mean if computers can't get much faster? If you need more computing power then you would need more chips, or bigger ones, that either way consume more energy.

However, it feels like computers are plenty powerful right now. It is not like the general public has a strong need for more powerful chips.

Apple already has good competition from AMD. My mini computer is twice as powerful as the Apple M2 chip.

Sunday, April 14, 2024

A Look Inside Apple's $130 USB-C Cable

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

Apple sells things at a higher margin than other companies.  Although this is a superior cable for data transmission, maybe competitors will offer comparable products.

Saturday, March 30, 2024

How Sinclair Spectrum games handled color.

The Spectrum computer could only display one foreground and background color for every 8x8 pixel square.

Many games would have multicolored backgrounds and a single color, maybe black, foreground.  Then "sprites" would be black and the same color as the background.  It works, but looks hokey showing just how inferior the color capabilities of the Spectrum are.  It makes it look like you are playing a black-and-white game with a color overlay on the screen.

When the computer was released, it competed against computers like the Apple II and the Atari 8-bit.  The C64 would come out 6 months later.

 

The 2068 had three extra graphics modes if you count frame swapping as one mode.  Nobody used the extra graphics modes, as most games were ports from the Spectrum.  

I wanted to do great things with the extended color mode, which allowed two colors for every 8x1 pixels.

Why is AI so bad at spelling? Because image generators aren’t actually reading text | TechCrunch

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.

Your Internet is Too Fast


It was costing me around $90 a month for gigabit Internet service.  So I downgraded to 200 Mbit, for about $35 per month, and it is plenty fast for me.

Wednesday, March 13, 2024

68000 processor vs. 65C816 processor

The 68000 was by far the easiest assembly language to program. The instruction set is HUGE, compared to the 6502 which has a small instruction set. As I recall, the 68000 allows you to have 8, 16, and 32-bit operations in both moving data and math and has a bunch of internal registers.

For me, programming the 68000 didn't feel much different from writing code in C.

However, the 68000 takes more clock cycles to execute its instructions. If we compare systems like the original Apple McIntosh vs the Apple II GS, or the Sega Genesis vs. the SNES, in both cases you have a roughly 8 Mhz 68000 versus a 2.8 or 3.58 Mhz 65816. The 65816 only has an 8-bit data bus but can execute instructions faster. Also, the original McIntosh used about 37% of its CPU time to drive the display.

The 68000 is superior, but the 65816 is competitive with it. It is like CISC vs. RISC.

Apple deliberately limited the speed of the Apple II GS because they didn't want it to compete with the more expensive McIntosh. The chip can go up to 14 Mhz. Some people stated that the Apple II GS was the computer that Apple should have made instead of the McIntosh. It was cheaper, ran a graphical user interface, and was backward compatible with the Apple II.

Tuesday, March 12, 2024

Do Hard Drives Vibrate?

I noticed that when I put my hand on my portable 5TB hard drive, it has a slight vibration.  I didn't notice this before, so I was worried about it.

Google's AI tells me the following...

A small amount of vibration is normal for spinning drives. When in use, a hard drive's platter spins at 7,200 RPM, and its actuators and heads move to read and write data. This movement can cause a slight vibration in the X-Y plane. A healthy drive also makes mild, regular sounds of whirring. 
Here are some other things to consider about hard drive vibrations:
  • Rattling noises
    In most cases, rattling noises are normal and are no reason to worry. They are caused by mechanical parts of the HDD and just indicate that the drive is reading, writing or calibrating itself.
  • Shock resistance
    At average HDD shock resistance is 50+ G while operating and 300+ G while non-operating.
  • Driving a desktop hard drive
    Some say that you should not drive or expose a desktop hard drive to vibrations when powered on


Saturday, February 24, 2024

Exciting decade for computer chips


In the 2010s computers advanced at a snail's pace. Sometimes people got excited when chips were 10% faster from one year to the next.

However, this decade has been dramatically different and it has everything to do with the circuit sizes on those chips. My 2009 iMac that died had a 42-nanometer chip. My 2017 iMac has a 14-nanometer chip. My new mini-computer has a 4-nanometer chip and it is very powerful for something not much bigger than a Whopper sandwich.

In late 2019 both Microsoft and Sony released their latest generation of video game consoles using 7-nanometer chips. Since these have APUs with the graphics "card" built into the main processor, I wanted something like this in a computer.  I waited almost 4 years to be able to get something similar in a mini-desktop PC.

These smaller circuits are not cheap to make The equipment to make them can cost billions. This is why Taiwan Semiconductor, which made the investment, is the number one manufacturer of these chips.

But it has resulted in a paradigm shift where people realize that they don't have to spend a fortune on graphics cards to play games. The APUs are not as good as a $1200 gaming PC, but they are good enough.

This also has resulted in hand-held gaming systems that are as powerful as a computer and can also be used as a computer when hooked up to a monitor, keyboard, and mouse.

Even the most recent iPhone can double as a gaming system.

Reportedly, Sony, Nintendo, and Microsoft are all coming out with more powerful gaming systems in the coming year. This has been an exciting decade for computer chips.

--
Best wishes,

John Coffey


Tuesday, February 20, 2024

Who The Hell Asked For A PS5 Pro?

https://www.youtube.com/watch?v=k--psgxdUJw

I've been saying the same thing.  I also bought a powerful mini-PC that can play games.  All of this change, including the consoles and the handhelds, has happened because of AMD's new powerful energy-efficient chips.  Intel has chips too, but they are not quite as good.

The PS5 and the XBox Series X consoles are 10.28 and 12 teraflop machines respectively.  That is still a great deal of performance and you would have to spend a lot on a PC to match that.

Apple is also starting to push gaming on the most expensive iPhones.

I have no faith in Cloud Gaming, but this may eventually be the future where you can run triple-A games on any device with a screen.

Saturday, February 17, 2024

Why Everyone is Wrong about the Apple Vision Pro (including me)



@john2001plus
0 seconds ago
I don't need to wear a heavy screen on my head when I have a house full of more screens than I actually use.  Two desktops and an iPhone are enough, but I also have a TV and a laptop that I rarely use, and two tablets I don't use.  I also have a handheld game system that doesn't get much use.

Thursday, February 8, 2024

USB-C Tutorial for Everybody

The bottom line is that when buying a USB-C cable, make sure that it supports the data speed that you want.  The same thing applies to power delivery for fast charging.

https://www.youtube.com/watch?v=qV03FfdPHOw&t=1308s

Friday, February 2, 2024

Using Apple Vision Pro: What It’s Actually Like!

I find this interesting. I can't imagine it being more than a novelty for now. For it to be anything more than a novelty, it is going to have to immerse you into another world.

Saturday, January 27, 2024

34 *AWESOME* Atari 2600 Homebrews! Episode 1!

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

It is hard to believe that these are games for the 2600, which only had 160 bytes of RAM.

A few 2600 games had extra RAM or other chips to give better graphics or sound. I suspect that the emulators can handle the extra hardware.

Thursday, January 11, 2024

WARNING: ChatGPT Could Be The Start Of The End! Sam Harris

Sam Harris spends 30 minutes talking about the dangers of AI.

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

He makes assumptions about the future. I think that he underestimates the difficulty of building a general AI.  

I think that ChatGPT is overhyped.  It is like a Wikipedia that can talk.  It has no understanding except to predict what words should follow other words based on statistical information.  This is why it gets so much wrong.  I asked it to write some computer code and the answer wasn't even remotely correct.  

We will inevitably develop general AI, but AI is a tool to solve specific problems.  We don't have to make an AI that matches human intelligence when it is more efficient to have problem-specific AI.  Calculators can do math far better than I can, and even the best 8-bit chess computers can outplay me at chess.  It would be like saying that when we developed mechanical locomotion, we needed to make a machine that functioned exactly like a horse.  We found better ways to do locomotion.

This means that AI will be solving problems long before we have a general AI, but more importantly, we will be treating it as a tool, just like any other tool.  For example, twenty years ago I was annoyed when Microsoft Word automatically corrected my spelling without asking me.  It felt like the machines were already becoming smarter than us.  Although that was a novel experience twenty years ago, we wouldn't think twice about it today.