• R/O
  • SSH
  • HTTPS

gpsp-kai: Commit


Commit MetaInfo

Revision216 (tree)
Zeit2007-08-23 23:31:39
Autortakka

Log Message

(empty log message)

Ändern Zusammenfassung

Diff

--- trunk/gpsp-kai-test/readme_kai_jp.txt (revision 215)
+++ trunk/gpsp-kai-test/readme_kai_jp.txt (revision 216)
@@ -1,6 +1,10 @@
11 -- gameplaySP Gameboy Advance emulator for Playstation Portable --
22
33 -- Release log --
4+-UnOfficial gpSP kai 3.1 test 16 svn rev.
5+ 一部のROMで画面が乱れるのを修正
6+ サスペンドの反応速度向上
7+
48 -UnOfficial gpSP kai 3.1 test 15 svn rev.213
59 HOMEボタンを押したときにメニューに移行する様にした
610 HOMEを押したときの反応を向上
--- trunk/gpsp-kai-test/sound.c (revision 215)
+++ trunk/gpsp-kai-test/sound.c (revision 216)
@@ -660,7 +660,7 @@
660660
661661 // TODO:初期設定に移動
662662 sound_read_offset = 0;
663- memset(buffer, 0, sizeof(buffer));
663+ memset(buffer, 0, SAMPLE_SIZE * 2 * 2);
664664 left_buffer = 0;
665665
666666 // メインループ
@@ -685,7 +685,10 @@
685685 }
686686 else
687687 {
688- buffer_num = 0; // オール0のサウンドデータを再生
688+ if (pause_sound_flag == 1)
689+ buffer_num = 0; // 全て0のデーターを再生
690+ else
691+ buffer_num = 1; // 前回のデーターをそのまま再生
689692 }
690693 sceAudioOutputPannedBlocking(audio_handle, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, &buffer[buffer_num][0]);
691694 sceKernelDelayThread(SAMPLE_COUNT / 44100 * 1000 * 1000 * 0.5);
--- trunk/gpsp-kai-test/mips_emit.h (revision 215)
+++ trunk/gpsp-kai-test/mips_emit.h (revision 216)
@@ -2488,7 +2488,7 @@
24882488 { 0x0, 0x0 }, // SWI 5: VBlankIntrWait
24892489 { 0x1, 0x1 }, // SWI 6: Div
24902490 { 0x1, 0x1 }, // SWI 7: DivArm
2491- { 0x0, 0x1 }, // SWI 8: Sqrt
2491+ { 0x1, 0x1 }, // SWI 8: Sqrt
24922492 { 0x0, 0x0 }, // SWI 9: ArcTan
24932493 { 0x0, 0x0 }, // SWI A: ArcTan2
24942494 { 0x0, 0x1 }, // SWI B: CpuSet
@@ -2529,6 +2529,12 @@
25292529 u32 swi_number = _swi_number; \
25302530 if(swi_hle_handle[swi_number][bios_mode]) \
25312531 { \
2532+ /* Halt */ \
2533+ if(swi_number == 0x02) \
2534+ { \
2535+ generate_function_call(bios_halt); \
2536+ } \
2537+ \
25322538 /* Div */ \
25332539 if(swi_number == 0x06) \
25342540 { \
--- trunk/gpsp-kai-test/bios.c (revision 215)
+++ trunk/gpsp-kai-test/bios.c (revision 216)
@@ -20,6 +20,8 @@
2020
2121 #include "common.h"
2222
23+static u32 reg_work[100];
24+
2325 #define save_reg() \
2426 asm( "\n \
2527 sw $3, 0(%0)\n \
@@ -37,7 +39,8 @@
3739 sw $18, 40(%0)\n \
3840 sw $28, 52(%0)\n \
3941 sw $30, 64(%0)\n \
40- "::"r"(reg)); \
42+ lw $28, 128(%0)\n \
43+ "::"r"(reg_work)); \
4144
4245 #define load_reg() \
4346 asm( "\n \
@@ -56,7 +59,7 @@
5659 lw $18, 40(%0)\n \
5760 lw $28, 52(%0)\n \
5861 lw $30, 64(%0)\n \
59- "::"r"(reg)); \
62+ "::"r"(reg_work)); \
6063
6164 s16 b_sinetable[256] = {
6265 (s16)0x0000, (s16)0x0192, (s16)0x0323, (s16)0x04B5, (s16)0x0645, (s16)0x07D5, (s16)0x0964, (s16)0x0AF1,
--- trunk/gpsp-kai-test/video.c (revision 215)
+++ trunk/gpsp-kai-test/video.c (revision 216)
@@ -145,7 +145,8 @@
145145 #define tile_lookup_palette(palette, source) \
146146 current_pixel = palette[source]; \
147147
148-#define tile_expand_base_normal(index) \
148+// palette 0 に対応
149+#define tile_expand_base_normal_p0(index) \
149150 if (current_pixel != 0) \
150151 { \
151152 tile_lookup_palette(palette, current_pixel); \
@@ -152,6 +153,10 @@
152153 dest_ptr[index] = current_pixel; \
153154 } \
154155
156+#define tile_expand_base_normal(index) \
157+ tile_lookup_palette(palette, current_pixel); \
158+ dest_ptr[index] = current_pixel \
159+
155160 #define tile_expand_transparent_normal(index) \
156161 tile_expand_base_normal(index) \
157162
@@ -598,6 +603,7 @@
598603 current_pixel = palette[0]; \
599604 tile_4bpp_draw_eight_base_zero(current_pixel) \
600605
606+
601607 // Draws eight 4bpp pixels.
602608
603609 #define tile_4bpp_draw_eight_noflip(combine_op, alpha_op) \
@@ -1289,7 +1295,7 @@
12891295 *dest_ptr = current_pixel \
12901296
12911297 #define bitmap_render_pixel_mode4(alpha_op) \
1292- tile_expand_base_##alpha_op(0) \
1298+ tile_expand_base_##alpha_op##_p0(0) \
12931299
12941300 #define bitmap_render_pixel_mode5(alpha_op) \
12951301 bitmap_render_pixel_mode3(alpha_op) \
@@ -1396,17 +1402,17 @@
13961402 #define render_scanline_vram_setup_mode5() \
13971403 u16 *src_ptr; \
13981404 if(io_registers[REG_DISPCNT] & 0x10) \
1399- src_ptr = (u16 *)vram + 0xA000; \
1405+ src_ptr = (u16*)(vram + 0xA000); \
14001406 else \
1401- src_ptr = (u16 *)vram \
1407+ src_ptr = (u16*)vram \
14021408
14031409 #define render_scanline_vram_setup_mode4() \
14041410 u16 *palette = palette_ram; \
14051411 u8 *src_ptr; \
14061412 if(io_registers[REG_DISPCNT] & 0x10) \
1407- src_ptr = (u8 *)vram + 0xA000; \
1413+ src_ptr = (u8*)(vram + 0xA000); \
14081414 else \
1409- src_ptr = (u8 *)vram \
1415+ src_ptr = (u8*)(vram) \
14101416
14111417 // Build bitmap scanline rendering functions.
14121418
@@ -1414,10 +1420,8 @@
14141420 void render_scanline_bitmap_##type##_##alpha_op(u32 start, u32 end, \
14151421 void *scanline) \
14161422 { \
1417- /*u32 bg_control = io_registers[REG_BG2CNT];*/ \
14181423 u32 current_pixel; \
14191424 s32 source_x, source_y; \
1420- /*u32 vcount = io_registers[REG_VCOUNT];*/ \
14211425 s32 pixel_x, pixel_y; \
14221426 \
14231427 s32 dx = (s16)io_registers[REG_BG2PA]; \
@@ -2184,7 +2188,7 @@
21842188
21852189
21862190 #define fill_line_color_normal() \
2187- color = palette_ram[color] \
2191+ color = palette_ram[color] \
21882192
21892193 #define fill_line_color_alpha() \
21902194
@@ -2464,7 +2468,6 @@
24642468 #define fill_line_bg(type, dest, _start, _end) \
24652469 fill_line_##type(0, dest, _start, _end) \
24662470
2467-
24682471 // Render all layers as they appear in the layer order.
24692472
24702473 #define render_layers(tile_alpha, obj_alpha, dest) \
@@ -2672,9 +2675,12 @@
26722675 render_scanline_layer_functions_bitmap();
26732676 u32 current_layer;
26742677 u32 layer_order_pos;
2678+ u32 *scanline2 = (u32*)scanline;
26752679
2676- // ラインをパレット0で埋める
2677- fill_line_bg(normal, scanline, 0, 240);
2680+ // ラインをパレット0で埋める(32bitアクセスで高速化)
2681+ u32 color = (u32)palette_ram[0];
2682+ color = color << 16 || color;
2683+ fill_line_color32(color, scanline2, 0, 240/2);
26782684
26792685 for(layer_order_pos = 0; layer_order_pos < layer_count; layer_order_pos++)
26802686 {
--- trunk/gpsp-kai-test/adhoc.c (revision 215)
+++ trunk/gpsp-kai-test/adhoc.c (revision 216)
@@ -71,17 +71,17 @@
7171 ローカル変数
7272 ***************************************************************************/
7373
74-static int Server;
74+static u32 Server;
7575 static int pdpId;
7676
77-static char g_mac[16];
77+static unsigned char g_mac[16];
7878 static char g_mymac[16];
79-static int g_unk1;
80-static int g_matchEvent;
81-static int g_matchOptLen;
79+static u32 g_unk1;
80+static u32 g_matchEvent;
81+static u32 g_matchOptLen;
8282 static char g_matchOptData[1000];
8383 static char g_matchingData[32];
84-static int matchChanged;
84+static u32 matchChanged;
8585 static int matchingId;
8686
8787 static struct psplist_t
@@ -90,8 +90,8 @@
9090 char mac[6];
9191 } psplist[NUM_ENTRIES];
9292
93-static int adhoc_max;
94-static int ahdoc_pos;
93+static u32 adhoc_max;
94+static u32 ahdoc_pos;
9595
9696 /***************************************************************************
9797 ローカル関数
@@ -101,7 +101,7 @@
101101 プログレスバー初期化
102102 --------------------------------------------------------*/
103103
104-static void adhoc_init_progress(int total, const char *text)
104+static void adhoc_init_progress(u32 total, const char *text)
105105 {
106106 char buf[MAX_FILE];
107107
@@ -137,9 +137,9 @@
137137 リストに追加
138138 --------------------------------------------------------*/
139139
140-static int AddPsp(char *mac, char *name, int length)
140+static u32 AddPsp(char *mac, char *name, u32 length)
141141 {
142- int i;
142+ u32 i;
143143
144144 if (adhoc_max == NUM_ENTRIES)
145145 return 0;
@@ -173,9 +173,9 @@
173173 リストから削除
174174 --------------------------------------------------------*/
175175
176-static int DelPsp(char *mac)
176+static u32 DelPsp(char *mac)
177177 {
178- int i, j;
178+ u32 i, j;
179179
180180 for (i = 0; i < adhoc_max; i++)
181181 {
@@ -207,7 +207,7 @@
207207 リストを表示
208208 --------------------------------------------------------*/
209209
210-static void DisplayPspList(int top, int rows)
210+static void DisplayPspList(u32 top, u32 rows)
211211 {
212212 if (adhoc_max == 0)
213213 {
@@ -216,7 +216,7 @@
216216 }
217217 else
218218 {
219- int i;
219+ u32 i;
220220 char temp[20];
221221
222222 // 画面表示
@@ -254,7 +254,7 @@
254254 選択中のPSPの情報を取得
255255 --------------------------------------------------------*/
256256
257-static int GetPspEntry(char *mac, char *name)
257+static u32 GetPspEntry(char *mac, char *name)
258258 {
259259 if (adhoc_max == 0)
260260 return -1;
@@ -269,8 +269,7 @@
269269 Matching callback
270270 --------------------------------------------------------*/
271271
272-static void matchingCallback(int unk1, int event, char *mac2, int optLen,
273- char *optData)
272+static void matchingCallback(int unk1, int event, char *mac2, int optLen, char *optData)
274273 {
275274 switch (event)
276275 {
@@ -301,9 +300,9 @@
301300 モジュールのロード
302301 --------------------------------------------------------*/
303302
304-int pspSdkLoadAdhocModules(void)
303+u32 pspSdkLoadAdhocModules(void)
305304 {
306- int modID;
305+ u32 modID;
307306
308307 modID = pspSdkLoadStartModule("flash0:/kd/ifhandle.prx", PSP_MEMORY_PARTITION_KERNEL);
309308 if (modID < 0)
@@ -351,7 +350,7 @@
351350 初期化
352351 --------------------------------------------------------*/
353352
354-int adhocInit(const char *matchingData)
353+u32 adhocInit(const char *matchingData)
355354 {
356355 struct productStruct product;
357356 int error = 0, state = 0;
@@ -458,7 +457,7 @@
458457 切断
459458 --------------------------------------------------------*/
460459
461-int adhocTerm(void)
460+u32 adhocTerm(void)
462461 {
463462 adhoc_init_progress(5, "DISCONNECTING");
464463
@@ -521,7 +520,7 @@
521520 SSIDを指定して再接続
522521 --------------------------------------------------------*/
523522
524-int adhocReconnect(char *ssid)
523+u32 adhocReconnect(char *ssid)
525524 {
526525 int error = 0, state = 1;
527526 char mac[20], buf[256];
@@ -626,13 +625,13 @@
626625 接続先の選択
627626 --------------------------------------------------------*/
628627
629-int adhocSelect(void)
628+u32 adhocSelect(void)
630629 {
631- int top = 0;
632- int rows = 11;
633- int currentState= PSP_LISTING;
634- int prev_max = 0;
635- int update = 1;
630+ u32 top = 0;
631+ u32 rows = 11;
632+ u32 currentState= PSP_LISTING;
633+ u32 prev_max = 0;
634+ u32 update = 1;
636635 char mac[16];
637636 char name[64];
638637 char temp[64];
@@ -829,9 +828,9 @@
829828 データ送信
830829 --------------------------------------------------------*/
831830
832-int adhocSend(void *buffer, int length)
831+u32 adhocSend(void *buffer, u32 length)
833832 {
834- if (sceNetAdhocPdpSend(pdpId, g_mac, 0x309, buffer, length, 0, 1) < 0)
833+ if (sceNetAdhocPdpSend(pdpId, g_mac, 0x309, buffer, (int)length, 0, 1) < 0)
835834 return 0;
836835 return length;
837836 }
@@ -840,10 +839,10 @@
840839 データ受信
841840 --------------------------------------------------------*/
842841
843-int adhocRecv(void *buffer, int length)
842+u32 adhocRecv(void *buffer, u32 length)
844843 {
845- int port = 0;
846- char mac[6];
844+ unsigned short port = 0;
845+ unsigned char mac[6];
847846
848847 if (sceNetAdhocPdpRecv(pdpId, mac, &port, buffer, &length, 0, 1) < 0)
849848 return 0;
@@ -854,7 +853,7 @@
854853 データ送信を待つ
855854 --------------------------------------------------------*/
856855
857-int adhocSendBlocking(void *buffer, int length)
856+u32 adhocSendBlocking(void *buffer, u32 length)
858857 {
859858 if (sceNetAdhocPdpSend(pdpId, g_mac, 0x309, buffer, length, ADHOC_TIMEOUT, 0) < 0)
860859 return 0;
@@ -865,10 +864,10 @@
865864 データ受信を待つ
866865 --------------------------------------------------------*/
867866
868-int adhocRecvBlocking(void *buffer, int length)
867+u32 adhocRecvBlocking(void *buffer, u32 length)
869868 {
870- int port = 0;
871- char mac[6];
869+ unsigned short port = 0;
870+ unsigned char mac[6];
872871
873872 if (sceNetAdhocPdpRecv(pdpId, mac, &port, buffer, &length, ADHOC_TIMEOUT, 0)
874873 < 0)
@@ -880,10 +879,10 @@
880879 データ受信を待つ(タイムアウト指定)
881880 --------------------------------------------------------*/
882881
883-int adhocRecvBlockingTimeout(void *buffer, int length, int timeout)
882+u32 adhocRecvBlockingTimeout(void *buffer, u32 length, u32 timeout)
884883 {
885- int port = 0;
886- char mac[6];
884+ unsigned short port = 0;
885+ unsigned char mac[6];
887886
888887 if (sceNetAdhocPdpRecv(pdpId, mac, &port, buffer, &length, timeout, 0) < 0)
889888 return 0;
@@ -894,11 +893,11 @@
894893 データを送信し、ackを受信するまで待つ
895894 --------------------------------------------------------*/
896895
897-int adhocSendRecvAck(void *buffer, int length)
896+u32 adhocSendRecvAck(void *buffer, u32 length)
898897 {
899- int ack_data = 0;
900- int tempLen = length;
901- int sentCount = 0;
898+ u32 ack_data = 0;
899+ u32 tempLen = length;
900+ u32 sentCount = 0;
902901 u8 *buf = (u8 *)buffer;
903902
904903 do
@@ -908,7 +907,7 @@
908907
909908 adhocSendBlocking(buf, tempLen);
910909
911- if (adhocRecvBlocking(&ack_data, sizeof(int)) == 0)
910+ if (adhocRecvBlocking(&ack_data, sizeof(u32)) == 0)
912911 return 0;
913912
914913 if (ack_data != tempLen)
@@ -926,10 +925,10 @@
926925 データの受信を待ち、ackを送信する
927926 --------------------------------------------------------*/
928927
929-int adhocRecvSendAck(void *buffer, int length)
928+u32 adhocRecvSendAck(void *buffer, u32 length)
930929 {
931- int tempLen = length;
932- int rcvdCount = 0;
930+ u32 tempLen = length;
931+ u32 rcvdCount = 0;
933932 u8 *buf = (u8 *)buffer;
934933
935934 do
@@ -940,7 +939,7 @@
940939 if (adhocRecvBlocking(buf, tempLen) == 0)
941940 return 0;
942941
943- adhocSendBlocking(&tempLen, sizeof(int));
942+ adhocSendBlocking(&tempLen, sizeof(u32));
944943
945944 buf += ADHOC_BLOCKSIZE;
946945 rcvdCount += ADHOC_BLOCKSIZE;
--- trunk/gpsp-kai-test/psp/Makefile (revision 215)
+++ trunk/gpsp-kai-test/psp/Makefile (revision 216)
@@ -20,7 +20,7 @@
2020
2121 VERSION_MAJOR = 3
2222 VERSION_MINOR = 1
23-VERSION_BUILD = 15
23+VERSION_BUILD = 16
2424 VERSION_OPT = test ${VERSION_BUILD}
2525
2626 PSP_EBOOT_TITLE = UnOfficial_gpSP_kai_${VERSION_MAJOR}.${VERSION_MINOR} ${VERSION_OPT}
--- trunk/gpsp-kai-test/adhoc.h (revision 215)
+++ trunk/gpsp-kai-test/adhoc.h (revision 216)
@@ -24,21 +24,21 @@
2424 /******************************************************************************
2525 * グローバル関数の宣言
2626 ******************************************************************************/
27-int pspSdkLoadAdhocModules(void);
27+u32 pspSdkLoadAdhocModules(void);
2828
29-int adhocInit(const char *matchingData);
30-int adhocTerm(void);
31-int adhocSelect(void);
32-int adhocReconnect(char *ssid);
29+u32 adhocInit(const char *matchingData);
30+u32 adhocTerm(void);
31+u32 adhocSelect(void);
32+u32 adhocReconnect(char *ssid);
3333
34-int adhocSend(void *buffer, int length);
35-int adhocRecv(void *buffer, int length);
34+u32 adhocSend(void *buffer, u32 length);
35+u32 adhocRecv(void *buffer, u32 length);
3636
37-int adhocSendBlocking(void *buffer, int length);
38-int adhocRecvBlocking(void *buffer, int length);
39-int adhocRecvBlockingTimeout(void *buffer, int length, int timeout);
37+u32 adhocSendBlocking(void *buffer, u32 length);
38+u32 adhocRecvBlocking(void *buffer, u32 length);
39+u32 adhocRecvBlockingTimeout(void *buffer, u32 length, u32 timeout);
4040
41-int adhocSendRecvAck(void *buffer, int length);
42-int adhocRecvSendAck(void *buffer, int length);
41+u32 adhocSendRecvAck(void *buffer, u32 length);
42+u32 adhocRecvSendAck(void *buffer, u32 length);
4343
4444 #endif
--- trunk/gpsp-kai-test/main.c (revision 215)
+++ trunk/gpsp-kai-test/main.c (revision 216)
@@ -212,13 +212,12 @@
212212 int exit_callback(int arg1, int arg2, void *common)
213213 {
214214 quit_flag = 1;
215- sceKernelDelayThread(500);
216215 return 0;
217216 }
218217
219218 int power_callback(int unknown, int powerInfo, void *common)
220219 {
221- if (powerInfo & PSP_POWER_CB_SUSPENDING)
220+ if (powerInfo & PSP_POWER_CB_POWER_SWITCH)
222221 power_flag = 1;
223222 else
224223 power_flag = 0;
Show on old repository browser