Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Figured I'd post some screenshots of my most recent gameboy game in development, it's been fun to code up and learn about Gameboy Colour forwards compatability so far
Intro Screens
Scrolling Game in action + collisions (sprite vs sprite and sprite vs bkg)
It's been a good challenge with getting scrolling and other things working but it's proven to be good fun and it runs nicely so far.
I'm pretty happy with where the game is and hope to have a finished version released shortly.
More details about my development progress can be found here:
http://refreshgames.co.uk/
Not sure why the images aren't coming out on here, looks to be formatted correctly though.. hmmmph, direct links below instead I guess?
https://www.refreshgames.co.uk/wp-conte … mes-gb.png
https://www.refreshgames.co.uk/wp-conte … -large.png
https://refreshgames.co.uk/wp-content/u … mateAI.gif
Last edited by rychan (2016-02-23 07:54:54)
Offline
looks great!
i will play this when it comes out
(source code would be great also!)
Offline
Aha, found the bugger in string.h aand my CPU usage has dropped by ~10% on the gameboy classic version, nice!
I wander if when I've got a bit further if I can get it to reference other track data dynamically (probably via pointers I'm guessing) to turn this around.
So far the game weighs in at 13kb so there's plenty of space available if I choose not to. But it just makes sense to do it for simpler scene management.
Offline
Managed to get a decent coding session underway last night and now the game is a lot tougher, damage reflects upon car performace, you can pseudo-explode if you take too much of it, cars can pass you back if you crash and I've got a fairly safe way to load multiple levels now. There's still a surprising amount left to do though, eep!
Offline
Got some more of the title sequence in the game now and I'm thinking about how to add some sorta Border for Super Gameboy features.
No docs in GBDK (aside from SGB detection) but I guess dipping into ASM would make this possible somehow? Any ideas would be appreciated. I've only done a lil bit of ASM on the VCS 2600 so far.
Offline
Right, got myself ASM functionality inside C all sorted out and access to super gameboy features, now to figure it all out tonight (hopefully) It's been fun!
Offline
Been away from the code for a while but back on to it tonight.
Linked the intro screens into the game and did a rough colour job on them for colour gameboy stuff.
Still unsure how to tackle SGB stuff though.
Offline
Orr maybe it won't have to wait after all.
I'm attempting to get my head around how to write ASM (which can be included inside GBDK, handy that) and have the following pseudocode
// sgb sound function
disable interrupts in GBDK
SET P14 and P15 to LOW?? (Looks like a value of 20 in decimal over here?)
Where are these located in the joypad register? 0xFF00 is just one address right?
nop for a moment [15us]
01000001 // FUNCTION 8-SOUND [5] - 1 PACKET [3]
00000001 // EFFECT A - NINTENDO NOISE ![8]
00000000 // EFFECT B - NONE[8]
11010000 // A PITCH[2], A VOLUME[2], B PITCH[2], B VOL[2]
00000000 // MUSIC SCORE CODE[8]
00000000 // REST IS UNUSED
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000
00000000 //OBLIGATORY BLANK BIT[8]
nop some more for 4 frames or ensure no other ops for 4 frames one way or another.
Can anyone shed some light on this or point me in the right direction? I'm confused as to where P14 and P15 would lie in memory, 0xFF00 is just a sinlge 8 bit value. Or am I missing something?
If I can figure out how to write something generic so it could be used inside gbdk by others that would be great, but have so far only done a lil bit of atari 2600 asm.
Offline
If I remember correctly there's a function in GBDK to send SGB commands, check the sgb.h file (or something). Try with that. But yes, P14 and P15 are the two writable bits of the P1 register (FF00).
Offline
hi, your games as far as i checked them (space invaders, and another one), don't use halt opcodes to wait. i think they run at unlimited framerate (so 200-300 fps or so).
it's proper/recommended to, when the frame is done, wait using halt, and to then do the next frame at the vblank interrupt, and read the joypad first thing after the start of the vblank, and have the joypad values then influence the immediate next frame.
if a game does not use halt opcodes, it will use up the gameboy's batteries unnecessarily fast, and emulators will use more CPU to emulate it. you can check the "CPU usage meter" in bgb's debugger, the green/amber bar on the right. if the game uses halt opcodes, it will be partially or mostly dark. if it's solid on/bright, the game is not using halt opcodes.
Offline
Thanks for the reminder beware, I'm using the vblank in this game to limit to 60fps, it's all quite the learning experience!
Will look through the sgb.h file again, thanks Antonio what exactly are p14 and p15 though?
Offline
The joypad hardware is just a matrix of 4x2 connections. 2 of them (P14 and P15) are outputs, the rest are inputs. The SGB uses the 2 outputs for command information because the CPU didn't have to be modified to be used this way, the 2 outputs from the CPU were already there, as well as the 4 inputs. http://bgb.bircd.org/pandocs.htm#joypadinput
Offline
Right, I think I'm getting somewhere now with my sgb code.
// INSIDE N ASM FILE - IS THIS 5 microseconds? Not sure how long NOP lasts for but I'm imagining not very long. .globl _paus _paus: NOP NOP NOP RET // INSIDE A ROMBANK in GBDK //SEND A COMMAND TO THE SUPER GAMEBOY - START *(char*)0xFF00 = 0; //BOTH DOWN paus(); *(char*)0xFF00 = 48; //BOTH HIGH paus();paus();paus(); for (i=0; i!=255; i++){ *(char*)0xFF00 = 16; // BIT 0 paus(); *(char*)0xFF00 = 48; //BOTH HIGH paus();paus();paus(); }
Does this look closer to something that might work? I imagine I could remove part of the delay to copy the replacement register value over from an array in the future. A whole bunch of zeroes ain't gonna do anything.
Offline
Why not simply use the timer interrupt?
Offline
It is crazily short, 5 microseconds, followed by 15 microseconds, then looped. With a long 4 frame delay between packets.
I've not done any development of late due to having to re-organize my home office into another room but hopefully should be back on it come sunday! I might put the SGB stuff on the backburner whilst I get some more of the main game ready. Might burn this onto a cartridge when it's finished though!
Offline
The game's coming along still, multiple tracks have been added, just gotta design them all 'n' test them out, very glad for the map editor! Also Started learning how to use fami tracker which I should be able to type over to a format for the gameboy.
Offline
As promised, here's a short video of the game with my plans on what to do next.
http://youtu.be/37pQAbWg6m0
Offline
This looks good so far!
Offline