From 047c8c28edc34ec79d9622181ad620fc2e87be91 Mon Sep 17 00:00:00 2001 From: cpu Date: Thu, 27 Mar 2008 12:57:42 +0000 Subject: [PATCH] r897@Knoppix: root | 2008-03-27 20:57:24 +0800 change sm502's rgb12 to not default. add x86emu testchar() to debug and emulate inb 0x61. git-svn-id: file:///svn/pmon-all/pmon-all@276 214b0138-1524-0410-9122-e5cb4b5bc56c --- sys/dev/pci/sm502.c | 4 ++-- x86emu/src/biosemu/besys.c | 16 +++++++++++++++- x86emu/src/biosemu/freebiosvga.c | 2 +- x86emu/src/x86emu/decode.c | 12 ++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/sm502.c b/sys/dev/pci/sm502.c index b670eb86..bacb0c6f 100644 --- a/sys/dev/pci/sm502.c +++ b/sys/dev/pci/sm502.c @@ -533,8 +533,8 @@ static void SmiSetRegs (void) preg ++; } #ifdef DEVBD2F_SM502 -if(!getenv("rgb24")) -write32(0x80000,0x0f413105); // bit21-20=1: 9-bit RGB 3:3:3. +if(getenv("sm502_rgb12")) +write32(0x80000,0x0f413105); // bit22-21=10b: 12-bit RGB 4:4:4. #endif } diff --git a/x86emu/src/biosemu/besys.c b/x86emu/src/biosemu/besys.c index 86ebd733..4ae64ccd 100644 --- a/x86emu/src/biosemu/besys.c +++ b/x86emu/src/biosemu/besys.c @@ -290,9 +290,9 @@ DB( if (DEBUG_MEM()) #ifdef DEBUG_EMU_VGA #define DEBUG_IO() (M.x86.debug & DEBUG_IO_TRACE_F) - void check_io(int port,int read,int val) { + return; if(port==0x40||port==0x43) return; //if(port>0x3ff) return; /* static int printed[1024]; @@ -336,6 +336,20 @@ static unsigned short Int10Current_inb40time=0; } #endif +#ifdef MY61IO +{ +static unsigned short Int10Current_inb61time=0; + if (port == 0x61) { + Int10Current_inb61time++; + val = (u8)(Int10Current_inb61time>>3); +#ifdef PRINT_PORT + printf(" inb(%#x) = %2.2x\n", port, val); +#endif + return val; + } +} +#endif + #if !defined(_PC) && !defined(_PC_PCI) if (!pciCfg1in(port,(u32 *)&val,1)) #endif diff --git a/x86emu/src/biosemu/freebiosvga.c b/x86emu/src/biosemu/freebiosvga.c index e3aa46a7..74386c69 100644 --- a/x86emu/src/biosemu/freebiosvga.c +++ b/x86emu/src/biosemu/freebiosvga.c @@ -119,7 +119,7 @@ int vga_bios_init(void) // Execute the BIOS POST code #ifdef DEBUG_EMU_VGA - X86EMU_trace_on(); + //X86EMU_trace_on(); #endif BE_callRealMode(0xC000,0x0003,®s,&sregs); #if 0 diff --git a/x86emu/src/x86emu/decode.c b/x86emu/src/x86emu/decode.c index 69cc9cd4..cf111ad6 100644 --- a/x86emu/src/x86emu/decode.c +++ b/x86emu/src/x86emu/decode.c @@ -113,6 +113,18 @@ DB( printf("halted\n"); } op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++)); (*x86emu_optab[op1])(op1); +#ifdef DEBUG_EMU_VGA + { + char c; + if(tgt_testchar()){ + printf("press d to show debug info,x to exit,others to continue\n"); + c=tgt_getchar(); + if(c=='d')X86EMU_trace_on(); + if(c=='x'){M.x86.debug &= ~DEBUG_EXIT;return;} + + } + } +#endif if (M.x86.debug & DEBUG_EXIT) { M.x86.debug &= ~DEBUG_EXIT; return;