Commit graph

4256 commits

Author SHA1 Message Date
Michael Sevakis
e86ea6bdb9 Get test_codec synced with changes in 6c868dd
Change-Id: I47c5ae09ff620b46e42463654e1a073b59fb2191
2017-12-08 21:32:54 -05:00
Franklin Wei
d728b9775b puzzles: fix off-by-one in blitter clipping
Nobody to blame except myself for this one...

Change-Id: I8446b564c3c060411c46675e9baac1c72437c39a
2017-11-24 20:31:45 -05:00
Franklin Wei
f51544a0e5 puzzles: polish mouse mode
Reduces lag when dragging. Also throws some comments in.

Change-Id: Ibd0d95e94200ae6de8258ce8d2e001c931161385
2017-11-24 20:31:45 -05:00
Franklin Wei
ab6e40b977 puzzles: fix copy-paste typo
Change-Id: I09d065574a02a541c43c1a78d92e50a80b5e2ae0
2017-11-24 20:31:45 -05:00
Franklin Wei
75d2e1f35c puzzles: add missing file
Change-Id: I72444b57abb7b7327891b17a22fbe2cafdf724a6
2017-11-21 19:54:14 -05:00
Franklin Wei
c1dc957195 puzzles: clean junk files
These are really not needed.

Change-Id: I8aa8d648c363c657ca104fc9876b3c63558c5608
2017-11-21 19:29:46 -05:00
Franklin Wei
e8e85c5762 puzzles: resync with upstream; add Loopy and Palisade, mouse mode
This brings a various small changes to the drawing and input code,
as well as a brand new "mouse mode", where input goes to a virtual
mouse cursor. Only Loopy has this mouse mode enabled by default,
while other games have it hidden away under the debug menu. Some
changes by me to Palisade were required to make it playable; those
are included here as well. Right now, sgt-net is pushing the c200v2's
upper limit on size and may have to be dropped in a future commit.

Change-Id: I495d2a2125462c2985aec1ffbc54bbe3fe5133bd
2017-11-21 19:29:45 -05:00
Michael Sevakis
aced667f48 Undo hacks to meant to get around string formatting limitations
The new vuprintf makes unnecessary workarounds due to formatting
limitations. I checked grep output for whatever appeared to fit
but it's possible I missed some instances because they weren't
so obvious.

Also, this means sound settings can dynamically work with any
number of decimals rather than the current assumption of one or
two. Add an ipow() function to help and take advantage of dynamic
field width and precision. Consolidate string formatting of sound
settings.

Change-Id: I46caf534859dfd1916cd440cd25e5206b192fcd8
2017-11-21 05:01:14 -05:00
Franklin Wei
d9a55ac816 puzzles: fix blitting when zoomed
Both blitter_save() and blitter_load() functioned incorrectly when
zoomed in -- blitter_save() would copy from the wrong location, and
blitter_load() would ignore the y-coordinate of the destination.

Change-Id: I7c85debf5953575f72c4a81e3dbcf514202c3aed
2017-11-04 12:09:16 -04:00
Franklin Wei
7f1dd6f593 puzzles: clarify code and documentation
This adds no functionality, but instead cleans up the source and adds
some more substantial documentation.

Change-Id: I77328c171a61db7729bdf928ba094cfbed4ec0dd
2017-11-04 11:14:18 -04:00
Franklin Wei
9f62373735 puzzles: fix title drawing
This fixes two separate bugs: The first was that the drawmode was not
reliably set when drawing the title, occasionally leading to a black
rectangle where the title should be; the second that the title bar's
space wasn't being cleared before drawing, leading to artifacts when
the length of the title string changed.

Change-Id: I3859125b14d568e1098b095ab134645a504b2d45
2017-11-04 11:14:17 -04:00
Franklin Wei
65e7617ab6 puzzles: add an interaction mode to the "Zoom In" feature
This makes it possible to play the game while zoomed in. Read the
manual entry if you want to know more.

Change-Id: Iff8bab12f92ebd2798047c25d1fde7740aa543ce
2017-10-30 21:25:33 -04:00
Franklin Wei
1f3e70aafc puzzles: sync with upstream
This includes the fix for Map's incorrect cursor positioning when
zoomed in.

Change-Id: I7d7d1f3031bbe1390e89340039996f99efaa8ef5
2017-10-29 17:39:29 -04:00
Franklin Wei
47ebf623cb puzzles: improve zoom rendering
This adds colored font rendering, as well as a workaround for font
loading while zoomed. Additionally, the frontend has been modified to
match the new upstream API.

Change-Id: I8c3fe57e6854f176485bf792cf4778cd54a21674
2017-10-29 12:49:39 -04:00
Franklin Wei
9ba899f850 puzzles: fix clipping and 24-bit handling
Should fix the build.

