Burger Time Hardware Information

SourceForge.net Logo

. Home . . Main CPU . . Sound CPU . . Ports . . Encryption . . Tiles . . Sprites . . Palette . . Rendering . . Full View . . Sourceforge Project Page .

Burger Time Hardware Information

Information acquired from MAME sources and various testing with my emulator, Breem

Games that utilize this hardware:

Basic hardware information:


Main CPU - btime, btime2, btimem
R/W Address Size Description
RW $0 $800 RAM
RW $C00 $10 Palette RAM
RW $1000 $400 Video RAM
RW $1400 $400 Color RAM
RW $1800 $400 Video RAM Mirror
RW $1C00 $400 Color RAM Mirror
R $4000 $1 Player 1 Input
R $4001 $1 Player 2 Input
W $4002 $1 Video Control
RW $4003 $1 DIP Switch 1 (read), Sound Command (write)
R $4004 $1 DIP Switch 2
R $C000 $4000 ROM
Main CPU - brubber, bnj, caractn
R/W Address Size Description
RW $0 $800 RAM
R $C000 $4000 ROM

Sound CPU
R/W Address Size Description
RW $0 $400 RAM
R $A000 $1 Sound Command
R $A001 $FFF Sound Command Mirror
W $F000 $1000 ROM

ports - main cpu:
	+-[ $4000 - player 1 input (read only) ]---------------+
	|                                                      |
	| xx?bdulr                                             |
	|    |||||                                             |
	|    ||||+--- right                                    |
	|    |||+---- left                                     |
	|    ||+----- up                                       |
	|    |+------ down                                     |
	|    +------- button                                   |
	|                                                      |
	| when a bit is set to 0, the button is pressed        |
	|                                                      |
	+-[ $4001 - player 2 input (read only) ]---------------+
	|                                                      |
	| xx?bdulr                                             |
	|    |||||                                             |
	|    ||||+--- right                                    |
	|    |||+---- left                                     |
	|    ||+----- up                                       |
	|    |+------ down                                     |
	|    +------- button                                   |
	|                                                      |
	| when a bit is set to 0, the button is pressed        |
	|                                                      |
	+-[ $4002 - coins/start buttons (read only) ]----------+
	|                                                      |
	| ba????21                                             |
	| ||    ||                                             |
	| ||    |+--- player 1 start button                    |
	| ||    |      0: pressed                              |
	| ||    |      1: not pressed                          |
	| ||    +---- player 2 start button                    |
	| ||           0: pressed                              |
	| ||           1: not pressed                          |
	| |+--------- coin slot a                              |
	| |            0: no coin inserted                     |
	| |            1: coin inserted                        |
	| +---------- coin slot b                              |
	|              0: no coin inserted                     |
	|              1: coin inserted                        |
	|                                                      |
	| nmi is generated on main cpu when a coin is inserted |
	|                                                      |
	+-[ $4002 - video control (write only) ]---------------+
	|                                                      |
	| ???????f                                             |
	|        |                                             |
	|        +--- flip screen (x and y are flipped)        |
	|                                                      |
	+-[ $4003 - dip switch 1 (read only) ]-----------------+
	|                                                      |
	| vchsbbaa                                             |
	| ||||\|\|                                             |
	| |||| | +--- coin a                                   |
	| |||| |       00: 2 coins = 1 credit                  |
	| |||| |       01: 1 coin = 3 credits                  |
	| |||| |       10: 1 coin = 2 credits                  |
	| |||| |       11: 1 coin = 1 credit                   |
	| |||| +----- coin b                                   |
	| ||||         00: 2 coins = 1 credit                  |
	| ||||         01: 1 coin = 3 credits                  |
	| ||||         10: 1 coin = 2 credits                  |
	| ||||         11: 1 coin = 1 credit                   |
	| |||+------- service mode                             |
	| |||          0: on                                   |
	| |||          1: off                                  |
	| ||+-------- show cross hatch                         |
	| ||           0: on                                   |
	| ||           1: off                                  |
	| |+--------- cabinet type                             |
	| |            0: upright                              |
	| |            1: cocktail                             |
	| +---------- vblank status                            |
	|              0: not in vblank                        |
	|              1: in vblank                            |
	|                                                      |
	+-[ $4003 - sound command (write only) ]---------------+
	|                                                      |
	| vvvvvvvv -- command                                  |
	|                                                      |
	| this value gets put into a latch, which is read by   |
	| the sound cpu when it reads $a000 or its mirrors.    |
	| after a write here, the sound cpu gets an irq        |
	|                                                      |
	+-[ $4004 - dip switch 2 (read only) ]-----------------+
	|                                                      |
	| ???pebbl                                             |
	|    ||\||                                             |
	|    || |+--- lives                                    |
	|    || |      0: 5 lives                              |
	|    || |      1: 3 lives                              |
	|    || +---- bonus life                               |
	|    ||        00: 30000 points                        |
	|    ||        01: 20000 points                        |
	|    ||        10: 15000 points                        |
	|    ||        11: 10000 points                        |
	|    |+------ enemies                                  |
	|    |         0: 6 enemies                            |
	|    |         1: 4 enemies                            |
	|    +------- end of level pepper                      |
	|              0: on                                   |
	|              1: off                                  |
	|                                                      |
	+-[ $4004 - screen control (write only) ]--------------+
	|								|
	| ???b?tnn							|
	|    | |\|							|
	|    | | +--- background map # to use			|
	|    | |	 00: first (0x000)				|
	|    | |	 00: second (0x100)				|
	|    | |	 00: third (0x200)				|
	|    | |	 00: fourth (0x300)				|
	|    | | 							|
	|    | +----- select first or second background bank	|
	|    |		 0: first bank				|
	|    |		 1: second bank				|
	|    |								|
	|    +------- enable/disable background			|
	|		 0: disabled					|
	|		 1: enabled					|
	|								|
	+------------------------------------------------------+

