Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
MateoConLechuga wrote:
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



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 "main.h"
#include "access.h"
#include "menus.h"

//defines

//functions

//variables
uint8_t key, markProgInvalid;

void main(void) {
    gfx_Begin(gfx_8bpp);
    gfx_SetDraw(gfx_buffer);
    closeAll();
    openProg(createMain, blank);
    gfx_SetMonospaceFont(8);
    mainMenu();
    gfx_SetMonospaceFont(0);

    //end
    writeVar(saveMain, slotVars.main);
    closeAll();
    gfx_End();
}

The closeAll() function called above calls ti_CloseAll() (found in my last post's code).
How would I go about creating a library that can be integrated in with the toolchain? What do I need to accomplish this(what sort of files?)?

The reason I want to create a library instead of using a plain header file, is because I want to use the relocation.inc file, and I might want to release a library for public use.
PLEASE UPDATE Smile

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

Some important notes:
    gfx_sprite_t has replaced gfx_image_t, although both will still compile. Please use gfx_sprite_t for future programs.
    kb_group_X has been sent to compatibility heaven. Please just use the number now; rather than the define.
    #TransparentColor has replaced #TranspColor in ConvPNG, however both will still work.

Changelog
Runer has done some awesome work with the toolchain lately; here is list of new and improved features from him:
    A new transparent sprite format that is faster and takes up less memory. Check out the gfx_rletsprite example for details.
    A delay(uint16_t milliseconds) function for delaying a specific interval of time
    Bug fixes with green lsb colors and clipping out of bounds issues.
    Random routines such as rand() and random() have been drastically improved, and are now about 4-5x faster than before.
    Optimizations applied to multiple different routines.


Adriweb has impressively created a whole autotesting interface for use with the toolchain, which will load the example programs into CEmu and completely automate the testing of them using Travis. This provides nice code coverage. Perhaps it should even get its own topic? In addition to fixes and updates to the Project Builder as well.

jacobly has been doing awesome work with the llvm infrastructure, in addition to a usb interface which has made great progress. He has also been a great source of help with routine optimization!

The main things I worked on were updates for convtile and convpng, in addition to minor fixes with the toolchain structures and cleanup of makefiles and toolchain bits. Here's a list of new convpng and convtile features:
    Can now export images and palettes directly to appvars, and load the graphics easily from within a C program
    Added #FixedIndexColor which supports fixed indexes for colors in a palette
    Support in convtile for compressed zx7 tilemaps for size minimization
    ConvPNG now supports the #OutputDirectory command, as well as relative and absolute file paths
    A cleaner readme for ease of implementation

There is a whole lot more changes as well; feel free to peruse the commit logs for the applicable things. Programs should in theory be better and run faster. Enjoy! Smile
If you struggle because you use Windows and your username has a space in it, the following hotfix may help you. In include\.makefile in your C SDK directory, find the line beginning comma := (that's line 21 for me), and directly after it, add the following:

Code:
CURDIR  := $(subst Firstname$(space)Lastname,Firstn~1,$(CURDIR))

If your username is "Mateo ConLechuga", for example, so your path to your home directory is "C:\Users\Mateo ConLechuga\", then you'd use the following:

Code:
CURDIR  := $(subst Mateo$(space)ConLechuga,Mateo~1,$(CURDIR))

Note that you use at most the first six letters of the first name, or fewer if your first name is fewer than six characters. If you have more than two space-separated words, you'd adjust the first argument to subst accordingly. Also, if you have the unusual case of multiple usernames that start with the same first six characters, the replacement part of the subst expression might be more like Mateo~2 or Mateo~3.

Apologies to MateoC, who will no doubt be angry that I'm not willing to plop the directory in C:\CEDev
A very nice method; however it doesn't hold if the path has more than one space. And technically the rule should be placed inside the windows rules but meh Razz Anywho, here's a solution that can handle multiple path spaces and you don't need to edit the makefile. Should be ready for the next release Smile

https://github.com/CE-Programming/toolchain/commit/22c112e079aa0183e282abbb5c6e225803c1f067#diff-177421e5401c34d3bd0fabc4cd2b2086R33
The toolchain has been updated to fix a weird bug with the makefiles; in addition to adding support for rotated and scaled sprites using gfx_RotateScaleSprite and other similar routines. Many thanks to tr1p1ea, he did pretty much all of the work. In addition he also improved the line routine quite a bit and now it is quite fast Smile Good for making 3D graphers now I must say Wink

Anywho, enjoy! Please update whenever you get a chance Razz

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

The next goal is to integrate jacobly's fasmg ez80 port and have it build the libraries in addition to linking user programs. This is one of the first steps in moving away from the current zds+spasm combination Smile With any luck, spasm, zds linker, zds assembler, and zds librarian will all be replaced by fasmg.
Would it be doable to allow gfx_PrintString and gfx_PrintStringXY functions respond to things like the /n and /t characters? Just an idea.
seanlego23 wrote:
Would it be doable to allow gfx_PrintString and gfx_PrintStringXY functions respond to things like the /n and /t characters? Just an idea.

There is an open issue for that: https://github.com/CE-Programming/toolchain/issues/77
Help Mateo I'm trying to dab on them haters but its not working



I apologize if this was already answered in one of the previous 14 pages of this thread, but why doesn't this work?
Stop using powershell.
Did you run the exe
Mateo, I am almost sure everything is installed properly. I didn't mess with the file location this time and used command prompt instead of powershell.

The CEDEV enviornment variable is incorrect still.


When I checked the environment variable, it matched with the location of the CEdev folder. I assume this is correct?
That looks fine - now look at the PATH variable and make sure it contains the bin folder of the CEdev path of yours. Add it (at the beginning) if it's not there.
Then close and re-open the command prompt and try make-ing an example again.


Does that look right? I'm sorry for all these short posts
Yeah that looks fine, although you should put the last line at the top, just to be sure.
Update: Interrupt handling functions and definitions are no longer safe for use with the toolchain due to revision I. A new release has been created to address this. Please download asap so you can resolve any potential issues. Thanks! Very Happy

https://github.com/CE-Programming/toolchain/releases/latest
Would it be possible to add a arc function to graphx?
I have wanted to use it in a program several times now.
At first I wanted to try to create my own based on gfx_Circle (which doesn't look like it could work because of symmetry), but I'm inexperienced with both assembly and graphics and failed to do so.
  
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 ... , 14, 15, 16  Next
» View previous topic :: View next topic  
Page 15 of 16
» 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