From vice-emu
Revision as of 14:29, 16 August 2018 by Compyx (talk | contribs) (Archdep Refactoring)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Archdep Refactoring


The current archdep code contains a lot of duplicate code that is spread over various directories and files. We currently have two directories inside src/arch/: src/arch/sdl for the SDL UI and src/arch/gtk3 for the Gt3k UI. These directories in turn contain files called archdep.c, archdep_amiga.c, archdep_unix.c, archdep_win32.c, etcetera. A lot of these files containing (near) duplicate code, some of these even #include'ing other .c files.

This is all far from ideal so the idea was formed to refactor the various archdep files: avoiding duplication as much as possible and moving the archdep code from the src/arch/gtk3 and src/arch/sdl directories into a separate directory.

New setup

The new setup is to have a directory src/arch/shared where archdep code is stored, creating a separate static library, currently called libarchdep.a. The public functions are now split into one .c file per function, hopefully resulting in easier to maintain and properly documented code.

This results in the following directory structure:

    src/arch/gtk3    -- Gtk3 UI code 
    src/arch/sdl     -- SDL UI code
    src/arch/shared  -- Architecture-dependent code, shared between Gtk3 and SDL