*** vdp1.c	Fri Jun 24 23:32:30 2011
--- vdp1.c	Sat Oct  9 20:30:46 2010
***************
*** 297,303 ****
  
  void FASTCALL Vdp1WriteLong(u32 addr, UNUSED u32 val) {
     addr &= 0xFF;
     LOG("trying to long-write a Vdp1 register - %08X\n", addr);
  }
  
  //////////////////////////////////////////////////////////////////////////////
--- 297,333 ----
  
  void FASTCALL Vdp1WriteLong(u32 addr, UNUSED u32 val) {
     addr &= 0xFF;
+ #ifndef GEKKO
     LOG("trying to long-write a Vdp1 register - %08X\n", addr);
+ #else
+    switch(addr) {
+       case 0x0:
+          Vdp1Regs->TVMR = val >> 16;
+          Vdp1Regs->FBCR = val & 0xFFFF;
+          break;
+       case 0x4:
+          Vdp1Regs->PTMR = val >> 16;
+          Vdp1Regs->EWDR = val & 0xFFFF;
+          break;
+       case 0x8:
+          Vdp1Regs->EWLR = val >> 16;
+          Vdp1Regs->EWRR = val & 0xFFFF;
+          break;
+       case 0xC:
+          Vdp1Regs->ENDR = val >> 16;
+          break;
+       case 0x10:
+          Vdp1Regs->EDSR = val >> 16;
+          Vdp1Regs->LOPR = val & 0xFFFF;
+          break;
+       case 0x14:
+          Vdp1Regs->COPR = val >> 16;
+          Vdp1Regs->MODR = val & 0xFFFF;
+          break;
+       default:
+          LOG("trying to long-write a Vdp1 register - %08X\n", addr);
+    }
+ #endif
  }
  
  //////////////////////////////////////////////////////////////////////////////
***************
*** 309,316 ****
  
     VIDCore->Vdp1DrawStart();
  
     if (!Vdp1Regs->PTMR)
        return;
  
     if (!Vdp1Regs->disptoggle)
     {
--- 339,348 ----
  
     VIDCore->Vdp1DrawStart();
  
+ #ifndef GEKKO
     if (!Vdp1Regs->PTMR)
        return;
+ #endif
  
     if (!Vdp1Regs->disptoggle)
     {
***************
*** 370,389 ****
        }
  
        // Next, determine where to go next
        switch ((command & 0x3000) >> 12) {
           case 0: // NEXT, jump to following table
              Vdp1Regs->addr += 0x20;
              break;
           case 1: // ASSIGN, jump to CMDLINK
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 2: // CALL, call a subroutine
              if (returnAddr == 0xFFFFFFFF)
                 returnAddr = Vdp1Regs->addr + 0x20;
  	
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 3: // RETURN, return from subroutine
              if (returnAddr != 0xFFFFFFFF) {
                 Vdp1Regs->addr = returnAddr;
                 returnAddr = 0xFFFFFFFF;
--- 402,437 ----
        }
  
        // Next, determine where to go next
+ #ifndef GEKKO
        switch ((command & 0x3000) >> 12) {
+ #else
+       switch ((command & 0x7000) >> 12) {
+ #endif
           case 0: // NEXT, jump to following table
+ #ifdef GEKKO
+          case 4: // NEXT, jump to following table
+ #endif
              Vdp1Regs->addr += 0x20;
              break;
           case 1: // ASSIGN, jump to CMDLINK
+ #ifdef GEKKO
+          case 5: // ASSIGN, jump to CMDLINK
+ #endif
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 2: // CALL, call a subroutine
+ #ifdef GEKKO
+          case 6: // CALL, call a subroutine
+ #endif
              if (returnAddr == 0xFFFFFFFF)
                 returnAddr = Vdp1Regs->addr + 0x20;
  	
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 3: // RETURN, return from subroutine
+ #ifdef GEKKO
+          case 7: // RETURN, return from subroutine
+ #endif
              if (returnAddr != 0xFFFFFFFF) {
                 Vdp1Regs->addr = returnAddr;
                 returnAddr = 0xFFFFFFFF;
***************
*** 411,419 ****
     u32 commandCounter;
     u16 command;
  
     // Only when PTMR's not set do we not parse commands
     if (!Vdp1Regs->PTMR)
        return;
  
     Vdp1Regs->addr = 0;
     returnAddr = 0xFFFFFFFF;
--- 459,469 ----
     u32 commandCounter;
     u16 command;
  
+ #ifndef GEKKO
     // Only when PTMR's not set do we not parse commands
     if (!Vdp1Regs->PTMR)
        return;
+ #endif
  
     Vdp1Regs->addr = 0;
     returnAddr = 0xFFFFFFFF;
***************
*** 456,475 ****
        }
  
        // Next, determine where to go next
        switch ((command & 0x3000) >> 12) {
           case 0: // NEXT, jump to following table
              Vdp1Regs->addr += 0x20;
              break;
           case 1: // ASSIGN, jump to CMDLINK
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 2: // CALL, call a subroutine
              if (returnAddr == 0xFFFFFFFF)
                 returnAddr = Vdp1Regs->addr + 0x20;
  	
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 3: // RETURN, return from subroutine
              if (returnAddr != 0xFFFFFFFF) {
                 Vdp1Regs->addr = returnAddr;
                 returnAddr = 0xFFFFFFFF;
--- 506,541 ----
        }
  
        // Next, determine where to go next
+ #ifndef GEKKO
        switch ((command & 0x3000) >> 12) {
+ #else
+       switch ((command & 0x7000) >> 12) {
+ #endif
           case 0: // NEXT, jump to following table
+ #ifdef GEKKO
+          case 4: // NEXT, jump to following table
+ #endif
              Vdp1Regs->addr += 0x20;
              break;
           case 1: // ASSIGN, jump to CMDLINK
+ #ifdef GEKKO
+          case 5: // ASSIGN, jump to CMDLINK
+ #endif
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 2: // CALL, call a subroutine
+ #ifdef GEKKO
+          case 6: // CALL, call a subroutine
+ #endif
              if (returnAddr == 0xFFFFFFFF)
                 returnAddr = Vdp1Regs->addr + 0x20;
  	
              Vdp1Regs->addr = T1ReadWord(Vdp1Ram, Vdp1Regs->addr + 2) * 8;
              break;
           case 3: // RETURN, return from subroutine
+ #ifdef GEKKO
+          case 7: // RETURN, return from subroutine
+ #endif
              if (returnAddr != 0xFFFFFFFF) {
                 Vdp1Regs->addr = returnAddr;
                 returnAddr = 0xFFFFFFFF;
