Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Would you people stop playing these stupid games?!?!?!!!!


devel / comp.sys.apple2.programmer / cc65 / apple2 HGR2 linker configuration

SubjectAuthor
* cc65 / apple2 HGR2 linker configurationColin Leroy-Mira
`* Re: cc65 / apple2 HGR2 linker configurationOliver Schmidt
 `* Re: cc65 / apple2 HGR2 linker configurationColin Leroy-Mira
  `* Re: cc65 / apple2 HGR2 linker configurationColin Leroy-Mira
   `- Re: cc65 / apple2 HGR2 linker configurationOliver Schmidt

1
cc65 / apple2 HGR2 linker configuration

<20230728215344.0522a00e@laptop-sigfox>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=322&group=comp.sys.apple2.programmer#322

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: colin@colino.net (Colin Leroy-Mira)
Newsgroups: comp.sys.apple2.programmer
Subject: cc65 / apple2 HGR2 linker configuration
Date: Fri, 28 Jul 2023 21:53:44 +0200
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <20230728215344.0522a00e@laptop-sigfox>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="036e5f572f346ab23809a7bb533ee4fc";
logging-data="2447582"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RnFBBQ629bjgqVl1oH8VPMClyUwSg2ms="
Cancel-Lock: sha1:YMD3IYxQu7R0EUiDD8iHt2RZxeI=
X-Newsreader: Claws Mail 3.19.1git30 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Colin Leroy-Mira - Fri, 28 Jul 2023 19:53 UTC

Hi there,

I'm hoping Oliver will see this message :) I've worked a bit on a
linker configuration allowing my program to live from $803 to $3FFF and
use the HGR2 page. The program worked well using HGR1, but its code
can't live entirely between $803 and $1FFF, so it's much bigger than
needed on disk, having 8kB of zeroes on HGR1.

I've managed to make this linker config:
https://github.com/colinleroy/a2tools/blob/master/config/apple2enh-hgr2.cfg

It seems to work good and safe. I checked that the linker errors out if
I put too much code and it crosses the $4000 boundary; I've also
checked that malloc() does the right thing, not touching HGR
page 2 (it starts allocating at $6000 + BSS size + stack size).

I'd love a second opinion though :)

Thanks!
--
Colin
https://www.colino.net/

Re: cc65 / apple2 HGR2 linker configuration

<ua3arl$f695$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=323&group=comp.sys.apple2.programmer#323

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ol.sc@web.de (Oliver Schmidt)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: cc65 / apple2 HGR2 linker configuration
Date: Sat, 29 Jul 2023 15:22:28 GMT
Message-ID: <ua3arl$f695$1@solani.org>
References: <20230728215344.0522a00e@laptop-sigfox>
Injection-Date: Sat, 29 Jul 2023 15:22:29 -0000 (UTC)
Injection-Info: solani.org;
logging-data="497957"; mail-complaints-to="abuse@news.solani.org"
Cancel-Lock: sha1:qcjcjf2ZnKb78/FyPL8UUmdbyH0=
X-Newsreader: Forte Free Agent 1.21/32.243
X-User-ID: eJwNyEkBwDAIBEBLXAtEDoHgX0I7z4E6e4c53LBY4jfbqyx0TSNeSR/a+SNPtJROCRDofMiLDx62EPs=
 by: Oliver Schmidt - Sat, 29 Jul 2023 15:22 UTC

Hi Colin,

>I'm hoping Oliver will see this message :)

Here I am...

>I've managed to make this linker config:
>https://github.com/colinleroy/a2tools/blob/master/config/apple2enh-hgr2.cfg

The config looks absolutely sane to me.

>It seems to work good and safe. I checked that the linker errors out if
>I put too much code and it crosses the $4000 boundary; I've also
>checked that malloc() does the right thing, not touching HGR
>page 2 (it starts allocating at $6000 + BSS size + stack size).

The heap starts at $6000 + BSS size. The stack starts at HIMEM and
grows downwards towards the heap.

>I'd love a second opinion though :)

I don't see a problem. However, I'm wondering why you don't go the
from my perspective simpler way to load your program at $4000 and use
$803 to $2000 as additional heap.

That alternative doesn't require an own custom linker config. Just use
the '--start-addr $4000' cmdline parameter and add the heap as
described in https://cc65.github.io/doc/apple2.html#ss5.2

The HGR sample programs coming with cc65 doit this very way:
https://github.com/cc65/cc65/blob/master/samples/Makefile#L108-L112

Regards,
Oliver

Re: cc65 / apple2 HGR2 linker configuration

<20230730151316.1841f574@laptop-sigfox>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=324&group=comp.sys.apple2.programmer#324

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: colin@colino.net (Colin Leroy-Mira)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: cc65 / apple2 HGR2 linker configuration
Date: Sun, 30 Jul 2023 15:13:16 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <20230730151316.1841f574@laptop-sigfox>
References: <20230728215344.0522a00e@laptop-sigfox>
<ua3arl$f695$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="c4cea34a26c9c7f87d11aa56782bc661";
logging-data="2760079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nyuhF+VM7+fGc9YsroA/vu5vMseHcO14="
Cancel-Lock: sha1:Yu+eqd8gG+Q6xIlq3YEueE/vxcY=
X-Newsreader: Claws Mail 3.19.1git30 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Colin Leroy-Mira - Sun, 30 Jul 2023 13:13 UTC

Hi,

>The heap starts at $6000 + BSS size. The stack starts at HIMEM and
>grows downwards towards the heap.

Uh, right :) Had a little brainfart there.

>>I'd love a second opinion though :)
>
>
>I don't see a problem. However, I'm wondering why you don't go the
>from my perspective simpler way to load your program at $4000 and use
>$803 to $2000 as additional heap.

That's mostly because I didn't think of it! Thanks for the input.

--
Colin
https://www.colino.net/

Re: cc65 / apple2 HGR2 linker configuration

<20230730162430.5e1d6d82@laptop-sigfox>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=325&group=comp.sys.apple2.programmer#325

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: colin@colino.net (Colin Leroy-Mira)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: cc65 / apple2 HGR2 linker configuration
Date: Sun, 30 Jul 2023 16:24:30 +0200
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20230730162430.5e1d6d82@laptop-sigfox>
References: <20230728215344.0522a00e@laptop-sigfox>
<ua3arl$f695$1@solani.org>
<20230730151316.1841f574@laptop-sigfox>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="c4cea34a26c9c7f87d11aa56782bc661";
logging-data="2760079"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Y1VXks+1j1jAkrF69N9r+UpGM5ak+TzM="
Cancel-Lock: sha1:gpzUNMfMssE8ihWN5uLJCw2zlJ4=
X-Newsreader: Claws Mail 3.19.1git30 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Colin Leroy-Mira - Sun, 30 Jul 2023 14:24 UTC

Hi,

>>I don't see a problem. However, I'm wondering why you don't go the
>>from my perspective simpler way to load your program at $4000 and use
>>$803 to $2000 as additional heap.
>
>That's mostly because I didn't think of it! Thanks for the input.

Not only is it simpler, it's also cooler because I can still use
VIDEOMODE_80COL and/or MIXSET.

Thanks!
--
Colin
https://www.colino.net/

Re: cc65 / apple2 HGR2 linker configuration

<ua8sqt$pd8$1@solani.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=327&group=comp.sys.apple2.programmer#327

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ol.sc@web.de (Oliver Schmidt)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: cc65 / apple2 HGR2 linker configuration
Date: Mon, 31 Jul 2023 17:59:57 -0000 (UTC)
Message-ID: <ua8sqt$pd8$1@solani.org>
References: <20230728215344.0522a00e@laptop-sigfox>
<ua3arl$f695$1@solani.org>
<20230730151316.1841f574@laptop-sigfox>
<20230730162430.5e1d6d82@laptop-sigfox>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 31 Jul 2023 17:59:57 -0000 (UTC)
Injection-Info: solani.org;
logging-data="26024"; mail-complaints-to="abuse@news.solani.org"
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:dCZIyBkRifLqk+x2vg3se8Z55Fc= sha1:yaxv6tJDRd4WwwjdfOTfgkk93mA=
X-User-ID: eJwFwYEBwCAIA7CXBFpk57Aq/59gwkhLbSQTHE4XzM+UvhvgUoaJAMN/3dWyULju8YJvNh4UnBC8
 by: Oliver Schmidt - Mon, 31 Jul 2023 17:59 UTC

Hi Colin,

> [...]
> Thanks!

You're welcome! Thanks for the kind feedback :-)

Regards,
Oliver

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor