News for hackers. Stuff that matters.
Re:Show HN: I'm building a game for the Nintendo GameBoy by readerrrr on Thursday August 14, 2014 @02:44PM (#8179086)
I have moved to the negative zone after trying the B button. :)

http://i.imgur.com/pkZhTCJ.jpg

The screens are positioned correctly next to each other.

----

Are you writing this in assembly?!

Re:Show HN: I'm building a game for the Nintendo GameBoy by BonsaiDen on Thursday August 14, 2014 @02:50PM (#8179133)
Yes, it's all written in z80 assembly, although the GameBoy CPU really uses a mix of i8080 and z80 instructions, the mnemonics are all z80. I've also written my own assembler just recently, to have more control over the output and more easily generate debugging information: https://github.com/BonsaiDen/gbasm
Re:Show HN: I'm building a game for the Nintendo GameBoy by harwoodr on Thursday August 14, 2014 @02:54PM (#8179156)
"my own assembler" - now you're just showing off. :)
Re:Show HN: I'm building a game for the Nintendo GameBoy by BonsaiDen on Thursday August 14, 2014 @03:02PM (#8179210)
Nah' I would only be showing off if I were to put it onto a real cartrdige and GameBoy, wouldn't I? ;)

- https://dl.dropboxusercontent.com/u/2332843/tuff.cartridge.j... - https://www.youtube.com/watch?v=yXNEeld8Lq8

Re:Show HN: I'm building a game for the Nintendo GameBoy by stevelosh on Thursday August 14, 2014 @03:16PM (#8179290)
If folks want to try it on a real Gameboy without all the wires, the Drag'n'Derp works pretty well. It's a Gameboy cart with a USB port for easy writing: http://derpcart.com/
Re:Show HN: I'm building a game for the Nintendo GameBoy by BonsaiDen on Thursday August 14, 2014 @03:40PM (#8179424)
I was looking at these option initially too, but ended up going for the challenge since, both I read some not-so-good reviews and shipping the thing to germany would probably ended up being at least as expensive as buying the soldering equipment :) Building one of those custom GamePaks takes about ~4 hours once you have all the materials prepared (you really need very, very thin wires!) and putting it together for the first time is one of those finger crossing moments which you'll remember for a really long time :)
Re:Show HN: I'm building a game for the Nintendo GameBoy by DanBC on Thursday August 14, 2014 @03:48PM (#8179464)
I took a cart, removed the game IC, and soldered in a ZIF socket for eproms. And I'm a klutz so it's easy enough.

http://www.devrs.com/gb/files/faq.html

Re:Show HN: I'm building a game for the Nintendo GameBoy by voltagex_ on Thursday August 14, 2014 @08:53PM (#8180557)
Am I right in thinking that GameBoy carts are now a precious resource? We'll run out one day?
Re:Show HN: I'm building a game for the Nintendo GameBoy by JonnieCache on Friday August 15, 2014 @08:01AM (#8181768)
Pretty sure you could make your own with a 3d printer and one of those kitchen PCB-etching setups you see people using. There's no magic in there AFAIK.
Re:Show HN: I'm building a game for the Nintendo GameBoy by ant512 on Friday August 15, 2014 @12:12AM (#8180993)
The Everdrive GB takes micro SD cards, so it has more space:

http://krikzz.com/index.php?route=product/product&product_id...

Re:Show HN: I'm building a game for the Nintendo GameBoy by phaer on Thursday August 14, 2014 @03:03PM (#8179216)
It sounds very advanced but an assembler for a rather simple architecture like z80 is much easier to write like most (other) compilers for example.
Re:Show HN: I'm building a game for the Nintendo GameBoy by ams6110 on Friday August 15, 2014 @11:30AM (#8182610)
Used to be a standard 2nd or 3rd year assignment in a comp. sci. curriculum. Not sure if it is anymore.
Re:Show HN: I'm building a game for the Nintendo GameBoy by jldugger on Thursday August 14, 2014 @05:10PM (#8179882)
When I was tinkering with gbdev 15 years ago, we had lcc targetting z80. It seems far less painful to write in C than asm.
Re:Show HN: I'm building a game for the Nintendo GameBoy by vegedor on Thursday August 14, 2014 @08:05PM (#8180448)
C is just an advanced macro-assembler anyway.

Would seem painful enough as soon as speed or size became limited. C then was not as optimized as today. Old games used to be written in assembler, now the eeproms are bigger, the compilers are faster and portable.

Re:Show HN: I'm building a game for the Nintendo GameBoy by glhaynes on Thursday August 14, 2014 @05:47PM (#8180036)
although the GameBoy CPU really uses a mix of i8080 and z80 instructions, the mnemonics are all z80.

I'd love to hear more about this if anybody knows and feels like telling about it...

Re:Show HN: I'm building a game for the Nintendo GameBoy by userbinator on Thursday August 14, 2014 @10:14PM (#8180763)
It's a Z80-like core with some modifications; not all the Z80 instructions and registers are present and some instructions are completely different. Most instructions are the same as the 8080, but all 3 CPUs are not completely binary-compatible. It's neither truly an 8080 with added instructions, nor a Z80 with omitted ones.

For comparison: http://pastraiser.com/cpu/gameboy/gameboy_opcodes.html http://pastraiser.com/cpu/i8080/i8080_opcodes.html

