Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This will be a program that allows you to create notes and other things for later use. You'll be able store as many Notes as RAM allows, or archive if I can get it to store to archive. Don't know yet.

Menu85%
Create a New File with a name100%
AppVar100%
Create Parameters for File
Parameters include:
  • Key Combinations100%
  • Amount of Pages 1-10100%
  • Password Protected50%
  • Archived

Resize File
Delete File100%
Evaluate Text (the TI-Basic expr() command)
Send/Get File to/from a connected Calculator(would require a USB lib I think)
Compression(maybe)
I/O100%
Testing and Debugging7%

That's my thought process so far.
5682 bytes, in size.

All my code can be seen at this respiratory.

New Edit:
I have been working on this project fairly slowly, because I was doing loads of work from my AP classes. I think it's about a little less than 2000 bytes right now and a lot more efficient than it was. I restarted it mostly in ASM.

Done:
Creating, Saving, Finding, Deleting, and Archiving of AppVars
The Main Menu setup

Not Done:
Settings Menu
Editing Menu
Character and Token Menu
Error Handling/Pop-ups
Compression (Might come after the initial release)
Search Function
Equations(Being able to type equations in)
A few months before you joined, there was a member that was active who completed BasicNote which is essentially this, but for the monochrome models, you might want to have a look at Michael2_3B's BasicNote It is very nicely optimized as well which is nice Wink
One thing that was not implemented and could be interesting is to get it to work with the ti keyboard and maybe even a lossless compression algorithm once the notes are saved.
EDIT: it has been brought to my attention that MateoC has also made such a program for the CE.
This program will work with the TI-keyboard, have password protection, and I will try to implement compression into this. Don't know yet.
So a little progress update. I finished finished the input functions and output functions. I don't know if I should have it automatically compress files, or maybe have a setting for it.

Will school and marching season in full gear, I'm finding very little time to work on my projects. Sad
I'm in my senior year of highschool, and I agree there isn't much time for things other than school work :/ But nonetheless, there is time here and there.

Though I haven't posted anything about it yet, I've actually been working on BasicNote CE for a while, which will be a bigger (or more optimized might I say) and better text editing program for the 84+ CE. The link doesn't look like too much yet, but I promise it's way better than the monochrome one I was working on (sorry monochrome users).

Anyways, I don't know much about C and Asm, but I'm interested to see where you go with this. Good luck Wink
It's been awhile since an update, but homework, marching season, and architecture have taken up my time. They all should be becoming a lot less of stress, which means I can give this the attention it deserves.

I wrote up this bit of code(I actually got it from the K&R ANSI C Tutorial) for alphabetizing the list of Files. Some things are wrong with it and I can't figure out how to fix them.

Code:
struct files *addNote(struct files *p, char *w) {
    int cond;
    if (p == NULL) {
        p = (struct files *)malloc(sizeof(struct files));
        if (p == NULL)
            return NULL;
        p->name = strdup(w);
        if (p->name == NULL)
            return NULL;
        p->alpha = NULL;
    } else if ((cond = strcmp(w, p->name)) == 0)
        return NULL;
    else
        p->alpha = addNote(p->alpha, w);                   //line 49
    return p;
}

I added some error checking in it. Here is the struct I use for the files:

Code:
struct files {
    char *name;
    struct File *file;
    struct Files *alpha;
};

And these are the errors I get when compiling:

Code:
C:\CEDEV\PROJECTS\TEXTFILE\SRC\APPVAR.C (49,37) :       ERROR (171) Argument type is not compatible with formal parameter
C:\CEDEV\PROJECTS\TEXTFILE\SRC\APPVAR.C (49,41) :       ERROR (152) Operands are not assignment compatible
make: *** [obj/appvar.obj] Error -1

Line 49 is commented in the code above.

Edit:
Dumb mistake. My struct declaration wasn't updated.

Code:
struct files {
    char *name;
    struct File *file;
    struct files *alpha;
};
I got this error while compiling(It was actually during the linking stage):

Code:
WARNING (731) --> File "obj/fileioc.obj" is not found.
make: *** [bin/TEXTFILE.hex] Error -1

I have the include file included, and the makefile done correctly.

Edit:
I download the newest C SDK, and this time I got a weird error:

Code:
make: *** No rule to make target `C:\CEdev\lib\ce\graphx\graphx.lib', needed by `bin/TEXTFILE.hex'.  Stop.
You could try if cleaning the project by typing
Code:
make clean
in the command prompt helps.
I know this shows nothing, but I got stuff on the screen. It looks bad I know. But that's what I did without looking at a screen.
I'm having a problem, similar to the one I had in my last C project. Why do I click a button sometimes, and have the calculator not register anything? I have debugging code to prove it. Here's my code if you want to take a look at it:

