From 2dab9bf0ef329bed89a0438e48272320a01ae6ce Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Sun, 3 Oct 2004 19:18:32 +0000 Subject: [PATCH] added another type2 scriptcmd, logging not yet done. NV18 now reports OK status (not yet working as secondary card however..) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9169 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/nvidia/engine/nv_info.c | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/src/add-ons/accelerants/nvidia/engine/nv_info.c b/src/add-ons/accelerants/nvidia/engine/nv_info.c index 99c87fe4d5..4f2d3aafa2 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_info.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_info.c @@ -897,7 +897,7 @@ static status_t exec_type2_script_mode(uint8* rom, uint16* adress, int16* size, status_t result = B_OK; bool end = false; uint8 index, byte, byte2, safe, shift; - uint32 reg, reg2, data, data2, and_out, and_out2, or_in, safe32, offset32, size32; + uint32 reg, reg2, data, data2, and_out, and_out2, or_in, or_in2, safe32, offset32, size32; while (!end) { @@ -1135,6 +1135,58 @@ static status_t exec_type2_script_mode(uint8* rom, uint16* adress, int16* size, *adress += 1; exec_cmd_39_type2(rom, data, tabs, exec); break; + case 0x49: /* new */ + size32 = *((uint8*)(&(rom[*adress + 17]))); + if (!size32) size32 = 256; + *size -= (18 + (size32 << 1)); + if (*size < 0) + { + LOG(8,("script size error, aborting!\n\n")); + end = true; + result = B_ERROR; + break; + } + + /* execute */ + *adress += 1; + reg = *((uint32*)(&(rom[*adress]))); + *adress += 4; + reg2 = *((uint32*)(&(rom[*adress]))); + *adress += 4; + and_out = *((uint32*)(&(rom[*adress]))); + *adress += 4; + or_in = *((uint32*)(&(rom[*adress]))); + *adress += 4; + size32 = *((uint8*)(&(rom[*adress]))); + if (!size32) size32 = 256; + *adress += 1; +//fix log and doublecheck exe + LOG(8,("cmd 'blabla'\n")); + for (index = 0; index < size32; index++) + { + LOG(8,("INFO (cont.) blabla\n")); + } + if (*exec) + { + for (index = 0; index < size32; index++) + { + or_in2 = *((uint8*)(&(rom[*adress]))); + *adress += 1; + data2 = *((uint8*)(&(rom[*adress]))); + *adress += 1; + NV_REG32(reg2) = data2; + data = NV_REG32(reg); + data &= and_out; + data |= or_in; + data |= or_in2; + NV_REG32(reg) = data; + } + } + else + { + *adress += (size32 << 1); + } + break; case 0x62: /* new */ *size -= 5; if (*size < 0)