extracted OSS code to sndout_oss_*, BTN->PBTN, refactoring

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@599 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2008-10-17 15:29:37 +00:00
parent 7b3f44c6b6
commit e5ab6fafac
25 changed files with 497 additions and 589 deletions

View file

@ -3,17 +3,17 @@
#ifdef __GP2X__
#include "../gp2x/gp2x.h"
#define BTN_UP GP2X_UP
#define BTN_DOWN GP2X_DOWN
#define BTN_LEFT GP2X_LEFT
#define BTN_RIGHT GP2X_RIGHT
#define PBTN_UP GP2X_UP
#define PBTN_DOWN GP2X_DOWN
#define PBTN_LEFT GP2X_LEFT
#define PBTN_RIGHT GP2X_RIGHT
#define BTN_NORTH GP2X_Y
#define BTN_SOUTH GP2X_X
#define BTN_WEST GP2X_A
#define BTN_EAST GP2X_B
#define BTN_L GP2X_L
#define BTN_R GP2X_R
#define PBTN_NORTH GP2X_Y
#define PBTN_SOUTH GP2X_X
#define PBTN_WEST GP2X_A
#define PBTN_EAST GP2X_B
#define PBTN_L GP2X_L
#define PBTN_R GP2X_R
unsigned long wait_for_input(unsigned long interesting);
void gp2x_pd_clone_buffer2(void);
@ -43,10 +43,10 @@ void menu_flip(void);
#include "../gizmondo/giz.h"
#define BTN_NORTH BTN_STOP
#define BTN_SOUTH BTN_PLAY
#define BTN_WEST BTN_REW
#define BTN_EAST BTN_FWD
#define PBTN_NORTH PBTN_STOP
#define PBTN_SOUTH PBTN_PLAY
#define PBTN_WEST PBTN_REW
#define PBTN_EAST PBTN_FWD
unsigned long wait_for_input(unsigned int interesting);
void menu_draw_begin(int use_bgbuff);
@ -75,10 +75,10 @@ extern void *giz_screen;
#include "../psp/psp.h"
#define BTN_NORTH BTN_TRIANGLE
#define BTN_SOUTH BTN_X
#define BTN_WEST BTN_SQUARE
#define BTN_EAST BTN_CIRCLE
#define PBTN_NORTH PBTN_TRIANGLE
#define PBTN_SOUTH PBTN_X
#define PBTN_WEST PBTN_SQUARE
#define PBTN_EAST PBTN_CIRCLE
unsigned long wait_for_input(unsigned int interesting, int is_key_config);
void menu_draw_begin(void);
@ -106,17 +106,17 @@ void menu_draw_end(void);
#include "../gp2x/gp2x.h"
#define BTN_UP 0
#define BTN_DOWN 0
#define BTN_LEFT 0
#define BTN_RIGHT 0
#define PBTN_UP 0
#define PBTN_DOWN 0
#define PBTN_LEFT 0
#define PBTN_RIGHT 0
#define BTN_NORTH 0
#define BTN_SOUTH 0
#define BTN_WEST 0
#define BTN_EAST 0
#define BTN_L 0
#define BTN_R 0
#define PBTN_NORTH 0
#define PBTN_SOUTH 0
#define PBTN_WEST 0
#define PBTN_EAST 0
#define PBTN_L 0
#define PBTN_R 0
unsigned long wait_for_input(unsigned long interesting);
void gp2x_pd_clone_buffer2(void);

View file

@ -350,7 +350,7 @@ static void mplayer_loop(void)
while (1)
{
PDebugZ80Frame();
if (read_buttons_async(BTN_NORTH)) break;
if (read_buttons_async(PBTN_NORTH)) break;
emu_waitSound();
}
@ -429,41 +429,41 @@ void debug_menu_loop(void)
}
menu_draw_end();
inp = read_buttons(BTN_EAST|BTN_SOUTH|BTN_WEST|BTN_NORTH|BTN_L|BTN_R|BTN_UP|BTN_DOWN|BTN_LEFT|BTN_RIGHT);
if (inp & BTN_SOUTH) return;
if (inp & BTN_L) { mode--; if (mode < 0) mode = 3; }
if (inp & BTN_R) { mode++; if (mode > 3) mode = 0; }
inp = read_buttons(PBTN_EAST|PBTN_SOUTH|PBTN_WEST|PBTN_NORTH|PBTN_L|PBTN_R|PBTN_UP|PBTN_DOWN|PBTN_LEFT|PBTN_RIGHT);
if (inp & PBTN_SOUTH) return;
if (inp & PBTN_L) { mode--; if (mode < 0) mode = 3; }
if (inp & PBTN_R) { mode++; if (mode > 3) mode = 0; }
switch (mode)
{
case 0:
if (inp & BTN_EAST) SekStepM68k();
if (inp & BTN_NORTH) {
while (inp & BTN_NORTH) inp = read_buttons_async(BTN_NORTH);
if (inp & PBTN_EAST) SekStepM68k();
if (inp & PBTN_NORTH) {
while (inp & PBTN_NORTH) inp = read_buttons_async(PBTN_NORTH);
mplayer_loop();
}
if ((inp & (BTN_WEST|BTN_LEFT)) == (BTN_WEST|BTN_LEFT)) {
if ((inp & (PBTN_WEST|PBTN_LEFT)) == (PBTN_WEST|PBTN_LEFT)) {
mkdir("dumps", 0777);
PDebugDumpMem();
while (inp & BTN_WEST) inp = read_buttons_async(BTN_WEST);
while (inp & PBTN_WEST) inp = read_buttons_async(PBTN_WEST);
dumped = 1;
}
break;
case 1:
if (inp & BTN_LEFT) PicoDrawMask ^= PDRAW_LAYERB_ON;
if (inp & BTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;
if (inp & BTN_DOWN) PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;
if (inp & BTN_UP) PicoDrawMask ^= PDRAW_SPRITES_HI_ON;
if (inp & BTN_EAST) {
if (inp & PBTN_LEFT) PicoDrawMask ^= PDRAW_LAYERB_ON;
if (inp & PBTN_RIGHT) PicoDrawMask ^= PDRAW_LAYERA_ON;
if (inp & PBTN_DOWN) PicoDrawMask ^= PDRAW_SPRITES_LOW_ON;
if (inp & PBTN_UP) PicoDrawMask ^= PDRAW_SPRITES_HI_ON;
if (inp & PBTN_EAST) {
PsndOut = NULL; // just in case
PicoSkipFrame = 1;
PicoFrame();
PicoSkipFrame = 0;
while (inp & BTN_EAST) inp = read_buttons_async(BTN_EAST);
while (inp & PBTN_EAST) inp = read_buttons_async(PBTN_EAST);
}
break;
case 3:
if (inp & BTN_DOWN) spr_offs++;
if (inp & BTN_UP) spr_offs--;
if (inp & PBTN_DOWN) spr_offs++;
if (inp & PBTN_UP) spr_offs--;
if (spr_offs < 0) spr_offs = 0;
break;
}