Previous 15994 Revisions Next

r9162 Saturday 18th September, 2010 at 06:47:28 UTC by R. Belmont
[GBA] Compiles and runs again with latest intelfsh; flash saving not actually working yet.
[src/mess]mess.mak messdriv.c
[src/mess/drivers]gba.c
[src/mess/includes]gba.h

src/mess/includes/gba.h
r9161r9162
11#ifndef _GBA_H_
22#define _GBA_H_
33
4#include "machine/intelfsh.h"
5
46#define DISPSTAT_VBL         0x0001
57#define DISPSTAT_HBL         0x0002
68#define DISPSTAT_VCNT         0x0004
r9161r9162
183185
184186   UINT32 gba_sram[0x10000/4];
185187   UINT8 gba_eeprom[0x2000];
186   UINT32 gba_flash[0x20000/4];
187188   UINT32 flash_size;
188189   UINT32 flash_mask;
190   intelfsh8_device *mFlashDev;
189191   int eeprom_state, eeprom_command, eeprom_count, eeprom_addr, eeprom_bits;
190192   UINT8 eep_data;
191193
src/mess/messdriv.c
r9161r9162
6565   DRIVER( gbpocket )  /* Nintendo Game Boy Pocket Handheld */
6666   DRIVER( gblight )   /* Nintendo Game Boy Light Handheld */
6767   DRIVER( gbcolor )   /* Nintendo Game Boy Color Handheld */
68//   DRIVER( gba )       /* Nintendo Game Boy Advance Handheld */
68   DRIVER( gba )       /* Nintendo Game Boy Advance Handheld */
6969   DRIVER( snes )      /* Nintendo Super Nintendo NTSC */
7070   DRIVER( snespal )   /* Nintendo Super Nintendo PAL */
7171   DRIVER( snessfx )   /* Nintendo Super Nintendo NTSC w/SuperFX CPU*/
src/mess/mess.mak
r9161r9162
11721172   $(MESS_MACHINE)/pokemini.o   \
11731173   $(MESS_DRIVERS)/pokemini.o   \
11741174   $(MESS_DRIVERS)/vboy.o      \
1175#   $(MESS_DRIVERS)/gba.o      \
1176#   $(MESS_VIDEO)/gba.o      \
1175   $(MESS_DRIVERS)/gba.o      \
1176   $(MESS_VIDEO)/gba.o      \
11771177
11781178$(MESSOBJ)/nokia.a:            \
11791179   $(MESS_DRIVERS)/mikromik.o   \
src/mess/drivers/gba.c
r9161r9162
21152115
21162116   rv = 0;
21172117   offset &= state->flash_mask;
2118   if (mem_mask & 0xff) rv |= intelflash_read(0, offset*4);
2119   if (mem_mask & 0xff00) rv |= intelflash_read(0, (offset*4)+1)<<8;
2120   if (mem_mask & 0xff0000) rv |= intelflash_read(0, (offset*4)+2)<<16;
2121   if (mem_mask & 0xff000000) rv |= intelflash_read(0, (offset*4)+3)<<24;
2118   if (mem_mask & 0xff) rv |= state->mFlashDev->read(offset*4);
2119   if (mem_mask & 0xff00) rv |= state->mFlashDev->read((offset*4)+1)<<8;
2120   if (mem_mask & 0xff0000) rv |= state->mFlashDev->read((offset*4)+2)<<16;
2121   if (mem_mask & 0xff000000) rv |= state->mFlashDev->read((offset*4)+3)<<24;
21222122
21232123   return rv;
21242124}
r9161r9162
21312131   switch (mem_mask)
21322132   {
21332133      case 0xff:
2134         intelflash_write(0, offset*4, data&0xff);
2134         state->mFlashDev->write(offset*4, data&0xff);
21352135         break;
21362136      case 0xff00:
2137         intelflash_write(0, (offset*4)+1, (data>>8)&0xff);
2137         state->mFlashDev->write((offset*4)+1, (data>>8)&0xff);
21382138         break;
21392139      case 0xff0000:
2140         intelflash_write(0, (offset*4)+2, (data>>16)&0xff);
2140         state->mFlashDev->write((offset*4)+2, (data>>16)&0xff);
21412141         break;
21422142      case 0xff000000:
2143         intelflash_write(0, (offset*4)+3, (data>>24)&0xff);
2143         state->mFlashDev->write((offset*4)+3, (data>>24)&0xff);
21442144         break;
21452145      default:
21462146         fatalerror("Unknown mem_mask for GBA flash_w %x\n", mem_mask);
r9161r9162
23442344      }
23452345      else if (!memcmp(&ROM[i], "FLASH1M_", 8))
23462346      {
2347         state->nvptr = (UINT8 *)&state->gba_flash;
2348         state->nvsize = 0x20000;
2347         state->nvptr = NULL;
2348         state->nvsize = 0;
23492349         state->flash_size = 0x20000;
23502350         state->flash_mask = 0x1ffff/4;
23512351
r9161r9162
23552355      }
23562356      else if (!memcmp(&ROM[i], "FLASH", 5))
23572357      {
2358         state->nvptr = (UINT8 *)&state->gba_flash;
2359         state->nvsize = 0x10000;
2358         state->nvptr = NULL;
2359         state->nvsize = 0;
23602360         state->flash_size = 0x10000;
23612361         state->flash_mask = 0xffff/4;
23622362
r9161r9162
23882388   {
23892389      if (state->flash_size == 0x10000)
23902390      {
2391         intelflash_init(image.device().machine, 0, FLASH_PANASONIC_MN63F805MNP, &state->gba_flash);
2391         state->mFlashDev = image.device().machine->device<intelfsh8_device>("pflash");
23922392      }
23932393      else
23942394      {
2395         intelflash_init(image.device().machine, 0, FLASH_SANYO_LE26FV10N1TS, &state->gba_flash);
2395         state->mFlashDev = image.device().machine->device<intelfsh8_device>("sflash");
23962396      }
23972397   }
23982398
r9161r9162
24472447   MDRV_SOUND_ADD("direct_b_right", DAC, 0)      // GBA direct sound B right
24482448   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "spkright", 0.50)
24492449
2450   MDRV_PANASONIC_MN63F805MNP_ADD("pflash")
2451   MDRV_SANYO_LE26FV10N1TS_ADD("sflash")
2452
24502453   MDRV_CARTSLOT_ADD("cart")
24512454   MDRV_CARTSLOT_EXTENSION_LIST("gba,bin")
24522455   MDRV_CARTSLOT_INTERFACE("gba_cart")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team