Giter Site home page Giter Site logo

libti99's Introduction

(n/a)

This library is released by Tursi aka Mike Brent for TI-99/4A coding via GCC. It is released to the public domain with no restrictions (but credit would be nice if you use it). Likewise, I make no guarantees or promises!

Documentation is found in each of the .h files. The .h files are briefly described here:

  • grom.h - helper definitions and functions for accessing GROM
  • kscan.h - include file for using the console's kscan code (including joysticks)
  • player.h - include file for using my compressed VGM audio player
  • sound.h - helper definitions for the sound chip and console sound interrupt player
  • vdp.h - helper definitions and functions for the VDP and console interrupt
  • puff.h - deflate implementation - from the zlib library and created by Mark Adler - [email protected]
  • conio.h - console functions (including cprintf) for basic screen I/O
  • files.h - dsrlnk and related functions and constants for native TI device IO.
  • math.h - numeric functions (sqrt, abs)
  • string.h - string manipulation and conversion functions
  • system.h - halt and exit functions

Note that the current version of puff has all error handling disabled, it just calls halt(). So test your streams before using it!

The GCC patches and build instructions (not related to this lib) are here: http://atariage.com/forums/topic/164295-gcc-for-the-ti/page__st__125

libti99's People

Contributors

fabrizio-caruso avatar jedimatt42 avatar msplett avatar peberlein avatar polluks avatar tschak909 avatar tursilion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libti99's Issues

[question] Multiple definition problem and broken binary (most probably a bug in my code)

Hi,
first of all sorry if I am using the Issues section to ask a question that may not be a bug.
I am trying to use your lib to get my game to compile.
I am getting several "multiple definition" errors that I can silence with -allow-multiple-definition

Is this expected when using your package on multiple files? Am I doing something wrong?

I am using this Makefile: https://github.com/Fabrizio-Caruso/CROSS-LIB/blob/master/src/makefiles.chase/targets/Makefile.gcc_tms9900_targets (which uses the option -allow-multiple-definition to get a successful compilation)

I get a .cart and a .elf file. If I attach the .cart file into classic99, I can start it but I get a repeating high-pitched sound instead of a hello world message as I expect in my code:

#include "system.h"
#include <conio.h>
void INIT_GRAPHICS(void) {
    set_text();
    charsetlc();
    textcolor(COLOR_WHITE);
    bgcolor(COLOR_DKBLUE);
    gotoxy(2,2);
    cprintf("Hello world\n");
    while(1){};
}

The .cart and .elf files are in the attachment
ti99_cross_chase.zip

conio crashes when line wrap occurs

I broke things good didn't I :)

Your fixes to use a mode state is way better than the address based guesswork going on that I propagated.. But there is still at least a problem with scrolling from putc.

I'll try to fix it this week/weekend...

[bug?] gotoxy macro may produce impredictable results

In https://github.com/tursilion/libti99/blob/main/conio.h#L77
I see a macro with two commands with no do{...}while(0) to protect it from being misinterpreted.
This might explain why I get totally wrong results when I use it to display text.

For example

if(...)
   gotoxy(x,y)

is wrongly interpreted as

if(...)
{
    conio_x = (x); 
}
conio_y = (y)

And you need do, while(0) and not just braces, because it would fail with a syntax error in cases such as

if(...)
    gotoxy(x,y);
else
    ...

So a solution would be to do:

#define gotoxy(x,y) \
do \
{ \
    conio_x = (x); \
    conio_y = (y); \
} while(0)

In general I would do this on all macros, even the ones with one single command to be safe just in case I replace that command with a macro one day.

Just a typo

#define DST_STATUS_EOF 0x01 // else not at end of file

I don't think you meant for this to be DST_STATUS_EOF instead of DSR_STATUS_EOF

dsrlnkraw doesn't detect when no matching DSR was found

Calling dsrlnk with PAB with name set to some non-DSR valid value, such as "abc" doesn't indicate an error occurred or that the DSR call was not serviced. Seems line #62 is the key, where no error is actually set.

This can be worked around this by first capturing all the DSR names and then ensuring those passed to dsrlnk/dsrlnkraw match.

dsr_dsrlnkraw.c:49: error: impossible constraint in ‘asm’

Just FYI, I've getting a build error in dsr_dsrlnkraw.c with tms9900-gcc that I haven't noticed before :

dsr_dsrlnkraw.c: In function ‘dsrlnkraw’:
dsr_dsrlnkraw.c:49: warning: asm operand 1 probably doesn’t match constraints
dsr_dsrlnkraw.c:49: error: impossible constraint in ‘asm’

It seems it doesn't like the "immediate" constraint for buf on line 106 as buf isn't a constant?

   : "i" (buf)

My fix was

#define NAME_BUF 0x8380
: "i" (NAME_BUF)

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

if (conio_x >= nTextEnd-nTextRow) {

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);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.