Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added software strobe
Jack Lange [Wed, 11 Mar 2009 04:28:39 +0000 (23:28 -0500)]
palacios/src/devices/8254.c

index 90f860a..1de80e9 100644 (file)
@@ -154,6 +154,10 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint
     } else {
        ushort_t reload_val = ch->reload_value; 
 
+       if (ch->op_mode == SW_STROBE) {
+           reload_val = 0xffff;
+       }
+
        // TODO: Check this....
        // Is this correct???
        if (reload_val == 0) {
@@ -206,8 +210,13 @@ static int handle_crystal_tics(struct vm_device * dev, struct channel * ch, uint
 
            break;
        case SW_STROBE:
-           PrintError("Software strobe not implemented\n");
-           return -1;
+
+           if (channel_cycles > 0) {
+               if (ch->output_pin == 1) {
+                   ch->output_pin = 0;
+                   output_changed = 1;
+               }
+           }
            break;
        case HW_STROBE:
            PrintError("Hardware strobe not implemented\n");
@@ -357,6 +366,9 @@ static int handle_channel_write(struct channel * ch, char val) {
        case SQR_WAVE:
            ch->output_pin = 1;
            break;
+       case SW_STROBE:
+           ch->output_pin = 1;
+           break;
        default:
            PrintError("Invalid OP_MODE: %d\n", ch->op_mode);
            return -1;
@@ -434,6 +446,9 @@ static int handle_channel_cmd(struct channel * ch, struct pit_cmd_word cmd) {
        case SQR_WAVE:
            ch->output_pin = 1;
            break;
+       case SW_STROBE:
+           ch->output_pin = 1;
+           break;
        default:
            PrintError("Invalid OP_MODE: %d\n", cmd.op_mode);
            return -1;