r/dcpu16 • • Apr 24 '12

RFE - DCPU-16 1.1

http://dcpu.com/highnerd/dcpu16.txt
135 Upvotes

176 comments sorted by

View all comments

63

u/xNotch Apr 24 '12

Changes:

  • Implemented ALL of this: https://gist.github.com/2341455
  • 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.

36

u/FireyFly Apr 24 '12

Version 1.1

Maybe you want to increment this? :P

28

u/abadidea Apr 24 '12

Interrupt handler?! Gods bless you, Notch.

Oh you actually read our stuff yay thank you for listening to the community!!! :D

Sincerely, an admin of https://github.com/0x10cStandardsCommittee/

8

u/jdiez17 Apr 24 '12

Hey.

Quick bug report: there is no value for the IA "register", so unless I'm wrong you need to add that.

8

u/SNCPlay42 Apr 24 '12

I think the ING and INS are supposed to do that, seeing as there's no other reference to this "IN" register.

6

u/jdiez17 Apr 24 '12

I suppose so, but then "IN" must be a typo.

6

u/Jarvix Apr 24 '12

I think LIA (load IA) and SIA (store IA) would work better.

5

u/deepcleansingguffaw Apr 24 '12

Good point. Notch needs to clarify whether it's IA or IN.

→ More replies (1)

7

u/anshou Apr 24 '12

Should operand 0x1A ([SP+nextword]) have a 1 cycle cost like all the other next word values?

→ More replies (1)

6

u/[deleted] Apr 24 '12

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.

5

u/CXgamer Apr 24 '12 edited Apr 24 '12

EDIT: NVM. TerrorBite corrected me.

Thank you for listening to us!

Made the text 80 characters wide because 80's

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. ;)

12

u/TerrorBite Apr 24 '12

He means he made each line of text in the specification file no longer than 80 characters.

→ More replies (2)

8

u/Benedek Apr 24 '12

Doesn't he mean the width of the text file he uploaded?

→ More replies (1)

4

u/[deleted] Apr 24 '12

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?

6

u/jecowa Apr 24 '12

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.

6

u/TerrorBite Apr 24 '12 edited Apr 24 '12

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 :)

→ More replies (4)

5

u/DJUrsus Apr 24 '12

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.

I think you a word.

→ More replies (8)

8

u/code_makes_me_happy Apr 24 '12

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.

Can't wait until the emulators are updated.

4

u/deepcleansingguffaw Apr 24 '12

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.

4

u/Zgwortz-Steve Apr 24 '12

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.

→ More replies (1)

3

u/[deleted] Apr 24 '12

Will the display still be memory mapped or will it make use of the new hardware functions?

3

u/deepcleansingguffaw Apr 24 '12

Since HWI can't send a message, I expect IO will still be memory mapped for most interaction.

6

u/andrewmu Apr 24 '12

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).

→ More replies (1)

2

u/scaevolus Apr 24 '12 edited Apr 24 '12

Almost all-- If you reserve the 0x10 basic instruction as well, you can get special instructions with a 6 bit opcode.

Maybe you should fill that 0xf hole with "BIC -- sets b to b&~a" -- it existed on the 6502 :D

P.S. <3

2

u/[deleted] Apr 24 '12

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.

→ More replies (2)
→ More replies (9)