mass:werk / Blog

(Posts tagged “software“.  All posts. RSS feed: Subscribe.)

Japanese Attractions: Kana on the PET 2001

The Japanese character ROM and keyboard come to the PET 2001 emulator.

Katakana on the Commodore PET 2001 (emulation)

Another update to the PET 2001 emulator, spefically, a tribute to Japan and its importance to home computing history in general, and its role for Commodore in particular.

Continue reading…

“The Abominable iPhone Zombies”
– A PETSCII Horror Doom Scroller

A new game for the Commodore PET, also, how to detect keyboards on a Commodore PET.

The Abominable iPhone Zombies, a game for Commodore PET

Rumors that I am might be writing a game (or is it a playable joke?) are not entirey unfounded. Also, another (maybe helpful) note on PET keybords and how to detect them.

Continue reading…

Funny Games on a PET 2001N (or B)

A curious case of jumper settings for PETs with the dynamic system board.

A semi-abstract title illustration

The curious tale of a PET, two jumpers, and some funny games…

Continue reading…

The PET 2001 Emulator Debugger

A visual tour.

Illustration for the PET 2001 emulation debugger article

So a few words on the debugger for the PET 2001 emulator: this is meant to help you around with 6502 machine code on the virtual PET, both for exploring existing software and testing your own code.

Be my guest on a visual tour…

Continue reading…

Shiny New 6502 Thing

New 6502 emulator feature: Instruction preview with resolved operands.

Screenshot of the 6502 emulator at masswerk.at/6502

A new feature for the 6502 emulator: Now, there’s an instant preview for the effects of the next instruction to be executed, with effective values and operands resolved.

E.g., given the following memory and register content,

$2004: $88
$0044: $04 ;<$2004
$0045: $20 ;>$2004
    X: $04

the emulator will show the following preview for the instruction `A1 40` or “LDA ($40,X)”:

A ⇐ $88

resolving the X-indexed addressing and showing the effective value, which will be assigned to the A register (accumulator).

Or, for an ASL instruction, it may show this (depending on the content of A):

A ⇐ C < |10001000| < 0

And, for the instruction `CE 04 20` or “DEC $2004”, it may show:

[2004] ⇐ $88 - 1

Thanks to this preview of the effective values, which will be actually used, complex behavior may be followed more easily and common errors, like forgetting “#” to mark up immediate operands in the assembler (and using zeropage mode instead — the dreaded “LDX $00”), should become pretty obvious.
(I’m not aware, whether there is prior art for this idea or not.)

And, by popular demand, there is now a “RST” button, sending a RESET signal to the emulator.

Try the 6502 emulator.

PET 2001 Dark Mode & Themed Range Sliders

Also, how to style range inputs using CSS, including accent colors.

Title illustration: dark mode control and slider elements of the PET 2001 emulator

So the PET 2001 emulator received a dark mode. This wasn’t exactly great news, nor worthy a blog post, if there wasn’t also something to be learned from every project. In this case, it’s about how to implement accent colors for custom styled HTML range-input elements, something, I haven’t found any hint on in the entirety of the Internet.

Continue reading…

PET Business

PET 2001 emulator up to business.

Yet another illustration, including a PET 2001

The PET 2001 emulator does now support the business keyboard!
While we prepared for this and hinted here at this in the past, we now proudly present a full implementation. — Select “ROM 4b” for BASIC 4.0 with a ”b” as in “business”…

CBM 2001/B computer

Update: Our humble PET, which has thus become a “CBM Series 2001/B Business Computer”, as well, isn’t limited to BASIC 4.0 with the business keyboard any longer, as you may now also select “ROM 2b” for BASIC 2.0 with a ”b” as in “business”.

PET 2001 Emulator: Option ROMs

Just to let you know, in case you were interested…

Yet another illustration, a drawing of a PET 2001 and puzzle pieces

A very brief update notice: Inching forward on the quest for feature creep, the PET 2001 emulator now supports ROM installation per drag&drop! See the description for details.

To add a bit of meat to this post, here are the ROM socket designators of the PET 2001:

