Author Topic: C++17 for 6502  (Read 306 times)

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
C++17 for 6502
« on: November 03, 2016, 08:10:58 AM »
So, this video popped up:
.
He writes C++17 code to write a C64 game. The point of the video was showing how advance code could be written with zero overhead, and used a limited processor environment like the 6502 to demonstrate this. To get 6502 instruction output, he just translates the x86 (set to 386 IIRC) to 65x. But the overall idea is kind of interesting.

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: C++17 for 6502
« Reply #1 on: November 04, 2016, 05:26:30 AM »
So, this video popped up:
.
He writes C++17 code to write a C64 game. The point of the video was showing how advance code could be written with zero overhead, and used a limited processor environment like the 6502 to demonstrate this. To get 6502 instruction output, he just translates the x86 (set to 386 IIRC) to 65x. But the overall idea is kind of interesting.

I've got to say that the idea of just translating from another processor certainly could have its merits.

It might well end up with considerably faster code than HuC if the other processor wasn't some complex modern 32-bit behemoth.

I probably *should* watch through the whole thing, but my eyes glazed-over when he started to get into the arcane syntax of all these newer C++ features that have been added to help remove the code-bloat.

It's all got to the point where you're supposed to gyrate your code around into something that only the original author can read in order to push the compiler into being as clever as the programmer thinks that he's being.

If code isn't clear and readable, then IMHO, it's not maintainable.

Many years ago it was said that C++ had become so complex and arcane that most programmers only used 20% of its capabilities. The big problem being that they all used a different 20%!

Since then, C++ has only added on more and more "clever" features.

It's no wonder that the F35 fighter can't fly half the time!