MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / SetExpansionMemType

Function SetExpansionMemType

source/Memory.cpp:316–372  ·  view source on GitHub ↗

Called from SetExpansionMemTypeDefault(), LoadConfiguration(), RepeatInitialization(), MemLoadSnapshotAux(), SaveState.cpp_ParseSlots(), cmd-line switch

Source from the content-addressed store, hash-verified

314
315// Called from SetExpansionMemTypeDefault(), LoadConfiguration(), RepeatInitialization(), MemLoadSnapshotAux(), SaveState.cpp_ParseSlots(), cmd-line switch
316void SetExpansionMemType(const SS_CARDTYPE type, bool updateRegistry/*=true*/)
317{
318 SS_CARDTYPE newSlot0Card;
319 SS_CARDTYPE newSlotAuxCard;
320
321 // Set defaults:
322 if (IsApple2Original(GetApple2Type()))
323 {
324 newSlot0Card = CT_Empty;
325 newSlotAuxCard = CT_Empty;
326 }
327 else if (IsApple2PlusOrClone(GetApple2Type()))
328 {
329 newSlot0Card = CT_LanguageCard;
330 newSlotAuxCard = CT_Empty;
331 }
332 else // Apple //e or above
333 {
334 newSlot0Card = CT_LanguageCardIIe; // NB. No slot0 for //e
335 newSlotAuxCard = CT_Extended80Col;
336 }
337
338 if (type == CT_LanguageCard || type == CT_Saturn128K)
339 {
340 g_MemTypeAppleII = type;
341 g_MemTypeAppleIIPlus = type;
342 if (IsApple2PlusOrClone(GetApple2Type()))
343 newSlot0Card = type;
344 else
345 newSlot0Card = CT_Empty; // NB. No slot0 for //e
346 }
347 else if (type == CT_80Col || type == CT_Extended80Col || type == CT_RamWorksIII)
348 {
349 g_MemTypeAppleIIe = type;
350 if (IsApple2PlusOrClone(GetApple2Type()))
351 newSlotAuxCard = CT_Empty; // NB. No aux slot for ][ or ][+
352 else
353 newSlotAuxCard = type;
354 }
355 else if (type == CT_Empty) // NB. This sets global state depending on machine type
356 {
357 if (IsApple2PlusOrClone(GetApple2Type()))
358 {
359 g_MemTypeAppleII = CT_Empty;
360 g_MemTypeAppleIIPlus = CT_Empty;
361 newSlot0Card = CT_Empty;
362 }
363 else
364 {
365 g_MemTypeAppleIIe = CT_Empty;
366 newSlotAuxCard = CT_Empty;
367 }
368 }
369
370 GetCardMgr().Insert(SLOT0, newSlot0Card, updateRegistry);
371 GetCardMgr().InsertAux(newSlotAuxCard, updateRegistry);
372}
373

Callers 4

ParseSlotsFunction · 0.85
LoadConfigurationFunction · 0.85
RepeatInitializationFunction · 0.85

Calls 5

IsApple2OriginalFunction · 0.85
GetApple2TypeFunction · 0.85
IsApple2PlusOrCloneFunction · 0.85
InsertAuxMethod · 0.80
InsertMethod · 0.45

Tested by

no test coverage detected