Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
articles:iicplus_merlin [2017/12/14 15:11]
M.G. [Fixing ROM 5X]
articles:iicplus_merlin [2017/12/14 19:07] (current)
M.G. [A Wild Bug Appears]
Line 5: Line 5:
 ===== A Wild Bug Appears ===== ===== A Wild Bug Appears =====
  
-Recently, ​a few members of the "Apple II Enthusiasts"​ Facebook group discovered ​a bug, seemingly in ROM 5X for the Apple IIc Plus:  The Merlin assembler, specifically the 128K versions 2.58 and 2.59, would crash at the main menu when ROM 5X was installed, but worked fine with the stock Apple ROM.+Recently, "Apple II Enthusiasts"​ Facebook group members Skander Ben Abdelkrim, Eric Leung, and Wyatt Wong reported ​a bug, seemingly in ROM 5X for the Apple IIc Plus:  The Merlin assembler, specifically the 128K versions 2.58 and 2.59, would crash at the main menu when ROM 5X was installed, but worked fine with the stock Apple ROM.
  
 This had me a bit perplexed, as I ran through possibilities in my head.  After booting a copy of [[http://​mirrors.apple2.org.za/​ftp.apple.asimov.net/​images/​programming/​assembler/​merlin/​Merlin-8%20v2.58%20%28ProDOS%29%20Disk%201-2.dsk|Merlin 2.58]] in an emulator and looking at its normal behavior, I had a place to start - the crash was happening immediately after the prompt was displayed at the main menu. This had me a bit perplexed, as I ran through possibilities in my head.  After booting a copy of [[http://​mirrors.apple2.org.za/​ftp.apple.asimov.net/​images/​programming/​assembler/​merlin/​Merlin-8%20v2.58%20%28ProDOS%29%20Disk%201-2.dsk|Merlin 2.58]] in an emulator and looking at its normal behavior, I had a place to start - the crash was happening immediately after the prompt was displayed at the main menu.
Line 169: Line 169:
 While there are other miscellaneous changes and code reorganizations around fixing this problem (they can be seen in the [[https://​github.com/​mgcaret/​rom4x/​commit/​d5969104cdca6fb3746e47080364c6deb2874f7b|commit]]),​ they are not centrally important to the problem we are fixing. While there are other miscellaneous changes and code reorganizations around fixing this problem (they can be seen in the [[https://​github.com/​mgcaret/​rom4x/​commit/​d5969104cdca6fb3746e47080364c6deb2874f7b|commit]]),​ they are not centrally important to the problem we are fixing.
  
-The main parts of the fix are as follows: ​ (Important note: The ROM in $Cxxx is *always visibleno matter what, there'​s no way to switch it out for RAM.)+The main parts of the fix are as follows: ​ (Important note: The ROM in $Cxxx is //always visible// no matter what, there'​s no way to switch it out for RAM.)
  
 Move the dispatcher bank switch out of the BELL1 routine to a few free bytes at $C7FC in the main bank and $C7FF of the aux bank: Move the dispatcher bank switch out of the BELL1 routine to a few free bytes at $C7FC in the main bank and $C7FF of the aux bank:
Line 208: Line 208:
 </​code>​ </​code>​
  
-We make use of the IIc Plus's existing routines to save and restore the language card state, and in between we call the ROM 5X dispatch, which executes the classic "air raid beep" that the Apple II line is known for.+We make use of the IIc Plus's existing routines to save and restore the language card state, and in between we call the ROM 5X dispatch, which executes the classic "air raid beep" that the Apple II line is known for.  In fact, this can be used to call any of the ROM 5X functions, now or in the future, and preserve the RAM state, provided we don't care about the contents of the A register.
  
  
Line 217: Line 217:
 There are plenty of programs that copy the ROM into RAM in order to modify it or make use of the routines in a non-standard memory configuration. ​ That's what's going on here. There are plenty of programs that copy the ROM into RAM in order to modify it or make use of the routines in a non-standard memory configuration. ​ That's what's going on here.
  
-Apple probably hit this problem early on in testing, perhaps noting an odd crash in a popular assembler.+Apple's engineers ​probably hit this problem early on in testing ​the IIc Plus, perhaps noting an odd crash in a popular assembler.