GithubHelp home page GithubHelp logo

Comments (3)

dmsc avatar dmsc commented on May 22, 2024

Hi!

I am working on compiling a program and seeing if it is possible to make a program run from a 16k cartridge instead of RAM. I have started a CFG file. I am not sure if I am not missing anything.

This needs a little extra work.

Normally, Fastbasic uses self-modifying-code in a few places to make the code faster, so the code can't be placed in ROM. But there is a compilation option to use alternative code that disables this, so you need to recompile the interpreter.

As I had not tested that option in a while, I just reviewed all the interpreter and found three places which still tried to write to the code, so I just fixed that.

This means:

  • You need the last (unreleased) version from github.
  • You need to compile the code using:
  make ASMFLAGS="--asm-define NO_SMCODE"
  • You need to alter the linker file.

Here there is another little issue: Fastbasic uses code in zeropage and initialized DATA.

This means you need to provide two special sections:

  • A section to place the "INTERP" segment in ROM, and at runtime copy it to RAM.
  • A section to place the "RT_DATA" segment in TOM, and again at runtime copy it to RAM.

I added a "fastbiasc-cart.cfg" file with those sections, and the support code to build the cartridge image in commit b8d7ff6 , now the full instructions to compile for a cartridge image (on Linux or other Unix) are:

  git clone https://github.com/dmsc/fastbasic/
  cd fastbasic
  make ASMFLAGS="--asm-define NO_SMCODE"
  build/compiler/fb myProgram.bas -C:build/compiler/fastbasic-cart.cfg

Have Fun!

from fastbasic.

 avatar commented on May 22, 2024

I also have a ML routine called deflate which decompresses data blocks from Cartridge ROM into RAM. I could just use a portion of cartridge ROM for fonts, data tables, and some ML routines.

from fastbasic.

dmsc avatar dmsc commented on May 22, 2024

Hi!

I also have a ML routine called deflate which decompresses data blocks from Cartridge ROM into RAM. I could just use a portion of cartridge ROM for fonts, data tables, and some ML routines.

Did you try using the new CART support?

Also I recently added a copy of the CC65 tools to the repo, so you don't need CC65 to use the compiler.

Have Fun!

from fastbasic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.