Hallo Besucher, der Thread wurde 3,1k mal aufgerufen und enthält 7 Antworten

letzter Beitrag von Wirsing am

vbcc optimizing C compiler for 6502 now with MEGA65 support

  • Hi,

    I have uploaded an update of vbcc with first support for the MEGA65: http://www.compilers.de/vbcc.html


    It does not yet make much use of MEGA65 CPU apart from map instruction (update is under work) and there are probably still quite a number of problems (there are some areas where I do not yet understand the requirements regarding mapping when calling kernel functions). But it should be well worth a try. At least I did have to change the loop counter of the dhrystone benchmark to unsigned because 30000 iterations would not take enough time.


    A few of the good things:


    - compiler is under active development

    - supports C99 (variable-length arrays, designated initializers etc.)

    - generates optimized code (see dhrystones in sample directory)

    - supports banked memory and far-pointers

    - (limited) floating point support based on Steve Wozniaks code

    - (pretty good) 32/64bit IEEE floating point support based on SANE

    - support for 65C02 extensions

    - support for writing interrupt handlers

    - attributes for putting variables into zero page

    - supports stack-frames > 256 bytes


    Changes since r1:


    - new target: MEGA65 (native mode, some banking support)

    - new target: Commander X16 (thanks András Péteri)

    - new options -prefer-statics/-force-statics (allocate local variables in static memory rather than on the stack)

    - new option -range-opt (first implementation of some range-based optimizations changing induction variables to smaller types)

    - added support for o65 object file format

    - added support for Oric target format

    - better use of x register

    - improved cross-module function-inlining

    - IEEE math library works with 65c02

    - several code generation improvements

    - fixed several bugs

    - slightly reworked examples

  • WOW,

    thanks for the update !

  • I have uploaded version 3 of the vbcc distribution for 6502 targets at http://www.compilers.de/vbcc.html


    This release brings significant improvements for the MEGA65. The code generator now makes use of the special MEGA65 32bit instructions as well as of the HW multiplier unit. vbcc now has full support for banking including automated bank-switching and a loader to transfer big images from SD card into the RAM banks. Together with a rewritten C library that does not need the ROM functions, the full chip memory is now available for the application. Also, there is support for using stdio functions to read files from SD card.


    Furthermore, we are happy to announce that the Museum of Electronic Games & Art e.V. (http://www.m-e-g-a.org) has decided to sponsor the MEGA65 version of vbcc.

    This does not only help us to continue supporting and improving this port but it also allows us to relax the terms of use for the MEGA65 community. Everyone may now freely use vbcc to develop MEGA65 code for commercial as well as non-commercial usage (for details please refer to the license in the documentation).


    We thank MEGA e.V. for the confidence in vbcc and hope that this step will help in the creation of new software for the MEGA65.


    Major changes since last update:

    • - several bug fixes
    • - improved code generation
    • - linker mask optimizations to reduce overhead of some library functions (still much room for improvement)
    • - improved attribute checks for banking
    • - C64 new features:
      • - stdio functions allow file access on 1541 compatible drives
    • - MEGA65 new features:
      • - free license for commercial usage
      • - code generator uses 32bit extensions
      • - code generator uses HW multiplier
      • - full automated banking support
      • - ROM-less library enabling full use of the entire RAM
      • - stdio functions allow reading of files on SD card
    • - BBC new features:
      • - stdio functions allow file access
      • - full automated banking support for systems with sideways RAM
      • - support for command line arguments
      • - configuration for clean return after exit
    • - CBM PET new features:
      • - added as new target
  • Whoa this is big news. I can't wait to try it out... and then maybe begin porting my RPG enigne to the new compiler and finally finish it.


    Up until now I was using CC65 and doing banked stuff (overlays, far variables, etc.) manually and with lots of ever more complicated C and asm helper code. Which at some point simply wasn't fun any more... so, chances are you just gave https://github.com/steph72/dragonrock-mega65 a new lease of life :)