421
Community Contests / Re: CWick Contests
« on: September 24, 2015, 01:22:47 pm »
So for TI-BASIC, does this mean 140 bytes of tokens, or does something like "sin(" count as 4 chars?
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. 421
Community Contests / Re: CWick Contests« on: September 24, 2015, 01:22:47 pm »
So for TI-BASIC, does this mean 140 bytes of tokens, or does something like "sin(" count as 4 chars?
422
TI Z80 / Re: Pokémon Amber« on: September 22, 2015, 05:58:23 pm »
Yeah, maybe in like a million years when I get the motivation, I'll redo it from scratch again, but that was a lot of work to get where it was at.
423
TI Z80 / Re: Pokémon Amber« on: September 22, 2015, 05:28:53 pm »
Sadly, no. Everybody is always told to backup their projects and unfortunately, this as well as Grammer and Batlib were lost (among many others). Apparently when I did backup my projects, I only backed up shortcuts to my "Major Projects" folder. For Batlib and Grammer, I have some old versions still online, but I never uploaded the source or even a binary (that I am aware of) for Pokemon Amber.
424
TI Z80 / Re: Mandelbrot Set explorer« on: September 01, 2015, 12:17:59 pm »
Yup, it's in assembly Even then, rendering a 64x64 screen takes a long time I have some ideas for improving the speed, but it won't save much without a different algorithm altogether.
425
TI Z80 / Mandelbrot Set explorer« on: September 01, 2015, 09:00:55 am »
I had no internet for a few days, but at the same time I had a day off from work, so I made a Mandelbrot Set explorer! It uses 4.12 fixed point arithmetic. Here is a gif of it in action, and attached are stills of some deeper zooms.
I also made my own 4x4 mini font! 426
Escheron: Twilight over Ragnoth / Re: "Escheron: Twilight over Ragnoth" — progress updates and discussion« on: August 10, 2015, 08:43:33 am »
Oh, the coords are 8-bit? Mine might not work for that in some situations.So did my code work? It seemed to scroll pretty smoothly and accurately.
427
TI Z80 / Re: CatElem - Catalog Reader« on: August 06, 2015, 10:51:09 am »
I updated the first post. Now it is just one program that sets up itself. It correctly obtains the start of the catalog table as well as the size (tested on multiple OSes from 1.03 to 2.55MP).
After setup is complete, it shrinks down from 322 bytes to 149 bytes, having only the essential code. 428
TI Z80 / Re: Tok2Char« on: August 06, 2015, 08:35:44 am »
Oh, maybe, I never thought of that. I did just check with setting the French language app and the tokens were correctly converted (so you get "non(" instead of "not(" ).
429
TI Z80 / Re: CatElem - Catalog Reader« on: August 06, 2015, 08:25:26 am »
Probably, but isn't that basically what "Input " does? Also, I want to make a note that the program does appear to work on other models and OSes, but it does not return the correct number of catalog elements. I have an idea for how to fix that
430
This is a work-in-progress, but the intent is for it to convert a token into it's individual chars. It first converts the token to ASCII (this is easy; the OS provides a call), then the hard part is converting the ASCII to individual tokens. Uppercase is easy, and I also added conversion for lowercase chars, space, and "(" so that should get most tokens. However, something like tan-1( will not properly convert the -1.
431
TI Z80 / Re: CatElem - Catalog Reader« on: August 06, 2015, 08:17:41 am »
Yup ^~^ It might be useful if you need to give the user a list of tokens, I dunno. It was still a pain to program
432
TI Z80 / CatElem - Catalog Reader« on: August 05, 2015, 10:10:09 am »
There was a request on Cemetech that I took interest in, and this is my work so far. You basically pass a number into the program, and it returns the nth catalog element. So 1:Asm(prgmCATELEM would return "abs(" as an example. If you pass 0 into it, it returns how many catalog elements there are.
Before you can use prgmCATELEM for it's intended purpose, you must run it once, and it will set itself up for your specific OS. Suggestion: If you are going to use prgmCATELEM in a program that you want to release into the wild, provide a fresh prgmCATELEM, not the version on your calculator. Further, you should run it once at the start of your program to install, just in case the user of your program didn't run the installation step. There are definitely issues with how prgmCESETUP searches for the catalog table. It assumes that the catalog will not have its first 4 bytes split on two pages and it assumes that catalog starts with "abs(" and then " and ". It also assumes that the catalog end is on the same page and ends with "?". 433
Escheron: Twilight over Ragnoth / Re: "Escheron: Twilight over Ragnoth" — progress updates and discussion« on: August 05, 2015, 07:47:56 am »
Okay, I have a few ideas for modifying this, and I'll try to figure out if I can optimize it further.
The only case where the algorithm does nothing is when it has reached the end of the line, otherwise it *always* does something. Proof: When (x1,y1) != (x2,y2), then we have 2 case: bit 7 of HL is 0 or it is 1. Case 1: It is 0. Then the first step of incrementing x1 is carried through (since x1 != x2) Case 2: It is 1. Then the second step of incrementing y1 is carried through (since y1 != y2) So basically, if you check bit 7 and it is 1, skip the X step and go straight into the Y step. You only need to check bit 7 for the Y step if you did the X step, and in that case, you can directly use the sign flag from the sbc hl,de... which by the way you can just negate the deltax value during the setup phase and use an add hl,de. I also noticed the B register was unused, so instead of using flags, I just set b=1 in the beginning, then inc b instead of setting the flag. At the end, check if b is still 1, in which case nothing was updated, so the algorithm is done. Here is how I modified it: Code: [Select] ld b,1 ;use this to check if we bresenhammed So question: What is the range of values for the coordinates? Are they 0~127 ? (It seems like it based on the code). EDIT: Here, this code might work. First routine is setup, second routine is the iteration. Code: [Select] br_setup: EDIT: There was an error in my latter code that should be ld (_cam_acc),hl as opposed to ld hl,(_cam_acc). The algo would still work, but this makes it work better.
434
ASM / Re: ASM Optimized routines« on: August 04, 2015, 10:52:59 am »
I decided to see if I could make a faster routine than what Runer made that did the same stuff and I came up with the following code. Mine is 3 bytes larger and on average almost twice as fast (ranging from 120cc to 525cc, and one case of 59cc). It has output in HL and returns a DataType error for inputs that are not non-negative reals, and a Domain error if the input exceeds a 16-bit unsigned integer.
One other advantage that mine has is that you can convert a float pointed to by DE, so you aren't limited to just OP1. Code: [Select] ConvOP1: If you do not want to throw errors and are comfortable returning garbage results:Code: [Select] ConvOP1: EDIT: I do not have time right now, but I found some really significant speed improvements while I was at work yesterday. Gotta take a kitten to the vet, but later I'll post the update ^~^ Here, this one is a bit faster, a little larger, and has the same outputs (DE,A) as the OS routine, but with modified error handling (no negative or non-real inputs, max input is 65535 instead of 9999). Code: [Select] ConvOP1:
435
ASM / Re: ASM Optimized routines« on: August 03, 2015, 10:54:32 am »
Related to the previous post, I offer several alternatives to the bcalls _SetXXOP1 and _SetXXOP2. These routines are for converting 8-bit integers to TI floats. The advantages with my routines are that they are faster, you don't need to truncate to only the bottom 2 digits, and you can store the output to any location instead of just OP1 or OP2.
So first, if you still want the output to be the same: Code: [Select] setXXOP2: And if you want to get all 3 digits:Code: [Select] setXXXOP1: And if you want to do that, but maybe a little faster:Code: [Select] setXXX: And if you want to convert signed 8-bit ints:Code: [Select] setXXX_signed: The slowest routine here has a worst case of 499cc and slowest average case is 436cc. |
|