Commit 244de356 authored by Not6's avatar Not6
Browse files

libretro patch (open file from gui is still KO)

parent d52b7e60
......@@ -81,7 +81,10 @@ void IOOUTCALL memio_ram(UINT port, REG8 dat) {
static const OEMCHAR iplromx1[] = OEMTEXT("IPLROM.X1");
static const OEMCHAR iplromx1t[] = OEMTEXT("IPLROM.X1T");
#ifdef __LIBRETRO__
extern char retro_system_conf[512];
extern char slash ;
#endif
void memio_reset(void) {
const OEMCHAR *iplfile;
......@@ -99,7 +102,13 @@ const OEMCHAR *iplfile;
iplfile = iplromx1;
iplsize = 0x8000;
}
#ifdef __LIBRETRO__
char rtmp[512];
sprintf(rtmp,"%s%c%s\0",retro_system_conf,slash,iplfile);
fh = file_open_rb(rtmp);
#else
fh = file_open_rb_c(iplfile);
#endif
if (fh != FILEH_INVALID) {
file_read(fh, biosmem, iplsize);
file_close(fh);
......
include Makefile.libretro
XMIL_PATH := ..
CORE_DIR := ..
INCFLAGS := -I$(CORE_DIR) \
-I$(CORE_DIR)/libretro \
-I$(XMIL_PATH) \
-I$(XMIL_PATH)/codecnv \
-I$(XMIL_PATH)/common \
-I$(XMIL_PATH)/embed \
-I$(XMIL_PATH)/embed/menu \
-I$(XMIL_PATH)/embed/menubase \
-I$(XMIL_PATH)/fdd \
-I$(XMIL_PATH)/font \
-I$(XMIL_PATH)/io \
-I$(XMIL_PATH)/sound \
-I$(XMIL_PATH)/vram \
-I$(XMIL_PATH)/z80c
SOURCES_C := \
$(wildcard $(XMIL_PATH)/*.c) \
$(wildcard $(XMIL_PATH)/codecnv/*.c) \
$(wildcard $(XMIL_PATH)/common/*.c) \
$(wildcard $(XMIL_PATH)/embed/*.c) \
$(wildcard $(XMIL_PATH)/embed/menu/*.c) \
$(wildcard $(XMIL_PATH)/embed/menubase/*.c) \
$(wildcard $(XMIL_PATH)/fdd/*.c) \
$(wildcard $(XMIL_PATH)/font/*.c) \
$(wildcard $(XMIL_PATH)/io/*.c) \
$(wildcard $(XMIL_PATH)/libretro/*.c) \
$(wildcard $(XMIL_PATH)/sound/*.c) \
$(wildcard $(XMIL_PATH)/vram/*.c) \
$(wildcard $(XMIL_PATH)/z80c/*.c)
#SOURCES_CXX :=
DEBUG = 0
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
ifeq ($(platform), win)
INCLUDES += -I Windows
endif
TARGET_NAME := x1
ENDIANNESS_DEFINES :=
CORE_DIR := .
ifeq ($(platform), unix)
CFLAGS = -g -O2
CXXFLAGS = -g -O2 -fno-merge-constants
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
FLAGS += -D__LINUX__
else ifneq (,$(findstring osx,$(platform)))
TARGET := $(TARGET_NAME)_libretro.dylib
fpic = -fPIC
SHARED := -dynamiclib
else ifneq (,$(findstring ios,$(platform)))
TARGET := $(TARGET_NAME)_libretro_ios.dylib
fpic = -fPIC
SHARED := -dynamiclib
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
DEFINES := -DIOS
CC = cc -arch armv7 -isysroot $(IOSSDK)
CXX = c++ -arch armv7 -isysroot $(IOSSDK)
ifeq ($(platform),ios9)
CC += -miphoneos-version-min=8.0
CXXFLAGS += -miphoneos-version-min=8.0
else
CC += -miphoneos-version-min=5.0
CXXFLAGS += -miphoneos-version-min=5.0
endif
# android arm
else ifneq (,$(findstring android,$(platform)))
TARGET := $(TARGET_NAME)_libretro_android.so
fpic = -fPIC
SHARED := -lstdc++ -llog -shared -Wl,--version-script=link.T -Wl,--no-undefined
CFLAGS += -g -O2
CXXFLAGS = -g -O2 -fno-merge-constants
CC = arm-linux-androideabi-gcc
CXX = arm-linux-androideabi-g++
FLAGS += -D__LINUX__ -DARM -marm
# crosspi arm
else ifneq (,$(findstring crosspi,$(platform)))
CC = arm-linux-gnueabihf-gcc
CXX = arm-linux-gnueabihf-g++
CC_AS = arm-linux-gnueabihf-as
CPU_FLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard
CFLAGS += -g -O2
CXXFLAGS += -g -O2 -fno-merge-constants
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
FLAGS += -D__LINUX__ -DARM -marm
# cross Windows
else ifeq ($(platform), wincross64)
TARGET := $(TARGET_NAME)_libretro.dll
AR = x86_64-w64-mingw32-ar
CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
LDFLAGS += -static-libgcc -static-libstdc++
EXTRA_LDF := -lwinmm -Wl,--export-all-symbols
else
TARGET := $(TARGET_NAME)_libretro.dll
CC = gcc
CXX = g++
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
LDFLAGS += -static-libgcc -static-libstdc++
EXTRA_LDF = -lwinmm -Wl,--export-all-symbols
endif
CDEBUGFLAGS+=
CDEBUGFLAGS+=
FLAGS += $(CDEBUGFLAGS)
include $(CORE_DIR)/Makefile.common
OBJECTS := $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o) $(SOURCES_S:.s=.o)
all: $(TARGET)
ifeq ($(DEBUG), 0)
FLAGS += -O3 -ffast-math -fomit-frame-pointer
else
FLAGS += -O0 -g
endif
LDFLAGS += $(fpic) $(SHARED) $(EXTRA_LDF)
FLAGS += $(INCFLAGS)
FLAGS +=
WARNINGS :=
FLAGS += -D__LIBRETRO__ $(ENDIANNESS_DEFINES) $(WARNINGS) $(fpic)
CXXFLAGS += $(FLAGS) -fpermissive $(CPU_FLAGS)
CFLAGS += $(FLAGS) -std=gnu99 $(CPU_FLAGS)
$(TARGET): $(OBJECTS)
$(CXX) -o $@ $^ $(LDFLAGS)
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
%.o: %.s
$(CXX) $(CFLAGS) -c $^ -o $@
clean:
rm -f $(TARGET) $(OBJECTS)
.PHONY: clean
#define ANKFONTSIZE 10
static const unsigned char ankfont[960] = {
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,
0x80,0x80,0x80,0x80,0x80,0x00,0x80,0x00,0x03,0x00,0xa0,0xa0,
0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x50,0x50,0xf8,0x50,
0xf8,0x50,0x50,0x00,0x05,0x00,0x20,0x70,0xa8,0x60,0x30,0xa8,
0x70,0x00,0x05,0x00,0xc0,0xc8,0x10,0x20,0x40,0x98,0x18,0x00,
0x05,0x00,0x40,0xa0,0xa0,0x48,0xb0,0x90,0x68,0x00,0x01,0x00,
0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x80,
0x80,0x80,0x80,0x80,0x40,0x00,0x02,0x00,0x80,0x40,0x40,0x40,
0x40,0x40,0x80,0x00,0x03,0x40,0xe0,0x40,0xe0,0x40,0x00,0x00,
0x00,0x00,0x03,0x00,0x00,0x00,0x40,0xe0,0x40,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x02,0x00,
0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0x00,0x03,0x00,0x20,0x20,0x40,0x40,
0x40,0x80,0x80,0x00,0x04,0x00,0x60,0x90,0x90,0x90,0x90,0x90,
0x60,0x00,0x02,0x00,0x40,0xc0,0x40,0x40,0x40,0x40,0x40,0x00,
0x04,0x00,0x60,0x90,0x10,0x20,0x40,0x80,0xf0,0x00,0x04,0x00,
0xf0,0x20,0x40,0x20,0x10,0x90,0x60,0x00,0x04,0x00,0x20,0x60,
0xa0,0xa0,0xf0,0x20,0x20,0x00,0x04,0x00,0xf0,0x80,0xe0,0x90,
0x10,0x90,0x60,0x00,0x04,0x00,0x20,0x40,0x80,0xe0,0x90,0x90,
0x60,0x00,0x04,0x00,0xf0,0x10,0x20,0x20,0x40,0x40,0x40,0x00,
0x04,0x00,0x60,0x90,0x90,0x60,0x90,0x90,0x60,0x00,0x04,0x00,
0x60,0x90,0x90,0x70,0x10,0x20,0x40,0x00,0x01,0x00,0x00,0x00,
0x80,0x00,0x00,0x80,0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x00,
0x00,0x80,0x80,0x00,0x03,0x00,0x00,0x00,0x20,0x40,0x80,0x40,
0x20,0x00,0x03,0x00,0x00,0x00,0x00,0xe0,0x00,0xe0,0x00,0x00,
0x03,0x00,0x00,0x00,0x80,0x40,0x20,0x40,0x80,0x00,0x04,0x00,
0x60,0x90,0x10,0x20,0x40,0x00,0x40,0x00,0x07,0x00,0x38,0x44,
0x9a,0xaa,0x94,0x40,0x3c,0x00,0x05,0x00,0x20,0x20,0x50,0x50,
0x70,0x88,0x88,0x00,0x05,0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,
0xf0,0x00,0x05,0x00,0x70,0x88,0x80,0x80,0x80,0x88,0x70,0x00,
0x05,0x00,0xf0,0x88,0x88,0x88,0x88,0x88,0xf0,0x00,0x04,0x00,
0xf0,0x80,0x80,0xe0,0x80,0x80,0xf0,0x00,0x04,0x00,0xf0,0x80,
0x80,0xe0,0x80,0x80,0x80,0x00,0x05,0x00,0x70,0x88,0x80,0xb8,
0x88,0x98,0x68,0x00,0x05,0x00,0x88,0x88,0x88,0xf8,0x88,0x88,
0x88,0x00,0x01,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x04,0x00,0x10,0x10,0x10,0x10,0x10,0x90,0x60,0x00,0x05,0x00,
0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x00,0x04,0x00,0x80,0x80,
0x80,0x80,0x80,0x80,0xf0,0x00,0x07,0x00,0xc6,0xc6,0xaa,0xaa,
0x92,0x92,0x82,0x00,0x05,0x00,0xc8,0xc8,0xa8,0xa8,0xa8,0x98,
0x98,0x00,0x05,0x00,0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
0x05,0x00,0xf0,0x88,0x88,0xf0,0x80,0x80,0x80,0x00,0x05,0x00,
0x70,0x88,0x88,0x88,0xa8,0x98,0x70,0x08,0x05,0x00,0xf0,0x88,
0x88,0xf0,0x88,0x88,0x88,0x00,0x05,0x00,0x70,0x88,0x80,0x70,
0x08,0x88,0x70,0x00,0x05,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,
0x20,0x00,0x05,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x70,0x00,
0x05,0x00,0x88,0x88,0x88,0x50,0x50,0x50,0x20,0x00,0x07,0x00,
0x82,0x82,0x82,0x54,0x54,0x54,0x28,0x00,0x05,0x00,0x88,0x88,
0x50,0x20,0x50,0x88,0x88,0x00,0x05,0x00,0x88,0x88,0x50,0x50,
0x20,0x20,0x20,0x00,0x05,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,
0xf8,0x00,0x02,0x00,0xc0,0x80,0x80,0x80,0x80,0x80,0xc0,0x00,
0x03,0x00,0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x00,0x02,0x00,
0xc0,0x40,0x40,0x40,0x40,0x40,0xc0,0x00,0x03,0x40,0xa0,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xf0,0x00,0x02,0x80,0x40,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x04,0x00,0x00,0x00,0x60,0x10,0x70,0x90,0x70,0x00,
0x04,0x00,0x80,0x80,0xe0,0x90,0x90,0x90,0xe0,0x00,0x04,0x00,
0x00,0x00,0x60,0x90,0x80,0x90,0x60,0x00,0x04,0x00,0x10,0x10,
0x70,0x90,0x90,0x90,0x70,0x00,0x04,0x00,0x00,0x00,0x60,0x90,
0xf0,0x80,0x60,0x00,0x03,0x00,0x20,0x40,0x40,0xe0,0x40,0x40,
0x40,0x00,0x04,0x00,0x00,0x20,0x60,0x90,0xa0,0x60,0x90,0xe0,
0x04,0x00,0x80,0x80,0xa0,0xd0,0x90,0x90,0x90,0x00,0x01,0x00,
0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x02,0x00,0x40,0x00,
0x40,0x40,0x40,0x40,0x40,0xc0,0x04,0x00,0x80,0x80,0xa0,0xc0,
0xc0,0xa0,0x90,0x00,0x01,0x00,0x80,0x80,0x80,0x80,0x80,0x80,
0x80,0x00,0x05,0x00,0x00,0x00,0xf0,0xa8,0xa8,0xa8,0xa8,0x00,
0x04,0x00,0x00,0x00,0xe0,0x90,0x90,0x90,0x90,0x00,0x04,0x00,
0x00,0x00,0x60,0x90,0x90,0x90,0x60,0x00,0x04,0x00,0x00,0x00,
0xe0,0x90,0x90,0xe0,0x80,0x80,0x04,0x00,0x00,0x00,0x70,0x90,
0x90,0x70,0x10,0x10,0x03,0x00,0x00,0x00,0xa0,0xc0,0x80,0x80,
0x80,0x00,0x03,0x00,0x00,0x00,0x60,0x80,0x40,0x20,0xc0,0x00,
0x03,0x00,0x00,0x40,0xe0,0x40,0x40,0x40,0x60,0x00,0x04,0x00,
0x00,0x00,0x90,0x90,0x90,0x90,0x70,0x00,0x03,0x00,0x00,0x00,
0xa0,0xa0,0xa0,0x40,0x40,0x00,0x05,0x00,0x00,0x00,0x88,0xa8,
0xa8,0x50,0x50,0x00,0x04,0x00,0x00,0x00,0x90,0x90,0x60,0x90,
0x90,0x00,0x04,0x00,0x00,0x00,0x90,0x90,0x90,0x50,0x20,0xc0,
0x04,0x00,0x00,0x00,0xf0,0x10,0x60,0x80,0xf0,0x00,0x03,0x00,
0x20,0x40,0x40,0x80,0x40,0x40,0x20,0x00,0x01,0x00,0x80,0x80,
0x80,0x00,0x80,0x80,0x80,0x00,0x03,0x00,0x80,0x40,0x40,0x20,
0x40,0x40,0x80,0x00,0x04,0x00,0x50,0xa0,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
#define ANKFONTSIZE 12
static const unsigned char ankfont[1152] = {
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x80,0x00,0x00,
0x03,0x00,0xa0,0xa0,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x05,0x00,0x00,0x50,0x50,0xf8,0x50,0xf8,0x50,0x50,0x00,0x00,
0x05,0x00,0x00,0x20,0x78,0xa0,0x70,0x28,0xf0,0x20,0x00,0x00,
0x07,0x00,0x00,0x44,0xa8,0xa8,0x54,0x2a,0x2a,0x44,0x00,0x00,
0x05,0x00,0x00,0x40,0xa0,0xa0,0x48,0xa8,0x90,0x68,0x00,0x00,
0x01,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x20,0x40,0x80,0x80,0x80,0x80,0x40,0x20,0x00,0x00,
0x03,0x00,0x80,0x40,0x20,0x20,0x20,0x20,0x40,0x80,0x00,0x00,
0x05,0x00,0x20,0xa8,0x70,0xa8,0x20,0x00,0x00,0x00,0x00,0x00,
0x05,0x00,0x00,0x00,0x20,0x20,0xf8,0x20,0x20,0x00,0x00,0x00,
0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x80,0x00,
0x03,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x00,
0x04,0x00,0x00,0x10,0x10,0x20,0x20,0x40,0x40,0x80,0x80,0x00,
0x04,0x00,0x00,0x60,0x90,0x90,0x90,0x90,0x90,0x60,0x00,0x00,
0x03,0x00,0x00,0x40,0xc0,0x40,0x40,0x40,0x40,0xe0,0x00,0x00,
0x04,0x00,0x00,0xe0,0x10,0x10,0x20,0x40,0x80,0xf0,0x00,0x00,
0x04,0x00,0x00,0xf0,0x20,0x40,0x20,0x10,0x10,0xe0,0x00,0x00,
0x05,0x00,0x00,0x10,0x30,0x50,0x90,0xf8,0x10,0x10,0x00,0x00,
0x04,0x00,0x00,0xf0,0x80,0x80,0xe0,0x10,0x10,0xe0,0x00,0x00,
0x04,0x00,0x00,0x20,0x40,0x80,0xe0,0x90,0x90,0x60,0x00,0x00,
0x04,0x00,0x00,0xf0,0x10,0x20,0x20,0x40,0x40,0x80,0x00,0x00,
0x04,0x00,0x00,0x60,0x90,0x90,0x60,0x90,0x90,0x60,0x00,0x00,
0x04,0x00,0x00,0x60,0x90,0x90,0x70,0x10,0x20,0x40,0x00,0x00,
0x01,0x00,0x00,0x00,0x00,0x80,0x80,0x00,0x80,0x80,0x00,0x00,
0x02,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x40,0x40,0x80,0x00,
0x04,0x00,0x00,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0xf8,0x00,0xf8,0x00,0x00,0x00,0x00,
0x04,0x00,0x00,0x80,0x40,0x20,0x10,0x20,0x40,0x80,0x00,0x00,
0x04,0x00,0x00,0xe0,0x10,0x10,0x20,0x40,0x00,0x40,0x00,0x00,
0x07,0x00,0x00,0x38,0x44,0x9a,0xaa,0xaa,0x9c,0x40,0x38,0x00,
0x06,0x00,0x00,0x30,0x30,0x48,0x48,0x78,0x84,0x84,0x00,0x00,
0x05,0x00,0x00,0xf0,0x88,0x88,0xf0,0x88,0x88,0xf0,0x00,0x00,
0x06,0x00,0x00,0x3c,0x40,0x80,0x80,0x80,0x40,0x3c,0x00,0x00,
0x06,0x00,0x00,0xf0,0x88,0x84,0x84,0x84,0x88,0xf0,0x00,0x00,
0x05,0x00,0x00,0xf8,0x80,0x80,0xf0,0x80,0x80,0xf8,0x00,0x00,
0x05,0x00,0x00,0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0x00,0x00,
0x06,0x00,0x00,0x3c,0x40,0x80,0x9c,0x84,0x44,0x3c,0x00,0x00,
0x06,0x00,0x00,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x00,0x00,
0x01,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,
0x03,0x00,0x00,0x60,0x20,0x20,0x20,0x20,0x20,0xc0,0x00,0x00,
0x05,0x00,0x00,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x00,0x00,
0x04,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0xf0,0x00,0x00,
0x07,0x00,0x00,0xc6,0xc6,0xaa,0xaa,0x92,0x92,0x82,0x00,0x00,
0x06,0x00,0x00,0x84,0xc4,0xa4,0x94,0x8c,0x84,0x84,0x00,0x00,
0x06,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x48,0x30,0x00,0x00,
0x05,0x00,0x00,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,0x00,0x00,
0x06,0x00,0x00,0x30,0x48,0x84,0x84,0x84,0x48,0x30,0x10,0x0c,
0x05,0x00,0x00,0xf0,0x88,0x88,0xf0,0xa0,0x90,0x88,0x00,0x00,
0x05,0x00,0x00,0x78,0x80,0x80,0x70,0x08,0x08,0xf0,0x00,0x00,
0x05,0x00,0x00,0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,
0x06,0x00,0x00,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x00,0x00,
0x05,0x00,0x00,0x88,0x88,0x88,0x50,0x50,0x50,0x20,0x00,0x00,
0x07,0x00,0x00,0x82,0x82,0x92,0x92,0xaa,0xaa,0x44,0x00,0x00,
0x05,0x00,0x00,0x88,0x50,0x50,0x20,0x50,0x50,0x88,0x00,0x00,
0x05,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x20,0x20,0x00,0x00,
0x05,0x00,0x00,0xf8,0x08,0x10,0x20,0x40,0x80,0xf8,0x00,0x00,
0x02,0x00,0x00,0xc0,0x80,0x80,0x80,0x80,0x80,0xc0,0x00,0x00,
0x04,0x00,0x00,0x80,0x80,0x40,0x40,0x20,0x20,0x10,0x10,0x00,
0x02,0x00,0x00,0xc0,0x40,0x40,0x40,0x40,0x40,0xc0,0x00,0x00,
0x05,0x00,0x20,0x50,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,
0x02,0x00,0x80,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x04,0x00,0x00,0x00,0x00,0x60,0x10,0x70,0x90,0x70,0x00,0x00,
0x05,0x00,0x80,0x80,0x80,0xf0,0x88,0x88,0x88,0xf0,0x00,0x00,
0x04,0x00,0x00,0x00,0x00,0x70,0x80,0x80,0x80,0x70,0x00,0x00,
0x05,0x00,0x08,0x08,0x08,0x78,0x88,0x88,0x88,0x78,0x00,0x00,
0x04,0x00,0x00,0x00,0x00,0x60,0x90,0xf0,0x80,0x70,0x00,0x00,
0x04,0x00,0x30,0x40,0x40,0xf0,0x40,0x40,0x40,0x40,0x00,0x00,
0x05,0x00,0x00,0x08,0x10,0x78,0x88,0x90,0x70,0x88,0x88,0x70,
0x05,0x00,0x80,0x80,0x80,0xf0,0x88,0x88,0x88,0x88,0x00,0x00,
0x01,0x00,0x00,0x80,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,
0x02,0x00,0x00,0x40,0x00,0xc0,0x40,0x40,0x40,0x40,0x40,0x80,
0x05,0x00,0x80,0x80,0x80,0x90,0xa0,0xe0,0x90,0x88,0x00,0x00,
0x01,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,
0x07,0x00,0x00,0x00,0x00,0xec,0x92,0x92,0x92,0x92,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0xf0,0x88,0x88,0x88,0x88,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0xf0,0x88,0x88,0x88,0xf0,0x80,0x80,
0x05,0x00,0x00,0x00,0x00,0x78,0x88,0x88,0x88,0x78,0x08,0x08,
0x04,0x00,0x00,0x00,0x00,0xb0,0xc0,0x80,0x80,0x80,0x00,0x00,
0x04,0x00,0x00,0x00,0x00,0xf0,0x80,0x60,0x10,0xf0,0x00,0x00,
0x03,0x00,0x00,0x40,0x40,0xe0,0x40,0x40,0x40,0x60,0x00,0x00,
0x04,0x00,0x00,0x00,0x00,0x90,0x90,0x90,0x90,0x70,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x00,0x00,
0x07,0x00,0x00,0x00,0x00,0x82,0x92,0xaa,0x44,0x44,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0x88,0x50,0x20,0x50,0x88,0x00,0x00,
0x05,0x00,0x00,0x00,0x00,0x88,0x88,0x50,0x50,0x20,0x20,0x40,
0x04,0x00,0x00,0x00,0x00,0xf0,0x10,0x60,0x80,0xf0,0x00,0x00,
0x03,0x00,0x00,0x20,0x40,0x40,0x80,0x40,0x40,0x20,0x00,0x00,
0x01,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x03,0x00,0x00,0x80,0x40,0x40,0x20,0x40,0x40,0x80,0x00,0x00,
0x05,0x00,0x00,0x48,0xa8,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
/**
* @file compiler.h
* @brief include file for standard system include files,
* or project specific include files that are used frequently,
* but are changed infrequently
*/
#pragma once
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#include <stdio.h>
#include <stddef.h>
#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
#define SDL_Delay(a) usleep((a)*1000)
#define BYTESEX_LITTLE
#define OSLANG_UTF8
#define OSLINEBREAK_CRLF
#define RESOURCE_US
typedef signed int SINT;
typedef unsigned int UINT;
typedef signed char SINT8;
typedef unsigned char UINT8;
typedef signed short SINT16;
typedef unsigned short UINT16;
typedef signed int SINT32;
typedef unsigned int UINT32;
#define BRESULT UINT
#define OEMCHAR char
#define OEMTEXT(string) string
#define OEMSPRINTF sprintf
#define OEMSTRLEN strlen
#define SIZE_VGA
#if !defined(SIZE_VGA)
#define RGB16 UINT32
#define SIZE_QVGA
#endif
typedef signed char CHAR;
typedef unsigned char BYTE;
#if !defined(OBJC_BOOL_DEFINED)
typedef signed char BOOL;
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef MAX_PATH
#define MAX_PATH 256
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef ZeroMemory
#define ZeroMemory(d,n) memset((d), 0, (n))
#endif
#ifndef CopyMemory
#define CopyMemory(d,s,n) memcpy((d), (s), (n))
#endif
#ifndef FillMemory
#define FillMemory(a, b, c) memset((a), (c), (b))
#endif
#include "common.h"
#include "milstr.h"
#include "_memory.h"
#include "rect.h"
#include "lstarray.h"
#include "trace.h"
#define GETTICK() GetTicks()
#define __ASSERT(s)
#define SPRINTF sprintf
#define STRLEN strlen
#define SUPPORT_UTF8
#define SUPPORT_16BPP
#define MEMOPTIMIZE 2
//#define SOUND_CRITICAL
#define SOUNDRESERVE 100
#define SUPPORT_OPM
#define SCREEN_BPP 16
#include "compiler.h"
#include <sys/stat.h>
#include <time.h>
#if defined(WIN32) && defined(OSLANG_UTF8)
#include "codecnv/codecnv.h"
#endif
#include "dosio.h"
#if defined(WIN32)
#include <direct.h>
#else
#include <dirent.h>
#endif
static char curpath[MAX_PATH] = "./";
static char *curfilep = curpath + 2;
/* ファイル操作 */
FILEH file_open(const char *path) {
#if defined(WIN32) && defined(OSLANG_UTF8)
char sjis[MAX_PATH];
codecnv_utf8tosjis(sjis, SDL_arraysize(sjis), path, (UINT)-1);
return(fopen(sjis, "rb+"));
#else
return(fopen(path, "rb+"));
#endif
}
FILEH file_open_rb(const char *path) {
printf("fopen(%s)\n",path);
#if defined(WIN32) && defined(OSLANG_UTF8)
char sjis[MAX_PATH];
codecnv_utf8tosjis(sjis, SDL_arraysize(sjis), path, (UINT)-1);
return(fopen(sjis, "rb"));
#else
return(fopen(path, "rb"));
#endif
}
FILEH file_create(const char *path) {
#if defined(WIN32) && defined(OSLANG_UTF8)
char sjis[MAX_PATH];
codecnv_utf8tosjis(sjis, SDL_arraysize(sjis), path, (UINT)-1);
return(fopen(sjis, "wb+"));
#else
return(fopen(path, "wb+"));
#endif
}
long file_seek(FILEH handle, long pointer, int method) {
fseek(handle, pointer, method);
return(ftell(handle));
}
UINT file_read(FILEH handle, void *data, UINT length) {
return((UINT)fread(data, 1, length, handle));
}
UINT file_write(FILEH handle, const void *data, UINT length) {
return((UINT)fwrite(data, 1, length, handle));
}
short file_close(FILEH handle) {
fclose(handle);
return(0);
}
UINT file_getsize(FILEH handle) {
struct stat sb;
if (fstat(fileno(handle), &sb) == 0)
{
return (UINT)sb.st_size;
}
return(0);
}
short file_attr(const char *path) {
struct stat sb;
short attr;
#if defined(WIN32) && defined(OSLANG_UTF8)
char sjis[MAX_PATH];
codecnv_utf8tosjis(sjis, SDL_arraysize(sjis), path, (UINT)-1);