summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles
AgeCommit message (Collapse)Author
2020-12-07puzzles: tooling to automate the resyncing processFranklin Wei
This adds a resync.sh script that handles most of the resyncing process: copying new sources, regenerating help, and staging for commit. I also took this opportunity to make the process more efficient and consistent by only selecting the types of files that we care about and ignoring any autogenerated temporary files that may be in the upstream tree. Change-Id: Ib0803462684b8ae3b40eec3742944e5bdb28508e
2020-12-07puzzles: update frontend for new midend_get_cursor_location semanticsFranklin Wei
midend_get_cursor_location now returns a bool indicating success. Change-Id: Ie3e7130a821b6619c829846177baf2cc6b51e3a3
2020-12-07puzzles: resync with upstreamFranklin Wei
This updates the upstream sources to include a modified get_cursor_location patch that I anticipate Simon will merge shortly. Also, I've streamlined the resync process to only copy the exact files we need to reduce clutter. Change-Id: I6a5ac60821fce346c500b101c363ae0c63c2ee95
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus
I'm currently running up against the limitations of the lcd_draw functions I want these functions to be able to be used on any size buffer not just buffers with a stride matching the underlying device [DONE] allow the framebuffer to be decoupled from the device framebuffer [DONE need examples] allow for some simple blit like transformations [DONE] remove the device framebuffer from the plugin api [DONE}ditto remote framebuffer [DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr while remote lcds may compile (and work in the sim) its not been tested on targets [FIXED] backdrops need work to be screen agnostic [FIXED] screen statusbar is not being combined into the main viewport correctly yet [FIXED] screen elements are displayed incorrectly after switch to void* [FIXED] core didn't restore proper viewport on splash etc. [NEEDS TESTING] remote lcd garbled data [FIXED] osd lib garbled screen on bmp_part [FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport [FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer [FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw) [UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear scrolling viewports no longer trigger wps refresh also fixed a bug where guisyncyesno was displaying and then disappearing [ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes (LCD_ and LCD_REMOTE_) LCD_STRIDE(w, h) same as STRIDE_MAIN LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH) test_viewports.c has an example of usage [FIXED!!] 2bit targets don't respect non-native strides [FIXED] Few define snags Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26make the plugin API frambuffer agnosticMoshe Piekarski
Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
2020-10-09puzzles: improve frontend documentationFranklin Wei
What it says on the tin. Change-Id: Idf8f520e0c8c1fab98d292f4ad94e5231578f9ce
2020-07-22keyboard add ability to specify temporary custom layoutsWilliam Wilgus
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 Wilgus
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 Wei
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 Wei
No functional changes. Change-Id: I7baa7bf37b3bdd57064c654a72d0e4e0d5600245
2020-07-07puzzles: load cached fonts unconditionallyFranklin Wei
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 Wei
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 Wei
- 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 Wei
Change-Id: I13d987cc148f053778474e99c719cc8439ec53c0
2020-06-27puzzles: fix crash when loading a corrupt saveFranklin Wei
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 Wei
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 Wei
This hack has survived for far too long. Change-Id: Idca0b647bd6e77f2afcd9a538513a6b9aa970fc7
2020-06-27puzzles: disable software poweroff in all puzzlesFranklin Wei
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 Wei
Change-Id: Ia32d41cd872140481e73b7565904fc196b7c5b01
2020-06-25puzzles: fix numerical chooser while zoomed inFranklin Wei
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 Wei
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 Wei
Change-Id: Ifea2580989f87bb1c4b357b847121bb5f66f4dfe
2020-06-25puzzles: update copyright dateFranklin Wei
Change-Id: I57c0554cb0d2951631d28e249eacb34c4b36ef21
2020-06-25puzzles: clean up error messagesFranklin Wei
Expands buffer size, and prints to LOGF. Change-Id: I6dbcf60152d69c928270023c550976b802269d95
2020-06-25puzzles: fix crashes and odd behavior on loadFranklin Wei
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 Wei
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 Wei
This should allow syncing with fully clean upstream source trees. Change-Id: Ie476a4d2ef72a411150cacc2bd45265170670e1d
2019-07-20build: Fix puzzles build due to missing dependencySolomon Peachy
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 Wei
Change-Id: I80751a41d0711c52558ba198c22d1f012998302c
2019-05-15puzzles: refactor rockbox frontendFranklin Wei
Cleaned up a bit of copy-pasted code and added some useful comments. Change-Id: I9a6f37acbeeda58b3ea8c65ee96230372400f323
2019-05-15puzzles: resync with upstreamFranklin Wei
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 Wei
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 Wei
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 Wei
Just some whitespace changes to maintain stylistic consistency. Change-Id: I50b5d52db2795cfcb4155bdffbfb80c1c3773112
2018-06-12puzzles: fix typo introduced by fbb6a2fFranklin Wei
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 Bukat
Patch provided by Aapo Tahkola. Change-Id: I37a42a950d78d6b8aa3927ec7aeb30030f7be7a5
2018-04-24puzzles: update frontend for new upstream, misc. changesFranklin Wei
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 Wei
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 Wei
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 Wei
Change-Id: Id6fd9d8dd3021f5e2cb93565d7e419aaf07f9af0
2018-04-17puzzles: save some bytesFranklin Wei
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 Wei
Disabled vprintf() call in Filling, and reordered vertices in Unequal. Change-Id: Ia3d8cd46ae3a7909b7dc2a8de762aa3173634d1e
2018-04-17puzzles: enable all the remaining gamesFranklin Wei
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 Wei
Change-Id: I6b8c18472749248508d4e5b1595b8903e687f67c
2018-03-17puzzles: add formatting to help viewerFranklin Wei
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 Wei
Nobody to blame except myself for this one... Change-Id: I8446b564c3c060411c46675e9baac1c72437c39a
2017-11-24puzzles: polish mouse modeFranklin Wei
Reduces lag when dragging. Also throws some comments in. Change-Id: Ibd0d95e94200ae6de8258ce8d2e001c931161385
2017-11-24puzzles: fix copy-paste typoFranklin Wei
Change-Id: I09d065574a02a541c43c1a78d92e50a80b5e2ae0
2017-11-21puzzles: clean junk filesFranklin Wei
These are really not needed. Change-Id: I8aa8d648c363c657ca104fc9876b3c63558c5608
2017-11-21puzzles: resync with upstream; add Loopy and Palisade, mouse modeFranklin Wei
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