<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Andale Mono";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>If I were you I would have started by looking at the newer graphics examples supplied with Project Oberon 2013 as a basis for porting the Fern example to the newer system. The bitmap in the original XYPlane code appears to have been used for dot-drawing optimisation that is no longer used (necessary?).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Chris Burrows<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>CFB Software<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>https://www.astrobe.com<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] <b>On Behalf Of </b>Hans Klaver<br><b>Sent:</b> Monday, 24 February 2020 10:45 AM<br><b>To:</b> ETH Oberon and related systems<br><b>Subject:</b> [Oberon] Static variable overflow (bug?)<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Recently I tried to implement XYplane.Mod from the book of Reiser & Wirth 'Programming in Oberon' for Project Oberon. Within Peter de Wachter's RISC emulator I ran into an overflow problem (leading to the remaining empty of the menu line of a viewer) that appears to be dependent on which disk image is used.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Otherwise my port works fine (produces the IFS fractal fern as expected). <o:p></o:p></p></div><div><p class=MsoNormal>For those interested I will post it to my github repository.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>A minimal module that can reproduce this menu problem can be found below.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>When starting the emulator in macOS as follows this problem occurs:<o:p></o:p></p></div><div><div><p class=MsoNormal style='background:black'><span style='font-family:"Andale Mono","serif";color:#F2F2F2'>$ ./risc --fullscreen DiskImage/Oberon-2019-01-21.dsk<o:p></o:p></span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>But the problem does NOT occur when starting thus: <o:p></o:p></p></div><div><div><p class=MsoNormal style='background:black'><span style='font-family:"Andale Mono","serif";color:#F2F2F2'>$ ./risc --fullscreen DiskImage/Oberon-2016-08-02.dsk<o:p></o:p></span></p></div></div></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I do understand that there is a limit to the use of static variables within the PO version of Oberon, but I would not expect this limit to be reached this easily, and I would not expect it to appear in newer versions of the software and not in older.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Does anyone have a clue where to look for the cause of this happening?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Hans Klaver<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>---------------------<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>MODULE MyViewer; <o:p></o:p></p></div><div><p class=MsoNormal>(* Test of the menu line of a viewer *)<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>IMPORT Display, Viewers, Oberon, MenuViewers, TextFrames;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>CONST <o:p></o:p></p></div><div><p class=MsoNormal> max = 16377; (* If max >= 16367 the frame name disappears; If max >= 16377 the whole menu line disappears! *)<o:p></o:p></p></div><div><p class=MsoNormal> menu = "System.Close System.Copy System.Grow"; <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>TYPE <o:p></o:p></p></div><div><p class=MsoNormal> XYframe = POINTER TO XYframeDesc;<o:p></o:p></p></div><div><p class=MsoNormal> XYframeDesc = RECORD (Display.FrameDesc) END;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>VAR bitmap: ARRAY max OF SET; (* with this variable present the menu may remain empty! *)<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>PROCEDURE Restore(F: XYframe);<o:p></o:p></p></div><div><p class=MsoNormal>BEGIN <o:p></o:p></p></div><div><p class=MsoNormal> Oberon.RemoveMarks(F.X, F.Y, F.W, F.H);<o:p></o:p></p></div><div><p class=MsoNormal> Display.ReplConst(Display.black, F.X, F.Y, F.W, F.H, Display.replace); (* clear *)<o:p></o:p></p></div><div><p class=MsoNormal>END Restore;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>PROCEDURE Handle(F: Display.Frame; VAR M: Display.FrameMsg);<o:p></o:p></p></div><div><p class=MsoNormal> VAR F1: XYframe;<o:p></o:p></p></div><div><p class=MsoNormal>BEGIN <o:p></o:p></p></div><div><p class=MsoNormal> CASE F OF XYframe:<o:p></o:p></p></div><div><p class=MsoNormal> CASE M OF <o:p></o:p></p></div><div><p class=MsoNormal> Oberon.InputMsg:<o:p></o:p></p></div><div><p class=MsoNormal> IF <a href="http://M.id">M.id</a> = Oberon.track THEN Oberon.DrawMouseArrow(M.X, M.Y) END |<o:p></o:p></p></div><div><p class=MsoNormal> Oberon.CopyMsg:<o:p></o:p></p></div><div><p class=MsoNormal> Oberon.RemoveMarks(F.X, F.Y, F.W, F.H); NEW(F1); F1^ := F^; M.F := F1 |<o:p></o:p></p></div><div><p class=MsoNormal> MenuViewers.ModifyMsg:<o:p></o:p></p></div><div><p class=MsoNormal> IF (M.Y # F.Y) OR (M.H # F.H) THEN F.Y := M.Y; F.H := M.H; Restore(F) END <o:p></o:p></p></div><div><p class=MsoNormal> END<o:p></o:p></p></div><div><p class=MsoNormal> END<o:p></o:p></p></div><div><p class=MsoNormal>END Handle;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>PROCEDURE Open*;<o:p></o:p></p></div><div><p class=MsoNormal> VAR F: XYframe; V: Viewers.Viewer; x, y: INTEGER;<o:p></o:p></p></div><div><p class=MsoNormal>BEGIN<o:p></o:p></p></div><div><p class=MsoNormal> NEW(F); F.handle := Handle; <o:p></o:p></p></div><div><p class=MsoNormal> Oberon.AllocateUserViewer(Oberon.Par.vwr.X, x, y); <o:p></o:p></p></div><div><p class=MsoNormal> V := MenuViewers.New(TextFrames.NewMenu("MyViewer", menu), F, TextFrames.menuH, x, y)<o:p></o:p></p></div><div><p class=MsoNormal>END Open;<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>END MyViewer.<o:p></o:p></p></div></div></div></div></body></html>