Commit Graph
72 Commits
Author SHA1 Message Date
root 2688dd8738 Make sure all PROGMEM data is const. 2013-08-30 22:46:36 +00:00
root e208b08fe0 Fix rotation of the long bar.
Use the Sega scoring algorithm.
TODO: Currently there is no way to drop a piece.
2013-08-30 12:18:59 +00:00
root 300f9daa9c Size redux. 2013-08-30 10:11:01 +00:00
root c69ec1c17c Make the pieces rotate the same as the original game.
Also make them start at the top of the screen.
2013-08-30 10:09:43 +00:00
root 246d97edab Size redux, and fix a few bugs in Scroll90(). 2013-08-30 08:49:06 +00:00
root 26638bb958 Compress the figure data and move it to PROGMEM. 2013-08-30 07:59:49 +00:00
root 594ac11810 Remove all the dynamic allocation.
Randomize the starting orientation of the piece.
2013-08-30 07:43:00 +00:00
root 0ca4b0790e Size redux. 2013-08-30 07:08:48 +00:00
root d69584a697 Use const. 2013-08-30 06:33:44 +00:00
root e60385b6c6 Move the font table into PROGMEM.
Compress the column and row into a single byte.
Fix up some of the problems with the lowercase characters, though they're not
enabled by default.

Trims FontTest by 458 bytes of text and 116 bytes of data.
2013-08-30 05:58:15 +00:00
root 70485a5154 Eliminate a display glitch. 2013-08-30 05:57:52 +00:00
root d3c0154dcd Don't call randomSeed() on every reseed; this was confining us to only 256
sequences ever displayed.
2013-08-30 03:28:03 +00:00
root e9673ef446 If nothing has changed for a few cycles, reseed. 2013-08-30 03:19:45 +00:00
root 9bf17aebf5 Reduce another int to uint8_t. 2013-08-30 03:00:37 +00:00
root a570bd9546 The video buffer is already pre-cleared by virtue of being in the BSS, so
don't bother to do it in Init().
It's harmless to allow a Flip() in single-buffer mode.
Saves another 62 bytes of code.
2013-08-30 02:31:32 +00:00
root 1d80dc2d45 Fix off by one error. 2013-08-30 02:10:49 +00:00
root 7f6902380c Minor cleanup, including:
* If DOUBLE_BUFFER is commented out, don't bother to use extra pointer for
  the display buffer.
* There's no need to wait for a buffer flip when starting up.  It's fine to
  display the first (blank) frame indefinitely.
* Don't bother using delay() while waiting for flips.  All it does is bloat
  the code.
2013-08-30 02:06:28 +00:00
root 7ee75f9a7c Since the prescalers are determined at compile time, make them const
variables.
2013-08-30 01:27:59 +00:00
root 6dd8c97bb1 A few more consts reduces code size further. 2013-08-30 01:02:20 +00:00
root 5c69e1d924 Whoops, the font code uses negative coordinates to draw characters partially
off the screen.
2013-08-30 00:53:38 +00:00
root e4f49abb82 Reduce some type sizes, use DISPLAY_ROWS/DISPLAY_COLS more uniformly. 2013-08-30 00:38:09 +00:00
root e088707272 Slight performance improvement, more noticeable at 8MHz. 2013-08-29 04:02:34 +00:00
root 4c7776655a Replace some of the math in SetBrightness() with a simpler, but exactly
equivalent, formula.  Interestingly, this doesn't change the compiled code
size--perhaps the compiler is smarter than I thought.  At least it's easier
to understand now.
2013-08-27 04:24:51 +00:00
root b323909c49 For SHADES==2 or 8, use precomputed exponents. Saves 716 bytes of code for
SHADES==8; the compiler already optimized to ~the same code for SHADES==2,
so there is no change there.
2013-08-27 03:43:29 +00:00
root 72c03d0a77 Fix another integer overflow on 328 chips. Still needs work on others. 2013-08-27 03:00:21 +00:00
root 6ccc8712cd Leonardo support from Wharn Cliff. 2013-08-26 17:50:02 +00:00
root 32cda6dc2c Minor cleanup: reindent, use _BV(). 2013-08-26 17:44:24 +00:00
root 75d3cae798 Purge prog_uchar, for compatibility with GCC 4.7. 2013-08-26 17:32:52 +00:00
root 655c9934f8 Strobe the array in 12 cycles rather than 24, doubling the strobe rate.
This has the nice side effect of greatly simplifying the ISR code  
(especially for the Mega).

