89 Commits
Author SHA1 Message Date
Michel 87bc3d6d8e Rebuild for use as library with PlatformIO 2023-11-03 18:47:32 +01:00
jprodgers 87417ee974 Grayscale fading and brightness changes.
Fixed the basic test code to run single brightness level by default,
added the option of the grayscale fading, and slowed it way the hell
down.
2015-05-29 16:16:29 +02:00
jprodgers 04f8c1ad87 Added PCB files
These are kind of important.
2015-05-28 19:33:27 +02:00
jprodgers 061225f87a Demo Mode Added
This is a demo mode I use at conferences. Had to change a few things to
work with the new library.
2015-05-28 18:27:22 +02:00
jprodgers fa3573bc7d Revert "Demo Mode Added"
This reverts commit 355805478f.
2015-05-28 18:17:16 +02:00
jprodgers 355805478f Demo Mode Added
Fun program that cycles through 4 animations. I use this at conferences
to show off some of the things you can do.
2015-05-28 18:15:58 +02:00
jprodgers 082e478a74 Lots of fixes.
My last commit broke all the things. I had to move things around
according to where Arduino expects the libraries now. Also fixed MyFont
to work in Grayscale mode.
2015-05-28 18:09:48 +02:00
jprodgers e5141bfbea Migration and reorganization post google code.
I've re-arranged and re-named a number of things in the move over from
google code. I've added a few animations and things as well.
2015-05-28 14:45:21 +02:00
root 1a36288d00 Minor cleanup. 2013-09-06 09:00:36 +00:00
root 2d33a35a6c On the 328, et al, use additional scaler steps to get more precision in the
frame rate.
2013-09-01 07:41:07 +00:00
root 1cd202c3ff Allow a frame rate to be set with a #define. Most of the timing goo is
determined at compile time, so no extra code is added.  Previously the
frame rate was totally erratic across CPU speeds.

Default frame rate is 80Hz, which is very close to the previous value of
81.7Hz on 16MHz 328 chips.
2013-09-01 06:27:55 +00:00
root ac1214d0c4 Finally found a solution to make the display 100% glitch free. Works on all
platforms, though code bloat is least on the 328/168.
2013-08-31 15:31:44 +00:00
root 6e376721ce Atomic access to the PORT registers on Mega and Leonardo. 2013-08-31 14:43:42 +00:00
root 23990a42e3 Use fixed point arithmetic in SetBrightness(). Saves nearly 1K of code if
the application doesn't use floating point.
2013-08-31 01:29:10 +00:00
root 59256a6115 Remove outdated comment about the lowercase section being incorrect. 2013-08-31 00:18:59 +00:00
root 9cd0d31d11 Refine the characters: CEFGNQRSWaksw
Add the characters: yz
TODO: These could use more work: egs

Also used a little preprocessor goo to compact the code.
2013-08-31 00:18:03 +00:00
root 0e1084373b Simple hack that saves another 230 bytes. 2013-08-30 22:55:29 +00:00
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