• R/O
  • SSH
  • HTTPS

gpsp-kai: Commit


Commit MetaInfo

Revision428 (tree)
Time2009-07-25 00:39:21
Authortakka

Log Message

(empty log message)

Change Summary

Incremental Difference

--- trunk/gpsp-kai-test/src/gu.c (revision 427)
+++ trunk/gpsp-kai-test/src/gu.c (revision 428)
@@ -264,6 +264,8 @@
264264 {
265265 static u32 first_load = 0;
266266 static SCREEN_PARAMETER *old_parameter = NULL;
267+ float x, y, cx, cy, xx, yy;
268+ SCREEN_PARAMETER sp; // TODO:変数名
267269
268270 if(first_load == 0)
269271 {
@@ -290,23 +292,38 @@
290292 {
291293 case ((PSP_OUT << 1) | FRAME_GAME):
292294 current_parameter = &screen_parameter_psp_game[g_gpsp_config.screen_mode];
293- current_parameter->screen_setting_1.x1 = 16;
295+ memcpy(&sp.screen_setting_1, &current_parameter->screen_setting_1, sizeof(float) * 20);
294296
297+ x = (sp.screen_setting_1.x2 - sp.screen_setting_1.x1) / 2;
298+ y = (sp.screen_setting_1.y2 - sp.screen_setting_1.y1) / 2;
299+ cx = sp.screen_setting_1.x1 + x;
300+ cy = sp.screen_setting_1.y1 + y;
301+ xx = x * g_gpsp_config.screen_scale / 100;
302+ yy = y * g_gpsp_config.screen_scale / 100;
303+ sp.screen_setting_1.x1 = cx - xx;
304+ sp.screen_setting_1.x2 = cx + xx;
305+ sp.screen_setting_1.y1 = cy - yy;
306+ sp.screen_setting_1.y2 = cy + yy;
295307 break;
296308 case ((PSP_OUT << 1) | FRAME_MENU):
297309 current_parameter = &screen_parameter_psp_menu;
310+ memcpy(&sp.screen_setting_1, &current_parameter->screen_setting_1, sizeof(float) * 20);
298311 break;
299312 case ((ANALOG_OUT << 1) | FRAME_GAME):
300313 current_parameter = &screen_parameter_composite_game[g_gpsp_config.screen_ratio][g_gpsp_config.screen_interlace][g_gpsp_config.screen_mode];
301- break;
314+ memcpy(&sp.screen_setting_1, &current_parameter->screen_setting_1, sizeof(float) * 20);
315+ break;
302316 case ((ANALOG_OUT << 1) | FRAME_MENU):
303317 current_parameter = &screen_parameter_composite_menu[g_gpsp_config.screen_ratio][g_gpsp_config.screen_interlace];
318+ memcpy(&sp.screen_setting_1, &current_parameter->screen_setting_1, sizeof(float) * 20);
304319 break;
305320 case ((DIGITAL_OUT << 1) | FRAME_GAME):
306321 current_parameter = &screen_parameter_component_game[g_gpsp_config.screen_ratio][g_gpsp_config.screen_interlace][g_gpsp_config.screen_mode];
307- break;
322+ memcpy(&sp.screen_setting_1, &current_parameter->screen_setting_1, sizeof(float) * 20);
323+ break;
308324 case ((DIGITAL_OUT << 1) | FRAME_MENU):
309325 current_parameter = &screen_parameter_component_menu[g_gpsp_config.screen_ratio][g_gpsp_config.screen_interlace];
326+ memcpy(&sp.screen_setting_1, &current_parameter->screen_setting_1, sizeof(float) * 20);
310327 break;
311328 }
312329
@@ -324,18 +341,8 @@
324341 }
325342 }
326343
327- // TODO %指定調整
328- /*
329- * (x1,y1)-(x2,y2) r(0...1) (x2>x1,y2>y1)
330- * 中心を計算
331- * x = x2 - x1, y = y2 - y1
332- * cx = x1 + x / 2 , cy = y1 + y / 2
333- * x' = x * r, y' = y * r
334- * x1 = cx - x'/ 2, y1 = cy - x'/ 2
335- * x2 = cx + x'/ 2, y2 = cy + x'/ 2
336- */
337-
338344 memcpy(screen_vertex, &current_parameter->screen_setting_1, sizeof(float) * 20);
345+ memcpy(screen_vertex, &sp.screen_setting_1, sizeof(float) * 20);
339346
340347 video_draw_frame = frame;
341348 screen_address = (u16 *)flip_address[frame][0];
--- trunk/gpsp-kai-test/src/sound.c (revision 427)
+++ trunk/gpsp-kai-test/src/sound.c (revision 428)
@@ -443,6 +443,9 @@
443443 {
444444 // TODO 実数部のビット数を多くした方がいい?
445445 FIXED16_16 buffer_ticks= FLOAT_TO_FP16_16(((float)(cpu_ticks - gbc_sound_last_cpu_ticks) * SOUND_FREQUENCY) / SYS_CLOCK);
446+ DBGOUT("%d\n", cpu_ticks - gbc_sound_last_cpu_ticks); /* 272 - 280896 */
447+ // a * 44100.0 / 16777216.0 (1*2*3*5*7)^2 / (2^24)
448+ // 380.435737
446449 u32 i, i2;
447450 GBC_SOUND_STRUCT *gs = gbc_sound_channel;
448451 FIXED16_16 sample_index, frequency_step;
@@ -456,8 +459,8 @@
456459 s8 *wave_bank;
457460 u8 *wave_ram = ((u8 *)io_registers) + 0x90;
458461
459- gbc_sound_partial_ticks += FP16_16_FRACTIONAL_PART(buffer_ticks);
460- buffer_ticks = FP16_16_TO_U32(buffer_ticks);
462+ gbc_sound_partial_ticks += FP16_16_FRACTIONAL_PART(buffer_ticks); /* 実数部 */
463+ buffer_ticks = FP16_16_TO_U32(buffer_ticks); /* 整数部 */
461464
462465 if (gbc_sound_partial_ticks > 0xFFFF)
463466 {
--- trunk/gpsp-kai-test/src/memory.c (revision 427)
+++ trunk/gpsp-kai-test/src/memory.c (revision 428)
@@ -1911,7 +1911,6 @@
19111911 }
19121912 }
19131913 }
1914- DBGOUT("OUT : %X\n\n", rtc_registers[0]);
19151914 #else
19161915 if(rtc_state == RTC_DISABLED)
19171916 rtc_state = RTC_IDLE;
@@ -1947,7 +1946,6 @@
19471946 // Have we received a full RTC command? If so execute it.
19481947 if(rtc_bit_count < 0)
19491948 {
1950- DBGOUT("%X\n",rtc_command);
19511949 switch(rtc_command)
19521950 {
19531951 // Resets RTC
--- trunk/gpsp-kai-test/src/gui.c (revision 427)
+++ trunk/gpsp-kai-test/src/gui.c (revision 428)
@@ -1291,7 +1291,7 @@
12911291 /* 11 */
12921292 /* 12 */ ACTION_OPTION(menu_save_ss, NULL, msg[MSG_SCREEN_SHOT], msg[MSG_G_S_MENU_HELP_7], 12),
12931293 /* 13 */
1294- /* 14 */NUMERIC_SELECTION_OPTION(NULL, "ratio %d", &g_gpsp_config.screen_scale, 201, "ratio", 14),
1294+ /* 14 */NUMERIC_SELECTION_OPTION(NULL, "scale %d", &g_gpsp_config.screen_scale, 201, "scale", 14),
12951295 /* 15 */
12961296 /* 16 */ SUBMENU_OPTION(NULL, msg[MSG_MENU_RETURN_MAIN], msg[MSG_G_S_MENU_HELP_8], 16)
12971297 };
--- trunk/gpsp-kai-test/src/cpu_asm.c (revision 427)
+++ trunk/gpsp-kai-test/src/cpu_asm.c (revision 428)
@@ -256,7 +256,6 @@
256256 check_pc_region(pc); \
257257 opcode = ADDRESS32(pc_address_block, (pc & 0x7FFF)); \
258258 condition = block_data[block_data_position].condition; \
259- DBGOUT("PC %0X:CODE %0X:PTR %0X\n",pc,opcode,translation_ptr); \
260259 if((condition != last_condition) || (condition >= 0x20)) \
261260 { \
262261 \
@@ -2797,7 +2796,6 @@
27972796 translation_flush_count = 0; \
27982797 /* modeにあわせてPCの位置を調整 */ \
27992798 block_lookup_address_pc_##type(); \
2800- DBGOUT("PC:%0X\n",pc); \
28012799 switch(pc >> 24) \
28022800 { \
28032801 case 0x0: \
--- trunk/gpsp-kai-test/readme_kai_jp.html (revision 427)
+++ trunk/gpsp-kai-test/readme_kai_jp.html (revision 428)
@@ -12,7 +12,8 @@
1212 (現在修正中)ERAMとIRAMのキャッシュを分離
1313 -->
1414 -UnOfficial gpSP kai 3.4 test 3 build
15- ZIP解凍時に1MBのメモリが確保できない場合、フリーズしてしまうのを修正
15+ ZIP解凍時に1MBのメモリが確保できない場合、フリーズしてしまうのを修正(PSP-2000/3000)
16+ 画面の拡大縮小設定を追加(本体表示時のみ)
1617
1718 -UnOfficial gpSP kai 3.4 test 2 build 69
1819 メインフォントとサブフォントの優先順位を調整(「ヲボタン問題」が直ったと思います)
Show on old repository browser