Project announcement: libcmini

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Project announcement: libcmini

Postby mfro » Wed Jun 26, 2013 6:29 am

Hi all,

just wanted to let you know that I created a new project on AtariForge.

announcement: libcmini, a tiny and simple libc for TOS/MiNT and gcc.

Mintlib, the standard C library for TOS/MiNT is feature-rich, (nearly) standards-conformant and ideal for porting Unix/Linux software to the Atari platform.

It however has a serious drawback for small GEM-based utilities (that just need an occasional fread() and sprintf() now and then): being standards-conformant, it creates huge (not to say bloated) programs and has created the popular belief that the GNU cross compiler toolchain would be unusable for creating low-footprint binaries.

In fact, it's not the toolchain's fault (gcc is perfectly suited to create compact code) - it's the mintlib that causes binaries getting so huge.

libcmini is meant to fill this gap: provide a libc that's well suited to create low-footprint binaries with a feature set comparable to what Pure-C had.

The library is currently far from finished (e.g. stdio unbuffered, directly calling GEMDOS functions, command line handling and lots of functions missing, many functions still stupidly implemented), but what's there is already quite usable and shows that the approach is sound:

a simple "Hello World":

Code: Select all

#include <stdio.h>

int main(int argc, char *argv[])
{
   printf("hello world\n");
}

compiled to HELLO.APP (m68000, -Os, stripped):

mintlib: 118225 bytes
libcmini: 2281 bytes

Libcmini already fully supports gcc's multilib feature (Makefile provided that generates the library for all supported flavours of m68k targets) and comes with a "near real world" GEM-based example program skeleton including a Makefile that shows how to make use of it (plain m68000, m68020-60 and m5475 as well as their -mshort equivalent targets available), ready to use. One strong hope is that this will contribute to the availability of more native Coldfire applications.

Program size saving is still significant with more complex programs (medium complex GEM app fits in less than 15k, mintlib equivalent about 10 times larger).

Libcmini is available at http://www.atariforge.org/gf/project/libcmini.

Interested parties are kindly invited to participate in the project, the library is free to use for anybody who can make use of it (LGPL license although the required "legalese" is still missing from the sources).

Constructive feedback is desired and since there is still a whole lot to do, individual participation is more than welcome.

Regards,
Markus
Last edited by mfro on Wed Jun 26, 2013 9:15 am, edited 1 time in total.

User avatar
shoggoth
Nature
Nature
Posts: 854
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Project announcement: libcmini

Postby shoggoth » Wed Jun 26, 2013 7:30 am

Great idea :) I always re-invent the wheel for this stuff; I compile sans standard library, and use some standalone printf implementation, re-implement strlen/strcpy/strcat etc each time. I'd rather have the real deal as a proper library, all this sounds lovely to me.
Ain't no space like PeP-space.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4858
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Project announcement: libcmini

Postby simonsunnyboy » Wed Jun 26, 2013 3:31 pm

Great idea! This is needed and helpful and might help others to get into GCC on Atari. I will have a try someday.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4858
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Project announcement: libcmini

Postby simonsunnyboy » Sat Jun 29, 2013 9:03 am

I id a checkout of the current trunk and tried to compile. Atm I get errors:

Code: Select all

[11:01:06] marndt@jll: ~/src/libcmini/libcmini
$ make
rm depend
rm: Entfernen von „depend“ nicht möglich: Datei oder Verzeichnis nicht gefunden
make: [depend] Fehler 1 (ignoriert)
for objdir in ./objs ./m68020-60/objs ./m5475/objs ./mshort/objs ./m68020-60/mshort/objs ./m5475/mshort/objs; \
   do m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -M  sources/sprintf.c sources/snprintf.c sources/printf.c sources/fprintf.c sources/vfprintf.c sources/doprnt.c sources/fputc.c sources/putc.c sources/fputs.c sources/puts.c sources/setvbuf.c sources/fflush.c sources/strcmp.c sources/strncmp.c sources/strnicmp.c sources/strcpy.c sources/strncpy.c sources/atoi.c sources/strlen.c sources/strcat.c sources/strncat.c sources/strchr.c sources/strrchr.c sources/strdup.c sources/strndup.c sources/strrev.c sources/bcopy.c sources/memcpy.c sources/memset.c sources/bzero.c sources/toupper.c sources/fopen.c sources/fgetc.c sources/fclose.c sources/fwrite.c sources/stat.c sources/malloc.c sources/calloc.c sources/realloc.c sources/free.c sources/exit.c sources/abort.c sources/ltoa.c sources/main.c | sed "s#^\(.*\).o:#$objdir/\1.o:#" >> depend; \
   done
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/sprintf.c -o objs/sprintf.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/snprintf.c -o objs/snprintf.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/printf.c -o objs/printf.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/fprintf.c -o objs/fprintf.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/vfprintf.c -o objs/vfprintf.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/doprnt.c -o objs/doprnt.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/fputc.c -o objs/fputc.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/putc.c -o objs/putc.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/fputs.c -o objs/fputs.o
m68k-atari-mint-gcc -Wall -Wno-multichar -Os -g -fomit-frame-pointer -fno-strict-aliasing -Iinclude -c sources/puts.c -o objs/puts.o
In file included from include/stdio.h:11:0,
                 from sources/puts.c:20:
