Giter VIP home page Giter VIP logo

Comments (11)

EtchedPixels avatar EtchedPixels commented on July 17, 2024

I did play with the ti99/4a gcc initially but it was incredibly buggy.

I got a bit stuck with cc68 and tms9995 because it's got a lot of registers and despite my best efforts to make use of them the cc65 core doesn't really know how to do it. Instead see

https://github.com/EtchedPixels/pcc-tms9995-support

I have this building and running a few things. There is a bug in vararg handling (promotion of char to int for unprototyped parameters) at the moment but otherwise it seems to be doing reasonably okay on char, integer and some long.

For the 9900 I believe the only difference would be that you don't have DIVS so would need instead to use a small helper to switch the signs as needed and use DIV.

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

Cool! I am looking forward to seeing TMS9900 and TI99/4A if you ever implement it.
I think TMS9900 is indeed so close to require a minor adaptation.
Support for TI99/4A would just be a matter of using a crt, plugging in an implementation for getchar and putchar and generating a cartridge (or tape) image.
Indeed GCC for TI is not reliable and moreover it is not easy to build as it has many dependencies and it won't build out of the box on all POSIX environments. I would be more than happy to ditch it and use your compiler.

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

By the way, if you ever produce a TMS9900 compiler if possible with minimal support for the TI99/4A, I will test it extensively and maybe spot some bugs and give you some hopefully useful feed-back.

from cc6303.

EtchedPixels avatar EtchedPixels commented on July 17, 2024

All the hooks are now there, would need someone who knows about the 99/4a to write the crt0, set the memory map up etc

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

Great! Thanks!
I am no expert but I may have all or most of what we need here.
Have you taken a look at the links I have provided above?
They include a working crt (which I have used successfully with the modded GCC):
https://github.com/Fabrizio-Caruso/CROSS-LIB/tree/master/tools/ti99

My (very messy sorry) Makefile uses some of the tools that generate a rom image and may do most of what is left to be done:
https://github.com/Fabrizio-Caruso/CROSS-LIB/blob/master/src/games/chase/makefiles.chase/Makefile.gcc_tms9900_targets

The other links above also point to code to do some trivial input output with the VDP.

from cc6303.

EtchedPixels avatar EtchedPixels commented on July 17, 2024

Probably but without knowing how things are loaded, what the memory layout is etc not a lot.

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

Most homebrew developers build cartridge images for the TI99/4A. Cassettes are possible but not common now.

If I remember well, the cartridges do not provide a contiguous directly addressable unique block of memory. They provide several 8k banks of memory. So running from the cartridge would require bank-switching (which is close to impossible code to generate for a C compiler).
So most games and tools assume you have a 32k RAM expansion and the code is "automatically" decompressed into it.
The tools I use (see my links) should create cartridge images that will "explode" into the expanded RAM and run from RAM. This is already taken care of by the tools. No need to code this.
Anyway most people assume a 32k real RAM is present. It is common to have both a cartridge and a 32k expansion. The modern memory expansion uses a "sidecar expansion".
This is the most common "target" now for homebrews of the 21st century: 32k memory expansion with a cartridge.

For super small binaries with no bank switching, the code could reside on the cartridge and run from the cartridge. This should be limited to 8k of code + 256 of internal RAM (or +32k if a memory expansion is present).

In the old days (and maybe sometimes even now), the video RAM was also used to store data (and/or even code) but we can avoid this painful process.

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

I am looking at:
https://www.unige.ch/medecine/nouspikel/ti99/architec.htm

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

I am not sure but it looks like GCC generates a raw ELF binary (relocatable binary?), which is converted to something a TI99/4A could run by Elf2Ea5 (which may also do a relocation it but I am no sure).
In order to store it onto a self-exploding cartridge image, this has to be (internally) "split" into 8k blocks with EA5SPLIT.
This tool also takes care of prepending the code that reads all the blocks and moves the code onto RAM and starts it.

I am looking at:
https://github.com/jedimatt42/fcmd/wiki/tms9900gcc-Ubuntu-Installation-Guide

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

@EtchedPixels I am not sure 100% of all that what I have written. I am trying to use those tools with the binary produced by GCC to see how to use them. Last time I used GCC for TI to do something for the TI was a couple of years.

from cc6303.

Fabrizio-Caruso avatar Fabrizio-Caruso commented on July 17, 2024

Maybe some useful information before we even starting considering real cartrdige/images.
Classic99 emulator (http://www.harmlesslion.com/cgi-bin/onesoft.cgi?1) can read EA5 files (elf2ea5 should convert elf to ea5) with the following procedure:

  • Have one of the disks, e.g DSK1., point to the directory that contains the EA5 file: DSK1-> Set DSK1 -> Disk Type: FIAD
  • Go to Cartridge->Apps->Editor/Assembler
  • Press 2 to enter the Editor/Assembler
  • Press 5 to run a file
  • Enter DSK1.<file name>

from cc6303.

Related Issues (13)

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.