Modifying the loader

Libraries, utilities, bootloaders...

Re: Modifying the loader

Postby Jerom » Wed Apr 08, 2015 9:43 am

If you have to stick with 15*13 px grid, I'm fine with it. Even if some icons are not so recognizable, since there is the name in the header, it's great.
Btw the blinking square is fine enough.
User avatar
Jerom
 
Posts: 58
Joined: Tue Mar 31, 2015 4:47 pm
Location: France

Re: Modifying the loader

Postby erico » Wed Apr 08, 2015 12:12 pm

The 4x2 icon size is 19x18 pixels. The header is better to read here as you have it surrounded by black lines with a white line splitting it from the icons.

The 15x13 pixels, the text gets blurred with the icons as there is not enough space for a line split. As an interface, I think the text should be easy to read.

Anyway, both are fine to me.
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: Modifying the loader

Postby Sorunome » Wed Apr 08, 2015 1:36 pm

uho, with 15x13 i'm running into ram issues (right now it takes up exactly 2048 bytes of ram).
So Maybe I'll switch to 19x18 only so that I have more free RAM :P

EDIT: With some very dark magic i managed to shrink it down to 1748 bytes while still using the 15x13 icons!
That means i have 300 bytes left to make the cursor flashing ^.^

EDIT2: eeeer, i derp, the program can be 30k of which is only 2k ram.....whatever lol :P
I made the flashing cursor now ^.^ I'll upload a screenie thingy once my cam recharged.

Also if I should only display games that have an INF file I could do even more speed optimizations ^.^
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Modifying the loader

Postby Sorunome » Wed Apr 08, 2015 3:49 pm

So, I only made one icon for this demo.

Image

Also, for it to be able to save an EEPROM without screwing the filesystem i need rodot to build it >.<

The source is available here: https://github.com/Sorunome/Gamebuino/t ... ies/Loader

You will need the custom tinyFAT library: https://github.com/Sorunome/Gamebuino/t ... es/tinyFAT (only tinyFAT.h changed)

And the INF file creator is here: http://www.sorunome.de/makeGamebuinoINF
The name can be up to 21 chars!
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Modifying the loader

Postby erico » Thu Apr 09, 2015 7:01 am

Nice pic! :)
Still, you see that text is harder to read, it just blends too much.

The 4x2 design goes better here visual wise, you could also have the upper grid in white, it should read even better.

I think I prefer the 4x2 one. As a proposed loader, it should look great and clean IMO.
User avatar
erico
 
Posts: 671
Joined: Thu Mar 27, 2014 9:29 pm
Location: Brazil

Re: Modifying the loader

Postby rodot » Mon Apr 13, 2015 7:53 pm

I just tried to compile the loader and yes it creates empty files when it attempts to save games (compiled with Arduino 1.6.2 on windows 7). When I plug the micro SD card on the computer, Windows says that the .SAV files appear to be corrupt. Although I don't get garbage files.

I haven't looked for a solution yet, but it might be a compatibility issue with the new version of the Arduino IDE, or that we run out of RAM so random stuff get written in the buffer.

One way to use less RAM would be to use the same buffer for both the display and the micro SD card. You can change tinFAT.h from this
Code: Select all
class tinyFAT
{
public:
   _master_boot_record   MBR;
   _boot_sector      BS;
   _directory_entry   DE;
   _current_file      currFile;
   unsigned long      firstDirSector;
   byte            buffer[512];

to this
Code: Select all
class tinyFAT
{
public:
   _master_boot_record   MBR;
   _boot_sector      BS;
   _directory_entry   DE;
   unsigned long      firstDirSector;
   byte            *buffer;

Then, at the beginning of your program, you give the display buffer to the tinyFAT library :
file.buffer = gb.display.getBuffer();
But you will have to clean the buffer each time you switch between display updating/SD accessing.
I made a program which would do this but I can't find it back, I'll redo it but I don't have time right now.
Anyway we still don't know why the SAV files are getting corrupt :(
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France

Re: Modifying the loader

Postby jonnection » Tue Apr 14, 2015 8:11 am

Rodot & Sorunome

Could you please post an example where you have seen the writing files fails?

When I have time, I can check with the logic analyzer what the Gamebuino is actually telling the SD card. A logic analyzer can decode the SPI signals back to hex characters - by comparing the instructions in the source code and what is being communicated, it is possible to find the exact point of failure.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: Modifying the loader

Postby Sorunome » Tue Apr 14, 2015 12:47 pm

@rodot: do you still have an old version of the arduino IDE to try it out?

@Jonnection: literately every single time i tried file.writeLn no matter what it contained.

Also, maybe we should switch to a different fat library then, if this one isn't working and since we can't write \x00 ?

EDIT: also rodot, wouldn't that mean we'd need to extend the global buffer to 512 bytes, though?
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

Re: Modifying the loader

Postby jonnection » Tue Apr 14, 2015 3:12 pm

Sorunome wrote:@Jonnection: literately every single time i tried file.writeLn no matter what it contained.


@Sorunome: at the moment, I am very busy with many things. If you just post 1 example program which you know that fails, I can stick it in the Arduino IDE, hook up the analyzer and see what happens. I do not have time to start learning TinyFAT. So it would be much easier if you just post your program - that you have tested and know doesn't work - and I will take a look at what happens. If I write the program from scratch it might be that it a) somehow it works b) will take me too much time so I won't get around to doing it.
User avatar
jonnection
 
Posts: 317
Joined: Sun May 04, 2014 8:21 pm

Re: Modifying the loader

Postby Sorunome » Fri Apr 17, 2015 12:37 pm

Sorry it took so long, I was busy, too

Code: Select all
#include <tinyFAT.h> //requires the tinyFAT library. You can download it here : http://www.henningkarlsen.com/electronics/library.php?id=37
#include <avr/pgmspace.h>
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;
byte res;

void setup() {
  gb.begin();
  file.initFAT();
 
  gb.display.clear();
  gb.display.print(F("Deleting old file...\n"));
  gb.display.update();
  if(file.exists("test.txt")){
    file.delFile("test.txt");
  }
  file.create("test.txt");
  res=file.openFile("test.txt", FILEMODE_TEXT_WRITE);
  if(res==NO_ERROR){
    gb.display.print(F("Writing to file...\n"));
    gb.display.update();
    file.writeLn("Hello World!");
    file.closeFile();
    gb.display.print(F("Done writing to file!\n"));
    gb.display.update();
  }else{
    gb.display.print(F("Error opening file!\n"));
    gb.display.update();
  }
  while(true); // infinite pause
}

void loop() {
  // put your main code here, to run repeatedly:

}

It should create a file TEST.TXT with the contents "Hello World!" but it actually also creates a garbage file with the name "hello wo.rld" and test.txt is empty
User avatar
Sorunome
 
Posts: 629
Joined: Sun Mar 01, 2015 1:58 pm

PreviousNext

Return to Software Development

Who is online

Users browsing this forum: No registered users and 36 guests

cron