Diff for /qemu/hw/ssd0323.c between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2018/04/24 16:54:02 version 1.1.1.3, 2018/04/24 17:25:10
Line 10 Line 10
 /* The controller can support a variety of different displays, but we only  /* The controller can support a variety of different displays, but we only
    implement one.  Most of the commends relating to brightness and geometry     implement one.  Most of the commends relating to brightness and geometry
    setup are ignored. */     setup are ignored. */
 #include "hw.h"  #include "ssi.h"
 #include "devices.h"  
 #include "console.h"  #include "console.h"
   
 //#define DEBUG_SSD0323 1  //#define DEBUG_SSD0323 1
   
 #ifdef DEBUG_SSD0323  #ifdef DEBUG_SSD0323
 #define DPRINTF(fmt, args...) \  #define DPRINTF(fmt, ...) \
 do { printf("ssd0323: " fmt , ##args); } while (0)  do { printf("ssd0323: " fmt , ## __VA_ARGS__); } while (0)
 #define BADF(fmt, args...) \  #define BADF(fmt, ...) \
 do { fprintf(stderr, "ssd0323: error: " fmt , ##args); exit(1);} while (0)  do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else  #else
 #define DPRINTF(fmt, args...) do {} while(0)  #define DPRINTF(fmt, ...) do {} while(0)
 #define BADF(fmt, args...) \  #define BADF(fmt, ...) \
 do { fprintf(stderr, "ssd0323: error: " fmt , ##args);} while (0)  do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif  #endif
   
 /* Scaling factor for pixels.  */  /* Scaling factor for pixels.  */
Line 43  enum ssd0323_mode Line 42  enum ssd0323_mode
 };  };
   
 typedef struct {  typedef struct {
       SSISlave ssidev;
     DisplayState *ds;      DisplayState *ds;
   
     int cmd_len;      int cmd_len;
Line 60  typedef struct { Line 60  typedef struct {
     uint8_t framebuffer[128 * 80 / 2];      uint8_t framebuffer[128 * 80 / 2];
 } ssd0323_state;  } ssd0323_state;
   
 int ssd0323_xfer_ssi(void *opaque, int data)  static uint32_t ssd0323_transfer(SSISlave *dev, uint32_t data)
 {  {
     ssd0323_state *s = (ssd0323_state *)opaque;      ssd0323_state *s = FROM_SSI_SLAVE(ssd0323_state, dev);
   
     switch (s->mode) {      switch (s->mode) {
     case SSD0323_DATA:      case SSD0323_DATA:
         DPRINTF("data 0x%02x\n", data);          DPRINTF("data 0x%02x\n", data);
Line 321  static int ssd0323_load(QEMUFile *f, voi Line 322  static int ssd0323_load(QEMUFile *f, voi
     return 0;      return 0;
 }  }
   
 void *ssd0323_init(qemu_irq *cmd_p)  static void ssd0323_init(SSISlave *dev)
 {  {
     ssd0323_state *s;      ssd0323_state *s = FROM_SSI_SLAVE(ssd0323_state, dev);
     qemu_irq *cmd;  
   
     s = (ssd0323_state *)qemu_mallocz(sizeof(ssd0323_state));  
     s->col_end = 63;      s->col_end = 63;
     s->row_end = 79;      s->row_end = 79;
     s->ds = graphic_console_init(ssd0323_update_display,      s->ds = graphic_console_init(ssd0323_update_display,
Line 334  void *ssd0323_init(qemu_irq *cmd_p) Line 333  void *ssd0323_init(qemu_irq *cmd_p)
                                  NULL, NULL, s);                                   NULL, NULL, s);
     qemu_console_resize(s->ds, 128 * MAGNIFY, 64 * MAGNIFY);      qemu_console_resize(s->ds, 128 * MAGNIFY, 64 * MAGNIFY);
   
     cmd = qemu_allocate_irqs(ssd0323_cd, s, 1);      qdev_init_gpio_in(&dev->qdev, ssd0323_cd, 1);
     *cmd_p = *cmd;  
   
     register_savevm("ssd0323_oled", -1, 1, ssd0323_save, ssd0323_load, s);      register_savevm("ssd0323_oled", -1, 1, ssd0323_save, ssd0323_load, s);
   }
   
     return s;  static SSISlaveInfo ssd0323_info = {
       .qdev.name = "ssd0323",
       .qdev.size = sizeof(ssd0323_state),
       .init = ssd0323_init,
       .transfer = ssd0323_transfer
   };
   
   static void ssd03232_register_devices(void)
   {
       ssi_register_slave(&ssd0323_info);
 }  }
   
   device_init(ssd03232_register_devices)

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


unix.superglobalmegacorp.com