Ok, that was a bit of an underestimation of the required changes, but after 2 weeks of hard work I have something created which I dubbed the Virtual CBM.
It's not an emulator - there are more then enough very good emulators already out there, but basically it's an environment in which a Basic V2 program can run at full speed on your PC.
So there is no graphics modes, no sprites and no sound, no UDFs etc. but only pure Basic with PRINT commands!
While working on that environment I realized that most existing programs will at least peek and poke colors and characters, so I decided to make some sort of compatible environments available for the VIC and the C64:


I implemented the complete Basic V2 with the following exclusions:
CMD - not implemented
USR - not implemented
SYS - not implemented
DEF FN - not implemented
FileIO - not implemented (this regards OPEN/CLOSE/INPUT#/PRINT#/GET#)
NEXT var1,var2,... - not working -> use NEXT:NEXT:... or NEXT var1:NEXT var2:...
LOAD and SAVE are working, you need no device no as they simply ignore it and always use the current directory.
LOAD can be used with ,8,1 to load absolute
if load address<>basic start address this will simply load some data in virtual RAM for PEEK and POKE
LOAD"$" loads directory which can be shown with LIST as usual

Fullscreen editor is working, I didn't restricted the logical lines to 4 (for the VIC) or 2 (for the C64). So you can enter lines as long as you want but be aware that if you generate lines longer than 255 bytes they won't run on the original machines!
PEEK and POKE is working, but since there is no emulation of the VIC or VIC-II chips this only means that you can POKE some values into memory and read them back with PEEK .
Ok, that's not the complete truth, there are some locations which behave a little bit like the original:
- PEEK & POKE 646: foreground color
- PEEK & POKE 198: # of characters in keyboard buffer
- POKE 214 : set cursor row
- VIC: PEEK & POKE $900F for background and border colors
- C64: PEEK & POKE $D020 and $D021 for background and border colors
- C64: POKE 53265,PEEK(53265) AND 239 .... turn off screen display
- C64: POKE 53265,PEEK(53265) OR 16 ..... turn on screen display
VirtualCBM can be started with the following commandline parameters:
machine=VIC|C64
ram=unexp|unexpanded
trueemu=on|off (on=restrict integers to 16 bit, of=32 bit integers)
(case doesn't matter)
reals are always double precision floats from the .NET framework, so these CBM's have a higher precision than the originals!
Examples for start parameters:
a) VirtualCBM machine=VIC ram=UnExp TrueEmu=On -> start as VIC with screen and color RAM at unexpanded locations ($1C00 and $9800), integers are 16 bit
b) VirtualCBM machine=VIC -> start as VIC with screen and color RAM at expanded locations ($1000 and $9400), integers are 32 bit
c) VirtualCBM machine=C64 -> start as C64, integers=32 bit
If you simply start VirtualCBM without any parameter it starts in a true virtual mode which will be enhanced later, using 32 bit integers and (for the moment) screen, color RAM and VIC-II pokes like the C64.
As long as I can remember I missed the simple operating environment a Commodore offers. If I need a small program or a simple routine I don't want to start something like VB.NET, create a form, add textfields, buttons, add a listbox as a "scrolling screen" for my output and so on. It's so much easier to write a little Basic program which has some INPUT commands, some calculations and a PRINT at the end, maybe enveloped by a little loop.
This is the main reason behind VirtualCBM, my goal is to have an icon on my desktop so I have by a simple double click a complete nice Basic environment at hand for such tasks.
(And I will enhance that mode with more basic keywords and some sort of file I/O with text and binary modes etc.)
Nevertheless it is vital that the Basic Interpreter is doing it's job reliable so I decided to start with the VIC (and C64) environments as testbeds.
I finally managed to get my Videopoker to work beside the missing sound.
Oh, I nearly forgot, here's the link to the actual version of VirtualCBM :
http://www.stojalowski.de/VirtualCBM/VirtualCBM.NET.zip
After these two weeks I have to admit that I'm deeply impressed by the features of the Basic V2 Interpreter, trying to rebuild all this from scratch proved to be not an easy task, even with all the power and tools of todays hard- and software.
Wow, long post, that should be enough for now, maybe someone finds this useful or interesting enough to play with it - I would appreciate every form of feedback!