tursilion / libti99

GCC Library for the TI-99/4A
29 stars 10 forks source link

cputc won't let me put a character in the last column of the screen. #4

Closed jedimatt42 closed 6 years ago

jedimatt42 commented 7 years ago

https://github.com/tursilion/libti99/blob/5900e89352e327f526bbfa5796b2f842c2c529c3/conio_cputc.c#L20

I think changing the <= to < fixes it here.

with ipaddress a string equal to "???.???.???.???", a 15 character string, the following code ends up wrapping the last ? to the next line. But I can clearly see the chline(40) can place a '-' in column 39.

The example code:

  set_text();
  ...
  gotoxy(25,1);
  cputs(ipaddress);
  gotoxy(0,2);
  chline(40);
jedimatt42 commented 6 years ago

Ok, I don't know what I did... but this is currently not a real issue..

I added this code to testlib.c so I could see what I thought I expected, which was early wrapping of the characters in the string.

   clrscr();
   gotoxy(0,2);
   cputs("Expected");
   gotoxy(0,0);
   chline(40);
   gotoxy(0,1);
   cputs("<");
   gotoxy(39,1);
   cputs(">");
   gotoxy(0,3);
   cgetc();

But there is no evidence of that, with or without my suggested change to the cputc wrapping condition.

-M@