Previous 199869 Revisions Next

r34847 Wednesday 4th February, 2015 at 13:24:05 UTC by Couriersud
Safety commit before pull. More code alignment. (nw)
[3rdparty/bgfx/src]renderer_d3d11.cpp
[src/lib]lib.mak
[src/mame]mame.lst
[src/mame/drivers]aleck64.c bloodbro.c dcon.c goodejan.c lindbergh.c naomi.c sengokmj.c silvmil.c toki.c
[src/mame/includes]bloodbro.h dcon.h toki.h
[src/mame/video]bloodbro.c dcon.c decospr.c decospr.h toki.c
[src/mess/drivers]c65.c mbee.c pentagon.c spec128.c
[src/mess/includes]mbee.h
[src/mess/machine]mbee.c
[src/mess/video]spectrum.c
[src/osd/sdl]draw13.c drawbgfx.c drawogl.c drawsdl.c window.c window.h
[src/osd/windows]vconv.c winprefix.h

trunk/3rdparty/bgfx/src/renderer_d3d11.cpp
r243358r243359
345345   static const GUID IID_IDXGIDevice2          = { 0x05008617, 0xfbfd, 0x4051, { 0xa7, 0x90, 0x14, 0x48, 0x84, 0xb4, 0xf6, 0xa9 } };
346346   static const GUID IID_IDXGIDevice3          = { 0x6007896c, 0x3244, 0x4afd, { 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23 } };
347347   static const GUID IID_IDXGIAdapter          = { 0x2411e7e1, 0x12ac, 0x4ccf, { 0xbd, 0x14, 0x97, 0x98, 0xe8, 0x53, 0x4d, 0xc0 } };
348   static const GUID IID_ID3D11InfoQueue      = { 0x6543dbb6, 0x1b48, 0x42f5, { 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6 } };
349348
350349   static const GUID s_deviceIIDs[] =
351350   {
r243358r243359
670669         if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
671670         {
672671            ID3D11InfoQueue* infoQueue;
673            hr = m_device->QueryInterface(IID_ID3D11InfoQueue, (void**)&infoQueue);
672            hr = m_device->QueryInterface(__uuidof(ID3D11InfoQueue), (void**)&infoQueue);
674673
675674            if (SUCCEEDED(hr) )
676675            {
trunk/src/lib/lib.mak
r243358r243359
646646
647647BGFXINC = -I$(3RDPARTY)/bgfx/include -I$(3RDPARTY)/bgfx/3rdparty -I$(3RDPARTY)/bx/include -I$(3RDPARTY)/bgfx/3rdparty/khronos
648648ifdef MSVC_BUILD
649   BGFXINC += -I$(3RDPARTY)/bx/include/compat/msvc /EHsc
649   BGFXINC += -I$(3RDPARTY)/bx/include/compat/msvc
650650else
651651   ifeq ($(TARGETOS),win32)
652652      BGFXINC += -I$(3RDPARTY)/bx/include/compat/mingw
653      ifeq ($(PTR64),1)
654      BGFXINC += -L$(3RDPARTY)/dxsdk/lib/x64 -D_WIN32_WINNT=0x601
655      else
656      BGFXINC += -L$(3RDPARTY)/dxsdk/lib/x86 -D_WIN32_WINNT=0x601
657      endif
658653   endif
659654   ifeq ($(TARGETOS),freebsd)
660655      BGFXINC += -I$(3RDPARTY)/bx/include/compat/freebsd
r243358r243359
666661
667662ifeq ($(TARGETOS),win32)
668663BGFXINC += -I$(3RDPARTY)/dxsdk/Include
664ifeq ($(PTR64),1)
665BGFXINC += -L$(3RDPARTY)/dxsdk/lib/x64 -D_WIN32_WINNT=0x601
666else
667BGFXINC += -L$(3RDPARTY)/dxsdk/lib/x86 -D_WIN32_WINNT=0x601
669668endif
669endif
670670
671671$(LIBOBJ)/bgfx/%.o: $(3RDPARTY)/bgfx/src/%.cpp | $(OSPREBUILD)
672672   @echo Compiling $<...
trunk/src/mame/drivers/aleck64.c
r243358r243359
975975   PIF_BOOTROM
976976
977977   ROM_REGION32_BE( 0x4000000, "user2", 0 )
978   ROM_LOAD16_WORD_SWAP( "nus-zcaj.u4", 0x000000, 0x1000000, CRC(c9de64db) SHA1(59932c70b43ff8e9264c670f37b3abbe939b7f95) )
978   ROM_LOAD16_WORD_SWAP( "nus-zcaj.u4", 0x000000, 0x1000000, CRC(ec4563fc) SHA1(4d5a30873a5850cf4cd1c0bdbe24e1934f163cd0) )
979
979980   ROM_REGION32_BE( 0x100000, "user3", 0 )
980981   ROM_LOAD ( "tet-01m.u5", 0x000000, 0x100000, CRC(f78f859b) SHA1(b07c85e0453869fe43792f42081f64a5327e58e6) )
981982
trunk/src/mame/drivers/bloodbro.c
r243358r243359
131131   AM_RANGE(0x000000, 0x07ffff) AM_ROM
132132   AM_RANGE(0x080000, 0x08afff) AM_RAM
133133   AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_SHARE("spriteram")
134   AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
134   AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bloodbro_bgvideoram_w) AM_SHARE("bgvideoram")
135135   AM_RANGE(0x08c400, 0x08cfff) AM_RAM
136   AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram")
136   AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(bloodbro_fgvideoram_w) AM_SHARE("fgvideoram")
137137   AM_RANGE(0x08d400, 0x08d7ff) AM_RAM
138   AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
138   AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(bloodbro_txvideoram_w) AM_SHARE("txvideoram")
139139   AM_RANGE(0x08e000, 0x08e7ff) AM_RAM
140140   AM_RANGE(0x08e800, 0x08f7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
141141   AM_RANGE(0x08f800, 0x08ffff) AM_RAM
r243358r243359
163163   AM_RANGE(0x000000, 0x07ffff) AM_ROM
164164   AM_RANGE(0x080000, 0x08afff) AM_RAM
165165   AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_SHARE("spriteram")
166   AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
166   AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bloodbro_bgvideoram_w) AM_SHARE("bgvideoram")
167167   AM_RANGE(0x08c400, 0x08cfff) AM_RAM
168   AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram")
168   AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(bloodbro_fgvideoram_w) AM_SHARE("fgvideoram")
169169   AM_RANGE(0x08d400, 0x08d7ff) AM_RAM
170   AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram")
170   AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(bloodbro_txvideoram_w) AM_SHARE("txvideoram")
171171   AM_RANGE(0x08e000, 0x08ffff) AM_RAM
172172   AM_RANGE(0x0c1000, 0x0c1001) AM_READ_PORT("DSW")
173173   AM_RANGE(0x0c1002, 0x0c1003) AM_READ_PORT("IN0")
r243358r243359
663663
664664/* Game Drivers */
665665
666GAME( 1990, bloodbro, 0,        bloodbro, bloodbro, driver_device, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
667GAME( 1990, bloodbroa,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
668GAME( 1990, bloodbrob,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 3)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
669GAME( 1990, weststry, bloodbro, weststry, weststry, driver_device, 0, ROT0,   "bootleg (Datsu)", "West Story (bootleg of Blood Bros.)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
670GAME( 1990, skysmash, 0,        skysmash, skysmash, driver_device, 0, ROT270, "Nihon System",    "Sky Smasher", 0 | GAME_SUPPORTS_SAVE )
666GAME( 1990, bloodbro, 0,        bloodbro, bloodbro, driver_device, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 1)", GAME_NO_COCKTAIL )
667GAME( 1990, bloodbroa,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 2)", GAME_NO_COCKTAIL )
668GAME( 1990, bloodbrob,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0,   "TAD Corporation", "Blood Bros. (set 3)", GAME_NO_COCKTAIL )
669GAME( 1990, weststry, bloodbro, weststry, weststry, driver_device, 0, ROT0,   "bootleg (Datsu)", "West Story (bootleg of Blood Bros.)", GAME_NO_COCKTAIL | GAME_NO_SOUND )
670GAME( 1990, skysmash, 0,        skysmash, skysmash, driver_device, 0, ROT270, "Nihon System",    "Sky Smasher", 0 )
trunk/src/mame/drivers/dcon.c
r243358r243359
2626   AM_RANGE(0x00000, 0x7ffff) AM_ROM
2727   AM_RANGE(0x80000, 0x8bfff) AM_RAM
2828
29   AM_RANGE(0x8c000, 0x8c7ff) AM_RAM_WRITE(background_w) AM_SHARE("back_data")
30   AM_RANGE(0x8c800, 0x8cfff) AM_RAM_WRITE(foreground_w) AM_SHARE("fore_data")
31   AM_RANGE(0x8d000, 0x8d7ff) AM_RAM_WRITE(midground_w) AM_SHARE("mid_data")
32   AM_RANGE(0x8d800, 0x8e7ff) AM_RAM_WRITE(text_w) AM_SHARE("textram")
29   AM_RANGE(0x8c000, 0x8c7ff) AM_RAM_WRITE(dcon_background_w) AM_SHARE("back_data")
30   AM_RANGE(0x8c800, 0x8cfff) AM_RAM_WRITE(dcon_foreground_w) AM_SHARE("fore_data")
31   AM_RANGE(0x8d000, 0x8d7ff) AM_RAM_WRITE(dcon_midground_w) AM_SHARE("mid_data")
32   AM_RANGE(0x8d800, 0x8e7ff) AM_RAM_WRITE(dcon_text_w) AM_SHARE("textram")
3333   AM_RANGE(0x8e800, 0x8f7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
3434   AM_RANGE(0x8f800, 0x8ffff) AM_RAM AM_SHARE("spriteram")
35   AM_RANGE(0x9d000, 0x9d7ff) AM_WRITE(gfxbank_w)
35   AM_RANGE(0x9d000, 0x9d7ff) AM_WRITE(dcon_gfxbank_w)
3636
3737   AM_RANGE(0xa0000, 0xa000d) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, main_word_r, main_word_w)
3838   AM_RANGE(0xc0000, 0xc004f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
r243358r243359
403403}
404404
405405
406GAME( 1991, sdgndmps, 0, sdgndmps, sdgndmps, dcon_state, sdgndmps, ROT0, "Banpresto / Bandai", "SD Gundam Psycho Salamander no Kyoui", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
407GAME( 1992, dcon,     0, dcon,     dcon, driver_device,     0,        ROT0, "Success",            "D-Con", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
406GAME( 1991, sdgndmps, 0, sdgndmps, sdgndmps, dcon_state, sdgndmps, ROT0, "Banpresto / Bandai", "SD Gundam Psycho Salamander no Kyoui", GAME_NO_COCKTAIL )
407GAME( 1992, dcon,     0, dcon,     dcon, driver_device,     0,        ROT0, "Success",            "D-Con", GAME_NO_COCKTAIL )
trunk/src/mame/drivers/goodejan.c
r243358r243359
7878public:
7979   goodejan_state(const machine_config &mconfig, device_type type, const char *tag)
8080      : driver_device(mconfig, type, tag),
81      m_maincpu(*this, "maincpu"),
82      m_gfxdecode(*this, "gfxdecode"),
83      m_palette(*this, "palette"),
8481      m_sc0_vram(*this, "sc0_vram"),
8582      m_sc1_vram(*this, "sc1_vram"),
8683      m_sc2_vram(*this, "sc2_vram"),
8784      m_sc3_vram(*this, "sc3_vram"),
88      m_spriteram16(*this, "sprite_ram") { }
85      m_spriteram16(*this, "sprite_ram"),
86      m_maincpu(*this, "maincpu"),
87      m_gfxdecode(*this, "gfxdecode"),
88      m_palette(*this, "palette") { }
8989
90   required_device<cpu_device> m_maincpu;
91   required_device<gfxdecode_device> m_gfxdecode;
92   required_device<palette_device> m_palette;
93
9490   required_shared_ptr<UINT16> m_sc0_vram;
9591   required_shared_ptr<UINT16> m_sc1_vram;
9692   required_shared_ptr<UINT16> m_sc2_vram;
9793   required_shared_ptr<UINT16> m_sc3_vram;
9894   required_shared_ptr<UINT16> m_spriteram16;
99
95   required_device<cpu_device> m_maincpu;
96   required_device<gfxdecode_device> m_gfxdecode;
97   required_device<palette_device> m_palette;
10098   tilemap_t *m_sc0_tilemap;
10199   tilemap_t *m_sc1_tilemap;
102100   tilemap_t *m_sc2_tilemap;
103101   tilemap_t *m_sc3_tilemap;
104   
105102   UINT16 m_mux_data;
106103   UINT16 m_seibucrtc_sc0bank;
107   UINT16 m_layer_en;
108   UINT16 m_scrollram[6];
109   
110   DECLARE_WRITE16_MEMBER(gfxbank_w);
104   DECLARE_WRITE16_MEMBER(goodejan_gfxbank_w);
111105   DECLARE_READ16_MEMBER(mahjong_panel_r);
112106   DECLARE_WRITE16_MEMBER(mahjong_panel_w);
113107   DECLARE_WRITE16_MEMBER(seibucrtc_sc0vram_w);
114108   DECLARE_WRITE16_MEMBER(seibucrtc_sc1vram_w);
115109   DECLARE_WRITE16_MEMBER(seibucrtc_sc2vram_w);
116110   DECLARE_WRITE16_MEMBER(seibucrtc_sc3vram_w);
117   DECLARE_WRITE16_MEMBER(layer_en_w);
118   DECLARE_WRITE16_MEMBER(layer_scroll_w);
119   
120111   TILE_GET_INFO_MEMBER(seibucrtc_sc0_tile_info);
121112   TILE_GET_INFO_MEMBER(seibucrtc_sc1_tile_info);
122113   TILE_GET_INFO_MEMBER(seibucrtc_sc2_tile_info);
123114   TILE_GET_INFO_MEMBER(seibucrtc_sc3_tile_info);
124   
125   INTERRUPT_GEN_MEMBER(irq);
126   
115   INTERRUPT_GEN_MEMBER(goodejan_irq);
116   DECLARE_WRITE16_MEMBER(layer_en_w);
117   DECLARE_WRITE16_MEMBER(layer_scroll_w);
118   UINT16 m_layer_en;
119   UINT16 m_scrollram[6];
127120   void seibucrtc_sc0bank_w(UINT16 data);
128121   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri);
129122   virtual void video_start();
130   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
123   UINT32 screen_update_goodejan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
131124};
132125
133126/*******************************
r243358r243359
355348   m_sc3_tilemap->set_transparent_pen(15);
356349
357350   m_seibucrtc_sc0bank = 0;
358   
359   save_item(NAME(m_mux_data));
360   save_item(NAME(m_seibucrtc_sc0bank));
361   save_item(NAME(m_layer_en));
362   save_item(NAME(m_scrollram));
363351}
364352
365UINT32 goodejan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
353UINT32 goodejan_state::screen_update_goodejan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
366354{
367355   bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen
368356
r243358r243359
393381#define GOODEJAN_MHZ3 12000000
394382
395383
396WRITE16_MEMBER(goodejan_state::gfxbank_w)
384WRITE16_MEMBER(goodejan_state::goodejan_gfxbank_w)
397385{
398386   seibucrtc_sc0bank_w((data & 0x100)>>8);
399387}
r243358r243359
435423
436424/* totmejan CRTC is at 8000-804f,goodejan is at 8000-807f */
437425static ADDRESS_MAP_START( common_io_map, AS_IO, 16, goodejan_state )
438   AM_RANGE(0x9000, 0x9001) AM_WRITE(gfxbank_w)
426   AM_RANGE(0x9000, 0x9001) AM_WRITE(goodejan_gfxbank_w)
439427   AM_RANGE(0xb000, 0xb003) AM_WRITENOP
440428   AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w)
441429
r243358r243359
604592   GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x100, 0x10 ) /* Text */
605593GFXDECODE_END
606594
607INTERRUPT_GEN_MEMBER(goodejan_state::irq)
595INTERRUPT_GEN_MEMBER(goodejan_state::goodejan_irq)
608596{
609597   device.execute().set_input_line_and_vector(0,HOLD_LINE,0x208/4);
610598/* vector 0x00c is just a reti */
r243358r243359
628616   MCFG_CPU_ADD("maincpu", V30, GOODEJAN_MHZ2/2)
629617   MCFG_CPU_PROGRAM_MAP(goodejan_map)
630618   MCFG_CPU_IO_MAP(goodejan_io_map)
631   MCFG_CPU_VBLANK_INT_DRIVER("screen", goodejan_state, irq)
619   MCFG_CPU_VBLANK_INT_DRIVER("screen", goodejan_state, goodejan_irq)
632620
633621   SEIBU_SOUND_SYSTEM_CPU(GOODEJAN_MHZ1/2)
634622
r243358r243359
638626   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
639627   MCFG_SCREEN_SIZE(32*8, 32*8)
640628   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) //TODO: dynamic resolution
641   MCFG_SCREEN_UPDATE_DRIVER(goodejan_state, screen_update)
629   MCFG_SCREEN_UPDATE_DRIVER(goodejan_state, screen_update_goodejan)
642630   MCFG_SCREEN_PALETTE("palette")
643631
644632   MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
r243358r243359
754742   ROM_LOAD( "fmj08.083", 0x000, 0x100, CRC(9657b7ad) SHA1(e9b469c2b3534593f7fe0ea19cbbf93b55957e42) )
755743ROM_END
756744
757GAME( 1991, totmejan, 0,        totmejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
758GAME( 1991, goodejan, 0,        goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
759GAME( 1991, goodejana,goodejan, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
745GAME( 1991, totmejan, 0,        totmejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS )
746GAME( 1991, goodejan, 0,        goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS )
747GAME( 1991, goodejana,goodejan, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS )
trunk/src/mame/drivers/lindbergh.c
r243358r243359
3131The security seems to work in multiple steps.  The information here
3232is a combination of our research and things found on the internet.
3333
34- At boot, the bios unlocks the CF card through an IDE command.  There
35  is also a hardware heartbeat signal on the IDE bus to avoid
36  hotswapping, and making it hard to dump the card outside of a Lindberg
37  motherboard.
34- At boot, the bios unlocks the CF card through an IDE 0x82 command
35  with a currently unknown key.  There is also a hardware heartbeat
36  signal on the IDE bus to avoid hotswapping.
3837
3938- The system boots on the CF which holds a customized Montavista linux.
4039
41- The CF system can either install the game (from the DVD) or start it
42  (on the HD) through the "/usr/sbin/segaboot" executable in the second
43  partition.
40- The CF system can either install the game (from the DVD) or start it (on the HD)
4441
45- The DVD includes an ISO-9660 filesystem at a (game-dependant)
46  offset. It has a handful of files, all encrypted.  Of specific
47  interest and the su[0-3].dat files which are system updates, and the
48  frontend file which handles the setup of all the other files for the
49  game.
42- The DVD is decrypted (probably on-the-fly with aesloop) using a
43  fixed system key (all the dvd images start identically).
5044
5145- The PIC includes an AES-CBC engine and has as data an IV, a key,
5246  some game-specific identification information, and two pre and
r243358r243359
5549  decrypt very large amounts of data through it though, the bandwidth
5650  would be way too low.
5751
58- The CF decrypts the dvd/hd files with a custom crypto system which
59  is keyed by the result of decrypting 16 times 0x00, 16 times 0x01,
60  ..., 16 times 0x0b through the PIC, giving a 176 bytes secondary key.
61  segaboot (in the second partition) and lxdecrypt_hard (in the first
62  partition's initrd) take care of that.
52- The HD is probably unlocked by the CF and bootstrap code is
53  decrypted through the PIC.  That code in turn loop-decrypts/mounts all the
54  data needed from the partition (probably /usr, /X11R6 and /home).
6355
64- The HD is unlocked by the CF with lxunlock.hdb in the first
65  partition's initrd.  The method varies depending on the HD model.
66  That code is also capable of unlocking the CF (but don't forget
67  the hardware hearbeat there).
56Currently, we do not have access to the CF image, making it impossible
57to do a complete boot/install.
6858
6959
7060Lindbergh Game List
r243358r243359
396386   ROM_LOAD("fpr-24370b.ic6", 0x000000, 0x400000, CRC(c3b021a4) SHA1(1b6938a50fe0e4ae813864649eb103838c399ac0)) \
397387\
398388   ROM_REGION32_LE(0x10000, ":pci:01.0:00.0", 0) /* Geforce bios extension (custom for the card) */ \
399   ROM_LOAD("vid_bios.u504", 0x00000, 0x10000, CRC(f78d14d7) SHA1(f129787e487984edd23bf344f2e9500c85052275)) \
400   DISK_REGION("cf") \
401   DISK_IMAGE_READONLY("mda-c0004a_revb_lindyellow_v2.4.20_mvl31a_boot_2.01", 0, SHA1(e13da5f827df852e742b594729ee3f933b387410))
402
403
389   ROM_LOAD("vid_bios.u504", 0x00000, 0x10000, CRC(f78d14d7) SHA1(f129787e487984edd23bf344f2e9500c85052275))
404390ROM_START(lindbios)
405391   LINDBERGH_BIOS
406392ROM_END
trunk/src/mame/drivers/naomi.c
r243358r243359
34663466
34673467   // 840-0016    1999     317-0262-JPN   Naomi
34683468   ROM_PARAMETER( ":rom_board:segam2crypt:key", "280fee35" )
3469/*
3470   838-13661 RS422/RS232C BD DOC
3471   IC1 - Toshiba TMPZ84C015BF-10 Z80-based MCU
3472   IC6 - Toshiba TC551001CF-70L 128k x8 SRAM
3473   IC8 - Sega 315-5338A
3474   OSC1 - 19.680MHz OSC2 - 32.000MHz
3475
3476   connected between Naomi motherboard and card reader/printer, accessed via MIE MCU ports 0x09-0x0d
3477*/
3478   ROM_REGION( 0x10000, "rs422_io", 0 )
3479   ROM_LOAD( "epr-22083.ic7",  0x0000, 0x10000, CRC(c70b0de9) SHA1(329c924b4d29017482b1ecca839fb610ca20b2af) )
34803469ROM_END
34813470
34823471ROM_START( derbyocw )
r243358r243359
39443933   ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") // 315-5881 not populated
39453934ROM_END
39463935
3947// IC22 shown in ROM TEST as BAD, but its byte summ matches written on label, verified on 2 cartridges
39483936ROM_START( hotd2p )
39493937   HOTD2_BIOS
39503938   NAOMI_DEFAULT_EEPROM
r243358r243359
39763964   ROM_LOAD( "mpr-21404.ic19s", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) )
39773965   ROM_LOAD( "mpr-21405.ic20s", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) )
39783966
3979   // 315-5881 populated, have no 317-xxxx label, key unknown
3980   ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1")
3967   ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") // 315-5881 not populated
39813968ROM_END
39823969
39833970/*
r243358r243359
51705157   ROM_PARAMETER( ":rom_board:segam2crypt:key", "280a8b5d" )
51715158ROM_END
51725159
5173// !!! partial dump, only IC22 dumped. without correct flashroms contents game crashes at certain points.
51745160// prototype - only works with US BIOS
51755161ROM_START( sambap )
51765162   NAOMI_BIOS
r243358r243359
77857771   ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF)
77867772   //PIC16C621A (317-0567-EXP)
77877773   //(sticker 253-5508-0567)
7788   ROM_LOAD("317-0567-exp.pic", 0x00, 0x4000, CRC(cd1d2b2d) SHA1(78203ee0339f76eb76da08d7de43e7e44e4b7d32) )
7774   ROM_LOAD("317-0567-exp.pic", 0x00, 0x4000, NO_DUMP )
77897775ROM_END
77907776
77917777
r243358r243359
85718557   ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE)
85728558   ROM_LOAD( "610-0752.u3",  0x0000000, 0x1000000, CRC(bab6182e) SHA1(4d25256c81941316887cbb4524a203922f5b7104) )
85738559   ROM_LOAD( "610-0752.u1",  0x1000000, 0x1000000, CRC(3086bc47) SHA1(eb7b04db90d296985528f0cfdd4545f184c40b64) )
8574   ROM_LOAD( "610-0752.u4",  0x2000000, 0x1000000, CRC(9787f145) SHA1(8445ede0477f70fbdc113810b80356945ce498d2) )
8575   ROM_LOAD( "610-0752.u2",  0x3000000, 0x1000000, CRC(d3a88b31) SHA1(ccf14367e4e7efbc2cc835f3b001fd6d64302a5e) )
8576   ROM_LOAD( "610-0752.u15", 0x4000000, 0x1000000, CRC(864a6342) SHA1(fb97532d5dd00f8520fdaf68dfcd1ea627bdf90a) )
8577   ROM_LOAD( "610-0752.u17", 0x5000000, 0x1000000, CRC(a79fb1fa) SHA1(f75c5b574fd79677b926c595b369e95605a3c848) )
8578   ROM_LOAD( "610-0752.u14", 0x6000000, 0x1000000, CRC(ce83bcc7) SHA1(e2d324a5a7eacbec7b0df9a4b9e276521bb9ab80) )
8579   ROM_LOAD( "610-0752.u16", 0x7000000, 0x1000000, CRC(8ac71c76) SHA1(080e41e633bf082fc536781541c6031d1ac81939) )
8560   ROM_LOAD( "610-0752.u2",  0x2000000, 0x1000000, CRC(d3a88b31) SHA1(ccf14367e4e7efbc2cc835f3b001fd6d64302a5e) )
8561   ROM_LOAD( "610-0752.u4",  0x3000000, 0x1000000, CRC(9787f145) SHA1(8445ede0477f70fbdc113810b80356945ce498d2) )
8562   ROM_LOAD( "610-0752.u14", 0x4000000, 0x1000000, CRC(ce83bcc7) SHA1(e2d324a5a7eacbec7b0df9a4b9e276521bb9ab80) )
8563   ROM_LOAD( "610-0752.u15", 0x5000000, 0x1000000, CRC(864a6342) SHA1(fb97532d5dd00f8520fdaf68dfcd1ea627bdf90a) )
8564   ROM_LOAD( "610-0752.u16", 0x6000000, 0x1000000, CRC(8ac71c76) SHA1(080e41e633bf082fc536781541c6031d1ac81939) )
8565   ROM_LOAD( "610-0752.u17", 0x7000000, 0x1000000, CRC(a79fb1fa) SHA1(f75c5b574fd79677b926c595b369e95605a3c848) )
85808566
85818567   ROM_REGION( 4, "rom_key", 0 )
85828568   ROM_LOAD( "315-6248.bin", 0, 4, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
r243358r243359
88268812   ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE)
88278813   ROM_LOAD( "695-0014.u3",  0x0000000, 0x1000000, CRC(9fdd7d07) SHA1(56d580dda116823ea5dc5e1bd5154463a476866a) )
88288814   ROM_LOAD( "695-0014.u1",  0x1000000, 0x1000000, CRC(a91d2fcb) SHA1(8414386c09ba36ea581c8161f6cf2a13cc5ae516) )
8829   ROM_LOAD( "695-0014.u4",  0x2000000, 0x1000000, CRC(3342f237) SHA1(e617b0e1f8d8da9783c58ab98eb91de2363ec36f) )
8830   ROM_LOAD( "695-0014.u2",  0x3000000, 0x1000000, CRC(4d82152f) SHA1(a448983d4e81eb6485b62f23a6c99d1112a20c21) )
8831   ROM_LOAD( "695-0014.u15", 0x4000000, 0x1000000, CRC(d239a549) SHA1(71f3c1c2ae2a9b6f09f30e7be3bb11ba111276ae) )
8832   ROM_LOAD( "695-0014.u17", 0x5000000, 0x1000000, CRC(16bb5992) SHA1(18772587272aba1d50a48d384f472276c3b48d96) )
8833   ROM_LOAD( "695-0014.u14", 0x6000000, 0x1000000, CRC(55470242) SHA1(789036189ae5488a9da565774bdf91b49cd8264e) )
8834   ROM_LOAD( "695-0014.u16", 0x7000000, 0x1000000, CRC(730180a4) SHA1(017b82e2d2744695e3e521d35a8511ecc1c8ab43) )
8815   ROM_LOAD( "695-0014.u2",  0x2000000, 0x1000000, CRC(4d82152f) SHA1(a448983d4e81eb6485b62f23a6c99d1112a20c21) )
8816   ROM_LOAD( "695-0014.u4",  0x3000000, 0x1000000, CRC(3342f237) SHA1(e617b0e1f8d8da9783c58ab98eb91de2363ec36f) )
8817   ROM_LOAD( "695-0014.u14", 0x4000000, 0x1000000, CRC(55470242) SHA1(789036189ae5488a9da565774bdf91b49cd8264e) )
8818   ROM_LOAD( "695-0014.u15", 0x5000000, 0x1000000, CRC(d239a549) SHA1(71f3c1c2ae2a9b6f09f30e7be3bb11ba111276ae) )
8819   ROM_LOAD( "695-0014.u16", 0x6000000, 0x1000000, CRC(730180a4) SHA1(017b82e2d2744695e3e521d35a8511ecc1c8ab43) )
8820   ROM_LOAD( "695-0014.u17", 0x7000000, 0x1000000, CRC(16bb5992) SHA1(18772587272aba1d50a48d384f472276c3b48d96) )
88358821
88368822   ROM_REGION( 4, "rom_key", 0 )
88378823   ROM_LOAD( "695-0014.bin", 0, 4, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) )
trunk/src/mame/drivers/sengokmj.c
r243358r243359
6666public:
6767   sengokmj_state(const machine_config &mconfig, device_type type, const char *tag)
6868      : driver_device(mconfig, type, tag),
69      m_maincpu(*this, "maincpu"),
70      m_gfxdecode(*this, "gfxdecode"),
71      m_palette(*this, "palette"),
7269      m_sc0_vram(*this, "sc0_vram"),
7370      m_sc1_vram(*this, "sc1_vram"),
7471      m_sc2_vram(*this, "sc2_vram"),
7572      m_sc3_vram(*this, "sc3_vram"),
76      m_spriteram16(*this, "sprite_ram") { }
73      m_spriteram16(*this, "sprite_ram"),
74      m_maincpu(*this, "maincpu"),
75      m_gfxdecode(*this, "gfxdecode"),
76      m_palette(*this, "palette") { }
7777
78   required_device<cpu_device> m_maincpu;
79   required_device<gfxdecode_device> m_gfxdecode;
80   required_device<palette_device> m_palette;
81
8278   required_shared_ptr<UINT16> m_sc0_vram;
8379   required_shared_ptr<UINT16> m_sc1_vram;
8480   required_shared_ptr<UINT16> m_sc2_vram;
8581   required_shared_ptr<UINT16> m_sc3_vram;
8682   required_shared_ptr<UINT16> m_spriteram16;
87
83   required_device<cpu_device> m_maincpu;
84   required_device<gfxdecode_device> m_gfxdecode;
85   required_device<palette_device> m_palette;
8886   tilemap_t *m_sc0_tilemap;
8987   tilemap_t *m_sc1_tilemap;
9088   tilemap_t *m_sc2_tilemap;
9189   tilemap_t *m_sc3_tilemap;
92   
93   UINT16 m_mux_data;
90   UINT16 m_sengokumj_mux_data;
9491   UINT8 m_hopper_io;
9592   UINT16 m_layer_en;
9693   UINT16 m_scrollram[6];
97   
9894   DECLARE_READ16_MEMBER(mahjong_panel_r);
9995   DECLARE_WRITE16_MEMBER(mahjong_panel_w);
100   DECLARE_WRITE16_MEMBER(out_w);
101   DECLARE_READ16_MEMBER(system_r);
96   DECLARE_WRITE16_MEMBER(sengokmj_out_w);
97   DECLARE_READ16_MEMBER(sengokmj_system_r);
10298   DECLARE_WRITE16_MEMBER(seibucrtc_sc0vram_w);
10399   DECLARE_WRITE16_MEMBER(seibucrtc_sc1vram_w);
104100   DECLARE_WRITE16_MEMBER(seibucrtc_sc2vram_w);
105101   DECLARE_WRITE16_MEMBER(seibucrtc_sc3vram_w);
106   DECLARE_WRITE16_MEMBER(layer_en_w);
107   DECLARE_WRITE16_MEMBER(layer_scroll_w);
108   
109102   TILE_GET_INFO_MEMBER(seibucrtc_sc0_tile_info);
110103   TILE_GET_INFO_MEMBER(seibucrtc_sc1_tile_info);
111104   TILE_GET_INFO_MEMBER(seibucrtc_sc2_tile_info);
112105   TILE_GET_INFO_MEMBER(seibucrtc_sc3_tile_info);
113   
114   INTERRUPT_GEN_MEMBER(interrupt);
106   INTERRUPT_GEN_MEMBER(sengokmj_interrupt);
107   DECLARE_WRITE16_MEMBER(layer_en_w);
108   DECLARE_WRITE16_MEMBER(layer_scroll_w);
115109
116   virtual void machine_start();
117   virtual void video_start();
118
119110   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri);
120   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
111   virtual void video_start();
112   UINT32 screen_update_sengokmj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
121113};
122114
123115
r243358r243359
302294   m_sc2_tilemap->set_transparent_pen(15);
303295   m_sc1_tilemap->set_transparent_pen(15);
304296   m_sc3_tilemap->set_transparent_pen(15);
305
306   save_item(NAME(m_layer_en));
307   save_item(NAME(m_scrollram));
308297}
309298
310UINT32 sengokmj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
299UINT32 sengokmj_state::screen_update_sengokmj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
311300{
312301   bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen
313302
r243358r243359
334323}
335324
336325
337void sengokmj_state::machine_start()
338{
339   save_item(NAME(m_mux_data));
340   save_item(NAME(m_hopper_io));
341}
342326
343327
344328/* Multiplexer device for the mahjong panel */
r243358r243359
350334
351335   for(i=0;i<5;i++)
352336   {
353      if(m_mux_data & 1 << i)
337      if(m_sengokumj_mux_data & 1 << i)
354338         res = ioport(mpnames[i])->read();
355339   }
356340
r243358r243359
359343
360344WRITE16_MEMBER(sengokmj_state::mahjong_panel_w)
361345{
362   m_mux_data = (data & 0x3f00) >> 8;
346   m_sengokumj_mux_data = (data & 0x3f00) >> 8;
363347
364348   if(data & 0xc0ff)
365349      logerror("Write to mux %04x\n",data);
366350}
367351
368WRITE16_MEMBER(sengokmj_state::out_w)
352WRITE16_MEMBER(sengokmj_state::sengokmj_out_w)
369353{
370354   /* ---- ---- ---x ---- J.P. Signal (?)*/
371355   /* ---- ---- ---- -x-- Coin counter (done AFTER you press start)*/
r243358r243359
378362//  popmessage("%02x",m_hopper_io);
379363}
380364
381READ16_MEMBER(sengokmj_state::system_r)
365READ16_MEMBER(sengokmj_state::sengokmj_system_r)
382366{
383367   return (ioport("SYSTEM")->read() & 0xffbf) | m_hopper_io;
384368}
r243358r243359
403387//  AM_RANGE(0x8080, 0x8081) CRTC extra register?
404388//  AM_RANGE(0x80c0, 0x80c1) CRTC extra register?
405389//  AM_RANGE(0x8100, 0x8101) AM_WRITENOP // always 0
406   AM_RANGE(0x8180, 0x8181) AM_WRITE(out_w)
390   AM_RANGE(0x8180, 0x8181) AM_WRITE(sengokmj_out_w)
407391   AM_RANGE(0x8140, 0x8141) AM_WRITE(mahjong_panel_w)
408392   AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1")
409393   AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r)
410   AM_RANGE(0xc004, 0xc005) AM_READ(system_r) //switches
394   AM_RANGE(0xc004, 0xc005) AM_READ(sengokmj_system_r) //switches
411395ADDRESS_MAP_END
412396
413397
r243358r243359
554538   GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x700, 0x10 ) /* Text */
555539GFXDECODE_END
556540
557INTERRUPT_GEN_MEMBER(sengokmj_state::interrupt)
541INTERRUPT_GEN_MEMBER(sengokmj_state::sengokmj_interrupt)
558542{
559543   device.execute().set_input_line_and_vector(0,HOLD_LINE,0xc8/4);
560544}
r243358r243359
576560   MCFG_CPU_ADD("maincpu", V30, 16000000/2) /* V30-8 */
577561   MCFG_CPU_PROGRAM_MAP(sengokmj_map)
578562   MCFG_CPU_IO_MAP(sengokmj_io_map)
579   MCFG_CPU_VBLANK_INT_DRIVER("screen", sengokmj_state,  interrupt)
563   MCFG_CPU_VBLANK_INT_DRIVER("screen", sengokmj_state,  sengokmj_interrupt)
580564
581565   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
582566
r243358r243359
588572   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
589573   MCFG_SCREEN_SIZE(64*8, 32*8)
590574   MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1) //TODO: dynamic resolution
591   MCFG_SCREEN_UPDATE_DRIVER(sengokmj_state, screen_update)
575   MCFG_SCREEN_UPDATE_DRIVER(sengokmj_state, screen_update_sengokmj)
592576   MCFG_SCREEN_PALETTE("palette")
593577
594578   MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0)
r243358r243359
640624   ROM_LOAD( "rs006.89", 0x000, 0x200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */
641625ROM_END
642626
643GAME( 1991, sengokmj, 0, sengokmj, sengokmj, driver_device, 0, ROT0, "Sigma", "Sengoku Mahjong [BET] (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
627GAME( 1991, sengokmj, 0, sengokmj, sengokmj, driver_device, 0, ROT0, "Sigma", "Sengoku Mahjong [BET] (Japan)", GAME_IMPERFECT_GRAPHICS )
644628/*Non-Bet Version?*/
trunk/src/mame/drivers/silvmil.c
r243358r243359
261261   PORT_SERVICE_DIPLOC(  0x8000, IP_ACTIVE_LOW, "SW2:8" ) /* Verified */
262262INPUT_PORTS_END
263263
264
265static INPUT_PORTS_START( puzzlove )
266   PORT_START("P1_P2")
267   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_PLAYER(1)
268   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_PLAYER(1)
269   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_PLAYER(1)
270   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
271   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
272   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
273   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
274   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
275   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_PLAYER(2)
276   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_PLAYER(2)
277   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_PLAYER(2)
278   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
279   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
280   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
281   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
282   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
283
284   PORT_START("COIN")
285   PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
286   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
287   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 )
288   PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNKNOWN )
289
290   PORT_START("DSW")
291   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:1")
292   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
293   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
294   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:2")
295   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
296   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
297   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:3")
298   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
299   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
300   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:4")
301   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
302   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
303   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:5")
304   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
305   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
306   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:6")
307   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
308   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
309   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:7")
310   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
311   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
312   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )      PORT_DIPLOCATION("SW2:8")
313   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
314   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
315   PORT_DIPNAME( 0x0300, 0x0300, "Game Level" )      PORT_DIPLOCATION("SW1:1,2") /* Difficulty?? - Not sure how this works for Easy --> Very Hard */
316   PORT_DIPSETTING(      0x0300, "1" ) /* Initial start time 40 secs */
317   PORT_DIPSETTING(      0x0200, "2" ) /* Initial start time 30 secs - Other in game effects?? */
318   PORT_DIPSETTING(      0x0100, "3" ) /* Initial start time 30 secs - Other in game effects?? */
319   PORT_DIPSETTING(      0x0000, "4" ) /* Initial start time 30 secs - Other in game effects?? */
320   PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:3,4,5")
321   PORT_DIPSETTING(      0x1000, DEF_STR( 4C_1C ) )
322   PORT_DIPSETTING(      0x1400, DEF_STR( 3C_1C ) )
323   PORT_DIPSETTING(      0x0000, DEF_STR( 4C_2C ) ) /* Works the same as 2C/1C */
324   PORT_DIPSETTING(      0x1800, DEF_STR( 2C_1C ) )
325   PORT_DIPSETTING(      0x0400, DEF_STR( 3C_2C ) ) /* Works like 2C/1C then 1C/1C repeat */
326   PORT_DIPSETTING(      0x0800, DEF_STR( 2C_2C ) ) /* Works the same as 1C/1C */
327   PORT_DIPSETTING(      0x1c00, DEF_STR( 1C_1C ) )
328   PORT_DIPSETTING(      0x0c00, DEF_STR( 1C_2C ) )
329   PORT_DIPNAME( 0x2000, 0x2000, "Coin Box" )      PORT_DIPLOCATION("SW1:6") /* Always displays total credits - No separate Credit display per player */
330   PORT_DIPSETTING(      0x2000, "1" ) /* Both players use coins from either Coin 1 or Coin 2 */
331   PORT_DIPSETTING(      0x0000, "2" ) /* Players use coins from own coin chute. IE: Player 1 -> Coin 1, Player 2 -> Coin 2 but shows only total credits */
332   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW1:7")
333   PORT_DIPSETTING(      0x0000, "2" )
334   PORT_DIPSETTING(      0x4000, "3" )
335   PORT_SERVICE_DIPLOC(  0x8000, IP_ACTIVE_LOW, "SW1:8" ) /* Verified */
336INPUT_PORTS_END
337
338
339
340264static const gfx_layout tlayout =
341265{
342266   16,16,
r243358r243359
428352   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2)
429353MACHINE_CONFIG_END
430354
431static MACHINE_CONFIG_DERIVED( puzzlove, silvmil )
432   MCFG_DEVICE_MODIFY("spritegen")
433   MCFG_DECO_SPRITE_BOOTLEG_TYPE(1)
434MACHINE_CONFIG_END
435355
436356ROM_START( silvmil )
437357   ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */
r243358r243359
485405   ROM_LOAD16_BYTE( "d-20_u56.bin", 0x100001, 0x80000, CRC(e67c2c7d) SHA1(cddfd6a3d934e71853af62e3d2bf312618c9b4ff) )
486406ROM_END
487407
488ROM_START( puzzlove )
489   ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */
490   ROM_LOAD16_BYTE( "3.u3", 0x00000, 0x40000, CRC(826c8472) SHA1(54f1a9fa0431de840d6fce466e09098a8d601660) )
491   ROM_LOAD16_BYTE( "4.u2", 0x00001, 0x40000, CRC(64ddc708) SHA1(60b29f8cd5dd654be34452fd197a77abc872e63d) )
492408
493   ROM_REGION( 0x20000, "audiocpu", 0 ) /* z80  */
494   ROM_LOAD( "1.uz02", 0x00000, 0x20000, CRC(3077e7f3) SHA1(e2bf634a2166e1851486a801e74a7ec0d4599c28) )
495
496   ROM_REGION( 0x40000, "oki", 0 ) /* samples */
497   ROM_LOAD( "2.uz11", 0x00000, 0x40000, CRC(4c06ec68) SHA1(3cfca1c98e73c65a45b65d43e012c5529572c057) )
498
499   ROM_REGION( 0x100000, "gfx1", 0 )
500   ROM_LOAD16_BYTE( "10.u41",   0x000000, 0x20000, CRC(7200f878) SHA1(27c6389f802f6e0af0210e2b01788914c0eb1d04) )
501   ROM_CONTINUE ( 0x080000,0x20000 )
502   ROM_CONTINUE ( 0x040000,0x20000 )
503   ROM_CONTINUE ( 0x0c0000,0x20000 )
504   ROM_LOAD16_BYTE( "9.u42",   0x000001, 0x20000, CRC(21b1b297) SHA1(0f589d1c62d0f79b1379e4444b119bdc4cc70cfb) )
505   ROM_CONTINUE ( 0x080001,0x20000 )
506   ROM_CONTINUE ( 0x040001,0x20000 )
507   ROM_CONTINUE ( 0x0c0001,0x20000 )
508
509   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
510   ROM_LOAD16_BYTE( "5.u53", 0x000000, 0x80000, CRC(8707d5a0) SHA1(05480ac34982a4e4768b7f3fccd2e557ca4b2545) )
511   ROM_LOAD16_BYTE( "6.u54", 0x000001, 0x80000, CRC(60a6d614) SHA1(0693c08c51d6b3a05373c9999f01b0b8d23a1c89) )
512   ROM_LOAD16_BYTE( "7.u55", 0x100000, 0x80000, CRC(0f2ea5c4) SHA1(4cb46fc6272e3cc14dfdcd7831157433ee7cf247) )
513   ROM_LOAD16_BYTE( "8.u56", 0x100001, 0x80000, CRC(037dcd3d) SHA1(fcdf604710518982e0b4acc81a56fa703d0c9407) )
514ROM_END
515
516409void silvmil_state::tumblepb_gfx1_rearrange()
517410{
518411   UINT8 *rom = memregion("gfx1")->base();
r243358r243359
539432   tumblepb_gfx1_rearrange();
540433}
541434
542GAME( 1995, silvmil,  0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE )
543GAME( 1994, puzzlove, 0, puzzlove,puzzlove,silvmil_state, silvmil, ROT0,   "Para", "PuzzLove", GAME_SUPPORTS_SAVE )
435GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/toki.c
r243358r243359
9191   AM_RANGE(0x060000, 0x06d7ff) AM_RAM
9292   AM_RANGE(0x06d800, 0x06dfff) AM_RAM AM_SHARE("spriteram")
9393   AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
94   AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(background1_videoram_w) AM_SHARE("bg1_vram")
95   AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(background2_videoram_w) AM_SHARE("bg2_vram")
96   AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(foreground_videoram_w) AM_SHARE("videoram")
94   AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_SHARE("bg1_vram16")
95   AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_SHARE("bg2_vram16")
96   AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_SHARE("videoram")
9797   AM_RANGE(0x080000, 0x08000d) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, main_word_r, main_word_w)
98   AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_SHARE("scrollram")
98   AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_SHARE("scrollram16")
9999   AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW")
100100   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS")
101101   AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM")
r243358r243359
106106   AM_RANGE(0x000000, 0x05ffff) AM_ROM
107107   AM_RANGE(0x060000, 0x06dfff) AM_RAM
108108   AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
109   AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(background1_videoram_w) AM_SHARE("bg1_vram")
110   AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(background2_videoram_w) AM_SHARE("bg2_vram")
111   AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(foreground_videoram_w) AM_SHARE("videoram")
109   AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_SHARE("bg1_vram16")
110   AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_SHARE("bg2_vram16")
111   AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_SHARE("videoram")
112112   AM_RANGE(0x071000, 0x071001) AM_WRITENOP    /* sprite related? seems another scroll register */
113113            /* gets written the same value as 75000a (bg2 scrollx) */
114114   AM_RANGE(0x071804, 0x071807) AM_WRITENOP    /* sprite related, always 01be0100 */
115115   AM_RANGE(0x07180e, 0x071e45) AM_WRITEONLY AM_SHARE("spriteram")
116116   AM_RANGE(0x072000, 0x072001) AM_READ(watchdog_reset16_r)   /* probably */
117117   AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand16_w)
118   AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram")
118   AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram16")
119119   AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW")
120120   AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS")
121121   AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM")
r243358r243359
826826         memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800);
827827      }
828828   }
829   
830   save_item(NAME(m_msm5205next));
831   save_item(NAME(m_toggle));
832829}
833830
834831DRIVER_INIT_MEMBER(toki_state,jujuba)
r243358r243359
880877
881878
882879// these 2 are both unique revisions
883GAME( 1989, toki,  0,    toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation", "Toki (World, set 1)", GAME_SUPPORTS_SAVE )
884GAME( 1989, tokiu, toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", GAME_SUPPORTS_SAVE )
880GAME( 1989, toki,  0,    toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation", "Toki (World, set 1)", 0 )
881GAME( 1989, tokiu, toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", 0 )
885882
886883// these 3 are all the same revision, only the region byte differs
887GAME( 1989, tokia, toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation", "Toki (World, set 2)", GAME_SUPPORTS_SAVE )
888GAME( 1989, tokiua,toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", GAME_SUPPORTS_SAVE )
889GAME( 1989, juju,  toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", GAME_SUPPORTS_SAVE )
884GAME( 1989, tokia, toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation", "Toki (World, set 2)", 0 )
885GAME( 1989, tokiua,toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", 0 )
886GAME( 1989, juju,  toki, toki,  toki, toki_state,  toki,  ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", 0 )
890887
891GAME( 1990, tokib,  toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", GAME_SUPPORTS_SAVE )
892GAME( 1990, jujub,  toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", GAME_SUPPORTS_SAVE )
888GAME( 1990, tokib,  toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", 0 )
889GAME( 1990, jujub,  toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", 0 )
893890/* Sound hardware seems to have been slightly modified, the coins are handled ok, but there is no music and bad sfx.  Program roms have a slight bitswap, Flipscreen also seems to be ignored */
894GAME( 1989, jujuba, toki, toki,  toki, toki_state,  jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // bootleg of tokia/juju revison
891GAME( 1989, jujuba, toki, toki,  toki, toki_state,  jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND ) // bootleg of tokia/juju revison
trunk/src/mame/includes/bloodbro.h
r243358r243359
33public:
44   bloodbro_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu"),
7      m_gfxdecode(*this, "gfxdecode"),
8      m_palette(*this, "palette"),
96      m_spriteram(*this, "spriteram"),
107      m_bgvideoram(*this, "bgvideoram"),
118      m_fgvideoram(*this, "fgvideoram"),
12      m_txvideoram(*this, "txvideoram") { }
9      m_txvideoram(*this, "txvideoram"),
10      m_maincpu(*this, "maincpu"),
11      m_gfxdecode(*this, "gfxdecode"),
12      m_palette(*this, "palette") { }
1313
14   required_device<cpu_device> m_maincpu;
15   required_device<gfxdecode_device> m_gfxdecode;
16   required_device<palette_device> m_palette;
17   
1814   required_shared_ptr<UINT16> m_spriteram;
1915   required_shared_ptr<UINT16> m_bgvideoram;
2016   required_shared_ptr<UINT16> m_fgvideoram;
r243358r243359
2218
2319   UINT16 m_scrollram[6];
2420   UINT16 m_layer_en;
25   
2621   tilemap_t *m_bg_tilemap;
2722   tilemap_t *m_fg_tilemap;
2823   tilemap_t *m_tx_tilemap;
2924
30   DECLARE_WRITE16_MEMBER(bgvideoram_w);
31   DECLARE_WRITE16_MEMBER(fgvideoram_w);
32   DECLARE_WRITE16_MEMBER(txvideoram_w);
25   DECLARE_WRITE16_MEMBER(bloodbro_bgvideoram_w);
26   DECLARE_WRITE16_MEMBER(bloodbro_fgvideoram_w);
27   DECLARE_WRITE16_MEMBER(bloodbro_txvideoram_w);
3328   DECLARE_WRITE16_MEMBER(layer_en_w);
3429   DECLARE_WRITE16_MEMBER(layer_scroll_w);
35   
3630   TILE_GET_INFO_MEMBER(get_bg_tile_info);
3731   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3832   TILE_GET_INFO_MEMBER(get_tx_tile_info);
39   
4033   virtual void video_start();
41   
4234   UINT32 screen_update_bloodbro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4335   UINT32 screen_update_weststry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4436   UINT32 screen_update_skysmash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4537   void bloodbro_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4638   void weststry_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39   required_device<cpu_device> m_maincpu;
40   required_device<gfxdecode_device> m_gfxdecode;
41   required_device<palette_device> m_palette;
4742};
trunk/src/mame/includes/dcon.h
r243358r243359
33public:
44   dcon_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu"),
7      m_gfxdecode(*this, "gfxdecode"),
8      m_palette(*this, "palette"),
96      m_back_data(*this, "back_data"),
107      m_fore_data(*this, "fore_data"),
118      m_mid_data(*this, "mid_data"),
129      m_textram(*this, "textram"),
13      m_spriteram(*this, "spriteram") { }
10      m_spriteram(*this, "spriteram"),
11      m_maincpu(*this, "maincpu"),
12      m_gfxdecode(*this, "gfxdecode"),
13      m_palette(*this, "palette") { }
1414
15   required_device<cpu_device> m_maincpu;
16   required_device<gfxdecode_device> m_gfxdecode;
17   required_device<palette_device> m_palette;
18
1915   required_shared_ptr<UINT16> m_back_data;
2016   required_shared_ptr<UINT16> m_fore_data;
2117   required_shared_ptr<UINT16> m_mid_data;
2218   required_shared_ptr<UINT16> m_textram;
2319   required_shared_ptr<UINT16> m_spriteram;
24
2520   tilemap_t *m_background_layer;
2621   tilemap_t *m_foreground_layer;
2722   tilemap_t *m_midground_layer;
2823   tilemap_t *m_text_layer;
29
24   UINT16 m_enable;
3025   int m_gfx_bank_select;
3126   int m_last_gfx_bank;
3227   UINT16 m_scroll_ram[6];
33   UINT16 m_layer_en;
34
3528   DECLARE_WRITE16_MEMBER(layer_en_w);
3629   DECLARE_WRITE16_MEMBER(layer_scroll_w);
37   DECLARE_WRITE16_MEMBER(gfxbank_w);
38   DECLARE_WRITE16_MEMBER(background_w);
39   DECLARE_WRITE16_MEMBER(foreground_w);
40   DECLARE_WRITE16_MEMBER(midground_w);
41   DECLARE_WRITE16_MEMBER(text_w);
30   UINT16 m_layer_en;
4231
32   DECLARE_WRITE16_MEMBER(dcon_gfxbank_w);
33   DECLARE_WRITE16_MEMBER(dcon_background_w);
34   DECLARE_WRITE16_MEMBER(dcon_foreground_w);
35   DECLARE_WRITE16_MEMBER(dcon_midground_w);
36   DECLARE_WRITE16_MEMBER(dcon_text_w);
37   DECLARE_DRIVER_INIT(sdgndmps);
4338   TILE_GET_INFO_MEMBER(get_back_tile_info);
4439   TILE_GET_INFO_MEMBER(get_fore_tile_info);
4540   TILE_GET_INFO_MEMBER(get_mid_tile_info);
4641   TILE_GET_INFO_MEMBER(get_text_tile_info);
47   
48   DECLARE_DRIVER_INIT(sdgndmps);
4942   virtual void video_start();
50   
5143   UINT32 screen_update_dcon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5244   UINT32 screen_update_sdgndmps(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5345   void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect);
46   required_device<cpu_device> m_maincpu;
47   required_device<gfxdecode_device> m_gfxdecode;
48   required_device<palette_device> m_palette;
5449};
trunk/src/mame/includes/toki.h
r243358r243359
77public:
88   toki_state(const machine_config &mconfig, device_type type, const char *tag)
99      : driver_device(mconfig, type, tag),
10         m_spriteram(*this, "spriteram") ,
11      m_background1_videoram16(*this, "bg1_vram16"),
12      m_background2_videoram16(*this, "bg2_vram16"),
13      m_videoram(*this, "videoram"),
14      m_scrollram16(*this, "scrollram16"),
1015      m_maincpu(*this, "maincpu"),
1116      m_audiocpu(*this, "audiocpu"),
1217      m_seibu_sound(*this, "seibu_sound"),
1318      m_msm(*this, "msm"),
1419      m_gfxdecode(*this, "gfxdecode"),
1520      m_screen(*this, "screen"),
16      m_palette(*this, "palette"),
17      m_spriteram(*this, "spriteram") ,
18      m_background1_videoram(*this, "bg1_vram"),
19      m_background2_videoram(*this, "bg2_vram"),
20      m_videoram(*this, "videoram"),
21      m_scrollram(*this, "scrollram") { }
21      m_palette(*this, "palette") { }
2222
23   required_device<buffered_spriteram16_device> m_spriteram;
24   required_shared_ptr<UINT16> m_background1_videoram16;
25   required_shared_ptr<UINT16> m_background2_videoram16;
26   required_shared_ptr<UINT16> m_videoram;
27   required_shared_ptr<UINT16> m_scrollram16;
28
2329   required_device<cpu_device> m_maincpu;
2430   required_device<cpu_device> m_audiocpu;
2531   optional_device<seibu_sound_device> m_seibu_sound;
r243358r243359
2834   required_device<screen_device> m_screen;
2935   required_device<palette_device> m_palette;
3036
31   required_device<buffered_spriteram16_device> m_spriteram;
32   required_shared_ptr<UINT16> m_background1_videoram;
33   required_shared_ptr<UINT16> m_background2_videoram;
34   required_shared_ptr<UINT16> m_videoram;
35   required_shared_ptr<UINT16> m_scrollram;
36
3737   int m_msm5205next;
3838   int m_toggle;
39
4039   tilemap_t *m_background_layer;
4140   tilemap_t *m_foreground_layer;
4241   tilemap_t *m_text_layer;
4342
4443   DECLARE_WRITE16_MEMBER(tokib_soundcommand16_w);
4544   DECLARE_READ16_MEMBER(pip16_r);
45   DECLARE_WRITE8_MEMBER(toki_adpcm_data_w);
4646   DECLARE_WRITE16_MEMBER(toki_control_w);
47   DECLARE_WRITE16_MEMBER(foreground_videoram_w);
48   DECLARE_WRITE16_MEMBER(background1_videoram_w);
49   DECLARE_WRITE16_MEMBER(background2_videoram_w);
47   DECLARE_WRITE16_MEMBER(toki_foreground_videoram16_w);
48   DECLARE_WRITE16_MEMBER(toki_background1_videoram16_w);
49   DECLARE_WRITE16_MEMBER(toki_background2_videoram16_w);
5050   DECLARE_WRITE8_MEMBER(toki_adpcm_control_w);
51   DECLARE_WRITE8_MEMBER(toki_adpcm_data_w);
52   DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int);
53
5451   DECLARE_DRIVER_INIT(tokib);
5552   DECLARE_DRIVER_INIT(jujuba);
5653   DECLARE_DRIVER_INIT(toki);
57
5854   TILE_GET_INFO_MEMBER(get_text_tile_info);
5955   TILE_GET_INFO_MEMBER(get_back_tile_info);
6056   TILE_GET_INFO_MEMBER(get_fore_tile_info);
61
6257   virtual void video_start();
63
6458   UINT32 screen_update_toki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6559   UINT32 screen_update_tokib(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6660   void toki_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
6761   void tokib_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect);
62   DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int);
6863};
trunk/src/mame/mame.lst
r243358r243359
1047910479heuksun         // (c) 1998 Oksan / F2 System
1048010480bestri          // (c) F2 System
1048110481silvmil         // (c) 1995 Para
10482puzzlove      // (c) 1994 Para
1048310482funybubl        // (c) 1999 In Chang Electronic Co
1048410483funybublc       // (c) 1999 Comad Industries
1048510484dcheese         // (c) 1993 HAR
trunk/src/mame/video/bloodbro.c
r243358r243359
6161
6262   m_fg_tilemap->set_transparent_pen(15);
6363   m_tx_tilemap->set_transparent_pen(15);
64   
65   save_item(NAME(m_scrollram));
66   save_item(NAME(m_layer_en));
6764}
6865
6966
r243358r243359
7471
7572***************************************************************************/
7673
77WRITE16_MEMBER(bloodbro_state::bgvideoram_w)
74WRITE16_MEMBER(bloodbro_state::bloodbro_bgvideoram_w)
7875{
7976   COMBINE_DATA(&m_bgvideoram[offset]);
8077   m_bg_tilemap->mark_tile_dirty(offset);
8178}
8279
83WRITE16_MEMBER(bloodbro_state::fgvideoram_w)
80WRITE16_MEMBER(bloodbro_state::bloodbro_fgvideoram_w)
8481{
8582   COMBINE_DATA(&m_fgvideoram[offset]);
8683   m_fg_tilemap->mark_tile_dirty(offset);
8784}
8885
89WRITE16_MEMBER(bloodbro_state::txvideoram_w)
86WRITE16_MEMBER(bloodbro_state::bloodbro_txvideoram_w)
9087{
9188   COMBINE_DATA(&m_txvideoram[offset]);
9289   m_tx_tilemap->mark_tile_dirty(offset);
trunk/src/mame/video/dcon.c
r243358r243359
1010
1111/******************************************************************************/
1212
13WRITE16_MEMBER(dcon_state::gfxbank_w)
13WRITE16_MEMBER(dcon_state::dcon_gfxbank_w)
1414{
1515   if (data&1)
1616      m_gfx_bank_select=0x1000;
r243358r243359
1818      m_gfx_bank_select=0;
1919}
2020
21WRITE16_MEMBER(dcon_state::background_w)
21WRITE16_MEMBER(dcon_state::dcon_background_w)
2222{
2323   COMBINE_DATA(&m_back_data[offset]);
2424   m_background_layer->mark_tile_dirty(offset);
2525}
2626
27WRITE16_MEMBER(dcon_state::foreground_w)
27WRITE16_MEMBER(dcon_state::dcon_foreground_w)
2828{
2929   COMBINE_DATA(&m_fore_data[offset]);
3030   m_foreground_layer->mark_tile_dirty(offset);
3131}
3232
33WRITE16_MEMBER(dcon_state::midground_w)
33WRITE16_MEMBER(dcon_state::dcon_midground_w)
3434{
3535   COMBINE_DATA(&m_mid_data[offset]);
3636   m_midground_layer->mark_tile_dirty(offset);
3737}
3838
39WRITE16_MEMBER(dcon_state::text_w)
39WRITE16_MEMBER(dcon_state::dcon_text_w)
4040{
4141   COMBINE_DATA(&m_textram[offset]);
4242   m_text_layer->mark_tile_dirty(offset);
r243358r243359
106106   m_text_layer->set_transparent_pen(15);
107107
108108   m_gfx_bank_select = 0;
109   
110   save_item(NAME(m_gfx_bank_select));
111   save_item(NAME(m_last_gfx_bank));
112   save_item(NAME(m_scroll_ram));
113   save_item(NAME(m_layer_en));
114109}
115110
116111void dcon_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect)
trunk/src/mame/video/decospr.c
r243358r243359
150150      device_video_interface(mconfig, *this),
151151      m_gfxregion(0),
152152      m_is_bootleg(false),
153      m_bootleg_type(0),
154153      m_x_offset(0),
155154      m_y_offset(0),
156155      m_flipallx(0),
r243358r243359
233232      {
234233         sprite = spriteram[offs + 1];
235234         y = spriteram[offs];
236         
237         if (m_is_bootleg && (m_bootleg_type == 1))
238         {
239            flash = y & 0x0400;
240         }
241         else
242         {
243            flash = y & 0x1000;
244         }
245
235         flash = y & 0x1000;
246236         w = y & 0x0800;
247237
248238
r243358r243359
268258
269259            fx = y & 0x2000;
270260            fy = y & 0x4000;
261            multi = (1 << ((y & 0x0600) >> 9)) - 1; /* 1x, 2x, 4x, 8x height */
271262
272            int tempwidth = 0;
273
274            if (m_is_bootleg && (m_bootleg_type==1))  // puzzlove
275            {
276               tempwidth = (y & 0x1000) >> 12;
277               tempwidth |= (y & 0x0200) >> 8;
278            }
279            else
280            {
281               tempwidth |= (y & 0x0600) >> 9;
282            }
283
284            multi = (1 << (tempwidth)) - 1; /* 1x, 2x, 4x, 8x height */
285
286263            /* bootleg support (esd16.c) */
287264            if (flipscreen) x = ((x&0x1ff) - m_x_offset)&0x1ff;
288265            else x = ((x&0x1ff) + m_x_offset)&0x1ff;
trunk/src/mame/video/decospr.h
r243358r243359
2121   static void set_pri_callback(device_t &device, decospr_pri_cb_delegate callback) { downcast<decospr_device &>(device).m_pri_cb = callback; }
2222   static void set_col_callback(device_t &device, decospr_col_cb_delegate callback) { downcast<decospr_device &>(device).m_col_cb = callback; }
2323   static void set_is_bootleg(device_t &device, bool is_bootleg) { downcast<decospr_device &>(device).m_is_bootleg = is_bootleg; }
24   static void set_bootleg_type(device_t &device, int bootleg_type) { downcast<decospr_device &>(device).m_bootleg_type = bootleg_type; }
2524   static void set_flipallx(device_t &device, int flipallx) { downcast<decospr_device &>(device).m_flipallx = flipallx; }
2625   static void set_transpen(device_t &device, int transpen) { downcast<decospr_device &>(device).m_transpen = transpen; }
2726   static void set_offsets(device_t &device, int x_offset, int y_offset)
r243358r243359
5655
5756   // used by various bootleg / clone chips.
5857   bool m_is_bootleg; // used by various bootlegs (disables masking of sprite tile number when multi-sprite is used)
59   int m_bootleg_type; // for Puzzlove, has sprite bits moved around (probably to prevent board swaps)
6058   int m_x_offset, m_y_offset; // used by various bootlegs
6159   int m_flipallx; // used by esd16.c - hedpanio, multchmp , and nmg5.c
6260   int m_transpen; // used by fncywld (tumbleb.c)
r243358r243359
8280#define MCFG_DECO_SPRITE_ISBOOTLEG(_boot) \
8381   decospr_device::set_is_bootleg(*device, _boot);
8482
85#define MCFG_DECO_SPRITE_BOOTLEG_TYPE(_bootleg_type) \
86   decospr_device::set_bootleg_type(*device, _bootleg_type);
87
8883#define MCFG_DECO_SPRITE_FLIPALLX(_flip) \
8984   decospr_device::set_flipallx(*device, _flip);
9085
trunk/src/mame/video/toki.c
r243358r243359
2929WRITE16_MEMBER(toki_state::toki_control_w)
3030{
3131   m_screen->update_partial(m_screen->vpos() - 1);
32   COMBINE_DATA(&m_scrollram[offset]);
32   COMBINE_DATA(&m_scrollram16[offset]);
3333}
3434
3535TILE_GET_INFO_MEMBER(toki_state::get_text_tile_info)
r243358r243359
4848
4949TILE_GET_INFO_MEMBER(toki_state::get_back_tile_info)
5050{
51   int tile = m_background1_videoram[tile_index];
51   int tile = m_background1_videoram16[tile_index];
5252   int color = (tile >> 12) & 0xf;
5353
5454   tile &= 0xfff;
r243358r243359
6161
6262TILE_GET_INFO_MEMBER(toki_state::get_fore_tile_info)
6363{
64   int tile = m_background2_videoram[tile_index];
64   int tile = m_background2_videoram16[tile_index];
6565   int color = (tile >> 12) & 0xf;
6666
6767   tile &= 0xfff;
r243358r243359
9292
9393/*************************************/
9494
95WRITE16_MEMBER(toki_state::foreground_videoram_w)
95WRITE16_MEMBER(toki_state::toki_foreground_videoram16_w)
9696{
9797   UINT16 *videoram = m_videoram;
9898   COMBINE_DATA(&videoram[offset]);
9999   m_text_layer->mark_tile_dirty(offset);
100100}
101101
102WRITE16_MEMBER(toki_state::background1_videoram_w)
102WRITE16_MEMBER(toki_state::toki_background1_videoram16_w)
103103{
104   COMBINE_DATA(&m_background1_videoram[offset]);
104   COMBINE_DATA(&m_background1_videoram16[offset]);
105105   m_background_layer->mark_tile_dirty(offset);
106106}
107107
108WRITE16_MEMBER(toki_state::background2_videoram_w)
108WRITE16_MEMBER(toki_state::toki_background2_videoram16_w)
109109{
110   COMBINE_DATA(&m_background2_videoram[offset]);
110   COMBINE_DATA(&m_background2_videoram16[offset]);
111111   m_foreground_layer->mark_tile_dirty(offset);
112112}
113113
r243358r243359
249249{
250250   int background_y_scroll,foreground_y_scroll,background_x_scroll,foreground_x_scroll;
251251
252   background_x_scroll=((m_scrollram[0x06] &0x7f) << 1)
253                           |((m_scrollram[0x06] &0x80) >> 7)
254                           |((m_scrollram[0x05] &0x10) << 4);
255   background_y_scroll=((m_scrollram[0x0d]&0x10)<<4)+((m_scrollram[0x0e]&0x7f)<<1)+((m_scrollram[0x0e]&0x80)>>7);
252   background_x_scroll=((m_scrollram16[0x06] &0x7f) << 1)
253                           |((m_scrollram16[0x06] &0x80) >> 7)
254                           |((m_scrollram16[0x05] &0x10) << 4);
255   background_y_scroll=((m_scrollram16[0x0d]&0x10)<<4)+((m_scrollram16[0x0e]&0x7f)<<1)+((m_scrollram16[0x0e]&0x80)>>7);
256256
257257   m_background_layer->set_scrollx(0, background_x_scroll );
258258   m_background_layer->set_scrolly(0, background_y_scroll );
259259
260   foreground_x_scroll= ((m_scrollram[0x16] &0x7f) << 1)
261                           |((m_scrollram[0x16] &0x80) >> 7)
262                           |((m_scrollram[0x15] &0x10) << 4);
263   foreground_y_scroll=((m_scrollram[0x1d]&0x10)<<4)+((m_scrollram[0x1e]&0x7f)<<1)+((m_scrollram[0x1e]&0x80)>>7);
260   foreground_x_scroll= ((m_scrollram16[0x16] &0x7f) << 1)
261                           |((m_scrollram16[0x16] &0x80) >> 7)
262                           |((m_scrollram16[0x15] &0x10) << 4);
263   foreground_y_scroll=((m_scrollram16[0x1d]&0x10)<<4)+((m_scrollram16[0x1e]&0x7f)<<1)+((m_scrollram16[0x1e]&0x80)>>7);
264264
265265   m_foreground_layer->set_scrollx(0, foreground_x_scroll );
266266   m_foreground_layer->set_scrolly(0, foreground_y_scroll );
267267
268   flip_screen_set((m_scrollram[0x28]&0x8000)==0);
268   flip_screen_set((m_scrollram16[0x28]&0x8000)==0);
269269
270   if (m_scrollram[0x28]&0x100) {
270   if (m_scrollram16[0x28]&0x100) {
271271      m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
272272      m_foreground_layer->draw(screen, bitmap, cliprect, 0,0);
273273   } else {
r243358r243359
283283{
284284   m_foreground_layer->set_scroll_rows(1);
285285   m_background_layer->set_scroll_rows(1);
286   m_background_layer->set_scrolly(0, m_scrollram[0]+1 );
287   m_background_layer->set_scrollx(0, m_scrollram[1]-0x103 );
288   m_foreground_layer->set_scrolly(0, m_scrollram[2]+1 );
289   m_foreground_layer->set_scrollx(0, m_scrollram[3]-0x101 );
286   m_background_layer->set_scrolly(0, m_scrollram16[0]+1 );
287   m_background_layer->set_scrollx(0, m_scrollram16[1]-0x103 );
288   m_foreground_layer->set_scrolly(0, m_scrollram16[2]+1 );
289   m_foreground_layer->set_scrollx(0, m_scrollram16[3]-0x101 );
290290
291   if (m_scrollram[3]&0x2000) {
291   if (m_scrollram16[3]&0x2000) {
292292      m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0);
293293      m_foreground_layer->draw(screen, bitmap, cliprect, 0,0);
294294   } else {
trunk/src/mess/drivers/c65.c
r243358r243359
2020
2121#include "emu.h"
2222#include "cpu/m6502/m4510.h"
23#include "machine/mos6526.h"
2423
2524#define MAIN_CLOCK XTAL_3_5MHz
2625
r243358r243359
3029   c65_state(const machine_config &mconfig, device_type type, const char *tag)
3130      : driver_device(mconfig, type, tag),
3231         m_maincpu(*this, "maincpu"),
33         m_cia0(*this, "cia_0"),
34         m_cia1(*this, "cia_1"),
3532         m_screen(*this, "screen"),
3633         m_palette(*this, "palette"),
3734         m_workram(*this, "wram"),
r243358r243359
4542
4643   // devices
4744   required_device<m4510_device> m_maincpu;
48   required_device<mos6526_device> m_cia0;
49   required_device<mos6526_device> m_cia1;
5045   required_device<screen_device> m_screen;
5146   required_device<palette_device> m_palette;
5247   required_shared_ptr<UINT8> m_workram;
r243358r243359
5853   required_device<gfxdecode_device> m_gfxdecode;
5954
6055   UINT8 *m_iplrom;
61   UINT8 m_keyb_input[10];
62   UINT8 m_keyb_mux;
56
6357   
6458   DECLARE_READ8_MEMBER(vic4567_dummy_r);
6559   DECLARE_WRITE8_MEMBER(vic4567_dummy_w);
r243358r243359
6963   DECLARE_WRITE8_MEMBER(DMAgic_w);
7064   DECLARE_READ8_MEMBER(CIASelect_r);
7165   DECLARE_WRITE8_MEMBER(CIASelect_w);
72   DECLARE_READ8_MEMBER(cia0_porta_r);
73   DECLARE_WRITE8_MEMBER(cia0_porta_w);
74   DECLARE_READ8_MEMBER(cia0_portb_r);
75   DECLARE_WRITE8_MEMBER(cia0_portb_w);
76   DECLARE_WRITE_LINE_MEMBER(cia0_irq);
7766   
7867   DECLARE_READ8_MEMBER(dummy_r);
79
68   
8069   // screen updates
8170   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8271   DECLARE_PALETTE_INIT(c65);
r243358r243359
10089   UINT8 m_VIC3_ControlB;
10190   void PalEntryFlush(UINT8 offset);
10291   void DMAgicExecute(address_space &space,UINT32 address);
103   void IRQCheck(UINT8 irq_cause);
10492   int inner_x_char(int xoffs);
10593   int inner_y_char(int yoffs);
10694};
r243358r243359
166154      case 0x12:
167155         res = (m_screen->vpos() & 0xff);
168156         return res;
169      case 0x15:
170         return 0xff; // silence log for now
171      case 0x19:
172         return m_VIC2_IRQPend;
173     
174      case 0x1a:
175         return m_VIC2_IRQMask;
176         
177157      case 0x20:
178158         return m_VIC2_EXTColor;
179
159      case 0x19:
160         return m_VIC2_IRQPend;
180161      case 0x30:
181162         return m_VIC3_ControlA;
182163      case 0x31:
r243358r243359
193174   switch(offset)
194175   {
195176      case 0x19:
196         m_VIC2_IRQPend &= ~data;
197         IRQCheck(0);
177         m_VIC2_IRQPend = data & 0x8f;
198178         break;
199179      case 0x1a:
200180         m_VIC2_IRQMask = data & 0xf;
201         IRQCheck(0);
202181         break;
203182      case 0x20:
204183         m_VIC2_EXTColor = data & 0xf;
r243358r243359
328307   else
329308   {
330309      // CIA at 0xdc00
331      switch((offset & 0x700) | 0x800)
332      {
333         case 0xc00:
334            return m_cia0->read(space,offset);
335         case 0xd00:
336            return m_cia1->read(space,offset);
337         default:
338            printf("Unknown I/O access read to offset %04x\n",offset);
339            break;
340      }
341
342310   }
343311
344312   return 0xff;
r243358r243359
351319   else
352320   {
353321      // CIA at 0xdc00
354      switch((offset & 0x700) | 0x800)
355      {
356         case 0xc00:
357            m_cia0->write(space,offset,data);
358            break;
359
360         case 0xd00:
361            m_cia1->write(space,offset,data);
362            break;
363         default:
364            printf("Unknown I/O access write to offset %04x data = %02x\n",offset,data);
365            break;
366      }
367322   }
368323   
369324}
370325
371READ8_MEMBER(c65_state::cia0_porta_r)
372{
373
374   return 0xff;
375}
376
377READ8_MEMBER(c65_state::cia0_portb_r)
378{
379   static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
380   UINT8 res;
381   
382   res = 0xff;
383   for(int i=0;i<8;i++)
384   {
385     
386      m_keyb_input[i] = machine().root_device().ioport(c64ports[i])->read();
387
388      if(m_keyb_mux & 1 << (i))
389         res &= m_keyb_input[i];
390   }
391
392   return res;
393}
394
395WRITE8_MEMBER(c65_state::cia0_porta_w)
396{
397   m_keyb_mux = ~data;
398   printf("%02x\n",m_keyb_mux);
399}
400
401WRITE8_MEMBER(c65_state::cia0_portb_w)
402{
403}
404
405326READ8_MEMBER(c65_state::dummy_r)
406327{
407328   return 0;
r243358r243359
436357
437358
438359static INPUT_PORTS_START( c65 )
439   PORT_START( "ROW0" )
440   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Down Up") PORT_CODE(KEYCODE_RALT)        PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(UP))
441   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3)                                    PORT_CHAR(UCHAR_MAMEKEY(F5))
442   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2)                                    PORT_CHAR(UCHAR_MAMEKEY(F3))
443   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1)                                    PORT_CHAR(UCHAR_MAMEKEY(F1))
444   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4)                                    PORT_CHAR(UCHAR_MAMEKEY(F7))
445   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Right Left") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
446   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER)             PORT_CHAR(13)
447   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INST DEL") PORT_CODE(KEYCODE_BACKSPACE)       PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
360   /* dummy active high structure */
361   PORT_START("SYSA")
362   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
363   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
364   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
365   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
366   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
367   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
368   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
369   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
370   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
371   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
372   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
373   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
374   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
375   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
376   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
377   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
378   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
379   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
380   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
381   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
382   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
383   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
384   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
385   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
448386
449   PORT_START( "ROW1" )
450   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Left)") PORT_CODE(KEYCODE_LSHIFT)      PORT_CHAR(UCHAR_SHIFT_1)
451   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E)         PORT_CHAR('E')
452   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S)         PORT_CHAR('S')
453   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z)         PORT_CHAR('Z')
454   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4)         PORT_CHAR('4') PORT_CHAR('$')
455   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A)         PORT_CHAR('A')
456   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W)         PORT_CHAR('W')
457   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3)         PORT_CHAR('3') PORT_CHAR('#')
458
459   PORT_START( "ROW2" )
460   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X)         PORT_CHAR('X')
461   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T)         PORT_CHAR('T')
462   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F)         PORT_CHAR('F')
463   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C)         PORT_CHAR('C')
464   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6)         PORT_CHAR('6') PORT_CHAR('&')
465   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D)         PORT_CHAR('D')
466   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R)         PORT_CHAR('R')
467   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5)         PORT_CHAR('5') PORT_CHAR('%')
468
469   PORT_START( "ROW3" )
470   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V)         PORT_CHAR('V')
471   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)         PORT_CHAR('U')
472   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H)         PORT_CHAR('H')
473   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B)         PORT_CHAR('B')
474   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)         PORT_CHAR('8') PORT_CHAR('(')
475   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G)         PORT_CHAR('G')
476   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y)         PORT_CHAR('Y')
477   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7)         PORT_CHAR('7') PORT_CHAR('\'')
478
479   PORT_START( "ROW4" )
480   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N)         PORT_CHAR('N')
481   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O)         PORT_CHAR('O')
482   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K)         PORT_CHAR('K')
483   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M)         PORT_CHAR('M')
484   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0)         PORT_CHAR('0')
485   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)         PORT_CHAR('J')
486   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I)         PORT_CHAR('I')
487   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9)         PORT_CHAR('9') PORT_CHAR(')')
488
489   PORT_START( "ROW5" )
490   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA)     PORT_CHAR(',') PORT_CHAR('<')
491   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@')
492   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON)     PORT_CHAR(':') PORT_CHAR('[')
493   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP)      PORT_CHAR('.') PORT_CHAR('>')
494   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS)    PORT_CHAR('-')
495   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L)         PORT_CHAR('L')
496   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P)         PORT_CHAR('P')
497   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)     PORT_CHAR('+')
498
499   PORT_START( "ROW6" )
500   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH)                             PORT_CHAR('/') PORT_CHAR('?')
501   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x91  Pi") PORT_CODE(KEYCODE_DEL) PORT_CHAR(0x2191) PORT_CHAR(0x03C0)
502   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH)                         PORT_CHAR('=')
503   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Right)") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
504   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CLR HOME") PORT_CODE(KEYCODE_INSERT)      PORT_CHAR(UCHAR_MAMEKEY(HOME))
505   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE)                             PORT_CHAR(';') PORT_CHAR(']')
506   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE)                        PORT_CHAR('*')
507   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2)                        PORT_CHAR('\xA3')
508
509   PORT_START( "ROW7" )
510   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUN STOP") PORT_CODE(KEYCODE_HOME)
511   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q)                                 PORT_CHAR('Q')
512   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CBM") PORT_CODE(KEYCODE_LALT)
513   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE)                             PORT_CHAR(' ')
514   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2)                                 PORT_CHAR('2') PORT_CHAR('"')
515   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB)                               PORT_CHAR(UCHAR_SHIFT_2)
516   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x90") PORT_CODE(KEYCODE_TILDE)   PORT_CHAR(0x2190)
517   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1)                                 PORT_CHAR('1') PORT_CHAR('!')
518
387   /* dummy active low structure */
388   PORT_START("DSWA")
389   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
390   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
391   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
392   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
393   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
394   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
395   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
396   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
397   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
398   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
399   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
400   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
401   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
402   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
403   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
404   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
405   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
406   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
407   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
408   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
409   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
410   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
411   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
412   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
519413INPUT_PORTS_END
520414
521415
r243358r243359
551445   GFXDECODE_ENTRY( "maincpu", 0xd000, charlayout,     0, 16 ) // another identical copy is at 0x9000
552446GFXDECODE_END
553447
554void c65_state::IRQCheck(UINT8 irq_cause)
555{
556   m_VIC2_IRQPend |= (irq_cause != 0) ? 0x80 : 0x00;
557   m_VIC2_IRQPend |= irq_cause;
558   
559   m_maincpu->set_input_line(M4510_IRQ_LINE,m_VIC2_IRQMask & m_VIC2_IRQPend ? ASSERT_LINE : CLEAR_LINE);
560}
561
562448INTERRUPT_GEN_MEMBER(c65_state::vic3_vblank_irq)
563449{
564   IRQCheck(1);
565450   //if(m_VIC2_IRQMask & 1)
566451   //   m_maincpu->set_input_line(M4510_IRQ_LINE,HOLD_LINE);
567452}
568453
569WRITE_LINE_MEMBER(c65_state::cia0_irq)
570{
571   printf("%d IRQ\n",state);
572
573#if 0
574   if(state)
575   {
576      static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
577      for(int i=0;i<8;i++)
578         m_keyb_input[i] = machine().root_device().ioport(c64ports[i])->read();
579   }   
580#endif
581//   m_cia0_irq = state;
582//   c65_irq(state || m_vicirq);
583}
584
585454static MACHINE_CONFIG_START( c65, c65_state )
586455
587456   /* basic machine hardware */
r243358r243359
589458   MCFG_CPU_PROGRAM_MAP(c65_map)
590459   MCFG_CPU_VBLANK_INT_DRIVER("screen",c65_state,vic3_vblank_irq)
591460
592   MCFG_DEVICE_ADD("cia_0", MOS6526, MAIN_CLOCK)
593   MCFG_MOS6526_TOD(60)
594   MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, cia0_irq))
595   MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, cia0_porta_r))
596   MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, cia0_porta_w))
597   MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c65_state, cia0_portb_r))
598   MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c65_state, cia0_portb_w))
599
600   MCFG_DEVICE_ADD("cia_1", MOS6526, MAIN_CLOCK)
601   MCFG_MOS6526_TOD(60)
602//   MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, c65_cia1_interrupt))
603//   MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, c65_cia1_port_a_r))
604//   MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, c65_cia1_port_a_w))
605
606   
607461   /* video hardware */
608462   MCFG_SCREEN_ADD("screen", RASTER)
609463//  MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mess/drivers/mbee.c
r243358r243359
2222    The unemulated Matilda is a IBM XT clone fitted with a NEC V40, and has the
2323    ability to emulate the 256TC as mentioned above.
2424
25    Floppy formats:
26    - All disks are the standard CPCEMU 'dsk' format.
27    - Types are 9cm 80 track, and 13cm 40 track (single or double sided)
28    - 13cm has been specified as QD to prevent a nasty crash if an 80-track disk was mounted
29    - The tracks/sector layout is the same regardless of size
30    - Although certain models came with particular drives as standard, users could add
31      the other size if they wished. We support both sizes on any model.
25    Floppy Disk types (as used by ubee512)
26    - ss80 - single sided 80 track
27    - ds40 - double-sided 40 track - 400KB
28    - ds80, ds82, ds84 - double sided 80 track - 800KB
29    - dsk - various - 211KB, 421KB, 841KB
3230
3331    Microbee Standard / Plus memory map
3432
r243358r243359
8482
8583    - Fix Paste (it loses most of the characters)
8684
87    - all except 256tc: RTC is optional, but it is being totally ignored.
85    - RTC for 256TC works, but it is supposed to be an option on other
86      models. It is being completely ignored.
8887
8988    - Most early models have a clock in Telcom, and in the menu. It doesn't
9089      work.
9190
92    - various fdc issues:
93        - only some ds40 disks can be used. All 80-track disks fail.
94        - some disks show no or partial directory listing.
95        - some disks cause MESS to freeze.
96        - ENMF pin missing from wd_fdc.
97        - incorrect timing for track register causes 256tc failure to boot a disk.
98        - 56k model takes about 2 minutes to boot a disk if loaded via command line.
99   
100    - 256tc: At the menu, if F2 pressed to activate the Monitor, the emulated machine
101      crashes due to a bug in z80pio emulation.
102   
103    - 256tc: Keyboard ROM U60 needs to be dumped.
104    - 128k: PROM PAL needs to be dumped, so that the bankswitching can be fixed.
91    - The Monitor program on 256TC crashes the system. This appears
92      to be a MAME core bug involving the z80pio.
10593
94    - The 256TC corrupts itself when a floppy disk is detected.
95
96    - Disk system doesn't work because of fdc problems.
97
10698    - Teleterm: keyboard is problematic, and cursor doesn't show.
10799
108100
r243358r243359
121113      in the emulator for some years. Conversion to the new modern
122114      implementation (2013-07-05) has not resolved the issue.
123115
116      There are 3 types of microbee disks available in the wild.
117
118    - CPCEMU-format "dsk" disks, which has an already-working
119      format "dsk_dsk".
120
121    - ubee512-format disks, such as "ds80,ds82,ds84,ss80", etc.
122      These are described in "mbee_dsk", but it's not known if it
123      works as yet.
124
125    - There a "img" format for the 128k boot disk. The internal
126      layout is not known and no work has been done.
127
128
124129****************************************************************************/
125130
126131
127132#include "includes/mbee.h"
133#include "formats/mbee_dsk.h"
128134#include "formats/mbee_cas.h"
129135
130136
r243358r243359
213219   AM_RANGE(0xf800, 0xffff) AM_RAMBANK("bankfh")
214220ADDRESS_MAP_END
215221
216static ADDRESS_MAP_START(mbee256_mem, AS_PROGRAM, 8, mbee_state)
217   AM_RANGE(0x0000, 0x0fff) AM_READ_BANK("bankr0") AM_WRITE_BANK("bankw0")
218   AM_RANGE(0x1000, 0x1fff) AM_READ_BANK("bankr1") AM_WRITE_BANK("bankw1")
219   AM_RANGE(0x2000, 0x2fff) AM_READ_BANK("bankr2") AM_WRITE_BANK("bankw2")
220   AM_RANGE(0x3000, 0x3fff) AM_READ_BANK("bankr3") AM_WRITE_BANK("bankw3")
221   AM_RANGE(0x4000, 0x4fff) AM_READ_BANK("bankr4") AM_WRITE_BANK("bankw4")
222   AM_RANGE(0x5000, 0x5fff) AM_READ_BANK("bankr5") AM_WRITE_BANK("bankw5")
223   AM_RANGE(0x6000, 0x6fff) AM_READ_BANK("bankr6") AM_WRITE_BANK("bankw6")
224   AM_RANGE(0x7000, 0x7fff) AM_READ_BANK("bankr7") AM_WRITE_BANK("bankw7")
225   AM_RANGE(0x8000, 0x8fff) AM_READ_BANK("bankr8") AM_WRITE_BANK("bankw8")
226   AM_RANGE(0x9000, 0x9fff) AM_READ_BANK("bankr9") AM_WRITE_BANK("bankw9")
227   AM_RANGE(0xa000, 0xafff) AM_READ_BANK("bankr10") AM_WRITE_BANK("bankw10")
228   AM_RANGE(0xb000, 0xbfff) AM_READ_BANK("bankr11") AM_WRITE_BANK("bankw11")
229   AM_RANGE(0xc000, 0xcfff) AM_READ_BANK("bankr12") AM_WRITE_BANK("bankw12")
230   AM_RANGE(0xd000, 0xdfff) AM_READ_BANK("bankr13") AM_WRITE_BANK("bankw13")
231   AM_RANGE(0xe000, 0xefff) AM_READ_BANK("bankr14") AM_WRITE_BANK("bankw14")
232   AM_RANGE(0xf000, 0xffff) AM_READ_BANK("bankr15") AM_WRITE_BANK("bankw15")
233ADDRESS_MAP_END
234
235222static ADDRESS_MAP_START(mbeett_mem, AS_PROGRAM, 8, mbee_state)
236223   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
237224   AM_RANGE(0x1000, 0x7fff) AM_RAM
r243358r243359
627614static GFXDECODE_START( mbeeppc )
628615   GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 8 )
629616GFXDECODE_END
617#if 0
618static LEGACY_FLOPPY_OPTIONS_START(mbee)
619   LEGACY_FLOPPY_OPTION(ss80, "ss80", "SS80 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
620      HEADS([1])
621      TRACKS([80])
622      SECTORS([10])
623      SECTOR_LENGTH([512])
624      FIRST_SECTOR_ID([1]))
625   LEGACY_FLOPPY_OPTION(ds40, "ds40", "DS40 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
626      HEADS([2])
627      TRACKS([40])
628      SECTORS([10])
629      SECTOR_LENGTH([512])
630      FIRST_SECTOR_ID([1]))
631   LEGACY_FLOPPY_OPTION(ds80, "ds80", "DS80 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
632      HEADS([2])
633      TRACKS([80])
634      SECTORS([10])
635      SECTOR_LENGTH([512])
636      FIRST_SECTOR_ID([21]))
637   LEGACY_FLOPPY_OPTION(ds84, "ds82,ds84", "DS84 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
638      HEADS([2])
639      TRACKS([80])
640      SECTORS([10])
641      SECTOR_LENGTH([512])
642      FIRST_SECTOR_ID([1]))
643LEGACY_FLOPPY_OPTIONS_END
630644
645static const floppy_interface mbee_floppy_interface =
646{
647   FLOPPY_STANDARD_5_25_DSHD,
648   LEGACY_FLOPPY_OPTIONS_NAME(mbee),
649   NULL
650};
651#endif
652
653FLOPPY_FORMATS_MEMBER( mbee_state::floppy_formats )
654   FLOPPY_MBEE_FORMAT
655FLOPPY_FORMATS_END
656
631657static SLOT_INTERFACE_START( mbee_floppies )
632   SLOT_INTERFACE( "drive3a", FLOPPY_35_DD )
633   SLOT_INTERFACE( "drive3b", FLOPPY_35_DD )
634   SLOT_INTERFACE( "drive5a", FLOPPY_525_QD )
635   SLOT_INTERFACE( "drive5b", FLOPPY_525_QD )
658   SLOT_INTERFACE( "35dd", FLOPPY_35_DD )
659   SLOT_INTERFACE( "525dd", FLOPPY_525_QD )
636660SLOT_INTERFACE_END
637661
638662
r243358r243359
662686   MCFG_GFXDECODE_ADD("gfxdecode", "palette", mbee)
663687   MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") // usually sold with amber or green monitor
664688
665   MCFG_VIDEO_START_OVERRIDE(mbee_state, mbee)
689   MCFG_VIDEO_START_OVERRIDE(mbee_state,mbee)
666690
667691   /* sound hardware */
668692   MCFG_SPEAKER_STANDARD_MONO("mono")
r243358r243359
789813   MCFG_CPU_IO_MAP(mbee56_io)
790814   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee56 )
791815   MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4) // divided by 2 externally, then divided by 2 internally (/ENMF pin not emulated)
792   MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w))
793   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
794   MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive5a", floppy_image_device::default_floppy_formats)
795   MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive5b", floppy_image_device::default_floppy_formats)
816   MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "525dd", mbee_state::floppy_formats)
817   MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "35dd", mbee_state::floppy_formats)
796818MACHINE_CONFIG_END
797819
798820static MACHINE_CONFIG_DERIVED( mbee64, mbee56 )
r243358r243359
808830   MCFG_CPU_IO_MAP(mbee128_io)
809831   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128 )
810832   MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4)
811   MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w))
812   MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
813   MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive5a", floppy_image_device::default_floppy_formats)
814   MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive5b", floppy_image_device::default_floppy_formats)
833   MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "35dd", mbee_state::floppy_formats)
834   MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "525dd", mbee_state::floppy_formats)
815835MACHINE_CONFIG_END
816836
817837static MACHINE_CONFIG_DERIVED( mbee256, mbee128 )
818838   MCFG_CPU_MODIFY( "maincpu" )
819   MCFG_CPU_PROGRAM_MAP(mbee256_mem)
820839   MCFG_CPU_IO_MAP(mbee256_io)
821840   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee256 )
822841   MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz )
r243358r243359
827846   MCFG_MC6845_CHAR_WIDTH(8)
828847   MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbeeppc_update_row)
829848   MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee256_update_addr)
830   MCFG_DEVICE_REMOVE("fdc:0")
831   MCFG_DEVICE_REMOVE("fdc:1")
832   MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive3a", floppy_image_device::default_floppy_formats)
833   MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive3b", floppy_image_device::default_floppy_formats)
834849MACHINE_CONFIG_END
835850
836851static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc )
r243358r243359
11451160ROM_END
11461161
11471162ROM_START( mbee256 ) // 256tc
1148   ROM_REGION(0x40000, "rams", ROMREGION_ERASEFF)
1163   ROM_REGION(0x40000,"maincpu", ROMREGION_ERASEFF)
11491164
1150   ROM_REGION(0x5000, "roms", 0) // rom plus dummy area
1165   ROM_REGION(0x7000,"bootrom", ROMREGION_ERASEFF)
11511166   ROM_SYSTEM_BIOS( 0, "1.20", "Version 1.20" )
1152   ROMX_LOAD("256tc_boot_1.20.u38", 0x0000, 0x4000, CRC(fe8d6a84) SHA1(a037a1b90b18a2180e9f5f216b829fcd480449a4), ROM_BIOS(1) )
1167   ROMX_LOAD("256tc_boot_1.20.rom", 0x0000, 0x4000, CRC(fe8d6a84) SHA1(a037a1b90b18a2180e9f5f216b829fcd480449a4), ROM_BIOS(1) )
11531168   ROM_SYSTEM_BIOS( 1, "1.15", "Version 1.15" )
1154   ROMX_LOAD("256tc_boot_1.15.u38", 0x0000, 0x4000, CRC(1902062d) SHA1(e4a1c0b3f4996e313da0bac0edb6d34e3270723e), ROM_BIOS(2) )
1169   ROMX_LOAD("256tc_boot_1.15.rom", 0x0000, 0x4000, CRC(1902062d) SHA1(e4a1c0b3f4996e313da0bac0edb6d34e3270723e), ROM_BIOS(2) )
11551170
1156   ROM_REGION(0x4000, "proms", 0)
1157   ROM_LOAD( "silver.u39", 0x0000, 0x4000, CRC(c34aab64) SHA1(781fe648488dec90185760f8e081e488b73b68bf) )
1158
11591171   ROM_REGION(0x9800, "gfx", 0)
1160   ROM_LOAD("char256.u53", 0x1000, 0x1000, CRC(9372af3c) SHA1(a63591822c0504de2fed52e88d64e1dbd6124b74) )
1172   ROM_LOAD("char256.bin",           0x1000, 0x1000, CRC(9372af3c) SHA1(a63591822c0504de2fed52e88d64e1dbd6124b74) )
11611173   ROM_IGNORE( 0x1000 )    // throw away swedish characters for now
11621174   ROM_COPY( "gfx", 0x1000, 0x0000, 0x1000 )
11631175
r243358r243359
11721184
11731185***************************************************************************/
11741186
1175/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     CLASS        INIT         COMPANY                   FULLNAME */
1176COMP( 1982, mbee,     0,        0,      mbee,     mbee,     mbee_state,  mbee,       "Applied Technology",  "Microbee 16 Standard" , 0 )
1177COMP( 1982, mbeeic,   mbee,     0,      mbeeic,   mbee,     mbee_state,  mbeeic,     "Applied Technology",  "Microbee 32 IC" , 0 )
1178COMP( 1982, mbeepc,   mbee,     0,      mbeepc,   mbee,     mbee_state,  mbeepc,     "Applied Technology",  "Microbee Personal Communicator" , 0 )
1179COMP( 1985, mbeepc85, mbee,     0,      mbeepc85, mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85" , 0 )
1180COMP( 1985, mbeepc85b,mbee,     0,      mbeepc85b,mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85 (New version)" , 0 )
1181COMP( 1985, mbeepc85s,mbee,     0,      mbeepc85, mbee,     mbee_state,  mbeepc85,   "Applied Technology",  "Microbee PC85 (Swedish)" , 0 )
1182COMP( 1986, mbeeppc,  mbee,     0,      mbeeppc,  mbee,     mbee_state,  mbeeppc,    "Applied Technology",  "Microbee Premium PC85" , 0 )
1183COMP( 1986, mbeett,   mbee,     0,      mbeett,   mbee256,  mbee_state,  mbeett,     "Applied Technology",  "Microbee Teleterm" , GAME_NOT_WORKING )
1184COMP( 1986, mbee56,   mbee,     0,      mbee56,   mbee,     mbee_state,  mbee56,     "Applied Technology",  "Microbee 56k" , GAME_NOT_WORKING )
1185COMP( 1986, mbee64,   mbee,     0,      mbee64,   mbee,     mbee_state,  mbee64,     "Applied Technology",  "Microbee 64k" , GAME_NOT_WORKING )
1186COMP( 1986, mbee128,  mbee,     0,      mbee128,  mbee,     mbee_state,  mbee128,    "Applied Technology",  "Microbee 128k" , GAME_NOT_WORKING )
1187COMP( 1987, mbee256,  mbee,     0,      mbee256,  mbee256,  mbee_state,  mbee256,    "Applied Technology",  "Microbee 256TC" , GAME_NOT_WORKING )
1187/*    YEAR  NAME      PARENT    COMPAT  MACHINE   INPUT     INIT       COMPANY         FULLNAME */
1188COMP( 1982, mbee,     0,    0,  mbee,     mbee, mbee_state,     mbee,           "Applied Technology",  "Microbee 16 Standard" , 0 )
1189COMP( 1982, mbeeic,   mbee, 0,  mbeeic,   mbee, mbee_state,     mbeeic,         "Applied Technology",  "Microbee 32 IC" , 0 )
1190COMP( 1982, mbeepc,   mbee, 0,  mbeepc,   mbee, mbee_state,     mbeepc,         "Applied Technology",  "Microbee Personal Communicator" , 0 )
1191COMP( 1985, mbeepc85, mbee, 0,  mbeepc85, mbee, mbee_state,     mbeepc85,       "Applied Technology",  "Microbee PC85" , 0 )
1192COMP( 1985, mbeepc85b,mbee, 0,  mbeepc85b,mbee, mbee_state,     mbeepc85,       "Applied Technology",  "Microbee PC85 (New version)" , 0 )
1193COMP( 1985, mbeepc85s,mbee, 0,  mbeepc85, mbee, mbee_state,     mbeepc85,       "Applied Technology",  "Microbee PC85 (Swedish)" , 0 )
1194COMP( 1986, mbeeppc,  mbee, 0,  mbeeppc,  mbee, mbee_state,     mbeeppc,        "Applied Technology",  "Microbee Premium PC85" , 0 )
1195COMP( 1986, mbeett,   mbee, 0,  mbeett,   mbee256, mbee_state,  mbeett,     "Applied Technology",  "Microbee Teleterm" , GAME_NOT_WORKING )
1196COMP( 1986, mbee56,   mbee, 0,  mbee56,   mbee, mbee_state,     mbee56,         "Applied Technology",  "Microbee 56k" , GAME_NOT_WORKING )
1197COMP( 1986, mbee64,   mbee, 0,  mbee64,   mbee, mbee_state,     mbee64,         "Applied Technology",  "Microbee 64k" , GAME_NOT_WORKING )
1198COMP( 1986, mbee128,  mbee, 0,  mbee128,  mbee, mbee_state,     mbee128,        "Applied Technology",  "Microbee 128k" , GAME_NOT_WORKING )
1199COMP( 1987, mbee256,  mbee, 0,  mbee256,  mbee256, mbee_state,  mbee256,        "Applied Technology",  "Microbee 256TC" , GAME_NOT_WORKING )
trunk/src/mess/drivers/pentagon.c
r243358r243359
120120   if (m_port_7ffd_data & 0x20)
121121      return;
122122
123   if ((m_port_7ffd_data ^ data) & 0x08)
124      spectrum_UpdateBorderBitmap();
125
126123   /* store new state */
127124   m_port_7ffd_data = data;
128125
trunk/src/mess/drivers/spec128.c
r243358r243359
172172   if (m_port_7ffd_data & 0x20)
173173         return;
174174
175   if ((m_port_7ffd_data ^ data) & 0x08)
176      spectrum_UpdateBorderBitmap();
177
178175   /* store new state */
179176   m_port_7ffd_data = data;
180177
trunk/src/mess/includes/mbee.h
r243358r243359
3434   };
3535
3636   mbee_state(const machine_config &mconfig, device_type type, const char *tag)
37      : driver_device(mconfig, type, tag)
38      , m_palette(*this, "palette")
39      , m_maincpu(*this, "maincpu")
40      , m_pio(*this, "z80pio")
41      , m_cassette(*this, "cassette")
42      , m_wave(*this, WAVE_TAG)
43      , m_speaker(*this, "speaker")
44      , m_centronics(*this, "centronics")
45      , m_cent_data_out(*this, "cent_data_out")
46      , m_crtc(*this, "crtc")
47      , m_fdc(*this, "fdc")
48      , m_floppy0(*this, "fdc:0")
49      , m_floppy1(*this, "fdc:1")
50      , m_rtc(*this, "rtc")
51      , m_boot(*this, "boot")
52      , m_pak(*this, "pak")
53      , m_telcom(*this, "telcom")
54      , m_basic(*this, "basic")
55      , m_bankl(*this, "bankl")
56      , m_bankh(*this, "bankh")
57      , m_bank1(*this, "bank1")
58      , m_bank8l(*this, "bank8l")
59      , m_bank8h(*this, "bank8h")
60      , m_bank9(*this, "bank9")
61      , m_bankfl(*this, "bankfl")
62      , m_bankfh(*this, "bankfh")
63      , m_io_x0(*this, "X0")
64      , m_io_x1(*this, "X1")
65      , m_io_x2(*this, "X2")
66      , m_io_x3(*this, "X3")
67      , m_io_x4(*this, "X4")
68      , m_io_x5(*this, "X5")
69      , m_io_x6(*this, "X6")
70      , m_io_x7(*this, "X7")
71      , m_io_extra(*this, "EXTRA")
72      , m_io_config(*this, "CONFIG")
73      , m_io_x8(*this, "X8")
74      , m_io_x9(*this, "X9")
75      , m_io_x10(*this, "X10")
76      , m_io_x11(*this, "X11")
77      , m_io_x12(*this, "X12")
78      , m_io_x13(*this, "X13")
79      , m_io_x14(*this, "X14")
80      , m_screen(*this, "screen")
81   { }
37      : driver_device(mconfig, type, tag),
38      m_maincpu(*this, "maincpu"),
39      m_pio(*this, "z80pio"),
40      m_cassette(*this, "cassette"),
41      m_wave(*this, WAVE_TAG),
42      m_speaker(*this, "speaker"),
43      m_centronics(*this, "centronics"),
44      m_cent_data_out(*this, "cent_data_out"),
45      m_crtc(*this, "crtc"),
46      m_fdc(*this, "fdc"),
47      m_floppy0(*this, "fdc:0"),
48      m_floppy1(*this, "fdc:1"),
49      m_rtc(*this, "rtc"),
50      m_boot(*this, "boot"),
51      m_pak(*this, "pak"),
52      m_telcom(*this, "telcom"),
53      m_basic(*this, "basic"),
54      m_bankl(*this, "bankl"),
55      m_bankh(*this, "bankh"),
56      m_bank1(*this, "bank1"),
57      m_bank8l(*this, "bank8l"),
58      m_bank8h(*this, "bank8h"),
59      m_bank9(*this, "bank9"),
60      m_bankfl(*this, "bankfl"),
61      m_bankfh(*this, "bankfh"),
62      m_io_x0(*this, "X0"),
63      m_io_x1(*this, "X1"),
64      m_io_x2(*this, "X2"),
65      m_io_x3(*this, "X3"),
66      m_io_x4(*this, "X4"),
67      m_io_x5(*this, "X5"),
68      m_io_x6(*this, "X6"),
69      m_io_x7(*this, "X7"),
70      m_io_extra(*this, "EXTRA"),
71      m_io_config(*this, "CONFIG"),
72      m_io_x8(*this, "X8"),
73      m_io_x9(*this, "X9"),
74      m_io_x10(*this, "X10"),
75      m_io_x11(*this, "X11"),
76      m_io_x12(*this, "X12"),
77      m_io_x13(*this, "X13"),
78      m_io_x14(*this, "X14"),
79      m_screen(*this, "screen"),
80      m_palette(*this, "palette") { }
8281
8382   DECLARE_WRITE8_MEMBER( mbee_04_w );
8483   DECLARE_WRITE8_MEMBER( mbee_06_w );
r243358r243359
149148   TIMER_CALLBACK_MEMBER(mbee_reset);
150149   DECLARE_QUICKLOAD_LOAD_MEMBER( mbee );
151150   DECLARE_QUICKLOAD_LOAD_MEMBER( mbee_z80bin );
152   WRITE_LINE_MEMBER(fdc_intrq_w);
153   WRITE_LINE_MEMBER(fdc_drq_w);
154151   DECLARE_FLOPPY_FORMATS(floppy_formats);
155152   UINT8 *m_p_videoram;
156153   UINT8 *m_p_gfxram;
r243358r243359
168165   MC6845_ON_UPDATE_ADDR_CHANGED(mbee_update_addr);
169166   MC6845_ON_UPDATE_ADDR_CHANGED(mbee256_update_addr);
170167
171   required_device<palette_device> m_palette;
172168private:
173169   size_t m_size;
174170   UINT8 m_clock_pulse;
r243358r243359
182178   UINT8 m_sy6545_status;
183179   UINT8 m_sy6545_reg[32];
184180   UINT8 m_sy6545_ind;
185   UINT8 m_fdc_rq;
186   void mbee256_setup_banks(UINT8 data);
187181   void sy6545_cursor_configure();
188182   void keyboard_matrix_r(int offs);
189   void machine_reset_common_disk();
190   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
191183   required_device<cpu_device> m_maincpu;
192184   required_device<z80pio_device> m_pio;
193185   required_device<cassette_image_device> m_cassette;
r243358r243359
200192   optional_device<floppy_connector> m_floppy0;
201193   optional_device<floppy_connector> m_floppy1;
202194   optional_device<mc146818_device> m_rtc;
203   optional_memory_bank m_boot;
195   required_memory_bank m_boot;
204196   optional_memory_bank m_pak;
205197   optional_memory_bank m_telcom;
206198   optional_memory_bank m_basic;
r243358r243359
230222   optional_ioport m_io_x13;
231223   optional_ioport m_io_x14;
232224   required_device<screen_device> m_screen;
225public:
226   required_device<palette_device> m_palette;
227
228   void machine_reset_common_disk();
229   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
233230};
234231
235232#endif /* MBEE_H_ */
trunk/src/mess/machine/mbee.c
r243358r243359
8989
9090*************************************************************************************/
9191
92WRITE_LINE_MEMBER( mbee_state::fdc_intrq_w )
93{
94   m_fdc_rq = (m_fdc_rq & 2) | state;
95}
96
97WRITE_LINE_MEMBER( mbee_state::fdc_drq_w )
98{
99   m_fdc_rq = (m_fdc_rq & 1) | (state << 1);
100}
101
10292READ8_MEMBER( mbee_state::mbee_fdc_status_r )
10393{
10494/*  d7 indicate if IRQ or DRQ is occuring (1=happening)
10595    d6..d0 not used */
10696
107   return m_fdc_rq ? 0xff : 0x7f;
97   return 0x7f | ((m_fdc->intrq_r() || m_fdc->drq_r()) ? 0x80 : 0);
10898}
10999
110100WRITE8_MEMBER( mbee_state::mbee_fdc_motor_w )
r243358r243359
141131TIMER_CALLBACK_MEMBER(mbee_state::mbee256_kbd)
142132{
143133   /* Keyboard scanner is a Mostek M3870 chip. Its speed of operation is determined by a 15k resistor on
144   pin 2 (XTL2) and is therefore 2MHz. If a key change is detected (up or down), the /strobe
134   pin 2 (XTL2) and is therefore unknown. If a key change is detected (up or down), the /strobe
145135   line activates, sending a high to bit 1 of port 2 (one of the pio input lines). The next read of
146136   port 18 will clear this line, and read the key scancode. It will also signal the 3870 that the key
147137   data has been read, on pin 38 (/extint). The 3870 can cache up to 9 keys. With no rom dump
r243358r243359
266256
267257    256TC Memory Banking
268258
269    Selection of ROM, RAM, and video access by the CPU is controlled by U39,
270    a PAL14L8. When read as an ordinary rom it is 16k in size. The dumper has
271    arranged the pins as (bit0,1,..) (input = 1,23,2,3,4,5,6,7,8,9,10,11,14,13)
272    and (output = 22,21,20,19,18,17,16,15). The prom is also used to control
273    the refresh required by the dynamic rams, however we ignore this function.
259    Bits 0, 1 and 5 select which bank goes into 0000-7FFF.
260    Bit 2 disables ROM, replacing it with RAM.
261    Bit 3 disables Video, replacing it with RAM.
262    Bit 4 switches the video circuits between F000-FFFF and
263          8000-8FFF.
274264
265    In case of a clash, video overrides ROM which overrides RAM.
266
275267************************************************************/
276268
277void mbee_state::mbee256_setup_banks(UINT8 data)
269WRITE8_MEMBER( mbee_state::mbee256_50_w )
278270{
279   data &= 0x3f; // U28 (bits 0-5 are referred to as S0-S5)
280271   address_space &mem = m_maincpu->space(AS_PROGRAM);
281   UINT8 *prom = memregion("proms")->base();
282   UINT8 b_data = BITSWAP8(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3
283   UINT8 b_bank, b_byte, b_byte_t, b_addr;
284   UINT16 b_vid;
285   char banktag[10];
286272
287   for (b_bank = 0; b_bank < 16; b_bank++)
288   {
289      b_vid = b_bank << 12;
290      mem.unmap_readwrite (b_vid, b_vid + 0xfff);
291      b_addr = BITSWAP8(b_bank, 7,4,5,3,1,2,6,0) & 0x1f; // arrange address bits to A12,-,A14,A13,A15
273   // primary low banks
274   m_boot->set_entry((data & 3) | ((data & 0x20) >> 3));
275   m_bank1->set_entry((data & 3) | ((data & 0x20) >> 3));
292276
293      // Calculate read-bank
294      b_byte_t = prom[b_addr | (b_data << 8) | 0x82]; // read-bank (RDS and MREQ are low, RFSH is high)
295      b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used
296      if (!BIT(data, 5))
297         b_byte &= 0xfb;  // U42/1 - S17 only valid if S5 is on
298      if (!BIT(b_byte, 4))
299      {
300         // select video
301         mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this));
302         mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this));
303      }
304      else
305      {
306         sprintf(banktag, "bankr%d", b_bank);
307         mem.install_read_bank( b_vid, b_vid+0xfff, banktag );
277   // 9000-EFFF
278   m_bank9->set_entry((data & 4) ? 1 : 0);
308279
309         if (!BIT(b_byte, 3))
310            membank(banktag)->set_entry(64 + (b_bank & 3)); // read from rom
311         else
312            membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram
313      }
280   // 8000-8FFF, F000-FFFF
281   mem.unmap_readwrite (0x8000, 0x87ff);
282   mem.unmap_readwrite (0x8800, 0x8fff);
283   mem.unmap_readwrite (0xf000, 0xf7ff);
284   mem.unmap_readwrite (0xf800, 0xffff);
314285
315      // Calculate write-bank
316      b_byte_t = prom[b_addr | (b_data << 8) | 0xc0]; // write-bank (XWR and MREQ are low, RFSH is high)
317      b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used
318      if (!BIT(data, 5))
319         b_byte &= 0xfb;  // U42/1 - S17 only valid if S5 is on
320      if (!BIT(b_byte, 4))
321      {
322         // select video
323         mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
324         mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
325      }
326      else
327      {
328         sprintf(banktag, "bankw%d", b_bank);
329         mem.install_write_bank( b_vid, b_vid+0xfff, banktag );
330
331         if (!BIT(b_byte, 3))
332            membank(banktag)->set_entry(64); // write to rom dummy area
333         else
334            membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram
335      }
286   switch (data & 0x1c)
287   {
288      case 0x00:
289         mem.install_read_bank (0x8000, 0x87ff, "bank8l");
290         mem.install_read_bank (0x8800, 0x8fff, "bank8h");
291         mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
292         mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
293         m_bank8l->set_entry(0); // rom
294         m_bank8h->set_entry(0); // rom
295         break;
296      case 0x04:
297         mem.install_read_bank (0x8000, 0x87ff, "bank8l");
298         mem.install_read_bank (0x8800, 0x8fff, "bank8h");
299         mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
300         mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
301         m_bank8l->set_entry(1); // ram
302         m_bank8h->set_entry(1); // ram
303         break;
304      case 0x08:
305      case 0x18:
306         mem.install_read_bank (0x8000, 0x87ff, "bank8l");
307         mem.install_read_bank (0x8800, 0x8fff, "bank8h");
308         mem.install_read_bank (0xf000, 0xf7ff, "bankfl");
309         mem.install_read_bank (0xf800, 0xffff, "bankfh");
310         m_bank8l->set_entry(0); // rom
311         m_bank8h->set_entry(0); // rom
312         m_bankfl->set_entry(0); // ram
313         m_bankfh->set_entry(0); // ram
314         break;
315      case 0x0c:
316      case 0x1c:
317         mem.install_read_bank (0x8000, 0x87ff, "bank8l");
318         mem.install_read_bank (0x8800, 0x8fff, "bank8h");
319         mem.install_read_bank (0xf000, 0xf7ff, "bankfl");
320         mem.install_read_bank (0xf800, 0xffff, "bankfh");
321         m_bank8l->set_entry(1); // ram
322         m_bank8h->set_entry(1); // ram
323         m_bankfl->set_entry(0); // ram
324         m_bankfh->set_entry(0); // ram
325         break;
326      case 0x10:
327      case 0x14:
328         mem.install_readwrite_handler (0x8000, 0x87ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this));
329         mem.install_readwrite_handler (0x8800, 0x8fff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this));
330         mem.install_read_bank (0xf000, 0xf7ff, "bankfl");
331         mem.install_read_bank (0xf800, 0xffff, "bankfh");
332         m_bankfl->set_entry(0); // ram
333         m_bankfh->set_entry(0); // ram
334         break;
336335   }
337336}
338337
339WRITE8_MEMBER( mbee_state::mbee256_50_w )
340{
341   mbee256_setup_banks(data);
342}
343
344338/***********************************************************
345339
346340    128k Memory Banking
r243358r243359
514508
515509void mbee_state::machine_reset_common_disk()
516510{
517   m_fdc_rq = 0;
518511}
519512
520513MACHINE_RESET_MEMBER(mbee_state,mbee)
r243358r243359
540533
541534MACHINE_RESET_MEMBER(mbee_state,mbee128)
542535{
543   address_space &mem = m_maincpu->space(AS_IO);
536   address_space &mem = m_maincpu->space(AS_PROGRAM);
544537   machine_reset_common_disk();
545538   mbee128_50_w(mem,0,0); // set banks to default
546   m_boot->set_entry(8); // boot time
539   m_boot->set_entry(4); // boot time
547540}
548541
549542MACHINE_RESET_MEMBER(mbee_state,mbee256)
550543{
551544   UINT8 i;
545   address_space &mem = m_maincpu->space(AS_PROGRAM);
552546   machine_reset_common_disk();
553547   for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0;
554548   m_mbee256_q_pos = 0;
555   mbee256_setup_banks(0); // set banks to default
556   m_maincpu->set_pc(0x8000);
549   mbee256_50_w(mem,0,0); // set banks to default
550   m_boot->set_entry(8); // boot time
551   timer_set(attotime::from_usec(4), TIMER_MBEE_RESET);
557552}
558553
559554MACHINE_RESET_MEMBER(mbee_state,mbeett)
r243358r243359
695690
696691   RAM = memregion("bootrom")->base();
697692   m_bank9->configure_entry(0, &RAM[0x1000]); // rom
698   m_boot->configure_entry(8, &RAM[0x0000]); // rom at boot for 4usec
693   m_boot->configure_entry(4, &RAM[0x0000]); // rom at boot for 4usec
699694   m_bank8l->configure_entry(0, &RAM[0x0000]); // rom
700695   m_bank8h->configure_entry(0, &RAM[0x0800]); // rom
701696
r243358r243359
704699
705700DRIVER_INIT_MEMBER(mbee_state,mbee256)
706701{
707   UINT8 *RAM = memregion("rams")->base();
708   UINT8 *ROM = memregion("roms")->base();
709   char banktag[10];
702   UINT8 *RAM = memregion("maincpu")->base();
703   m_boot->configure_entries(0, 8, &RAM[0x0000], 0x8000); // standard banks 0000
704   m_bank1->configure_entries(0, 8, &RAM[0x1000], 0x8000); // standard banks 1000
705   m_bank8l->configure_entry(1, &RAM[0x0000]); // shadow ram
706   m_bank8h->configure_entry(1, &RAM[0x0800]); // shadow ram
707   m_bank9->configure_entry(1, &RAM[0x1000]); // shadow ram
708   m_bankfl->configure_entry(0, &RAM[0xf000]); // shadow ram
709   m_bankfh->configure_entry(0, &RAM[0xf800]); // shadow ram
710710
711   for (UINT8 b_bank = 0; b_bank < 16; b_bank++)
712   {
713      sprintf(banktag, "bankr%d", b_bank);
714      membank(banktag)->configure_entries(0, 64, &RAM[0x0000], 0x1000); // RAM banks
715      membank(banktag)->configure_entries(64, 4, &ROM[0x0000], 0x1000); // rom
711   RAM = memregion("bootrom")->base();
712   m_bank9->configure_entry(0, &RAM[0x1000]); // rom
713   m_boot->configure_entry(8, &RAM[0x0000]); // rom at boot for 4usec
714   m_bank8l->configure_entry(0, &RAM[0x0000]); // rom
715   m_bank8h->configure_entry(0, &RAM[0x0800]); // rom
716716
717      sprintf(banktag, "bankw%d", b_bank);
718      membank(banktag)->configure_entries(0, 64, &RAM[0x0000], 0x1000); // RAM banks
719      membank(banktag)->configure_entries(64, 1, &ROM[0x4000], 0x1000); // dummy rom
720   }
721
722717   timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ);   /* timer for rtc */
723   timer_set(attotime::from_hz(50), TIMER_MBEE256_KBD);   /* timer for kbd */
718   timer_set(attotime::from_hz(25), TIMER_MBEE256_KBD);   /* timer for kbd */
724719
725720   m_size = 0x8000;
726721}
trunk/src/mess/video/spectrum.c
r243358r243359
3939
4040   m_previous_border_x = 0; m_previous_border_y = 0;
4141   machine().first_screen()->register_screen_bitmap(m_border_bitmap);
42
43   m_screen_location = m_ram->pointer() + (5 << 14);
4442}
4543
4644
r243358r243359
6058   // rising edge
6159   if (state)
6260   {
63      spectrum_UpdateBorderBitmap();
64
6561      m_frame_number++;
6662
6763      if (m_frame_number >= m_frame_invert_count)
r243358r243359
6965         m_frame_number = 0;
7066         m_flash_invert = !m_flash_invert;
7167      }
68
69
70      spectrum_UpdateBorderBitmap();
7271   }
7372}
7473
r243358r243359
104103
105104UINT32 spectrum_state::screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
106105{
107   if (m_border_bitmap.valid())
108      copyscrollbitmap(bitmap, m_border_bitmap, 0, 0, 0, 0, cliprect);
109
110#if 0
111106   // note, don't update borders in here, this can time travel w/regards to other timers and may end up giving you
112107   // screen positions earlier than the last write handler gave you
113108
r243358r243359
117112   unsigned char *attr, *scr;
118113   //  int full_refresh = 1;
119114
115   if (m_border_bitmap.valid())
116      copyscrollbitmap(bitmap, m_border_bitmap, 0, 0, 0, 0, cliprect);
117
120118   scr=m_screen_location;
121119
122120   for (y=0; y<192; y++)
r243358r243359
151149         attr++;
152150      }
153151   }
154#endif
155152
156153   return 0;
157154}
r243358r243359
194191
195192   if (m_border_bitmap.valid())
196193   {
197      UINT16 border = m_port_fe_data & 0x07;
194      int colour = m_port_fe_data & 0x07;
198195
199196      //printf("update border from %d,%d to %d,%d\n", m_previous_border_x, m_previous_border_y, x, y);
200197
201198      do
202199      {
203         UINT16 scrx = m_previous_border_x - SPEC_LEFT_BORDER;
204         UINT16 scry = m_previous_border_y - SPEC_TOP_BORDER;
200         UINT16* bm = &m_border_bitmap.pix16(m_previous_border_y);
201         bm[m_previous_border_x] = colour;
205202
206         if (scrx < SPEC_DISPLAY_XSIZE && scry < SPEC_DISPLAY_YSIZE)
207         {
208            // this can/must be optimised
209            if ((scrx & 7) == 0) {
210               UINT16 *bm = &m_border_bitmap.pix16(m_previous_border_y, m_previous_border_x);
211               UINT8 attr = *(m_screen_location + ((scry & 0xF8) << 2) + (scrx >> 3) + 0x1800);
212               UINT8 scr = *(m_screen_location + ((scry & 7) << 8) + ((scry & 0x38) << 2) + ((scry & 0xC0) << 5) + (scrx >> 3));
213               UINT16 ink = (attr & 0x07) + ((attr >> 3) & 0x08);
214               UINT16 pap = (attr >> 3) & 0x0f;
215
216               if (m_flash_invert && (attr & 0x80))
217                  scr = ~scr;
218
219               for (UINT8 b = 0x80; b != 0; b >>= 1)
220                  *bm++ = (scr & b) ? ink : pap;
221            }
222         } else
223            m_border_bitmap.pix16(m_previous_border_y, m_previous_border_x) = border;
224
225203         m_previous_border_x += 1;
226204
227205         if (m_previous_border_x >= width)
trunk/src/osd/sdl/draw13.c
r243358r243359
143143{
144144public:
145145    sdl_info13(sdl_window_info *w)
146    : osd_renderer(w), m_blittimer(0), m_renderer(NULL),
146    : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_renderer(NULL),
147147      m_last_hofs(0), m_last_vofs(0),
148148      m_resize_pending(0), m_resize_width(0), m_resize_height(0),
149149      m_last_blit_time(0), m_last_blit_pixels(0)
150150    {}
151151
152   /* virtual */ int create(int width, int height);
153   /* virtual */ void resize(int width, int height);
154   /* virtual */ int draw(UINT32 dc, int update);
155   /* virtual */ void set_target_bounds();
156   /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt);
152   /* virtual */ int create(const int width, const int height);
153   /* virtual */ void resize(const int width, const int height);
154   /* virtual */ int draw(const UINT32 dc, const int update);
155   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
157156   /* virtual */ void destroy_all_textures();
158157   /* virtual */ void destroy();
159158   /* virtual */ void clear();
r243358r243359
594593    * xrandr --output HDMI-0 --panning 0x0+0+0 --fb 0x0
595594    *
596595    */
596   osd_printf_verbose("Enter sdl_info::create\n");
597597
598   osd_printf_verbose("Enter sdl_info13::create\n");
598#if (SDLMAME_SDL2)
599599
600   if (check_flag(FLAG_NEEDS_OPENGL))
601   {
602      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
603
604      /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to
605         * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension.
606         *
607         * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 );
608         *
609         */
610      m_extra_flags = SDL_WINDOW_OPENGL;
611   }
612   else
613            m_extra_flags = 0;
614
600615   // create the SDL window
601   m_extra_flags = (window().fullscreen() ?
616   // soft driver also used | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_MOUSE_FOCUS
617   m_extra_flags |= (window().fullscreen() ?
602618         SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
603619
604620#if defined(SDLMAME_WIN32)
r243358r243359
608624   window().m_sdl_window = SDL_CreateWindow(window().m_title,
609625         window().monitor()->position_size().x, window().monitor()->position_size().y,
610626         width, height, m_extra_flags);
627   //window().m_sdl_window = SDL_CreateWindow(window().m_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
628   //      width, height, m_extra_flags);
611629
612630   if  (!window().m_sdl_window )
613631   {
632      if (check_flag(FLAG_NEEDS_OPENGL))
633         osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError());
634      else
614635      osd_printf_error("Window creation failed: %s\n", SDL_GetError());
615636      return 1;
616637   }
r243358r243359
639660   {
640661      //SDL_SetWindowDisplayMode(window().m_sdl_window, NULL); // Use desktop
641662   }
663
664   // show window
665
666   SDL_ShowWindow(window().m_sdl_window);
667   //SDL_SetWindowFullscreen(window().m_sdl_window, window().fullscreen);
668   SDL_RaiseWindow(window().m_sdl_window);
669
670   SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height);
671
642672   // create renderer
643673
644674   if (video_config.waitvsync)
r243358r243359
653683
654684   //SDL_SelectRenderer(window().sdl_window);
655685
656   // show window
686   m_blittimer = 3;
657687
658   SDL_ShowWindow(window().m_sdl_window);
659   //SDL_SetWindowFullscreen(window().sdl_window, window().fullscreen);
660   SDL_RaiseWindow(window().m_sdl_window);
688   SDL_RenderPresent(m_renderer);
689   osd_printf_verbose("Leave sdl_info13::create\n");
661690
662   SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height);
691#else
692   m_extra_flags = (window().fullscreen() ?  SDL_FULLSCREEN : SDL_RESIZABLE);
693   m_extra_flags |= SDL_DOUBLEBUF;
663694
664   m_blittimer = 3;
695   if (check_flag(FLAG_NEEDS_OPENGL))
696 {
697      m_extra_flags |= SDL_OPENGL;
698      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
699      #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN))
700      SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
701      #endif
702         //load_gl_lib(window().machine());
703 }
665704
666   SDL_RenderPresent(m_renderer);
667   osd_printf_verbose("Leave sdl_info13::create\n");
705   // create the SDL surface (which creates the window in windowed mode)
706   m_sdlsurf = SDL_SetVideoMode(width, height,
707                     0, SDL_SWSURFACE  | SDL_ANYFORMAT | m_extra_flags);
708
709   if (!m_sdlsurf)
710      return 1;
711   if ( (video_config.mode  == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) )
712   {
713      osd_printf_error("OpenGL not supported on this driver!\n");
714      return 1;
715   }
716
717   window().m_width = m_sdlsurf->w;
718   window().m_height = m_sdlsurf->h;
719
720   window().m_screen_width = 0;
721   window().m_screen_height = 0;
722
723
724   // set the window title
725   SDL_WM_SetCaption(window().m_title, "SDLMAME");
726
727#endif
668728   return 0;
669729}
670730
r243358r243359
685745
686746}
687747
748
688749//============================================================
750//  sdl_info::destroy
751//============================================================
752
753void sdl_info13::destroy()
754{
755   // free the memory in the window
756
757   destroy_all_textures();
758
759   if (window().fullscreen() && video_config.switchres)
760   {
761      SDL_SetWindowFullscreen(window().m_sdl_window, 0);    // Try to set mode
762      SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode);    // Try to set mode
763      SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN);    // Try to set mode
764   }
765
766   SDL_DestroyWindow(window().m_sdl_window);
767
768}
769
770//============================================================
771//  sdl_info::clear
772//============================================================
773
774void sdl_info13::clear()
775{
776   m_blittimer = 2;
777}
778
779
780//============================================================
689781//  drawsdl_xy_to_render_target
690782//============================================================
691783
r243358r243359
702794}
703795
704796//============================================================
705//  sdl_info::get_primitives
706//============================================================
707
708void sdl_info13::set_target_bounds()
709{
710   window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect());
711}
712
713//============================================================
714797//  sdl_info::draw
715798//============================================================
716799
r243358r243359
824907
825908
826909//============================================================
827//  sdl_info13::clear
828//============================================================
829
830void sdl_info13::clear()
831{
832   m_blittimer = 2;
833}
834
835
836//============================================================
837//  sdl_info13::destroy
838//============================================================
839
840void sdl_info13::destroy()
841{
842   // free the memory in the window
843
844   destroy_all_textures();
845
846   if (window().fullscreen() && video_config.switchres)
847   {
848      SDL_SetWindowFullscreen(window().m_sdl_window, 0);    // Try to set mode
849      SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode);    // Try to set mode
850      SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN);    // Try to set mode
851   }
852
853   SDL_DestroyWindow(window().m_sdl_window);
854
855}
856
857//============================================================
858910//  texture handling
859911//============================================================
860912
trunk/src/osd/sdl/drawbgfx.c
r243358r243359
7474{
7575public:
7676    sdl_info_bgfx(sdl_window_info *w)
77    : osd_renderer(w), m_blittimer(0), m_renderer(NULL),
77    : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_renderer(NULL),
7878      m_last_hofs(0), m_last_vofs(0),
7979      m_resize_pending(0), m_resize_width(0), m_resize_height(0),
8080      m_last_blit_time(0), m_last_blit_pixels(0)
8181    {}
8282
83   /* virtual */ int create(int width, int height);
84   /* virtual */ void resize(int width, int height);
85   /* virtual */ int draw(UINT32 dc, int update);
86   /* virtual */ void set_target_bounds();
87   /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt);
83   /* virtual */ int create(const int width, const int height);
84   /* virtual */ void resize(const int width, const int height);
85   /* virtual */ int draw(const UINT32 dc, const int update);
86   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
8887   /* virtual */ void destroy_all_textures();
8988   /* virtual */ void destroy();
9089   /* virtual */ void clear();
r243358r243359
254253}
255254
256255//============================================================
257//  sdl_info_bgfx::get_primitives
258//============================================================
259
260void sdl_info_bgfx::set_target_bounds()
261{
262   window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect());
263}
264
265//============================================================
266256//  sdl_info_bgfx::draw
267257//============================================================
268258
trunk/src/osd/sdl/drawogl.c
r243358r243359
156156//  TYPES
157157//============================================================
158158
159struct texture_info;
159//============================================================
160//  Textures
161//============================================================
160162
161163/* texture_info holds information about a texture */
162struct texture_info
164class texture_info
163165{
166public:
164167   texture_info()
165168   : hash(0), flags(0), rawwidth(0), rawheight(0),
166169      rawwidth_create(0), rawheight_create(0),
r243358r243359
219222{
220223public:
221224   sdl_info_ogl(sdl_window_info *window)
222   : osd_renderer(window), m_blittimer(0), m_extra_flags(0),
225   : osd_renderer(window, FLAG_NEEDS_OPENGL), m_blittimer(0), m_extra_flags(0),
223226#if (SDLMAME_SDL2)
224227      m_gl_context_id(0),
225228#else
r243358r243359
248251         m_texVerticex[i] = 0.0f;
249252   }
250253
251   /* virtual */ int create(int width, int height);
252   /* virtual */ void resize(int width, int height);
253   /* virtual */ int draw(UINT32 dc, int update);
254   /* virtual */ void set_target_bounds();
255   /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt);
254   /* virtual */ int create(const int width, const int height);
255   /* virtual */ void resize(const int width, int const height);
256   /* virtual */ int draw(const UINT32 dc, const int update);
257   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
256258   /* virtual */ void destroy_all_textures();
257259   /* virtual */ void destroy();
258260   /* virtual */ void clear();
r243358r243359
393395
394396// core functions
395397
398//============================================================
399//  STATIC VARIABLES
400//============================================================
401
396402static void drawogl_exit(void);
397403static void load_gl_lib(running_machine &machine);
398404
r243358r243359
440446static int dll_loaded = 0;
441447
442448//============================================================
443//  drawogl_init
449//  drawsdl_init
444450//============================================================
445451
446452static osd_renderer *drawogl_create(sdl_window_info *window)
r243358r243359
456462
457463   dll_loaded = 0;
458464
465   load_gl_lib(machine);
459466   if (SDLMAME_SDL2)
460467   {
461468      osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n");
462      load_gl_lib(machine);
463469   }
464470   else
465471      osd_printf_verbose("Using SDL single-window OpenGL driver (SDL 1.2)\n");
r243358r243359
710716
711717int sdl_info_ogl::create(int width, int height)
712718{
713#if (SDLMAME_SDL2)
714
715   SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
716
717   /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to
718    * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension.
719   /* FIXME: On Ubuntu and potentially other Linux OS you should use
720    * to disable panning. This has to be done before every invocation of mame.
719721    *
720    * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 );
722    * xrandr --output HDMI-0 --panning 0x0+0+0 --fb 0x0
721723    *
722724    */
725   osd_printf_verbose("Enter sdl_info::create\n");
723726
724   osd_printf_verbose("Enter sdl_info_ogl::create\n");
727#if (SDLMAME_SDL2)
725728
729   if (check_flag(FLAG_NEEDS_OPENGL))
730   {
731      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
732
733      /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to
734         * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension.
735         *
736         * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 );
737         *
738         */
739      m_extra_flags = SDL_WINDOW_OPENGL;
740   }
741   else
742            m_extra_flags = 0;
743
726744   // create the SDL window
727745   // soft driver also used | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_MOUSE_FOCUS
728   m_extra_flags = (window().fullscreen() ?
746   m_extra_flags |= (window().fullscreen() ?
729747         SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
730748
731   m_extra_flags |= SDL_WINDOW_OPENGL;
732
733
734749#if defined(SDLMAME_WIN32)
735750   SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
736751#endif
r243358r243359
743758
744759   if  (!window().m_sdl_window )
745760   {
746      osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError());
761      if (check_flag(FLAG_NEEDS_OPENGL))
762         osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError());
763      else
764         osd_printf_error("Window creation failed: %s\n", SDL_GetError());
747765      return 1;
748766   }
749767
r243358r243359
771789   {
772790      //SDL_SetWindowDisplayMode(window().m_sdl_window, NULL); // Use desktop
773791   }
774   // create renderer
775792
776   //SDL_SelectRenderer(window().sdl_window);
777
778793   // show window
779794
780795   SDL_ShowWindow(window().m_sdl_window);
r243358r243359
783798
784799   SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height);
785800
801   // create renderer
786802
787803   m_gl_context_id = SDL_GL_CreateContext(window().m_sdl_window);
788804   if  (!m_gl_context_id)
r243358r243359
795811
796812#else
797813   m_extra_flags = (window().fullscreen() ?  SDL_FULLSCREEN : SDL_RESIZABLE);
798   m_extra_flags |= SDL_OPENGL | SDL_DOUBLEBUF;
814   m_extra_flags |= SDL_DOUBLEBUF;
799815
800   SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
801   #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN))
802   SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
803   #endif
816   if (check_flag(FLAG_NEEDS_OPENGL))
817   {
818      m_extra_flags |= SDL_OPENGL;
819      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
820      #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN))
821      SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
822      #endif
823         //load_gl_lib(window().machine());
824   }
804825
805   load_gl_lib(window().machine());
806
807826   // create the SDL surface (which creates the window in windowed mode)
808827   m_sdlsurf = SDL_SetVideoMode(width, height,
809828                     0, SDL_SWSURFACE  | SDL_ANYFORMAT | m_extra_flags);
810829
811830   if (!m_sdlsurf)
812831      return 1;
832   if ( (video_config.mode  == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) )
833   {
834      osd_printf_error("OpenGL not supported on this driver!\n");
835      return 1;
836   }
813837
814838   window().m_width = m_sdlsurf->w;
815839   window().m_height = m_sdlsurf->h;
r243358r243359
817841   window().m_screen_width = 0;
818842   window().m_screen_height = 0;
819843
820   if ( (video_config.mode  == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) )
821   {
822      osd_printf_error("OpenGL not supported on this driver!\n");
823      return 1;
824   }
825844
826845   // set the window title
827846   SDL_WM_SetCaption(window().m_title, "SDLMAME");
r243358r243359
876895
877896}
878897
898
879899//============================================================
900//  sdl_info::destroy
901//============================================================
902
903void sdl_info_ogl::destroy()
904{
905
906   // free the memory in the window
907
908   destroy_all_textures();
909
910#if (SDLMAME_SDL2)
911   SDL_GL_DeleteContext(m_gl_context_id);
912   if (window().fullscreen() && video_config.switchres)
913   {
914      SDL_SetWindowFullscreen(window().m_sdl_window, 0);    // Try to set mode
915      SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode);    // Try to set mode
916      SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN);    // Try to set mode
917   }
918
919   SDL_DestroyWindow(window().m_sdl_window);
920#else
921   if (m_sdlsurf)
922   {
923      SDL_FreeSurface(m_sdlsurf);
924      m_sdlsurf = NULL;
925   }
926#endif
927}
928
929//============================================================
930//  sdl_info::clear
931//============================================================
932
933void sdl_info_ogl::clear()
934{
935   //FIXME: Handled in sdl_info::draw as well
936   m_blittimer = 3;
937}
938
939//============================================================
880940//  drawsdl_xy_to_render_target
881941//============================================================
882942
r243358r243359
892952}
893953
894954//============================================================
895//  sdl_info::get_primitives
896//============================================================
897
898void sdl_info_ogl::set_target_bounds()
899{
900   window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect());
901}
902
903//============================================================
904955//  loadGLExtensions
905956//============================================================
906957
r243358r243359
12111262}
12121263
12131264//============================================================
1214//  sdl_info::destroy
1215//============================================================
1216
1217void sdl_info_ogl::destroy()
1218{
1219
1220   // free the memory in the window
1221
1222   destroy_all_textures();
1223
1224#if (SDLMAME_SDL2)
1225   SDL_GL_DeleteContext(m_gl_context_id);
1226   if (window().fullscreen() && video_config.switchres)
1227   {
1228      SDL_SetWindowFullscreen(window().m_sdl_window, 0);    // Try to set mode
1229      SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode);    // Try to set mode
1230      SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN);    // Try to set mode
1231   }
1232
1233   SDL_DestroyWindow(window().m_sdl_window);
1234#else
1235   if (m_sdlsurf)
1236   {
1237      SDL_FreeSurface(m_sdlsurf);
1238      m_sdlsurf = NULL;
1239   }
1240#endif
1241}
1242
1243//============================================================
12441265//  sdl_info::draw
12451266//============================================================
12461267
r243358r243359
31673188      window().m_primlist->release_lock();
31683189}
31693190
3170//============================================================
3171//  TEXCOPY FUNCS
3172//============================================================
3173
3174void sdl_info_ogl::clear()
3175{
3176   //FIXME: Handled in sdl_info::draw as well
3177   m_blittimer = 3;
3178}
trunk/src/osd/sdl/drawsdl.c
r243358r243359
5151public:
5252
5353   sdl_info(sdl_window_info *w)
54   : osd_renderer(w),
54   : osd_renderer(w, FLAG_NONE),
5555   m_blittimer(0),
5656   m_extra_flags(0),
5757
r243358r243359
7272   m_old_blitheight(0)
7373   { }
7474
75   /* virtual */ int create(int width, int height);
76   /* virtual */ void resize(int width, int height);
77   /* virtual */ int draw(UINT32 dc, int update);
78   /* virtual */ void set_target_bounds();
79   /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt);
75   /* virtual */ int create(const int width, const int height);
76   /* virtual */ void resize(const int width, const int height);
77   /* virtual */ int draw(const UINT32 dc, const int update);
78   /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt);
8079   /* virtual */ void destroy_all_textures();
8180   /* virtual */ void destroy();
8281   /* virtual */ void clear();
r243358r243359
431430
432431int sdl_info::create(int width, int height)
433432{
433   /* FIXME: On Ubuntu and potentially other Linux OS you should use
434    * to disable panning. This has to be done before every invocation of mame.
435    *
436    * xrandr --output HDMI-0 --panning 0x0+0+0 --fb 0x0
437    *
438    */
434439   const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
435440
441   osd_printf_verbose("Enter sdl_info::create\n");
442
436443#if (SDLMAME_SDL2)
437444
438   osd_printf_verbose("Enter sdl_info::create\n");
445   if (check_flag(FLAG_NEEDS_OPENGL))
446   {
447      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
439448
449      /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to
450         * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension.
451         *
452         * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 );
453         *
454         */
455      m_extra_flags = SDL_WINDOW_OPENGL;
456   }
457   else
458            m_extra_flags = 0;
459
440460   /* set hints ... */
441461   SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode);
442462
443463   // create the SDL window
444464   // soft driver also used | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_MOUSE_FOCUS
445   m_extra_flags = (window().fullscreen() ?
465   m_extra_flags |= (window().fullscreen() ?
446466         SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
447467
448468#if defined(SDLMAME_WIN32)
449469   SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0");
450470#endif
471   // create the SDL window
451472   window().m_sdl_window = SDL_CreateWindow(window().m_title,
452473         window().monitor()->position_size().x, window().monitor()->position_size().y,
453474         width, height, m_extra_flags);
r243358r243359
456477
457478   if  (!window().m_sdl_window )
458479   {
459      osd_printf_error("Unable to create window: %s\n", SDL_GetError());
480      if (check_flag(FLAG_NEEDS_OPENGL))
481         osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError());
482      else
483      osd_printf_error("Window creation failed: %s\n", SDL_GetError());
460484      return 1;
461485   }
462486
r243358r243359
484508   {
485509      //SDL_SetWindowDisplayMode(window().m_sdl_window, NULL); // Use desktop
486510   }
487   // create renderer
488511
489   //SDL_SelectRenderer(window().sdl_window);
490
491512   // show window
492513
493514   SDL_ShowWindow(window().m_sdl_window);
r243358r243359
496517
497518   SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height);
498519
499   /* FIXME: Bug in SDL 1.3 */
500   if (window().fullscreen())
501      SDL_SetWindowGrab(window().m_sdl_window, SDL_TRUE);
520   // create renderer
502521
503   // create a texture
504
505522   if (video_config.waitvsync)
506      m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, /*SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD |*/ SDL_RENDERER_PRESENTVSYNC);
523      m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED);
507524   else
508      m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, /*SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD*/ 0);
525      m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, SDL_RENDERER_ACCELERATED);
509526
510   //SDL_SelectRenderer(window().sdl_window);
527   if (!m_sdl_renderer)
528   {
529      fatalerror("Error on creating renderer: %s\n", SDL_GetError());
530   }
511531
512532   {
513533      struct SDL_RendererInfo render_info;
r243358r243359
539559
540560   m_extra_flags |= sm->m_extra_flags;
541561
562   if (check_flag(FLAG_NEEDS_OPENGL))
563   {
564      m_extra_flags |= SDL_DOUBLEBUF | SDL_OPENGL;
565      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
566      #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN))
567      SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
568      #endif
569      //load_gl_lib(window().machine());
570   }
571
572   // create the SDL surface (which creates the window in windowed mode)
542573   m_sdlsurf = SDL_SetVideoMode(width, height,
543574               0, SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags);
544575
545576   if (!m_sdlsurf)
546577      return 1;
578   if ( (video_config.mode  == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) )
579   {
580      osd_printf_error("OpenGL not supported on this driver!\n");
581      return 1;
582   }
583
547584   window().m_width = m_sdlsurf->w;
548585   window().m_height = m_sdlsurf->h;
549586   if (sm->is_yuv)
r243358r243359
645682}
646683
647684//============================================================
648//  sdl_info::draw
685//  sdl_info::clear
649686//============================================================
650687
651688void sdl_info::clear()
652689{
690   //FIXME: Handled in sdl_info::draw as well
653691   m_blittimer = 3;
654692}
655693
r243358r243359
659697
660698int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt)
661699{
662//   const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
663
664700   *xt = x - m_last_hofs;
665701   *yt = y - m_last_vofs;
666702   if (*xt<0 || *xt >= window().m_blitwidth)
667703      return 0;
668   if (*yt<0 || *xt >= window().m_blitheight)
704   if (*yt<0 || *yt >= window().m_blitheight)
669705      return 0;
670706   return 1;
671707}
672708
673709//============================================================
674//  drawsdl_window_get_primitives
710//  sdl_info::draw
675711//============================================================
676712
677void sdl_info::set_target_bounds()
678{
679   window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect());
680}
681
682//============================================================
683//  drawsdl_window_draw
684//============================================================
685
686713int sdl_info::draw(UINT32 dc, int update)
687714{
688715   const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode];
trunk/src/osd/sdl/window.c
r243358r243359
10311031         }
10321032
10331033         // ensure the target bounds are up-to-date, and then get the primitives
1034         renderer().set_target_bounds();
10351034
1035         m_target->set_bounds(m_blitwidth, m_blitheight, monitor()->aspect());
1036
10361037         render_primitive_list &primlist = m_target->get_primitives();
10371038
10381039         // and redraw now
trunk/src/osd/sdl/window.h
r243358r243359
3737class osd_renderer
3838{
3939public:
40   osd_renderer(sdl_window_info *window)
41   : m_window(window) { }
4240
41   static const int FLAG_NONE = 0;
42   static const int FLAG_NEEDS_OPENGL = 1;
43
44   osd_renderer(sdl_window_info *window, const int flags)
45   : m_window(window), m_flags(flags) { }
46
4347   virtual ~osd_renderer() { }
4448
4549   sdl_window_info &window() { return *m_window; }
50   int flags() const { return m_flags; }
51   bool check_flag(const int flag) { return ((m_flags & flag)) == flag; }
4652
47   virtual int create(int width, int height) = 0;
48   virtual void resize(int width, int height) = 0;
49   virtual int draw(UINT32 dc, int update) = 0;
50   virtual void set_target_bounds() = 0;
51   virtual int xy_to_render_target(int x, int y, int *xt, int *yt) = 0;
53   virtual int create(const int width, const int height) = 0;
54   virtual void resize(const int width, const int height) = 0;
55   virtual int draw(const UINT32 dc, const int update) = 0;
56   virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0;
5257   virtual void destroy_all_textures() = 0;
5358   virtual void destroy() = 0;
5459   virtual void clear() = 0;
5560
5661private:
5762   sdl_window_info *m_window;
63   int m_flags;
5864};
5965
6066#define OSDWORK_CALLBACK(name)  void *name(void *param, ATTR_UNUSED int threadid)
trunk/src/osd/windows/vconv.c
r243358r243359
7878   // warning C4146: unary minus operator applied to unsigned type, result still unsigned
7979   // warning C4150: deletion of pointer to incomplete type 'xxx'; no destructor called
8080   // warning C4189: 'xxx' : local variable is initialized but not referenced
81   // warning C4191: 'type cast' : unsafe conversion from 'xxx' to 'xxx' // 64-bit only
8281   // warning C4201: nonstandard extension used : nameless struct/union
8382   // warning C4242: 'x' : conversion from 'xxx' to 'xxx', possible loss of data
8483   // warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
8584   // warning C4250: 'xxx' : inherits 'xxx' via dominance
8685   // warning C4255: 'xxx' : no function prototype given: converting '()' to '(void)'
8786   // warning C4296: 'x' : expression is always false
88   // warning C4306: 'xxx': conversion from 'type1' to 'type2' of greater size // 64-bit only
8987   // warning C4310: cast truncates constant value
9088   // warning C4324: 'xxx' : structure was padded due to __declspec(align())
9189   // warning C4347: behavior change: 'xxx' is called instead of 'xxx' // obsolete VS2005 - VS2010 only
r243358r243359
9391   // warning C4510: 'xxx' : default constructor could not be generated
9492   // warning C4512: 'xxx' : assignment operator could not be generated
9593   // warning C4514: 'xxx' : unreferenced inline function has been removed
96   // warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
9794   // warning C4619: #pragma warning : there is no warning number 'xxx'
9895   // warning C4571: Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught
9996   // warning C4610: struct 'xxx' can never be instantiated - user defined constructor required
10097   // warning C4625: 'xxx' : copy constructor could not be generated because a base class copy constructor is inaccessible or deleted
10198   // warning C4626: 'xxx' : assignment operator could not be generated because a base class assignment operator is inaccessible or deleted
102   // warning C4640: 'xxx' : construction of local static object is not thread-safe
10399   // warning C4668: 'xxx' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
104100   // warning C4702: unreachable code
105101   // warning C4706: assignment within conditional expression
r243358r243359
108104   // warning C4805: 'x' : unsafe mix of type 'xxx' and type 'xxx' in operation
109105   // warning C4820: 'xxx' : 'x' bytes padding added after data member 'xxx'
110106   // warning C4826: Conversion from 'type1 ' to 'type_2' is sign-extended. This may cause unexpected runtime behavior. // 32-bit only
111   { VS7,      "-Wall",                    "/Wall /W4 /wd4003 /wd4018 /wd4061 /wd4100 /wd4127 /wd4131 /wd4141 /wd4146 /wd4150 /wd4189 /wd4191 /wd4201 /wd4242 /wd4244 /wd4250 /wd4255 /wd4296 /wd4306 /wd4310 /wd4324 /wd4347 /wd4435 /wd4510 /wd4512 /wd4514 /wd4571 /wd4610 /wd4611 /wd4619 /wd4625 /wd4626 /wd4640 /wd4668 /wd4702 /wd4706 /wd4710 /wd4711 /wd4805 /wd4820 /wd4826" },
107   { VS7,      "-Wall",                    "/Wall /W4 /wd4003 /wd4018 /wd4061 /wd4100 /wd4127 /wd4131 /wd4141 /wd4146 /wd4150 /wd4189 /wd4201 /wd4242 /wd4244 /wd4250 /wd4255 /wd4296 /wd4310 /wd4324 /wd4347 /wd4435 /wd4510 /wd4512 /wd4514 /wd4571 /wd4610 /wd4619 /wd4625 /wd4626 /wd4668 /wd4702 /wd4706 /wd4710 /wd4711 /wd4805 /wd4820 /wd4826" },
112108   { 0,        "-Wall",                    "/W0" },
113109   { VS7,      "-Wno-unused",              "/wd4100 /wd4101 /wd4102 /wd4505" },
114110   { 0,        "-Wno-sign-compare",        "/wd4365 /wd4389 /wd4245 /wd4388" },
trunk/src/osd/windows/winprefix.h
r243358r243359
1313#ifdef _MSC_VER
1414#include <assert.h>
1515#include <malloc.h>
16#if _MSC_VER < 1900 // < VS2015
17#define snprintf _snprintf
18#if _MSC_VER < 1800 // VS2013 or earlier
16#if _MSC_VER < 1500 // < VS2008
17#define vsnprintf _vsnprintf
18#elif _MSC_VER < 1800 // < VS2013
1919#define alloca _alloca
2020#define round(x) floor((x) + 0.5)
2121#define strtoll _strtoi64
r243358r243359
2424static __inline double fmin(double x, double y){ return (x < y) ? x : y; }
2525static __inline double fmax(double x, double y){ return (x > y) ? x : y; }
2626static __inline double log2(double x) { return log(x) * M_LOG2E; }
27#if _MSC_VER < 1500 // VS2008 or earlier
28#define vsnprintf _vsnprintf
29#endif // VS2008
30#endif // VS2013
31#else // VS2015
27#elif _MSC_VER < 1900 // < VS2015
28#define snprintf _snprintf
29#else
3230#pragma warning (disable: 4091)
3331#pragma warning (disable: 4267)
3432#pragma warning (disable: 4456 4457 4458 4459)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team