include/stdlib.h:11:23: error: redefinition of typedef 'size_t'
include/stddef.h:11:23: note: previous declaration of 'size_t' was here
make: *** [objs/puts.o] Fehler 1


my 68k gcc is:

Code: Select all

[11:01:20] marndt@jll: ~/src/libcmini/libcmini
$ m68k-atari-mint-gcc --version
m68k-atari-mint-gcc (GCC) 4.5.0 (MiNT 20100511)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Sun Jun 30, 2013 5:54 pm

You probably picked up an interim version, it's still WIP. Did you try to update to a more recent version from the svn repository?

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4858
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Project announcement: libcmini

Postby simonsunnyboy » Mon Jul 01, 2013 3:46 pm

mfro wrote:You probably picked up an interim version, it's still WIP. Did you try to update to a more recent version from the svn repository?


I can't tell, I updated now and I still get redefinition probelms with size_t.

Code: Select all

$ make
m68k-atari-mint-gcc -Wall -Os -fomit-frame-pointer -Iinclude -c sources/puts.c -o objs/puts.o
In file included from include/stdio.h:11:0,
                 from sources/puts.c:20:
include/stdlib.h:11:23: error: redefinition of typedef 'size_t'
include/stddef.h:11:23: note: previous declaration of 'size_t' was here
make: *** [objs/puts.o] Fehler 1
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Mon Jul 01, 2013 7:09 pm

simonsunnyboy wrote:
mfro wrote:You probably picked up an interim version, it's still WIP. Did you try to update to a more recent version from the svn repository?


I can't tell, I updated now and I still get redefinition probelms with size_t.

Code: Select all

$ make
m68k-atari-mint-gcc -Wall -Os -fomit-frame-pointer -Iinclude -c sources/puts.c -o objs/puts.o
In file included from include/stdio.h:11:0,
                 from sources/puts.c:20:
include/stdlib.h:11:23: error: redefinition of typedef 'size_t'
include/stddef.h:11:23: note: previous declaration of 'size_t' was here
make: *** [objs/puts.o] Fehler 1


Looked deeper into that problem. The difference is caused by this http://gcc.gnu.org/git/?p=gcc.git;a=com ... 07591d6412 change that was introduced in gcc 4.6. The newer version allows overrides of typedefs if the new base type is the same as the previous one and only treats this as error if -pedantic is in place (which is actually contrary to the standard if I remember right).

size_t was defined in stdlib.h and stddef.h following the PC pattern (which also allows to override typedefs) to avoid the need of a separate sys/types.h (I'd like to keep it this way to retain compatibility with Pure C).

Would it be a problem for you to update your compiler?

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1559
Joined: Sun Jul 31, 2011 1:11 pm

Re: Project announcement: libcmini

Postby Eero Tamminen » Mon Jul 01, 2013 9:19 pm

mfro wrote:Would it be a problem for you to update your compiler?


I think e.g. Sparemint is still at gcc 2.x, AFAIK newer GCC versions are cross-compilers and/or just available from somebody's home page?

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Mon Jul 01, 2013 10:07 pm

Eero Tamminen wrote:
mfro wrote:Would it be a problem for you to update your compiler?


I think e.g. Sparemint is still at gcc 2.x, AFAIK newer GCC versions are cross-compilers and/or just available from somebody's home page?


I don't think that matters here - he's using gcc 4.5 as stated above. If you can use 4.5, you should be able to run 4.6/4.7 as well.

The latest "official" native gcc is 2.95, AFAIK. That's pretty outdated, contains lots of bugs (I remember crashes with certain optimization levels) and code quality is mediocre at best. No fun supporting it and I'm not willing to do that, at least currently.

I'm also not sure if gnu make 3.80 (which is freemint's version) supports all the statements (call/eval) used in the multilib Makefiles. Can't test it since it just bails out with "virtual memory exhausted" with 128 Mbyte TT RAM 8O

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4858
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Project announcement: libcmini

