Show Posts

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 - Runer112

Pages: 1 2 [3] 4
31
Correlation / TI Float to String Routine
« on: April 10, 2011, 11:01:27 am »
I've been waiting for you to show up in IRC since Friday so I could give you this routine, but since I haven't seen you yet there, here it is! It returns strings like the OS would when displaying numbers on the home screen with the Float setting. It perfectly mimics the OS routine for every reasonable input I've tried, even when using hacked float variables that have exponents above 99. The only thing it doesn't perfectly mimic is hacked floats that contain invalid hexadecimal characters. But that shouldn't happen too often.

Anyway, you said you wanted this for speed. Good news! The OS routine appears to take an average of about 5500 cycles in my tests, whereas my routine takes an average of about 1600 cycles. It'll cost you 244 bytes, but the choice is yours.

And anyone besides Hot_Dog, feel free to grab this routine as well. Note though, that because I made this routine to Hot_Dog's specifications, it has a few weird quirks. The location of the string returned has to be a constant, but you can change that. Right now it's set to OP4. You'll also probably want to get rid of the ld (hl),20 \ inc l at the start of the routine, another weird quirk Hot_Dog said he needed. Also, note that the string returned is a null-terminated string of tokens, not characters. You should be able to change this though by simply changing all the token values in the routine to ASCII values.

