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.


Messages - Xeda112358

Pages: 1 ... 174 175 [176] 177 178 ... 317
2626
Grammer / Re: Grammer Q&A
« on: January 05, 2012, 07:14:47 pm »
Only if the name of the program to copy to is at 9872h. Do you need a command to copy data from a variable to a spot in RAM?

2627
Grammer / Re: Grammer Q&A
« on: January 05, 2012, 07:11:42 pm »
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

2628
Grammer / Re: Grammer Q&A
« on: January 05, 2012, 07:05:58 pm »
Do you mean like doing 3+C:[0,0,0,0,0,0 ?
I also think 3+C[0,0,0,0,0,0 is valid, but I cannot remember what I did with that code :/

2629
Grammer / Re: Grammer Q&A
« on: January 05, 2012, 06:43:19 pm »
I am not sure what you mean by that :/ Could you clarify?

2630
TI Z80 / Re: Z80 calculators CAS project
« on: January 05, 2012, 06:39:01 pm »
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 :/

2631
TI Z80 / Text Compressor
« on: January 05, 2012, 06:38:42 pm »
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...

In any event, I am not done with this program...

2632
TI Z80 / Re: [Grammer(xlib first)] The Reign of Legends 3 Port
« on: January 05, 2012, 06:21:49 pm »
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 :)

2633
ASM / Re: Useful Routines
« on: January 05, 2012, 10:51:48 am »
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.

2634
TI Z80 / Re: [Grammer(xlib first)] The Reign of Legends 3 Port
« on: January 05, 2012, 10:38:59 am »
Awesome, Yeong! And are you waiting for the smooth scrolling tilemap engine, too? I think I will try to attack that today, as well !

2635
Grammer / Re: Grammer Feature Requests
« on: January 05, 2012, 10:37:21 am »
Thanks to yeong for the idea! And I am still working on these other feature requests when I can find the inspiration:
Code: [Select]
Smoothscrolling
Var11~255 Access
RecallPic
StorePic
Sprite clipping

2636
ASM / Useful Routines
« on: January 04, 2012, 11:58:17 pm »
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 :)

EDIT: As a note, these are all codes I wrote :)

2637
TI Z80 / Re: [Grammer(xlib first)] The Reign of Legends 3 Port
« on: January 04, 2012, 09:41:38 pm »
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).

2638
TI Z80 / Re: [Grammer(xlib first)] The Reign of Legends 3 Port
« on: January 04, 2012, 09:31:26 pm »
As long as it can fit in RAM, it is fine :)

2639
Grammer / Re: Grammer Feature Requests
« on: January 04, 2012, 09:28:49 pm »
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:


solve(0,"EHELLO","VHi2",128,4

2640
TI Z80 / Re: [Grammer(xlib first)] The Reign of Legends 3 Port
« on: January 04, 2012, 09:12:28 pm »
Wow, that would be amazing if you could finish this this year! If you need any help, I do a lot of Celtic 3 and Grammer coding and I have at least partially made an RPG in Celtic3 (there were no goals, just monster fighting, leveling up, and whatnot). I hope this works out and I know you are a great programmer so I am sure you can do this!

Pages: 1 ... 174 175 [176] 177 178 ... 317