This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Topics - TC01
16
« on: August 13, 2010, 03:58:53 pm »
I have two *.89t files and one *.89p files that are part of my project. The *.89p (my unfinished custom toolbar) is not so important at the moment, but the text files are- one is a demo and the other contains all of my tokens.
Is there any way I can convert *.89t files to *.v2t and *.9xt files? Is the file format the same, so I could just copy and rename the files? Or would I need to do some hex editing?
17
« on: August 03, 2010, 10:53:04 pm »
My TI-89 Titanium came preloaded with language localization apps- German, French, and Spanish. I assume all Titaniums do. I don't speak either of these languages (I'm a native English speaker), and since combined they take up a reasonably large amount of space, I decided to delete them to give me more memory. I deleted the German app- and found my calculator was locked up. I did a RAM reset (using ON+2ND+LEFT+RIGHT) reinstalled KerNO, and used Stefan Heule's backup utility to restore my settings, and now the calculator appears to work fine. My question is this: is my calculator unstable now without it? Can I do the same for the other language localization apps? I can deal with the crashes easily enough, but if what I'm doing is leaving my Titanium unstable, I'll send the German app back to my calc.
18
« on: August 03, 2010, 07:45:23 pm »
A note- this is 68k C (GCC4TI), not Nspire C. Shouldn't really be a difference except for the nature of my error... I've mostly finished making z89 (that's my z80 Basic editor for 68k calcs) read in the list of tokens from a token file, then build them into an array of tokenInfo structures. The code to do this is rather complicated and probably poorly written- I'm not the best C programmer. I only started programming in C recently. However, it works. Or, at least, it would work if not for the Address Error I get when I try to free allocated memory at the end of the process. I have four pointers to strings being dynamically allocated- the text of the token file, a "working" string (for storing end-of-line characters and other things necessary in procedures like strcpsn()), a line string (for storing each line of the text file), and a "tokenstr" string, for storing token information (first the name, then the first token in hex). I had had problems with this before. Specifically, originally I was using realloc() to shrink and decrease the line string on each pass through the while loop. But that was causing an Address Error. I "solved" it by allocating enough memory to store the entire file to the line string- I'm not entirely sure why that solved the problem, though. The GCC4TI docs offer the definition of an address error below, but I'm not sure how trying to free the pointers would cause that. Q: What kind of error in my program usually causes an "Address Error"?
A: Well, writing over the boundaries of an array can usually cause all sorts of errors, since it usually destroys code or the return address of the function. However, an "Address Error" actually means that a short or long value is read or written at an odd address. So if you get an "Address Error" while you are dealing with pointers, check that you do not cast an odd address to a pointer to a short or long integer.
Here is my long and probably over-complex initTokens() function, which is where the array of token infos is built. It assumes the text file is formatted as follows (name\byte1\byte2, with byte2=0 if the token is one byte): :BoxPlot\0x05\0 :ClrHome\0xE1\0 void initTokens(tokenInfo *tokens, char *tokenfile) { int length; int bool; int newlength; int span = 0; int i = 0; char newchar; char endline = '\r'; unsigned long rawhex; unsigned short size = 0; unsigned char hex = '0';
char *tokentext = NULL; char *working = NULL; char *line = NULL; char *tokenstr = NULL;
tokenInfo token; SYM_ENTRY *sym; if ((working = (char *)calloc(2, sizeof(char))) == NULL) { DlgMessage("DMA Failure", "Unable to allocate space for working string", BT_OK, BT_NONE); return; } if ((line = (char *)calloc(10, sizeof(char))) == NULL) { DlgMessage("DMA Failure", "Unable to allocate space for line string", BT_OK, BT_NONE); free(working); return; } if ((tokenstr = (char *)calloc(16, sizeof(char))) == NULL) { DlgMessage("DMA Failure", "Unable to allocate space for token working string", BT_OK, BT_NONE); free(working); free(line); return; } //Get the size of the token file and allocate memory accordingly sym = SymFindPtr(SYMSTR(tokenfile), 0); size = ((MULTI_EXPR*)HeapDeref(sym->handle))->Size + 2; if ((tokentext = (char *)calloc(size, sizeof(char))) == NULL) { DlgMessage("DMA Failure", "Unable to allocate space for token file string", BT_OK, BT_NONE); free(working); free(line); free(tokenstr); return; } //Get input from file, set length and reallocate memory to troublesome pointers bool = getPrgmFromText(tokenfile, tokentext, size); if (bool == 0) { free(tokentext); free(working); free(line); return; } length = strlen(tokentext); line = (char *)realloc(line, (length + 2) * sizeof(char)); tokenstr = (char *)realloc(tokenstr, (length + 2) * sizeof(char));
//Loop until the length of the input string is zero while (length > 0) { //Maintain num token size! i += 1; if (i > NUM_TOKENS) { tokens = (tokenInfo *)realloc(tokens, i * sizeof(tokenInfo)); NUM_TOKENS = i; }
//Get the length of the line up to trailing character, reallocate memory memset(working, '\0', strlen(working)); memset(line, '\0', strlen(line)); memset(tokenstr, '\0', strlen(tokenstr)); sprintf(working, "%c", endline); span = strcspn(tokentext, working); //Load the line into a string, and then remove it line = strncat(line, tokentext, span); tokentext = strpbrk(tokentext, working); //Then clear out the \r at the front of the string and clear the working string out newchar = tokentext[2]; sprintf(working, "%c", newchar); tokentext = strpbrk(tokentext, working); length = strlen(tokentext); //Init the token token = tokens[i]; token.twoByteToken = 0;
//Seperate the name component from the line and set it (and it's length!) memset(working, '\0', strlen(working)); sprintf(working, "%c", '\\'); newlength = strcspn(line, working); tokenstr = strncat(tokenstr, line, newlength); line += (newlength + 1); token.chars = newlength; token.name = tokenstr; //Seperate the hex component from the line and set it memset(tokenstr, '\0', strlen(tokenstr)); tokenstr = strncat(tokenstr, line, 4); rawhex = strtol(tokenstr, NULL, 0); hex = (unsigned char)rawhex; token.hex[0] = hex; line += 5;
//Then check if what's left of the string is the second byte of a two-byte token and deal with it if (line[0] != '0') { rawhex = strtol(tokenstr, NULL, 0); ngetchx(); hex = (unsigned char)rawhex; token.hex[1] = hex; token.twoByteToken = 1; }
//Update the token tokens[i] = token; } //Free memory free(working); free(tokenstr); free(line); free(tokentext); }
19
« on: July 31, 2010, 11:31:41 am »
I was wondering if there was anyone else on Omnimaga who has ever made mods for games?
I've modded Civilization 4- a great game mainly because of how moddable it is. The developer, Firaxis, released the source code for the game's DLL, which allows modders to change mostly everything save what's hardcoded in the EXE (the graphics engine and a few other things), and provided Python as a built-in scripting language.
I know there was an older thread about this but that was about games with impressive maps/mods, not people who make them.
Oh, and I'm not really sure if this goes in the Computer development forum or this one, but since the previous topic about modding was here I thought I'd post it here.
20
« on: July 23, 2010, 01:02:55 pm »
UPDATE: Beta v0.2 has been released, and can be downloaded here (from the Cemetech Archives). So I thought I might as well announce my first serious calculator project, even though it's probably of little use to anyone other than myself or in my current situation, though. This project (which I have not yet named) is a suite of 68k programs and computer programs to allow someone to write a program in Z80 Basic (83+/84+) on a TI-89 (or other 68k calculator), using the text editor. The program is then tokenized on the calculator, and then can be sent to a computer to be converted to an 8xp file. This is not an interpreter for Z80 Basic for 68k calcs, nor is it an emulator or a debugger- you cannot actually run the programs on the 68k calculator. Why? Well, you might remember that my link port broke on my old TI-83 Plus, and I haven't yet gotten a new Z80 calculator. So for the time being, I'm limited to WabbitEmu or my Titanium, and while I can still write assembly programs and test them with WabbitEmu, I'd much rather write Basic programs (both Axe and regular Basic) on an actual calculator. And true, the 89's keyboard is just different enough from the 83+'s to make entering text annoying, but it's better than nothing. And while chronomex (Duncan Smith of ticalc.org) is working on a Z80 emulator at the moment, by the time it's finished I might actually have an 84+. And since I'm learning C and needed to work on something that actually did something, I decided to work on it. This will probably be obsolete when Duncan Smith's emulator comes out- indeed, as I said, it might be obsolete before then, as I don't know how many people would actually need something like this. So that's why. Now, as for the how: There will be three different programs involved (technically, four depending on how you count). One, a 68k Basic program (that I have named token8x), installs a custom toolbar with all the 83+ (and 84+, when I look them up) tokens. This can then be activated by pressing 2ND - HOME on a 89, and accessed from anywhere on the calc, including the Text Editor. This is mostly finished. Using this, you would write programs in the Text Editor, save them as a text file, and then use a 68k C program to tokenize the text file into an application variable with the tokens in hex format. This is mostly finished in that it works, but there is other stuff I'd like to add in the future. Then, the appvar can be sent to a computer, where you would use a suite of Python programs to extract the tokens and save them in 8xp format. This is probably complete (short of supporting other calculators) Here are some screenshots, of the dialog menu and of the custom toolbar. All screenshots are from TiEmu, nothing has actually been done on calc... and as you might be able to tell from the name of the program, all it does is "ClrHome".
21
« on: July 19, 2010, 05:52:26 pm »
The first 68k C question in this subforum! (the flash apps one I posted was in the Other Calculator Help and Support forum)
Anyway, I'm having a little trouble understanding some of the string manipulation functions in GCC4TI (string.h). It's probably because of the way strings are treated in C (as arrays) which isn't really what I'm used to, being a programmer in higher level languages (Python and VB). Also because I haven't really used pointers before in programming.
Specifically, I want to read a text file (*.89t) and split it line by line, then do operations on each line. I've gotten my program to a point where it uses a dialog box to get the name of the text file, opens and reads it, and then prints the text to the screen (this last bit is just for debugging). It's the "splitting line-by-line" that's causing me problems.
I've realized that the text files use "\r" as newline characters (at least, I think they do) and so I thought to use strscn() to get the length of the string up until the "line", then use strcpy() to copy the line into another string and strpbrk() to create a substring without the first line.
The first problem is that if you type "\", GCC4TI ignores the closing quotation mark, assuming another character is coming after it. I've had to use "\r"- but the problem of this is that if the line has "r" in it, strscn() would stop early (because it's characters from the second string, not the second string as a whole). Is there any way to solve this? Or am I wrong and, in fact, it would only stop when it found both "\" and "r"?
Then, the second problem is that I'm unsure what exactly strpbrk() does. The docs say it "returns a pointer to the first occurrence of any of the characters in s2"- is this just a pointer to that one character, or a pointer to everything from that character to the end of the string?
22
« on: July 16, 2010, 12:58:36 pm »
Is there any way to write flash apps for the 68k calcs anymore, without using TI's Flash Studio? Because Microsoft's JVM is no longer available on their site, which is required for it to run.
TIGCC/GCC4TI doesn't support flash apps- are there no third-party programs that let you do this?
I'd have put this in either the ASM or C forums, but I'm not sure what language apps on 68k calcs are written in.
23
« on: July 02, 2010, 03:07:59 pm »
Just today, I discovered that my calculator (my 83+; I also have a Titanium) can't link to my computer anymore. I had cleared my calculator of most programs on it, save for a Basic program (hooked to Startup, to print my name and contact info to the screen), a BBC Basic program (didn't do much, I just wrote it to experiment with BBC Basic) and an Assembly game (Pong Z80, which was the last program I sent to my calculator). Then, when I went to load some more games, I found that TI Connect couldn't pick up my calculator anymore, when I went to send additional games to my calculator. I assumed that the error was TI Connect's, and so I uninstalled and reinstalled it. That didn't fix the problem, so I then went to my Windows XP laptop- my desktop has Windows 7 64-bit- and tried the installation of TI Connect there. That didn't work, so I uninstalled TI Connect from my laptop and installed TiLP. But TiLP also didn't pick up my calculator. (It did pick up my Titanium, though, so I know I'm using it correctly). At this point, I had the problen narrowed down to two things- my cable (a SilverLink) or my calculator itself. I can't test the calculator-to-calculator link, because I've lost my 83+ cable and in any event, I don't have X-Link installed (to communicate with my Titanium, but I could test the cable) by plugging it into my Titanium's serial port. TI Connect was able to pick up my Titanium using the SilverLink. A search of the UTI, Cemetech, and Omnimaga tech support forums brought up this on Cemetech. Someone had a similar problem, and it turned out to be a hardware problem- the soldering on the link port failed. That could very well be possible, as my calculator is pretty old (hardware revision A, if I'm reading the serial number correctly). However, I'd like to be sure before I take my calculator apart and solder my link port: is it possible there's some software corruption instead? Could it be some part of the OS, or possibly even the certificate, is messed up? I've done RAM clears- both from the Memory menu on the calculator and by pulling out a battery- so I don't think it could be some part of RAM that's been corrupted. I do have CalcSys installed if there's some test I can do using it. I also can run any assembly program by loading it into WabbitEmu, unprotecting it, and copying the program token by token into my 83+... not that I want to do that, but if there's some assembly program I could use to test, or fix things, I could run it. Oh, and apart from the link port, the calculator is fine. I haven't noticed any other errors, which is why I think it might only be a hardware problem... I just want to be sure.
24
« on: July 01, 2010, 12:39:57 pm »
Hi!
I first learned to program my old TI-83 Plus last year (in Basic), and since then I've become more interested in calculator programming, leading to me getting a TI-89 Titanium, fooling around with assembly for the 83+, and, by a sort-of direct path, joining this site (even though I discovered it two months ago).
I have some knowledge of Z80 assembly, but it's very sparse at the moment, as is my knowledge of C for the Titanium, something I started learning only recently.
I also can do computer programming, in Visual Basic .NET and in Python.
|