clach04 avatar clach04 committed ae65872 Draft

Import of tailtale_src-31102012.zip from http://u-ac.net/tailtale/index.php?id=2 (version 1.1).

Comments (0)

Files changed (60)

+##################################################################
+#                           - DevKIT -                           #
+#                    Makefile for Open System                    #
+#                        - by Rikku2000 -                        #
+##################################################################
+
+# Compiler option
+BUILD_DINGOO = NO
+BUILD_CAANOO = NO
+BUILD_GP2XWIZ = NO
+BUILD_NDS = YES
+BUILD_PSP = NO
+BUILD_WII = NO
+BUILD_WIN = NO
+
+# Compiler setup
+ifeq ($(BUILD_WIN), YES)
+HAVE_CYGWIN = YES
+HAVE_MINGW = NO
+endif
+
+# Host compiler and extra flags
+ifeq ($(BUILD_DINGOO), YES)
+	EXEC = .dge
+	HOST = mipsel-linux-uclibc-
+	CFLAGS = -DDINGOO -DOPENDINGUX
+	CPPFLAGS = -DDINGOO -DOPENDINGUX
+	LDFLAGS = 
+	DIR_INC = 
+	DIR_SRC = 
+else
+ifeq ($(BUILD_CAANOO), YES)
+	EXEC = .gpe
+	HOST = arm-gph-linux-gnueabi-
+	CFLAGS = -DGPH -DCAANO
+	CPPFLAGS = -DGPH -DCAANOO
+	LDFLAGS = 
+	DIR_INC = 
+	DIR_SRC = 
+else
+ifeq ($(BUILD_GP2XWIZ), YES)
+	EXEC = .gpe
+	HOST = arm-open2x-linux-
+	CFLAGS = -DGPH -DGP2XWIZ
+	CPPFLAGS = -DGPH -DGP2XWIZ
+	LDFLAGS = 
+	DIR_INC = 
+	DIR_SRC = 
+else
+ifeq ($(BUILD_NDS), YES)
+	EXEC = .elf
+	HOST = arm-eabi-
+	CFLAGS = -DNDS
+	CPPFLAGS = -DNDS
+	LDFLAGS = -specs=ds_arm9.specs -marm
+	DIR_INC = 
+	DIR_SRC = 
+else
+ifeq ($(BUILD_PSP), YES)
+	EXEC = 
+	HOST = psp-
+	CFLAGS = -I./devkitPSP/psp/include -I./devkitPSP/psp/sdk/include -DPSP
+	CPPFLAGS = -I./devkitPSP/psp/include -I./devkitPSP/psp/sdk/include -DPSP
+	LDFLAGS = -lSDL_mixer -lvorbisidec -lm -lSDL -lSDLmain -lGL -lSDL_image -lpng -lz -lg \
+			  -ljpeg -lpspvfpu -lpspgu -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc \
+			  -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility \
+			  -lpspuser -lpspkernel -lpsphprm -lpsprtc -lpspaudio -lpsppower
+	DIR_INC = 
+	DIR_SRC = 
+else
+ifeq ($(BUILD_WII), YES)
+	EXEC = .elf
+	HOST = powerpc-eabi-
+	CFLAGS = -DGEKKO
+	CPPFLAGS = -DGEKKO
+	LDFLAGS = -mrvl
+	DIR_INC = 
+	DIR_SRC = 
+else
+ifeq ($(BUILD_WIN), YES)
+	EXEC = .exe
+ifeq ($(HAVE_CYGWIN), YES)
+	HOST = i686-pc-cygwin-
+	CFLAGS = -mno-cygwin -DX86 -mwindows -DWIN32
+	CPPFLAGS = -mno-cygwin -DX86 -mwindows -DWIN32
+	LDFLAGS = -mno-cygwin
+else
+ifeq ($(HAVE_MINGW), YES)
+	HOST = mingw32-
+	CFLAGS = -mno-mingw -DX86 -mwindows -DWIN32
+	CPPFLAGS = -mno-mingw -DX86 -mwindows -DWIN32
+	LDFLAGS = -mno-mingw
+else
+	HOST = 
+endif
+endif
+	DIR_INC = 
+	DIR_SRC = ./build/device/win32
+else
+	EXEC = 
+	HOST = 
+	CFLAGS = -DX86
+	CPPFLAGS = -DX86
+	LDFLAGS = 
+	DIR_INC = 
+	DIR_SRC = 
+endif
+endif
+endif
+endif
+endif
+endif
+endif
+
+# Compiler target file
+ifeq ($(BUILD_WII), YES)
+TARGET = ./build/boot
+else
+TARGET = ./build/tailtale
+endif
+
+# Compiler headers
+INCLUDES = -I./ $(DIR_INC)
+
+# Compiler source
+SOURCES = . $(DIR_SRC)
+CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
+CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
+ifeq ($(BUILD_WIN), YES)
+RCFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.rc))
+OFILES = $(RCFILES:.rc=.o) $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
+else
+OFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
+endif
+
+SDL_CFLAGS = `sdl-config --cflags` -DSDL
+SDL_LDFLAGS = `sdl-config --libs`
+
+# Compiler flags
+ifeq ($(BUILD_PSP), YES)
+CFLAGS += -g -Wall -O2 $(INCLUDES) $(SDL_CFLAGS)
+else
+CFLAGS += -g -Wall -O2 $(INCLUDES) $(SDL_CFLAGS) -DNOTPSP
+endif
+CPPFLAGS += $(CFLAGS)
+ifeq ($(BUILD_WIN), YES)
+LDFLAGS += -mwindows -lgdi32 -lcomdlg32
+endif
+LDFLAGS += $(SDL_LDFLAGS) -lstdc++
+ifeq ($(BUILD_NDS), YES)
+LDFLAGS += -lfat -lthds9 -lnds9
+endif
+
+# Start compile
+all: $(TARGET)
+
+# Client compile
+$(TARGET): $(OFILES)
+	$(HOST)g++ $(OFILES) -o $@$(EXEC) $(LDFLAGS)
+ifeq ($(BUILD_NDS), YES)
+	mkdir -p ./MyNitroFS/gfx ./MyNitroFS/sfx
+	cp ./build/data/gfx/*.* ./MyNitroFS/gfx
+	cp ./build/device/nds/*.* ./MyNitroFS/sfx
+	$(HOST)objcopy -O binary $(TARGET)$(EXEC) $(TARGET).arm9
+	ndstool -c $(TARGET).nds -9 $(TARGET).arm9 -b ./build/device/nds/icon.bmp "TailTale - Shippo no Puzzle;Homebrew;www.tailtale.u-ac.net" -d MyNitroFS
+else
+ifeq ($(BUILD_PSP), YES)
+	mksfo 'TailTale - Shippo no Puzzle' param.sfo
+	pack-pbp ./build/eboot.pbp param.sfo ./build/device/psp/icon0.png NULL NULL ./build/device/psp/pic1.png NULL $(TARGET).elf NULL
+else
+ifeq ($(BUILD_WII), YES)
+	elf2dol $(TARGET)$(EXEC) $(TARGET).dol
+else
+ifeq ($(BUILD_WIN), YES)
+	strip $(TARGET)$(EXEC)
+else
+	$(HOST)strip $(TARGET)$(EXEC)
+endif
+endif
+endif
+endif
+
+%.o: %.c
+	$(HOST)gcc $(CFLAGS) -c ./$< -o ./$@
+
+%.o: %.cpp
+	$(HOST)g++ $(CPPFLAGS) -c ./$< -o ./$@
+
+ifeq ($(BUILD_WIN), YES)
+%.o: %.rc
+	windres -i $< --input-format=rc -o $@ -O coff
+endif
+
+# Clean Project
+clean:
+ifeq ($(BUILD_NDS), YES)
+	rm -fr ./MyNitroFS $(TARGET)$(EXEC) $(TARGET).arm9 $(TARGET).nds $(OFILES)
+else
+ifeq ($(BUILD_PSP), YES)
+	rm -f $(TARGET)$(EXEC) ./build/eboot.pbp param.sfo $(OFILES)
+else
+ifeq ($(BUILD_WII), YES)
+	rm -f $(TARGET)$(EXEC) $(TARGET).dol $(OFILES)
+else
+	rm -f $(TARGET)$(EXEC) $(OFILES)
+endif
+endif
+endif
+# --- puzzle02 makefile
+# $ID: $
+#
+
+PCCC     = gcc
+PCCFLAGS = -O2 -g -Wall -DDEBUG -DNOTPSP
+PCLIBS   = -L/usr/local/lib
+PCINCLUDE = -I/usr/local/mingw32/include -I/usr/local/mingw32/include/SDL
+
+# --- source code target
+PCOBJS = bootmain.o debug.o input.o sound.o \
+         grp_screen.o grp_texture.o grp_sprite.o
+
+PSPOBJS = bootmain.o debug.o input.o sound.o \
+         grp_screen.o grp_texture.o grp_sprite.o
+
+# - your apprication object
+
+APPOBJS = gamemain.o puz_base.o puz_disp.o puz_trial.o
+
+OBJS = $(PSPOBJS) $(APPOBJS)
+
+#
+TARGET = puzzle
+
+CFLAGS = -O2 -g -Wall -DDEBUG
+LIBS=
+LIBDIR =
+LDFLAGS =
+
+EXTRA_TARGETS = EBOOT.PBP kxploit
+EXTRA_CLEAN = pcclean
+
+# --- PC SDL
+PCCFLAGS += $(shell sdl-config --cflags)
+PCLIBS += $(shell sdl-config --libs)
+PCLIBS += -lSDL_mixer -lm -lSDL -lSDLmain -lSDL_image -lpng -lz
+
+PSP_EBOOT_TITLE = PUZ02-DEV
+PSP_DIR_NAME = PUZ02
+
+PSPSDK= $(shell psp-config --pspsdk-path)
+PSPBIN = devkitPSP/bin
+CFLAGS += `sdl-config --cflags` -I/devkitPSP/lib/gcc/psp/4.6.3/include
+LIBS += `sdl-config --libs`
+LIBS += -lSDL_mixer -lm -lSDL -lSDLmain -lSDL_image -lpng -lz -ljpeg
+include $(PSPSDK)/lib/build.mak
+
+
+
+
+pc : pcobjs
+	$(PCCC) -o $(TARGET) $(PCOBJS) $(APPOBJS) $(PCLIBS)
+
+pcobjs :
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c bootmain.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c debug.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c grp_screen.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c grp_texture.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c grp_sprite.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c input.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c sound.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c gamemain.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c puz_base.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c puz_disp.c
+	$(PCCC) $(PCCFLAGS) $(PCINCLUDE) -c puz_trial.c
+
+pcclean :
+	rm -rf *.o $(TARGET) $(TARGET)% $(TARGET).exe *~
+
+bootmain.o : bootmain.c bootmain.h debug.h
+debug.o : debug.c debug.h
+psp_debug.o : psp_debug.c debug.h
+grp_screen.o : grp_screen.c grp_screen.h grp_texture.h
+psp_grp_screen.o : psp_grp_screen.c grp_screen.h grp_texture.h
+input.o : input.c
+sound.o : sound.h
+grp_texture.o : grp_texture.c grp_texture.h
+grp_sprite.o : grp_sprite.c grp_sprite.h
+gamemain.o : gamemain.c gamemain.h grp_screen.h input.h sound.h debug.h \
+             grp_texture.h grp_sprite.h
+puz_base.o : puz_base.c puz_base.h
+puz_disp.o : puz_disp.c puz_disp.h puz_base.h
+puz_trial.o : puz_trial.c puz_trial.h puz_disp.h puz_base.h
+
+
+
+/**
+ *  --- SDL puzzle project 'tailtale'.
+ *
+ */
+
+#ifdef WIN32
+#include <windows.h>
+#endif
+#include <stdlib.h>
+#ifdef __GP2X__
+#include <unistd.h>
+#endif
+
+#if defined(NDS) || defined(GEKKO)
+#ifdef NDS
+#include <unistd.h>
+#include <nds.h>
+#include <nitrofs.h>
+#include <thmp3.h>
+#endif
+
+#include <fat.h>
+#endif
+
+#include "SDL.h"
+#include "SDL_main.h"
+#ifndef NDS
+#include "SDL_audio.h"
+#include "SDL_mixer.h"
+#endif
+
+#include "bootmain.h"
+#include "common.h"
+#include "debug.h"
+#include "input.h"
+#include "sound.h"
+#include "grp_screen.h"
+
+#include "gamemain.h"
+
+TGameScreen  *scr;
+TGameMain  *gamemain;
+
+#ifdef X86
+#include <string.h>
+#endif
+
+/* --------------------------------------------- */
+/* --- ���C�����[�`��                        --- */
+/* --------------------------------------------- */
+
+#ifdef WIN32
+int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
+#else
+int main (int argc, char *argv[]) {
+#endif
+  int  i;
+  /* --- ���C�����[�`�����[�v�t���O */
+  int  endflag;
+  /* --- �^�C���J�E���g */
+#ifdef NOTPSP
+  int  SystemTime;
+  int  BeforeTiming;
+  int  NowTiming;
+  int  WorkTime;
+  int  DispTime;
+#endif
+  int  FrameCounter;
+  int  FrameSkip;
+
+#ifdef NOTPSP
+  WorkTime = 0;
+#endif
+  FrameSkip = 0;
+
+#if defined(NDS) || defined(GEKKO)
+  fatInitDefault ();
+
+#ifdef NDS
+  nitroFSInit ("tailtale.nds");
+  chdir ("nitro:/");
+#endif
+#endif
+
+#ifdef X86
+#ifdef WIN32
+  Config_Load ();
+#else
+  for (i = 1; i < argc; i++) {
+    if ((!strcmp(argv[i], "-d")) || (!strcmp(argv[i], "-debug")))
+	  sys_debug = atoi (argv[i + 1]);
+    if ((!strcmp(argv[i], "-f")) || (!strcmp(argv[i], "-fullscreen")))
+	  sys_fullscreen = atoi (argv[i + 1]);
+    if ((!strcmp(argv[i], "-s")) || (!strcmp(argv[i], "-scale")))
+	  sys_scale = atoi (argv[i + 1]);
+    if ((!strcmp(argv[i], "-n")) || (!strcmp(argv[i], "-nosound")))
+	  sys_sound = atoi (argv[i + 1]);
+  }
+#endif
+#endif
+
+  /* ----- SDL ������ */
+  i = SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK);
+  if (i != 0) {
+    /* --- SDL���������ł��Ȃ����� */
+    Debugger ("SDL_Init failed: %s\n", SDL_GetError ());
+    exit(-1);
+  }
+
+  /* --- �I���t���O */
+  endflag = 0;
+
+  /* ----- �n�[�h�E�F�A������ */
+  InputInit();
+
+#if defined(X86) || defined(WIN32)
+  if (sys_sound == 1)
+#endif
+    SoundInit();
+
+#ifdef NDS
+  scr = TGameScreen_Create (320, 240, SCREEN_DEPTH);
+
+  iprintf("-----------[TailTale]-----------\n");
+  iprintf("        Shippo no Puzzle\n\n");
+  iprintf("-----------[Controls]-----------\n");
+  iprintf("L:      Volume Up\n");
+  iprintf("R:      Volume Down\n\n");
+  iprintf("Up:     Move Up\n");
+  iprintf("Down:   Move Down\n");
+  iprintf("Left:   Move Left\n");
+  iprintf("Right:  Move Right\n\n");
+  iprintf("Select: Help\n");
+  iprintf("Start:  Return\n\n");
+  iprintf("A:      Grab\n");
+  iprintf("B:      \n");
+  iprintf("X:      \n");
+  iprintf("Y:      \n");
+#else
+  scr = TGameScreen_Create (SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH);
+#endif
+  TGameScreen_SetWMName(scr, WindowName);
+#ifdef NOTPSP
+  SystemTime = SDL_GetTicks();
+  BeforeTiming = SystemTime;
+  DispTime = 0;
+#endif
+  FrameCounter = 0;
+  srand(1);
+  InputJoyKeySwap(FALSE);
+
+  /* ----- �Q�[���{�̏����� */
+  gamemain = TGameMain_Create(scr);
+
+  /* ---------------------------------------- */
+  /* ----- ���C�����[�`��                     */
+  /* ---------------------------------------- */
+  while(endflag == 0) {
+    /* --- �Q�[���{�̃��[�v */
+    for(i=0; i<=FrameSkip; i++) {
+      FrameCounter = FrameCounter + 1;
+      InputPoll();
+      /* ------------------------------- */
+      /* ----- �Q�[�����C���� */
+      if ((TGameMain_Poll(gamemain, FrameCounter) == FALSE) ||
+	  (InputExit() != 0)) {
+#ifdef NOTPSP
+      BeforeTiming = SDL_GetTicks();
+#endif
+	break;
+      }
+    }
+
+#ifdef NOTPSP
+    WorkTime = SDL_GetTicks() - BeforeTiming;
+#endif
+
+    /* --- �t���[���I���A�X�N���[���`�� */
+    TGameScreen_RefreshScreen(scr);
+    /* --- �t���[���^�C�}�[ */
+#ifdef NOTPSP
+    DispTime = SDL_GetTicks() - BeforeTiming;
+
+    NowTiming = (1000 / FRAME_RATE) - WorkTime;
+    if ((NowTiming > 0) && (NowTiming <= (1000 / FRAME_RATE))) {
+      SDL_Delay (NowTiming);
+    }
+    endflag = InputExit();
+    FrameSkip = DispTime / (1000 / FRAME_RATE);
+    if (FrameSkip > FRAME_SKIP_MAX) {
+      FrameSkip = FRAME_SKIP_MAX;
+    }
+    BeforeTiming = SDL_GetTicks();
+#else
+    FrameSkip = 0;
+#endif
+
+    /* ---------------------------------------- */
+    /* ----- ���C�����[�v�R�R�܂�               */
+
+#ifdef NDS
+    swiWaitForVBlank ();
+    mp3Update ();
+#endif
+  }
+
+  /* --- �Q�[�����C�����[�v�I�� */
+  TGameMain_Destroy(gamemain);
+  /* --- �X�N���[����� */
+  TGameScreen_Destroy(scr);
+  /* --- �I���ASDL �㏈�� */
+#if defined(X86) || defined(WIN32)
+  if (sys_sound == 1)
+#endif
+    SoundFree();
+  InputFree();
+
+#ifdef __GP2X__
+  chdir("/usr/gp2x");
+  execl("/usr/gp2x/gp2xmenu", "/usr/gp2x/gp2xmenu", NULL);
+#else
+#ifdef WIN32
+  Config_Save ();
+#endif
+
+  SDL_Quit();
+#endif
+
+  return(0);
+}
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintainer  Rerorero@fumi.  */
+/*      C-SDL convert     2nd Maintainer  rerofumi.       */
+/*                                                        */
+/*   bootmain.h                                           */
+/*     �縵�Υᥤ��롼����Ȥ��ε�ư����                 */
+/*                                                        */
+/*--------------------------------------------------------*/
+/* -- $Id: bootmain.pp,v 1.6 2002/08/10 03:05:14 rero2 Exp $ */
+
+#ifndef BOOTMAIN_H
+#define BOOTMAIN_H
+
+/* ------------------------------------------------ */
+/* --- define                                       */
+/* ------------------------------------------------ */
+
+/* ----- ���̥����������� */
+
+#ifndef NDS
+#define  SCREEN_WIDTH   320
+#define  SCREEN_HEIGHT  240
+#endif
+
+#ifdef __GP2X__
+#define  SCREEN_DEPTH   16
+#elif NDS
+#define  SCREEN_DEPTH   8
+#else
+#define  SCREEN_DEPTH   32
+#endif
+
+/* ----- �ե졼��졼�Ȥ����� */
+#define FRAME_RATE      60
+#define FRAME_SKIP_MAX  6
+
+/* ----- window title */
+char   *WindowName = "TailTale - Shippo no Puzzle";
+
+#endif //BOOTMAIN_H
+
+
+
Add a comment to this file

