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

Pages: 1 ... 60 61 [62] 63 64 ... 82
916
Axe / Re: Routines
« on: July 27, 2010, 04:58:39 pm »
i'm going to try to write decompression your way, and we can compare afterwards. and i'm going to edit my RLE compression routine so that if you have an odd number of nibbles, it tacks on an 'F' at the end of the hex string.

great success?

Code: [Select]
.BB
[F71011011100F810]->GDB1
Zeroes(8)->Pic1
[FFFFFFFFFFFFFFFF]
0->X->Y
For(Z,0,15
  If sub(GN,Z)->N=15
    For(U,1,sub(GN,Z+1)
      Pt-On(X*8,Y*8,sub(GN,Z+2)*8+Pic1
      !If X+1->X^6
        0->X:Y+1->Y
      End
    End
    Z+2->Z
  Else
    Pt-On(X*8,Y*8,N*8+Pic1
    !If X+1->X^6
      0->X:Y+1->Y
    End
  End
End
DispGraph
Lbl GN
{r1/2+GDB1}->T
If r1^2
  T^16
Else
  T/16
End

as you can tell, i used builderboy's idea of having a subroutine to get a specific nibble.

edit: edited some whitespace in for readability

917
Axe / Re: Routines
« on: July 27, 2010, 04:52:33 pm »
yes, mine works by row. i think decompression will be harder, though. because if you run into an F, all your arithmetic has to change to compensate for reading the bytes differently. i think it'd be easiest to make the sequence for starting a run be a full byte, like FF, unless you've found an easy way to decompress already.

918
Axe / Re: Routines
« on: July 27, 2010, 03:17:51 pm »
calcdude, wouldn't RLE under your example only allow tiles 0-E, since F is reserved for indicating a run? and sometimes you could end up with an odd number of nibbles. regardless, i like that type of RLE and i'll probably post some de/compression routines about it.

edit: and my routines will have the uncompressed map data as each tile being one byte.

edit2: compression is working.

Code: [Select]
.ROUTINE
0->C->D
"0123456789ABCDE0->Str1    .Make sure you have 0 at the end, not F.
For(Y,0,S                  .Replace S with the height of your uncompressed map minus 1
For(X,0,T                  .Replace T with the width of your uncompressed map minus 1
If {T+1*Y+X+GDB1}->A={T+1*Y+X+GDB1+1} and (C!=14)
C+1->C
Else
If C>3
70->{L1+D}
{Str1+C+1}->{L1+D+1}
{Str1+A}->{L1+D+2}
D+3->D
Else
For(Z,0,C
{Str1+A}->{L1+D}
D+1->D
End:End:0->C:End:End:End
GetCalc("Str4",D^2+D)->I
For(Z,0,D-1
{L1+Z}->{I+Z}
End
If D^2
70->{I+Z+1}
End

that was much more difficult to write... i wonder how decompression will be.

919
Axe / Re: [Tutorial] Tilemaps in Axe Basic
« on: July 27, 2010, 12:51:32 am »
oh it's no problem. now i'm getting myself started on how to smooth scroll a half byte tilemap...

920
Axe / Re: [Tutorial] Tilemaps in Axe Basic
« on: July 27, 2010, 12:33:16 am »
hmm that's partially good, because the map's dimensions match the dimensions you described (8 8x32 stripes means the map is 64 pixels wide by 32 high, divide that by eight (the size of the tiles) and you get 8 tiles wide by 4 tiles high).

i think i found the bug. are you sure that the following line is typed correctly on your calculator?
Code: [Select]
Pt-On(X*16+8,Y*8,A^16*8+Pic1

because if you forgot the +8, you end up with alternating lines as you said.

921
Axe / Re: [Tutorial] Tilemaps in Axe Basic
« on: July 27, 2010, 12:10:49 am »
hmm... this works on my calculator:

Code: [Select]
.A
[11111111->GDB1
[10011001
[10100101
[11111111
[0000000000000000->Pic1
[FFFFFFFFFFFFFFFF
For(Y,0,3
For(X,0,3
{Y*4+X+GDB1}->A
Pt-On(X*16,Y*8,A/16*8+Pic1
Pt-On(X*16+8,Y*8,A^16*8+Pic1
End
End
DispGraph

edit: i'm not sure which parts would be confusing to people, so i left out anything unnecessary. i'll respond best i can to anyone who posts though

922
Miscellaneous / Re: Human Languages
« on: July 26, 2010, 11:36:45 pm »
English - advanced
German - Beginner/intermediate (onto German 3 in high school)
Latin - Beginner

923
Miscellaneous / Re: Programming Languages
« on: July 26, 2010, 11:07:43 pm »
whoa, i just noticed my little essay about the ** command is on there, thanks meishe!

924
Miscellaneous / Re: Programming Languages
« on: July 26, 2010, 11:00:36 pm »
graphmastur, do you have any resources on java that a beginner could use?

925
Miscellaneous / Re: Programming Languages
« on: July 26, 2010, 10:56:56 pm »
TI BASIC- intermediate/advanced (z80)
C++ - beginner
Java - beginner
Axe - intermediate

i've also become interested in javascript, though i've only just started reading about it and CSS/HTML which aren't as much programming languages.

926
Miscellaneous / Re: Programming Tutorials, Help, Etc.
« on: July 26, 2010, 05:38:59 pm »
i think happybob means that there isn't a very simple Ti-Basic programming tutorial. like HotDog's ASM tutorial but for Ti Basic.

927
The Axe Parser Project / Re: Bug Reports
« on: July 26, 2010, 05:23:47 pm »
has anyone successfully stored data into a list from an axe parser program? i can't seem to get it to work, and after running this program twice, i get a RAM clear:

Code: [Select]
.B
5->{L1}
GetCalc("L1",1)->A
{L1}->{A}

the program compiles fine, and after running the program once, i end up with the value 0 in the OS var L1. i run the program again, the calc freezes and i get a RAM clear.

928
Axe / Re: Routines
« on: July 26, 2010, 05:09:50 pm »
builderboy, i could make the routine compress half-byte tilemaps, but it would be more complicated, so i just stuck with one tile as being equal to one byte, though my compression is preferably used in maps that have 15 or less tiles, and have long runs of the same data. if you need more than 15 tiles and have very, very long runs of the same data,  you could use a method where one byte holds frequency, and the next holds the tile number.
so [43050320] would represent tile 5 67 times, then tile 32 3 times. but that can be very memory inefficient unless you have many runs of data, specifically runs of data that last more than 4 tiles.

929
The Axe Parser Project / Re: Axe Parser
« on: July 26, 2010, 04:42:11 pm »
yes, you can write to external variables.
Code: [Select]
"Str1"->Str1
"0123456789ABCDEF"->Str2
GetCalc(Str1,16)->A    .the OS var Str1 is created and A is now a pointer to the beginning of the data
Copy(Str2,A,16)

after you exit the program, Str1 will have "0123456789ABCDEF" in it.

930
Axe / Re: Routines
« on: July 26, 2010, 04:28:04 pm »
RLE compression. compresses as the first half-byte is the frequency, and the second is the tile number. this routine exports the data as a hex string in Str1.

Code: (map data) [Select]
.Uncompressed (24 bytes. each pair is a byte.)
[010101010101
[010303000001
[010200000201
[010101010101
.Compressed (8 bytes. each pair is a byte.)
[7123202112201271->GDB1

Code: (Routine) [Select]
.ROUTINE
[010101010101->GDB1
[010303000001
[010200000201
[010101010101
"0123456789ABCDEF"->Str1
"Str1"->Str2
GetCalc(Str2,16)->M    .16 is the size because our compressed map is 8 bytes, which is 16 half-bytes.
0->C->D
For(G,0,23)    .23 is the size of the map minus one.
If {GDB1+G}->A={GDB1+G+1} and (C!=14)  . "!=" is the does not equal sign
C+1->C
Else
{Str1+C+1}->{M+D}
{Str1+A}->{M+D+1}
D+2->D
0->C
End
End

Pages: 1 ... 60 61 [62] 63 64 ... 82