Previous 15994 Revisions Next

r8389 Monday 5th July, 2010 at 01:23:52 UTC by Fabio Priuli
[XEGS] WIP:
* Hooked up better memory handling and cart loading functions
* Hooked up xml softlist
[hash]xegs.xml
[src/mess/drivers]atari.c
[src/mess/machine]ataricrt.c ataridev.h

hash/xegs.xml
r8388r8389
1717-->
1818
1919<softwarelist name="xegs" description="Atari XE Game System cartridges">
20   <software name="aceaces" supported="no">
20   <software name="aceaces">
2121      <description>Ace of Aces</description>
2222      <!-- <cart number>RX8099</cart number> -->
2323      <year>1988</year>
r8388r8389
2929      </part>
3030   </software>
3131
32   <software name="airball" supported="no">
32   <software name="airball">
3333      <description>Airball</description>
3434      <!-- <cart number>RX8109</cart number> -->
3535      <year>1988</year>
r8388r8389
4141      </part>     
4242   </software>
4343   
44   <software name="archon" supported="no">
44   <software name="archon">
4545      <description>Archon: The Light and the Dark</description>
4646      <!-- <cart number>RX8092</cart number> -->
4747      <year>1987</year>
r8388r8389
6565      </part>
6666   </software>
6767
68   <software name="brnblstr" supported="no">
68   <software name="brnblstr">
6969      <description>Barnyard Blaster</description>
7070      <!-- <cart number>RX8086</cart number> -->
7171      <year>1987</year>
r8388r8389
7777      </part>
7878   </software>
7979   
80   <software name="bzone" supported="no">
80   <software name="bzone">
8181      <description>BattleZone</description>
8282      <!-- <cart number>RX8077</cart number> -->
8383      <year>1987</year>
r8388r8389
8989      </part>
9090   </software>
9191   
92   <software name="bluemax" supported="no">
92   <software name="bluemax">
9393      <description>Blue Max</description>
9494      <!-- <cart number>RX8081</cart number> -->
9595      <year>1987</year>
r8388r8389
101101      </part>
102102   </software>
103103   
104   <software name="bughunt" supported="no">
104   <software name="bughunt">
105105      <description>Bug Hunt</description>
106106      <!-- <cart number>RX8087</cart number> -->
107107      <year>1987</year>
r8388r8389
113113      </part>
114114   </software>
115115   
116   <software name="choplift" supported="no">
116   <software name="choplift" supported="partial">
117117      <description>Choplifter!</description>
118118      <!-- <cart number>RX8096</cart number> -->
119119      <year>1987</year>
r8388r8389
125125      </part>
126126   </software>
127127   
128   <software name="commando" supported="no">
128   <software name="commando">
129129      <description>Commando (Prototype)</description>
130130      <!-- <cart number></cart number> -->
131131      <year>1988</year>
r8388r8389
137137      </part>
138138   </software>
139139   
140   <software name="crimbstr" supported="no">
140   <software name="crimbstr">
141141      <description>Crime Buster</description>
142142      <!-- <cart number>RX8104</cart number> -->
143143      <year>1988</year>
r8388r8389
149149      </part>
150150   </software>
151151   
152   <software name="crossbow" supported="no">
152   <software name="crossbow" supported="partial">
153153      <description>Crossbow</description>
154154      <!-- <cart number>RX8088</cart number> -->
155155      <year>1988</year>
r8388r8389
161161      </part>
162162   </software>
163163   
164   <software name="crossbowa" cloneof="crossbow" supported="no">
164   <software name="crossbowa" cloneof="crossbow" supported="partial">
165165      <description>Crossbow (Alt)</description>
166166      <!-- <cart number>RX8088</cart number> -->
167167      <year>1988</year>
r8388r8389
173173      </part>
174174   </software>
175175   
176   <software name="ccastles" supported="no">
176   <software name="ccastles">
177177      <description>Crystal Castles</description>
178178      <!-- <cart number>RX8102</cart number> -->
179179      <year>1988</year>
r8388r8389
185185      </part>
186186   </software>
187187   
188   <software name="drkchmbr" supported="no">
188   <software name="drkchmbr">
189189      <description>Dark Chambers</description>
190190      <!-- <cart number>RX8101</cart number> -->
191191      <year>1988</year>
r8388r8389
197197      </part>
198198   </software>
199199   
200   <software name="midntmgc" supported="no">
201      <description>David&apos;s Midnight Magic</description>
200   <software name="midntmgc">
201      <description>David's Midnight Magic</description>
202202      <!-- <cart number>RX8083</cart number> -->
203203      <year>1987</year>
204204      <publisher>Atari</publisher>
r8388r8389
209209      </part>
210210   </software>
211211   
212   <software name="deflktor" supported="no">
212   <software name="deflktor">
213213      <description>Deflektor (Prototype)</description>
214214      <!-- <cart number></cart number> -->
215215      <year>1988</year>
r8388r8389
221221      </part>
222222   </software>
223223   
224   <software name="dsrtflcn" supported="no">
224   <software name="dsrtflcn">
225225      <description>Desert Falcon</description>
226226      <!-- <cart number>RX8089</cart number> -->
227227      <year>1988</year>
r8388r8389
233233      </part>
234234   </software>
235235   
236   <software name="fightnit" supported="no">
236   <software name="fightnit">
237237      <description>Fight Night</description>
238238      <!-- <cart number>RX8085</cart number> -->
239239      <year>1987</year>
r8388r8389
245245      </part>
246246   </software>   
247247   
248   <software name="flgtsim2" supported="no">
248   <software name="flgtsim2" supported="partial">
249249      <description>Flight Simulator 2</description>
250250      <!-- <cart number>RX8091</cart number> -->
251251      <year>1987</year>
r8388r8389
257257      </part>
258258   </software>
259259     
260   <software name="foodf" supported="no">
260   <software name="foodf">
261261      <description>Food Fight</description>
262262      <!-- <cart number>RX8079</cart number> -->
263263      <year>1987</year>
r8388r8389
269269      </part>
270270   </software>
271271   
272   <software name="gato" supported="no">
272   <software name="gato">
273273      <description>GATO Submarine Simulation</description>
274274      <!-- <cart number>RX8090</cart number> -->
275275      <year>1987</year>
r8388r8389
281281      </part>
282282   </software>
283283     
284   <software name="hardball" supported="no">
284   <software name="hardball">
285285      <description>Hardball!</description>
286286      <!-- <cart number>RX8084</cart number> -->
287287      <year>1987</year>
r8388r8389
293293      </part>
294294   </software>   
295295   
296   <software name="eaglnest" supported="no">
297      <description>Into the Eagle&apos;s Nest</description>
296   <software name="eaglnest">
297      <description>Into the Eagle's Nest</description>
298298      <!-- <cart number>RX8114</cart number> -->
299299      <year>1988</year>
300300      <publisher>Atari</publisher>
r8388r8389
305305      </part>
306306   </software>   
307307   
308   <software name="karateka" supported="no">
308   <software name="karateka">
309309      <description>Karateka</description>
310310      <!-- <cart number>RX8095</cart number> -->
311311      <year>1988</year>
r8388r8389
317317      </part>
318318   </software>
319319     
320   <software name="ldrun" supported="no">
320   <software name="ldrun">
321321      <description>Lode Runner</description>
322322      <!-- <cart number>RX8082</cart number> -->
323323      <year>1987</year>
r8388r8389
329329      </part>
330330   </software>   
331331   
332   <software name="mariobro" supported="no">
333      <description>Mario Brothers</description>
332   <software name="mariobro">
333      <description>Mario Bros.</description>
334334      <!-- <cart number>RX8103</cart number> -->
335335      <year>1988</year>
336336      <publisher>Atari</publisher>
r8388r8389
341341      </part>
342342   </software>   
343343   
344   <software name="mean18" supported="no">
344   <software name="mean18">
345345      <description>Mean 18 (Prototype)</description>
346346      <!-- <cart number></cart number> -->
347347      <year>1988</year>
r8388r8389
353353      </part>
354354   </software>
355355   
356   <software name="midimaze" supported="no">
356   <software name="midimaze" supported="partial">
357357      <description>MIDI Maze (Prototype)</description>
358358      <!-- <cart number></cart number> -->
359359      <year>1988</year>
r8388r8389
365365      </part>
366366   </software>
367367     
368   <software name="necroman" supported="no">
368   <software name="necroman">
369369      <description>Necromancer</description>
370370      <!-- <cart number>RX8108</cart number> -->
371371      <year>1988</year>
r8388r8389
377377      </part>
378378   </software>   
379379   
380   <software name="1on1" supported="no">
380   <software name="1on1">
381381      <description>One-on-One</description>
382382      <!-- <cart number>RX8093</cart number> -->
383383      <year>1987</year>
r8388r8389
389389      </part>
390390   </software>   
391391   
392   <software name="fractlus" supported="no">
392   <software name="fractlus">
393393      <description>Rescue on Fractalus!</description>
394394      <!-- <cart number>RX8063</cart number> -->
395395      <year>1987</year>
r8388r8389
401401      </part>
402402   </software>
403403   
404   <software name="raiders2" supported="no">
404   <software name="raiders2">
405405      <description>Star Raiders II</description>
406406      <!-- <cart number>RX8078</cart number> -->
407407      <year>1987</year>
r8388r8389
413413      </part>
414414   </software>
415415   
416   <software name="sumrgams" supported="no">
416   <software name="sumrgams">
417417      <description>Summer Games</description>
418418      <!-- <cart number>RX8098</cart number> -->
419419      <year>1987</year>
r8388r8389
425425      </part>
426426   </software>
427427   
428   <software name="thundfox" supported="no">
428   <software name="thundfox">
429429      <description>Thunderfox</description>
430430      <!-- <cart number>RX8113</cart number> -->
431431      <year>1988</year>
r8388r8389
437437      </part>
438438   </software>   
439439   
440   <software name="ttoppler" supported="no">
440   <software name="ttoppler">
441441      <description>Tower Toppler (Prototype)</description>
442442      <!-- <cart number></cart number> -->
443443      <year>1988</year>
src/mess/machine/ataricrt.c
r8388r8389
301301   /* zap the cartridge memory (again) */
302302   memset(&mem[0x4000], 0x00, 0x8000);
303303}
304
305/*************************************
306 *
307 *  Atari XEGS
308 *
309 *************************************/
310
311static UINT8 xegs_banks = 0;
312static UINT8 xegs_cart = 0;
313
314static WRITE8_HANDLER( xegs_bankswitch )
315{
316   UINT8 *cart = memory_region(space->machine, "user1");
317   data &= xegs_banks - 1;
318   memory_set_bankptr(space->machine, "bank0", cart + data * 0x2000);
319}
320
321MACHINE_START( xegs )
322{
323   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
324   UINT8 *cart = memory_region(space->machine, "user1");
325   UINT8 *cpu  = memory_region(space->machine, "maincpu");
326   
327   atari_machine_start(machine);
328   memory_install_write8_handler(space, 0xd500, 0xd5ff, 0, 0, xegs_bankswitch);
329
330   if (xegs_cart)
331   {
332      memory_set_bankptr(machine, "bank0", cart);
333      memory_set_bankptr(machine, "bank1", cart + (xegs_banks - 1) * 0x2000);
334   }
335   else
336   {
337      // point to built-in Missile Command (this does not work well, though... FIXME!!)
338      memory_set_bankptr(machine, "bank0", cpu + 0x10000);
339      memory_set_bankptr(machine, "bank1", cpu + 0x10000);
340   }
341}
342
343DEVICE_IMAGE_LOAD( xegs_cart )
344{
345   UINT32 size;
346   UINT8 *ptr = memory_region(image.device().machine, "user1");
347   
348   if (image.software_entry() == NULL)
349   {
350      // skip the header
351      image.fseek(0x10, SEEK_SET);
352      size = image.length() - 0x10;
353      if (image.fread(ptr, size) != size)
354         return IMAGE_INIT_FAIL;
355   }
356   else
357   {
358      size = image.get_software_region_length("rom");
359      memcpy(ptr, image.get_software_region("rom"), size);
360   }
361
362   xegs_banks = size / 0x2000;
363   xegs_cart = 1;
364
365   return IMAGE_INIT_PASS;
366}
367
368
src/mess/machine/ataridev.h
r8388r8389
1818MACHINE_START( a800 );
1919MACHINE_START( a800xl );
2020MACHINE_START( a5200 );
21MACHINE_START( xegs );
2122
2223DEVICE_IMAGE_LOAD( a800_cart );
2324DEVICE_IMAGE_UNLOAD( a800_cart );
r8388r8389
2829DEVICE_IMAGE_LOAD( a5200_cart );
2930DEVICE_IMAGE_UNLOAD( a5200_cart );
3031
32DEVICE_IMAGE_LOAD( xegs_cart );
3133
3234/*----------- defined in machine/atarifdc.c -----------*/
3335/***************************************************************************
src/mess/drivers/atari.c
r8388r8389
295295   AM_RANGE(0xd800, 0xffff) AM_RAMBANK("bank4")
296296ADDRESS_MAP_END
297297
298static ADDRESS_MAP_START(xegs_mem, ADDRESS_SPACE_PROGRAM, 8)
299   AM_RANGE(0x0000, 0x4fff) AM_RAM
300   AM_RANGE(0x5000, 0x57ff) AM_RAMBANK("bank2")
301   AM_RANGE(0x5800, 0x7fff) AM_RAM
302   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank0")
303   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK("bank1")
304   AM_RANGE(0xc000, 0xcfff) AM_RAMBANK("bank3")
305   AM_RANGE(0xd000, 0xd0ff) AM_READWRITE(atari_gtia_r, atari_gtia_w)
306   AM_RANGE(0xd100, 0xd1ff) AM_NOP
307   AM_RANGE(0xd200, 0xd2ff) AM_DEVREADWRITE("pokey", pokey_r, pokey_w)
308   AM_RANGE(0xd300, 0xd3ff) AM_DEVREADWRITE("pia", pia6821_alt_r, pia6821_alt_w)
309   AM_RANGE(0xd400, 0xd4ff) AM_READWRITE(atari_antic_r, atari_antic_w)
310   AM_RANGE(0xd500, 0xd7ff) AM_NOP
311   AM_RANGE(0xd800, 0xffff) AM_RAMBANK("bank4")
312ADDRESS_MAP_END
298313
314
299315static ADDRESS_MAP_START(a5200_mem, ADDRESS_SPACE_PROGRAM, 8)
300316   AM_RANGE(0x0000, 0x3fff) AM_RAM
301317   AM_RANGE(0x4000, 0xbfff) AM_ROM
r8388r8389
830846   memory_set_bankptr(machine, "bank2", base2);
831847}
832848
849static void xegs_mmu(running_machine *machine, UINT8 new_mmu)
850{
851   UINT8 *base2, *base3, *base4;
852   
853   /* check if memory C000-FFFF changed */
854   if( new_mmu & 0x01 )
855   {
856      logerror("%s MMU BIOS ROM\n", machine->gamedrv->name);
857      base3 = memory_region(machine, "maincpu") + 0x14000;  /* 8K lo BIOS */
858      base4 = memory_region(machine, "maincpu") + 0x15800;  /* 4K FP ROM + 8K hi BIOS */
859      memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xcfff, 0, 0, "bank3");
860      memory_unmap_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xcfff, 0, 0);
861      memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd800, 0xffff, 0, 0, "bank4");
862      memory_unmap_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd800, 0xffff, 0, 0);
863   }
864   else
865   {
866      logerror("%s MMU BIOS RAM\n", machine->gamedrv->name);
867      base3 = memory_region(machine, "maincpu") + 0x0c000;  /* 8K RAM */
868      base4 = memory_region(machine, "maincpu") + 0x0d800;  /* 4K RAM + 8K RAM */
869      memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xcfff, 0, 0, "bank3");
870      memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd800, 0xffff, 0, 0, "bank4");
871   }
872   memory_set_bankptr(machine, "bank3", base3);
873   memory_set_bankptr(machine, "bank4", base4);
874   
875   
876   /* check if self-test ROM changed */
877   if( new_mmu & 0x80 )
878   {
879      logerror("%s MMU SELFTEST RAM\n", machine->gamedrv->name);
880      memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x57ff, 0, 0, "bank2");
881      base2 = memory_region(machine, "maincpu") + 0x05000;  /* 0x0800 bytes */
882   }
883   else
884   {
885      logerror("%s MMU SELFTEST ROM\n", machine->gamedrv->name);
886      memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x57ff, 0, 0, "bank2");
887      memory_nop_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x57ff, 0, 0);
888      base2 = memory_region(machine, "maincpu") + 0x15000;  /* 0x0800 bytes */
889   }
890   memory_set_bankptr(machine, "bank2", base2);
891}
892
833893/**************************************************************
834894 *
835895 * PIA interface
r8388r8389
843903      a800xl_mmu(device->machine, data);
844904}
845905
906static WRITE8_DEVICE_HANDLER(xegs_pia_pb_w)
907{
908   if ( pia6821_get_port_b_z_mask(device) != 0xff )
909      xegs_mmu(device->machine, data);
910}
911
846912static const pokey_interface atari_pokey_interface =
847913{
848914   {
r8388r8389
926992   DEVCB_NULL      /* IRQB */
927993};
928994
995static const pia6821_interface xegs_pia_interface =
996{
997   DEVCB_HANDLER(atari_pia_pa_r),      /* port A in */
998   DEVCB_HANDLER(atari_pia_pb_r),   /* port B in */
999   DEVCB_NULL,      /* line CA1 in */
1000   DEVCB_NULL,      /* line CB1 in */
1001   DEVCB_NULL,      /* line CA2 in */
1002   DEVCB_NULL,      /* line CB2 in */
1003   DEVCB_NULL,      /* port A out */
1004   DEVCB_HANDLER(xegs_pia_pb_w),      /* port B out */
1005   DEVCB_NULL,      /* line CA2 out */
1006   DEVCB_DEVICE_LINE("fdc",atarifdc_pia_cb2_w),      /* port CB2 out */
1007   DEVCB_NULL,      /* IRQA */
1008   DEVCB_NULL      /* IRQB */
1009};
9291010
1011
9301012/**************************************************************
9311013 *
9321014 * Machine drivers
r8388r8389
11221204   MDRV_PIA6821_MODIFY( "pia", a1200xl_pia_interface )
11231205MACHINE_DRIVER_END
11241206
1207static MACHINE_DRIVER_START( xegs )
1208   MDRV_IMPORT_FROM( a800xl )
11251209
1210   MDRV_CPU_MODIFY( "maincpu" )
1211   MDRV_CPU_PROGRAM_MAP(xegs_mem)
1212
1213   MDRV_MACHINE_START( xegs )
1214
1215   MDRV_PIA6821_MODIFY( "pia", xegs_pia_interface )
1216
1217   MDRV_DEVICE_REMOVE("cart1")
1218
1219   MDRV_CARTSLOT_ADD("cart1")
1220   MDRV_CARTSLOT_EXTENSION_LIST("rom,bin")
1221   MDRV_CARTSLOT_NOT_MANDATORY
1222   MDRV_CARTSLOT_INTERFACE("xegs_cart")
1223   MDRV_CARTSLOT_LOAD(xegs_cart)
1224
1225   /* software lists */
1226   MDRV_SOFTWARE_LIST_ADD("xegs")
1227
1228MACHINE_DRIVER_END
1229
1230
11261231static MACHINE_DRIVER_START( a5200 )
11271232   MDRV_IMPORT_FROM( atari_common_nodac )
11281233
r8388r8389
12431348ROM_START(xegs)
12441349   ROM_REGION(0x1a000, "maincpu", 0)
12451350   ROM_LOAD( "c101687.rom", 0x10000, 0x8000, CRC(d50260d1) SHA1(0e0625ab2473f8431640df3ac8af61925760b9b9) )   // Rev. C + Rev. 4 + Missile Command
1351
1352   ROM_REGION(0x20000, "user1", ROMREGION_ERASE00)
12461353ROM_END
12471354
12481355
r8388r8389
12651372   a800xl_mmu(machine, 0xff);
12661373}
12671374
1375static DRIVER_INIT( xegs )
1376{
1377   if (1)
1378      xegs_mmu(machine, 0xff);
1379   else
1380      a800xl_mmu(machine, 0xff);
1381}
1382
12681383static DRIVER_INIT( a600xl )
12691384{
12701385   UINT8 *rom = memory_region(machine, "maincpu");
r8388r8389
12901405COMP ( 1986, a65xea,   a800xl,   0,     a800xl,     a800xl,  a800xl, "Atari",   "Atari 65XE (Arabic)", GAME_NOT_WORKING )
12911406COMP ( 1986, a130xe,   a800xl,   0,     a800xl,     a800xl,  a800xl, "Atari",   "Atari 130XE",      GAME_NOT_WORKING )      // 128k RAM
12921407COMP ( 1986, a800xe,   a800xl,   0,     a800xl,     a800xl,  a800xl, "Atari",   "Atari 800XE",      GAME_NOT_WORKING )      // 64k RAM
1293COMP ( 1987, xegs,     0,        0,     a800xl,     a800xl,  a800xl, "Atari",   "Atari XE Game System", GAME_NOT_WORKING )   // 64k RAM
1408COMP ( 1987, xegs,     0,        0,     xegs,       a800xl,  xegs,  "Atari",   "Atari XE Game System", GAME_NOT_WORKING )   // 64k RAM
12941409
12951410CONS ( 1982, a5200,    0,        0,     a5200,      a5200,   0,      "Atari",   "Atari 5200",       0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team