Quick start with the Oberon RISC emulator
The only official documentation on this project is an implementation guide, and the short manual is not sufficient, and in some places it’s incorrect. Here is what I learned about using this system.
After you download the emulator from here, I suggest to edit the file src/sdl-main.c to change the colors and to make the texture crisp:
static uint32_t BLACK = 0x000000, WHITE = 0xAAAABB;
SDL_SetTextureScaleMode(texture, SDL_ScaleModeNearest); /* insert this after the creation of the texture */
After compiling, copy a default disk image somewhere and start the emulator with that copy. You’re in.
The keyboard input is limited, and the mouse keys are not supported. Position the cursor by left-clicking on text. Select text by holding the right mouse button.
While selecting, if you left-click while holding the right mouse button, the selected text will be deleted. If you middle-click while holding the right mouse button, the text will be copied to the position at the cursor.
If you left-click a scroll bar, the text will be scrolled down so that the clicked line is on the top. The reverse happens for right-clicking. A middle-click is equivalent to the usual behaviour of a scroll bar.
To move a view from one column to another, left-click and drag it, and click the middle mouse button while dragging.
Generally, to run a command, you middle-click its name. The command might read the text right after it, and you might need to terminate it with “~”. If there is a caret, the arguments are read from the currently selected text.
If you have a file Test.Mod, you need to type its name, then either select it or select its first character, and middle-click Edit.Open.
After you’ve written a Test.Mod file, you can either select its contents and run “ORP.Compile @”, or simply specify its argument in “ORP.Compile Test.Mod~”. Its public procedures, the ones marked with an asterisk and without parameters, will be available for use.
Sometimes, the compiler will fail, reporting something about a “symbol file”. To avoid this, remove the module from memory with “System.Free Test~”, then compile with “ORP.Compile Test.Mod/s ~”, where “/s” is a flag that does something with symbol files.
Try clearing a file with “Edit.Open Test.Mod~”, then using the Clipboard module to paste this text. Don’t forget to run “Edit.Store” in the viewer before compiling.
MODULE Test;
IMPORT Texts, Oberon;
VAR W: Texts.Writer;
PROCEDURE Hi*;
BEGIN
Texts.WriteString(W, "Hello, world!"); Texts.WriteLn(W);
Texts.Append(Oberon.Log, W.buf)
END Hi;
BEGIN
Texts.OpenWriter(W)
END Test.
System.Free Test~
ORP.Compile Test.Mod/s ~
Try middle-clickign this: Test.Hi
Look around the system by running “System.Directory *.Mod~” and, after copying the name of a module to the log, run “System.ShowCommands ^” on it.
The tedious process of compilation can probably be made easier with the MacroTool module. How? – I didn’t care enough to explore this far. Run System.ShowCommands on it. Open MacroTool.Mod to figure out how it works. Have fun.