TinyArcade and memory usage

MagnusRunesson

  • Full Member
  • ***
    • Posts: 23
  • Eagerly awaiting TinyArcade!
    • View Profile
Hi everyone!

First of all, I'm super excited about the TinyArcade! I ordered the 3 DIY kits and is eagerly awaiting their arrival. :)

I'm preparing some games for it and have a few questions, but I figured I should start one thread per question to keep it simply, I hope that is ok!

So first of, memory on the TinyArcade.

If TinyArcade is based on Arduino Zero, and the Arduino Zero have 256 KB FLASH and 32 KB SRAM, will the TinyArcade also have 256 KB flash and 32 KB SRAM? Will the code execute from FLASH or does the executable AND runtime data need to exist in the 32 KB SRAM?

Also, is there a memory handler for the 32 KB SRAM?

Cheers!


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 357
    • View Profile
Hi Magnus,

Keeping topics separate is fine-

Correct- the TinyScreen+ board inside the arcade cabinet has the same processor as the Zero with 256KB FLASH and 32KB RAM.

Code executes from FLASH by default, so the 32KB SRAM is free.

Memory handler? At software level, everything is C++, so the answer might depend on what programming background you have :)


MagnusRunesson

  • Full Member
  • ***
    • Posts: 23
  • Eagerly awaiting TinyArcade!
    • View Profile
Oh ok, so I can use everything that comes with standard C/C++ like malloc/free and new/delete? Are the libraries pre built as library files for each platform or do they come as c/cpp files that are compiled for the proper platform at build time?

I've been programming c and c++ for 15+ years but I'm new to Arduino and still a bit confused as to what the Arduino app can and cannot do.

It seems like my .ino file is basically renamed to .cpp and built with a template program that contain a C entry point with a main loop that call the loop function in my ino file, but I don't have my computer around so I can't verify that.


Ben Rose

  • Administrator
  • Hero Member
  • *****
    • Posts: 357
    • View Profile
Knowing that, I can answer a bit better. Arduino's 'programming language' is C++ with a few layers of libraries to make it look pretty. I believe new/delete may not be implemented, but malloc/free are available(although often avoided since most Arduino platforms have so little RAM). There is in fact a main.cpp hidden away that calls setup and loop. The .ino is pre-processed(function declarations are added in) and everything is compiled(all libraries have source code). If you check the Arduino github account, all the source/build files are available but not necessarily presented in an obvious way.


MagnusRunesson

  • Full Member
  • ***
    • Posts: 23
  • Eagerly awaiting TinyArcade!
    • View Profile
Cool, thanks for clearing that up!

Looking through the source for Arduino has been very useful. I've been curious how functions like millis and micros was implemented.


MagnusRunesson

  • Full Member
  • ***
    • Posts: 23
  • Eagerly awaiting TinyArcade!
    • View Profile
Another question regarding memory on the TinyArcade. Out of the 256KB flash memory, how much will be available to the app? Is any flash memory (or SRAM) reserved for your game loading code or any other kind of boot loader?


 

SMF spam blocked by CleanTalk