Rework the timer setup so the prescaler information used by SetBrightness()
is determined based on the CPU frequency.  A few points:  
* The prescaler setup in Init() was ~completely ignored before, because it
  was overwritten on the first interrupt with info from SetBrightness(),
  based on {fast,slow}Prescaler.
* This has almost no effect on a 16MHz part (i.e. virtually all Arduinos) at
  full brightness, because it sets {fast,slow}Prescaler to the same values
  as before.
* The library now compiles again for the ATmega8 (Arduino NG), but I have no
  way to test it.
2013-08-24 03:33:40 +00:00
root c0b3b2c663 Clean up the previous a bit. 2013-08-21 18:10:29 +00:00
root 8cd7f6f0d0 Modified the algorithm so it can scroll text continuously with no funky end
condition.
2013-08-21 18:03:32 +00:00
root c03aa14156 The display wasn't properly updated during a reseed, sometimes leaving weird
glitches like a single apparently alive cell.

Also reduced the code size a bit.
2013-08-21 07:14:52 +00:00
root 0d7daf3b9c Experimental: Allow commenting out DOUBLE_BUFFER and/or GRAYSCALE to remove
the relevant code.  In particular, turning off both reduces the video buffer
RAM from 336 bytes to 24.
2013-08-20 18:28:46 +00:00
root 2853bbb288 Also fix the last row for Draw90(). 2013-08-20 17:59:43 +00:00
root 134730bfd4 Move ledMap[] into PROGMEM, saving precious RAM. 2013-08-20 17:44:47 +00:00
root b2b335ce0e Undef MEASURE_ISR_TIME. 2013-08-20 07:36:25 +00:00
root 5067125687 Change the grayscale curve to something that seems subjectively better. 2013-08-20 06:54:34 +00:00
root 99638f81c5 Remove unneeded Serial.Begin(). 2013-08-20 06:43:24 +00:00
root 796e2e6b15 Fix drawing in the last row (per issue 28). 2013-08-20 06:19:14 +00:00
root 8ba1f20048 More cleanup to LedSign::SetBrightness(). Reduces code size another 82 bytes. 2013-08-20 06:03:03 +00:00
root c4198ad518 Make these run in double buffer mode. 2013-08-20 05:56:27 +00:00
root 1cd3d973ba Rename these so that the Arduino IDE shows them in the examples. 2013-08-20 05:49:47 +00:00
root ef824cdf00 Make this actually compile again. 2013-08-20 05:48:18 +00:00
root 7f827f214e Patch from issue 34 (updated from issue 16).
Add Mega 1280/2560 support.
2013-08-20 05:41:32 +00:00
root c96d9da167 Patch from issue #33.
Fix off by one errors that were sending too large a value to LedSign:Set()
for the grayscale level.
2013-08-20 05:38:46 +00:00
root c36882dfa2 Patch from Issue #32.
This patch reduces the code size and improves the CPU performance of
Charliplexing.cpp by:
* removing zeroed data in videoPage
* precalculating information for LedSign::Set()
* removing unneeded register writes in TIMER2_OVF_vect()
* using a roving pointer to access the display buffer rather than recalculating the array index each time
* eliminating the extra blank interval (1/8 display cycles)
* eliminating an extra display “cycle” (which could also display garbage)

Also fixed several bugs in LedSign::SetBrightness(), which caused weird
grayscale gradiations and reduced brightness by not using a 100% duty cycle
for the maximum setting.
2013-08-20 05:35:53 +00:00
zkarcher 7d9cd5726b Added two grayscale examples: DoubleHelix and Plasma. 2012-08-14 21:03:19 +00:00
thilo.alexander d69e8f9227 Move LoLShield remote control tool into lolcomm sketch dir
The remote control command line application resided in
    parallel to all the other LoLShield sketches but is
    actually not a sketch but a Linux application. This change 
    moves the tool into a subdirectory below the lolcomm
    sketch.

    Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
2012-01-15 05:30:26 +00:00
thilo.alexander 9ef886788e Introducing LoLcomm - set LEDs via the serial port.
LoLcomm is an example application which enables you to set individual 
    LEDS, or set the whole shield via the serial port. You can also pulse
    the shield, or pulse individual LEDs (using grayscale).

    I also provide a Linux command line tool for remote-controlling the 
    LED shield.

    This enables you to play around with LED patters and even to script 
    your shield.

    Have fun!

    Signed-off-by: Thilo Fromm <kontakt@thilo-fromm.de>
2012-01-13 19:33:53 +00:00
thilo.alexander e9dea8b2b7 Removed unnecessary serial initialisation. 2012-01-13 17:54:37 +00:00