There are no sockets for option ROMs on the boards of the original PET 2001s.
Moreover, as there is no socket for B000–BFFF, we’re out of luck regarding BASIC 4 and restricted to the old and new ROM versions of Commodore BASIC. (Of course, we can always directly access the address bus on the CPU and thus provide for extra ROMs, but on an unmodified machine we are restricted in our firmware options.) Notably, the sockets, there are, are for 2K ROMs, while later models featured sockets for 4K ROMs.

On the PET 2001N, the one with the “real” keyboard, and CBMs, there are sockets for the full complement, including D3 and D4 for option ROMs:

Finally, later PETs featured the following ROM socket designators:

*) reserved I/O space at E800–EFFF.

Fun fact:
In the handwritten schematics, ”D800” for H6 looks much like “0800” and “B000” for D5 much like “8000”.

PET 2001 Emulator + 6502 Updates

Yet another software update notification.

Yet another illustration

After the big spring rewrite for version 2.0 of the PET 2001 emulator, which brought things like sound, cycle accurate video rendering (we run all the newest demos without modifications!), a new CPU emulation, and even more features, like a built-in 6502 assembler, various context aware dissassembly and dump modes to allow a close inpsection of the internals, support for joystick input with emulatinon of various adapter schemes (including SNES gamepads), and other things more, I’m happy to announce a few further upgrades.

Recently, I rewrote the entire keyboard handling from scratch, which now provides faithful emulation of the PET’s original keyboard in ”Games Mode”. Which — as suggested by the name — should provide better support for games that bring their own keyboard scan routines. (Compare our last installment.) Now I added support for a virtual numeric keypad, which is both complementary and somewhat alternative to the keyboard joystick emulation (which reroutes cursor input to any selected joystick scheme, using the CPAS-LOCK as a modal toggle.) Moreover, I rewrote the ROM implementation, which now (a) transparently relates to ROM sets and Commodore product IDs of the individual ROMs, and (b) allows modular upgrades without redundantly including duplicate code.

Somehow things are dropping in place and are coming together for a feature still missing, namely, support for the business keyboard. As the PET’s business keyboard features both typewriter-style numerals on the top row of the keyboard as well as a separate numeric keypad, which comes with its own key codes, any kind of emulated keypad is strictly a requirement for this to be of any use in the era of laptops and reduced keyboards. (Some laptops come with a NUM-LOCK feature, but others, like MacBooks, don’t have any of this. Hence, it’s up to the emulator to provide for this.) As the business keyboard also comes with its own keyboard matrix, we’ll have to replace the editor ROM in order for this to work. Which is already provided for by the new ROM architecture.

Other, I’m happy to announce that the CPU emulation passes Klaus Dormann’s functional test suite for the 6502 and the extensive decimal mode (BCD) test, which is also true for the closely related virtual 6502 emulation. The virtual 6502 suite also saw the addition of a new member, a tiny hex-editor for quick hacks of 8-bit binaries and hex-dumps (with special support for Commodore 8-bit PRG-files). Moreover, these apps now enforce their unique window identifier, which should provide improved interoperability, when switching between them, regardless of where you came from or how you navigated there.

Well, that’s it, for this time, but there may be coming more….

Link Your Time

An Update to the previous update.

Screenshot of the international time zone conversion utility.

Last time, we presented our nifty international time zone conversion utility. Now it has become even better: once, you’ve set up the converter, you may link the current set up in order to share it. There’s a link near the bottom of the page, which will be always up to date. Just right-click it and copy. (This may be helpul for negotiating dates or meetings.)

Moreover, you may also preconfigure a link in order to see, what the current time (or a specific one) will be in certain locations / time zones. See the documentation on parameters at the bottom of the page for details.

Also, I’m finally working on sound for the PET 2001 emulator…

December Updates

Assorted site news.

Title illustration

It’s been a while since my last post — sorry (a more substantial post is a bit long in the tooth, but may appear soon) —, so it may time to quickly announce a few updates to the site.

Since it’s end of the year, which is also the traditional time to look for a calendar, there is now one at www.masswerk.at/time/calendar. Pick a year and print it out in order to show off that you really understand how days work! :-). We had this already at our time display, but now you can have an entire year of this! E.g., here’s a link to 2023, which happens to be next year. (Make sure to disable headers & footers and to enable backgrounds in your print dialog.) If you really don’t like the idea of the layout (how dare you?), you may also export a no-frills plain-text version.

Another update is also related to time, namely it’s an international time zone conversion utility. Which can be found at www.masswerk.at/time/convert.
Now, JavaScript (and by this, your browser) features localized dates with time zones, nowadays, but this only supports foward conversions from UTC timestamps to localized dates. This, however, also involves finding a corresponding UTC date to a given local date so that you can pick a date and time in one timezone and see what this may be in annother time zone. Which is, what this utility does. (Please mind the disclaimer. Especially mind that things become a bit tricky with DST/standard time crossovers and there may be more than a single UTC reference for a given localized time-date combination. E.g., when a local clock rewinds to 2:00 am at 3:00 am, once a year.)

Screenshot of the international time zone conversion utility.

This is what it looks like. Technically, we use our trusty TZIntl.js library for this. And thanks to this, this utility runs entirely on your local computer, in the browser, without connecting to an external service or leaking any data.

Links to both utilities can be found at the bottom of our fancy time display, which is always behind the tiny clock icon at the very end of the site navigation.

The final news is about the PET 2001 emulator:
First, the emulator now supports quantifiers in PETSCII escapes in any BASIC source file or pasted code, like "{4 SPACES}" or "{12 RIGHT}", which adds another layer of compatibility to some listings as may be found in traditional type-in code. (It may even come handy for designing screen output more comfortably.) The other one is a rather major one, but without much of an external effect: The emulator now supports varying ROM sizes, which means, it now also comes with ROM 4.0. However, the IEEE interface emulation still only supports LOAD and SAVE commands, so there isn’t much utility to the advanced disk commands of Commodore BASIC 4.0. Still, there is otherwise full support for ROM 4.0, including text-to-BASIC, BASIC-to-text imports and exports and even click-anywhere-on-the-screen-to-place-the-cursor functionality (AKA, “Touch Cursor”). I guess, still sufficient added capability to elevate the emulator to version 1.5.

Catching Up

Catching up on some software updates.

Illustation (abstract): generic announcement

Time to catch up on announcements…

Moreover, the Digital Library finally features Wittgenstein’s tractatus logico-philosophicus, which had been a safe bet for a candidate right from the beginning, because the unique proposition numbers of the tractatus and sequence numbers are a match made in heaven — or hell (you decide) — at least not at ground level. Diagrams are a bit difficult, though. (We have to admit, however interesting this may be, the inprint of punch card remains a somewhat questionable choice of media for literature.)

Digital Library Update

Expanding the catalog of questionable media for the sake of literature.

Logo: mass:werk Digital Library

Meanwhile, the mass:werk Digital Library has been busy expanding its catalog of nerdy presentations of famous works of literature. (The library currently has a focus on prototypical exponents of materialist philosophy, like Jane Austen.)

Virtual 6502 — Another Update

A few new features for the 6502 online disassembler.

Illustation: MOS 6502 MPU

Another update to the “virtual 6502” disassembler, which has obtained a few new features regarding symbol tables:

Moreover, all the “virtual 6502” apps now support input and output in “&…” hex notion to comfort those who were tragically mislead by the BBC (while MOS made it quite clear that is “$…”). ;-)
(Seriously, I’ve really the highest respect for the BBC Micro, which was an enormous achievement.)

By this, the disassembler looks much like feature-complete.

New Old Game: Gravi-o-roids!

Presenting a new old-school video game just a few years late, totally unironically.

Illustation: an arcade cabinet

Back in 2017, I was asking myself — like about every other person on Earth has done so before ;-) —, what would a Spacewar!-like game with multiple gravitational attractors look like? Would it even be playable? Well, time for an experiment.

Continue reading…

Virtual 6502 — Update Round 2

Another major update to the venerable “Virtual 6502” emulator – assembler – disassembler suite.

Illustation: MOS 6502 MPU

