Well if the var is in RAM, you can use the Fill( commands for a picture and solve(1 for arbitrary data. solve(1 is used to copy data from one RAM location to another, so it can copy to and from vars if you have the pointers.
Yes the actual command is [. What that does is take the address in Ans and copies the bytes there. It won't let you put a number directly before the [, but you can do 3+C[0,0,0,0,0,0. (I just checked). I like to do something like pi9872[a,b,c,d,... if I need to store to a specific memory address
It would not be easy, but I am sure it could be done. Once you get the design down for how to handle symbolic inputs, it should be relatively easy, though. Since the TI-92 and other similar calculators use a different processor (Motorola 68000), the software wouldn't make an easy port to Z80
I made this program a few years ago using Celtic3, but since BASIC is rather slow compared to assembly, I tried to port it to assembly... A year and a half ago, that attempt failed. However, yesterday on IRC when I stumbled across the project in my backups, I thought "I have the experience, now, let me give this a shot. I guess experience helps because I got it to work in a few hours of coding
Contained are two programs. One of them uses a compression method I came up with and the other decompresses. Limitations are that only 46 characters are recognised (in this version). Outputs are a compression that is at best 50% and at worst no compression. Average is just under 60%.
The program inputs are through Ans in both cases. Outputs are the same in both cases, too. Str1 contains the converted string and Ans contains the compression ratio.
If you have any questions, feel free to ask. My future plan is to make it adaptable (the Celtic3 version let the user create a key file whereas this version has a built in key).
Also, if I were to combine these programs both into one program, I could save a lot of memory as both contain similar code and data (such as the key file). My only issue is trying to find a way of input to determine if the string is to be compressed or decompressed. Maybe I can have the input and output string in Ans and the method to use in Theta and the output compression ratio in Theta...
Aw, you didn't use a bigger map? The tilemap routine will easily handle things like 64x64 tiles. If you want, I can easily port it to the tilemap and walking routine and everything that I have for Samocal. It even has a built in handler for talking to objects, saving the map location, scrolling, and other things. Also, I can try to make a tilemap routine that draws a map of a given size on the screen (so you can have an HUD). Otherwise, I came up with a technique for making a beautiful looking options menu. It will pop up from the bottom, smoothly
Nice, chickendude! Here is the number to string routine I use in Grammer to display numbers.
Spoiler For Spoiler:
It converts HL to any base from 2 to 36 and uses the OS ASCII for the numbers and letters (which match the tokens). This can be easily modified to handle 32-bit input, too: ;================================================================= ConvNumBase: ;================================================================= ;Inputs: ; C is the base to convert to ; HL is the number to convert ;Output: ; A is the number of digits ; BC is the number of digits ; DE is 0 ; HL points to the number string ;Notes: ; This converts HL to a zero terminated string stored in OP4 ; and possibly a few bytes of OP3. ;================================================================= xor a ld de,84A3h ld (de),a dec de call HL_Div_C cp 10 jr c,$+4 add a,7 add a,48 ld (de),a dec de ld a,h or l jr nz,$-15 ld a,$A2 sub e ld c,a inc de ex de,hl ret
And as for the tilemap routine, there are tons of different ways. The one I provided handles 8x8 tiles and tilemaps of any size greater than or equal to the size of the screen as well as 5 different drawing methods.
I figured that I would start a topic like this here. These are links to a bunch of routines that I find useful and I think other will find useful ChkFindVar is like ChkFindSym for Program, Protected Program, Appvar, Temporary Program, Group. SearchVarBC is a routine (with several others included) for searching for the other program types. A_Times_DE This is a non-standard routine that is 25 bytes and faster than DE_Times_A. DE_Times_A This is a fast, straightfoward, standard DE_Times_A C_Div_D C_Times_D DE_Times_BC DEHL_Div_C DEHL_Mul_32Stack (no SMC) this is for Apps. This multiplies DEHL by the last two entries on the stack and returns the 64-bit result. DEHL_Mul_32Stack (SMC) this gets a decent speed boost by using SMC. It does the same thing. DEHL_Mul_A this uses shadow registers HLDE. I need to rewrite this GCDHL_BC computes the Greatest Common Divisor HL_Div_BC this can probably be optimised HL_Div_C HLDE_Div_C ncrHL_DE this computes "n choose r" and it uses shadow registers RoundHL_Div_C returns the rounded value of HL/C RoundSqrtE returns the rounded square root of E SqrtE SqrtHL PixelPlot (1) is a fast pixel plotting code that uses SMC and will draw to arbitrary buffers. I usually use a different version of this. LineSearch will search a var for a line and return the location and size. This will not search beyond the given limit. ConvRStr will convert a string of numbers to a 16-bit value Is_2_Byte checks if A is the start byte of a 2-byte token TokensToASCII converts a token string to ASCII IncHLMem1 This is an optmised routine to increment HL and port 6 as necessary TileMap1 This draws a tilemap. Uses DrawSpriteXxY. DrawSpriteXxY This draws a tile
Pastebin won't let me paste anymore for a while, but I have a bunch more waiting in reserve
Yes, it can copy programs and such from archive to RAM and it can delete, archive, unarchive and other such handling as well. In fact, yeong requested a modification to the CopyProg command that I managed to add. That should be very helpful for him and it should let him store a lot of data to vars (such as any sprite and tilemaps).
Okay, I like that idea very much and I just added it as well as an optional fourth argument for an offset into the var. So for example, if I wanted to copy the first 128 bytes of prgmHELLO to the temp program Hi2, I could do something like this:
solve(0,"EHELLO","VHi2",128
Or if I wanted to copy 128 bytes at an offset of 4 bytes into the var: