diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2016-11-11 19:03:10 -0500 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2016-11-11 19:03:10 -0500 |
| commit | 3b81775fa03c037a4d0d29483fbe70c3e36e22e9 (patch) | |
| tree | 63ddaa714640f0cf53652d800329b542f7b44b36 | |
| parent | 95cdc711cfa2b34703fa4aeea2082b36e05749a5 (diff) | |
| download | rockbox-3b81775fa03c037a4d0d29483fbe70c3e36e22e9.zip rockbox-3b81775fa03c037a4d0d29483fbe70c3e36e22e9.tar.gz rockbox-3b81775fa03c037a4d0d29483fbe70c3e36e22e9.tar.bz2 rockbox-3b81775fa03c037a4d0d29483fbe70c3e36e22e9.tar.xz | |
fix some minor stuff
Change-Id: If9e846be4c03c0f61c5813fc3522aa472a70fbc2
| -rw-r--r-- | apps/plugins/xworld/intern.c | 4 | ||||
| -rw-r--r-- | apps/plugins/xworld/intern.h | 4 | ||||
| -rw-r--r-- | apps/plugins/xworld/mixer.c | 5 | ||||
| -rw-r--r-- | apps/plugins/xworld/sys.c | 77 |
4 files changed, 11 insertions, 79 deletions
diff --git a/apps/plugins/xworld/intern.c b/apps/plugins/xworld/intern.c index 0d58100..b003333 100644 --- a/apps/plugins/xworld/intern.c +++ b/apps/plugins/xworld/intern.c @@ -23,11 +23,11 @@ #include "intern.h" #include "awendian.h" -uint8_t ICODE_ATTR scriptPtr_fetchByte(struct Ptr* p) { +uint8_t scriptPtr_fetchByte(struct Ptr* p) { return *p->pc++; } -uint16_t ICODE_ATTR scriptPtr_fetchWord(struct Ptr* p) { +uint16_t scriptPtr_fetchWord(struct Ptr* p) { uint16_t i = READ_BE_UINT16(p->pc); p->pc += 2; return i; diff --git a/apps/plugins/xworld/intern.h b/apps/plugins/xworld/intern.h index 3355f28..c1550e6 100644 --- a/apps/plugins/xworld/intern.h +++ b/apps/plugins/xworld/intern.h @@ -34,8 +34,8 @@ struct Ptr { uint8_t* pc; }; -uint8_t scriptPtr_fetchByte(struct Ptr* p) ICODE_ATTR; -uint16_t scriptPtr_fetchWord(struct Ptr* p) ICODE_ATTR; +uint8_t scriptPtr_fetchByte(struct Ptr* p); +uint16_t scriptPtr_fetchWord(struct Ptr* p); struct Point { int16_t x, y; diff --git a/apps/plugins/xworld/mixer.c b/apps/plugins/xworld/mixer.c index a09b540..47916cd 100644 --- a/apps/plugins/xworld/mixer.c +++ b/apps/plugins/xworld/mixer.c @@ -124,7 +124,7 @@ void mixer_stopAll(struct Mixer* mx) { static void mixer_mix(struct Mixer* mx, int8_t *buf, int len) { int8_t *pBuf; - //sys_lockMutex(mx->sys, mx->_mutex); + sys_lockMutex(mx->sys, mx->_mutex); /* Clear the buffer since nothing guarantees we are receiving clean memory. */ rb->memset(buf, 0, len); @@ -169,11 +169,10 @@ static void mixer_mix(struct Mixer* mx, int8_t *buf, int len) { } - //sys_unlockMutex(mx->sys, mx->_mutex); + sys_unlockMutex(mx->sys, mx->_mutex); } static void mixer_mixCallback(void *param, uint8_t *buf, int len) { - //debug(DBG_SND, "mixer_mixCallback"); mixer_mix((struct Mixer*)param, (int8_t *)buf, len); } diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c index 9f111ef..db9cab6 100644 --- a/apps/plugins/xworld/sys.c +++ b/apps/plugins/xworld/sys.c @@ -19,6 +19,8 @@ * ***************************************************************************/ +/* This file contains the majority of the Rockbox-specific code in xworld */ + /* TODO: */ /* vertical stride support (as of Dec. 2014, only the M:Robe 500 has a color, vertical stride LCD) */ @@ -277,8 +279,8 @@ static void do_sound_settings(struct System* sys) static void sys_reset_settings(struct System* sys) { sys->settings.negative_enabled = false; - sys->settings.rotation_option = 0; // off - sys->settings.scaling_quality = 1; // fast + sys->settings.rotation_option = 0; /* off */ + sys->settings.scaling_quality = 1; /* fast */ sys->settings.sound_enabled = true; sys->settings.sound_bufsize = 32; sys->settings.showfps = false; @@ -346,7 +348,7 @@ void sys_menu(struct System* sys) case 1: /* reset vm */ vm_init(&sys->e->vm); - vm_initForPart(&sys->e->vm, GAME_PART1); // This game part is the protection screen + vm_initForPart(&sys->e->vm, GAME_PART1); /* This game part is the protection screen */ quit = true; break; case 2: @@ -826,74 +828,6 @@ void sys_processEvents(struct System* sys) sys->input.dirMask |= (DIR_UP | DIR_RIGHT); #endif } - -#if 0 - /* handle releases */ - if(btn & BUTTON_REL) - { - debug(DBG_SYS, "button_rel"); - btn &= ~BUTTON_REL; - - if(btn & BTN_FIRE) - sys->input.button = false; - if(btn & sys->keymap.up) - sys->input.dirMask &= ~DIR_UP; - if(btn & sys->keymap.down) - sys->input.dirMask &= ~DIR_DOWN; - if(btn & sys->keymap.left) - sys->input.dirMask &= ~DIR_LEFT; - if(btn & sys->keymap.right) - sys->input.dirMask &= ~DIR_RIGHT; -#ifdef BTN_DOWN_LEFT - if(btn & sys->keymap.downleft) - sys->input.dirMask &= ~(DIR_DOWN | DIR_LEFT); -#endif -#ifdef BTN_DOWN_RIGHT - if(btn & sys->keymap.downright) - sys->input.dirMask &= ~(DIR_DOWN | DIR_RIGHT); -#endif -#ifdef BTN_UP_LEFT - if(btn & sys->keymap.upleft) - sys->input.dirMask &= ~(DIR_UP | DIR_LEFT); -#endif -#ifdef BTN_UP_RIGHT - if(btn & sys->keymap.upright) - sys->input.dirMask &= ~(DIR_UP | DIR_RIGHT); -#endif - } - /* then handle presses */ - else - { - if(btn & BTN_FIRE) - sys->input.button = true; - if(btn & sys->keymap.up) - sys->input.dirMask |= DIR_UP; - if(btn & sys->keymap.down) - sys->input.dirMask |= DIR_DOWN; - if(btn & sys->keymap.left) - sys->input.dirMask |= DIR_LEFT; - if(btn & sys->keymap.right) - sys->input.dirMask |= DIR_RIGHT; -#ifdef BTN_DOWN_LEFT - if(btn & sys->keymap.downleft) - sys->input.dirMask |= (DIR_DOWN | DIR_LEFT); -#endif -#ifdef BTN_DOWN_RIGHT - if(btn & sys->keymap.downright) - sys->input.dirMask |= (DIR_DOWN | DIR_RIGHT); -#endif -#ifdef BTN_UP_LEFT - if(btn & sys->keymap.upleft) - sys->input.dirMask |= (DIR_UP | DIR_LEFT); -#endif -#ifdef BTN_UP_RIGHT - if(btn & sys->keymap.upright) - sys->input.dirMask |= (DIR_UP | DIR_RIGHT); -#endif - } - debug(DBG_SYS, "dirMask is 0x%02x", sys->input.dirMask); - debug(DBG_SYS, "button is %s", sys->input.button == true ? "true" : "false"); -#endif } void sys_sleep(struct System* sys, uint32_t duration) @@ -1064,5 +998,4 @@ void MutexStack(struct MutexStack_t* s, struct System *stub, void *mutex) void MutexStack_destroy(struct MutexStack_t* s) { sys_unlockMutex(s->sys, s->_mutex); - } |