I have managed to get the basic “cpu” operational after a bit of debugging and rewiring. I have also added some status leds for the A register (top of the picture) and a manual clock button so that I can program the instructions in peace and send a clock pulse to the registers when I am ready.
Now all I have to do is to decide what to do next, I have several things that needs to be done.
Add bitwise negation for a,b inputs and output to ALU.
Decide a bit length for the instructions and design the instruction set. I will go with either 8-bit or 16-bit instructions. It would be nice if all instructions could be done in one clock cycle as that would simplify the design.
Hook up rom and ram. I will have to purchase some premade sram, probably in the size of 8-16kb. Addressing will probably use A and B registers, Addr = A | (B << 8). And maybe some kind of direct addressing encoded in the instructions.
Instruction counter, either a dedicated circuit or program my Arduino to act as one.
Create a data bus for reading/writing to registers/ram.
Add status leds for the B register.
ALU continued … the CPU part 1
September 20, 2012
I have started to connect the instruction decoder and the two registers that are going to the form the main parts of the cpu.
All the necessary parts are on the board, I just have to connect them to each other.
September 19, 2012
Here is a nice picture of the ALU that I am building. It’s 8-bit and can add two number’s or do a bitwise and on them. I am going to add functionality to negate one or both inputs and/or the output, this was supposed to be included in this version but I made a mistake when ordering the parts and got the wrong gates for the input inverters.
The next step is to add two registers and an instruction decoder to this setup and this will leave me with a “cpu” where I can enter instructions manually and just use a button as the clock. I am also considering to program my arduino to act as rom, ram, instruction counter and clock until I order the next batch of parts.
Unnamed Space Shooter
June 23, 2011
Here are a couple of screen-shots from a Freespace like space shooter that I have been developing for the last six months. I am using Unity3d and C# to create the game. There is only one mission in the game at the movement but most of the features that I want are already there like complex objectives, including but not limited to destroy a specific group, protected a specific group, reach a point etc. All objectives can be time limited, start after a specific amount of time, depend on other objectives and more.
There are also multiple weapons both primary (lasers) and secondary (missiles), the player can active or deactivate individual lasers, multiple lasers can be active at the same time, and switch between available missile launchers. The missiles have target locking or they can be just simple fire and forget missiles.
I have also implemented some auto-piloting functionality such as automatic speed keeping either at full or half speed. Or the ability to match the speed of your current target, useful for pursuing someone while blasting them to pieces. There is also an afterburner that allows you to go slightly above the ships speed limit and accelerates faster than the ordinary engines.
The ship control itself is not realistic and is more like driving a car, I found this to be more fun than the realistic alternative.
Enough talk, here are the screen-shots, showing everything from the main menu to explosions to me getting shot at.
RymdspeletHD has been released!
January 23, 2011
I have just released the final version of my latest game RymdspeletHD, (that’s Swedish for “The Space Game HD”).
It’s your standard asteroids-like space shooter with a few nice features such as an online highscore and an upgrade system that let’s you upgrade your ship between levels.
The game is written in C++ with HGE. I have been working on it for about 12 months but the total amount of time spent is probably closer to 60 hours, not including the previous incarnations of the game.
It is made for Windows but it may work on Linux through wine.
I have embedded a video showcasing some gameplay, or you can watch it in hd here.
July 30, 2010
I just branched my standard shader into a special character shader that allows three areas to have different colors per mesh instance – skin, hair and eye color.
I have also modified the terrain shader to use gray-scale detail textures instead of color textures. This makes it possible to combine four detail textures into one texture, one for each channel, resulting in less texture fetches. I use a base color layer on the terrain to bring back the colors and the detail textures are also used as height maps to calculate a nice per pixel normal. All in all this saves a couple of texture fetches and quite a lot of texture memory as only two textures are used instead of 9 (1 base + 1 detail compared to 1 base + 4 detail color + 4 detail normal).
Continuing the conversation
July 1, 2010
Worked a bit more on the conversation editor. Line links can now be established and broken, the “l” button and the “b” button. Lines can also be moved up and down on the same level using the left and right buttons. And I also made it so that NPC responses are colored in red and links in violet.
There are also some more visual changes like icons for most of the buttons and the three main areas, the conversation list, the tree and the line editor can be resized.
Starting a conversation
June 30, 2010
I am working on a rpg in the style of Baldur’s Gate and Dragon Age. An important part in these kind of games is the conversation system. The conversations are not just simple one liners but they branch and repeat in various ways so it is important that the conversation system is flexible enough to handle all of this.
A conversation is a line that may have several lines or responses. It may also have an action script that is executed when the line is activated. There can also be a condition script and if it evaluates to true then the line is visible. This means that there can be several roots in a conversation and the one that is used is the first one whose condition evaluates to true.
A line can also be a link to another line which means that the conversation jumps to that line instead, this can be great for conversations that repeat.
I made an editor for this conversation system in C# and I will probably implement it in the actual game as soon as I have got the GUI up and running. I have attached a screenshot of the editor below.
May 19, 2010
The simple lexer and the complete parser was made using a parser combinator library called JSParse and it worked out fine except that it does not keep track of line numbers, columns or which parser that failed so it is really hard to get any good error messages. There were also a couple of bugs in the butnot-parser and in the caching for the choice parser. I managed to fix both of them and the functioning version can be found at our git repository.
We do not support type classes at the moment but we will most likely fix that in the two coming weeks as we really want them in the final presentation of the project.
I have also put up an online demo at http://hiji.tinyrocket.se that works in firefox and chrome but internet explorer remains untested. The demo has a small part of the standard prelude library the definition of which can be found here http://hiji.tinyrocket.se/hs/Prelude.hs
My name is Johan Gustafsson and I am a 23 year old software developer. I am currently working as a product manager and lead developer at Web Prefer.
My preferred tools and languages are C# and OpenTK for 3d development, C++ and Hge for 2d development and Php or Asp.Net for web development depending on the task at hand.