Example #1
0
static int decoder(playa_info_t * info)
{
  int status;
  int n;
        
  status = FillYM();
  if (status < 0) {
    spool_error_message();
    return INP_DECODE_ERROR;
  }

  if (status & INP_DECODE_INFO) {
    disk_info(info, 0);
  }

  n = 0;
  if (app.mix.buflen > 0) {
    n = fifo_write((int *)app.mix.buf, app.mix.buflen);
    if (n > 0) {
      app.mix.buf += n;
      app.mix.buflen -= n;
    }
  }

  if (!n) {
    /* Nothing has been written. fifo must be full ! */
    status &= ~INP_DECODE_CONT;
  }

  return (n < 0) ? INP_DECODE_ERROR : status;
}
Example #2
0
static int info(playa_info_t *info, const char *fname)
{
  if (fname) {
    return file_info(info, fname);
  } else {
    return disk_info(info, 0);
  }
}
Example #3
0
static int start(const char *fn, int track, playa_info_t *info)
{
  int err = 0;
  disk68_t *disk = 0;

/*   SDDEBUG("%s(%s)\n", __FUNCTION__, fn); */
  
  disk = SC68app_load_diskfile((char *)fn, 0);
  if (!disk) {
    stop();
    err = -1;
    goto error;
  }
  
  if (err = SC68stop(&app), err < 0) {
    goto error;
  }
  if (err = SC68load(&app, disk), err < 0) {
    goto error;
  }

  /* Patch for tao_tsd, use 25Khz version ! */
  if (app.cur_disk) {
    int i;

    for (i=0; i<app.cur_disk->nb_six; ++i) {
      char *replay = app.cur_disk->mus[i].replay;
      if (replay && !strcmp("tao_tsd", replay)) {
        app.cur_disk->mus[i].replay = "tao_tsd25";
/*         SDDEBUG( "sc68 : Patched #%d for tao_tsd25\n", i+1); */
      } 
    }

    if (err = SC68track(&app, track), err < 0) {
      goto error;
    }

    if (err = SC68play(&app), err < 0) {
      goto error;
    }

  } else {
    err = -1;
    goto error;
  }
  err = 0;

 error:
  if (err) {
    SC68eject(&app);
  }
  disk_info(info, app.cur_disk);
  spool_error_message();
  
  return err;
}
Example #4
0
static int file_info(playa_info_t *info, const char *fname)
{
  int err = -1;
  disk68_t *d;

  d = SC68file_load((char *)fname);
  if (d) {
    err = disk_info(info, d);
    free(d);
  }
  return err;
}
Example #5
0
UIDiskChooser::UIDiskChooser(const char* title):Fl_Double_Window(400, 200, title){
	uint32 i = 0;
	uint32 dcount = disk_count();
	disk_info_t info;
	handle_t h;
	char *fmt_name = "\\\\.\\PhysicalDrive%d";
	char *name;
	char *size;

	_list = new UIDiskList(0, 0, 400, 160);
	_list->begin();
	for (i = 0; i < dcount; i ++){
		h = disk_open(i);
		if (h != null){
			name = (char*)calloc(64, sizeof(char));
			size = (char*)calloc(32, sizeof(char));
			
			disk_info(h, &info);
			format_size(size, info.size);
			sprintf(name, fmt_name, i);
			
			_list->add_disk(i, name, size, info.mbr.gpt_protect ? info.gpt.part_count : info.mbr.part_count);
		}
		disk_close(h);
	}
	_list->end();
	add(_list);
	
	_ok = new Fl_Button(260, 170, 60, 24, "OK");
	_ok->callback(ok_cb, this);
	add(_ok);
	_cancel = new Fl_Button(330, 170, 60, 24, "Cancel");
	_cancel->callback(cancel_cb, this);
	add(_cancel);

}
Example #6
0
File: main.c Project: vbmacher/qsOS
int main()
{
  int key;
  int sel, old_sel;

  printf("\nLoading...");

  Init_PHY();
  Init_LOG();
  Init_APP();

  sel = 0;
  old_sel = 0;
start:
  mainmenu(sel);

  // kbhit
  fflush(stdin);
  key = 0;
  asm {
    mov ax, 0x0305
    xor bx, bx
    int 0x16
  }
key_loop:
  while (!kbhit()) ;
  asm {
    xor ah, ah
    int 0x16
    mov byte ptr [key], ah // scan kod
  }

  switch (key) {
    case 0x50: // dole
      old_sel = sel;
      sel++;
      if (sel == menu_count) sel = 0;
      sel_item(sel,old_sel);
      goto key_loop;
    case 0x48: // hore
      old_sel = sel;
      if (!sel) sel = menu_count;
      sel--;
      sel_item(sel, old_sel);
      goto key_loop;
    case 0xE0:
    case 0x1C: // enter
      break;
    default:
      goto key_loop;
  }

  draw_window();
  switch (sel) {
    case CREATE_FILE:
      create_file(NULL);
      break;
    case DELETE_FILE:
      delete_file(NULL);
      break;
    case WRITE_FILE:
      write_file(NULL,NULL,0,0,1);
      cprintf("\n\rPress ENTER");
      cgets(NULL);
      break;
    case READ_FILE:
      read_file(NULL,NULL,0,0,1);
      cprintf("\n\rPress ENTER");
      cgets(NULL);
      break;
    case CREATE_DIR:
      create_dir(NULL);
      break;
    case DELETE_DIR:
      delete_dir(NULL);
      break;
    case SHOW_DIR:
      show_dir();
      break;
    case SET_PATH:
      set_path(NULL);
      break;
    case DISK_INFO:
      disk_info();
      break;
    case FORMAT_FDD:
      format_fdd();
      break;
    case FDD_TEST:
      dotest_fdd();
      break;
    case ABOUT:
      about();
      break;
    case EXIT:
      goto ext;
  }

  textattr(BORDER);
  cprintf("\n\r\n\rPress any key to continue...");
  getchar();
  goto start;

ext:
  window(1,1,80,25);
  textattr(0x07);
  clrscr();

  Destroy_APP();
  Destroy_LOG();
  Destroy_PHY();

  return 0;
}