build/data/gfx/chara01_1.png

Added
New image
Add a comment to this file

build/data/gfx/chara01_2.png

Added
New image
Add a comment to this file

build/data/gfx/chara01_3.png

Added
New image
Add a comment to this file

build/data/gfx/chara01_4.png

Added
New image
Add a comment to this file

build/data/gfx/chara01_5.png

Added
New image
Add a comment to this file

build/data/gfx/chara01_6.png

Added
New image
Add a comment to this file

build/data/gfx/control.png

Added
New image
Add a comment to this file

build/data/gfx/title_320.png

Added
New image
Add a comment to this file

build/data/gfx/trial_parts_320.png

Added
New image
Add a comment to this file

build/data/sfx/bgm001.mp3

Binary file added.

Add a comment to this file

build/data/sfx/bgm002.mp3

Binary file added.

Add a comment to this file

build/data/sfx/bgm004.mp3

Binary file added.

Add a comment to this file

build/data/sfx/se01.wav

Binary file added.

Add a comment to this file

build/data/sfx/se02.wav

Binary file added.

Add a comment to this file

build/data/sfx/se03.wav

Binary file added.

Add a comment to this file

build/data/sfx/se04.wav

Binary file added.

Add a comment to this file

build/data/sfx/se05.wav

Binary file added.

