Skip to content

Commit

Permalink
first release miyoo
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacam committed Feb 16, 2021
1 parent 4626fb2 commit 5169d9d
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 0 deletions.
72 changes: 72 additions & 0 deletions Makefile.miyoo
@@ -0,0 +1,72 @@
#
# dingux-vectrex for the RetroFW
#
# by pingflood; 2019
#

CHAINPREFIX=/opt/miyoo
CROSS_COMPILE=$(CHAINPREFIX)/usr/bin/arm-linux-

CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip

SYSROOT = $(shell $(CC) --print-sysroot)
SDL_CFLAGS = $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS = $(shell $(SYSROOT)/usr/bin/sdl-config --libs)

TARGET = dingux-vectrex/dingux-vectrex.dge

ifdef V
CMD =
SUM = @\#
else
CMD = @
SUM = @echo
endif

INCLUDES = -I./src
CFLAGS = $(SDL_CFLAGS) $(INCLUDES) -DGCW0_MODE -DMIYOO_MODE -g -O2 -Wall -fstrength-reduce -s -DSOUND_SUPPORT -DNO_STDIO_REDIRECT
# CFLAGS = $(SDL_CFLAGS) $(INCLUDES) -DGCW0_MODE -ggdb -O2 -Wall -fstrength-reduce -DSOUND_SUPPORT -DNO_STDIO_REDIRECT
CXXFLAGS = $(CFLAGS) # -fno-exceptions -fno-rtti
LDFLAGS = $(CXXFLAGS) $(SDL_LIBS) -lSDL_image -lpng -lz -lpthread -lm #-lgcc

OBJS = \
src/gp2x_psp.o \
src/e6809.o \
src/e8910.o \
src/osint.o \
src/vecx.o \
src/global.o \
src/psp_main.o \
src/psp_sdl.o \
src/psp_kbd.o \
src/psp_dve.o \
src/psp_fmgr.o \
src/psp_font.o \
src/psp_danzeff.o \
src/psp_editor.o \
src/psp_menu_set.o \
src/psp_menu_cheat.o \
src/psp_menu_list.o \
src/psp_menu.o \
src/psp_menu_kbd.o \
src/psp_menu_help.o

all : $(TARGET)

$(TARGET) : $(OBJS)
$(SUM) "LD $@"
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@

%.o: %.c
$(SUM) "CC $@"
$(CMD)$(CC) $(CFLAGS) -c $< -o $@

%.o: %.cpp
$(SUM) "CXX $@"
$(CMD)$(CXX) $(CFLAGS) -c $< -o $@

clean :
$(SUM) "CLEAN"
$(CMD)rm -f $(OBJS) $(TARGET)
Binary file removed dingux-vectrex/default.bin
Binary file not shown.
27 changes: 27 additions & 0 deletions src/gp2x_psp.h
Expand Up @@ -54,6 +54,32 @@ typedef struct gp2xCtrlData SceCtrlData;
# define PSP_CTRL_VOLDOWN GP2X_CTRL_VOLDOWN
# define PSP_CTRL_MASK GP2X_CTRL_MASK

#ifdef MIYOO_MODE

#define GP2X_UP SDLK_UP //80 //SDLK_KP8
#define GP2X_DOWN SDLK_DOWN // 88 //SDLK_KP2
#define GP2X_LEFT SDLK_LEFT // 83 //SDLK_KP4
#define GP2X_RIGHT SDLK_RIGHT //85 //SDLK_KP6

#define GP2X_A SDLK_SPACE //38 //SDLK_a
#define GP2X_B SDLK_LALT //40 //SDLK_d
#define GP2X_X SDLK_LCTRL //53 //SDLK_x
#define GP2X_Y SDLK_LSHIFT //25 //SDLK_w
#define GP2X_L SDLK_TAB //46 //SDLK_l
#define GP2X_R SDLK_BACKSPACE //27 //SDLK_r
#define GP2X_START SDLK_ESCAPE //36 //SDLK_RETURN
#define GP2X_SELECT SDLK_RCTRL //39 //SDLK_s

#define GP2X_UPLEFT (-1)
#define GP2X_UPRIGHT (-2)
#define GP2X_DOWNLEFT (-3)
#define GP2X_DOWNRIGHT (-4)
#define GP2X_VOLUP (-6)
#define GP2X_VOLDOWN (-7)
#define GP2X_FIRE SDLK_RETURN

#else //MIYOO_MODE

#if defined(WIZ_MODE) || defined(GP2X_MODE)

//gp2x buttons codes
Expand Down Expand Up @@ -167,6 +193,7 @@ typedef struct gp2xCtrlData SceCtrlData;
#define GP2X_VOLDOWN 82 //SDLK_KP_MINUS

#endif
#endif //MIYOO_MODE

#define GP2X_NOEVENT -1

Expand Down
16 changes: 16 additions & 0 deletions src/psp_danzeff.c
Expand Up @@ -110,12 +110,16 @@ danzeff_readInput(gp2xCtrlData pspctrl)
selected_x = x;
selected_y = y;
}
#ifndef MIYOO_MODE
//if they are changing shift then that makes it dirty too
if ((!shifted && (pspctrl.Buttons & GP2X_CTRL_RTRIGGER)) || (shifted && !(pspctrl.Buttons & GP2X_CTRL_RTRIGGER)))
dirty = true;
#endif

int pressed = 0; //character they have entered, 0 as that means 'nothing'
#ifndef MIYOO_MODE
shifted = (pspctrl.Buttons & GP2X_CTRL_RTRIGGER)?true:false;
#endif

if (!holding)
{
Expand All @@ -134,11 +138,23 @@ danzeff_readInput(gp2xCtrlData pspctrl)
//Now grab the value out of the array
pressed = modeChar[ (mode*2 + shifted) % MAX_VKEYBOARD][y][x][innerChoice];
}
#ifdef MIYOO_MODE
else if (pspctrl.Buttons& GP2X_CTRL_FIRE) //toggle mode
#else
else if (pspctrl.Buttons& GP2X_CTRL_LTRIGGER) //toggle mode
#endif
{
dirty = true;
#ifdef MIYOO_MODE
if(shifted)
{
#endif
mode++;
mode %= MODE_COUNT;
#ifdef MIYOO_MODE
}
shifted = !shifted;
#endif
}
else if (pspctrl.Buttons& GP2X_CTRL_SELECT)
{
Expand Down

0 comments on commit 5169d9d

Please sign in to comment.