diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2016-11-04 23:11:31 -0400 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2016-11-04 23:11:31 -0400 |
| commit | 740057a09ccf6d4d14a64095e3e2de04af7c684c (patch) | |
| tree | 92470f04e7df69b2514f446e062a012ee5082e58 /apps/plugins | |
| parent | 2dd8aee4e7a270fc6d978fd482aea59f2ade2bd7 (diff) | |
| download | rockbox-740057a09ccf6d4d14a64095e3e2de04af7c684c.zip rockbox-740057a09ccf6d4d14a64095e3e2de04af7c684c.tar.gz rockbox-740057a09ccf6d4d14a64095e3e2de04af7c684c.tar.bz2 rockbox-740057a09ccf6d4d14a64095e3e2de04af7c684c.tar.xz | |
rewrite xworld input, copied from rockdoom
Change-Id: Ia69bf2aac867d75c11986d17eeeca55728a3ad91
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/xworld/engine.c | 3 | ||||
| -rw-r--r-- | apps/plugins/xworld/sys.c | 38 | ||||
| -rw-r--r-- | apps/plugins/xworld/video_data.c | 3 | ||||
| -rw-r--r-- | apps/plugins/xworld/vm.c | 2 |
4 files changed, 24 insertions, 22 deletions
diff --git a/apps/plugins/xworld/engine.c b/apps/plugins/xworld/engine.c index 441ab4a..369d41d 100644 --- a/apps/plugins/xworld/engine.c +++ b/apps/plugins/xworld/engine.c @@ -61,6 +61,9 @@ void engine_run(struct Engine* e) { engine_processInput(e); vm_hostFrame(&e->vm); + + /* only yield() in the whole game :P */ + rb->yield(); } } diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c index 942ab3a..337b514 100644 --- a/apps/plugins/xworld/sys.c +++ b/apps/plugins/xworld/sys.c @@ -744,64 +744,64 @@ void sys_processEvents(struct System* sys) /* copied from doom which was copied from rockboy... */ unsigned released = ~btn & oldbuttonstate; unsigned pressed = btn & ~oldbuttonstate; - oldbuttonstate = newbuttonstate; + oldbuttonstate = btn; if(released) { - if(btn & BTN_FIRE) + if(released & BTN_FIRE) sys->input.button = false; - if(btn & sys->keymap.up) + if(released & sys->keymap.up) sys->input.dirMask &= ~DIR_UP; - if(btn & sys->keymap.down) + if(released & sys->keymap.down) sys->input.dirMask &= ~DIR_DOWN; - if(btn & sys->keymap.left) + if(released & sys->keymap.left) sys->input.dirMask &= ~DIR_LEFT; - if(btn & sys->keymap.right) + if(released & sys->keymap.right) sys->input.dirMask &= ~DIR_RIGHT; #ifdef BTN_DOWN_LEFT - if(btn & sys->keymap.downleft) + if(released & sys->keymap.downleft) sys->input.dirMask &= ~(DIR_DOWN | DIR_LEFT); #endif #ifdef BTN_DOWN_RIGHT - if(btn & sys->keymap.downright) + if(released & sys->keymap.downright) sys->input.dirMask &= ~(DIR_DOWN | DIR_RIGHT); #endif #ifdef BTN_UP_LEFT - if(btn & sys->keymap.upleft) + if(released & sys->keymap.upleft) sys->input.dirMask &= ~(DIR_UP | DIR_LEFT); #endif #ifdef BTN_UP_RIGHT - if(btn & sys->keymap.upright) + if(released & sys->keymap.upright) sys->input.dirMask &= ~(DIR_UP | DIR_RIGHT); #endif } if(pressed) { - if(btn & BTN_FIRE) + if(pressed & BTN_FIRE) sys->input.button = true; - if(btn & sys->keymap.up) + if(pressed & sys->keymap.up) sys->input.dirMask |= DIR_UP; - if(btn & sys->keymap.down) + if(pressed & sys->keymap.down) sys->input.dirMask |= DIR_DOWN; - if(btn & sys->keymap.left) + if(pressed & sys->keymap.left) sys->input.dirMask |= DIR_LEFT; - if(btn & sys->keymap.right) + if(pressed & sys->keymap.right) sys->input.dirMask |= DIR_RIGHT; #ifdef BTN_DOWN_LEFT - if(btn & sys->keymap.downleft) + if(pressed & sys->keymap.downleft) sys->input.dirMask |= (DIR_DOWN | DIR_LEFT); #endif #ifdef BTN_DOWN_RIGHT - if(btn & sys->keymap.downright) + if(pressed & sys->keymap.downright) sys->input.dirMask |= (DIR_DOWN | DIR_RIGHT); #endif #ifdef BTN_UP_LEFT - if(btn & sys->keymap.upleft) + if(pressed & sys->keymap.upleft) sys->input.dirMask |= (DIR_UP | DIR_LEFT); #endif #ifdef BTN_UP_RIGHT - if(btn & sys->keymap.upright) + if(pressed & sys->keymap.upright) sys->input.dirMask |= (DIR_UP | DIR_RIGHT); #endif } diff --git a/apps/plugins/xworld/video_data.c b/apps/plugins/xworld/video_data.c index e658c17..47acdca 100644 --- a/apps/plugins/xworld/video_data.c +++ b/apps/plugins/xworld/video_data.c @@ -126,9 +126,10 @@ uint8_t video_font[FONT_SIZE] = { 0x00, 0xA0, 0x10, 0x80, 0x10, 0x80, 0x50, 0x00, /* DEL */ }; +/* default bogus strings */ struct StrEntry video_stringsTableEng[MAX_STRING_TABLE_SIZE] = { { 0x001, "B A N A N A 2000" }, - { 0x002, "Copyright } 2014 Banana Corporation \nGPLv2\n\nBUNIX Revision 3.14" }, + { 0x002, "Copyright } 2016 Franklin Wei, Benjamin Brown \nGPLv2\n\nBUNIX Revision 3.14" }, { 0x003, "1" }, { 0x004, "3" }, { 0x005, "." }, diff --git a/apps/plugins/xworld/vm.c b/apps/plugins/xworld/vm.c index 1b070fc..71320bc 100644 --- a/apps/plugins/xworld/vm.c +++ b/apps/plugins/xworld/vm.c @@ -608,8 +608,6 @@ void vm_executeThread(struct VirtualMachine* m) { { (vm_opcodeTable[opcode])(m); } - - rb->yield(); } } |