/[gxemul]/trunk/src/devices/dev_pckbc.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/devices/dev_pckbc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Mon Oct 8 16:21:17 2007 UTC revision 42 by dpavlin, Mon Oct 8 16:22:32 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_pckbc.c,v 1.72 2006/12/30 13:30:58 debug Exp $   *  $Id: dev_pckbc.c,v 1.74 2007/06/15 19:57:33 debug Exp $
29   *     *  
30   *  Standard 8042 PC keyboard controller (and a 8242WB PS2 keyboard/mouse   *  COMMENT: 8042 PC keyboard controller (+ 8242WB Keyboard/Mouse controller)
31   *  controller), including the 8048 keyboard chip.   *
32     *  This module includes emulation of the 8048 keyboard chip too.
33   *   *
34   *  Quick source of good info: http://my.execpc.com/~geezer/osd/kbd/kbd.txt   *  Quick source of good info: http://my.execpc.com/~geezer/osd/kbd/kbd.txt
35   *   *
# Line 437  static void ascii_to_pc_scancodes_type2( Line 438  static void ascii_to_pc_scancodes_type2(
438  }  }
439    
440    
441  /*  DEVICE_TICK(pckbc)
  *  dev_pckbc_tick():  
  */  
 void dev_pckbc_tick(struct cpu *cpu, void *extra)  
442  {  {
443          struct pckbc_data *d = extra;          struct pckbc_data *d = extra;
444          int port_nr, ch, ints_enabled;          int port_nr, ch, ints_enabled;
# Line 622  static void dev_pckbc_command(struct pck Line 620  static void dev_pckbc_command(struct pck
620    
621  DEVICE_ACCESS(pckbc)  DEVICE_ACCESS(pckbc)
622  {  {
623            struct pckbc_data *d = extra;
624          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
625          int port_nr = 0;          int port_nr = 0;
626          size_t i;          size_t i;
         struct pckbc_data *d = extra;  
627    
628          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
629                  idata = memory_readmax64(cpu, data, len);                  idata = memory_readmax64(cpu, data, len);
# Line 912  int dev_pckbc_init(struct machine *machi Line 910  int dev_pckbc_init(struct machine *machi
910          struct pckbc_data *d;          struct pckbc_data *d;
911          int len = DEV_PCKBC_LENGTH;          int len = DEV_PCKBC_LENGTH;
912    
913          d = malloc(sizeof(struct pckbc_data));          CHECK_ALLOCATION(d = malloc(sizeof(struct pckbc_data)));
         if (d == NULL) {  
                 fprintf(stderr, "out of memory\n");  
                 exit(1);  
         }  
914          memset(d, 0, sizeof(struct pckbc_data));          memset(d, 0, sizeof(struct pckbc_data));
915    
916          if (type == PCKBC_8242)          if (type == PCKBC_8242)
# Line 943  int dev_pckbc_init(struct machine *machi Line 937  int dev_pckbc_init(struct machine *machi
937          memory_device_register(mem, "pckbc", baseaddr,          memory_device_register(mem, "pckbc", baseaddr,
938              len, dev_pckbc_access, d, DM_DEFAULT, NULL);              len, dev_pckbc_access, d, DM_DEFAULT, NULL);
939          machine_add_tickfunction(machine, dev_pckbc_tick, d,          machine_add_tickfunction(machine, dev_pckbc_tick, d,
940              PCKBC_TICKSHIFT, 0.0);              PCKBC_TICKSHIFT);
941    
942          return d->console_handle;          return d->console_handle;
943  }  }

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26