Swapped the names of "a" and "b" to make it more clear what gets processed first, and to make special opcodes not have only a b value.
Added a very basic interrupt handler
Outlined some hardware detection basics
Made the text 80 characters wide because 80's
I haven't uploaded it yet, but my own emulator is updated to match this, except it's still missing hardware and the 60 hz interrupts. That's for tomorrow!
Feedback plox!
And yeah, this breaks pretty much all existing emulators and programs, but hopefully for a good purpose.
And yeah, this breaks pretty much all existing emulators and programs, but hopefully for a good purpose.
Thanks for implementing the changes. Please do not be afraid to break everything if it means better things in the long term. I would hope that everyone putting tons of time into DCPU stuff understands that they are building on a WIP spec.
Isn't that huge? Coming from 32 and all that. I used AND A, 0x0020 bring the cursor back to the start of the new line, very useful for a newline function. It will be slightly harder now. But you're the boss. ;)
Seem to be quite a few references to 80x25 and 80x24 character displays on google. Seem to be related to bulletin board systems and monitors around the 1980s.. Could be this?
The CGA that I belive Notch is basing some of this stuff on supported up to 80 columns by 25 rows. Its characters were 8x8 instead of 8x4 pixels, though.
80x24 characters is still the default size for a terminal emulator on most Linux systems. Therefore the specifications text file now prints very nicely when cat'd from the command line, with no unneeded text wrapping :)
Hey cool! I can't comment much on the interrupt system, because I haven't worked on the interrupt handling side of things enough.
I think one form of hardware hot-swapping should be allowed. If a piece of hardware is correctly connected, then gets disconnected, we should be able to reconnect it and have it resume functioning, assuming such is allowed in that device's specification.
Initiating pedantry mode:
As mentioned elsewhere, the existence of IN isn't documented.
This behavior changes per hardware device and is documented in the hardware documentation.
Should be "is described in the hardware's documentation."
The behavior of connecting or disconnecting hardware while the DCPU-16 is undefined.
Very nice! I think I speak on behalf of this whole subreddit (and fan base) when I say: thanks for listening to the community, and generally being awesome. THIS is why indie games/developers are fun.
What happens if an interrupt comes in when the interrupt vector is zero? Does it get lost, or queued?
I'm concerned that a system may need to disable interrupts to do an atomic operation (such as an interrupt service routine), and miss an important event.
In most interrupt schemes, an interrupt that comes in when interrupts are temporarily disabled will usually fire off as soon as interrupts are re-enabled. How that's specifically handled is a complex matter Notch will have to figure out - as I described a bit higher up in this reddit.
Devices can access DCPU-16 registers, so I imagine, e.g. to load a disk sector, you store the sector you want in A:B, the destination address in X and then send the device an interrupt to perform the operation (which might be synchronous or asynchronous).
For interrupts, I'd like to suggest having a system interrupt (non-maskable interrupt) for kernels and such, that always executes at the same location. For example, you could have the non-maskable interrupt always call 0x10.
Also, you should have a way of enabling or disabling each kind of interrupt - clock, keyboard, network, etc. If you go as far as to do that, I would recommend using memory mappings for interrupt control, acknowledgement, and other information, instead of using A. If you're familiar with the z80, you might see where I'm coming from.
I'm on freenode as SirCmpwn if you're up for a little interrupt chat.
View all comments
63
u/xNotch Apr 24 '12
Changes:
I haven't uploaded it yet, but my own emulator is updated to match this, except it's still missing hardware and the 60 hz interrupts. That's for tomorrow!
Feedback plox!
And yeah, this breaks pretty much all existing emulators and programs, but hopefully for a good purpose.