Previous 199869 Revisions Next

r32593 Thursday 9th October, 2014 at 07:13:20 UTC by Fabio Priuli
a few more generic cart slots. nw.
[src/mess/drivers]geniusiq.c pc2000.c

trunk/src/mess/drivers/geniusiq.c
r32592r32593
235235#include "emu.h"
236236#include "cpu/m68000/m68000.h"
237237#include "machine/intelfsh.h"
238#include "imagedev/cartslot.h"
239238
239#include "bus/generic/slot.h"
240#include "bus/generic/carts.h"
240241
241242#define KEYBOARD_QUEUE_SIZE     0x80
242243
r32592r32593
254255   geniusiq_state(const machine_config &mconfig, device_type type, const char *tag)
255256      : driver_device(mconfig, type, tag),
256257      m_maincpu(*this, "maincpu"),
258      m_cart(*this, "cartslot"),
257259      m_vram(*this, "vram"),
258260      m_mouse_gfx(*this, "mouse_gfx"),
259261      m_cart_state(IQ128_NO_CART)
260262   { }
261263
262264   required_device<cpu_device> m_maincpu;
265   required_device<generic_slot_device> m_cart;
263266   required_shared_ptr<UINT16> m_vram;
264267   required_shared_ptr<UINT16> m_mouse_gfx;
265268
r32592r32593
293296   UINT8       m_mouse_posy;
294297   UINT16      m_mouse_gfx_posx;
295298   UINT16      m_mouse_gfx_posy;
296   UINT8 *     m_cart;
297299   UINT8       m_cart_state;
298300   struct
299301   {
r32592r32593
527529   AM_RANGE(0x60101c, 0x60101f) AM_WRITE(gfx_color_w)
528530   AM_RANGE(0x601060, 0x601063) AM_WRITE(mouse_pos_w)
529531   AM_RANGE(0x601100, 0x6011ff) AM_RAM     AM_SHARE("mouse_gfx")   // mouse cursor gfx (24x16)
530   AM_RANGE(0xa00000, 0xafffff) AM_REGION("cart", 0)               // cartridge
532   AM_RANGE(0xa00000, 0xafffff) AM_DEVREAD("cartslot", generic_slot_device, read16_rom)
531533   // 0x600000 : some memory mapped hardware
532534ADDRESS_MAP_END
533535
r32592r32593
738740
739741void geniusiq_state::machine_start()
740742{
741   m_cart = (UINT8*)(*memregion("cart"));
742743}
743744
744745void geniusiq_state::machine_reset()
r32592r32593
757758
758759DEVICE_IMAGE_LOAD_MEMBER(geniusiq_state,iq128_cart)
759760{
760   if (image.software_entry() == NULL)
761   {
762      UINT32 size = image.length();
763      if (image.fread(m_cart, size) != size)
764         return IMAGE_INIT_FAIL;
761   UINT32 size = m_cart->common_get_size("rom");
762   
763   // we always a 0x100000 region, for easier mapping in the memory map
764   m_cart->rom_alloc(0x100000, GENERIC_ROM16_WIDTH, ENDIANNESS_LITTLE);
765   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
765766
766      m_cart_state = IQ128_ROM_CART;
767   }
768   else
769   {
770      UINT32 size = image.get_software_region_length("rom");
771      if (size > 1)
772         memcpy(m_cart, image.get_software_region("rom"), size);
767   m_cart_state = IQ128_ROM_CART;
773768
769   if (image.software_entry() != NULL)
770   {
774771      const char *pcb_type = image.get_feature("pcb_type");
775772      if (pcb_type)
776773      {
777         if (!strcmp(pcb_type, "romless1"))
774         if (!core_stricmp(pcb_type, "romless1"))
778775            m_cart_state = IQ128_ROMLESS1_CART;
779         else if (!strcmp(pcb_type, "romless2"))
776         if (!core_stricmp(pcb_type, "romless2"))
780777            m_cart_state = IQ128_ROMLESS2_CART;
781         else if (!strcmp(pcb_type, "rom"))
782            m_cart_state = IQ128_ROM_CART;
783778      }
784      else
785      {
786         m_cart_state = IQ128_ROM_CART;
787      }
788779   }
789780
790781   return IMAGE_INIT_PASS;
r32592r32593
792783
793784DEVICE_IMAGE_UNLOAD_MEMBER(geniusiq_state,iq128_cart)
794785{
795   memset(m_cart, 0xff, memregion("cart")->bytes());
796786   m_cart_state = IQ128_NO_CART;
797787}
798788
r32592r32593
819809   MCFG_AMD_29F010_ADD("flash")
820810
821811   /* cartridge */
822   MCFG_CARTSLOT_ADD("cart")
823   MCFG_CARTSLOT_EXTENSION_LIST("bin")
824   MCFG_CARTSLOT_NOT_MANDATORY
825   MCFG_CARTSLOT_LOAD(geniusiq_state,iq128_cart)
826   MCFG_CARTSLOT_UNLOAD(geniusiq_state,iq128_cart)
827   MCFG_CARTSLOT_INTERFACE("iq128_cart")
812   MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "iq128_cart")
813   MCFG_GENERIC_LOAD(geniusiq_state, iq128_cart)
814   MCFG_GENERIC_UNLOAD(geniusiq_state, iq128_cart)
828815
829816   /* Software lists */
830817   MCFG_SOFTWARE_LIST_ADD("cart_list", "iq128")
r32592r32593
855842ROM_START( iq128 )
856843   ROM_REGION(0x200000, "maincpu", 0)
857844   ROM_LOAD( "27-5947-00.bin", 0x0000, 0x200000, CRC(a98fc3ff) SHA1(de76a5898182bd0180bd2b3e34c4502f0918a3fa) )
858
859   ROM_REGION(0x100000, "cart", ROMREGION_ERASEFF)
860845ROM_END
861846
862847ROM_START( iq128_fr )
863848   ROM_REGION(0x200000, "maincpu", 0)
864849   ROM_LOAD( "geniusiq.bin", 0x0000, 0x200000, CRC(9b06cbf1) SHA1(b9438494a9575f78117c0033761f899e3c14e292) )
865
866   ROM_REGION(0x100000, "cart", ROMREGION_ERASEFF)
867850ROM_END
868851
869852ROM_START( iqtv512 )
870853   ROM_REGION(0x200000, "maincpu", 0)
871854   ROM_LOAD( "27-06171-000.bin", 0x0000, 0x200000, CRC(2597af70) SHA1(9db8151a84517407d380424410b6fa0003ceb1eb) )
872
873   ROM_REGION(0x100000, "cart", ROMREGION_ERASEFF)
874855ROM_END
875856
876857ROM_START( gl8008cx )
r32592r32593
892873ROM_START( itunlim )
893874   ROM_REGION(0x200000, "maincpu", 0)
894875   ROM_LOAD( "27-06124-002.u3", 0x000000, 0x200000, CRC(0c0753ce) SHA1(d22504d583ca8d6a9d2f56fbaa3e1d52c442a1e9) )
895
896   ROM_REGION(0x100000, "cart", ROMREGION_ERASEFF)
897876ROM_END
898877
899878ROM_START( iqunlim )
900879   ROM_REGION(0x200000, "maincpu", 0)
901880   ROM_LOAD16_WORD_SWAP( "27-06126-007.bin", 0x000000, 0x200000, CRC(af38c743) SHA1(5b91748536905812e6de7145638699acb375865a) )
902
903   ROM_REGION(0x100000, "cart", ROMREGION_ERASEFF)
904881ROM_END
905882
906
907883ROM_START( glmmc )
908884   ROM_REGION(0x200000, "maincpu", 0)
909885   ROM_LOAD( "27-5889-00.bin", 0x000000, 0x080000, CRC(5e2c6359) SHA1(cc01c7bd5c87224b63dd1044db5a36a5cb7824f1) )
910
911   ROM_REGION(0x100000, "cart", ROMREGION_ERASEFF)
912886ROM_END
913887
914888/* Driver */
trunk/src/mess/drivers/pc2000.c
r32592r32593
1919#include "video/hd44780.h"
2020#include "video/sed1520.h"
2121#include "sound/beep.h"
22#include "imagedev/cartslot.h"
2322#include "rendlay.h"
2423#include "gl3000s.lh"
2524
25#include "bus/generic/slot.h"
26#include "bus/generic/carts.h"
2627
28
2729class pc2000_state : public driver_device
2830{
2931public:
r32592r32593
3234         m_maincpu(*this, "maincpu"),
3335         m_lcdc(*this, "hd44780"),
3436         m_beep(*this, "beeper"),
37         m_cart(*this, "cartslot"),
3538         m_bank0(*this, "bank0"),
3639         m_bank1(*this, "bank1"),
3740         m_bank2(*this, "bank2")
r32592r32593
4043   required_device<cpu_device> m_maincpu;
4144   optional_device<hd44780_device> m_lcdc;
4245   required_device<beep_device> m_beep;
46   required_device<generic_slot_device> m_cart;
4347   optional_memory_bank m_bank0;
4448   required_memory_bank m_bank1;
4549   optional_memory_bank m_bank2;
r32592r32593
5862   DECLARE_READ8_MEMBER( beep_r );
5963   DECLARE_WRITE8_MEMBER( beep_w );
6064   DECLARE_PALETTE_INIT(pc2000);
65   DECLARE_DEVICE_IMAGE_LOAD_MEMBER(pc2000_cart);
6166};
6267
6368class gl3000s_state : public pc2000_state
r32592r32593
338343   ADDRESS_MAP_UNMAP_HIGH
339344   AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("bios", 0x00000)
340345   AM_RANGE(0x4000, 0x47ff) AM_RAM
341   AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("cart", 0x00000)    //0x8000 - 0xbfff tests a cartridge, header is 0x55 0xaa 0x33, if it succeeds a jump at 0x8010 occurs
346   AM_RANGE(0x8000, 0xbfff) AM_DEVREAD("cartslot", generic_slot_device, read_rom)    //0x8000 - 0xbfff tests a cartridge, header is 0x55 0xaa 0x33, if it succeeds a jump at 0x8010 occurs
342347   AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank1")
343348ADDRESS_MAP_END
344349
r32592r32593
735740
736741void pc2000_state::machine_start()
737742{
743   astring region_tag;
744   UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base();
738745   UINT8 *bios = memregion("bios")->base();
739   UINT8 *cart = memregion("cart")->base();
740746
741747   m_bank0->configure_entries(0, 0x10, bios, 0x4000);
742748   m_bank1->configure_entries(0, 0x10, bios, 0x4000);
r32592r32593
746752
747753void gl4004_state::machine_start()
748754{
755   astring region_tag;
756   UINT8 *cart = memregion(region_tag.cpy(m_cart->tag()).cat(GENERIC_ROM_REGION_TAG))->base();
749757   UINT8 *bios = memregion("bios")->base();
750   UINT8 *cart = memregion("cart")->base();
751758
752759   m_bank0->configure_entries(0, 0x20, bios, 0x4000);
753760   m_bank1->configure_entries(0, 0x20, bios, 0x4000);
r32592r32593
796803GFXDECODE_END
797804
798805
806DEVICE_IMAGE_LOAD_MEMBER( pc2000_state, pc2000_cart )
807{
808   UINT32 size = m_cart->common_get_size("rom");
809
810   // we always allocate a 0x40000 region, even if most carts span only 0x20000,
811   // because the bankswitch code accesses up to 16 x 16K banks...
812   m_cart->rom_alloc(0x40000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE);
813   m_cart->common_load_rom(m_cart->get_rom_base(), size, "rom");         
814   
815   return IMAGE_INIT_PASS;
816}
817
799818static MACHINE_CONFIG_START( pc2000, pc2000_state )
800819   /* basic machine hardware */
801820   MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) /* probably not accurate */
r32592r32593
825844   MCFG_SOUND_ADD( "beeper", BEEP, 0 )
826845   MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 )
827846
828   MCFG_CARTSLOT_ADD("cart")
829   MCFG_CARTSLOT_EXTENSION_LIST("bin")
830   MCFG_CARTSLOT_INTERFACE("genius_cart")
831   MCFG_CARTSLOT_NOT_MANDATORY
847   MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "genius_cart")
848   MCFG_GENERIC_LOAD(pc2000_state, pc2000_cart)
832849MACHINE_CONFIG_END
833850
834851static MACHINE_CONFIG_DERIVED( gl2000, pc2000 )
r32592r32593
903920   MCFG_HD44780_LCD_SIZE(1, 20)
904921   MCFG_HD44780_PIXEL_UPDATE_CB(pc1000_pixel_update)
905922
906   MCFG_CARTSLOT_MODIFY("cart")
907   MCFG_CARTSLOT_INTERFACE("genius_cart")
908
909923   /* Software lists */
910924   MCFG_SOFTWARE_LIST_ADD("cart_list", "misterx")
911925MACHINE_CONFIG_END
r32592r32593
914928ROM_START( pc2000 )
915929   ROM_REGION( 0x40000, "bios", 0 )
916930   ROM_LOAD( "lh532hee_9344_d.u4", 0x000000, 0x040000, CRC(0b03bf33) SHA1(cb344b94b14975c685041d3e669f386e8a21909f))
917
918   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
919   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
920931ROM_END
921932
922933ROM_START( gl2000 )
923934   ROM_REGION( 0x40000, "bios", 0 )
924935   ROM_LOAD( "lh532hez_9416_d.bin", 0x000000, 0x040000, CRC(532f219e) SHA1(4044f0cf098087af4cc9d1b2a80c3c9ec06f154e))
925
926   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
927   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
928936ROM_END
929937
930938ROM_START( gl2000c )
931939   ROM_REGION( 0x40000, "bios", 0 )
932940   ROM_LOAD( "27-5491-00", 0x000000, 0x020000, CRC(cbb9fe90) SHA1(a2a7a8afb027fe764a5998e3b35e87f291c24df1))
933
934   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
935   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
936941ROM_END
937942
938943ROM_START( gl2000p )
939944   ROM_REGION( 0x40000, "bios", 0 )
940945   ROM_LOAD( "27-5615-00_9534_d.bin", 0x000000, 0x040000, CRC(481c1000) SHA1(da6f60e5bb25145ec5239310296bedaabeeaee28))
941
942   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
943   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
944946ROM_END
945947
946948ROM_START( gl3000s )
947949   ROM_REGION(0x40000, "bios", 0)
948950   ROM_LOAD( "27-5713-00", 0x000000, 0x040000, CRC(18b113e0) SHA1(27a12893c38068efa35a99fa97a260dbfbd497e3) )
949
950   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
951   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
952951ROM_END
953952
954953ROM_START( gl4000 )
955954   ROM_REGION(0x80000, "bios", 0)
956955   ROM_LOAD( "27-5480-00",   0x000000, 0x040000, CRC(8de047d3) SHA1(bb1d869954773bb7b8b51caa54531015d6b751ec) )
957
958   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
959   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
960956ROM_END
961957
962958ROM_START( gl4004 )
963959   ROM_REGION(0x80000, "bios", 0)
964960   ROM_LOAD( "27-5762-00.u2", 0x000000, 0x080000, CRC(fb242f0f) SHA1(aae1beeb94873e29920726ad35475641d9f1e94e) )
965
966   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
967   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
968961ROM_END
969962
970963ROM_START( gl5000 )
971964   ROM_REGION(0x80000, "bios", 0)
972965   ROM_LOAD( "27-5912-00.u1", 0x000000, 0x080000, CRC(9fe4c04a) SHA1(823d1d46e49e21f921260296874bc3ee5f718a5f) )
973
974   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
975   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
976966ROM_END
977967
978968ROM_START( gl5005x )
979969   ROM_REGION(0x200000, "bios", 0)
980970   ROM_LOAD( "27-6426-00.u1", 0x000000, 0x200000, CRC(adde3581) SHA1(80f2bde7c5c339534614f24a9ca6ea362ee2f816) )
981
982   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
983   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
984971ROM_END
985972
986973ROM_START( glpn )
987974   ROM_REGION( 0x200000, "bios", 0 )
988975   ROM_LOAD( "27-5755-01.u1", 0x00000, 0x80000, CRC(dc28346b) SHA1(148fe664bef5b2f68c6702c74462802b76900ca0) )
989
990   ROM_REGION( 0x80000, "cart", ROMREGION_ERASEFF )
991   ROM_CART_LOAD( "cart", 0, 0x80000, 0 )
992976ROM_END
993977
994978ROM_START( gmtt )
995979   ROM_REGION(0x100000, "bios", 0)
996980   ROM_LOAD( "27-6154-00.u4", 0x000000, 0x100000, CRC(e908262d) SHA1(a7964c9f9d304b6b2cce61822e8c6151b50388be) )
997
998   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
999   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
1000981ROM_END
1001982
1002983ROM_START( gbs5505x )
1003984   ROM_REGION(0x200000, "bios", 0)
1004985   ROM_LOAD( "27-7006-00.u5", 0x000000, 0x200000, CRC(28af3ca7) SHA1(5df7063c7327263c23d5ac2aac3aa66f7e0821c5) )
1005
1006   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
1007   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
1008986ROM_END
1009987
1010988ROM_START( gln ) // not Z80 code
1011989   ROM_REGION( 0x80000, "bios", 0 )
1012990   ROM_LOAD( "27-5308-00_9524_d.bin", 0x000000, 0x080000, CRC(d1b994ee) SHA1(b5cf0810df0676712e4f30e279cc46c19b4277dd))
1013
1014   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
1015   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
1016991ROM_END
1017992
1018993ROM_START( pc1000 )
1019994   ROM_REGION( 0x20000, "bios", 0 )
1020995   ROM_LOAD( "27-00780-002-002.u4", 0x000000, 0x020000, CRC(705170ae) SHA1(825ce0ff2c7d0a7b1e2577d1465a37f7e8da383b))
1021
1022   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
1023   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
1024996ROM_END
1025997
1026998ROM_START( misterx )
1027999   ROM_REGION( 0x20000, "bios", 0 )
10281000   ROM_LOAD( "27-00882-001.bin", 0x000000, 0x020000, CRC(30e0dc94) SHA1(2f4675746a41399b3d9e3e8001a9b4a0dcc5b620))
1029
1030   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
1031   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
10321001ROM_END
10331002
10341003ROM_START( lexipcm )
10351004   ROM_REGION( 0x200000, "bios", 0 )
10361005   ROM_LOAD( "epoxy.u3", 0x00000, 0x100000, CRC(0a410790) SHA1(be04d5f74208a2f3b200daed75e04e966f64b545) )
1037
1038   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
1039   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
10401006ROM_END
10411007
10421008

Previous 199869 Revisions Next


© 1997-2024 The MAME Team