From: notaz Date: Tue, 26 Jun 2007 20:49:30 +0000 (+0000) Subject: refresh rate: more settings, detect tv-out X-Git-Tag: r1~16 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf65360c22e121053d152f611c9b966ccab9f4c2;p=fceu.git refresh rate: more settings, detect tv-out git-svn-id: file:///home/notaz/opt/svn/fceu@173 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/drivers/gp2x/cpuctrl.c b/drivers/gp2x/cpuctrl.c index b2cc395..9940fd5 100644 --- a/drivers/gp2x/cpuctrl.c +++ b/drivers/gp2x/cpuctrl.c @@ -185,14 +185,45 @@ static reg_setting rate_100_02[] = { 0, 0, 0 } }; +// 120.00 97/0/2/7|25/ 7/ 7/11/37 +static reg_setting rate_120[] = +{ + { 0x0914, 0xffff, (97<<8)|(0<<2)|2 }, /* UPLLSETVREG */ + { 0x0924, 0xff00, (2<<14)|(7<<8) }, /* DISPCSETREG */ + { 0x281A, 0x00ff, 25 }, /* .HSWID(T2) */ + { 0x281C, 0x00ff, 7 }, /* .HSSTR(T8) */ + { 0x281E, 0x00ff, 7 }, /* .HSEND(T7) */ + { 0x2822, 0x01ff, 11 }, /* .VSEND (T9) */ + { 0x2826, 0x0ff0, 37<<4 }, /* .DESTR(T3) */ + { 0, 0, 0 } +}; + +// 100.00 96/0/2/7|29/25/53/15/37 +static reg_setting rate_100[] = +{ + { 0x0914, 0xffff, (96<<8)|(0<<2)|2 }, /* UPLLSETVREG */ + { 0x0924, 0xff00, (2<<14)|(7<<8) }, /* DISPCSETREG */ + { 0x281A, 0x00ff, 29 }, /* .HSWID(T2) */ + { 0x281C, 0x00ff, 25 }, /* .HSSTR(T8) */ + { 0x281E, 0x00ff, 53 }, /* .HSEND(T7) */ + { 0x2822, 0x01ff, 15 }, /* .VSEND (T9) */ + { 0x2826, 0x0ff0, 37<<4 }, /* .DESTR(T3) */ + { 0, 0, 0 } +}; -static reg_setting *possible_rates[] = { rate_almost60, rate_50, rate_120_20, rate_100_02 }; + +static reg_setting *possible_rates[] = { rate_almost60, rate_50, rate_120_20, rate_100_02, rate_120, rate_100 }; void set_LCD_custom_rate(lcd_rate_t rate) { reg_setting *set; + if (MEM_REG[0x2800>>1] & 0x100) // tv-out + { + return; + } + printf("setting custom LCD refresh, mode=%i... ", rate); fflush(stdout); for (set = possible_rates[rate]; set->reg; set++) { diff --git a/drivers/gp2x/cpuctrl.h b/drivers/gp2x/cpuctrl.h index d537f4e..d94d60b 100644 --- a/drivers/gp2x/cpuctrl.h +++ b/drivers/gp2x/cpuctrl.h @@ -19,6 +19,8 @@ typedef enum LCDR_50, /* 50Hz, has interlacing problems */ LCDR_120_20, /* ~60.10*2Hz, used by FCE Ultra */ LCDR_100_02, /* ~50.01*2Hz, used by FCE Ultra */ + LCDR_120, /* 120Hz */ + LCDR_100, /* 100Hz */ } lcd_rate_t; extern void set_LCD_custom_rate(lcd_rate_t rate);