ProjectABE FX Integration

Implemented the letterbox and the touch detection.

@Mr.Blinky: Is there a minimal example of something being loaded from the cart to flash?
Also, would the emulator have to load two files now (the hex and the flash image)? Or are we going to pack things together in arduboy files?

1 Like

The decision on how to manage the file packaging and deployment has still been decided.

I think it will be included in the arduboy file, so that can be portable.

Best case would be that a user can take a bunch of arduboy files, drag and drop them into our application, and it automatically creates a menu and manages the save files etc.

Here’s an example of test sketch.

That’s a good question! Two seperate files (or 3 when save data will be used) will be best for development I think. A finished game could be packed into an .arduboy file so the parts stay together.

I’ll have to replicate part of what your python script does in the emulator before it can start running, right?

Since the emulator would only run one game at a time I’d be able to ignore the header stuff, put the data in some hardcoded address, patch the hex and run? Datapage could be zero and I wouldn’t have to load the program?

You might want to consider, if possible a full stack implementation because it might be cool… “end game” to have it so that the experience from the emulator is 1:1 what you get with a physical hardware arduboy.

It’s not important now, to get things working, but think about the ability to put the emulator on the front page and be able to present that as an authentic arduboy experience with the menu and everything.

It is obviously less important, just being able to replicate the function of having the extended memory will allow developers to make their games NOW, which is what the real need of this utility is.

After that need is met, I think it would be nice to support loading of the full flash cart if possible, and have the function of the bootloader in it. But that might be without the scope, and if it is too difficult it wouldn’t be a terrible thing, just a little sad.

Yeah, I’m just thinking of what’s the bare minimum I need to do so as to unblock others quickly.

1 Like

You are the best why cant I get people like you on my league of legends teams?

1 Like

You don’t need much to unless you want to build your own flash image in memory and emulate the bootloader as well.

What needs to be done is create an 16Mbyte memory array store the save file at the end of that and store the data file just in front of the save file.

On 2n’d thought the datafiles can become quite large. maybe .Arduboy file might be easier /faster.

Yes. you could also lust creat a buffer where you load the binary files into

FlashBuffer = Datafile + Savefile
FlashMemoryStartAddress = 16777216 - len(FlashBuffer)
Any reads/writes lower then that address are ignored. Any read/writes from that address and up return the data

You wouldn’t need to patch the hex file

If I don’t patch it, how would the program know the Flash start address? :thinking:

During development. the flash writer tool that uploads the data to flash chip will report the address at which the data and save data are stored. This/these value(s) has to be passed along to an initialisation function in source. After compiling the program knows where to find the data.

When running the program from a flashimage, it’s the flash builder tool that makes sure the program will find it’s data. But this is no concern for you. since you will only handle a single game.

Ah, I see. Time to dig in.

Edit: Looks like the python script currently ignores save data… what format is it supposed to be in?

Yeah I wasn’t finished implementing it fully. But wanted to do an update cause of of an issue causing a problem with python 3. The save data is just a multiple of 4K blocks of raw data.

Has the arduboy file format been amended to take data into account yet?

Negative, @JO3RI was kind of the person who took the lead on creating the arduboy file in the first place. Not sure anyone really cares that much any more, so it is up to us to do that now.

@Mr.Blinky: After much debugging, I think I’ve found the problem: Your hex file must have a wrong base address (0xFE00). When I recompiled your code without modifications, I got the entire animation (might need to clear the browser cache):

@bateske: can you enable .arduboy attachments?

I propose adding flashdata and flashsave to the entries in binaries, maybe bump the schemaVersion and use “ArduboyFX” in device:

  "schemaVersion": 3,
  "binaries": [
      "title": "flashcart",
      "filename": "flashcart-test-mine.hex",
      "flashdata": "thedoor-frames.bin",
      "device": "ArduboyFX"


Except the animation has artifacts but I think that is from the encoding.

smart use of the device and binaries!

Sure, I can enable Arduboy files, should I point the iframe at them just the same?

Yup, that’s what I did above

I think those are from the encoding, I haven’t tried it on hardware yet. :thinking: