Crazy Driver (simple but complete game)

Announce (tech) demos or games releases

Moderator: Mask of Destiny

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Crazy Driver (simple but complete game)

Post by M-374 LX » Sat Aug 10, 2013 2:26 pm

Crazy Driver is a simple homebrew driving game for Sega Genesis written mostly in C. Ports to Game Boy Advance and PC are also planned.

Gameplay
As the name suggests, you are a crazy driver in this game. All you want is to drive fast!

Crazy Driver is a simple driving game where you only need to avoid crashing into other cars. By driving faster, you get a higher score.

Controls
D-pad left/right: steer
A/B/C: accelerate like crazy!
Start: pause

Technical side features
•Usage of sprites and VDP planes A and B
•Vertical scrolling
•FM sound effects
•Music using FM, DAC samples and PSG

Screenshots
Image
Image

Video
This video shows the game running on the real hardware: http://www.youtube.com/watch?v=m-ydfPYw-jk

Download
v1.1: Link
v1.0: Link
Source code included in both links.
Last edited by M-374 LX on Wed Sep 18, 2013 11:06 pm, edited 3 times in total.

User avatar
sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Sat Aug 10, 2013 3:00 pm

Nice!! Thank you for your work

haroldoop
Very interested
Posts: 99
Joined: Sun Apr 29, 2007 10:04 pm
Location: Belo Horizonte, MG, Brazil

Post by haroldoop » Sat Aug 10, 2013 8:22 pm

Nice game.

nolddor
Very interested
Posts: 101
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Post by nolddor » Thu Aug 22, 2013 1:17 pm

how many levels are the game?

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX » Thu Aug 22, 2013 10:48 pm

nolddor wrote:how many levels are the game?
The level number is stored as a byte. As a result, the level number could be up to 255 and wrap back to 1.

However, the last playable level in my tests was around 20.

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX » Tue Sep 03, 2013 7:47 pm

I have finally had the opportunity to test the game on the real hardware.

The PSG notes are fine in the music, but random FM notes are played instead of the desired ones. Besides, the engine sound effect can be heard sometimes, but not always, and the crash sound effect seems to be never heard. Does anyone know why this happens?

Chilly Willy
Very interested
Posts: 2493
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Sep 03, 2013 9:11 pm

Probably not waiting long enough after setting the FM register. You really should wait on the BUSY bit in the FM status.

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX » Tue Sep 03, 2013 9:49 pm

Here are some of the functions related to the audio:

Code: Select all

void z80_halt()
{
	volatile ushort* z80 = (ushort*)Z80_RESET;
	*z80 = 0x100;

	z80 = (ushort*)Z80_BUSREQ;
	*z80 = 0x100;

	while(*z80 & 0x100);
}

void fm_write(uchar reg, uchar val, uchar part)
{
	volatile uchar* ctrl;
	volatile uchar* data;

	if(part == 0)
	{
		ctrl = (uchar*)FM_REG_1;
		data = (uchar*)FM_DAT_1;
	}
	else
	{
		ctrl = (uchar*)FM_REG_2;
		data = (uchar*)FM_DAT_2;
	}

	while(*ctrl & 0x80);
	*ctrl = reg;

	while(*ctrl & 0x80);
	*data = val;
}
Is anything wrong?

Chilly Willy
Very interested
Posts: 2493
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Sep 04, 2013 3:15 am

Yes - according to Sega, you must NEVER use the second part (as you call it) for reading the status. It will return not busy even when it is. ALWAYS read the status from the first part (0x4000). That's in the same bulletin as where they mention that the VDP isn't reset by the reset, so you have to check for DMA on reset before trying to use it or it may fail.

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX » Wed Sep 04, 2013 4:16 pm

The audio on the real hardware is fine now. Thanks, Chilly Willy.

However, according to the Genesis Technical Overview document, the status of the YM2612 can be read from "any of the four locations". This seems to be another mistake in that document.

User avatar
TmEE co.(TM)
Very interested
Posts: 2286
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Sep 04, 2013 5:05 pm

I has been verified that status register is read from all addresses by other people and Yamaha OPN family docs also say that. Maybe there's more to the address decode that it seems on the MD around YM...
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2493
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Sep 04, 2013 5:31 pm

TmEE co.(TM) wrote:It has been verified that status register is read from all addresses by other people and Yamaha OPN family docs also say that. Maybe there's more to the address decode that it seems on the MD around YM...
Must be something to do with the Sega... maybe this is only an issue on models with the built-in FM rather than the discrete FM. If someone has a model with the separate YM2612, they could try the older version to see if it still has sound problems. But Sega's note on the FM is in response to an issue just like this one - "missing" or bad sounds, and is specifically stated to be the result of missing the busy status by reading the "wrong" register and getting a bad status.

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX » Wed Sep 18, 2013 6:10 pm

A new version is now available. It features new music, now using DAC samples. Also, the audio issues on the real hardware and the bug that caused the game to run faster have been fixed.

I would like to thank Chilly Willy, who is now in the "Thanks to" section of the credits.

Chilly Willy
Very interested
Posts: 2493
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Sep 18, 2013 10:59 pm

No problem, but the facebook link requires you to be logged into facebook... and I'm not a fb member.

M-374 LX
Very interested
Posts: 60
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

Post by M-374 LX » Wed Sep 18, 2013 11:07 pm

Chilly Willy wrote:No problem, but the facebook link requires you to be logged into facebook... and I'm not a fb member.
Wrong link. :oops:
It is now fixed.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest