From b8e89af5940a676aff71d4f55f2cecbf91b39ee9 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Sat, 9 Sep 2017 10:08:06 -0700 Subject: [PATCH] Save game after initial character created, in case they quick. --- Platform/Apple/virtual/src/plasma/diskops.pla | 11 ++--------- Platform/Apple/virtual/src/plasma/gameloop.pla | 6 ++++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Platform/Apple/virtual/src/plasma/diskops.pla b/Platform/Apple/virtual/src/plasma/diskops.pla index 5842e82f..0092ac1f 100644 --- a/Platform/Apple/virtual/src/plasma/diskops.pla +++ b/Platform/Apple/virtual/src/plasma/diskops.pla @@ -224,8 +224,7 @@ def _rwGame(cmd)#0 end /////////////////////////////////////////////////////////////////////////////////////////////////// -def saveInternal()#0 - +def _saveGame()#1 // Never save corrupted heap mmgr(CHECK_MEM, 0) @@ -235,12 +234,6 @@ def saveInternal()#0 // Copy data to main memory, and write it out. memcpy(HEAP_BOTTOM, LOAD_SAVE_BUF, HEAP_SIZE) // LC to low mem _rwGame(RWTS_WRITE) -end - -/////////////////////////////////////////////////////////////////////////////////////////////////// -def _saveGame()#1 - showMapName("Saving game...") - saveInternal() return 0 end @@ -331,7 +324,7 @@ def importGame()#1 loadInternal() puts("\n Game imported.") reinsert() - saveInternal() + _saveGame() return TRUE fin puts("\n Not found.") diff --git a/Platform/Apple/virtual/src/plasma/gameloop.pla b/Platform/Apple/virtual/src/plasma/gameloop.pla index 67856228..814576a9 100644 --- a/Platform/Apple/virtual/src/plasma/gameloop.pla +++ b/Platform/Apple/virtual/src/plasma/gameloop.pla @@ -2091,7 +2091,6 @@ end /////////////////////////////////////////////////////////////////////////////////////////////////// // Called by scripts to display a string. We set the flag noting that something has been // displayed, then use an assembly routine to do the work. -// Also, clear the keyboard strobe, so the player has time to read the text. export def scriptDisplayStr(str)#0 if pIntimate pIntimate=>intimate_displayStr(str) @@ -2304,7 +2303,7 @@ export def removeFromList(pList, toRemove)#0 end /////////////////////////////////////////////////////////////////////////////////////////////////// -def saveMapPos()#0 +export def saveMapPos()#0 global->b_mapIs3D = mapIs3D global->b_mapNum = mapNum getPos(@global=>w_mapX, @global=>w_mapY) @@ -2516,6 +2515,8 @@ end /////////////////////////////////////////////////////////////////////////////////////////////////// def saveGame()#1 saveMapPos() + flipToPage1() + showMapName("Saving game...") loadEngine(MOD_DISKOPS)=>diskops_saveGame() returnFromEngine(TRUE) return 0 @@ -3126,6 +3127,7 @@ def startGame(ask)#0 allowZoneInit = TRUE initMap(q_x, q_y, q_dir) allowZoneInit = FALSE + saveGame() else q_mapNum = 0 restoreMapPos()