Closed iflan closed 1 year ago
Sorry I haven't had a chance to look more closely at this, but one thing to consider is that the //e language card logic is a clone of the the code in cards/language, so it might be necessary to update that too? Possibly we should consolidate that logic somewhere?
Good point. There is code in cards/langcard.ts
that does the same thing and has the same bug. I'll try to fix that and add a test as well. It's likely that we can consolidate the logic, but I'll do that in another future change.
OK—the latest commit fixes the language card on the Apple II as well. In both cases, the test that repros the bug report in #187 fails unless the fix is applied.
Weirdly, this works with npm 8.x, (which I had on my machine) but fails with npm 9.x (which is on the machine hosting scullinsteel.com):
pm ERR! Could not resolve dependency:
npm ERR! peer jest@">=20 <=27" from jest-image-snapshot@4.5.1
npm ERR! node_modules/jest-image-snapshot
npm ERR! dev jest-image-snapshot@"^4.5.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: jest@27.5.1
npm ERR! node_modules/jest
npm ERR! peer jest@">=20 <=27" from jest-image-snapshot@4.5.1
npm ERR! node_modules/jest-image-snapshot
npm ERR! dev jest-image-snapshot@"^4.5.1" from the root project
I will try to update jest-image-snapshot
and see what happens.
Updating jest-image-snapshot
resolves that. We were a couple major versions behind but I did't encounter any issues updating.
Before,
mmu.ts
andcards/langcard.ts
would deactivate writing to the language card ifprewrite
was reset. However, it is totally possible to resetprewrite
and leave writing enabled, as shown my Sather in Understanding the Apple II, table 5.4, p. 5-30, and Understanding the Apple IIe, table 5.5, p. 5-24. For example:would not work correctly because the last line would clear
_writebsr
before setting_prewrite
, which is incorrect.Now,
_writebsr
is only set when_prewrite
is set and thus only cleared whenwriteSwitch
is false.There is also a new test for the
MMU
andLanuageCard
classes.