From 629679b94294ec3cff7575234fb52204166e6da4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 7 Mar 2019 15:03:15 -0500 Subject: [PATCH] Added discussion of media target. --- Porting-Guide.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Porting-Guide.md b/Porting-Guide.md index d094dcf..cc0d27a 100644 --- a/Porting-Guide.md +++ b/Porting-Guide.md @@ -137,4 +137,14 @@ _As per comments elsewhere, I'm still considering the ramifications of the type The best-effort updater, `Concurrency/BestEffortUpdater.hpp` is a helper class currently used by both the Mac and SDL ports, though it's entirely optional. It provides a thread-safe `update` method that can be called to request that 'more' emulation occurs. It will tell a delegate how long to run emulation for, but it will do so only if a call to the delegate isn't already happening. -So the scheme used by both ports is simply to call `update` any time that more output — video or audio — is required, on whichever thread it learns that. \ No newline at end of file +So the scheme used by both ports is simply to call `update` any time that more output — video or audio — is required, on whichever thread it learns that. + +## Inserting Different or Additional Media + +Use `Analyser::Static::GetMedia` to obtain an instance of `Analyser::Static::Media` for the file. E.g. if it's a single disc image, the piece of media returned will be a single disc. + +Grab the dynamic machine's `media_target()` if it provides one. Not all machines do — for example, there's nothing you can insert into a Master System once it's running. Call `insert_media` on the media target with the media object that the static analyser returned. Its return result will tell you whether the insertion was successful. + +_Commentary: the media target interface doesn't currently allow the caller to be more specific than merely 'insert this media', e.g. it isn't possible for a port to allow the user to select which drive they want to insert a disc image into. This primarily a relic of my desire not to provide a complicated UI. It's something I'd like to correct, however._ + +`Analyser::Static::GetMedia` will simply determine the type of the file and return the proper disk(s), tape(s) and/or cartridge(s). That piece of media is not bound to a specific type of machine — e.g. it's possible to insert any disk into any machine that has a disk drive, it just won't necessarily be something the drive can read. \ No newline at end of file