C# 6 Language Features

by Payton Byrd 12. September 2014 07:55

Here's a PDF document explaining the awesomeness of the new features in C# 6.0.  

ctp3-csharp-features.pdf (467.05 kb) 

My favorite changes are the following:

1.2 Getter-only auto-properties

Auto-properties can now be declared without a setter. 

public class Customer


 public string First { get; } = "Jane";

 public string Last { get; } = "Doe";



9 Null-conditional operators

Sometimes code tends to drown a bit in null-checking. The null-conditional operator lets you access 

members and elements only when the receiver is not-null, providing a null result otherwise:

int? length = customers?.Length; // null if customers is null

Customer first = customers?[0]; // null if customers is null

The null-conditional operator is conveniently used together with the null coalescing operator jQuery15208349821912124753_1410526640956:

int length = customers?.Length ?? 0; // 0 if customers is null

The null-conditional operator exhibits short-circuiting behavior, where an immediately following chain 

of member accesses, element accesses and invocations will only be executed if the original receiver was 

not null:

int? first = customers?[0].Orders.Count();This example is essentially equivalent to:

int? first = (customers != null) ? customers[0].Orders.Count() : null;

Except that customers is only evaluated once. None of the member accesses, element accesses and 

invocations immediately following the ? are executed unless customers has a non-null value.



KipperDialer - Simple BASIC Terminal for RR-Net based NICs.

by Payton Byrd 18. July 2014 12:11

A few years ago I created a simple term program using KipperBasic.  I'm posting it for posterity.  It's not a perfect terminal, some control characters don't get processed for some odd reason, but it works well enough.

kipper_dialer.D64 (170.75 kb)

Tags: ,


Bitcoin Mining

by Payton Byrd 16. May 2014 17:59

Well, I've been testing the waters with bitcoin mining with a small farm of Jalapeno miners.  I'm up to 62GH/s of capacity, and it's earning about $40 per month at current prices and difficulty.  Problem is, they probably will take about a year to pay for themselves at this rate.  So, I've made the decision to go solo and try to solve a chain on my own.  The payday would be huge, about $10,000 at current Bitcoin exchange rates.  However the odds are definitely against me actually solving a chain on my own, so it's more akin to gambling on the lottery, but since the equipment is already paid for I might as well give it a shot.


Commodore Screen Codes in ca65

by Payton Byrd 13. May 2014 16:07

In cc65's assembler, ca65, you can remap ASCII codes to any value you want using the .charmap function. This gives you the ability to do things like map ASCII -> ATASCII, ASCII -> PETSCII, ASCII -> CBM Screen codes.  Below is an example of using this feature to map all of the PETSCII characters to CBM Screen codes.  Place this in an include file and then include it in your ca65 sources, or put it right in the source file.  This allows you to use the .asciiz directive to define strings that are written to the screen using screen codes.

; Remaps PETSCII to Screen Codes
.repeat $20, i
	.charmap $40 + i, $40 + i + $00

.repeat $20, i
	.charmap $60 + i, $60 + i - $60

.repeat $20, i
	.charmap $80 + i, $80 + i + $40

.repeat $20, i
	.charmap $A0 + i, $A0 + i - $40

.repeat $3F, i
	.charmap $C0 + i, $C0 + i - $80

.charmap $FF, $5E

A neat side-effect of doing this is that it becomes easy to map characters to colors for the VIC 2.  Here's a chart for converting a screen code to a color:

; Colors
; @ - Black
; A - White
; B - Red
; C - Cyan
; D - Purple
; E - Green
; F - Blue
; G - Yellow
; H - Orange
; I - Brown
; J - Light Red
; K - Dark Gray
; L - Medium Gray
; M - Light Green
; N - Light Blue
; O - Light Gray

Now, to use these colors you can write an ascii string as such:



Tags: ,

Commodore | Programming

CC65 Visual Studio 2012 Project Template

by Payton Byrd 10. May 2014 13:59

I've created a project template for Visual Studio 2012 for creating CC65 applications.  The template comes with Oliver Schmidt's universal makefile and a simple Hello, World source file in C.

Read this page.


Commodore | Programming

Heartbleed: Told You So

by Payton Byrd 15. April 2014 18:54

I wrote this five years ago.  I was scorned.  Look who's laughing now (the CTO with an all-Microsoft stack).



Arduino Galileo

by Payton Byrd 10. January 2014 07:05

I just purchased an Arduino Galileo yesterday.  I plan on porting Hayesduino to it as soon as Visual Micro gets updated to support the Galileo the extra RAM and CPU should allow me to add a lot of features, plus the Galileo has a real time clock!



Arduino | Hayesduino

BridgeBBS: Open Source At Last

by Payton Byrd 27. December 2013 17:43

It's that time!  I've released BridgeBBS to the world via open source on CodePlex.  It's still very much a work in progress, but I have a volunteer who wants to work on the project so I decided to go ahead and get everything set up on CodePlex.  

Go check it out today:  http://bridgebbs.codeplex.com

On another note, I've started my version of Empire for BridgeBBS.  It's a bit more sophisticated than the original BASIC version, but I think people will enjoy the changes.  Here's some highlights:

  • Collect wood, stone and food
  • Earn gold from Markets, Foundries, Brothels and Banks
  • Build Markets, Foundries, Brothels, Banks and castle upgrades with wood and stone
  • Buy infantry, archers, catapults, knights and barons with gold
  • Peasants are allocated to each building, so make sure you have enough peasants before buying that new building!
  • Round-based combat.  
  • Combat modifiers for castle upgrades, number of barons on the battlefield, etc.
  • Fire may burn up food and wood stores, but you won't lose land!
  • Revolution only in extremely bad economic conditions
  • Global economy affects individual empires.  Global food shortages?  Get more gold for selling extra food!  Too much food?  Food prices are lower.
I'm also looking for any input you might as well!


BridgeBBS | Commodore | Programming

Cool Arduino Idea

by Payton Byrd 22. December 2013 17:42

I just had an idea for an arduino based add on to the Commodore 64.

It would do a couple of things:

1) Reset the C64 on receiving an authenticated command over the internet

2) stream the C64 composite video over the internet

3) interface with the keyboard to allow a remote user to enter keys directly to the c64.

This way I could reboot the BBS from afar.  The reset and keyboard stuff is gravy.  I wonder what kind of video capture shields are available for Arduino....


Arduino | Commodore

BridgeBBS: It's Alive!

by Payton Byrd 20. December 2013 23:54

A couple of big developments on the BridgeBBS front.  First, the message system is functional and stable.  A few features need to be buttoned up, and a proper editor written (the current one does not do word wrap).  

Second, and more exciting, is that BridgeBBS has made it's first step towards multi-platform as it now runs on the C128!  Since the 128 has less RAM available to CC65 programs, I'll be using it as my dev target so I make sure all of the overlays fit as expected when porting to other systems.

Whew, never thought I'd get this far!


Go there now!  bbs.paytonbyrd.com  port 23


BridgeBBS | Commodore | Programming

About the author

Payton is married to Rebecca Lynne Byrd and has three wonderful children, Mary, Robert and JT.  Payton is a professional software developer and currently works as contractor for Link Systems in Nashville, TN and Tool Planners Inc in Hendersonville, TN.  Payton also is an active member of the Commodore 64 scene having recently created and released demos and original music.  Payton is the creator of CBM-Command, which is an Orthodox File Manager for the Commodore 8-bit line of computers.

Most Prolific Commentors

mhoney mhoney
us United States
Mike Mike
au Australia
Alan Reed Alan Reed
us United States

Month List


Comment RSS