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

Pages: 1 ... 61 62 [63] 64 65 ... 77
931
Axe / Re: Butts Fredkin's Buffer Tutorial in Axe 1.0.2
« on: August 20, 2011, 07:29:42 pm »
I actually submitted it as a tutorial and it's in the tutorial section currently ;) and in the tutorial section, it had code tags, just when I copied it over to this thread, they didn't copy. And no problem Qwerty, I'll flesh out some concepts.

932
TI Z80 / PaintPad - On-Calc Paint and Text Editing
« on: August 20, 2011, 07:04:35 pm »
I'm starting a project, in Axe, for the TI-83/84+SE series of calcs. It's going to be a paint editor similar to/based off of mspaint (the regular paint program that comes with windows), bundled with a text editor.


The Paint program will most likely have the following graphics functions:

     Lines
     Squares/Rectangles
     Custom Polygons
     Different size brushes
     Circles
     Ovals
     Flood Fill
     Up to 4-level grayscale

and also other things, such as rectangular and free-form selection with copy/paste, invert, resize, rotate, etc.; some form an eraser / mass erase function; different levels of zoom; in-program sprite editing and inserting, and other features I can think. It will probably end up as a single-page app, that exports one or two 768 byte appvars that can be used as buffers in programs.


The Text Editor will have copy/paste, custom input as fast as I can make it (within reason), text selection, deletion, and insertion, a find/replace function (maybe) and as many lines as I can fit in the meager memory I have access to :P (compression help appreciated). It will also export to an appvar that will possibly also be computer-readable (help here will also be appreciated - might it work with Croquette?)

What do you think? This project is still only in concept phase, so I'm definitely taking feature requests into consideration.

933
Axe / Re: Butts Fredkin's Buffer Tutorial in Axe 1.0.2
« on: August 20, 2011, 06:12:10 pm »
That's pretty much why I'm still using Axe 0.5.3 :)

934
Axe / Re: Help With Nymless!
« on: August 20, 2011, 06:04:44 pm »
What the heck does this do?

E15->{L1}r

935
Axe / Butts Fredkin's Buffer Tutorial in Axe 1.0.2
« on: August 20, 2011, 05:44:37 pm »
NOTE:For this tutorial, I'm using Axe 1.0.2. Check the Commands.htm of your current version of Axe to make sure the commands are supported

So. There's this thing that you can use in Axe. It's called a Buffer, and it's basically a chunk of memory, and appvar, or some other form of an Array. By definition, it is 768 bytes in size. By using the appropriate commands in Axe Parser, buffers can be displayed on the screen of your calculator to output graphics in monochrome, 3, or 4 level grayscale.


Using the Default Buffers

In Axe, there is a location in saferam or freeram or whatever you want to call it, called L6. Check the commands list - L6 is 768 bytes in size! Perfect for a buffer. L6 (and also L3, for grayscale) are known as the Default Buffers.

Whenever you use a command such as Pt-On(X,Y,Pic1) or Pxl-On(44,36) or Drawinv or something like that, you are drawing to the Default Buffer.

Line(0,0,10,10) doesn't 'draw a Line' per se, it sets and edits data in L6, the default buffer (for more on how computers draw lines, you might want to read this). Then, when you call DispGraph, it looks at the data in L6, and displays it.

Check this out:

Code: [Select]

Repeat getkey(15)

.This command fills L6 with a bunch of zeros, 768 to be exact
ClrDraw

.Now let's edit the very first byte in L6

255->{L6}

.We set the first byte to 255, or FF in hexadecimal
.255 / 0xFF translates out to the following binary:
.11111111 (eight ones)
.So when we call DispGraph, it will display eight black pixels in the first byte of the buffer
.In other words, the top left corner

DispGraph

End


Try it! If you understand how sprites work, you can see that Pt-On just copies your sprite hex data into a buffer! Experiment with this -- you could even write your own Pt-On subroutine, completely in Axe! (not that it would be extremely useful, just fun to make)

Grayscale

So how does grayscale work in Axe? This is where the Back-Buffer comes in. L3 is referred to as the Back Buffer, or Secondary Buffer.

When you call commands such as Pt-On(X,Y,Pic1)r, it does the exact same thing as without the little r, but it draws to the Back-Buffer instead of the Default Buffer. And when you call DispGraphr, it displays all the data in L3 as gray, and all the data in L6 as black. For more on how grayscale works, I recommend reading this

And for four-level grayscale, L3 is displayed as light gray, L6 is used for dark gray, where they overlap is displayed as black, and where they are both blank is white. So to display four blocks right next to each other, progressively getting lighter, do this:

Code: [Select]

prgmEXAMPLE

.EXPROG
.Example program is an example.

[FFFFFFFFFFFFFFFF]->Pic1
.^this is just a solid block

Repeat getkey(15)

ClrDraw
ClrDraw[sup]r[/sup]

Pt-On(0,0,Pic1)
Pt-On(8,0,Pic1)
Pt-On(0,0,Pic1)[sup]r[/sup]
Pt-On(16,0,Pic1)[sup]r[/sup]

