/[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 21 by dpavlin, Mon Oct 8 16:19:23 2007 UTC revision 22 by dpavlin, Mon Oct 8 16:19:37 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2003-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2003-2006  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_pckbc.c,v 1.60 2005/11/25 04:25:26 debug Exp $   *  $Id: dev_pckbc.c,v 1.64 2006/01/01 13:17:16 debug Exp $
29   *     *  
30   *  Standard 8042 PC keyboard controller (and a 8242WB PS2 keyboard/mouse   *  Standard 8042 PC keyboard controller (and a 8242WB PS2 keyboard/mouse
31   *  controller), including the 8048 keyboard chip.   *  controller), including the 8048 keyboard chip.
# Line 582  static void dev_pckbc_command(struct pck Line 582  static void dev_pckbc_command(struct pck
582  /*  /*
583   *  dev_pckbc_access():   *  dev_pckbc_access():
584   */   */
585  int dev_pckbc_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(pckbc)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
586  {  {
587          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
588          int i, port_nr = 0;          int port_nr = 0;
589            size_t i;
590          struct pckbc_data *d = extra;          struct pckbc_data *d = extra;
591    
592          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
# Line 883  int dev_pckbc_init(struct machine *machi Line 882  int dev_pckbc_init(struct machine *machi
882          memset(d, 0, sizeof(struct pckbc_data));          memset(d, 0, sizeof(struct pckbc_data));
883    
884          if (type == PCKBC_8242)          if (type == PCKBC_8242)
885                  len = 0x40;                  len = 0x18;
886    
887          if (type == PCKBC_JAZZ) {          if (type == PCKBC_JAZZ) {
888                  type = PCKBC_8042;                  type = PCKBC_8042;
# Line 895  int dev_pckbc_init(struct machine *machi Line 894  int dev_pckbc_init(struct machine *machi
894          d->mouse_irqnr       = mouse_irqnr;          d->mouse_irqnr       = mouse_irqnr;
895          d->in_use            = in_use;          d->in_use            = in_use;
896          d->pc_style_flag     = pc_style_flag;          d->pc_style_flag     = pc_style_flag;
         if (d->in_use)  
                 d->console_handle =  
                     console_start_slave_inputonly(machine, "pckbc");  
897          d->translation_table = 2;          d->translation_table = 2;
898          d->rx_int_enable     = 1;          d->rx_int_enable     = 1;
899          d->output_byte       = 0x02;    /*  A20 enable on PCs  */          d->output_byte       = 0x02;    /*  A20 enable on PCs  */
900    
901            d->console_handle = console_start_slave_inputonly(
902                machine, "pckbc", d->in_use);
903    
904          memory_device_register(mem, "pckbc", baseaddr,          memory_device_register(mem, "pckbc", baseaddr,
905              len, dev_pckbc_access, d, DM_DEFAULT, NULL);              len, dev_pckbc_access, d, DM_DEFAULT, NULL);
906          machine_add_tickfunction(machine, dev_pckbc_tick, d, PCKBC_TICKSHIFT);          machine_add_tickfunction(machine, dev_pckbc_tick, d, PCKBC_TICKSHIFT);

Legend:
Removed from v.21  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26