GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - Hyper16 - a DCPU-16 emulator
View previous topic :: View next topic  
Author Message
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Tue Aug 09, 2016 5:26 am    Post subject: Development Log - Hyper16 - a DCPU-16 emulator Reply with quote

OK, so I decided to build another emulator a few months or so back, and i've started to make some appreciable progress on it. The emulator is for a fictional cpu spec, the dcpu-16, that was going to be in a game Notch was going to write some years ago. The game was cancelled eventually, I think is was a bit too ambitious. Heres some info: https://en.wikipedia.org/wiki/0x10c

Anyway, this is a good emulation target because it's simple. The main doc describing the cpu is only 200 lines long, although it's quite information-dense. I dumped it in my repo here: https://github.com/douglett/hyper16/blob/master/docs/dcpu-1-7.txt

My aim is to get the reference diagnostics program running properly. Right now, I get to the intro screen then crash out :). So, some work to do still. Heres some fun stuff:

Links:
source: https://github.com/douglett/hyper16
album: http://imgur.com/a/Wa4eE

Screenshots:




_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Mon Aug 15, 2016 7:00 am    Post subject: Reply with quote

It works, kind of! I had a problem with conditional skipping:



Next up, working on emulating more hardware - hardware timer, keyboard, and possibly floppy disk.

EDIT: this post isn't very informative i've noticed. I'm not sure how to describe what i'm working on very well, since there aren't any games or fun programs that will run just yet. Right now, i'm trying to make sure all the instructions are doing the right thing. This means making sure the debugger is showing the right stuff, and that all the test programs are matching the output of other emulators. Hopefully this project will be more fun to report on in the days to come :)
_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4965
Location: Silicon Valley!
PostPosted: Wed Aug 17, 2016 12:52 pm    Post subject: Reply with quote

Downloaded the source, but no idea how to compile this? Any instructions? :]
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Thu Aug 18, 2016 7:35 am    Post subject: Reply with quote

sonrisu wrote:
Downloaded the source, but no idea how to compile this? Any instructions? :]

Just hold on a bit and i'll provide binaries :). I just wanted to log my progress somehow as I make the thing useful. There is no keyboard support yet, but once thats in I can provide some example programs and stuff.

EDIT: for the record, I use my own build tool: https://github.com/douglett/dougmake . It's so half-assed, I'm amazed it works.
_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Tue Aug 30, 2016 2:12 am    Post subject: Reply with quote

Got hardware interrupts working last night! Generic clock is implemented:



Next up, keyboard support.
_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10663
Location: Canadia
PostPosted: Thu Sep 01, 2016 11:14 am    Post subject: Reply with quote

Neat. I've been in a hardware headspace lately, interfacing a YM2612 (Sega Genesis Sound Chip) with an Arduino, and a lot of fudging around with cheap Raspbery Pi-like computers (C.H.I.P's, Orange Pi's, and other things with AllWinner SOCs).
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Sat Sep 03, 2016 3:08 am    Post subject: Reply with quote

Hah cool, old technology is neat. Did you get it to play sounds?
_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10663
Location: Canadia
PostPosted: Sat Sep 03, 2016 10:05 am    Post subject: Reply with quote

I didn't unfortunately. I hit a road block, as even though the YM2612 has a built in ADC (Analag->Digital Converter), it needs to be amplified, and I don't yet trust what I've learned about building an amplifier. ;). Also it was outputting a constant 4 volts (should have been near zero), and that worried me. Sadly information about the wiring is scarce. I have a data sheet for the follow-up model, but it's in Japanese. ;)

As a consolation though, I made a device that monitors the moisture of my plants (see Arduino thread). At least putting what I learned last weekend to good use.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Mon Nov 14, 2016 5:13 am    Post subject: Reply with quote

Update:
I made it work and have been programming some stuff! Some larger programs don't seem to work all that well, I think because the spec changed a few times during development. Maybe I can get hold of some unit tests or something, we shall see. Some example programs are included.

I made a source code debugger too, which was quite useful. Much learning was needed for this part.

Still a work in progress, mostly it is hard to validate that my implementation is really correct. Some cross platform work is also needed.



Download:
http://totem9.net/projects/hyper16/hyper16_0.2.dmg (mac only, sorry!)
_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9364
Location: Not Finland
PostPosted: Mon Nov 14, 2016 5:25 am    Post subject: Reply with quote

Quote:

Still a work in progress, mostly it is hard to validate that my implementation is really correct.


This was something I put much thought into back when I was considering making my own 8-bit software CPU "for fun". I don't think I ever drew any real conclusions, to be honest, other than saying "this might be a pain."

Heh :)

I'm glad someone here is working on it. I love seeing this stuff.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
Ren
Contributor

Joined: 31 Aug 2005
Posts: 271
Location: London, England
PostPosted: Tue Nov 15, 2016 3:41 am    Post subject: Reply with quote

If the 'hardware' was popular enough to have some kind of community it would be easier to find all the edge cases, but most of that died out with 0x10c itself a few years back. If you were making your own fake-machine, whatever was in the reference implementation would become the defacto standard, so nothing to worry about :)
_________________
Avatar: Yu Suzuki (Virtual Fighter, Shenmue)
View user's profile Send private message Send e-mail Visit poster's website
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - Hyper16 - a DCPU-16 emulator
Game Developer's Refuge
is proudly hosted by,

HostGator

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.