Skip to content

Commit

Permalink
five years of minor fixes
Browse files Browse the repository at this point in the history
This sweeps up a number of small changes made since the 2008 wangemu 2.1
release.  Most of the changes were related to updating the code for
wxWidgets 2.9.4 back in 2012.  A few minor typos were also fixed along
the way.
  • Loading branch information
jtbattle committed Dec 31, 2014
1 parent 490ffb0 commit 9037765
Show file tree
Hide file tree
Showing 22 changed files with 455 additions and 268 deletions.
103 changes: 35 additions & 68 deletions build.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
============================================================================
Wang 2200 emulator build notes, v2.1
December 12, 2008
Wang 2200 emulator build notes, v2.2
December 27, 2014
============================================================================

The typical user of wangmu has no need to know any of this. However, if you
Expand All @@ -15,73 +15,42 @@ an explicit mouse-click-by-mouse-click cookbook.

1) Set up a modern C++ compiler

Install Microsoft Visual Studio Express 2008. It is free, it works well,
Install Microsoft Visual Studio Express 2010. It is free, it works well,
it has a great debugger. I will completely ignore the steps of downloading
it and getting it installed. Google is your friend.

Previous versions of WangEmu were built with MSVC++ 6. It is now more than
ten years old and it doesn't understand some features of modern C++,
such as defining constant static integers inside a class. Other compilers
may work just fine, but Visual Studio Express 2008 is what I use, and I
know it works for this project.
Other compilers may work just fine, but Visual Studio Express 2010 is
what I use, and I know it works for this project.

2) Get the wxWidgets library source code

Version 2.1 of WangEmu was build using wx version 2.8.9. If you download
Version 2.2 of WangEmu was build using wx version 3.0.2. If you download
a later version of wxWidgets, there are likely to be issues, as the wx
developers do tend to make a few backward-incompatible changes each
release. Release 3.0 will, no doubt, have even greater compatibility
issues.
release.

Go to http://www.wxwidgets.org/downloads/ and grab the wxMSW installer.

3) Unpack the wxWidgets source code

Personally, I override the default install location and instead unpack
it into C:\wx289 (for release 2.8.9). This isn't strictly necessary,
but future examples in this document assumes things were installed into
C:\wx289 . Adjust future comments if you install somewhere else.
it into C:\libs\wx-3.0.2 (for release 3.0.2). This isn't strictly
necessary, but future examples in this document assumes things were
installed into C:\libs\wx-3.0.2. Adjust future comments if you install
somewhere else.

4) Tweak setup.h (strictly optional)

I recommend you skip right to step 5. I include it here simply because
I want to report exactly what my setup is like.

wxWidgets has a master option configuration file called setup.h.
The default configuration will work fine for building the emulator.
Here are a few small changes I made to my setup.h.

cd C:\wx289\include\wx\msw

Bring up the file "setup.h" in your favorite editor.
I recommend you skip right to step 5, but if you want to tweak some of
the wx build features, like additional malloc debugging, now is the time
to do it.

This first change is because I don't care if my lib is backwards
compatible with version 2.6 of wxWidgets. Such features tend to be
removed in the next release of wxWidgets, and I want to be forward
looking as possible. Change this line:
cd C:\libs\wx-3.0.2\include\wx\msw

#define WXWIN_COMPATIBILITY_2_6 1
Edit the file "setup.h" to tweak whatever options you need. Only do
this if you know your way around wxWidgets. The stock setup.h will
work fine.

to become:

#define WXWIN_COMPATIBILITY_2_6 0

The other changes, to the wxUSE_* settings, allow for more informative
debug messages when memory leaks are detected at exit. Again, none of
these must be changed; I did to make debugging memory leaks a bit easier.
There are better solutions available, but this was sufficient for my needs.
Change these lines:

#define wxUSE_DEBUG_CONTEXT 0
#define wxUSE_MEMORY_TRACING 0
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0

to become:

#define wxUSE_DEBUG_CONTEXT 1
#define wxUSE_MEMORY_TRACING 1
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1

5) Build the wxWidgets library

