summaryrefslogtreecommitdiffstats
path: root/apps/plugins/puzzles
AgeCommit message (Collapse)AuthorFilesLines
2020-10-09puzzles: improve frontend documentationFranklin Wei1-7/+195
What it says on the tin. Change-Id: Idf8f520e0c8c1fab98d292f4ad94e5231578f9ce
2020-07-22keyboard add ability to specify temporary custom layoutsWilliam Wilgus1-1/+1
rb core allows you to load custom keyboard layouts this patch adds the ability to load a keyboard layout in a buffer the custom layout is temporary and does not overwrite the current layout use like so: unsigned short kbd[64]; unsigned short *kbd_p = kbd; if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd))) kbd_p = NULL; rb->kbd_input(buf,sizeof(buf), kbd_p); Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-19do_menu pass internal synclist reference to callbackWilliam Wilgus1-1/+4
keep running into the rigid nature of do_menu it isn't too bad when you don't need voice but once you do the fun awaits do_menu likes to talk on menu enter which is in a loop when you use do_menu I would like to move the processing to the callback TOO BAD you only get an action and the menu_item_ex struct you sent it when calling the function Change-Id: Iaefd0cc133435d675b7dd27a558c504d6ccb327a
2020-07-14puzzles: always reset input state before pause menuFranklin Wei1-3/+3
We were improperly conditioning the state reset with `do_pausemenu'. We should reset the input state no matter what. Change-Id: Iaafc59b95e9f1f053b57a34f0f28f7c672c0e327
2020-07-14puzzles: more verbose debug output in font loadingFranklin Wei1-3/+38
No functional changes. Change-Id: I7baa7bf37b3bdd57064c654a72d0e4e0d5600245
2020-07-07puzzles: load cached fonts unconditionallyFranklin Wei1-4/+5
This works around an odd issue in Mines involving the zoom feature. The chain of events leading to it is rather convoluted: 1. No save game is found, so no fonts are loaded from disk. 2. A new game is started. 3. The user selects the "Zoom" option. 4. The allocation of the zoom framebuffer causes the malloc code to grab the audiobuffer. This causes all further font_load() calls to FAIL, due to buflib allocations no longer working. 5. The user goes back to the normal view and uncovers a square. 6. Font loading fails, causing the drawing code to fall back to the system font. 7. An unrelated bug (not yet tracked down) causes font_get(FONT_UI) to return a different font. 8. font_getstringsize() returns the right size of the "wrong" font, leading to centering issues upon rb_draw_text(). The real solution to this would be to fix font_get(), but this fix should prevent the issue from happening if Mines has been run and saved at least once before. Change-Id: Ib9ad51376eeb3ca1113a1f3786124b612db88cd7
2020-07-06puzzles: Follow cursor in zoom mode and general code cleanup.Franklin Wei48-25/+834
Frontends now have a way to retrieve the backend cursor position with some changes I've submitted upstream. With this information, we can now follow the cursor around in "interaction mode" while zoomed in, eliminating (most) need for mode switching. Also does some cleanup of the frontend code. Change-Id: I1ba118f67564a3baed95435f5619b73cfa3ae87a
2020-07-02puzzles: enhancements to mouse mode, zoom featureFranklin Wei1-65/+94
- zoom now remembers position between activations (but not when exiting the plugin) - key repeat enabled when panning - moving mouse out of frame while zoomed will pan - mouse can be moved diagonally Change-Id: I39380ef7f36238700b6baa54cac036832933df67
2020-06-27puzzles: clean up and document some voodooFranklin Wei1-17/+55
Change-Id: I13d987cc148f053778474e99c719cc8439ec53c0
2020-06-27puzzles: fix crash when loading a corrupt saveFranklin Wei1-2/+1
I misread the documentation here, thinking that the pointer would be set to *point to* a null byte, not to a null pointer itself. [1] [1]: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/midend.html#identify-game Change-Id: I9b76bba9b1611dfd8e05d076a69f7554b5b74c53
2020-06-27puzzles: refuse to draw non-ASCII charactersFranklin Wei1-3/+34
We had some issues in Keen with the arithmetic operators not being rendered properly. This is still a kludge (we should intelligently search the font) but is still less ugly than the garbage it was drawing before. Change-Id: I5b957c7371b659ea6d64847145f9913b2a892e48
2020-06-27puzzles: replace menu title kludge with more elegant solutionFranklin Wei1-19/+8
This hack has survived for far too long. Change-Id: Idca0b647bd6e77f2afcd9a538513a6b9aa970fc7
2020-06-27puzzles: disable software poweroff in all puzzlesFranklin Wei1-1/+8
We have a couple games like Untangle and mouse-mode games in which the software poweroff is very annoying. Change-Id: I554b89aecf8c7cc20c6c7f305be1b8807dc9283b
2020-06-27puzzles: allow secondary select in Rectangles and MapFranklin Wei1-3/+11
Change-Id: Ia32d41cd872140481e73b7565904fc196b7c5b01
2020-06-25puzzles: fix numerical chooser while zoomed inFranklin Wei1-2/+8
We need to blit the zoom framebuffer to the screen in our chooser loop. Change-Id: Id2ba1a79b61f14cc34ca9804486f69a2b32484ff
2020-06-25puzzles: fix text centering when zooming inFranklin Wei1-3/+5
For some reason lcd_getstringsize was occasionally reverting to the system font, rather than the loaded font. This was leading to improper font sizes being reported. Change-Id: Ie5fc31de9a6a7af739beb22efc3ec1383206eaea
2020-06-25puzzles: update READMEFranklin Wei1-1/+2
Change-Id: Ifea2580989f87bb1c4b357b847121bb5f66f4dfe
2020-06-25puzzles: update copyright dateFranklin Wei1-1/+1
Change-Id: I57c0554cb0d2951631d28e249eacb34c4b36ef21
2020-06-25puzzles: clean up error messagesFranklin Wei2-4/+6
Expands buffer size, and prints to LOGF. Change-Id: I6dbcf60152d69c928270023c550976b802269d95
2020-06-25puzzles: fix crashes and odd behavior on loadFranklin Wei1-0/+2
I can't believe this has gone unnoticed for so long... We need to update the game size upon loading games. Who knew? Change-Id: I929f8139457853440ae687bd937af989fa7c6f93
2020-06-25puzzles: resync with upstreamFranklin Wei60-332/+1889
This brings the upstream version to 9aa7b7c (with some of my changes as well). Change-Id: I5bf8a3e0b8672d82cb1bf34afc07adbe12a3ac53
2020-06-25puzzles: remove dependency on gamedesc.txtFranklin Wei1-2/+2
This should allow syncing with fully clean upstream source trees. Change-Id: Ie476a4d2ef72a411150cacc2bd45265170670e1d
2019-07-20build: Fix puzzles build due to missing dependencySolomon Peachy1-1/+2
As rbcompat.h is -include'd on the command line, the mkdep script doesn't pick it up. Explicitly add the dependency to lang_enum.h to the makefile. Also add lang_enum.h to the 'make clean' target! Change-Id: I33c8ed0cd5c1d44dce02ac9285469c0e4feac00e
2019-05-15Work around DX90 compile errorFranklin Wei1-0/+1
Change-Id: I80751a41d0711c52558ba198c22d1f012998302c
2019-05-15puzzles: refactor rockbox frontendFranklin Wei3-33/+41
Cleaned up a bit of copy-pasted code and added some useful comments. Change-Id: I9a6f37acbeeda58b3ea8c65ee96230372400f323
2019-05-15puzzles: resync with upstreamFranklin Wei11-496/+2525
This brings the puzzles source to upstream commit e2135d5. (I've made my own changes on top of that.) This brings in a couple bugfixes and a new solver for Dominosa. Change-Id: I11d46b43171787832330a5e2e0d2f353f36f727d
2018-12-21puzzles: resync with upstreamFranklin Wei116-8423/+8845
This brings the code to upstream commit 3ece3d6 (I've made my own Rockbox- specific changes on top of that). Changes include using C99 `bool' throughout, and minor logic fixes for some puzzles. Change-Id: Ie823e73ae49a8ee1de411d6d406df2ba835af541
2018-06-20puzzles: resync with upstreamFranklin Wei36-31461/+144
This brings the source to upstream commit 506b073 (though I have made some extra commits on top of that). Notably this includes a fix for a double-free bug that I myself introduced upstream. Change-Id: I02671586bbc34d63e05398ee971271fed42538cf
2018-06-12puzzles: minor nitpicks to fbb6a2fFranklin Wei1-2/+2
Just some whitespace changes to maintain stylistic consistency. Change-Id: I50b5d52db2795cfcb4155bdffbfb80c1c3773112
2018-06-12puzzles: fix typo introduced by fbb6a2fFranklin Wei1-1/+1
When zoomed in, the original commit made a mono bitmap (a.k.a. text) always have the red component set to 255. This would cause drawn text to always be red. Fixed. Change-Id: Iec06256a3a783948c60c70557de042b375224448
2018-06-12Agptek Rocker: Build pluginsMarcin Bukat1-6/+25
Patch provided by Aapo Tahkola. Change-Id: I37a42a950d78d6b8aa3927ec7aeb30030f7be7a5
2018-04-24puzzles: update frontend for new upstream, misc. changesFranklin Wei5-23/+22
The upstream code changed a little bit with regard to the request_keys() API. Also, we save some bytes (especially on the c200v2) by compiling with -ffunction-sections and -fdata-sections, which allows Net to fit once again. Change-Id: I3ab30127169c73e4cd8996f0c12e1223ee18d79f
2018-04-24puzzles: update help text, make generation and testing cleanerFranklin Wei42-209/+238
This includes an upstream change to the Galaxies help text. `genhelp.sh' no longer leaves temporary files sitting around, and the self-test feature of lz4tiny.c works again. Change-Id: I787f4cb3c258baade31638d6be18f95b7aa0705e
2018-04-24puzzles: resync with upstreamFranklin Wei61-884/+32740
This brings the upstream version to b3da238 (though some of my own changes are included on top of that). Change-Id: Ida73e8cd86765413147ce891af3cc2b7aeda2b2a
2018-04-24puzzles: silence some warningsFranklin Wei42-89/+84
Change-Id: Id6fd9d8dd3021f5e2cb93565d7e419aaf07f9af0
2018-04-17puzzles: save some bytesFranklin Wei1-39/+24
This should cut just enough size off the binary to let Net still compile for the c200v2. This is probably close to the last time I'll be able to do this; I'm already resorting to dirty hacks like writing super terse error messages. Change-Id: I43344b9a601696d7ca56fc02af4a611fd9d1a150
2018-04-17puzzles: clean up for rockboxFranklin Wei2-13/+13
Disabled vprintf() call in Filling, and reordered vertices in Unequal. Change-Id: Ia3d8cd46ae3a7909b7dc2a8de762aa3173634d1e
2018-04-17puzzles: enable all the remaining gamesFranklin Wei46-103/+470
They all work now :). I merged in part of Chris Boyle's Android port of Puzzles to give the front end a way to know what keys the back end needs. This also re-syncs to the latest upstream sources. Change-Id: Ie0409bbb32f617ae5abf4f81be3b45d1552db9bb
2018-03-18puzzles: fix typoFranklin Wei1-3/+1
Change-Id: I6b8c18472749248508d4e5b1595b8903e687f67c
2018-03-17puzzles: add formatting to help viewerFranklin Wei44-6940/+7729
The help text is now processed to generate a style array to pass to the display_text library in addition to the text itself. The help text is still compressed using LZ4, and still fits on the c200v2. Change-Id: I7a3a664f90f67a1a018956c72d2b62d92b8ffd17
2017-11-24puzzles: fix off-by-one in blitter clippingFranklin Wei1-4/+4
Nobody to blame except myself for this one... Change-Id: I8446b564c3c060411c46675e9baac1c72437c39a
2017-11-24puzzles: polish mouse modeFranklin Wei1-25/+28
Reduces lag when dragging. Also throws some comments in. Change-Id: Ibd0d95e94200ae6de8258ce8d2e001c931161385
2017-11-24puzzles: fix copy-paste typoFranklin Wei1-2/+2
Change-Id: I09d065574a02a541c43c1a78d92e50a80b5e2ae0
2017-11-21puzzles: clean junk filesFranklin Wei67-27741/+0
These are really not needed. Change-Id: I8aa8d648c363c657ca104fc9876b3c63558c5608
2017-11-21puzzles: resync with upstream; add Loopy and Palisade, mouse modeFranklin Wei9-106/+493
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-04puzzles: fix blitting when zoomedFranklin Wei1-2/+5
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-04puzzles: clarify code and documentationFranklin Wei2-163/+229
This adds no functionality, but instead cleans up the source and adds some more substantial documentation. Change-Id: I77328c171a61db7729bdf928ba094cfbed4ec0dd
2017-11-04puzzles: fix title drawingFranklin Wei1-39/+12
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-10-30puzzles: add an interaction mode to the "Zoom In" featureFranklin Wei1-277/+358
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-29puzzles: sync with upstreamFranklin Wei3-30/+73
This includes the fix for Map's incorrect cursor positioning when zoomed in. Change-Id: I7d7d1f3031bbe1390e89340039996f99efaa8ef5