My main program:

Code:
/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>

/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <debug.h>

//libraries
#include <fileioc.h>
#include <keypadc.h>
#include <graphx.h>
#include <intce.h>

//includes
#include "draw.h"
#include "appvar.h"
#include "main.h"

//defines

//functions

//variables
uint8_t key;

void main(void) {
    bool leave=false;
    uint8_t choice;
    file_t *p;


    gfx_Begin(gfx_8bpp);
    gfx_SetDraw(gfx_buffer);
    access_Open();
    dbg_sprintf(dbgout, "AppVar Opened Successfully\n");
    do {
        key = os_GetCSC();
        if (key)
            dbg_sprintf(dbgout, "Key Pressed");
        choice = draw_Menu(key);
        if (choice) {
            switch (choice) {
            case 1:                                     //New Note
            case 2:                                     //Settings
//                draw_SettingsScreen();
                access_AppVarW("all",0, fileVar);
                break;
            case 3:                                     //Edit Existing Note
            case 4:                                     //Delete Note
                p = &fileAccess[fileChoose];
                deleteNote(p);
                break;
            }
        }
        if (key == sk_Clear) {
            dbg_sprintf(dbgout, "Key = sk_Clear\n");
            leave = true;
        }
    } while (leave != true);
//    draw_Exit();

    gfx_End();
    prgm_CleanUp();
}

My draw functions:

Code:
/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tice.h>

/* Standard headers - it's recommended to leave them included */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <debug.h>

//libraries
#include <fileioc.h>
#include <keypadc.h>
#include <graphx.h>

//includes
#include "draw.h"
#include "appvar.h"

//defines
#define moveFalse       0
#define moveUp          1
#define moveDown        2
#define moveTop         3
#define moveBottom      4

//functions

//variables
struct numberOfFilesScreen {
    int onScreen;
    int topFile;
}nof;

bool complete = false;
uint8_t cursory = 10;
int fileChoose;

uint8_t draw_Menu(uint8_t kbd_key) {
    uint8_t move=moveFalse;
    nof.onScreen = 20;

    switch (kbd_key) {
    case sk_Down:
        if (cursory == numberOfFiles * 10 + 10) {
            cursory = 10;
            fileChoose=1;
            move = moveTop;
            dbg_sprintf(dbgout, "kbd_key = sk_Down 1\n");
            break;
        }
        cursory += 10;
        fileChoose++;
        move = moveDown;
        dbg_sprintf(dbgout, "kbd_key = sk_Down 2\n");
        break;
    case sk_Up:
        if (cursory == 10) {
            cursory = nof.onScreen * 10 + 10;
            fileChoose = numberOfFiles;
            move = moveBottom;
            dbg_sprintf(dbgout, "kbd_key = sk_Up 1\n");
            break;
        }
        cursory -= 10;
        fileChoose--;
        move = moveUp;
        dbg_sprintf(dbgout, "kbd_key = sk_Up 2\n");
        break;
    case sk_Add:
        dbg_sprintf(dbgout, "kbd_key = sk_Add\n");
        return 1;                               //New Note
    case sk_Mode:
        dbg_sprintf(dbgout, "kbd_key = sk_Mode\n");
        return 2;                               //Settings
    case sk_Enter:
    case sk_2nd:
        dbg_sprintf(dbgout, "kbd_key = sk_2nd\n");
        return 3;                               //Edit Existing Note
    case sk_Del:
        return 4;                               //Delete Note
    }
    if (kbd_key) {
        dbg_sprintf(dbgout, "kbd_key pressed\n");
        gfx_FillScreen(0x64);
        gfx_SetColor(0x1A);
        gfx_FillRectangle(0,0,320,10);
        gfx_PrintStringXY("File", 10, 0);
        gfx_PrintStringXY("Size", 250, 0);
        gfx_SetColor(0x00);
        gfx_Line(8,0,8,229);
        gfx_Line(0,230,320,230);
        gfx_Line(0,10,320,10);
        gfx_Line(248,11,248,229);
        gfx_PrintStringXY(">",2,cursory);
        draw_TextFiles(move);
        gfx_SwapDraw();
    }
    move = moveFalse;
    if (!complete)
        dbg_sprintf(dbgout, "Before while(os_GetCSC());\n");
    while (os_GetCSC());
    if (!complete) {
        dbg_sprintf(dbgout, "Return normally from draw_Menu\n");
        gfx_SwapDraw();
    }
    complete = true;
    return 0;
}