The wxWidgets library may be built many different ways. I'll describe
Expand All @@ -90,30 +59,28 @@ an explicit mouse-click-by-mouse-click cookbook.
5a) Fire up the compiler
5b) File -> Open -> Project/Solution ...
5c) You are facing a file dialog box. Navigate over to where you
installed the wxWidgets code; in my case, this is C:\wx289.
Then drill down into build/msw. Select the file "wx.dsw".
This will allow building a static wxWidgets library.
It will likely tell you that this this project must be converted
for use with Visual C++ 2008 project format -- tell it OK to all.
5d) From the top level menu, select Build -> Batch Build ...
This allows building many libs at once.
5e) "Deselect All" and manually set checks to build all the "Debug" and
"Release" versions of the libraries. Doing so means you can later
build and run any of the demo or sample applications. However,
WangEmu uses only these three libraries: adv, base, core.
There is a single function in the emulator that requires the adv
library: UiMyAboutDlg.cpp makes use of wxHyperlinkCtrl. You can
cut the dependency down to just the base and core wx libs if the
USE_HYPERLINK define in that file is changed from 1 to 0.
5f) Hit "Build". The thing should grind for a while and build without
errors.
5g) Bonus points if you want to build and run any of the demo or sample
installed the wxWidgets code; in my case, this is C:\libs\wx-3.0.2.
Then drill down into build/msw. Select the file "wx_vc10.sln".
If you are using a different version of visual studio, pick the
.sln file with a name matching the compiler version you are using.
This step will allow building a static wxWidgets library.
5d) In the Solution Explorer pane, right click on the top level of the
heirarchy, "Solution 'wx_vc10' (23 projects)" in my case.
This displays a dialog of which sub-libraries should be built.
It only costs a bit of time and some disk space to build everything
(the default), but if you want to skimp, the Wang 2200 emulator
uses only the following sub-libraries: adv, base, core. Select
both debug and release versions of each of the libraries. Hit OK
to dismiss the dialog.
5e) Hit <F7> to build, or use the menu Debug/Build instead. The compiler
should grind for a while and build without errors.
5f) Bonus points if you want to build and run any of the demo or sample
applications. Note that most specify linking against a wide range
of wx libs, although not all are necessarily needed for a given
application. This is worth the effort to gain confidence that the
wx libs were built successfully. samples/minimal is the canonical
app to try, but demos/bombs is a lot more fun.
5h) Quit the compiler.
5g) Quit the compiler.

If you have difficulties doing this, try visiting the wxWidgets wiki.
As of November 2008, the right URL to start is this one:
Expand Down
6 changes: 6 additions & 0 deletions html/keyboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ <h2>Keyword Keys</h2>
</tr>
</thead>

<tbody>
<tr>
<td>A</td>
<td>HEX(</td>
Expand Down Expand Up @@ -442,6 +443,7 @@ <h2>Keyword Keys</h2>
<td>Z</td>
<td>SELECT</td>
</tr>
</tbody>

</table>

Expand All @@ -458,6 +460,7 @@ <h2>Keyword Keys</h2>
</tr>
</thead>

<tbody>
<tr>
<td>Ctrl+Z</td>
<td>CONTINUE</td>
Expand All @@ -477,6 +480,7 @@ <h2>Keyword Keys</h2>
<td>Ctrl+R</td>
<td>RUN</td>
</tr>
</tbody>
</table>

<p>
Expand All @@ -491,6 +495,7 @@ <h2>Keyword Keys</h2>
</tr>
</thead>

<tbody>
<tr>
<td>Alt+G</td>
<td>screen grab</td>
Expand Down Expand Up @@ -520,6 +525,7 @@ <h2>Keyword Keys</h2>
<td>Alt+Enter</td>
<td>toggle fullscreen mode</td>
</tr>
</tbody>

</table>

Expand Down
149 changes: 18 additions & 131 deletions relnotes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
============================================================================
Wang 2200 emulator release notes, v2.1
December 12, 2008
Wang 2200 emulator release notes, v2.2-pre
August 4, 2012
============================================================================


Expand Down Expand Up @@ -36,146 +36,33 @@ The emulator very well might run on Linux via Wine, but it hasn't been tested.

---- User-visible Changes ----

*) Added support for large, multiplatter disks and intelligent disk controller
logic. Thanks to Paul Sudzik for supplying the disk controller protocol
document and answering my questions as I implemented it.

*) Added ability to configure for 2200B CPU operation. Thanks to Eilert
Brinkmeyer for supplying the ROM images.

*) The printer can now optionally print to real parallel port (Windows only).
Thanks to Paul Heller for implementing this feature.

*) Each pair of drives on the status bar is preceded by a unit address label.

*) In the system configuration dialog, there is now a button that appears
after any card that has more detailed configuration options. Currently,
only the disk controller needs this button. It can be used to change the
number of drives associated with a disk controller, whether the controller
is dumb or intelligent, and whether to warn about certain situations.

*) The system configuration dialog now gives an indication if the
configuration is legal even before the OK button is pressed. Also,
if it is legal, it indicates if the change requires a virtual reboot.

*) The CRT window no longer flickers while it is being resized.

*) The disk icon tooltip for an occupied state is now multiline.

*) Right clicking on a disk icon on the status bar brings up a context menu.

*) The default font is now 2:1 dot matrix, instead of system 12 pt font.

*) Revamped the "About" box, inspired by the stock wxAboutBox dialog.

*) script.cpp and tokens.h were updated to include keyword escapes for
BASIC-2.

*) Menu items that don't make a lot of sense for non-primary CRTs were
removed.

*) Added a bit of margin around the text in the error code pop-up dialog so
the text wasn't flush with the window borders.

*) Moved the "show statistics" checkbox off the "Configure Screen" menu and
made it an item directly under the Configure menu.

