Latest library update ensures all types of circles are drawn the same:

https://github.com/CE-Programming/libraries/releases/latest

Feel free to download at your lesiure Razz
I have added a doxygen page for all of your documentation of library routine needs. Feel free to check it out; it's rather nice. I'll probably be making it look better and everything and linking it from the github wiki.

http://ce-programming.github.io/toolchain/files.html
Pretty awesome toolchain update! Installing on windows is probably the easiest toolchain installation in the entire world now. Lots of bug fixes and feature additions, keep reading for more or just get the download.

Toolchain: https://github.com/CE-Programming/toolchain/releases/latest
Libraries: https://github.com/CE-Programming/libraries/releases/latest

Note: Libraries are now included by using '#include <graphx.h>' rather than '#include <lib/ce/graphx.h>'. Also, if you are updating an older project, please use an updated makefile from the examples folder. These changes are important, so be sure to make them! Smile

Things that have changed (there's more too, take a look at github):
    Able to build natively on any platform now simply by typing 'make'
    ConvPNG has been updated to fix a few memory issues (work goes on to add appvar support)
    Complete restructure of toolchain hierarchy; can now simply clone the repo and make. (see readme)
    Added gfx_FloodFill, gfx_ScaleSprite, and gfx_SetFontHeight, along with about a 5-9% speed increase in clipped sprite drawing.
    Optimized gfx_AllocSprite (Thanks Runer)
    Native convpng, convhex, and other programs for ease of use.


Also, jacobly is doing insane things with llvm, so feel free to give him some kudos whenever he's around Smile Many thanks to jacobly and Adriweb for testing and telling me when I messed things up Razz Enjoy everyone! Until next time.
Updated header file documentation to reflect new library commands:

http://ce-programming.github.io/toolchain/files.html
I'm glad you continue to especially focus on fun graphics things like clipped sprites. What algorithm did you go with for flood fill?
KermMartian wrote:
I'm glad you continue to especially focus on fun graphics things like clipped sprites. What algorithm did you go with for flood fill?


I spent a long time trying to decide, and eventually settled on a seed fill algorithm similar to this one. My assembly implementation
here could probably use some optimization, but for now it is quite decently fast; and prevents overflow of the stack by implementing its own. Overall though it is quite fun to be able to run demos like this one.
Oooh flood fill? I'd better hop to it! Razz
I've added screenshots for almost all examples, on their readmes Smile
https://github.com/CE-Programming/toolchain/commit/7ebb1f19c9f0c9a3ed76df68a6e9b1d711f57187

Hopefully that will attract more people to actually look at the examples...
Minor bug updates to the toolchain and libraries:

https://github.com/CE-Programming/libraries/releases/latest
https://github.com/CE-Programming/toolchain/releases/latest

Kudos to P_T for finding and fixing as well Smile
Version 7.2 cleans up the examples' code and removes prgm_CleanUp(). This is now automatically handled when you close, but is left as a blank define for compatibility. Use either os_ClrHome() or os_ClrHomeFull() if you wish to clean up the screen. A few small bug fixes in the fileio library as well. Enjoy! Smile

Libraries: https://github.com/CE-Programming/libraries/releases/latest
Toolchain: https://github.com/CE-Programming/toolchain/releases/latest



Also, a random tidbit I'll include with every new post here about the toolchain:
You can use os_MemChk() to easily get free user space memory for use in your programs Smile
My computer is blocking windows_CEdev.exe and saying it has a virus. Sad Is anyone else having this problem? How can I get it to run?
calcnerd_CEP_D wrote:
My computer is blocking windows_CEdev.exe and saying it has a virus. Sad Is anyone else having this problem? How can I get it to run?

Screen shot please Wink
Your windows 10 defender or antivirus settings are too high. Just lower them or add a custom rule. I can't really guide you through something like this; learn how to use and configure your system Wink

The reason for this is because I do not want to pay $200 to digitally sign the installer. Microsoft just is trying to make you not be a developer. They hate developers. Unless they work for them.
What I was worried about is that its never shown up as a virus for any of your other programs. Its never recognized it (stupid microsoft), but this is the first time it came up as a virus.
That is why people shouldn't use Windows Razz

***PT_ hides as he uses Windows

Anyway, I don't think you can do anything against it, or you might have a greatful donator who wants to pay it, but I don't think so Wink
I believe this would be the most relevant place to place this post. (I could be wrong)

I found a problem will ti_Open...but then again, I don't think it's ti_Open being the issue. Basically, I found that the program I am debugging was crashing. I found that it was through ti_Open. I figured out it was happening during the call to _PushOP1 (it's the second one in the function). _PushOP1 eventually makes the call to __PushRealO1. __PushReal, which __PushRealO1 goes into, makes a call to __ErrNotEnoughMem. That's where the calculator crashes, because there's apparently not enough memory. I reset CEmu and reloaded the ROM, and I also tried it on my physical calculator; it crashed every time. Any ideas?

Basically I entered ti_Open like this:
ti_Open(APPVAR_NAME, READ_PLUS);
where:
APPVAR_NAME is a pointer to the 8 character name
READ_PLUS is a pointer to "r+"

I just updated the toolchain, libraries and CEmu today.

I attempted to change the "r+" to just "r" in order to pass all of the _PushOP1's, and then I ran into another problem. The calculator seemingly runs on and on, leaving the display a nice blank white, in _ChkFindSym. I don't exactly know how, but it does this both on CEmu and my regular calculator.
What does your source file look like? Explanations for things are not helpful haha Razz
MateoConLechuga wrote:
What does your source file look like? Explanations for things are not helpful haha Razz


Oh, sorry. Here it is:

Code:
/* Keep these headers */
#include <stdbool.h>
#include <stddef.h>             //need this
#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>

//includes
#include "access.h"

//defines

//functions

//variables
const open_type createMain = 0;
const open_type saveMain = 1;
const open_type openMain = 2;
const open_type createFile = 3;
const open_type saveFile = 4;
const open_type openFile = 5;

char apvName[] = "TextFile";
char readPlus[] = "r";
char write[] = "w";

int numofFiles_Open = 0;
int numofFiles = 0;

slotVars_t slotVars;

allfiles_t *allfiles_ptr = (allfiles_t*)0xD031F6;     //address of allfiles
allfiles_t *allfiles_inc = (allfiles_t*)0xD031F6;
const allfiles_t allfiles = {0};

static const settings_t settings_d = { 1.0000, 0x5E, 0x36, 0};
settings_t settings_m;

fileStructure_t *file_1 = (fileStructure_t*)0xD09466;
fileStructure_t *file_2 = (fileStructure_t*)0xD0BF42;
fileStructure_t *file_3 = (fileStructure_t*)0xD0EA1E;
fileStructure_t *file_4 = (fileStructure_t*)0xD114FA;
int16_t maxFileSize = 0x2ADC;
fileStructure_t *hText_1 = (fileStructure_t*)0xD052C6;
fileStructure_t *hText_2 = (fileStructure_t*)0xD0632E;
fileStructure_t *hText_3 = (fileStructure_t*)0xD07396;
fileStructure_t *hText_4 = (fileStructure_t*)0xD083FE;
int16_t maxHTextSize = 0x1068;

openFiles openFile_1, openFile_2, openFile_3, openFile_4;
name_t blank = {0,0};

int openProg(open_type type, name_t fileName) {      //fileName is only used when opening or saving a file
    int result;

    switch(type) {
    case createMain:
        slotVars.main = ti_Open(apvName, readPlus);                         //the problem occurs at this ti_Open
        if (!slotVars.main) {
            slotVars.main = ti_Open(apvName, write);
            if (!slotVars.main) {
                return -1;      //change to error code: Malloc error
            }else {
                if (result = writeVar(type, slotVars.main))
                    return result;
                break;
            }
        }else {
            if (result = readVar(openMain, slotVars.main))
                return result;
            break;
        }
    case openMain:
        slotVars.main = ti_Open(apvName, readPlus);
        break;                  //may want to add ReadVar
    case createFile:
        if (numofFiles_Open < 4) {
            if (!(slotVars.files[numofFiles_Open] = ti_Open(fileName.name, write)))
                return -1;      //change to error code: Malloc error
            if (result = writeVar(type, slotVars.files[numofFiles_Open]))
                return result;
            ++numofFiles_Open;
            break;
        }else
            return -2;          //change to error code: Cannot open file
    case openFile:
        if (numofFiles_Open < 4) {
            slotVars.files[numofFiles_Open] = ti_Open(fileName.name, readPlus);    //maxnumFiles
            if (result = readVar(type, slotVars.files[numofFiles_Open]))
                return result;
            ++numofFiles_Open;
            break;
        }else
            return -2;          //change to error code: Cannot open file
    default:
        return -4;              //change to error code: Given parameter is invalid
    }
    return 0;
}

double doubleCompare(double flt1, double flt2) {
    if (flt1 > flt2)
        return 1.0;
    if (flt1 < flt2)
        return -1.0;
    return 0;
}

void closeAll(void) {
    int i;
    ti_CloseAll();
    slotVars.main = 0;
    openFile_1.ptr = (fileStructure_t*)0;
    openFile_2.ptr = (fileStructure_t*)0;
    openFile_3.ptr = (fileStructure_t*)0;
    openFile_4.ptr = (fileStructure_t*)0;
    if (!numofFiles_Open)
        return;
    for(i = 0; i == numofFiles_Open; ++i) {
        slotVars.files[i] = 0;
    }
    numofFiles_Open = 0;
}

void close(ti_var_t file) {
    switch(file) {
    case 2:
        openFile_1.ptr = (fileStructure_t*)0;
        break;
    case 3:
        openFile_2.ptr = (fileStructure_t*)0;
        break;
    case 4:
        openFile_3.ptr = (fileStructure_t*)0;
        break;
    case 5:
        openFile_4.ptr = (fileStructure_t*)0;
        break;
    }
    ti_Close(file);
}

size_t writeVar(open_type type, ti_var_t file) {
    switch(type) {
    case createMain:
        settings_m = settings_d;
        if (!ti_Write(&settings_m, sizeof(settings_t), 1, file))
            return -1;                  //change to error code: Malloc error
        break;
    case saveMain:
        if (!ti_Write(&settings_m, sizeof(settings_t), 1, file))
            return -1;                  //change to error code: Malloc error
        if (!ti_Write(&numofFiles, sizeof(numofFiles), 1, file))
            return -1;                  //change to error code: Malloc error
        if (numofFiles)
            if (!ti_Write(allfiles_ptr, sizeof(allfiles), numofFiles, file))
                return -1;              //change to error code: Malloc error
        break;
    case saveFile:
        switch(file) {
        case 2:
            if (!ti_Write(openFile_1.ptr, openFile_1.ptr->size, 1, file))
                return -1;              //change to error code: Malloc error
            if (!ti_Write(openFile_1.ptr->hidden_text, openFile_1.ptr->size_htext, 1, file))
                return -1;              //change to error code: Malloc error
            break;
        case 3:
            if (!ti_Write(openFile_2.ptr, openFile_2.ptr->size, 1, file))
                return -1;              //change to error code: Malloc error
            if (!ti_Write(openFile_2.ptr->hidden_text, openFile_2.ptr->size_htext, 1, file))
                return -1;              //change to error code: Malloc error
            break;
        case 4:
            if (!ti_Write(openFile_3.ptr, openFile_3.ptr->size, 1, file))
                return -1;              //change to error code: Malloc error
            if (!ti_Write(openFile_3.ptr->hidden_text, openFile_3.ptr->size_htext, 1, file))
                return -1;              //change to error code: Malloc error
            break;
        case 5:
            if (!ti_Write(openFile_4.ptr, openFile_4.ptr->size, 1, file))
                return -1;              //change to error code: Malloc error
            if (!ti_Write(openFile_4.ptr->hidden_text, openFile_4.ptr->size_htext, 1, file))
                return -1;              //change to error code: Malloc error
            break;
        default:
            return -4;                  //change to error code: Given parameter is invalid
        }
        break;
    default:
        return -4;                      //change to error code: Given parameter is invalid
    }
    ti_Rewind(file);
    return 0;
}

size_t readVar(open_type type, ti_var_t file) {
    double result;

    switch(type) {
    case openMain:
        ti_Read(&settings_m, sizeof(settings_t), 1, file);
        result = doubleCompare(settings_d.version, settings_m.version);
        if (result == -1.0)
            return -3;                  //change to error code: Incompatable Version
        else {
            ti_Read(&numofFiles, sizeof(numofFiles), 1, file);
            if (numofFiles)
                ti_Read(allfiles_ptr, sizeof(allfiles), numofFiles, file);
        }
        break;
    case openFile:
        switch(file) {
        case 2:
            ti_Read(openFile_1.ptr, openFile_1.ptr->size, 1, file);
            ti_Read(openFile_1.ptr->hidden_text, openFile_1.ptr->size_htext, 1, file);
            break;
        case 3:
            ti_Read(openFile_2.ptr, openFile_2.ptr->size, 1, file);
            ti_Read(openFile_2.ptr->hidden_text, openFile_2.ptr->size_htext, 1, file);
            break;
        case 4:
            ti_Read(openFile_3.ptr, openFile_3.ptr->size, 1, file);
            ti_Read(openFile_3.ptr->hidden_text, openFile_3.ptr->size_htext, 1, file);
            break;
        case 5:
            ti_Read(openFile_4.ptr, openFile_4.ptr->size, 1, file);
            ti_Read(openFile_4.ptr->hidden_text, openFile_4.ptr->size_htext, 1, file);
            break;
        default:
            return -4;                      //change to error code: Given parameter is invalid
        }
        break;
    default:
        return -4;                          //change to error code: Given parameter is invalid
    }
    return 0;
}

I marked the spot where the ti_Open is.

The problems never happened before I updated the toolchain.
You need to call ti_CloseAll() before trying to open other file handles, as documented:

http://ce-programming.github.io/toolchain/fileioc_8h.html#a2a9a88c6c2200809894fdab31ffef226

Wink
  
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
» Goto page Previous  1, 2, 3 ... 13, 14, 15, 16, 17  Next
» View previous topic :: View next topic  
Page 14 of 17
» All times are UTC - 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