Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #6311 > unrolled thread

An Attempt at CC65

Started byTRS-90 <matthewmpower@gmail.com>
First post2024-06-30 01:01 +0000
Last post2024-06-30 09:52 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  An Attempt at CC65 TRS-90 <matthewmpower@gmail.com> - 2024-06-30 01:01 +0000
    Re: An Attempt at CC65 TRS-90 <matthewmpower@gmail.com> - 2024-06-30 01:14 +0000
    Re: An Attempt at CC65 Oliver Schmidt <ol.sc@web.de> - 2024-06-30 09:52 +0000

#6311 — An Attempt at CC65

FromTRS-90 <matthewmpower@gmail.com>
Date2024-06-30 01:01 +0000
SubjectAn Attempt at CC65
Message-ID<BSjnEMbtGSbpHPcpEKbl%matthewmpower@gmail.com>
So I imagine I'm so far in the wrong direction
that I may earn a laugh, but that's ok!

I'm trying to recreate this Applesoft line in 
C with CC65:

GR : PRINT "GR SET"

So I realized that there does not seem to be a 
GR command in CC65 and after digging around in 
a disassembly listing I now have (again in BASIC):

CALL -1216 : PRINT "GR SET" REM $FB40

So an least I'm calling the sub without the Applesoft command. Works good.

Here's my C attempt. It freezes the system and never gets to the print command:
------------------------------
/* cl65 -O -t apple2enh setgr.c */
# include <stdio.h>

void gr() {
     asm ("jsr FB40");
}

int main() {
     gr();
     printf("GR SET\n");
     return 0;
}
-------------------------------

I guess I thought I could just switch languages,
compile, and run. I thought I could rewrite some
of my silly BASIC programs in C and gain some speed
and then I realized it may not be that simple. I've
seen the TGI drivers. Is that how to get into GR and
HGR and such?

Thanks all!

TRS-90
 

[toc] | [next] | [standalone]


#6312

FromTRS-90 <matthewmpower@gmail.com>
Date2024-06-30 01:14 +0000
Message-ID<BReoAQbsGLekCQgoIMan%matthewmpower@gmail.com>
In reply to#6311
>      asm ("jsr FB40");

Should be "jsr $FB40". I just typo'd
when posting this.

[toc] | [prev] | [next] | [standalone]


#6313

FromOliver Schmidt <ol.sc@web.de>
Date2024-06-30 09:52 +0000
Message-ID<v5r9s2$3uo$1@solani.org>
In reply to#6311
Hi,

> I guess I thought I could just switch languages,
> compile, and run. I thought I could rewrite some
> of my silly BASIC programs in C and gain some speed
> and then I realized it may not be that simple. I've
> seen the TGI drivers. Is that how to get into GR and
> HGR and such?

Yes, the goal of the cc65 library is NOT to make C programs look as similar
to BASIC programs as possible.

Yes, TGI is the cc65 way to do graphics.

No, You can't just JSR to a ROM routine. The ROM is banked out. Use _sys()
instead. See https://cc65.github.io/doc/funcref.html#ss3.15

Regards,
Oliver


[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.apple2.programmer


csiph-web