32
The Axe Parser Project / [Axiom] LCDKit
« on: March 28, 2011, 12:29:41 am »
For the past week or so, I worked on an Axiom that includes a lot of commands for interfacing with the LCD driver. I think I've finished adding just about everything I wanted to and hopefully it has no bugs, so I'll release it. Here are its features:

  • Turn the LCD on or off    ? This one's cool
  • Get the on/off status of the LCD
  • Set the contrast (I just realized as I'm writing this that Axe could already do this, but this command is safer)
  • Get the contrast set by the OS (useful for setting the screen contrast back to normal)    ? Pretty useful
  • Set the screen's z-address (internally shifts the rows of the screen up/down)    ? This one's really cool
  • Apply screen flipping effects (on newer calculators with compatible drivers)
  • Read and write individual bytes/words to and from LCD memory
  • Copy a stream of bytes to or from LCD memory


That's a lot of information to throw at you about what it can do. To give you some ideas of how you could use some of these commands, here would be some useful applications of this Axiom:

  • Turn the screen off for a teacher key or to save power in a waiting state
  • Make contrast effects based around the active (OS-defined) contrast value and then return the contrast to the proper value when done
  • Use z-addressing to apply an earthquake effect without having to worry about shifting the buffer image (or make crazy tunnel games)


Anyway, without further ado I will attach a zip file containing the LCDKit Axiom, its source code (sorry if it's tabbed oddly, I designed it in wabbitcode), a readme, and a command list. The Axiom appvar is fairly small for a library with 31 routines, weighing in at 651 bytes. Note that Axe will NOT add the whole thing to your program, only the routines that you actually use, so don't worry about any unnecessary code bloating.



Changelog
  • 1.0.1 (Mar 28 2011):   Fixed a bug that slipped by, breaking the ?imag() commands
  • 1.0.0 (Mar 28 2011):   Initial release


MAKE SURE YOU DOWNLOAD THE LATEST VERSION, CURRENTLY: LCDKit_1.0.1.zip

33
The Axe Parser Project / Credit
« on: March 18, 2011, 02:32:15 am »
Hi. I don't think this has ever been properly addressed, so I would like to formally address the matter of crediting others when it comes to programming works. Although everything that follows is only my opinion and you do not need to agree with it, I would like to state it. Feel free to post responses agreeing or disagreeing with me. The first paragraph will deal with what I would deem to be general etiquette. The second paragraph will be focused on Axe.

When making a project, you may often turn to others for help. Whether it's requesting sprites, using a routine somebody created, or simply letting someone optimize some parts of it, I feel that it is courteous to recognize their help in some form. In some cases, like in the case of minor code changes or optimizations by another person, a simple thank you would suffice for their aid. If you want, you can give them a small credit in the readme for your finished program. Or if you learned some stuff about coding from a help post somebody made, you may want to shoot them a quick thanks for the guidance, but it isn't necessary to cite small amounts general programming help. But I believe that if someone contributed specific help that your game relies on, like sprites or an important routine, it is fitting to cite who contributed that important part of your finished product. No need to put their name in your program's splash screen, or necessarily in the program at all. But a thanks at the bottom of a readme, no matter how small, can mean a lot. It means the efforts this person made to help you were really helpful after all. It means the time they put aside to help, no matter how much, was time spent well and worth spending again to help others.

When it comes to Axe projects, in a lot of cases the programmer will release the Axe source with their finished work. Sometimes he or she will say that their project is an Axe project but will want to keep the source protected, which is completely fine. But what can irk me a bit is seeing programmers produce something with Axe and fail to report is as being an Axe project. On one hand, I find it a little unsettling that it isn't mentioned, possibly as if they want others to think that they wrote it in assembly. But a possible slight deception is not what I find most unsettling. What I find unsettling is that failing to recognize it as an Axe project means failing to recognize perhaps the most important part of your project's existence: Kevin Horowitz. As I stated earlier, I believe it is proper to give credit in a final product to someone who may have provided you with some graphics or some code. But what about Quigibo? He provided every routine your program uses. He provided bug fixes for problems you might have run into. He provided a documentation and command information which likely taught you a lot of the concepts and commands you know. And most importantly, he provided his time. More than a year of it, so your program could exist. And I think the least any one of us can do to repay that is give a few seconds of thanks and recognition in return.


~~~

I can never focus on one project at once and have thus never really finished and published any projects, or the readmes to go along with them. I have never had the chance to give thanks in any published projects. But I have still programmed in Axe and enjoyed it for countless hours. So I would like to be the first to officially say:

Kevin Horowitz, thank you for the work you have done. Your helpfulness and commitment to Axe have known no bounds, and neither do my thanks to you.

34
Computer Programming / Command Line GIMP Batch Operations?
« on: March 04, 2011, 12:23:48 am »
I have been tearing my hair out trying to get this to work. No matter how many different things I try, I cannot figure out how to run a simple command line GIMP script. I keep getting errors like the following:
Code: [Select]
GIMP-Error: Opening 'c:\Program Files (x86)\GIMP-2.0\bin\0)'' failed: No such file or directory
It seems that any arguments I enter, it tries to parse them as files in GIMP's \bin\ directory. I've tried using the exact examples used in GIMP's batch mode tutorial, but they have the same problem. Any ideas?


In case this information will help:
  • GIMP 2.6.10
  • Windows 7 x64

35
TI Z80 / TI Program Editor: hAxe'd
« on: February 20, 2011, 06:44:30 am »

TL;DR: 2 modified .xml files for TI's Program Editor to convert it from a TI-BASIC into an Axe program editor.



I like programming for calculators on the computer for a few reasons. You have a much larger space to work with, things like copy, paste, undo, redo, etc. Also, your programs are always safe on your computer if your calculator crashes.

A lot of my calculator programming is done in Axe. Because the Axe language is based on TI-BASIC tokens and programs, I write and edit my programs with the TI-BASIC program editor called "TI Program Editor" bundled with TI-CONNECT. Unfortunately, TI decided to remove the only useful program to me from the TI-CONNECT suite, so you can't download it from TI anymore. You may or may not be able to find a download link in the description of a video from a YouTube search, though...

Anyway, I write Axe programs with this software that was intended for editing TI-BASIC programs. Because of this, it obviously lacks things like Axe token replacements and such. Even worse, it doesn't properly support some tokens like lowercase letters, making some programs impossible to open and others annoying to edit. And although it has a nice catalog of commands and calculator tokens to select from, it can be tedious to navigate it and find the Axe commands you want. Anyways, it looks like this:




It definitely has some nice features for TI-BASIC program editing:
  • Tabbed file management
  • Easily edit program details like the name it will be on a calculator or lock status
  • The usual text editing features like cut, copy, paste
  • A font specifically designed to mimic the font on the TI calculators and display special characters very nicely
  • A categorized catalog of special symbols and all the functions you would find on your normal calculator, often sorted by an identical menu system
  • Token hotkeys, useful for quickly entering common tokens you can't type on a keyboard

For an Axe programmer, a lot of those features are just as nice as for a TI-BASIC programmer. But the fact that it wasn't designed for Axe programming, chokes on some lowercase letters, and has a few other quirks sometimes made it difficult for me to write Axe programs on it. I could have decided to write my own Axe IDE, but I'm lazy. So I decided to just modify TI's already existing and pretty well-developed program editor. The same program you saw above with two modified source files suddenly becomes so much more Axe friendly:




Every token that displays differently in Axe has been changed to its Axe equivalent, so no more needing to look up which rotate command Shade_t() was! Commands actually make sense! And you can now simply type something like Copy( and not wonder why you get a compile error at the "o". Additionally, although the old catalog of tokens and TI-BASIC commands remains in a section called "Normal" in the command chooser, a whole new section exists just for Axe! In this section are tokens for every symbol, variable, and constant used in Axe, followed by tokens for every Axe command. And if you're familiar with the Commands.htm file included in Axe releases, it should be a piece of cake to navigate the commands because they're sorted in the same exact order. I just finished this myself so haven't been able to fully try programming with it, but I'm sure it will be a lot nicer programming in Axe with it now than without it.



If you have TI's Program Editor and want to test this out, I have attached a zip file containing the two modified xml files that constitute this modification. To hAxe the program, simply find the directory it exists in and replace "83PlusDictionary.xml" and "TI-83 PlusFunctionTree.tree" with the modified versions in the zip file. It may be a good idea to back up the originals first, though.

And once you've tested it out, tell me how it is!

36
Axe / Documentation of the Speed and Size of (Almost) Every Axe Command
« on: January 10, 2011, 01:09:23 pm »
TL;DR : An Axe command list with size, speed, and notes for Axe commands. Good for optimizing.



I'd say I'm fairly decent at optimizing Axe programs. This stems partially from my good amount of experience with Axe. After having used Axe for a long time, I know all of the commands and options available, so when trying to make code to do something, I can usually think of many different ways to do it. Knowing offhand the sizes of a decent number of commands helps me eliminate a large number of these options, and between what's left, I often just try each option one by one, compiling the program with each option and seeing which is the smallest.

What helps even more to optimize my code is my experience with z80 assembly. When thinking about the smallest or fastest way to do something, I could think of the assembly code that Axe commands break down into and actually count bytes and cycles for a very exact comparison.

The Auto Opts.txt file included in Axe releases helped me learn a lot, but it only lists the sizes of what its name would suggest, the automatic optimizations. And although those often help to produce the smallest sizes, what about speed? And what about commands that aren't listed there? I often had to resort to methods like I talked about above, such as brute force testing all the options or trying to step through the assembly in my head. But those can be difficult and time consuming, even for someone with a lot of experience.

So I decided to make a list, detailing some specifications about every Axe command. This means basic loading and saving, auto optimizations, math routines, graphic routines, everything. For every command, I listed the command's size and equivalent Axe code. With this file, you could determine the exact size of anything you can do in Axe. It also lists the exact or approximate time that most commands take, so you can optimize for speed as well, something which is much harder to determine than size without examining the underlying machine code for every command. But I did just this, so others who are able to don't have to spend the lengthy amount of time doing so, and so others who aren't able to don't have to be able to.

I am missing the speed of some commands, as the remaining ones are some of the more challenging ones to test. I hope to test all of these eventually, but for now I'll release what I have. But for the commands that do have speed documented, you can learn some interesting things. Like how Pt-Off() is faster than Pt-On() and Pt-Change() for drawing aligned sprites (x and y are multiples of 8), but slower for unaligned sprites. Or how, on my calculator's hardware at least, DispGraphr is actually faster than DispGraph.


Anyways, without further ado, I'll attach the file. I highly suggest viewing it in a text editor like Notepad. Without a monospaced font and an 8-character tab width, it won't look pretty. I'll try to keep it up to date and modify it as new versions of Axe come out so you can always have a copy you can know is accurate for the current version.


Tip: To search for a specific command, try using your text file viewer's find feature to search for the Axe source code equivalent.





If you see any errors or have any questions or suggestions, just post them here.

Current version: 0.5.3b


37
ASM / [z80] 16-bit * 16-bit = 32-bit Signed Multiplication
« on: December 17, 2010, 04:59:42 pm »
This is a somewhat challenging routine I've been trying to develop for z80 assembly. I'm trying to find a way to multiply two signed 16-bit operands together and get a signed 32-bit result.

I already have one working method, although it's fairly hacky. Its general structure is as follows:
  • Xor the high bytes of the two operands and push af
  • Convert the operands into their absolute values
  • Multiply these two values with the normal restoring multiplication algorithm
  • Pop af and return if sign flag is unset
  • Negate the result of the multiplication and return

Somehow, I get the feeling there are faster and/or more elegant solutions than this.

The most elegant solution would just be a modified restoring multiplication algorithm that deals with signed numbers correctly. After having stared down the restoring multiplication algorithm for about the past hour, I don't know how reasonable this is, though. And unless there's some simple change I'm not seeing that would suddenly make this work, any solution of this form would probably consume a lot of extra cycles in each iteration.

Something that has occurred to me as a more achievable and probably faster solution, albeit larger, consists of a test that branches into one of three different versions of the restoring multiplication algorithm. Which algorithm to use would be determined based on whether neither, one, or both of the operands are negative. This is the method I am currently trying to develop. After a bit of messing around with the restoring multiplication algorithm, though, I'm still fairly confused about how to form the two modified algorithms that would be needed.


Any ideas?

38
Humour and Jokes / YAYA (Yet Another Yet Another)
« on: December 15, 2010, 07:18:59 pm »
Everybody be copyin' mah subject! :hyper:


39
TI Z80 / YAAR (Yet Another Assembly/Axe Raycaster)
« on: December 11, 2010, 09:31:05 pm »
I had started work on an Axe raycaster a while ago, but forgot about it. However, squidgetx's raycaster reminded me that I had one too, so I went back to work on it. Anyways, it works pretty nicely, although somewhat slowly , and I have different versions with different features. It's pure Axe though, which is pretty awesome. ;D I run all my versions of it at 15MHz.

Unless you want me to go into the technical details, I won't, because that stuff is pretty ugly. But screenshots are cool!

Most of what I need to do now is try to make it faster, because these are all using the full 15MHz and it would be nice to save some processing power for other things!


EDIT: Attached a zip file containing the source code and compiled executables for all four versions.

40
TI Z80 / Sprite Editor Feature Requests
« on: November 27, 2010, 10:07:44 pm »
As some may have learned from a poll I posted a while ago, I've been working on a sprite editor in Axe. Or at least I was working on it, but put it down for a while to work on other stuff. But I want to come back to it, and I want to make sure it's as feature-packed and awesome as it can be. So before I get back to work on it, I'd like to know: What features would you want to see in the on-calc sprite editor of your dreams? Did I miss any useful editing tools? Did I miss a file operations feature? Request any features that you don't already see in the list below, or tell me about features already in the list below that you would especially like to see implemented.

Potential features (some are obviously more fundamental than others and will definitely be implemented, whereas others would probably be ridiculously complex to implement):
  • Black and white, 3-level gray, and 4-level gray sprites
  • Masked sprites
  • Sprites of any size
  • Viewing and editing at any zoom level, including zoom levels that don't fully fit on the screen (scrolling will be necessary)
  • Point tool
  • Line tool
  • Box tool
  • Circle tool
  • Variable pen size for drawing commands
  • Fill tool
  • Text tool
  • Hex editing
  • Area selection, transforming, cut, copy, and paste
  • Palette transformations (e.g. changing the color of all dark gray pixels to light gray and all light gray pixels to dark gray)
  • Sprite transformations (flip, rotate, shift)
  • Sprite conversion/attribute editing (e.g. changing size, changing gray level)
  • Tilemaps
  • Animations
  • A full filesystem (files, folders, shortcuts, etc. with names and attributes)
  • A file explorer
  • A menu system
  • Shortcut keys for most menu items
  • Search
  • File sorting in folders by various attributes
  • Importing data from and exporting data to pictures, strings, and Ans
  • Undo/redo
  • File selecting, moving, copying, and deleting from the file explorer
  • Batch sprite transformations

41
ASM / A GetKey that doesn't wait?
« on: November 01, 2010, 11:43:36 pm »
Is there such a thing? I know there are things like GetCSC and direct port input, but I'm wondering if GetKey has a non-waiting equivalent that also uses the A/keyExtend output format.

42
General Calculator Help / TI-83/84 Plus series - Amount of free RAM?
« on: October 23, 2010, 10:49:33 pm »
I may be mistaken, but is there not a byte pair in RAM in which the OS keeps the amount of free RAM? If there is, where in RAM is this located, and how often is this value updated? If not, I'll just use MemChk, but this seems easier.

43
General Calculator Help / Which color palette is better?
« on: October 06, 2010, 10:02:27 pm »
A bunch of people have been pestering me about the dysfunctionality of an old sprite editor of mine, so I'm working on it again. I plan to support masked 3-color (black, gray, and white) grayscale sprites, and I want the user to be able to see transparency. To do this I'm going to display the sprite in 4-color grayscale, with transparent being represented as one shade of gray and actual gray being the other shade. The question is, which method looks better: transparency being represented as light gray (left) or dark gray (right)? I'm torn because, to me, the option on the left better portrays the sprite being over a transparent layer, but in the option on the right, the sprite itself simply looks better.



Another image (also, sneak peak at the epicness that will be the new sprite editor - note the full filesystem - no, it's not just a mock-up):


Another, with non-Zelda sprites:



44
The Axe Parser Project / Axioms?
« on: October 06, 2010, 05:06:45 am »
I'm not quite sure where to post this, in here or in the ASM forum... but although Quigibo disabled axioms in 0.4.5, I decided to write one anyways ;) It's an 8x8, aligned, grayscale sprite routine that can write to arbitrary buffers! And at 15MHz it could draw OVER 9000 GRAYSCALE SPRITES PER SECOND!!! That is, if it worked... Running it as part of a program compiled with version 0.4.4 freezes my calculator (The axiom did partially work ONCE without crashing my calculator though, the first time I tried it). I'm not sure if the problem is in my code or the Axiom system.

Quigibo, was the Axiom system removed because it was damaged? Or is my code probably the damaged part, whether it's a problem with the axiom or how I use it in my program?

I don't know if assembly code should even be posted here, but if you want to look at the source and tell me the numerous things I did wrong (besides cheating the normal axiom argument system, that's intentional and should work fine), here it is:


EDIT: Changed iy usage to push/pop, still crashes my calculator.

EDIT 2: THE AXIOM FUNCTIONS WITHOUT CRASHING, YAY! But it still doesn't do what I want, which I presume is just a problem with my code. It seems that it's ignoring the row input and always drawing sprites to the 2nd sprite row (row 16 of the display). Any ideas?


EDIT 3: IT COMPLETELY WORKS!!! ;D If you want to use it (not in Axe 0.4.5 though), it's attached to this post.


Code: [Select]
.nolist
#include "ti83plus.inc"
.list
.org $9D95

#define var_r1 $83A5 ;Sprite column (0-11)
#define var_r2 $83A7 ;Sprite row (0-7)
#define var_r3 $83A9 ;Pointer to 8x8 grayscale sprite data
#define var_r4 $83AB ;Pointer to front buffer
#define var_r5 $83AD ;Pointer to back buffer

.dw $C0DE ;Header
.db $FF ;Shells
.db tPlot2,0 ;Token
.db 0 ;Replacement Type
.db 0 ;Arguments
.db 56 ;Size

;Calculate byte offset
ld a,(var_r2) ;[13] Sprite row (0-7) -> Multiply by 96 for byte offset (0-672)
add a,a ;[4] *2
add a,a ;[4] *4
add a,a ;[4] *8
add a,a ;[4] *16
add a,a ;[4] *32 (0-224)
ld h,0 ;[7] Move to hl to avoid overflow
ld l,a ;[4]
ld d,h ;[4] Copy hl to de to prepare for *3
ld e,l ;[4]
add hl,de ;[11]
add hl,de ;[11] *96 (0-672)
ld a,(var_r1) ;[13] Sprite column (0-11)
add a,l ;[4] Add to byte offset (will not overflow, l mod 32 = 0)
ld e,a ;[4] Move result to de
ld d,h ;[4]
ld hl,(var_r5) ;[16] Back buffer pointer
add hl,de ;[11] +offset
push hl ;[11] Save for later
;Prepare to copy sprite to buffers
ld hl,(var_r4) ;[16] Front buffer pointer
add hl,de ;[11] +offset
ld ix,(var_r3) ;[20] Sprite data
ld de,12 ;[10] Row increment
ld c,2 ;[7] Buffer counter
putSpriteLoop1:
ld b,8 ;[7] Row counter
putSpriteLoop2:
ld a,(ix) ;[19] Copy a byte from the sprite to the buffer
ld (hl),a ;[7]
inc ix ;[10] Move forward 1 byte in sprite
add hl,de ;[11] Move forward 12 bytes in buffer
djnz putSpriteLoop2 ;[13/8] Repeat for 8 rows
dec c ;[4] Decrease buffer counter
jr z,end ;[12/7] End if done with both buffers
pop hl ;[11] Retrieve back buffer pointer+offset
jr putSpriteLoop1 ;[10] Repeat for second buffer
end:

.end

45
ASM / VAT entry size
« on: September 01, 2010, 06:00:16 pm »
Quick question: the SDK says programs, appvars, and groups are all 14-byte VAT entries, but lists are 13 bytes. Are lists actually 14 bytes, just with the last byte not representing anything? It seems that having fixed-length entries is probably more reasonable, just trying to confirm this.

Pages: 1 2 [3] 4