Postby simonsunnyboy » Tue Jul 02, 2013 3:39 pm

I am using Vincent Riviere's GNU toolchain for Ubuntu Linux. I will neither use an outdated 2.95 nor try to compile a more recent one for myself.
It is just curiosity, for real practical Atari work I'd use AHCC atm.

IMHO Vincent's package should be considered the standard for GNU on Atari.....2.95 is over 10 years old.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
shoggoth
Nature
Nature
Posts: 854
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Project announcement: libcmini

Postby shoggoth » Tue Jul 02, 2013 4:15 pm

simonsunnyboy wrote:IMHO Vincent's package should be considered the standard for GNU on Atari.....2.95 is over 10 years old.


On the other hand, 2.95 builds pretty good code on 68k (from C source), and compile times etc are acceptable on (real) 040/060 class machines. Later versions of GCC take forever to build things natively, and AHCC doesn't optimize code that well. It does make sense to support GCC 2.95 on this platform.
Ain't no space like PeP-space.

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Tue Jul 02, 2013 4:20 pm

simonsunnyboy wrote:IMHO Vincent's package should be considered the standard for GNU on Atari.....2.95 is over 10 years old.


I agree. You probably just forgot to upgrade - Vincent's current repository version (which is what I use) is at 4.6.4:

Code: Select all

m68k-atari-mint-gcc -v
Using built-in specs.
COLLECT_GCC=m68k-atari-mint-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/m68k-atari-mint/4.6.4/lto-wrapper
Target: m68k-atari-mint
Configured with: ../gcc-4.6.4/configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=m68k-atari-mint --disable-nls --enable-languages=c,c++ --disable-libstdcxx-pch 'CFLAGS_FOR_TARGET=-O2 -fomit-frame-pointer' 'CXXFLAGS_FOR_TARGET=-O2 -fomit-frame-pointer'
Thread model: single
gcc version 4.6.4 (MiNT 20130415) (GCC)

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4858
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Project announcement: libcmini

Postby simonsunnyboy » Tue Jul 02, 2013 5:26 pm

I fear upgrade requires a dist upgrade which I won't do at this point of time. I don't have the spare time and my setup just works. Maybe Vincent will backport the newer version?
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

AnthonyJ
Atari nerd
Atari nerd
Posts: 47
Joined: Sat Jan 26, 2013 8:16 am

Re: Project announcement: libcmini

Postby AnthonyJ » Wed Jul 03, 2013 4:24 pm

Seems easy enough to avoid the redeclaration error with something along these lines:

Code: Select all

#if (GCC_VERSION >= 40600) || !defined(_SIZE_T_DEFINED)
typedef unsigned long size_t; /// or whatever it is...
#define _SIZE_T_DEFINED
#endif

Or are there lots of redefinitions that would mean it would quickly become very ugly?

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Sat Apr 26, 2014 12:08 pm

For those that care: I have tagged and released a new libcmini version (0.5) today on Atariforge.

It's still far from complete (as a full blown standard library) but pretty usable already (at least it was good enough for Resource Master diet). Numerous functions (too many to mention) have been added and a lot of bugs corrected.

bench (the sample application which you can just copy and use the Makefile) is provided as a clean GEM skeleton supporting all m68k-gcc supported platforms (including Coldfire).

It has been extended (no need to use this extension, though) with (dirty/clean, depends on how you look at it) backbuffered drawing routines (currently only 256 colours/8 bit interleaved bitplanes support) which allow to draw into a program-allocated backbuffer and copy the results with vro_cpyfm() to screen.

When I first tested it on hatari, I was pretty disappointed with the speed and nearly threw it away as (one out of too many) failed programming lessons. Luckily I redecided and coded the same with "real" VDI on-screen code and it turned out the backbuffer drawing code (including the vro_cpyfm() call) was about twice as fast (slow) as EmuTOS' VDI routines and about equal to TOS404's (astonishingly, the TOS404 raster copy seems to work much slower than with EmuTOS, while with VDI circles it's just the other way round).

grab0001.png


Notice the backbuffered circles use an exact Bresenham circle algorithm while the VDI uses a pretty rough approximation only.

On the Firebee (using EmuTOS) both methods are exactly equal (25-30 ms/redraw = 30 FPS) so this is probably good enough for simple 256-color GEM games (which I take as proof that screen drawing is memory-bandwidth limited on the Firebee - as discussed in the other thread).

The mintlib executable equivalent of bench, btw., is still more than three times the size than its libcmini counterpart.
You do not have the required permissions to view the files attached to this post.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Project announcement: libcmini

Postby wongck » Sun Mar 06, 2016 12:00 pm

mfro wrote:just wanted to let you know that I created a new project on AtariForge.

announcement: libcmini, a tiny and simple libc for TOS/MiNT and gcc.


Hi Markus,

So I want to try this libcmini to see if it can make my 400+ KB driver smaller.

So I downloaded the v0.5 and of course it tells me time() is undefined. So I looked at sourceforge again and saw latest version does implement time(). I download via SVN and did a make and of course it fails because I am not cross-compiling. Error was " virtual memory exhausted".
(sure... I do not have any virtual memory on Mint :roll: )

Can you please make the latest version available for download ?
(i looked at your Makefile and I gave up... I'm too old to figure it out)
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Sun Mar 06, 2016 2:38 pm

Just done a new release. Can't promise it will support all you need, but time is now definitively supported. Good luck!

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Project announcement: libcmini

Postby wongck » Sun Mar 06, 2016 3:10 pm

THANKS !!!
Will try it out and probably have some questions for you.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Project announcement: libcmini

Postby wongck » Sun Mar 06, 2016 3:41 pm

Seems to work fine :-)
The libc stripped binary was 293735 bytes
The libcmini stripped binary is 216522 bytes
So nearly 80K savings.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Project announcement: libcmini

Postby wongck » Sun Mar 20, 2016 2:43 pm

When I make an ACC using libcmini, it bombs on startup. Is there anything special I need to make an ACC ?
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Sun Mar 20, 2016 2:58 pm

wongck wrote:When I make an ACC using libcmini, it bombs on startup. Is there anything special I need to make an ACC ?


Yes. Tell me. Like you just did ;).

Basic accessory support should be part of the startup code IIRC, but I never came around testing it so it's probably still full of bugs.

Will look into it.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Project announcement: libcmini

Postby wongck » Sun Mar 20, 2016 3:28 pm

OK, thanks for looking into it.
I saw your code had acc_main() , so I tried using it for my ACC.
I reverted back to standard lib in the mean time.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 683
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Project announcement: libcmini

Postby mfro » Sun Mar 20, 2016 6:45 pm

wongck wrote:... I saw your code had acc_main() , so I tried using it for my ACC ...


acc_main() is not intended for user code. Just use a completely standard main(). You should be able to determine if your code is started as accessory with the _app global variable (1 = application, 0 = accessory). As far as I remember, that's just like Pure-C did it.

I've hacked together a (very) simple accessory just now. May be its simply too simple to really show your problem, but for me, it seems to work as desired.

acctest.acc.gz


Please let me know if this helps.
You do not have the required permissions to view the files attached to this post.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Project announcement: libcmini

Postby wongck » Sun Mar 20, 2016 10:50 pm

Thanks.
Structure-wise, the code seems similar to your example.
I will have to make some printf statements to see where is the crash.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4858
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Project announcement: libcmini

Postby simonsunnyboy » Mon Mar 21, 2016 5:30 pm

Small notice, the v0.5 release builds here with Ubuntu 14.04LTS and Vincent's gcc build for it:

Code: Select all

$ m68k-atari-mint-gcc --version
m68k-atari-mint-gcc (GCC) 4.6.4 (MiNT 20130415)


Nice to see this reached a usable stage.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 2 guests