Sub-Etha Software
Blogs

C: (too) many happy returns…

July 21, 2021 Sub-Etha Software

Here’s another quick C thing… One of the jobs I had used a pretty complete coding style guide for C. One of the things they insisted on was only one “return” in any function that returns values. For example: int function(int x) { if (x == 1) { return 100; …

Sub-Etha Software
Blogs

char versus C versus C#

July 15, 2021 Sub-Etha Software

I am mostly a simple C programmer, but I do touch a bit of C# at my day job. If you don’t think about what is going on behind the scenes, languages like Java and C# are quite fun to work with. For instance, if I was pulling bytes out …

Sub-Etha Software
Blogs

Researching 8-bit floating point.

July 1, 2021 Sub-Etha Software

Recently, I ran in to a situation where a floating point value (represent current) was being converted to a byte value before being sent off in a status message. Thus, any calculations on the other side were being done with whole values (1, 2, 42, etc.). I was asked if …

Sub-Etha Software
Blogs

C, printf, and pointers.

April 27, 2021 Sub-Etha Software

I learned a new C thing today. But first, an old C thing. When you write “standard C” and want to print a value using printf, you are at the mercy of standard C data types. For example, “%d” is a “Signed decimal integer” and “%u” is an “Unsigned decimal …

Sub-Etha Software
Blogs

Raspberry Pi Pico?

January 21, 2021 Sub-Etha Software

For those who find the unwieldy huge size of the Raspberry Pi Zero off-putting, the Raspberry Pi Foundation has now released a Raspberry Pi Pico. It uses a custom chip, the RP2040, and seems to be more of an Arduino than a Pi. It has 264KB of memory and can …

Sub-Etha Software
Blogs

Benchmarking the CoCo keyboard – part 7

January 18, 2021 Sub-Etha Software

See also: part 1, part 2, part 3, part 4, part 5, part 6, part 7 and more (coming “soon”). NOTE: This one is gonna jump around a bit, referring to examples in the previous installment, so hang tight… Some comments from the previous installment, where I shared some code …

Blogs

Exploring Atari VCS/2600 Adventure – part 4

January 13, 2021 Sub-Etha Software

See also: part 1, part 2, part 3, part 4 … and more to come… Objectively speaking Welcome back to the world of Atari Adventure! After spending some time figuring out how the rooms were drawn, it’s time to look at how the game objects are drawn. Adventure contains many …

Sub-Etha Software
Blogs

Benchmarking the CoCo keyboard – part 6

January 11, 2021 Sub-Etha Software

See also: part 1, part 2, part 3, part 4 and part 5 (coming “soon”). Let’s jump right in with a mystery… This code: 0 REM arrowbench.bas 10 TIMER=0:FOR A=1 TO 1000 20 POKE&H155,&HFF:POKE&H156,&HFF:POKE&H157,&HFF:POKE&H158,&HFF 30 IF PEEK(&H155)=&HF7 THEN IF Y >. THEN Y=Y-1 40 IF PEEK(&H156)=&HF7 THEN IF Y. THEN X=X-1 60 IF PEEK(&H158)=&HF7 THEN IF X.THEN Y=Y-1 40 IF PEEK(D)=V THEN IF Y.THEN X=X-1 60 IF PEEK(R)=V THEN IF X …