UART support

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: UART support

Post by danboid »

Artcfox:

Great! I can confirm your cuzebox Linux whisper console patch works. I can now print stuff to the cuzebox console! This will be a huge help in making progress with my long stalled Combat (tanks) remake.

Will you submit this as a PR to the cuzebox repo or do you want me to do it? It may not be worthwhile if Jubatian isn't around to merge it. The same applies to the main UB repo. I hope he's OK!

https://github.com/Jubatian/cuzebox/issues/6
User avatar
danboid
Posts: 1937
Joined: Sun Jun 14, 2020 12:14 am

Re: UART support

Post by danboid »

I've added these simple debug functions to IKD:

Code: Select all

void cuzeboxCOut(char str[]);
void cuzeboxHOut(int num);

// cuzeboxCOut() is used to print debug strings to the cuzebox console.
void cuzeboxCOut(char str[]) {
  for (int i = 0; str[i] != '\0'; i++) {
        _SFR_IO8(0X1a)=str[i];
  }
  _SFR_IO8(0X1a)='\n'; // Add newline after last character
}

// cuzeboxHOut() is used to print a hex value to the cuzebox console.
// eg cuzeboxHOut(GetTile(2,8));
void cuzeboxHOut(int num) {
  _SFR_IO8(25)=num;
  _SFR_IO8(0X1a)='\n'; // Add newline
}
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: UART support

Post by Artcfox »

A while back I had asked Jubatian if he wanted to add whisper console support to cuzebox, but I don't think he wanted to, but you have it working, so that's great!
Post Reply