[ To achieve a more widespread response, this post has been duplicated at archlinux.org (my distribution's forum). ]
As a sort of toy to play with in recognition of old technology, I want to try my hand at writing a kind of emulator similar to an old Macintosh, except using simpler principles.
I want a fixed amount of video memory for a 320x200 or 512x384 (not sure which) 1-bit (b&w) display, and basic keyboard and mouse support. Nothing else.
From there, I want simple routines to be able to detect where the mouse cursor is and/or if the keyboard is being used, and from there flick bits on and off in the video array to form pictures.
I want this emulator to run between 500kHz and about 5MHz - that should get everyone doing some serious optimization
although I would of course let the emulator run at full host speed for testing/developmental purposes.
If all works well, I hope to build up enough awesomeness to get a basic GUI running, although nothing serious.
There's just a small issue: I'm not too sure how to do this. Of course, for this to be remotely authentic, I'd make a real CPU and an assembly language for it, but that's a bit (very large bit) over my head (although if I did that I could load the language onto an FPGA...
) so I was considering somehow using C and abusing dynamic libraries to get myself a "binary" file format.
The other issues are the CPU - how do I execute code at a set speed? - and mouse/keyboard event reporting. I have no idea how to do that, except for using interrupts, which is obviously out. And the screen is another issue - how do I refresh my "video memory"? At the end of each "CPU iteration" do I just run through the video memory area armed with (since I plan to use Xlib) XSetForeground() and XDrawPoint()?
So... input? suggestions? Thanks.
-dav7
As a sort of toy to play with in recognition of old technology, I want to try my hand at writing a kind of emulator similar to an old Macintosh, except using simpler principles.
I want a fixed amount of video memory for a 320x200 or 512x384 (not sure which) 1-bit (b&w) display, and basic keyboard and mouse support. Nothing else.
From there, I want simple routines to be able to detect where the mouse cursor is and/or if the keyboard is being used, and from there flick bits on and off in the video array to form pictures.
I want this emulator to run between 500kHz and about 5MHz - that should get everyone doing some serious optimization
If all works well, I hope to build up enough awesomeness to get a basic GUI running, although nothing serious.
There's just a small issue: I'm not too sure how to do this. Of course, for this to be remotely authentic, I'd make a real CPU and an assembly language for it, but that's a bit (very large bit) over my head (although if I did that I could load the language onto an FPGA...
The other issues are the CPU - how do I execute code at a set speed? - and mouse/keyboard event reporting. I have no idea how to do that, except for using interrupts, which is obviously out. And the screen is another issue - how do I refresh my "video memory"? At the end of each "CPU iteration" do I just run through the video memory area armed with (since I plan to use Xlib) XSetForeground() and XDrawPoint()?
So... input? suggestions? Thanks.
-dav7