Re:Show HN: I'm building a game for the Nintendo GameBoy by tete on Thursday August 14, 2014 @04:44PM (#8179759)
Nice! Also nice that these days Assemblers get written in JavaScript. ;)
Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Thursday August 14, 2014 @04:53PM (#8179800)
Well, they used to be written in Basic as well, so given that JavaScript has apparently taken Basic's role....
Re:Show HN: I'm building a game for the Nintendo GameBoy by harwoodr on Thursday August 14, 2014 @02:53PM (#8179149)
Holy carp - he is writing it in assembly.

https://github.com/BonsaiDen/Tuff.gb/blob/master/src/core/co...

Nice.

Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Thursday August 14, 2014 @03:35PM (#8179402)
In what language do you imagine GameBoy games were written?
Re:Show HN: I'm building a game for the Nintendo GameBoy by adamman on Thursday August 14, 2014 @04:20PM (#8179636)
Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Thursday August 14, 2014 @04:49PM (#8179778)
C was a bloated language for targeting the Gameboy[0].

Only slowly after the 32bit became mainstream, did professional game developers started adopting C.

In the 8 and 16 bit days, C (and Pascal dialects) were viewed as C# and Java are nowadays for game development.

[0]Using my 80's developer hat.

Re:Show HN: I'm building a game for the Nintendo GameBoy by ido on Friday August 15, 2014 @05:46AM (#8181534)
Actually a lot of games are written in c# these days since that's what most unity developers use (and the other options are even less "lean").

I'd say c or c++ is only really standard in the AAA world, most casual/mobile/indie devs use higher level languages & engines (c#/unity, haxe, as3/flash, lua/corona, etc.)

Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Friday August 15, 2014 @08:29AM (#8181826)
I agree, that is why I smile every time I see the discussing of language X being too slow for game development, because of GC, bounds checking or whatever one comes up with.

As I am old enough to have lived through a few programming language generations accused of the same performance issues for game development, C included.

Re:Show HN: I'm building a game for the Nintendo GameBoy by crazypyro on Friday August 15, 2014 @10:36AM (#8182332)
To be fair, currently most of those tools involve low level linking to C code for performance-critical computations, no?
Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Friday August 15, 2014 @12:15PM (#8182832)
Actually C++, as most studios have moved away from pure C around the PS2 timeframe.

But the reason it is not always performance. Sometimes it is reusing already existing, battlefield tested proven code.

However, I can rephrase your question by replacing C with inline Assembly and we are back to the discussions I was having around 25 years ago.

Re:Show HN: I'm building a game for the Nintendo GameBoy by ekianjo on Thursday August 14, 2014 @10:54PM (#8180852)
Werent most Amiga and Atari ST games written in C though?
Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Friday August 15, 2014 @02:50AM (#8181228)
Surely not.

You need to do a lot of low level programming to target the custom sound and graphics chips those machines had available.

Not to mention that with 512 KB, every byte counted.

I cannot speak much for the Atari ST, as I was on the Amiga side of the bench.

The operating system was originally coded in Assembly and BCPL, with later versions having some C code as well(mostly K&R still).

Assembly and special game programming languages like AMOS, were the main programming languages for game developers on Amiga.

C was just another business programming language like C#, Java, Ruby and many others are today.

Mostly used for standard desktop software, or for doing the UNIX university projects at home.

Young developers take C's ubiquity for granted nowadays, but there was a time, when it was just yet another programming language.

Re:Show HN: I'm building a game for the Nintendo GameBoy by zedr on Friday August 15, 2014 @06:13AM (#8181573)
> it was just yet another programming language.

It was considered a high-level programming language.

Re:Show HN: I'm building a game for the Nintendo GameBoy by pjmlp on Friday August 15, 2014 @07:51AM (#8181754)
I have a few 80's books that refer to C as middle-level programming language.

High-level was already reserved for the likes of Lisp and Smalltalk.

Re:Show HN: I'm building a game for the Nintendo GameBoy by BonsaiDen on Thursday August 14, 2014 @04:29PM (#8179684)
That's a "recent" development though :) The original title back in the day were all written in assembly, you really have to squeeze out every single byte and cycle for something like Pokemon or Kirby.
Re:Show HN: I'm building a game for the Nintendo GameBoy by judk on Thursday August 14, 2014 @10:36PM (#8180811)
Pokemon is turn based with no AI, why would it need cycles?
Re:Show HN: I'm building a game for the Nintendo GameBoy by arcatek on Friday August 15, 2014 @02:51AM (#8181229)
Because softwares are not the only one to use cycles.

For example, in the GB, some memory space is only adressable during a few cycles, and so you have to optimize your code when you wish to update the video ram. If you miss the window, too bad.

Re:Show HN: I'm building a game for the Nintendo GameBoy by bane on Thursday August 14, 2014 @04:59PM (#8179828)
ASM isn't all that hard, just a little tedious once you understand the CPU architecture a little and the mnemonics. You can think of it like a low-level basic. ;)
Re:Show HN: I'm building a game for the Nintendo GameBoy by araes on Thursday August 14, 2014 @04:18PM (#8179625)
Cool, came here to report the exact same bug. Twitching, and doing the down smash eventually caused me to warp through the floor and initiate an endless fall into white nothingness. [Edit] After exploring some more, the extents of completeness are more obvious. I like the design style, and the art is very evocative. In terms of gameplay, there's a lot of blind jumps that basically end in death (spike and lava rooms to lower right). While I like the quick save mechanic with the light pillars, telegraphing those rapidly changing hazards might be less frustrating. Also, is it currently possible to get to the stuff up to the left?
Re:Show HN: I'm building a game for the Nintendo GameBoy by BonsaiDen on Thursday August 14, 2014 @04:47PM (#8179770)
It's probably not possible at this time. The whole map is just a giant demo level which evolved (and still is) along with the gameplay and other features (like spikes and lava).

I've got some rough sketches for the final world as well as the powerup placement, since there are no text boxes in the game, everything will be explained through level design or other hints like enemies or neutral creatures performing certain maneuvers for the player to imitate.

Re:Show HN: I'm building a game for the Nintendo GameBoy by joshu on Thursday August 14, 2014 @02:56PM (#8179163)
I got there too.