*) The distribution now includes an updated version of the wang virtual disk
utility program, wvdutil.py. As the name suggests, this is a python
program, and to use it your system must have python installed. This
program was developed with python 2.5, but no exotic features were used,
so it is probably compatible with earlier versions of python, at least
back to 2.2 or so.
*) (M)VP systems can be configured to have 128 KB, 256 KB, or 512 KB,
in addition to the previously supported 32 KB and 64 KB. VP OS's
can't make use of any memory above 64 KB, though.


---- Bugs Fixed in this Release ----

*) Made some printer tweaks, including scaling issues (Paul Heller)

*) Fixed a bug where the user could request to open a file that didn't exist,
and it would cause a crash. wangemu now complains about it.

*) Under OS X, using the print preview feature caused some of the the printer
window's menus to get disabled after the preview is closed. It appears to
have been a wx library bug, as it works fine with wx 2.8.9.

*) Removed an assertion in the microcode engine that sometimes fired, yet it
wasn't preventing a real error. This would happen, for example, when
running the MEMORY and CPU tests together off the diagnostic disk. For
some reason the POS test would case a BCD add instruction with a "B"
operand that wasn't 0-9. It will still fire when the emulator is built
in Debug mode.

*) Fixed the error description table; "I95" was "195", for example.
*) The disk controller would assert if it received an unexpected value for
the first byte of the command sequence. Because GIO programs can send
anything at all, the assert was removed and the other values get mapped
to assume a VP or MVP host if the first byte isn't 0x00.

*) Fixed a couple small one time memory leaks when the emulator is configured
with multiple emulated display cards.
*) the "Disk/New Disk..." disk factory allowed specifying DS-112, DS-140,
or DS-224 disk drive types. These attempted to create disks with 65536
sectors/track, but this would cause an assertion, as 65535 is the maximum
sector address which can be specified with a 16b number.

*) Each time a disk controller card was selected or deselected, as often as
twice per sector operation, the emulator was reading the metadata from the
virtual disk file. this could pentuple the number of file accesses over
the minimum. That metadata is now accessed from a cache.
*) attempting to configuring a VP with 16 KB or 48 KB of RAM would trigger
an assertion. Now those sizes are disallowed.


---- Minor Tweaks and Implementation Changes ----

*) added build.txt to outline how to build the emulator from sources

*) added code.txt to outline the code structure of the emulator

*) Updated to wxWidgets 2.8.9 library

*) After 10 years, gave up MSVC++ 6 and switched to the free Microsoft
Visual Studio C++ 2008 Express Edition. Added a .vcproj file.

*) Converted the core emulator to use a class-encapsulated structure.
The new classes are Cpu2200t, Cpu2200vp, Host, Scheduler, ScriptFile,
System2200, SysCfgState, and Wvd.

*) Now using c++ libs instead of c libs;
got rid of lingering malloc/free code;
most uses of char* and wxString converted to std::string.

*) There was a large effort to rename files, classes, member functions and
variables in a consistent fashion.

*) Converted tabs to spaces in source files.

*) Added an application version resource file so that, under windows, viewing
the application's properties provides meaningful information.

*) Generalized the card addressing mechanisms to allow a single card to map
to more than one i/o address, which may be useful for disk controllers,
and in the future, multifunction cards.

*) Improved modeling of the track-to-track seek times of hard disks.

*) Obtained accurate sector interleave data for a few drive types, and fixed
the logical->physical mapping computation

*) Changed timeslicing to be driven from TheApp:OnIdle(), instead of the
previous clumsy way of hanging it off the primary CrtFrame.

*) Changed the emu to target 30 fps screen refresh rate instead of 60 fps.
This saves cycles without being noticeable.

*) Found that the screen drawing code got dramatically slower starting with
with wxWidgets 2.6.3. Code was added to try and generate the display image
via the rawbmp.h interface, but it wasn't faster. It was tracked down to
a code regression in the wx libraries. After reporting it, vz fixed it
for future wx releases. Meanwhile, this code implemented a work-around
for the stock 2.8.9 release.

*) Help/Website now links to www.wang2200.org instead of my personal page.

*) Reworked the fontmap generation code to be cleaner.

*) Now using wxStandardPaths to obtain dir and file configuration.

*) Changed screen refresh control when there are more than one emulated CRT.
*) compiled with the latest wxWidgets library release, 2.9.4

*) Got rid of never-used code to read ucode from an external file.
Microcode will only ever be compiled in.
*) fixed a typo in errtable.cpp for error 73;
it should read "SAVE DCF" instead of "SAVE SCF"


---- Known Bugs ----
Expand Down
7 changes: 4 additions & 3 deletions scripts/charset.w22
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CLEAR
10 DIM A$1
20 FOR R=1 TO 7
20 FOR R=0 TO 7
30 FOR C=0 TO 31
40 A=R*32+C:BIN(A$)=A:PRINT A$;
50 NEXT C:PRINT:NEXT R
40 IF R>0 THEN 50:IF C>15 THEN 50:PRINT " ";:GOTO 60
50 A=R*32+C:BIN(A$)=A:PRINT A$;
60 NEXT C:PRINT:NEXT R
Loading

0 comments on commit 9037765

Please sign in to comment.