Add a comment to this file

build/data/sfx/se06.wav

Binary file added.

Add a comment to this file

build/data/sfx/se07.wav

Binary file added.

Add a comment to this file

build/data/sfx/se08.wav

Binary file added.

build/data/snd.lst

+# -----------------------------------------------
+# --- �Q�[���p�T�E���h��`
+#
+
+M001 sfx/bgm001.mp3
+M002 sfx/bgm002.mp3
+M003 sfx/bgm004.mp3
+
+S001 sfx/se01.wav
+S002 sfx/se02.wav
+S003 sfx/se03.wav
+S004 sfx/se04.wav
+S005 sfx/se05.wav
+S006 sfx/se06.wav
+S007 sfx/se07.wav
+S008 sfx/se08.wav
Add a comment to this file

build/device/dingoo/icon.png

Added
New image

build/device/gph/tailtale.ini

+[info]
+name="TailTale"
+path="/tailtale/boot.gpe"
+icon="/tailtale/icon.png"
+title="/tailtale/banner.png"
+group="GAME"
Add a comment to this file

build/device/gph/tailtale/icon.png

Added
New image
Add a comment to this file

build/device/nds/icon.bmp

Added
New image
Add a comment to this file

build/device/nds/thmp3.arm7

Binary file added.

Add a comment to this file

build/device/psp/icon0.png

Added
New image
Add a comment to this file

build/device/psp/pic1.png

Added
New image
Add a comment to this file

build/device/wii/Icon.png

Added
New image

build/device/wii/meta.xml

+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+	<app version="1.0">
+		<name>
+			TailTale - Shippo no Puzzle
+		</name>
+		<coder>
+			rerofumi, ported by Rikku2000
+		</coder>
+		<version>
+			1.1
+		</version>
+		<release_date>
+			08.10.2012
+		</release_date>
+		<short_description>
+			Doujin puzzle game
+		</short_description>
+		<long_description>
+			TailTale is a tile-matching puzzle video
+			game developed for open video game
+			console.
+		</long_description>
+	</app>
Add a comment to this file

build/device/win32/icon.ico

Added
New image

build/device/win32/res.rc