Change-Id: I68f06702570389c2c9d0d76acc064c324cac457b
2017-10-27 20:17:28 -04:00
Franklin Wei
8b8e25f195 puzzles: add "Zoom In" option to improve usability
This adds a "Zoom In" option to the pause menu of each puzzle, which
displays the puzzle at triple size (subject to change). This should
help with tiny screens, modulo memory concerns associated with
allocating the temporary framebuffer to which drawing operations are
redirected. Coincidentally, there's an upstream bug with Map that
causes the cursor's positioning to be incorrectly displayed when
zoomed.

Change-Id: Ic8b7c2942acf558e295f4271dd7dc458cd336895
2017-10-27 19:10:53 -04:00
Franklin Wei
3ad9caeb2a puzzles: make Untangle's input code return UI_UPDATE instead of ""
This was changed upstream and slipped by when I was merging the
changes.

Change-Id: I3a53cd2db5a5cd2ffef52719a048b8ff4c80d1aa
2017-10-24 19:36:19 -04:00
Franklin Wei
a644489ccf puzzles: adapt frontend to upstream changes
Change-Id: Idd911ac4ac6c2efa3c6b064be6058979d7a15447
2017-10-23 17:41:11 -04:00
Franklin Wei
ef1306764e puzzles: resync with upstream
There have been some improvements with regard to small screen sizes,
which will be nice to have.

Change-Id: I30c740514156258d2818fde325c1a751500f7611
2017-10-23 17:19:29 -04:00
Amaury Pouly
7a8c9daf7e test_mem: increase dram buffer if possible, cap number of iterations
Change-Id: Ie034433184d0dfcd50e3b783b2b6d0b6a44d001f
2017-10-22 15:36:13 +02:00
Michael Sevakis
b2a373eb64 Replace fp_sqrt function with one that only uses shift, or and sub.
Simply extends the current isqrt() to be able to do fractional bits
and improves the initial estimate using clz(). iqrt() itself is
no more and is equivalent to fp_sqrt(x, 0). The original also had
a small bug where the guess comparision should have been >=, not >.

Uses no large integer math or division and is very accurate
(simply returns a truncated fraction).

Change-Id: I2ae26e6505df1770dc01e56220f7385369f90ae9
2017-10-01 20:29:38 -04:00
Franklin Wei
23e7d0ef19 xworld: support diagonal buttons on Zen X-Fi
Change-Id: Ia738ecd2a39c0c0772d6f939d549dd5d0eda055e
2017-09-30 20:50:33 -04:00
Franklin Wei
bb55fceb70 Remove old keymaps from xworld and puzzles
They've been replaced by the one in apps/plugins/lib/

Change-Id: Icb54ec4caae1149dfddad8c754087686792a8bc2
2017-09-30 20:49:18 -04:00
Franklin Wei
752f7b1698 Harmonize plugin keymaps
Aims to provide a lib/keymaps.h for plugins needing simple button
functionality beyond that provided by PLA. Currently used by puzzles
and xworld.

Change-Id: Icb3493aaf176d401762de834dd48fc76a3824c5a
2017-09-30 20:13:49 -04:00
Franklin Wei
b9386109e8 puzzles: resync with upstream
This brings puzzles to upstream commit 84d3fd2.

Change-Id: I808a197f868032d771fc101a15666c5ec4b9f94b
2017-09-30 20:06:50 -04:00
Franklin Wei
25a29e71d8 Silence warnings in mp3_encoder
`const' only needs to be used once (a const pointer to const data is
`const type * const').

Change-Id: I47a0d69755cb7753ac64b82b930d14b4a19b7527
2017-09-01 22:03:06 -04:00
Franklin Wei
5a724bb6dc Fix typo in goban
Pointer wasn't dereferenced as it should be.

Change-Id: I4b4993fef2290c22ab8f36ba8aafe7dcafcbfa2e
2017-09-01 22:00:59 -04:00
Franklin Wei
3a39f24b8c puzzles: remove unused overlay loader
Just cluttering the plugins directory as there is no COMBINED support
anymore.

Change-Id: I05591d457055e67cd1a01e007bec7ce77dcecb4a
2017-09-01 20:33:20 -04:00
Franklin Wei
1cd96b4931 Keybox: display the entry name along with the password
The dereference of entry->name was originally omitted, which meant
that only the password would ever be displayed.

Change-Id: If368a2d3dd9ddf0a253d28b9db5b98d639cfb30b
2017-08-27 15:43:11 -04:00
Amaury Pouly
b31ae4554a fix yellow, commit f2f1889 left a variable unused
Change-Id: I128bf509cb68860cc2c12b42d032621a5bc71008
2017-08-27 19:25:56 +02:00
Franklin Wei
3c514f8e20 puzzles: misc. changes and sync with upstream
This brings puzzles up-to-date with Simon's tree, along with the
rockbox-specific changes I made. Note that I also got rid of some
of the ugly floating-point code in rbwrappers.c and replaced it
with wrappers for our fixed-point library.

Change-Id: Ibfb79acb15517116a26de1c3ea89e025146b9e2e
2017-08-23 14:22:09 -04:00
Franklin Wei
4dd300d9f0 puzzles: remove old combined build code
We don't really need it anymore.

Change-Id: I7c8149faa6b80807ca718b73483bdb2e41830cbd
2017-08-23 14:22:09 -04:00
Franklin Wei
ec1a74a37c puzzles: faster, smaller sqrt()
Change-Id: I18e170ee49bff131fe76fa4bb1b9e0f120818b82
2017-08-23 14:22:09 -04:00
Sebastian Leonhardt
f2f1889b10 Sokoban: enable restarting level via "Select Level"
This patch disables the (deliberate) feature of "Select Level",
that selecting the current level wouldn't restart but rather
resume. (i.e. now selecting any level will always start this
from scratch).

There definitely should be a way to restart the current level
via menu. Currently the only possibility to do this is via
button presses, but (a) these are hard to remember combos, and
(b) they are not defined on all targets.
This patch is meant as a lightwight alternative to g#1356
(adding a "restart level" option to the menu).

Change-Id: I18ee5aff5c922f95c28d1edf2ba71dd2e50687d2
2017-08-23 01:15:50 +02:00
Sebastian Leonhardt
28ae700444 FS#11922: Lua game - Pixel Painter
* Changed keymaps to PLA and added to SOURCES and CATEGORIES file
* improved keymaps: implement wrap-around and key repeat
* change keymap according to screen orientation
* fix font size calculation
* use blocking button query in main loop
* replace tabs with spaces
* added manual entry
* added original author to CREDITS

Change-Id: Id67ae99cbb7a737c7f4608e278b77a389ac2ffa6
2017-08-23 00:25:11 +02:00
Franklin Wei
7944969ff7 puzzles: fix build
Change-Id: Ifb6d7938968a48a1492483b33c84050abcfb75e0
2017-08-16 15:01:38 -04:00
Franklin Wei
71850e8e69 puzzles: various useless tweaks
Change-Id: Ibf9769f99d61581b184d0ffa4ef0614eb976f0e8
2017-08-16 11:40:42 -04:00
Franklin Wei
d0c4ef4b78 puzzles: enable long-press in Map
This allows for stippling regions.

Change-Id: If8f271b66f6f350c843d6669918ea39712acd818
2017-08-16 11:40:42 -04:00
Franklin Wei
ef9c2f4457 puzzles: fix polygon drawing in Inertia
Yet another hack to accommodate our polygon algorithm...

Change-Id: Ic5d304be23d30c380b19771ab68cf01c416261b4
2017-08-16 11:40:42 -04:00
Franklin Wei
f31a400bac puzzles: add more parameter validation checks
Fixes some annoying crashes.

Change-Id: If3c293bd90e301c3e697d1e5fcb1b0aa2ea320fb
2017-08-16 11:40:42 -04:00
Franklin Wei
c78ff7f615 puzzles: fix floating-point formatting
This is pretty ad-hoc, but the only other ways are to rewrite
sprintf (which would use too much memory on the c200v2), or
implement support for floats in rockbox's formatter, neither of
which are acceptable.

Change-Id: I70d59fd3e90a16e2db9ae0a84cd8c14807f50b46
2017-08-16 11:40:42 -04:00
Franklin Wei
bf25f3e6e7 puzzles: compress extensive help text
This is only really needed to save a few bytes on the c200v2, but
since it adds negligible overhead, so it's implemented for all
targets.

A stripped down version of the LZ4 reference implementation is found
in lz4tiny.c.

Change-Id: Ib914ba71c84e04da282328662c752e533912e197
2017-08-16 11:40:37 -04:00
Franklin Wei
ca228d3d87 puzzles: cut size for c200v2
- font caching is disabled
- font table is dynamically allocated
- side effect: tlsf isn't reset between runs anymore, memory leaks will have a bigger impact

Change-Id: I0b25c22665d956895e8007883d522256010d04ab
2017-08-09 21:51:23 -04:00
Franklin Wei
51984098ef puzzles: enable Mines
It should work now that arm memset() has been fixed for negative
values. This is the last puzzle that was disabled due to a crash.
2017-07-27 19:09:50 -04:00
Franklin Wei
076cf0aa9b puzzles: new input scheme for Mines and Magnets
Both these puzzles now have long press mapped to spacebar.
2017-07-27 19:09:50 -04:00
Franklin Wei
f1b82b1acf puzzles: polish up the config menus 2017-07-27 19:09:50 -04:00
Franklin Wei
1a5149a0ae puzzles: tweak text positioning 2017-07-27 19:09:50 -04:00
Franklin Wei
aa7b168fd7 puzzles: font caching
This lets puzzles remember which fonts were loaded previously so
they can be preloaded when the puzzle is started (and the disk is
spinning), instead of while the game is being played.
2017-07-27 19:09:50 -04:00
Franklin Wei
eb43bce106 puzzles: add number chooser for integer settings
Sure beats typing on the virtual keyboard.
2017-07-27 19:09:50 -04:00
Franklin Wei
513fb8b332 puzzles: update debug menu
Add an option to visualize polygon rendering to aid in diagnosing
artifacts.
2017-07-27 19:09:50 -04:00