I may have been a bit unresponsive over the last few days, but there is a reason for this. Namely, I invested most of my available time into another round of updates to the “Virtual 6502” suite, consisting of an emulator of the MOS 6502 MPU, an old-school assembler, and a respective disassembler. And this has been a major round of updates. Suffice to say, I think these venerable programs, which had been a bit basic and even dated by now, do now for a competent little suite of programs.

+++ Updated for an even improved version of the disassembler. (June 25, 2021) +++

Continue reading…

More 6502 Updates

Further improvements on the Virtual 6502 suite.

Illustation: MOS 6502 MPU

Never at a loss to improve and always afraid to miss out on features or correctness ;-), I added another bunch of improvements to the Virtual 6502 suite.

This time, it has been about the emulator, which received a watchdog to monitor breakpoints and other conditions (like register contents or stack underflow), and support for interrupts. Also, stack operations in conjunction to the implementation of the break flag have been improved. (Moreover, all the applications now enjoy — hopefully as much as the user — fancy UI buttons and custom dialogs. Besides looking period appropriately pretty — this is sort of a sympathetic restoration —, these also provide some extended functionallity that is essential to some of these improvements, like the dialog for editing the watchdog’s conditions.)

In addition to this, the 6502 Instruction Set Sheet now features all kind of information on “illegal” opcodes: there’s now a checkbox below the instruction table to include them in the view, a new section with details on those undocumented instructions, and two three more decoding tables showing, where these fit in, and providing deeper insight into the internal operations.

I guess, next steps will be to implement support for these illegal opcodes for the emulator, assembler, and disassembler as an option.

An Update to the Virtual 6502 Suite

Improving one of the oldest 6502 tool sets on the web.

Illustation

The Virtual 6502 suite maybe the oldest 6502 tool set on the web still in existence. It may be also one of the earlier ones, at least, when I was doing it, I hadn’t found another one. Reason enough, to give these venerable web pages a bit of an update treatment.

Continue reading…

Copy & Paste for PET 2001

A quick update on the PET 2001 online emulator.

Title: copy & paste for PET 2001 emulator
The PET 2001 emulator just became even better.

The PET 2001 online emulator just received its first sponsored update, by this advancing to version 1.4. And this update is all about Copy & Paste integration. — TLDR version; have a look at the respective section in the online help, accessible via the “Help” button on top of the emulator’s page.

Continue reading…

meSpeak.js Update, v. 2.0.7

Text to Speech in JS, and a curious bug. Also, Safari desktop compatibility.

meSpeak Update 2.0.7

A curious bug, believed mitigated long ago, crept up again in meSpeak.js (an open source TTS for the Web in JavaScript maintained by me). On each 80th call, the internal eSpeak engine would crash on a round-off by one error. However, that error message never seemed right, as the abort message indicated a size of more than 1.8 GB for a relatively small and static internal file. Also, this didn’t happen on all browsers. A workaround was eventually found, where we would intercept this error, restart the engine, reload all relevant internal files and start over automatically.

However, this stopped working and the bug rose its head of rare, but questionable beauty once again. It doesn’t happen on all browsers, but, for me, it happens at least in current versions of Firefox. Even more, it seems to be a real Heisenbug, since the script exits on an “out of memory” exception on varying points depending on the specific version of the code. In the minimized production version, the code makes it to several debug messages before the final exit, in the unminimized test version, however, it exits on a different point, which renders intercepting that specific error a somewhat impractical endeavor. Also, the exception dosen’t depend on the length of the utterances spoken (thus suggesting that the “out of memory” exception isn’t caused by memory allocation of the actual code, but the result of cascading failures internal to the JS engine), it just happens on each 80th call of the method “speak()”, which triggers a run of the internal eSpeak engine. Which, on the other hand, provides a suitable point of access to an otherwise somewhat cryptic and inaccessible failure mode, namely, simply keeping track of the number of calls and automatically restarting the engine on every 80th call. (Mind that this may cause a small delay, but it’s still better than the script stalling on an uncatchable exception.)

Shout-out to Trent Murgatroyd for reporting the fault and testing!

