cc65 mit TGI

Moderator: Rockford

Antworten
Benutzeravatar
bbock
Beiträge: 4
Registriert: 18.08.2021 18:37
Kontaktdaten:

cc65 mit TGI

Beitrag von bbock »

Hallo allerseits,

hat hier schon jemand versucht ein C-Programm mit dem cc65 Compiler mit der Grafikbibliothek TGI (tiny graphics interface) zum Laufen zu bringen? Meine Versuche endeten bisher immer in einem Absturz; ich verwende den Treiber atrx8.tgi.

Ich habe das Beispielprogramm "tgitest" etwas abgespeckt (s. Anhang).
tgitest2.zip
(31.5 KiB) 25-mal heruntergeladen


Nach dem Booten von DOS II V2.5 wähle ich L. BINARY LOAD und gebe TGITEST.COM ein.

Die Ausgaben sind wie folgt:
tgi driver to test? atrx8.tgi

Loading 'atrx8.tgi'
Driver loaded successfully

x resolution: 320
y resolution: 192
color count: 2
page count: 1
memory footprint: 1578

Press any key to continue

This test will plot random points on
the screen. You can stop the test by
pressing a key.

Press any key to continue
Now starting tgi_init()

Dann stürzt das Programm ab und es erfolgt ein Rücksprung ins DOS-Menü.

Irgendeine Idee, was das Problem sein könnte?

tschak909
Beiträge: 201
Registriert: 17.08.2021 00:22
Has thanked: 4 times
Been thanked: 142 times
Kontaktdaten:

Re: cc65 mit TGI

Beitrag von tschak909 »

If you want to see a full featured program which uses TGI for its graphics output:
https://github.com/tschak909/platoterm64

I used a cfg file that explicitly reserved memory for the graphics screen.

-Thom

Benutzeravatar
bbock
Beiträge: 4
Registriert: 18.08.2021 18:37
Kontaktdaten:

Re: cc65 mit TGI

Beitrag von bbock »

Hi Thom,

thank you for pointing me to your excellent Platoterm program, which you ported to multiple platforms. Most of the TGI related stuff seems to take place in screen.c. Regarding the cofiguration, I found the following line in your Makefile:

LDFLAGS.atari = --start-addr 0x2420 -Wl -D__RESERVED_MEMORY__=0x2000 -D__STACKSIZE__=0x200 --mapfile plato.map

So you explicitly change the start address, reserve some memory (for the high-res screen, I guess), and set the stack size. So far, so good.

Looking at the targets your Makefile supports, there is:

TARGETS := c64,c128,atari,apple2,apple2enh

If I am not mistaken, the atari target is for Atari 400 or 800, but I am trying to create a program for an Atari 800XL, so I should use the target atarixl. And that's where the trouble begins... I tried your settings with both targets, but I had no success. My test program crashes in tgi_init().

Benutzeravatar
cpg
Beiträge: 3
Registriert: 17.08.2021 12:06
Kontaktdaten:

Re: cc65 mit TGI

Beitrag von cpg »

The atari target is for _all_ Ataris. The atarixl target is for XL Ataris only and uses the RAM under the ROM to provide more main memory. So, unless you're low on memory you should use the atari target.

Please read the documentation: https://cc65.github.io/doc/atari.html

regards,
chris

Benutzeravatar
bbock
Beiträge: 4
Registriert: 18.08.2021 18:37
Kontaktdaten:

Re: cc65 mit TGI

Beitrag von bbock »

Thank you for the explanation. I just wanted to add that I succeeded to create a TGI enabled program using the following compiler options:

%cc65bin%\cl65 -t atari -Wl -D__RESERVED_MEMORY__=0x2000 -DDYN_DRV=0 -o %comfilename% %files%

My program will participate in the ABBUC Software Contest 2023.

Antworten

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast