Author Topic: PicoC -> TCC  (Read 36386 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: PicoC -> TCC
« Reply #25 on: March 16, 2014, 10:16:13 PM »
Proof of concept working:

- compile from https://bitbucket.org/hudson/magic-lantern/branch/tcc-scripting
- update the path passed to script_load_symbols in script.c (it's hardcoded for now)
- load script.mo and fpu_emu.mo
- don't load tcc.mo, but place it on the card
- run hello.c and clock.c
- fix the bugs and port the picoc library (library_ml.c)


pravdomil

  • Member
  • ***
  • Posts: 166
Re: PicoC -> TCC
« Reply #26 on: March 17, 2014, 10:49:27 PM »
yes, sobokan is back!

ted ramasola

  • Moderators
  • Hero Member
  • *****
  • Posts: 1251
Re: PicoC -> TCC
« Reply #27 on: March 17, 2014, 11:26:58 PM »
I'm still hoping arkanoid will be added with a way to keep score.
5DmkII  / 7D
www.ramasolaproductions.com
Texas

gerk.raisen

  • Member
  • ***
  • Posts: 161
Re: PicoC -> TCC
« Reply #28 on: March 18, 2014, 02:51:24 PM »
Thank you A1ex... we are close to have fun :)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: PicoC -> TCC
« Reply #29 on: March 18, 2014, 03:02:51 PM »
Well... no comments regarding the scripting API?!

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: PicoC -> TCC
« Reply #30 on: March 18, 2014, 03:09:25 PM »
Well... no comments regarding the scripting API?!

I guess most people around here are either simple user folk ("How do I install it?") or more in-depth people who can write modules or patches if they want something done. Generating a user base for scripts might take some time and a good documentation on the api...

... but nevertheless it's great it's working now (again :-)) and we're looking forward to the mini_iso release :->

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3183
Re: PicoC -> TCC
« Reply #31 on: March 18, 2014, 03:41:12 PM »
didnt find where you asked for comments :)

here are the decision i made in TriX to clearly distinguish beween scripting and internal functions.
maybe they are a good starting point as they were quite good to handle and stable for the script developers.

a) all public scripting API functions are in UpperCamelCase and are documented!
    (if it is an API function, it will only be UpperCamelCase if there is some documentation)
b) all core-internal functions are available as they are named in core, just with "__" prefix (e.g. __internal_function)
c) core-internal functions get replaced step by step with public scripting API

the public scripting API was handled by wrapper-functions that abstracted some internal stuff and called the __internal_function.
any change to internal functions - i.e. adding/removing parameters etc was handled by the wrapper function.
most of the stuff was autogenerated with scripts and made visible using includes.

e.g. see the partially autogenerated util.h file
http://svn.g3gg0.de/svn/default/trunk/nokia/TriX/include/auto_util.h

#define UTIL_AUTO_IMPORTS
defines all functions that are visible to the scripting engine

#define UTIL_AUTO_MISC_POST
defines the public API with all stuff necessary to make the API sane and call the internal functions.


advantage:
 - all core symbols are visible to scripting engine without any restriction
    therefore core code is accessible - this is an exceptional case and not recommended
   (e.g. bmp_printf is exported into scripting engine as __bmp_printf)
 - keeping the API stuff in scripting-headers only, not affecting ML core, only scripts include that API file.
   (e.g. BmpPrintf is a static inline function in scripts/include/bmp.h and calls __bmp_printf)
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

gerk.raisen

  • Member
  • ***
  • Posts: 161
Re: PicoC -> TCC
« Reply #32 on: March 19, 2014, 10:32:46 AM »
Not sure.  :o Is the old PicoC APIs already available to test with new TCC scripting engine?
I think it could be a good start point.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: PicoC -> TCC
« Reply #33 on: March 19, 2014, 10:33:52 AM »
It's available in the PicoC code, waiting for somebody to port it ;)