bool draw_TextFiles(uint8_t move) {
    file_t *p;
    uint8_t i = 0, y = 10;
    int printFileOn = nof.topFile;

    if (numberOfFiles == 0)
        return false;
    if (move == moveFalse) {
        if (nof.topFile > numberOfFiles)
            return false;
        while (i != 21 || i != numberOfFiles) {
            p = &fileAccess[printFileOn];
            gfx_PrintStringXY(p->name, 12, y);
            printFileOn++;
            i++;
            y += 10;
        }
        return true;
    }
    if (move == moveUp) {
        nof.topFile--;
        if (!draw_TextFiles(moveFalse))
            return false;
        return true;
    }
    if (move == moveDown) {
        nof.topFile++;
        if (!draw_TextFiles(moveFalse))
            return false;
        return true;
    }
    if (move == moveTop) {
        nof.topFile = 1;
        if (!draw_TextFiles(moveFalse))
            return false;
        return true;
    }
    if (move == moveBottom) {
        nof.topFile = numberOfFiles;
        if (!draw_TextFiles(moveFalse))
            return false;
        return true;
    }
    return false;
}
Remove the
Code:
while (os_GetCSC());
loop at the end of you draw_Menu function.
I have been working on this program for the past 5-7 weeks, and I'm proud to say, I'm almost done before debugging. The first version, I'm sad to say, does not include compression as I outlined in my original thoughts, nor does it include some of the other things.

I'm currently making the error handler, and then I'm on to debugging and release. I estimate 2-4 weeks at the most. Maybe sooner.

Edit:
Program is finished. I am moving on to debugging.
So I'm almost done doing debugging. When I'm finished it won't be 100% debugged to my knowledge(maybe I'll get lucky...doubtful), however, I'm hoping that people who download it can give me feedback and bug info.
Anyways, here is a little "teaser" gif for everyone. It's kind of long, sorry, but I wanted to show what I currently have debugged. It shows most of the entire program.

Any thoughts?
You should try supporting the input method that I used for this program. I've found that it makes it super efficient for typing Smile Great work so far; it's looking awesome! Do you have a format in mind for text files so they can be exported and imported computer side?
MateoConLechuga wrote:
You should try supporting the input method that I used for this program. I've found that it makes it super efficient for typing Smile

I'll take a look. I'm currently just trying to get this done, and then I will update things that could look a lot better.
Quote:
Great work so far; it's looking awesome! Do you have a format in mind for text files so they can be exported and imported computer side?

My format goes like this right now:

Code:
typedef struct {
    double version;
    name_t apvName;
    name_t password;
    int size, size_text;
    bool archive, newfile;
    char text[1];
}fileStructure_t;
That's the file header I guess you could call it. The actual contents of the file are located in the char array text(allocated space through malloc). Currently I have a newline and an End of File indicator, where /n = 0xFA and EOF = 0xFF. Other than that, all the characters are unchanged. I hope that answers your question. Also, I'm not really that knowledgeable about importing and exporting from the computer side. One day, it's possible that this may not be possible, I would love to export/import from/to Microsoft Word as well; obviously, I'd have to learn more about the computer stuff first.
A few recommendations:

version should be reduced to a uint8_t.
name_t should be changed to a char apvName[9] and password[X].
size and size_text should be changed to size_t types.

EOF should be byte 0x00.
/n should be the same as the ASCII spec, 0x0A.

Read this page: http://www.asciitable.com

Hope this helps Smile
MateoConLechuga wrote:
A few recommendations:

version should be reduced to a uint8_t.

I might do this. I think I could pull off what I wanted with two bytes of uint8_t instead of a double.
Quote:
name_t should be changed to a char apvName[9] and password[X].

I'm not going to do this because, when searching for a file that was maybe imported from another calc(or in the future maybe, the computer), the first byte of the name_t struct will tell the program whether it's a TextFile file or not.
Quote:
size and size_text should be changed to size_t types.

Good idea!

Quote:
EOF should be byte 0x00.
/n should be the same as the ASCII spec, 0x0A.

Read this page: http://www.asciitable.com

Hope this helps Smile

Another good idea.
Would you mind if I implemented Text Edit CE's Pixel Font Edit Data into my TextFile program? If yes, do you happen to have the original .pf file for the data?


Edit:
This doesn't deserve a new post so I'll just edit. Hopefully this should be ready to release by the weekend. I'm currently working on an Architecture Project and then I have some free time to work on all the bugs that I keep finding the more I dig. Laughing
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement