Tetris for the RA8875, derived from another users implementation.
Fork of Tetris by
Tetris, adapted to the RA8875 graphics library and display.
As currently implemented, this version is defined for the 800x480 display. A number of macros can adapt it for other screen resolutions.
Further, while presently configured for landscape mode, it should be fairly easy to reconfigure it for portrait mode.
Revision 10:a09d9bb9c5c8, committed 2020-03-28
- Comitter:
- WiredHome
- Date:
- Sat Mar 28 15:34:00 2020 +0000
- Parent:
- 9:b97b336ab36a
- Child:
- 11:2bdc83648d7f
- Commit message:
- Breaking change update to RA8875 Library. Improved APIs, Improved Portrait Mode, Code Cleanup.
Changed in this revision
RA8875.lib | Show annotated file Show diff for this revision Revisions of this file |
Tetris/playGround.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RA8875.lib Sun Jul 28 03:35:36 2019 +0000 +++ b/RA8875.lib Sat Mar 28 15:34:00 2020 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/WiredHome/code/RA8875/#c7fb7a4fb42f +http://mbed.org/users/WiredHome/code/RA8875/#fb06805f447f
--- a/Tetris/playGround.cpp Sun Jul 28 03:35:36 2019 +0000 +++ b/Tetris/playGround.cpp Sat Mar 28 15:34:00 2020 +0000 @@ -15,14 +15,14 @@ #endif // Hot-Spots -static const rect_t Drop = rect_t( DROP ); -static const rect_t rLeft = rect_t( ROT_LEFT ); -static const rect_t rRight = rect_t( ROT_RIGHT ); -static const rect_t mLeft = rect_t( MOV_LEFT ); -static const rect_t mRight = rect_t( MOV_RIGHT ); -static const rect_t Replay = rect_t( REPLAY ); -static const point_t orig = point_t(ORIGIN_X,ORIGIN_Y); -static const point_t sb_orig = point_t(SB_X, SB_Y); +static const rect_t Drop = { DROP }; +static const rect_t rLeft = { ROT_LEFT }; +static const rect_t rRight = { ROT_RIGHT }; +static const rect_t mLeft = { MOV_LEFT }; +static const rect_t mRight = { MOV_RIGHT }; +static const rect_t Replay = { REPLAY }; +static const point_t orig = { ORIGIN_X,ORIGIN_Y }; +static const point_t sb_orig = { SB_X, SB_Y }; // Convert cell coordinates to a rectangle location // rect_t CellPosToRect(int x, int y, point_t o = orig, int bs = BLOCK_SIZE) { @@ -139,7 +139,7 @@ TFT.init(LCD_W,LCD_H,LCD_C); TFT.TouchPanelInit(); TFT.Backlight_u8(BL_NORM); - TFT.SetOrientation(); + TFT.SetGraphicsOrientation(); }