+1 VERSIONINFO
+
+FILEVERSION 1,0,0,0
+PRODUCTVERSION 1,0,0,0
+
+{
+	BLOCK "StringFileInfo"
+	{
+		BLOCK "040904E4"
+		{
+			VALUE "Comments", "\0"
+			VALUE "CompanyName", "fumi2kick Software\0"
+			VALUE "FileDescription", "Freeware\0"
+			VALUE "FileVersion", "1.0.0.0\0"
+			VALUE "InternalName", "TailTale\0"
+			VALUE "LegalCopyright", "Copyright (C) 2012\0"
+			VALUE "LegalTrademarks", "fumi2kick Software\0"
+			VALUE "OriginalFilename", "tt.exe\0"
+			VALUE "ProductName", "TailTale\0"
+			VALUE "ProductVersion", "1.0.0.0\0"
+		}
+	}
+
+	BLOCK "VarFileInfo"
+	{
+		VALUE "Translation", 0x0409, 0x04E4
+	}
+}
+
+IDI_GAMEICON ICON DISCARDABLE "icon.ico"
+/*
+	SDL puzzle project
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "common.h"
+#include "debug.h"
+
+int sys_debug, sys_fullscreen, sys_scale, sys_sound, sys_bgm_volume, sys_se_volume;
+
+#ifdef WIN32
+int Config_Load () {
+	FILE* config;
+
+	config = fopen ("config.ini", "r");
+	if (config == NULL) {
+		Debugger ("Config_Load failed: Cannot open config.ini\n");
+		return 1;
+	} else {
+		fscanf (config, "sys_debug=%d\n", &sys_debug);
+		fscanf (config, "sys_fullscreen=%d\n", &sys_fullscreen);
+		fscanf (config, "sys_scale=%d\n", &sys_scale);
+		fscanf (config, "sys_sound=%d\n", &sys_sound);
+		fscanf (config, "sys_bgm_volume=%d\n", &sys_bgm_volume);
+		fscanf (config, "sys_se_volume=%d\n", &sys_se_volume);
+
+		fclose (config);
+	}
+
+	return 0;
+}
+
+int Config_Save () {
+	FILE *config;
+
+	config = fopen ("config.ini", "w");
+	if (config == NULL) {
+		Debugger ("Config_Save failed: Cannot open config.ini\n");
+		return 1;
+	} else {
+		fprintf (config, "sys_debug=%d\n", sys_debug);
+		fprintf (config, "sys_fullscreen=%d\n", sys_fullscreen);
+		fprintf (config, "sys_scale=%d\n", sys_scale);
+		fprintf (config, "sys_sound=%d\n", sys_sound);
+		fprintf (config, "sys_bgm_volume=%d\n", sys_bgm_volume);
+		fprintf (config, "sys_se_volume=%d\n", sys_se_volume);
+
+		fclose (config);
+	}
+
+	return 0;
+}
+#endif
+
+
+/*
+	SDL puzzle project
+*/
+
+extern int sys_debug, sys_fullscreen, sys_scale, sys_sound, sys_bgm_volume, sys_se_volume;
+
+#ifdef WIN32
+int Config_Load ();
+int Config_Save ();
+#endif
+/* ---------------------------------------------------------- */
+/*  debug.c                                                   */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   debug.c                                             */
+/*     �f�o�b�O�p�`�F�b�N���[�`��                         */
+/*                                                        */
+/*--------------------------------------------------------*/
+/* -- $Id: debug.pp,v 1.3 2002/07/11 17:21:47 rero2 Exp $ */
+
+/*------------------------------------------------------------- */
+/** @file
+    @brief		�f�o�b�O�`�F�b�N���[�`��
+    @author		K.Kunikane (rerofumi)
+    @since		Jul.27.2005
+    $Revision: 1.1.1.1 $
+*/
+/*-----------------------------------------------------
+ Copyright (C) 2002,2005 rerofumi <rero2@yuumu.org>
+ All Rights Reserved.
+ ------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "common.h"
+#include "debug.h"
+
+void Debugger (char *text, ...) {
+#ifndef NDS
+	FILE* file;
+	va_list arglist;
+
+	file = fopen ("debug.log", "a");
+	if (file == NULL)
+		fprintf (stdout, "Debugger failed: Cannot open debug.log\n");
+	else if (sys_debug == 1) {
+		va_start (arglist, text);
+		vfprintf (file, text, arglist);
+		va_end (arglist);
+
+		fclose (file);
+	}
+#endif
+}
+/* ---------------------------------------------------------- */
+/*  debug.h                                                   */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   debug.pp                                             */
+/*     �ǥХå��ѥ����å��롼����                         */
+/*                                                        */
+/*--------------------------------------------------------*/
+/* -- $Id: debug.pp,v 1.3 2002/07/11 17:21:47 rero2 Exp $ */
+
+
+/*------------------------------------------------------------- */
+/** @file
+    @brief		�ǥХå������å��롼����
+    @author		K.Kunikane (rerofumi)
+    @since		Jul.27.2005
+    $Revision: 1.1.1.1 $
+*/
+/*-----------------------------------------------------
+ Copyright (C) 2002,2005 rerofumi <rero2@yuumu.org>
+ All Rights Reserved.
+ ------------------------------------------------------*/
+
+#ifndef DEBUG_H
+#define DEBUG_H
+
+void Debugger (char *text, ...);
+
+#endif //DEBUG_H
+/* ---------------------------------------------------------- */
+/*  gamemain.c                                                */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   gamemain.c                                           */
+/*     �Q�[���{�̂̃��C���t���[                           */
+/*                                                        */
+/*--------------------------------------------------------*/
+
+/*------------------------------------------------------------- */
+/** @file
+    @brief		�Q�[���{�̃X�e�b�v
+    @author		K.Kunikane (rerofumi)
+    @since		Sep.20.2005
+*/
+/*-----------------------------------------------------
+ Copyright (C) 2002,2005 rerofumi <rero2@yuumu.org>
+ All Rights Reserved.
+ ------------------------------------------------------*/
+
+/*-------------------------------*/
+/* include                       */
+/*-------------------------------*/
+
+#include <stdlib.h>
+#include <math.h>
+
+#ifdef NDS
+#include <nds.h>
+#endif
+
+#include "gamemain.h"
+#include "input.h"
+#include "sound.h"
+#include "debug.h"
+#include "puz_trial.h"
+
+/*-------------------------------*/
+/* local value                   */
+/*-------------------------------*/
+
+/*-------------------------------*/
+/* local function                */
+/*-------------------------------*/
+
+/* -------------------------------------------------------------- */
+/* --- �Q�[�����C���X�e�b�v                                       */
+/* -------------------------------------------------------------- */
+
+/* ---------------------------------------- */
+/* --- �R���X�g���N�^�E�f�X�g���N�^         */
+TGameMain *TGameMain_Create(TGameScreen *mainscreen)
+{
+  TGameMain *class;
+
+  class = malloc(sizeof(TGameMain));
+  if (class == NULL) return(0);
+
+  class->sound_volume = 96;
+  class->control_reverse = 0;
+
+  class->screen = mainscreen;
+  class->step = TitleInit;
+  class->level = LevelEasy;
+
+  return(class);
+}
+
+void TGameMain_Destroy(TGameMain *class)
+{
+  if (class == NULL) return;
+  /* �C���X�^���X�̉�� */
+  free(class);
+}
+
+/* ---------------------------------------- */
+/* --- �Q�[�����C��                         */
+/* ---------------------------------------- */
+int TGameMain_Poll(TGameMain *class,
+		    int counter)
+{
+  int  i;
+  int  skip;
+  TGameSprite  *sp;
+  SDL_Surface  *texkey;
+
+  if (class == NULL) return(FALSE);
+
+  skip = TRUE;
+
+  /* -------------------------------- */
+  /* --- �{�����[���R���g���[�� */
+#ifdef __GP2X__
+  i = InputJoyKeyTriger(0);
+  if ((i & IN_GP_VOLUP) != 0) {
+    if (class->sound_volume < 128) {
+      class->sound_volume += 16;
+      if (class->sound_volume > 128) {
+	class->sound_volume = 128;
+      }
+      SoundVolume(class->sound_volume);
+    }
+  }
+  if ((i & IN_GP_VOLDOWN) != 0) {
+    if (class->sound_volume > 0) {
+      class->sound_volume -= 16;
+      if (class->sound_volume < 0) {
+	class->sound_volume = 0;
+      }
+      SoundVolume(class->sound_volume);
+    }
+  }
+  DEBUGPRINT("VOLUME : %d", class->sound_volume);
+#endif
+
+  /* -------------------------------- */
+  /* --- �Q�[�����C���X�e�b�v */
+  
+  switch(class->step) {
+
+    /* -- �^�C�g�������� */
+  case TitleInit:
+    TGameScreen_LoadTexture(class->screen, 0, "gfx/title_320.png");
+    texkey = TGameScreen_GetTexture(class->screen, 0);
+    SDL_SetColorKey(texkey,
+		    SDL_SRCCOLORKEY,
+		    SDL_MapRGB(texkey->format,
+			       0x20, 0x40, 0x80));
+    class->bg = TGameScreen_GetSprite(class->screen, 0);
+    class->logo = TGameScreen_GetSprite(class->screen, 1);
+    class->push = TGameScreen_GetSprite(class->screen, 2);
+    class->release = TGameScreen_GetSprite(class->screen, 3);
+    class->select_level = TGameScreen_GetSprite(class->screen, 4);
+    class->bg->DispSw = TRUE;
+    class->bg->x = 0;
+    class->bg->y = 0;
+    class->bg->w = 320;
+    class->bg->h = 240;
+    class->bg->tx = 0;
+    class->bg->ty = 0;
+    class->bg->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->bg->alpha = 255;
+    class->logo->DispSw = FALSE;
+    class->logo->x = 0;
+    class->logo->y = 0;
+    class->logo->w = 300;
+    class->logo->h = 84;
+    class->logo->tx = 0;
+    class->logo->ty = 240;
+    class->logo->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->logo->alpha = 255;
+    class->push->DispSw = FALSE;
+    class->push->x = 40;
+    class->push->y = 180;
+    class->push->w = 240;
+    class->push->h = 23;
+    class->push->tx = 0;
+    class->push->ty = 325;
+    class->push->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->push->alpha = 255;
+    class->release->DispSw = FALSE;
+    class->release->x = 40;
+    class->release->y = 210;
+    class->release->w = 240;
+    class->release->h = 10;
+    class->release->tx = 0;
+    class->release->ty = 349;
+    class->release->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->release->alpha = 255;
+    class->select_level->DispSw = FALSE;
+    class->select_level->x = 160-40;
+    class->select_level->y = 160;
+    class->select_level->w = 80;
+    class->select_level->h = 18;
+    class->select_level->tx = 300;
+    class->select_level->ty = 240 + (24 * class->level);
+    class->select_level->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->select_level->alpha = 255;
+    class->titletimer = 0;
+    class->step = TitleIn;
+    skip = FALSE;
+    break;
+
+    /* -- �^�C�g�����S�t���[���C�� */
+  case TitleIn:
+    /* - SE */
+    if (class->titletimer == 15*2) SoundSE(1);
+    if (class->titletimer > 20*2) {
+      /* �͂��� */
+      class->logo->x = 10;
+      class->logo->y = 120 - (int)(sin(3.1415926 * 2.0 * (((float)class->titletimer - 40.0) / 120.0)) * 120.0);
+      class->logo->DispSw = TRUE;
+    }
+    else {
+      /* �ォ��~���Ă��� */
+      class->logo->x = 10;
+      class->logo->y = 120 - ((40 - class->titletimer) * 10);
+      class->logo->DispSw = TRUE;
+    }
+    /* -- ���֐i�ރX�e�b�v */
+    class->titletimer = class->titletimer + 1;
+    if (class->titletimer == 38*2) {
+      SoundSE(6);
+    }
+    if (class->titletimer == 45*2) {
+      SoundMusic(2);
+      class->step = TitleMain;
+    }
+    i = InputJoyKeyTriger(0);
+    if ((i & IN_Button1) != 0) {
+      SoundMusic(2);
+      class->step = TitleMain;
+    }
+    break;
+
+    /* -- �X�^�[�g�{�^���҂� */
+  case TitleMain:
+    class->logo->DispSw = TRUE;
+    class->logo->x = 10;
+    class->logo->y = 60;
+    class->release->DispSw = TRUE;
+    class->select_level->DispSw = TRUE;
+    if (((class->titletimer / 8) % 2) == 1) {
+      class->push->DispSw = TRUE;
+    }
+    else {
+      class->push->DispSw = FALSE;
+    }
+    class->titletimer = class->titletimer + 1;
+    i = InputJoyKeyTriger(0);
+    if ((i & (IN_Button1|IN_Button2|IN_Button3|IN_Button4|IN_GP_START)) != 0) {
+      SoundSE(2);
+      class->titletimer = 0;
+      class->step = TitleStart;
+    }
+    if (i & IN_GP_SELECT) {
+      class->step = ConfigInit;
+    }
+    /* ���x���Z���N�g */
+    if ((i & IN_Left) != 0) {
+      class->level ^= LevelHard;
+    }
+    if ((i & IN_Right) != 0) {
+      class->level ^= LevelHard;
+    }
+    class->select_level->ty = 240 + (24 * class->level);
+    break;
+
+    /* -- �X�^�[�g���A�g���N�g */
+  case TitleStart:
+    class->logo->DispSw = TRUE;
+    class->logo->x = 10;
+    class->logo->y = 60;
+    class->release->DispSw = TRUE;
+    if ((class->titletimer % 2) == 1) {
+      class->push->DispSw = TRUE;
+    }
+    else {
+      class->push->DispSw = FALSE;
+    }
+    class->titletimer = class->titletimer + 1;
+    if (class->titletimer == 20) {
+      SoundMusicStop();
+      class->step = TitleFree;
+    }
+    break;
+
+    /* -- �^�C�g�����S�サ�܂� */
+  case TitleFree:
+    srand(counter);
+    class->bg->DispSw = FALSE;
+    class->logo->DispSw = FALSE;
+    class->push->DispSw = FALSE;
+    class->release->DispSw = FALSE;
+    class->select_level->DispSw = FALSE;
+    class->step = PuzzleInit;
+    break;
+
+
+    /* -- �Q�[�������� */
+  case PuzzleInit:
+    class->puzzle = TPuzzleTrial_Create(class->screen, class->level);
+    class->step = PuzzleMain;
+    skip = FALSE;
+    break;
+
+    /* -- �Q�[�����C�� */
+  case PuzzleMain:
+    TPuzzleTrial_GameMain(class->puzzle);
+    if (TPuzzleTrial_GameStat(class->puzzle) == FALSE) {
+      class->step = PuzzleFree;
+    }
+    break;
+
+    /* -- �Q�[���I���サ�܂� */
+    case PuzzleFree:
+      TPuzzleTrial_Destroy(class->puzzle);
+      for( i=0; i<SPRITEMAX; i++) {
+	sp = TGameScreen_GetSprite(class->screen, i);
+	sp->DispSw = FALSE;
+      }
+      class->step = TitleInit;
+      break;
+
+    /* -- GP2X �L�[�R���t�B�O */
+  case ConfigInit:
+    TGameScreen_LoadTexture(class->screen, 0, "gfx/control.png");
+    texkey = TGameScreen_GetTexture(class->screen, 0);
+    SDL_SetColorKey(texkey,
+		    SDL_SRCCOLORKEY,
+		    SDL_MapRGB(texkey->format,
+			       0x20, 0x40, 0x80));
+    class->bg = TGameScreen_GetSprite(class->screen, 0);
+    class->push = TGameScreen_GetSprite(class->screen, 2);
+    class->bg->DispSw = TRUE;
+    class->bg->x = 0;
+    class->bg->y = 0;
+    class->bg->w = 320;
+    class->bg->h = 240;
+    class->bg->tx = 0;
+    class->bg->ty = 0;
+    class->bg->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->bg->alpha = 255;
+    class->push->DispSw = TRUE;
+    class->push->x = 0;
+    class->push->y = 48;
+    class->push->w = 320;
+    class->push->h = 112;
+    class->push->tx = 0;
+    class->push->ty = 240 + 112*(class->control_reverse ^ 1);
+    class->push->Texture = TGameScreen_GetTexture(class->screen, 0);
+    class->push->alpha = 255;
+    class->logo->DispSw = FALSE;
+    class->release->DispSw = FALSE;
+    class->select_level->DispSw = FALSE;
+    class->control_anime = 0;
+    class->control_anime_y = 112*(class->control_reverse ^ 1);
+    class->step = ConfigMain;
+    break;
+
+    /* -- GP2X �L�[�R���t�B�O�I�� */
+  case ConfigMain:
+    if (class->control_anime != 0) {
+      class->control_anime_y += class->control_anime;
+      class->push->ty = 240 + class->control_anime_y;
+      if ((class->control_anime_y <= 0) ||
+	  (class->control_anime_y >= 112)) {
+	class->control_anime = 0;
+      }
+    }
+    else {
+      i = InputJoyKeyTriger(0);
+      if ((i & (IN_GP_SELECT)) != 0) {
+	SoundSE(6);
+	class->control_reverse ^= 1;
+	if (class->control_reverse == 0) {
+	  class->control_anime = 8;
+	}
+	else {
+	  class->control_anime = -8;
+	}
+      }
+      if ((i & (IN_GP_START)) != 0) {
+	SoundSE(2);
+	class->step = ConfigFree;
+      }
+    }
+    break;
+
+    /* -- GP2X �L�[�R���t�B�O�I�� */
+  case ConfigFree:
+    InputJoyKeySwap(class->control_reverse);
+    class->step = TitleInit;
+    break;
+
+
+  } // switch
+
+  return(skip);
+}
+
+/* ---------------------------------------------------------- */
+/*  gamemain.h                                                */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   gamemain.h                                           */
+/*     ����������Υե                                 */
+/*                                                        */
+/*--------------------------------------------------------*/
+
+#ifndef GAMEMAIN_H
+#define GAMEMAIN_H
+
+/*-------------------------------*/
+/* include                       */
+/*-------------------------------*/
+
+#include "SDL.h"
+#include "grp_screen.h"
+#include "puz_trial.h"
+
+/*-------------------------------*/
+/* define                        */
+/*-------------------------------*/
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+/* --- �����ॹ�ƥåפΥ�٥� */
+enum {
+  TitleInit,
+  TitleIn,
+  TitleMain,
+  TitleStart,
+  TitleFree,
+  PuzzleInit,
+  PuzzleMain,
+  PuzzleFree,
+  ConfigInit,
+  ConfigMain,
+  ConfigFree
+} MainStep;
+
+
+/*-------------------------------*/
+/* struct                        */
+/*-------------------------------*/
+
+typedef struct {
+  int  titletimer;
+  SDL_Surface  *tex;
+  TGameSprite  *bg, *logo, *push, *release, *select_level;
+  TGameScreen  *screen;
+  int  sound_volume;
+  int  control_reverse;
+  int  control_anime;
+  int  control_anime_y;
+  int  level;
+  int  step;
+  TPuzzleTrial  *puzzle;
+} TGameMain, *PTGameMain;
+
+/* ---------------------------------------------- */
+/* --- extern                                  -- */
+/* ---------------------------------------------- */
+
+TGameMain *TGameMain_Create(TGameScreen *mainscreen);
+void TGameMain_Destroy(TGameMain *class);
+
+int TGameMain_Poll(TGameMain *class,
+		   int  counter);
+
+
+#endif //GAMEMAIN_H
+/* ---------------------------------------------------------- */
+/*  grp_screen.c                                              */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   grp_screen.c                                         */
+/*     ��ʊǗ��N���X                                     */
+/*                                                        */
+/*--------------------------------------------------------*/
+
+
+/*------------------------------------------------------------- */
+/** @file
+    @brief		�`��X�N���[���Ǘ�
+    @author		K.Kunikane (rerofumi)
+    @since		Jul.27.2005
+*/
+/*-----------------------------------------------------
+ Copyright (C) 2002,2005 rerofumi <rero2@yuumu.org>
+ All Rights Reserved.
+ ------------------------------------------------------*/
+
+/*-------------------------------*/
+/* include                       */
+/*-------------------------------*/
+
+#ifndef NOTPSP
+#include <pspkernel.h>
+#include <pspdisplay.h>
+
+#include <pspgu.h>
+#include <pspgum.h>
+
+#include <malloc.h>
+#endif
+#include <stdlib.h>
+
+#include "grp_screen.h"
+#include "grp_table_int.h"
+
+#include "common.h"
+#include "debug.h"
+
+/*-------------------------------*/
+/* local value                   */
+/*-------------------------------*/
+
+#ifndef NOTPSP
+/* --- PSP�Œ�l */
+#define BUF_WIDTH (512)
+#define SCR_WIDTH (480)
+#define SCR_HEIGHT (272)
+#define FRAME_SIZE (BUF_WIDTH * SCR_HEIGHT * PIXEL_SIZE)
+
+/* change this if you change to another screenmode */
+#define PIXEL_SIZE (4)
+
+/* zbuffer seems to be 16-bit? */
+#define ZBUF_SIZE (BUF_WIDTH * SCR_HEIGHT * 2)
+
+/* �傫�ȃX�v���C�g��`�悷��Ƃ��̕����T�C�Y */
+#define SLICE_SIZE  64
+
+/* --- GU �`��̂��߂̃p�P�b�g�T�C�Y */
+#define PACKET_SIZE  262144
+//static  unsigned int __attribute__((aligned(16))) packet[262144];
+
+
+struct SpriteVertex
+{
+  unsigned short u, v;
+  unsigned int color;
+  short x,y,z;
+};
+#endif
+
+/*-------------------------------*/
+/* local function                */
+/*-------------------------------*/
+
+/* --- �X�v���C�g��ꖇ�X�N���[���ɓ\��t���� */
+void Render(TGameScreen *class, TGameSprite *spr);
+void RenderZoomRot(TGameScreen *class, TGameSprite *spr);
+
+#if defined(X86) || defined(WIN32)
+SDL_Surface *Video;
+
+void upscale (Uint32 *to, Uint32 *from) {
+  Uint32 pixel;
+  int i = 0, endline;
+
+  do {
+    endline = 320 + i;
+
+    do {
+      pixel = from[i++];
+
+      *(to + 640) = pixel;
+      *to++ = pixel;
+
+      *(to + 640) = pixel;
+      *to++ = pixel;
+    } while (i < endline);
+
+    to += 640;
+  } while (i < 320 * 240);
+}
+#endif
+
+/* -------------------------------------------------------------- */
+/* --- �X�N���[���Ǘ��N���X                                       */
+/* -------------------------------------------------------------- */
+
+/* ---------------------------------------- */
+/* --- �R���X�g���N�^�E�f�X�g���N�^         */
+TGameScreen *TGameScreen_Create(int width, int height, int depth)
+{
+#ifndef NOTPSP
+  int  i;
+
+  TGameScreen *class;
+
+  /* --- �C���X�^���X�̐��� */
+  class = malloc(sizeof(TGameScreen));
+  if (class == 0) {
+    return(0);
+  }
+  class->packet = (void*)memalign(16, sizeof(unsigned int) * PACKET_SIZE);
+  if (class->packet == 0) {
+    free(class);
+    return(0);
+  }
+
+  /* ----- work memo */
+  class->Screen = 0;
+  class->Width = width;
+  class->Height = height;
+  class->Depth = depth;
+
+  /* ----- GU initialise */
+  sceGuInit();
+
+  sceGuStart(GU_DIRECT, class->packet);
+  if (depth == 16) {
+    sceGuDrawBuffer(GU_PSM_5551, (void*)0, BUF_WIDTH);
+    sceGuDispBuffer(SCR_WIDTH, SCR_HEIGHT, (void*)0x44000, BUF_WIDTH);
+    sceGuDepthBuffer((void*)0x88000, BUF_WIDTH);
+  }
+  else {
+    sceGuDrawBuffer(GU_PSM_8888, (void*)0, BUF_WIDTH);
+    sceGuDispBuffer(SCR_WIDTH, SCR_HEIGHT, (void*)0x88000, BUF_WIDTH);
+    sceGuDepthBuffer((void*)0x110000, BUF_WIDTH);
+  }
+  sceGuOffset(2048 - (SCR_WIDTH/2),2048 - (SCR_HEIGHT/2));
+  sceGuViewport(2048,2048,SCR_WIDTH,SCR_HEIGHT);
+  sceGuDepthRange(0xc350,0x2710);
+  sceGuScissor(0,0,SCR_WIDTH,SCR_HEIGHT);
+  sceGuEnable(GU_SCISSOR_TEST);
+  //sceGuAlphaFunc(GU_ALWAYS,0,0xff);
+  //sceGuEnable(GU_ALPHA_TEST);
+  //sceGuDepthFunc(GU_GEQUAL);
+  //sceGuEnable(GU_DEPTH_TEST);
+  sceGuFrontFace(GU_CW);
+  sceGuShadeModel(GU_SMOOTH);
+  sceGuEnable(GU_CULL_FACE);
+  sceGuEnable(GU_BLEND);
+  sceGuEnable(GU_TEXTURE_2D);
+  sceGuFinish();
+  sceGuSync(0,0);
+
+  sceDisplayWaitVblankStart();
+  sceGuDisplay(GU_TRUE);
+
+  class->current_buffer_ptr = 0;
+
+  /* --- �e�N�X�`���}�l�[�W���̏����� */
+  class->Texture = TGameTexture_Create();
+  /* --- �X�v���C�g�}�l�[�W���̏����� */
+  for(i=0; i<SPRITEMAX; i++) {
+    class->Sprites[i] = TGameSprite_Create();
+  }
+
+  /* --- �|�C���^��Ԃ��ďI�� */
+  return(class);
+#else
+  int  i;
+
+  TGameScreen *class;
+
+  /* --- �C���X�^���X�̐��� */
+  class = malloc(sizeof(TGameScreen));
+  if (class == 0) {
+    return(0);
+  }
+
+  /* ----- �X�N���[���̐��� */
+#if defined(X86) || defined(WIN32)
+  if (sys_scale == 1) {
+    Video = SDL_SetVideoMode (width * 2, height * 2, depth, SDL_SWSURFACE|((sys_fullscreen) ? SDL_FULLSCREEN : 0));
+    if (Video == NULL)
+      Debugger ("SDL_SetVideoMode failed: %s\n", SDL_GetError ());
+
+    class->Screen = SDL_CreateRGBSurface (SDL_SWSURFACE, width, height, depth, DBmask, DGmask, DRmask, DAmask);
+  } else {
+    class->Screen = SDL_SetVideoMode (width, height, depth, SDL_SWSURFACE|((sys_fullscreen) ? SDL_FULLSCREEN : 0));
+    if (class->Screen == NULL)
+      Debugger ("SDL_SetVideoMode failed: %s\n", SDL_GetError ());
+  }
+#else
+  class->Screen = SDL_SetVideoMode (width, height, depth, SDL_SWSURFACE);
+  if (class->Screen == NULL)
+    Debugger ("SDL_SetVideoMode failed: %s\n", SDL_GetError ());
+#endif
+  class->Texture = TGameTexture_Create();
+  class->Width = width;
+  class->Height = height;
+  class->Depth = depth;
+  /* --- ������ */
+  for(i=0; i<SPRITEMAX; i++) {
+    class->Sprites[i] = TGameSprite_Create();
+  }
+
+  SDL_ShowCursor (SDL_DISABLE);
+
+  /* --- �|�C���^��Ԃ��ďI�� */
+  return(class);
+#endif
+}
+
+void TGameScreen_Destroy(TGameScreen *class)
+{
+  int  i;
+
+  if (class) {
+    /* ----- �e�N�X�`���̉�� */
+    TGameTexture_Destroy(class->Texture);
+    /* ----- �X�N���[���̉�� */
+    SDL_FreeSurface(class->Screen);
+    /* ----- �X�v���C�g�̉�� */
+    for(i=0; i<SPRITEMAX; i++) {
+      TGameSprite_Destroy(class->Sprites[i]);
+    }
+
+    /* ----- �C���X�^���X�̔j�� */
+    free(class);
+  }
+}
+
+/* ---------------------------------------- */
+/* --- �E�B���h�E�^�C�g���̐ݒ�             */
+void TGameScreen_SetWMName(TGameScreen *class, char *name)
+{
+#if defined(X86) || defined(WIN32)
+  SDL_WM_SetCaption(name, name);
+#endif
+}
+
+
+/* ---------------------------------------- */
+/* --- �t���[���^�C�~���O�ɂ��S�`��       */
+void TGameScreen_DispScreen(TGameScreen *class)
+{
+#ifndef NOTPSP
+  int  i;
+  int  texture_cache;
+  void  *texture_cache_ptr;
+
+  texture_cache = -1;
+  texture_cache_ptr = 0;
+
+  /* --- �X�v���C�g�`�� */
+  for(i=0; i<SPRITEMAX; i++) {
+    if ((class->Sprites[i]->DispSw == TRUE) &&
+	(class->Sprites[i]->Texture != NULL)) {
+      /* --- �e�N�X�`���̓]�����K�v�Ȃ� */
+      if ((class->Sprites[i]->TextureId != texture_cache) ||
+	  (class->Sprites[i]->Texture != texture_cache_ptr)) {
+	texture_cache = class->Sprites[i]->TextureId;
+	texture_cache_ptr = class->Sprites[i]->Texture;
+	/* - �e�N�X�`���]���R�}���h */
+	sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
+	if (class->Sprites[i]->Texture->format->BitsPerPixel == 16) {
+	  sceGuTexMode(GU_PSM_5551,0,0,0);
+	}
+	else {
+	  sceGuTexMode(GU_PSM_8888,0,0,0);
+	}
+	sceGuTexImage(0,
+		      class->Sprites[i]->Texture->w,
+		      class->Sprites[i]->Texture->h,
+		      class->Sprites[i]->Texture->w,
+		      class->Sprites[i]->Texture->pixels);
+	sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
+	sceGuTexFilter(GU_LINEAR, GU_LINEAR);
+	sceGuTexScale(1.0f,1.0f);
+	sceGuTexOffset(0.0f,0.0f);
+      }
+      /* --- �X�v���C�g�̕`�� */
+      if ((class->Sprites[i]->zoomx == 1.0) &&
+	  (class->Sprites[i]->zoomy == 1.0) &&
+	  (class->Sprites[i]->rotation_z == 0.0)) {
+	/* ��]�g��k���Ȃ��A�P����`�R�s�[ */
+	Render(class, class->Sprites[i]);
+      }
+      else {
+	/* ��]�g��k������ */
+	RenderZoomRot(class, class->Sprites[i]);
+      }
+    }
+  }
+#else
+  int  i;
+
+  /* --- �X�v���C�g�`�� */
+  for(i=0; i<SPRITEMAX; i++) {
+    if ((class->Sprites[i]->DispSw == TRUE) &&
+	(class->Sprites[i]->Texture != NULL)) {
+      /* --- �X�v���C�g�̕`�� */
+      if ((class->Sprites[i]->zoomx == 1.0) &&
+	  (class->Sprites[i]->zoomy == 1.0) &&
+	  (class->Sprites[i]->rotation_z == 0.0)) {
+	/* ��]�g��k���Ȃ��A�P����`�R�s�[ */
+	Render(class, class->Sprites[i]);
+      }
+      else {
+	/* ��]�g��k������ */
+	RenderZoomRot(class, class->Sprites[i]);
+      }
+    }
+  }
+#endif
+}
+
+void TGameScreen_RefreshScreen(TGameScreen *class)
+{
+#ifndef NOTPSP
+  /* - �p�P�b�g�`��I���҂� */
+  sceGuSync(0, 0);
+
+  /* --- VSync and swap frame buffer */
+  sceDisplayWaitVblankStart();
+  class->current_buffer_ptr = (unsigned char *)sceGuSwapBuffers();
+
+  /* --- �X�N���[���A�b�v�f�[�g */
+  sceGuStart(GU_DIRECT, class->packet);
+
+  /* --- ��ʃN���A */
+  sceGuClearColor(0xff601010);
+  sceGuClearDepth(0);
+  sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
+
+
+  /* -- ��ʍX�V */
+  TGameScreen_DispScreen(class);
+
+  /* - �p�P�b�g�ς݁A�����܂� */
+  sceGuFinish();
+#else
+  /* -- ��ʍX�V */
+  TGameScreen_DispScreen(class);
+
+#if defined(X86) || defined(WIN32)
+  if (sys_scale == 1) {
+    /* --- �X�N���[���A�b�v�f�[�g */
+    upscale (Video->pixels, class->Screen->pixels);
+
+    /* --- �S�N���A */
+    SDL_UpdateRect (class->Screen, 0, 0, class->Width, class->Height);
+    SDL_Flip (Video);
+  } else {
+    /* --- �X�N���[���A�b�v�f�[�g */
+    SDL_UpdateRect (class->Screen, 0, 0, class->Width, class->Height);
+
+    /* --- �S�N���A */
+    SDL_FillRect (class->Screen, 0, 0xff000040);
+  }
+#else
+  /* --- �X�N���[���A�b�v�f�[�g */
+  SDL_UpdateRect (class->Screen, 0, 0, class->Width, class->Height);
+
+  /* --- �S�N���A */
+  SDL_FillRect (class->Screen, 0, 0xff000040);
+#endif
+#endif
+}
+
+
+/* ---------------------------------------- */
+/* --- �e�N�X�`�����[�h����               */
+
+#ifndef NOTPSP
+void TGameScreen_LoadTexture(TGameScreen *class,
+			     int num,
+			     char *filename)
+{
+  TGameTexture_Load(class->Texture, num, filename, 0, TRUE);
+}
+
+void TGameScreen_LoadTexturePure(TGameScreen *class,
+				 int num,
+				 char *filename)
+{
+  TGameTexture_Load(class->Texture, num, filename, 0, FALSE);
+}
+#else
+void TGameScreen_LoadTexture(TGameScreen *class,
+			     int num,
+			     char *filename)
+{
+  TGameTexture_Load(class->Texture, num, filename, class->Screen, TRUE);
+}
+
+void TGameScreen_LoadTexturePure(TGameScreen *class,
+				 int num,
+				 char *filename)
+{
+  TGameTexture_Load(class->Texture, num, filename, class->Screen, FALSE);
+}
+#endif
+
+
+/* ---------------------------------------- */
+/* --- �X�v���C�g��n��                     */
+TGameSprite *TGameScreen_GetSprite(TGameScreen *class, int id)
+{
+  if (id < 0) return(0);
+  if (id > SPRITEMAX) return(0);
+
+  return(class->Sprites[id]);
+}
+
+
+/* ---------------------------------------- */
+/* --- �e�N�X�`����n��                     */
+SDL_Surface *TGameScreen_GetTexture(TGameScreen *class, int id)
+{
+  return(TGameTexture_GetTexture(class->Texture, id));
+}
+
+
+/* ---------------------------------------- */
+/* --- �X�v���C�g�̕\��(��ʓ]��)           */
+void Render(TGameScreen *class, TGameSprite *spr)
+{
+#ifndef NOTPSP
+  struct SpriteVertex* vertices;
+  int  seg, pos, w_size, w_rest;
+  int  i;
+  unsigned int  blendlevel;
+
+  /* --- �\���X�C�b�` */
+  if (spr->DispSw == FALSE) return;
+  if (spr->Texture == NULL) return;
+
+  /* --- �����������l */
+  blendlevel = ((spr->alpha & 0xff) << 24) | 0xffffff;
+
+  /* --- �X�v���C�g��ꖇ�`�悷�� */
+  /* ������x�̑傫���������X�v���C�g�͒Z����ɕ������Ȃ��� */
+  /* �ƂÂ�Ȃ��x���Ȃ� */
+  seg = (spr->w / SLICE_SIZE) + 1;
+  vertices = (struct SpriteVertex*)sceGuGetMemory(seg * 2 * sizeof(struct SpriteVertex));
+  pos = 0;
+  w_rest = spr->w;
+  for(i=0; i<seg; i++) {
+    if ((i+1) < seg) {
+      w_size = SLICE_SIZE;
+      w_rest -= SLICE_SIZE;
+    }
+    else {
+      w_size = w_rest;
+    }
+    vertices[i*2].u = spr->tx + pos;
+    vertices[i*2].v = spr->ty;
+    vertices[i*2].color = blendlevel;
+    vertices[i*2].x = spr->x + pos;
+    vertices[i*2].y = spr->y;
+    vertices[i*2].z = 0;
+    vertices[i*2+1].u = spr->tx + pos + w_size;
+    vertices[i*2+1].v = spr->ty + spr->h;
+    vertices[i*2+1].color = blendlevel;
+    vertices[i*2+1].x = spr->x + pos + w_size;
+    vertices[i*2+1].y = spr->y + spr->h;
+    vertices[i*2+1].z = 0;
+    pos += SLICE_SIZE;
+  }
+  /* --- �`�惊�N�G�X�g */
+  sceGuDrawArray(GU_SPRITES,
+		 GU_TEXTURE_16BIT|GU_COLOR_8888|GU_VERTEX_16BIT|GU_TRANSFORM_2D,
+		 (seg * 2), 0, vertices);
+#else
+  unsigned char org_alpha;
+  SDL_Rect rect1, rect2;
+
+  /* --- �\���X�C�b�` */
+  if (spr->DispSw == FALSE)
+    return;
+  if (spr->Texture == NULL)
+    return;
+
+  rect1.w = spr->w;
+  rect1.h = spr->h;
+  rect2.w = spr->w;
+  rect2.h = spr->h;
+  rect1.x = spr->tx;
+  rect1.y = spr->ty;
+  rect2.x = spr->x;
+  rect2.y = spr->y;
+
+  org_alpha = spr->Texture->format->alpha;
+  if (org_alpha != spr->alpha) {
+    if (spr->alpha < 255) {
+      SDL_SetAlpha(spr->Texture, SDL_SRCALPHA, spr->alpha);
+    }
+    else {
+      SDL_SetAlpha(spr->Texture, 0, 0);
+    }
+  }
+
+  SDL_BlitSurface(spr->Texture, &rect1, class->Screen, &rect2);
+
+  if (org_alpha != spr->alpha) {
+    SDL_SetAlpha(spr->Texture, SDL_SRCALPHA, org_alpha);
+  }
+#endif
+}
+
+
+/* ---------------------------------------- */
+/* --- �X�v���C�g�̕\��(��]�g��k������) */
+void RenderZoomRot(TGameScreen *class, TGameSprite *spr)
+{
+#ifndef NOTPSP
+  struct SpriteVertex* vertices;
+  int  seg, pos, w_size, w_rest;
+  int  i, j;
+  unsigned int  blendlevel;
+  int  rot;
+  float  center_x, center_y;
+  float  fx, fy, rx, ry;
+
+  /* --- �\���X�C�b�` */
+  if (spr->DispSw == FALSE) return;
+  if (spr->Texture == NULL) return;
+
+  /* --- ��]�g��O���� */
+  rot = (int)spr->rotation_z;
+  rot %= 360;
+  rot = 359 - rot;
+
+  /* --- �����������l */
+  blendlevel = ((spr->alpha & 0xff) << 24) | 0xffffff;
+
+  /* --- �X�v���C�g��ꖇ�`�悷�� */
+  /* ������x�̑傫���������X�v���C�g�͒Z����ɕ������Ȃ��� */
+  /* �ƂÂ�Ȃ��x���Ȃ� */
+  seg = (spr->w / SLICE_SIZE) + 1;
+  vertices = (struct SpriteVertex*)sceGuGetMemory(seg * 4 * sizeof(struct SpriteVertex));
+  pos = 0;
+  w_rest = spr->w;
+  for(i=0; i<seg; i++) {
+    if ((i+1) < seg) {
+      w_size = SLICE_SIZE;
+      w_rest -= SLICE_SIZE;
+    }
+    else {
+      w_size = w_rest;
+    }
+    vertices[i*4].u = spr->tx + pos;
+    vertices[i*4].v = spr->ty;
+    vertices[i*4].color = blendlevel;
+    vertices[i*4].x = spr->x + pos;
+    vertices[i*4].y = spr->y;
+    vertices[i*4].z = 0;
+    vertices[i*4+1].u = spr->tx + pos + w_size;
+    vertices[i*4+1].v = spr->ty;
+    vertices[i*4+1].color = blendlevel;
+    vertices[i*4+1].x = spr->x + pos + w_size;
+    vertices[i*4+1].y = spr->y;
+    vertices[i*4+1].z = 0;
+    vertices[i*4+2].u = spr->tx + pos;
+    vertices[i*4+2].v = spr->ty + spr->h;
+    vertices[i*4+2].color = blendlevel;
+    vertices[i*4+2].x = spr->x + pos;
+    vertices[i*4+2].y = spr->y + spr->h;
+    vertices[i*4+2].z = 0;
+    vertices[i*4+3].u = spr->tx + pos + w_size;
+    vertices[i*4+3].v = spr->ty + spr->h;
+    vertices[i*4+3].color = blendlevel;
+    vertices[i*4+3].x = spr->x + pos + w_size;
+    vertices[i*4+3].y = spr->y + spr->h;
+    vertices[i*4+3].z = 0;
+    pos += SLICE_SIZE;
+    /* --- ��]�g�又�� */
+    center_x = (float)spr->x + ((float)spr->w / 2);
+    center_y = (float)spr->y + ((float)spr->h / 2);
+    for(j=0; j<4; j++) {
+      fx = (float)vertices[i*4+j].x - center_x;
+      fy = (float)vertices[i*4+j].y - center_y;
+      rx = ((fx * sprite_cos[rot]) - (fy * sprite_sin[rot])) * spr->zoomx;
+      ry = ((fx * sprite_sin[rot]) + (fy * sprite_cos[rot])) * spr->zoomy;
+      rx += center_x;
+      ry += center_y;
+      vertices[i*4+j].x = (short)rx;
+      vertices[i*4+j].y = (short)ry;
+    }
+  }
+  /* --- �`�惊�N�G�X�g */
+  sceGuDrawArray(GU_TRIANGLE_STRIP,
+		 GU_TEXTURE_16BIT|GU_COLOR_8888|GU_VERTEX_16BIT|GU_TRANSFORM_2D,
+		 (seg * 4), 0, vertices);
+#else
+  SDL_Surface  *after;
+  SDL_Rect  rect1, rect2;
+  int  pp_x, pp_y;
+  int  pp_dw_x, pp_dh_x, pp_dw_y, pp_dh_y;
+  int  fw, fh, rzoomx, rzoomy;
+  int  max_w, max_h, max_w_int, max_h_int;
+  int  step_x, step_y;
+  int  rot;
+  int  loop_x, loop_y;
+  int  ix, iy;
+  unsigned long  *dstpix, *srcpix;
+    
+
+  /* --- �\���X�C�b�` */
+  if (spr->DispSw == FALSE) return;
+  if (spr->Texture == NULL) return;
+
+  /* --- ��]�g��O���� */
+  rot = (int)spr->rotation_z;
+  rot %= 360;
+  /* �s�N�Z���X�e�b�v */
+  rzoomx = (1024*1024) / (int)(spr->zoomx * 1024);
+  rzoomy = (1024*1024) / (int)(spr->zoomy * 1024);
+  pp_dw_x = (rzoomx * sprite_cos[rot]) / 1024;
+  pp_dh_x = (rzoomx * sprite_sin[rot]) / 1024;
+  pp_dw_y = -(rzoomy * sprite_sin[rot]) / 1024;
+  pp_dh_y = (rzoomy * sprite_cos[rot]) / 1024;
+  /* ��]��̉摜�̑傫�� */
+  if (rot != 0) {
+    max_w = (spr->w * (int)(spr->zoomx * 1448));
+    max_h = (spr->h * (int)(spr->zoomy * 1448));
+  }
+  else {
+    max_w = spr->w * (int)(spr->zoomx * 1024);
+    max_h = spr->h * (int)(spr->zoomy * 1024);
+  }
+  if (max_w > max_h) max_h = max_w;
+  if (max_h > max_w) max_w = max_h;
+  max_w_int = max_w >> 10;
+  max_h_int = max_h >> 10;
+  after = SDL_CreateRGBSurface(SDL_SWSURFACE,
+#ifdef X86
+			       max_w_int, max_h_int, 32,
+#elif NDS
+			       max_w_int, max_h_int, 8,
+#else
+			       max_w_int, max_h_int, 16,
+#endif
+			       DRmask, DGmask, DBmask, DAmask);
+  SDL_FillRect(after, 0, 0x00000000);
+  /* �J�n�_ */
+  fw = -(max_w_int) * rzoomx / 2;
+  fh = -(max_h_int) * rzoomy / 2;
+  pp_x = ((fw * sprite_cos[rot]) - (fh * sprite_sin[rot])) / 1024;
+  pp_y = ((fw * sprite_sin[rot]) + (fh * sprite_cos[rot])) / 1024;
+  pp_x += (spr->w >> 1) * 1024;
+  pp_y += (spr->h >> 1) * 1024;
+
+  /* --- ��]�]������ */
+  dstpix = after->pixels;
+  for(loop_y=0; loop_y<max_h_int; loop_y++) {
+    step_x = pp_x;
+    step_y = pp_y;
+    for(loop_x=0; loop_x<max_w_int; loop_x++) {
+      if ((step_x >= 0) && (step_x < (spr->w << 10)) &&
+	  (step_y >= 0) && (step_y < (spr->h << 10))) {
+	ix = step_x >> 10;
+	iy = step_y >> 10;
+	srcpix = (unsigned long *)spr->Texture->pixels;
+	srcpix += (spr->tx + ix + ((spr->ty + iy) * spr->Texture->w));
+	*dstpix = *srcpix;
+      }
+      else {
+	*dstpix = 0;
+      }
+      step_x += pp_dw_x;
+      step_y += pp_dh_x;
+      dstpix += 1;
+    }
+    pp_x += pp_dw_y;
+    pp_y += pp_dh_y;
+  }
+
+  /* --- �X�N���[���ɕ`�� */
+  rect1.w = after->w;
+  rect1.h = after->h;
+  rect2.w = after->w;
+  rect2.h = after->h;
+  rect1.x = 0;
+  rect1.y = 0;
+  rect2.x = spr->x + (spr->w / 2) - (after->w / 2);
+  rect2.y = spr->y + (spr->h / 2) - (after->h / 2);
+  SDL_BlitSurface(after, &rect1, class->Screen, &rect2);
+  /* ���Ƃ��܂� */
+  SDL_FreeSurface(after);
+#endif
+}
+/* ---------------------------------------------------------- */
+/*  grp_screen.h                                              */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   debug.pp                                             */
+/*     �ǥХå��ѥ����å��롼����                         */
+/*                                                        */
+/*--------------------------------------------------------*/
+/* -- $Id: debug.pp,v 1.3 2002/07/11 17:21:47 rero2 Exp $ */
+
+
+/*------------------------------------------------------------- */
+/** @file
+    @brief		����ɽ������
+    @author		K.Kunikane (rerofumi)
+    @since		Jul.27.2005
+    $Revision: 1.1.1.1 $
+*/
+/*-----------------------------------------------------
+ Copyright (C) 2002,2005 rerofumi <rero2@yuumu.org>
+ All Rights Reserved.
+ ------------------------------------------------------*/
+
+
+#ifndef GRP_SCREEN_H
+#define GRP_SCREEN_H
+
+/*-------------------------------*/
+/* include                       */
+/*-------------------------------*/
+
+#include "SDL.h"
+
+#include "grp_texture.h"
+#include "grp_sprite.h"
+
+/*-------------------------------*/
+/* define                        */
+/*-------------------------------*/
+
+/* --- ����������祹�ץ饤�ȿ� */
+#define  SPRITEMAX  1024
+
+#if (SDL_BYTEORDER == SDL_BIG_ENDIAN)
+ #define DRmask 0xff000000
+ #define DGmask 0x00ff0000
+ #define DBmask 0x0000ff00
+ #define DAmask 0x000000ff
+#else
+ #define DRmask 0x000000ff
+ #define DGmask 0x0000ff00
+ #define DBmask 0x00ff0000
+ #define DAmask 0xff000000
+#endif
+
+/*-------------------------------*/
+/* struct                        */
+/*-------------------------------*/
+
+typedef struct {
+  SDL_Surface *Screen;
+  TGameTexture *Texture;
+  TGameSprite  *Sprites[SPRITEMAX];
+  int Width;
+  int Height;
+  int Depth;
+  /// �������西�����åȤˤʤäƤ��� GU �ե졼��Хåե��Υݥ���
+  unsigned char *current_buffer_ptr;
+  /// PSP�Ǥ�GU����ѥ��åȥ��ꥢ
+  unsigned int  *packet;
+} TGameScreen, *PTGameScreen;
+
+/* ---------------------------------------------- */
+/* --- extern                                  -- */
+/* ---------------------------------------------- */
+
+TGameScreen *TGameScreen_Create(int width, int height, int depth);
+void TGameScreen_Destroy(TGameScreen *class);
+void TGameScreen_SetWMName(TGameScreen *class, char *name);
+void TGameScreen_DispScreen(TGameScreen *class);
+void TGameScreen_RefreshScreen(TGameScreen *class);
+
+TGameSprite *TGameScreen_GetSprite(TGameScreen *class, int id);
+SDL_Surface *TGameScreen_GetTexture(TGameScreen *class, int id);
+void TGameScreen_LoadTexture(TGameScreen *class, int num, char *filename);
+void TGameScreen_LoadTexturePure(TGameScreen *class, int num, char *filename);
+
+#endif //GRP_SCREEN_H
+
+
+
+
+
+
+/* ---------------------------------------------------------- */
+/*  grp_sptite.c                                              */
+/* ---------------------------------------------------------- */
+
+/*--------------------------------------------------------*/
+/*                                                        */
+/* SDL puzzle project - for COMIKET62                     */
+/*                        Fumi2Kick/LiMo/omamori-2002     */
+/*                        1st Maintaner  Rerorero@fumi.   */
+/*                                                        */
+/*   grp_sprite.c                                         */
+/*     �X�v���C�g�Ǘ��\����                               */
+/*                                                        */
+/*--------------------------------------------------------*/
+
+/*------------------------------------------------------------- */
+/** @file
+    @brief		�X�v���C�g�Ǘ�
+    @author		K.Kunikane (rerofumi)
+    @since		Sep.19.2005
+*/
+/*-----------------------------------------------------
+ Copyright (C) 2002,2005 rerofumi <rero2@yuumu.org>
+ All Rights Reserved.
+ ------------------------------------------------------*/
+
+/*-------------------------------*/
+/* include                       */
+/*-------------------------------*/
+
+#include <stdlib.h>
+
+#include "SDL.h"
+#include "grp_sprite.h"
+
+
+/*-------------------------------*/
+/* local value                   */
+/*-------------------------------*/
+
+/*-------------------------------*/
+/* local function                */
+/*-------------------------------*/
+
+/* -------------------------------------------------------------- */
+/* --- �e�N�X�`���Ǘ��N���X                                       */
+/* -------------------------------------------------------------- */
+
+/* ---------------------------------------- */
+/* --- �R���X�g���N�^�E�f�X�g���N�^         */
+TGameSprite *TGameSprite_Create(void)
+{
+  TGameSprite *class;
+
+  class = malloc(sizeof(TGameSprite));
+  if (class == NULL) {
+    return(0);
+  }
+  class->Texture = NULL;
+  class->TextureId = -1;
+  class->DispSw = FALSE;
+  class->zoomx = 1.0;
+  class->zoomy = 1.0;
+  class->rotation_z = 0.0;
+
+  return(class);
+}