Generalize rom loading
OFFTKP opened this issue · 3 comments
More of a TODO that I will list here.
Create a template "LoadRom" function in emulator_factory.h
that takes the emulator type as a template argument and an Emulator*, checks for nullptr and loads a rom to the emulator, and the correct variables based on a template specialization.
Delete Display::load_rom
.
Disassembler and tracelogger and any other tool should not be loaded like that.
Instead, call the emulator_factory functions, and maybe add other functions that load up the disassembler and tracelogger (or set them to nullptr if selected emulator doesn't use those)
Remove ptrs to base_disassembler/base_tracelogger and remove those classes in general
Instead, make an array of std::unique_ptr. Each of those must also include a "menu item" function. Call all of the menu item functions from the vector so it's easier to add applications in the future.
If the base_ classes are removed (optimal), emulator_factory
should populate the std::vector<std::unique_ptr<IMApplication>>