#315 Generic FDD UI handling (cleanup)

v1.2
closed-accepted
nobody
None
5
2016-06-06
2013-08-29
Alex Badea
No

While working on other patches (hc2000 and CoBra emulation) I've ran across some code duplication around the Media->Disk menu implementation.

This patch series factors out fdd-handling code out of the specplus3, beta, plusd, opus, and disciple implementations, and into a new generic "ui_media" framework. Essentially the back-ends specify what floppy drives they have, and the front-end takes care of insert, save, eject, and so on. Adding new peripherals with FDC should be much easier afterwards.

13 files changed, 823 insertions(+), 1529 deletions(-)

44 Attachments

Discussion

  • Alex Badea

    Alex Badea - 2013-08-29
    The following changes since commit 4c43ec194f82b39a00e6a0a0dc10b0d1cc7dd360:
    
      Fix length of data returned by READ_DIAG command (fixes bug #300) (thanks, Fred). (2013-08-19 22:32:49 +0000)
    
    are available in the git repository at:
    
      https://github.com/vamposdecampos/fuse-emulator-svn wip/ui-media
    
    for you to fetch changes up to 6189da19a417456fa90a3e2fcf8a3a9135497c1e:
    
      disciple: use ui_media API for updating menu items at reset (2013-08-29 10:34:27 +0300)
    
    ----------------------------------------------------------------
    Alex Badea (44):
          ui: add skeleton uimedia.[ch] sources
          uimedia: introduce ui_media_drive structure
          specplus3: register ui_media_drive info structs
          uimedia: add API for testing whether any drives are available
          ui media: introduce API for activating top-level menu items
          specplus3: use uimedia API for activating the top parent menu
          ui media: add info elements for sub-menu item IDs
          specplus3: define menu item IDs for ui media drives
          specplus3: store pointer to fdd_t object for uimedia drives
          uimedia: add API for updating submenu items based on fdd state
          specplus3: use uimedia API to update menu items
          ui media: add controller/drive index to info struct
          specplus3: define controller and drive indices for ui media info
          ui media: implement generic flip action
          specplus3: remove specific disk flip code
          ui media: implement generic writeprotect action
          specplus3: remove specific disk writeprotect code
          ui media: optimize checking for available drives
          specplus3: store pointer to disk_t object for uimedia drives
          ui media: add generic disk save API
          specplus3: remove specific disk saving code
          ui media: add generic disk eject API
          ui media: add API to eject all disks
          specplus3: remove specific disk eject code
          specplus3: add uimedia API to fetch fdd params
          ui media: add generic API for inserting disks
          specplus3: remove specific disk insert code
          ui media: define enum for media controller IDs
          specplus3: use named constant for controller index
          ui: declare an explicit constant for an invalid ui_menu_item
          ui media: use the new constant for invalid ui_menu_items
          beta: define ui media drives and register them
          ui media: add autoload hook function
          beta: remove specific disk code
          beta: use ui_media API for updating menu items at reset
          plusd: define ui media drives and register them
          plusd: remove specific disk code
          plusd: use ui_media API for updating menu items at reset
          opus: define ui media drives and register them
          opus: remove specific disk code
          opus: use ui_media API for updating menu items at reset
          disciple: define ui media drives and register them
          disciple: remove specific disk code
          disciple: use ui_media API for updating menu items at reset
    
     fuse/Makefile.am                 |    1 +
     fuse/fuse.c                      |    2 +
     fuse/machines/specplus3.c        |  281 ++++++--------------------
     fuse/menu.c                      |  158 +++------------
     fuse/peripherals/disk/beta.c     |  408 ++++++++++----------------------------
     fuse/peripherals/disk/disciple.c |  293 ++++++---------------------
     fuse/peripherals/disk/opus.c     |  292 ++++++---------------------
     fuse/peripherals/disk/plusd.c    |  293 ++++++---------------------
     fuse/ui.c                        |  170 +---------------
     fuse/ui/Makefile.am              |    3 +-
     fuse/ui/ui.h                     |    1 +
     fuse/ui/uimedia.h                |   90 +++++++++
     fuse/uimedia.c                   |  360 +++++++++++++++++++++++++++++++++
     13 files changed, 823 insertions(+), 1529 deletions(-)
     create mode 100644 fuse/ui/uimedia.h
     create mode 100644 fuse/uimedia.c
    
     
  • Sergio Baldoví

    Sergio Baldoví - 2013-09-01

    I've cloned the git repository (too lazy to download 44 files) and looks good to me. I've a minor suggestions about text messages...

    While inserting a new disk the former message prompts:
    Fuse - Insert +3 Disk A:
    and the actual message prompts:
    Fuse - Insert +3/Drive A:
    In my opinion 'Disk' word adds clarity over 'Drive', so a better message would be:
    Fuse - Insert disk in +3/Drive A:
    but widget UIs have a limited space in the title bar and decorations are overwritten.

    The same happens with the write operation. The former message prompts:
    Fuse - Write +3 Disk A:
    and the actual message prompts:
    Fuse - Write +3/Drive A:

    While ejecting a disk the former message prompts:
    Disk in drive A has been modified. Do you want to save it?
    and the actual message prompts:
    Disk in drive +3/Drive A: has been modified. Do you want to save it?
    IMO 'drive' word is redundant so a better message would be:
    Disk in +3/Drive A: has been modified. Do you want to save it?

     
  • Alex Badea

    Alex Badea - 2013-09-02

    Thanks for reviewing!

    The first two can be resolved by simply changing the strings in the drive definitions. There isn't much point in having the slash and "Drive" in there at this time, anyway.

    Would you mind if we use the same strings for the 3rd message as well? Then it would say,
    +3 Disk A: has been modified. Do you want to save it?
    (if not we can define separate strings for the "+3" and the "A:" portion, and the messages would be constructed either way)

    I'll cook up a (45th) patch for this. Let me know if you'd like me to respin the series and fold that into the relevant existing patches instead.

     
  • Fredrick Meunier

    It would be great if you could create a consolidated patch to make it easier to look at.

     
  • Fredrick Meunier

    Thanks, looks good to me too. Fuse uses C89 though so the array initialisation needs to be rephrased.

     
  • Alex Badea

    Alex Badea - 2013-09-04

    Sigh. I'll respin the series to address that, thanks.

     
  • Fredrick Meunier

    Thanks all, committed in revision [r5032].

     

    Related

    Commit: [r5032]


    Last edit: Fredrick Meunier 2013-09-08
  • Fredrick Meunier

    • status: open --> pending-accepted
     
  • Fredrick Meunier

    • Group: future --> v1.2
     
  • Fredrick Meunier

    • status: pending-accepted --> closed-accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks