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

Pages: 1 ... 4 5 [6] 7 8 ... 13
76
TI-BASIC / PalPrime - Zeda
« on: May 13, 2013, 08:43:21 pm »
So here is my palprime program, but after seeing Jim Bauwens' program and seeing that it could be tweaked to be much smaller and faster than mine, I don't know how much this is worth :P
Code: [Select]
Ans→N
0
If N<1 or fPart(N
Return
If N<6
Then
{2,3,5,7,11
Ans(N
Return
End
N-5→N
9→B
1→A
While N
B+1→B                       ;generate the next palindrome
If Ans=10A
Then
Ans→A
Else
If not(remainder(B,A
1+B+A(1+2(B=4A→B
End
B→C
.1Ans→D
While iPart(D
.1iPart(D→D
10(C+fPart(D→C
End                         ;palindrome is in C
If min(remainder(C,{3,7,11  ;Check primality
Then
√(C→D
{13,17,19,23,29,31,37,41
While max(Ans)≤D and min(remainder(C,Ans
Ans+30
End
N-not(not(min(remainder(C,Ans→N
End
End
C
For timings, I got 14 seconds for the 42nd prime palindrome, 58 seconds for the 100th, 494 seconds for the 290th.

Input is the 'nth' prime palindrome to return in Ans, and output is the nth prime palindrome (output in Ans).

77
TI Z80 / Digisibility Test (Z80 ASM)
« on: April 02, 2013, 01:03:50 pm »
Inspired by Round 2 of the 2013 TI-Concours BASIC category, I made this assembly program to test if a number is digisible. A number is digisible if every digit of the number divides the whole number evenly. Since you cannot divide by 0, every number with a 0 in it is automatically not digisible. So the input is a positive integer, and the output is text drawn to the screen where 0 =  not digisible, 1=digisible.

So here is what I was wondering: How fast or small can you make a program like this in assembly? My version takes a string input, so long as it fits in RAM and properly outputs a result. It is also 140 bytes on the calculator, so I am thinking it could be made a bit smaller XD (I think it is 122 bytes of code).

Hopefully I will remember to convert the code to readable source code, later. My approach is to keep track of which digits are in the sequence while finding the value of the string mod 2520 (every digit 1~9 divides 2520). Then, check to see if each present digit divides that value. At the same time, if any value appears that is not 1~9, it returns 0, so this takes care of non-integers and integers with a 0 in their digit expansion.

78
TI Z80 / [TI-Concours 2013] Mastermind-Zeda
« on: March 12, 2013, 06:13:13 pm »
So for my TI-Concours BASIC (z80) entry, you can see what it looks like below. We were supposed to make Mastermind, so I put the core of it together with a custom graphscreen input routine. I made it return smileys for correct numbers and positions, ? for correct numbers, bad positions, and an X for numbers not in the code. Then I made sure that the maximum number of allowed turns was 12 and I decided to make a fancy-ish main menu. It draws three main objects in random locations every setup and I made sure it wouldn't interfere with the menu. What is more, my program doesn't tamper with window settings, so even if you press ON, your window settings are preserved as well as Axes, Grid, and the like. The only thing the program modifies is it turns off the graphs and plots.

79
TI Z80 / Jade
« on: February 26, 2013, 03:16:23 pm »
After reading some Atari documentation and also seeing some of the documentation for the 84+C, the way I saw what was considered "acceptable" assembly completely changed. For the past few years, I have procrastinated on this project of mine, but last night I started from scratch and it is almost finished.

I have basically created an emulator for a processor that doesn't exist. I created the instruction set to emulate and the ports. I originally modeled instructions and interactions based on how the z80 does it and so the process of completing the instruction set was tedious. I completely changed my approach and here are the stats:

The instruction set is 6-bits, so there is room for 64 instructions but not all are finished. You have 256 bytes of RAM, the first 42 bytes (it will probably be more before this is finished) is for interacting with ports and the last 128 bytes is for a stack. There are 512 bytes of code space and there are no registers. This was the main spark of insight I had last night. Instead, you work directly with the RAM. Here are the instructions currently emulated:

Note that all values are 1-byte.

ld (addr1),(addr2) loads a byte from one RAM address to another.
ld (addr),const loads a byte into the RAM address
add (addr1),(addr2) adds two bytes of RAM together, storing the result to the first byte. Modifies C and Z flags
add (addr),const adds the constant value to the byte. Modifies C and Z flags

You get the idea, I am sure, so here are others that follow the same structure:
adc
sub
sbc
xor
or
and
cp    (compare two values)

And these are some more:
inc (addr)
dec (addr)
push (addr)
push const
pop (addr)
ex (addr1),(addr2)   ;exchange two bytes
ret
ret z
ret c
ldir (addr),size,data   ;copies inline data of the given number of bytes to a ram location specified by (addr)
ldir const,size,data   ;copies inline data of the given number of bytes to a ram location specified by (addr)

It is important to note that the ldir commands are very useful for setting up the ports.

there are also the jrf, jrb, callf, and callb commands. Each of these can work on a condition of c or z (not nc or nz).

jrf jumps forward a given number of bytes.
jrb jumps backwards a given number of bytes.
callf calls a relative routine that is within 256 bytes ahead
callb calls a relative routine that is within 256 bytes behind

Anytime a relative jump or call is made, it will never execute code from RAM. If you go past the 0~511 byte code range, it will loop back around.

There are 8 sets of 4 ports for sprites. The ports are ordered:
LSB of sprite data
MSB of sprite data
X coordinate
Y coordinate

In all, these makeup the first 32 bytes of RAM
Port 20h is the Sprite Update Port. When a sprite is drawn, its corresponding but gets set here. You can reset all of the bits here, then read from it to figure out when all of the sprites have been drawn.
Port 29h is the Sprite Mask Port. Set the corresponding but here to have the sprite drawn. Compare this port to port 20h to see if all the sprites are drawn.
Ports 21h~27h hold values for keypresses
Port 28h is the Key Mask Port which determines which groups of keys get polled

2Ah holds the stack pointer.


Anyways, I would offer an upload or something, but I cannot get it off of my calc, once again. Also, it is currently written in Grammer code, but I plan to convert it to an assembly program. My first attempt is going to make a Pong game and all I currently have done codewise setting up the ports All of the mentioned instructions work by the way, all I need to do is emulate the ports :)

80
TI Z80 / Random Maze Generation (Grammer)
« on: February 23, 2013, 04:07:51 pm »
I started working on a maze generating thingy after seeing KermM's BASIC algorithm (using the DCS7 AnsStack command). I have coded this in Grammer and I am still working on optimising it more. If you want to edit the size of the path (2 pixels wide, 3 pixels wide, et cetera), open the source and change the value for →S. 2 makes a 1-pixel wide path, 6 makes a 5 pixel wide path, for example. On my actual calc, I have an actual game started, but I haven't been able to transfer my programs.

Here is the code:
Code: [Select]
:.0:Return
:Full
:3→S
:Fix 16
:96/S
:*64/S→A
:Send(+A,"VYπ→θ+A→Z
:π86EC→W
:π9340→V
:Lbl "BTR→T
:Lbl "pxl-Test(NEIGHBORS→U
:Fill(0→N→X→Y
:ClrDrawZ
:Disp W
:ClrDraw
:64/S→A
:96/S→B
:Horizontal A
:Vertical B
:Line(S*B-1,S*A-1,S,,0,V
:Pxl-On(A-1,B-1
:!Repeat N
:int(Z+N,X
:int(θ+N,Y
:Pxl-On(Y,X
:Line(1+S*X,1+S*Y,S-1,,0,V
:If 15=prgmU
:prgmT
:!Repeat and A
:e^(randInt(0,4
:End
:→A=2
:+X-A=1→X*S
:+1+A=1
:-A=2→B
:Y+A=4
:-A=8→Y*S
:+1+A=8
:-A=4→A
:Line(B,A,S-1,,0,V
:IS>(N
:Disp V:DispGraph:Disp W
:End
:Stop
:.BTR
:Repeat 15≠prgmU
:N-1→N
:If θ'
:Stop
:(+Z→X
:(θ+N→Y
:End
:End
:.pxl-Test(NEIGHBORS
:pxl-Test(Y-1,X
:+Ans+pxl-Test(Y+1,X
:+Ans+pxl-Test(Y,X+1
:+Ans+pxl-Test(Y,X-1→A
:End

That creates a maze that is guaranteed to have a path from the upper left corner to the lower right of the screen.

81
TI Z80 / Tutor App
« on: January 29, 2013, 06:00:57 pm »
EDIT:22 April 2013
This topic is now renamed Tutor App as the project has evolved. An updated version can be found at this post later in the topic.


(original post)

On TI-BD, there was an idea for simulating keypresses, so I offered my assembly program to simulate a keypress. But then they wanted to simulate a list of keypresses, so I finally started working on that. Currently, whenever the OS looks for keypresses (not while programs are executing), the hook looks for the hacked string 17 (AA11h) and if it contains data, it will read the numbers one at a time, executing the keypresses.

The keypresses are not getKey values. If you have used assembly keycodes (where Enter=9, for example), that is the set you will want to use. To simulate pressing [2nd]+[nobbc], add 56, to simulate [ALPHA]+[nobbc], add 112. So for example, [Graph]=49, [PRGM]=31, [MATH]=47. To open the graph screen, then press [2nd][prgm] and then select 1:ClrDraw, use:
Code: [Select]
"49,87,9
To do that, then select the A:Pen from the draw menu, add an additional 87,159 (159=112+47). Finally, the arrows are 1=down,2=left,3=right,4=up. Combining all this:
Code: [Select]
"49,87,9,87,159,9,2,2,2,2,1,1,1,1,3,3,3,3,4,4,4,4
That will select ClrDraw, then Pen, then it will draw you a box :)
Spoiler For List of Key Codes:
01      Down
02      Left
03      Right
04      Up

09    Enter
10    +
11    -
12    *
13    /
14    ^
15    Clear

17    (-)
18    3
19    6
20    9
21    )
22    tan(
23    vars

25    .
26    2
27    5
28    8
29    (
30    cos(
31    prgm
32    Stat
33    0
34    1
35    4
36    7
37    ,
38    sin(
39    APPS
40    XTON

42    sto>
43    ln(
44    log(
45    X^2
46    X^-1
47    Math
48    Alpha
49    graph
50    trace
51    zoom
52    window
53    Y=
54    2nd
55    mode
56      delete

255    [2nd][On]
254    [prgm][enter] displays prgmA (Even if it doesn't exist)
253    [2nd][Stat]
252    Displays LA (list A)
251    Disp If
250    [Graph]
249    Catalog
248    nothing
247    Same as FE
246    RAM Clear
Spoiler For How To Make Hacked Strings:
There are several "easy" ways, but they involve getting the hacked string name in a string, then use Rcl Ans in a program to paste the name their. They typically have funky names, so don't be alarmed if your string is named something like GDB1-- it is because the OS doesn't have real names for them, so it uses what it has. Anyways:
  • Xtravar Beta provides an easy way to select hacked variables. In this case, find the Strings, and search for String 17 (11h) it will have a name 'sigma'x.
  • You can use Celtic 3 to do det(17,"AA11
  • You can use BatLib to do dim(5,"AA11
  • Xtra will take a list input to create a hacked var token. This has an included opcode.

82
TI Z80 / Fast Langton's Ant (ASM)
« on: January 20, 2013, 03:44:45 pm »
I was doing laundry again, today, and I thought of a neat way to go about making Langton's Ant in assembly. To give an idea of the speed it runs at, it gets through 10000 iterations in about a second, while updating the screen at each iteration (at 6MHz). This means that you can simulate over 1000000 iterations in under two minutes, on a TI-83+ !

I am sure there are optimisations that can be made, since I threw it together in about an hour and spent another hour tweaking things.

Specifics:
-It uses the whole screen, which is treated as a toroidal (not sure if that is the right word). Basically, if the ant goes of the left edge of the screen, it wraps around to the right.
-Press clear to exit
-It uses whatever contents are on the graph screen as the starting board.
-It only updates one byte at a time in the LCD, that is how it can update so fast.

I might be able to add a way to make it stop after a certain number of iterations, too, if that would be useful. I am just trying to think of a very efficient way of doing that using a 48-bit value for an input x.x Hmm, I might need to use daa for this one >.>

EDIT: For comparison purposes, I downloaded another Langton's Ant program (which is 30 bytes smaller). The screenie is attached. I downloaded another version, but since that used 3 ants, I didn't think it was an accurate comparison. Plus, it used MirageOS and was 62 bytes larger.

83
Anime and Manga / Manga Downloader
« on: January 19, 2013, 12:41:09 am »
Recently I made a manga downloader tool for my spouse who often likes to get on CityManga. The problem is that you need internet for that. Since I made a comic downloader for Questionable Content and XKCD, I decided to make a CityManga downloader. Unfortunately, ze does not program, so  had to make it easy to use, unlike my other programs.

It is programmed in Python, so you will need that on your computer, but all you need to do is run the program, type the name of the manga and press enter. For example, ze was finishing up Angel Hunt, the url used "angel_hunt" so that is what you would type. The program will make a folder with the name, then proceed to download each page of each chapter. Each page will be labeled with chapter#_page#, too.

I am sure the program can be optimised a bunch. I know very little Python, so I brute forced a lot of the code .__.
Here is the code, download, and screenshot:
Code: [Select]
import urllib
import urllib2
import os
manganame=raw_input("Manga Name:")
if not os.path.exists(manganame): os.mkdir(manganame)
os.chdir(manganame)
url="http://citymanga.com/"+manganame
f = urllib2.urlopen(url)
a="0"
while a[:20]!=" <b>Chapters:</b> ":
    a=f.readline()
c=20
b=d=0
while b<10 and b>=0:
    d=d*10+b
    b=ord(a[c])-48
    c=c+1
while d:
    f = urllib2.urlopen(url+"/chapter-"+str(d))
    a="0"
    while a[27:39]!="pageselector":
        a=f.readline()
    b=len(f.readline())-30
    if b>330:
        a=(b+20)/35
    if b<331:
        a=b/33
    chapter=str(d)
    path='http://citymanga.com/files/images/'+manganame+"/"+chapter+"/"
    path2=chapter+'_'
    while a:
        b=str(a)+'.jpg'
        print path2+b
        g = open(path2+b,'wb')
        g.write(urllib.urlopen(path+b).read())
        g.close()
        a=a-1
    d=d-1
usock.close()
f.close()
raw_input()

84
TI Z80 / ListComp
« on: January 12, 2013, 09:42:55 pm »
Earlier I made a program to compress a list into a specific string format or decompress from that specific string format to a list. The compression is lossless and relies on the observation that a signed 14 digit number fits in 48-bits, whereas TI uses 8 bytes to hold the sign and the 14 digits. So with 6 bytes plus the mantissa, a Floating Point number can be compress to 7 bytes without losing any data. Usually there are more efficient ways to compress floating point numbers under certain conditions (for example, if there are only integers from 0 to 65535, you can compress each element to two bytes pretty quickly). However, this only makes the condition that it will not read complex lists. If I change the format of how the data is stored, though, I can make it recognise matrices, lists, complex lists, et cetera at the cost of one or two bytes (two for matrices)

85
TI Z80 / MenuKey
« on: January 10, 2013, 12:17:18 am »
A while ago I made a rather neat program that could let you access menu items even after you have left the menu. What do I mean by this? If you set the Strings menu as your menu to access, you can press ON+[number] anywhere in the OS to paste the string. You can use other menus as well, but the Apps and PRGM menu won't work for this. This should help anybody who wants to add a new element of efficiency to their on-calc coding :P

86
TI-BASIC / Optmising BASIC code for A^K mod P
« on: January 07, 2013, 11:00:40 am »
I made this code to compute AK mod P and I was wondering if it could be optmised and still preserve the speediness (or make it faster).
Code: [Select]
:1→M
:While int(K
:.5K→K
:If int(2fPart(Ans
:AM-Pint(AM/P→M
:A²-Pint(A²/P→A
:End
I feel like it could be optimised in BASIC. And maybe use only three variables (base, exponent, mod).
EDIT: Optimised with suggestions from calc84maniac and Jacobly
EDIT2: Figured out that .5K is faster than K/2

87
TI Z80 / FileSyst
« on: January 02, 2013, 04:17:46 pm »
Hey everybody, I believe this is my next big project while I take a break from Grammer. In fact, this program used some code from my current progress on GrammerOS, but I will probably end up using this project for GrammerOS later. Anyways, what is it?

FileSyst provides some core routines for handling a filesystem on the TI-83+/84+/SE calculators and in the plans are a full folder system support, along with navigation, naming of the variables, icons, and a slew of other abilities. Currently, progress is in the planning stage. A few days ago I made a program and last night I turned it into an App. I basically took BatLib, hollowed it out except for about 50 BatLib commands, then I inserted what I had done with the program version and it is an undocumented mess at the moment. However, it has this much completed:

-Run the app and select the program to run (this is only for the developers version)
-The program will be executed using the FileSyst parser hook (hooks are restored when the program finishes)
-The dim() token is used to execute the included BatLib routines or the FileSyst routines.
-FileSyst takes arguments as a string. For example, "BASIC(Zeda:Doc Prog)" .
-FileSyst can open folders and files and automatically creates folder/files if you try to access them and they don't exist.
-There are only two commands at the moment:

BASIC() will open a file and try to execute it as a BASIC program
VPTR() will make a shortcut to an OS variable (the var doesn't actually need to exist)

An example might be:
Code: [Select]
dim("VPTR(prgmTEST,Zeda:Doc Test) BASIC(Zeda:Doc Test)
However, once I add in the CD command (which is basically only three bytes of code at this point):
Code: [Select]
dim("CD(Zeda:Doc) VPTR(prgmTEST, Test) BASIC( Test)
Anyways, since the program isn't very presentable, I won't release a program yet. Currently, there are two other projects that are already in the works to use this program-- ScopeOS by Codebender (with help from myself and Roguebantha) and Linux which is being done by Roguebantha (originally using BatLib, but that is why we have included certain BatLib commands in this app).

ScopeOS will hopefully provide a nice GUI to view the files and folders as well as all of the OS variables. I plan to add the following commands shortly:
Code: [Select]
CD(path)         This will open a folder (or use ".." to go up one folder level)
CF(filepath,field,data)     This will change a field in the header data of a file. Fields could be for passwords, descriptions, or specifying what programs to open the file with.
CI(filepath,icon#|icondata) This will change the icon number, or if you supply hex data, it will change the icon to a custom icon.
CN(filepath,newname)            This will change the name of a file.
COMP(filepath)              This will compress a file
COPY(filepath,newpath|newfilepath) This will copy a file from one location to another
DADD()                      Returns a string with the current directory
DEL(path) or DEL(filepath)   This will delete a folder or file.
GETD(path,#)                 Returns info aboutt he nth item in the directory (so you can create a list of variables or whatnot)
HIDE(filepath)              This will mark a file or folder as hidden
LOCK(filepath)              This will mark a file or folder as locked
MOVE(filepath,newpath)       Moves a file to another directory
ND(loc)                     This adds a new directory
SCUT(lfilepath,newloc)       This creates a shortcut of a file.
VPTR(VarName,filepath)      This will create a file that points to an OS variable

It currently supports relative paths where it starts from the current directory and absolute paths where it starts from the main directory. It also allows you to navigate back through directories by using ".." (or navigate back another directory for every additional period).

I wish it looked prettier so that I could supply some cool screenshots, but really, you don't see much happening. I've spent many hours over the past three days working on this working out any potential bugs. I hope the new years brings success because I had a really cool thought about how to use this when I first started.

Say you were making an RPG and you wanted to use a folder to store or retrieve monster data, player data, or anything else like that. You could use this program to make a directory in the main folder (named after your game or something), then in that folder you could put all of the other data you need. Then, to retrieve the data, you can use the FileSyst program to access the data through paths. Since the app has a bunch of graphics and data manipulating commands, I can make commands like SPRITE() so that you can make a script for certain parts of your program.

Here is a screenie from yesterday's version:

88
TI Z80 / GroupRead
« on: December 21, 2012, 10:17:03 am »
About 4 days ago, I started working on this project. Unfortunately, I am not home yet, so I cannot upload it, but I'll edit this post on the 30th (hopefully). Anyways, I decided to make a program like CopyProg, except it works with groups. Naturally, some features were excluded (you cannot delete lines from grouped program, for example), but I think this is a pretty neat program, so far. Here are its features:
  • One command lets you read the names and variable types of each variable in the group. It also returns the size of the data in theta (this is similar to the GetName command in CopyProg). If you try to read the zeroth var name, it will instead return how many variables are in the group.
  • Another command will let you extract a variable (by name) and copy it to another variable in RAM (this is like the CopyProg command)
  • Another command will let you read a line from a variable (like ReadLine)
  • Another command will let you recall a picture from the group, using one of these methods: Overwrite, AND logic, OR logic, XOR logic.


As you might imagine, this program can be useful for RPGs, and this is what I am keeping in my thoughts as I plan more routines. As it is, I think it is basically finished (for a version 1). I now need to clean up my code a bit to remove unused stuff. Also, it is a little over 800 bytes at the moment, so hopefully I can optimise it down a bit :/ The largest pieces of code come purely from reading the group data.

Here is an outdated screenie:


As an example, if you want to copy prgmFOO from the group named BACKUP to the protected program named BAR:
Code: [Select]
"BACKUP:EFOO:FBAR→Str1
Asm(prgmGRPREAD
I plan to modify this command to use Ans instead of Str1, by the way. And to recall Pic3 using XOR logic to the graph screen from the same group:
Code: [Select]
"RecallPic  xor BACKUP→Str1
2     ;2 corresponds to Pic3, 0 corresponds to Pic1
Asm(prgmGRPREAD
I hope I get home on time (9 days from now) so I can upload the program :P
EDIT: I have now uploaded the program and documentation! Here is the readme:
Quote from: Readme

GRPREAD    985 bytes
by Zeda Elnara
================================================================
  GrpRead is a program for BASIC programmers that want to work
with groups in some pretty cool ways. For example, say you have
an RPG that uses all 10 picture variables and it uses tons of
memory just for item names or monster names, or something like
that. If you group them (using the OS menu), GrpRead will let
you recall those pictures directly from the group and read lines
of code from programs in the group. These are just a few
examples of what GrpRead can do, so read on and I hope this
proves useful!
=============/
Installation/
===========/
  Send GRPREAD.8xp to your calculator. You can now use it.
===========/
How to Use/
=========/
  Arguments are passed mostly through strings or numbers. It
will then return data or perform some function.
==========/
Functions/
========/
     /=========================================================\
     |GetName                                                  |
     \=========================================================/
     |  The group variable will have variables in it. If you   |
     |want to figure out the names of the variables, their type|
     |and their size, this is the command to use. This returns |
     |info on the 'nth' variable in the group. It can also be  |
     |used to figure out how many variables are in the group.  |
     \=========================================================/
     Inputs:
        Str1 has the name of the group
        Ans is the nth var name to return, or zero
     Outputs:
        Ans has the name of the variable (with a prefix byte)*
        Theta has the size of the variable's data
       *A prefix byte is used to specify the type of the
        variable. This is either the " and " token or a letter.
        See the text document named "Prefix Bytes.txt" for info.
     Alternate:
        If the input Ans was 0, this instead returns the number
        of variables in the group. If the group doesn't exist,
        0 is returned.
     Errors:
        "." is returned if the nth variable doesn't exist
     Examples:
        Check if group BACKUP exists and how many vars it has:
             :"BACKUP->Str1
             :0
             :Asm(prgmGRPREAD
        Get the name/size/type of the first variable:
             :"BACKUP->Str1
             :1
             :Asm(prgmGRPREAD
     /=========================================================\
     |ExtractVar                                               |
     \=========================================================/
     |  This command allows you to extract a variable from the |
     |group, copying it to some variable in RAM. This also     |
     |allows you to rename the variable and it automatically   |
     |overwrites a preexisting variable (unless you specify not|
     |to overwrite). There are some pretty neat things you can |
     |do with this, especially for games.                      |
     \=========================================================/
     Inputs:
       Ans is a string containing the name of the group, the
       name of the variable to extract, and possibly the new
       name to extract to. The format:
         "<groupname>:<varname>:<newname>"
       The last argument is optional. If you put a "+" before
       the new name, the var will not be ungrouped if it already
       exists.
     Outputs:
       The variable is copied from the group to a var in RAM.
     Errors:
       0 is returned if the group does not exist.
     Examples:
       First, note that the prefix byte for a program is E and
       the prefix for an appvar is U. Now, to extract prgmFOO
       from group BACKUP:
            :"BACKUP:EFOO
            :Asm(prgmGRPREAD
       Now to extract prgmFOO to appvar BAR:
            :"BACKUP:EFOO:UBAR
            :Asm(prgmGRPREAD
       Now to extract it to appvar BAR without overwriting:
            :"BACKUP:EFOO:+UBAR
            :Asm(prgmGRPREAD
       To extract prgmFOO without overwriting it if it exists:
            :"BACKUP:EFOO:+
            :Asm(prgmGRPREAD
     Notes:
       As you can see, you are able to extract to completely
     different variable types. Use this to your advantage, but
     since lists, real numbers, and matrices have a different
     structure from the other variable types, you should not try
     to extract them or extract to them (or you will lose RAM).
     /=========================================================\
     |RecallPic                                                |
     \=========================================================/
     |  This will let you recall pictures directly from the    |
     |group. Not only that, but it gives you four different    |
     |methods of recalling the picture instead of the 1 way    |
     |that the OS provides.                                    |
     \=========================================================/
     Input (syntax 1):
       Ans is a string with the format
         "RecallPic <Pic#><logic><groupname>"
     Input (syntax 2):
       Ans is the picture number (0=Pic1, 1=Pic2,...,9=Pic0)
       Str1 has the format:
         "RecallPic <logic><groupname>"
       (This is useful for maps and monsters and hacked pics)
     Output:
       The picture var is drawn and the screen is updated if the
       picture variable exists.
     Notes:
       The logic tokens are as follows:
            xor
            and
            or    (This is what the OS uses).
       They can be found at [2nd][Math][Right]. If this argument
       is omitted, the picture will simply overwrite the data on
       the screen.
     Examples:
       Recall Pic1 from group BACKUP, overwriting the data on
     the screen:
            :"RecallPic Pic1BACKUP
            :Asm(prgmGRPREAD
       Recall Pic3 from group RPG using XOR logic (syntax 2):
            :"RecallPic  xor RPG->Str1
            :2
            :Asm(prgmGRPREAD
     /=========================================================\
     |LineRead                                                 |
     \=========================================================/
     |  This lets you read a line of code from a program in a  |
     |group. Note that the line doesn't actually need to be    |
     |code. You can store a bunch of names or words line by    |
     |line in a program. Then, using this function, you can    |
     |recall the data as a string in Ans. Enjoy!               |
     \=========================================================/
     Input:
       Str1 is of the form "Line(<groupname>,<varname>"
       Ans is the line number to read (or zero)
     Output:
       Ans is a string containing the name contents of the line.
       If Input Ans was zero, this instead returns the number of
         lines in the variable.
     Errors:
       ".NO DATA" is returned if the line is empty.
     Examples:
       Read the fourth line of prgmRPGDATA from the group RPG:
            :"Line(RPG,RPGDATA->Str1
            :4
            :Asm(prgmGRPREAD
================================================================
Notes:
  When I wrote this program, I was away from my computer,
internet (or electricity, for that matter) for several weeks. I
wrote the program using a combination of hex and a program named
ASMCOMP. It was basically like writing the program in hex the
normal way, but with the advantage of having labels and equates
and whatnot. Therefore, the source is in the form of a program
to be compiled by prgmASMCOMP.
================================================================
History:
7:37 PM 12/30/2012- Wrote the readme and prepared for initial
release. GetName,ExtractVar,RecallPic,LineRead.        985 bytes

89
News / solidFRAME v1.0b released
« on: December 01, 2012, 08:27:39 am »
A few days ago, tr1p1ea (you know, the guy that created xLIB) released solidFrame-- a 3D model viewer. It can take Wavefront OBJ files (converted, of course) and allow you to rotate and explore objects. And these aren't simple wireframe models, either, but instead these are textured models. Here are a few pieces of candy for your enjoyment:




Go ahead and give it a try! (A 15MHz calculator is suggested, by the way, but it will work on a 6MHz calc)

Discussion Topic
Download

90
TI Z80 / LabelLine Edit
« on: November 27, 2012, 11:14:59 pm »
I got this idea from Deep Thought, I modified it slightly, but I need some input:
This might be hard, but how about writing back a string to a label in the program? Something like

Code: (TI-BASIC) [Select]
:Lbl 0
:{1,1,2,3
:Lbl 1
:Ans→L₁
:"{1,3,4,7→Str1
:"0,1
:Asm(SMC

True SMC in BASIC is something we have yet to see :D
I modified the syntax to be more easily used by BASIC programmers (I hope), so here is what I have:

prgmLBLLINER is "Label Line Read" and will let you read a line at the offset of a label. Str1 contains the name of the label, followed by a colon (sorry). Ans contains the line number to read. If Ans is zero, this program will instead return how many lines there are until the end of the program. So for example:
Code: [Select]
"MD:→Str1
3
Asm(prgmLBLLINER
Pause Ans
Return
Lbl MD
Bulbasaur
Ivysaur
Venusaur
...
This code will return "Venusaur" in Ans.
prgmLBLLINEW is "Label Line Write" and will let you replace a line after a label. The syntax is the same as before, except the data to replace with follows the colon. If there is nothing after the colon, the line is made empty. For example:
Code: [Select]
"MD:!PEANUTS→Str1
3
Asm(prgmLBLLINEW
Return
Lbl MD
Bulbasaur
Ivysaur
Venusaur
...
That code will change the line reading "Venusaur" to "!PEANUTS" Also, setting Ans to zero as the input will return the number of lines left in the program after the label.

So here is my question... Alone, these programs are 204 and 285 bytes respectively. However, they share almost all the same code, so combined it would be a little over 300 bytes. I was thinking that having a decimal part in Ans (like 3.1) could tell the program to read a line, and no decimal part would tell it to overwrite a line. Does this sound like a good syntax?

EDIT: Also, that quote came from my hex opcodes topic. If you want the hex opcodes for these, be prepared to input a long code XD
EDIT2: See below for an updated version!

Pages: 1 ... 4 5 [6] 7 8 ... 13