ports - sound cpu:
	+-[ $a000 - sound command (read only) ]----------------+
	|                                                      |
	| vvvvvvvv -- command                                  |
	|                                                      |
	| this is the value written to $4003 on the main cpu   |
	|                                                      |
	+------------------------------------------------------+

Encryption:

during a write, if the next opcode address has bits 2 and 8 set (0x0104), then the opcode needs decrypting. watch out for jsr, since it writes to the stack during execution you will need to check the address of the opcode that jsr jumps to and see if it has the bits set. to decrypt the opcode, change around the bits from 76543210 to 65342710.

here is what the variables are:

   addr = the address of the next opcode to be read
   tmp = the address of the current opcode
   mem = the real rom data being read
   cpumem[2] = a copy of the original rom data that is modified

here is code i used:

   addr = getnextopcodepc();
   tmp = getcurrentopcodepc();
   if(cpumem[2][tmp] == 0x20)
      addr = mem[tmp + 1] + (mem[tmp + 2] << 8);
   if((addr & 0x0104) == 0x0104)
      cpumem[2][addr] = ((mem[addr] & 0x13) | 
                        ((mem[addr] & 0x80) >> 5) | 
                        ((mem[addr] & 0x64) << 1) | 
                        ((mem[addr] & 0x08) << 2));


Tiles:

each tile is 3 bits each, the bits are seperated into 3 areas, to get bit x from an area, use the formula (n * s * b). n is the total number of tiles in the bank (see info section, it says how many tiles are in the banks), s is the size of one tile in bytes for one bit plane, like and 8x8 tile is 8 bytes, and 16x16 tile is 32 bytes. b is the bit you need to get, 0, 1, or 2.


Sprites:

there are 8 sprites, each sprite uses up 4 bytes, each byte is 32 bytes after the last one in video ram. starting at 0, then 32, 64, 96 for sprite 0, then 128, 160, 192, and 224 for sprite 1, etc etc. use this chart for each byte:

	+-[ first byte ]---------------------------------------+
	|                                                      |
	| ?????xy?                                             |
	|      ||                                              |
	|      |+---- flip x                                   |
	|      +----- flip y                                   |
	|                                                      |
	+-[ second byte ]--------------------------------------+
	|                                                      |
	| tttttttt -- tile to use from vrom bank 0             |
	|                                                      |
	+-[ third byte ]---------------------------------------+
	|                                                      |
	| yyyyyyyy -- y coordinate                             |
	|                                                      |
	+-[ fourth byte ]--------------------------------------+
	|                                                      |
	| xxxxxxxx -- x coordinate                             |
	|                                                      |
	+------------------------------------------------------+

Palette:

there is 16 palette entries for burger time. the upper 8 colors are used for only the background, the lower 8 are used for screen and sprites. to get r g and b values from each write, use this c code (i dunno how to explain this, its based on mame's anyway :P)

	value = ~value;
	r = (0x21 * ((value >> 0) & 1)) + (0x47 * ((value >> 1) & 1)) + (0x97 * ((value >> 2) & 1));
	g = (0x21 * ((value >> 3) & 1)) + (0x47 * ((value >> 4) & 1)) + (0x97 * ((value >> 5) & 1));
	b = (0x47 * ((value >> 6) & 1)) + (0x97 * ((value >> 7) & 1));

Rendering

Rendering the background:

Rendering characters:

Rendering sprites:


Support This Project SourceForge.net Logo Valid XHTML 1.1!

page generated in 0.475827 seconds