This had actually been addressed in version 2.0.6, as of a few days ago (2020-04-17), already. But there was another issue, which had passed my radar, namely, the Safari desktop browser muting Web Audio on default. This is now addressed similar to how mobile devices are handled, by attempting to unlock audio on the first mousedown event occuring in the window. (Unlocking requires a direct user interaction. Hence, meSpeak.js must listen for a global user event. However, it neither blocks or consumes the event in any way, nor does it extract any data.) Additionally to this, meSpeak.js now also attempts to resume the audio-context on every call of the method “speak()” prior to playing any audio, in case it’s found in suspended state. (Again, this will be of any effect only, if the call was issued from code triggered by a user event. On the other hand, it doesn’t hurt trying.)

If you’re using meSpeak.js, please update: mespeak.zip?v=2.0.7.

PET 2001 Emulator — V. 1.1

Proudly announcing version 1.1 of the PET 2001 online emulator.

Commodore PET 2001 Emulator V.1.1 Announcement
Yet another PET 2001 related title illustration.

Version 1.1 of the PET 2001 online emulator features a totally revamped mounting and loading mechanism for files. For users this means full access to disk directories and LOADing programs from inside BASIC. For all the nerdy details and some hilarious insights into Commodore IEEE file loading (like, “Where on Earth — uhm, in memory — is the BASIC scondary device address?”) follow the link:

Continue reading…

PET 2001 Emulator — V. 1.0

Proudly announcing version 1.0 of the PET 2001 online emulator.

Commodore PET 2001 Emulator V.1.0 Announcement
Yet another PET 2001 related title illustration.

Recently, I’ve been posting on Commodore BASIC and more specifically about the PET 2001 quite a bit. While not the sole reason, this was partly because I was adding a few features to the PET 2001 online emulator behind the scenes. I even endeavored into a major reorganization of some of the source code in order to facilitate this and future work. And, last but not least, there’s now even a suitable help file / documentation. — Reason enough to promote the emulator from its previous beta state to version 1.0!

Continue reading…

Announcing meSpeak.js 2.0

Text to Speech in JS, now even better.

Announcing meSpeak 2.0

I am happy to announce a long planned for update to meSpeak.js, an open source TTS for the Web in JavaScript. This version brings some major update (and some minor discontinuities in API as well.) In a nutshell, meSpeak.js is the open source eSpeak program crosscompiled to JS using Emscripten (a minimal POSIX runtime to run LLVM compiler output in JS) running in the browser with some additional API glued on top. MeSpeak.js is based on speak.js, which has been an early demo application for Emscripten, but differs somewhat in architecture and features (like access to the entirety of eSpeak options, facilities for export and/or buffering of audio data, a built-in audio playback API, modular voice and language descriptions, etc) and also in compatibility.

Continue reading…

Instant PET: Commodore BASIC as Data-URL

mass:werk proudly presents: Running BASIC on a virtual PET 2001 from URL-data.

Network URLs for a virtual PET

So you want to show your friends a little BASIC program or want to solve some problem with (retro) style? Despair no more, since help is near…

More specifically, just a click away, at www.masswerk.at/pet, where you find my enhanced version of Thomas Skibo’s in-browser PET 2001 emulation. What’s new is an additional mode, where the emulator loads (and runs) a program from data encoded in URL-parameters — as provided either in the query-string or in the URL-fragment (hash). And you may use this for immediate execution in direct mode, as well!

Continue reading…

Legacy Graphics Range for Char8.js

The Terminals Working Group proposed a new Unicode range earlier this month (Jan. 4, 2019) for the purpose of retrocomputing and emulation. As of version 1.1, the newly proposed glyphs are already included in the Char8.js library for generating 8-bit characters from Unicode.

Here’s a sample, rendering the new glyphs in double height using a 16 × 8 character matrix:

The proposed legacy graphics range, rendered at 8 x 16 using Char8.js

The proposed range incorporates glyphs from various legacy systems, including

Related Links:

Snowflake: The Original Virtual Christmas Ornament

Snowflake for the PDP-1

It may be just the right season to remind of one of the first computer animations, “Snowflake” written in the 1960s for the DEC PDP-1. Despite various research efforts, the author of this amazing little program remains still unknown, which is quite a bity, since s/he deserves to be rembered along with the program.

Click the image for an emulation and/or have a look at some images of the real thing as hosted at the DigiBarn museum’s website.