Previous 15994 Revisions Next

r1821 Saturday 1st March, 2008 at 16:08:16 UTC by Wilbert Pol
[ODYSSEY2] Added support for 12KB and 16KB images.
[src/mess/drivers]odyssey2.c
[src/mess/machine]odyssey2.c

src/mess/machine/odyssey2.c
r1820r1821
1313
1414static UINT8 *ram;
1515static UINT8 p1, p2;
16static size_t   cart_size;
1617
18static void odyssey2_switch_banks(void) {
19   switch ( cart_size ) {
20   case 12288:
21      /* 12KB cart support (for instance, KTAA as released) */
22      memory_set_bankptr( 1, memory_region(REGION_USER1) + (p1 & 0x03) * 0xC00 );
23      memory_set_bankptr( 2, memory_region(REGION_USER1) + (p1 & 0x03) * 0xC00 + 0x800 );
24      break;
25   case 16384:
26      /* 16KB cart support (for instance, full sized version KTAA) */
27      memory_set_bankptr( 1, memory_region(REGION_USER1) + (p1 & 0x03) * 0x1000 + 0x400 );
28      memory_set_bankptr( 2, memory_region(REGION_USER1) + (p1 & 0x03) * 0x1000 + 0xC00 );
29      break;
30   default:
31      memory_set_bankptr(1, memory_region(REGION_USER1) + (p1 & 0x03) * 0x800);
32      memory_set_bankptr(2, memory_region(REGION_USER1) + (p1 & 0x03) * 0x800 );
33      break;
34   }
35}
36
1737DRIVER_INIT( odyssey2 )
1838{
1939   int i;
r1820r1821
3050MACHINE_RESET( odyssey2 )
3151{
3252    /* jump to "last" bank, will work for all sizes due to being mirrored */
33    memory_set_bankptr(1, memory_region(REGION_USER1) + 0x800*3);
34
3553    p1 = 0xFF;
3654    p2 = 0xFF;
55   odyssey2_switch_banks();
3756    return;
3857}
3958
r1820r1821
99118{
100119    p1 = data;
101120
102    /* ROM is mirrored so this will be OK for all sizes 2k/4k/8k */
103    memory_set_bankptr(1, memory_region(REGION_USER1) + (0x800 * (p1 & 0x03)));
121   odyssey2_switch_banks();
104122
105123    logerror("%.6f p1 written %.2x\n", attotime_to_double(timer_get_time()), data);
106124}
r1820r1821
167185
168186int odyssey2_cart_verify(const UINT8 *cartdata, size_t size)
169187{
188   cart_size = size;
170189    if (   (size == 2048)
171190        || (size == 4096)
172        || (size == 8192))
191        || (size == 8192)
192      || (size == 12288)
193      || (size == 16384))
173194    {
174195      return IMAGE_VERIFY_PASS;
175196    }
src/mess/drivers/odyssey2.c
r1820r1821
236236    ROM_LOAD ("o2bios.rom", 0x0000, 0x0400, CRC(8016a315) SHA1(b2e1955d957a475de2411770452eff4ea19f4cee))
237237    ROM_REGION(0x100, REGION_GFX1, ROMREGION_ERASEFF)
238238
239    ROM_REGION(0x2000, REGION_USER1, 0)
240   ROM_CART_LOAD(0, "bin", 0x0000, 0x2000, ROM_MIRROR)
239    ROM_REGION(0x4000, REGION_USER1, 0)
240   ROM_CART_LOAD(0, "bin", 0x0000, 0x4000, ROM_MIRROR)
241241ROM_END
242242
243243ROM_START (videopac)
r1820r1821
248248   ROMX_LOAD ("c52.bin", 0x0000, 0x0400, CRC(a318e8d6) SHA1(a6120aed50831c9c0d95dbdf707820f601d9452e), ROM_BIOS(2))
249249   ROM_REGION(0x100, REGION_GFX1, ROMREGION_ERASEFF)
250250
251   ROM_REGION(0x2000, REGION_USER1, 0)
252   ROM_CART_LOAD(0, "bin", 0x0000, 0x2000, ROM_MIRROR)
251   ROM_REGION(0x4000, REGION_USER1, 0)
252   ROM_CART_LOAD(0, "bin", 0x0000, 0x4000, ROM_MIRROR)
253253ROM_END
254254
255255ROM_START (g7400)
r1820r1821
257257   ROM_LOAD ("g7400.bin", 0x0000, 0x0400, CRC(e20a9f41) SHA1(5130243429b40b01a14e1304d0394b8459a6fbae))
258258   ROM_REGION(0x100, REGION_GFX1, ROMREGION_ERASEFF)
259259
260   ROM_REGION(0x2000, REGION_USER1, 0)
261   ROM_CART_LOAD(0, "bin", 0x0000, 0x2000, ROM_MIRROR)
260   ROM_REGION(0x4000, REGION_USER1, 0)
261   ROM_CART_LOAD(0, "bin", 0x0000, 0x4000, ROM_MIRROR)
262262ROM_END
263263
264264static void odyssey2_cartslot_device_getinfo(const device_class *devclass, UINT32 state, union devinfo *info)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team