DispGraph[sup]rr[/sup]

End



Using Alternate Buffers

If you understand that Line(0,0,10,10) isn't technically drawing a line on the screen it's really just editing and setting data in a Buffer, then using Alternate Buffers should not be hard to understand. All that's different is a slight syntax change.

To initialize a buffer (let's call it GDB1, just for fun), we do the following:

Zeros(768)->GDB1

This creates an array in memory that is 768 bytes large and fills it with zeros. To clear the buffer, do the following:

ClrDraw(GDB1)

and other than that, it's really easy.

I'll just show you some code examples, instead of explaining in words.

Monochrome Buffers:

Code: [Select]
prgmMOVE
.MVMT A simple movement demo (with buffers)

0->X
0->Y

Zeros(768)->GDB1

[FFFFFFFFFFFFFFFF]->Pic1

Repeat getkey(15)

.(this input system does not react to walls)
getkey(3)+X-(getkey(2))->X
getkey(1)+Y-(getkey(4))->Y

ClrDraw(GDB1)

Pt-On(X,Y,Pic1,GDB1)

Dispgraph(GDB1)

End


The same code, with 3 level gray:


Code: [Select]
prgmMOVE
.MVMT A simple movement demo (with buffers)

0->X
0->Y

Zeros(768)->GDB1
Zeros(768)->GDB2

[FF000000000000FF]->Pic1
[00FFFFFFFFFFFF00]->Pic2

Repeat getkey(15)

.(this input system does not react to walls)
getkey(3)+X-(getkey(2))->X
getkey(1)+Y-(getkey(4))->Y

ClrDraw(GDB1)
ClrDraw(GDB2)

Pt-On(X,Y,Pic1,GDB1)
Pt-On(X,Y,Pic2,GDB2)

Dispgraph(GDB1,GDB2)

End


I'm not 100% sure on the syntax here (I use 0.5.3  ;D) but you get the idea.


Voila! You have successfully set up and used an alternate buffer system! Let me know if I was unclear on anything.

936
Axe / Re: Help With Nymless!
« on: August 20, 2011, 05:36:01 pm »
Was that the problem?

937
News / Re: OmnomIRC moved to new server
« on: August 20, 2011, 03:04:24 pm »
Is he staff on Cemetech?

938
ROM Hacking and Console Homebrew / Re: Omni Emblem
« on: August 20, 2011, 02:59:42 pm »
Name: Butts Fredkin (if that's too long, take out the space so it's ButtsFredkin)

Chibi/Portrait: Just use my avatar, if that doesn't work I can come up with something.

Class: Great Lord

Personality: Too lazy to actually interact with the outside world other than a close group of friends. However, when important things are stake, can be very loud and/or obnoxious.

Death Quote: "Crap...looks like I'm in for the ultimate bug-fix..."

Stats:
Hp
Spd
Def
Res
Str/Mag
Skl
Lck

Con: uh...5' 11", enormously fat, rear end permanently attached to a computer chair

Physical Appearance: brown hair and eyes, enormously fat, glasses (if possible), rear end permanently attached to a computer chair (also if possible), blue shirt, khaki pants, see also: Linus Torvalds

939
News / Re: OmnomIRC moved to new server
« on: August 20, 2011, 02:36:14 pm »
I emailed him about this and he said
Quote
Nope, totally me.
:-\

Wait, he's proud of it? Yeah, an apology is a loooooong ways down the road.

940
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: August 20, 2011, 02:33:46 pm »
That's what that was. What the freak. I had to resend my OS because of that.

941
Axe / Re: Help With Nymless!
« on: August 20, 2011, 02:28:09 pm »
Watch out for code sections like this:


If GetCalc(L1)->A
Disp "AN APPVAR EXISTS WITH THAT NAME"
Return
End


Because what it will do is display AN APPVAR EXISTS WITH THAT NAME really fast and then exit the program without you ever knowing. You can change that by adding this:

Code: [Select]

If GetCalc(L1)->A
Disp "AN APPVAR EXISTS WITH THAT NAME"
Repeat getkey(15)
End
Return
End


So it waits until they press clear, then returns.

942
Axe / Re: New Tilemapping Tutorial With Example
« on: August 19, 2011, 11:51:04 pm »
Oops. My bad.

943
Axe / Re: Help With Nymless!
« on: August 19, 2011, 11:31:14 pm »
Can you explain any more? Also, it's a pain, but it might be helpful to write your own input function. I think I have one somewhere I can dig up...

944
Axe / Re: New Tilemapping Tutorial With Example
« on: August 19, 2011, 11:29:31 pm »
Maybe it'd be helpful to include a tile-mapping program/utility with the source code and detailed documentation. Then again, they're fairly easy to write.

945
Introduce Yourself! / Re: Greetings Omnimaga!
« on: August 19, 2011, 11:25:51 pm »
welcome and stuff. Like ztrumpet, I program exclusively for ti-83/84+(se) calcs except I only do Axe, not TI-Basic. And as for current projects, check the sig :)

Pages: 1 ... 61 62 [63] 64 65 ... 77