CodeWalrus

Development => Calculators => Calculator News, Coding, Help & Talk => Topic started by: Ephraim Becker on April 13, 2015, 06:33:38 PM

Title: Drawing to the buffer and screen
Post by: Ephraim Becker on April 13, 2015, 06:33:38 PM
How do I draw to the buffer and screen without a #include file for both the ti 84 Plus and ti 84 Plus CSE? I don't believe plotSScreen works without a #include file.
Title: Re: Drawing to the buffer and screen
Post by: Snektron on April 13, 2015, 06:37:05 PM
No, in the include file "PlotSScreen" is linked to an address. If you want to draw with out an include you should just use the address of PlotSScreen, which is 9340h (the h for hex) for the TI 83+/84+. Then, once you've changed the pixels to your needs, you need some code to do the actual uploading to the display. I recommend using FastCopy: http://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:Fastcopy (http://wikiti.brandonw.net/index.php?title=Z80_Routines:Graphic:Fastcopy)
Title: Re: Drawing to the buffer and screen
Post by: Ephraim Becker on April 13, 2015, 06:38:45 PM
What address is (penRow) and (penCol) linked to?
Title: Re: Drawing to the buffer and screen
Post by: Snektron on April 13, 2015, 06:41:01 PM
86D8h and 86D7h. You can just look it up for yourself http://wikiti.brandonw.net/index.php?title=83Plus:OS:ti83plus.inc (http://wikiti.brandonw.net/index.php?title=83Plus:OS:ti83plus.inc)
Title: Re: Drawing to the buffer and screen
Post by: Ephraim Becker on April 13, 2015, 06:48:00 PM
Will these addresses work without a #include file?
Title: Re: Drawing to the buffer and screen
Post by: DarkestEx on April 13, 2015, 06:54:52 PM
Quote from: Ephraim Becker on April 13, 2015, 06:48:00 PM
Will these addresses work without a #include file?
I guess they will. The include file only contains some labels and preprocessor directives to make life easier.
You could even write assembly by hand without any assembler, but that wouldn't make much sense.
Title: Re: Drawing to the buffer and screen
Post by: Dream of Omnimaga on April 13, 2015, 10:46:02 PM
Wouldn't using direct addresses pose a problem in the event that TI would change the calculator hardware? Remember what happened with the Casio FX-9860GII in 2011 and the TI-84+ in 2007 (although in the latter case, only programs using the extra RAM pages were affected).
Title: Re: Drawing to the buffer and screen
Post by: DarkestEx on April 13, 2015, 10:48:46 PM
Quote from: DJ Omnimaga on April 13, 2015, 10:46:02 PM
Wouldn't using direct addresses pose a problem in the event that TI would change the calculator hardware? Remember what happened with the Casio FX-9860GII in 2011 and the TI-84+ in 2007 (although in the latter case, only programs using the extra RAM pages were affected).
Yeah, you would lose alot of flexibility. But basically it is possible, but not recommended.
Title: Re: Drawing to the buffer and screen
Post by: Ephraim Becker on April 13, 2015, 11:01:05 PM
Then what's the best way of drawing to the screen and buffer without a #include file?
Title: Re: Drawing to the buffer and screen
Post by: pimathbrainiac on April 13, 2015, 11:03:34 PM
Quote from: Ephraim Becker on April 13, 2015, 06:33:38 PM
How do I draw to the buffer and screen without a #include file for both the ti 84 Plus and ti 84 Plus CSE? I don't believe plotSScreen works without a #include file.
Quote from: Ephraim Becker on April 13, 2015, 11:01:05 PM
Then what's the best way of drawing to the screen and buffer without a #include file?
You literally asked the same question twice... <_<

Quote from: Ephraim Becker on April 13, 2015, 06:48:00 PM
Will these addresses work without a #include file?
Yes. addresses are not dependent on #include files.
Title: Re: Drawing to the buffer and screen
Post by: Ephraim Becker on April 13, 2015, 11:08:35 PM
Then what's the difference of using addresses and using the port $10 and port $11?
Title: Re: Drawing to the buffer and screen
Post by: Ephraim Becker on April 14, 2015, 12:44:19 AM
Is there any tutorials on the Toshiba T6A04 (the TI 83\84 Plus LCD Driver)?
Title: Re: Drawing to the buffer and screen
Post by: tr1p1ea on April 14, 2015, 02:23:47 AM
Drawing on the TI-84+ and TI-84+CSE is different considering that one is b&w and the other is colour.

Here is a tutorial for the 83/84+: http://tutorials.eeems.ca/ASMin28Days/lesson/day26.html

It is recommended that you work through the entire tutorial chronologically however.
Title: Re: Drawing to the buffer and screen
Post by: Duke "Tape" Eiyeron on April 14, 2015, 10:38:42 AM
COuld you please avoid double posting? there is two edit buttons with that icon (http://codewalr.us/Themes/CodeWalrus/images/icons/modify_inline.gif). Double (or more) posting increases clutter and makes more things messy, okay? ^^

EDit : If you want more explanations, double posting is tolerated when last post was posted more than 24hours befores or when you are in your own project's topic and giving news, releases, etc.
Title: Re: Drawing to the buffer and screen
Post by: Ephraim Becker on April 19, 2015, 03:35:00 PM
Quote from: z80 heaven
Writing to a Buffer (good)

Now, we will introduce the best way to draw pictures. This involves a buffer. A buffer is an array of data. How it's structured and what the data means in the buffer is programmer defined (what the program does with it), but be careful because if you want to allocate (not use for any other purpose) a section of memory for a buffer that's structured 20*20, because z80 doesn't recognize "variables", you can inadvertently use it as a 4*100 buffer. Of course, then, your data would make no sense until you used it as a 20*20 buffer again. Here are some good tips on using buffers:

    Create variables that point to:
        Top of buffer (first byte)
        End of buffer (or define the length)
        Pointer (where you are looking at in the buffer)
    Define the buffer in a safe location of memory
        In a saferam area (appbackupscreen, etc.)
        In the program itself (if you're willing to sacrifice space)
        In a location of memory that the calculator already uses for your purposes (plotsscreen for picture buffer)


I don't really understand this so well. Can someone please explain this to me better?
Title: Re: Drawing to the buffer and screen
Post by: Duke "Tape" Eiyeron on April 20, 2015, 04:23:46 PM
A buffer is more or less like a sink. YOu have a tap where comes the water (the data input), you have the sink itself to contain up to an amount of water (the data buffer) and the hole where the water flows out (the data output).

The buffer is some space you allocate to make up for the difference you can have between the input and the output. let's say that your input flows faster than your output, the buffer is present to avoid having to stop the input each time you want to get some data. It allow the output or the input to wait until one of both can interact, whatever their speeds.