Previous 199869 Revisions Next

r18573 Wednesday 17th October, 2012 at 10:43:30 UTC by Miodrag Milanović
clean up some chess machines (no whatsnew)
[src/mess/drivers]glasgow.c mephisto.c mmodular.c
[src/mess/includes]mboard.h*
[src/mess/machine]mboard.c mboard.h

trunk/src/mess/drivers/mmodular.c
r18572r18573
9595
9696#include "rendlay.h"
9797
98#include "machine/mboard.h"
98#include "includes/mboard.h"
9999#include "machine/nvram.h"
100100
101101//static UINT16 unknown2_data = 0;
r18572r18573
124124
125125UINT8 lcd32_char;
126126
127class polgar_state : public driver_device
127class polgar_state : public mboard_state
128128{
129129public:
130130   polgar_state(const machine_config &mconfig, device_type type, const char *tag)
131      : driver_device(mconfig, type, tag) { }
131      : mboard_state(mconfig, type, tag) { }
132132
133133   UINT8 led_status;
134134   UINT8 lcd_char;
r18572r18573
200200   TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq6);
201201   TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq2);
202202   TIMER_DEVICE_CALLBACK_MEMBER(timer_update_irq_academy);
203   void common_chess_start();
203204};
204205
205206static HD44780_INTERFACE( chess_display )
r18572r18573
234235      }
235236}
236237
237static int get_first_cleared_bit(UINT8 data)
238{
239   int i;
240
241   for (i = 0; i < 8; i++)
242      if (!BIT(data, i))
243         return i;
244
245   return NOT_VALID;
246}
247
248238WRITE8_MEMBER(polgar_state::write_polgar_IO)
249239{
250240   int i;
r18572r18573
10241014
10251015MACHINE_START_MEMBER(polgar_state,risc)
10261016{
1027
10281017}
10291018
10301019
1031static void common_chess_start(void)
1020void polgar_state::common_chess_start()
10321021{
10331022   mboard_set_border_pieces();
10341023   mboard_set_board();
r18572r18573
10371026MACHINE_START_MEMBER(polgar_state,polgar)
10381027{
10391028   common_chess_start();
1040   mboard_savestate_register(machine());
1029   mboard_savestate_register();
10411030}
10421031
10431032MACHINE_START_MEMBER(polgar_state,sfortea)
10441033{
10451034   common_chess_start();
1046   mboard_savestate_register(machine());
1035   mboard_savestate_register();
10471036}
10481037
10491038MACHINE_START_MEMBER(polgar_state,diablo68)
10501039{
1051
10521040   common_chess_start();
1053
10541041}
10551042
10561043MACHINE_START_MEMBER(polgar_state,van16)
10571044{
1058
1059   mboard_savestate_register(machine());
1060
1045   mboard_savestate_register();
10611046}
10621047
10631048MACHINE_RESET_MEMBER(polgar_state,van16)
10641049{
10651050   common_chess_start();
1066
10671051}
10681052
10691053MACHINE_RESET_MEMBER(polgar_state,polgar)
10701054{
10711055   common_chess_start();
1072
10731056}
10741057
10751058MACHINE_RESET_MEMBER(polgar_state,sfortea)
10761059{
10771060   common_chess_start();
1078
10791061}
10801062
10811063MACHINE_RESET_MEMBER(polgar_state,monteciv)
r18572r18573
11191101
11201102static ADDRESS_MAP_START(polgar_mem , AS_PROGRAM, 8, polgar_state )
11211103   AM_RANGE( 0x0000, 0x1fff ) AM_RAM
1122   AM_RANGE( 0x2400, 0x2400 ) AM_WRITE_LEGACY(mboard_write_LED_8 )      // Chessboard
1123   AM_RANGE( 0x2800, 0x2800 ) AM_WRITE_LEGACY(mboard_write_board_8)      // Chessboard
1124   AM_RANGE( 0x3000, 0x3000 ) AM_READ_LEGACY(mboard_read_board_8 )      // Chessboard
1104   AM_RANGE( 0x2400, 0x2400 ) AM_WRITE(mboard_write_LED_8 )      // Chessboard
1105   AM_RANGE( 0x2800, 0x2800 ) AM_WRITE(mboard_write_board_8)      // Chessboard
1106   AM_RANGE( 0x3000, 0x3000 ) AM_READ(mboard_read_board_8 )      // Chessboard
11251107   AM_RANGE( 0x3400, 0x3405 ) AM_WRITE(polgar_write_LED)   // Function LEDs
11261108   AM_RANGE( 0x2c00, 0x2c07 ) AM_READ(read_keys)
11271109   AM_RANGE( 0x2004, 0x2004 ) AM_WRITE(write_polgar_IO )   // LCD Instr. Reg + Beeper
r18572r18573
11441126
11451127   AM_RANGE( 0x00000000,  0x0003ffff )  AM_ROM
11461128
1147   AM_RANGE( 0xc0000000 , 0xc0000003 )  AM_READ_LEGACY(mboard_read_board_32 )
1148   AM_RANGE( 0xc8000000 , 0xc8000003 )  AM_WRITE_LEGACY(mboard_write_board_32 )
1149   AM_RANGE( 0xc8000004 , 0xc8000007 )  AM_WRITE_LEGACY(mboard_write_board_32 )
1150   AM_RANGE( 0xd0000000 , 0xd0000003 )  AM_WRITE_LEGACY(mboard_write_LED_32 )
1151   AM_RANGE( 0xd0000004 , 0xd0000007 )  AM_WRITE_LEGACY(mboard_write_LED_32 )
1129   AM_RANGE( 0xc0000000 , 0xc0000003 )  AM_READ(mboard_read_board_32 )
1130   AM_RANGE( 0xc8000000 , 0xc8000003 )  AM_WRITE(mboard_write_board_32 )
1131   AM_RANGE( 0xc8000004 , 0xc8000007 )  AM_WRITE(mboard_write_board_32 )
1132   AM_RANGE( 0xd0000000 , 0xd0000003 )  AM_WRITE(mboard_write_LED_32 )
1133   AM_RANGE( 0xd0000004 , 0xd0000007 )  AM_WRITE(mboard_write_LED_32 )
11521134   AM_RANGE( 0xf0000004 , 0xf0000013 )  AM_READ(read_buttons_gen32 )
11531135   AM_RANGE( 0xe0000000 , 0xe0000003 )  AM_WRITE(write_LCD_data_32 )
11541136   AM_RANGE( 0xe0000010 , 0xe0000013 )  AM_WRITE(write_IOenables_32 )
r18572r18573
11791161
11801162   AM_RANGE( 0x00000000,  0x0003ffff )  AM_ROM
11811163
1182   AM_RANGE( 0x800000fc , 0x800000ff )  AM_READ_LEGACY(mboard_read_board_32 )
1183   AM_RANGE( 0x88000000 , 0x88000007 )  AM_WRITE_LEGACY(mboard_write_board_32 )
1184   AM_RANGE( 0x90000000 , 0x90000007 )  AM_WRITE_LEGACY(mboard_write_LED_32 )
1164   AM_RANGE( 0x800000fc , 0x800000ff )  AM_READ(mboard_read_board_32 )
1165   AM_RANGE( 0x88000000 , 0x88000007 )  AM_WRITE(mboard_write_board_32 )
1166   AM_RANGE( 0x90000000 , 0x90000007 )  AM_WRITE(mboard_write_LED_32 )
11851167   AM_RANGE( 0x800000ec , 0x800000ff )  AM_READ(read_buttons_van32 )
11861168   AM_RANGE( 0xa0000000 , 0xa0000003 )  AM_WRITE(write_LCD_data_32 )
11871169   AM_RANGE( 0xa0000010 , 0xa0000013 )  AM_WRITE(write_IOenables_32 )
r18572r18573
11991181
12001182   AM_RANGE( 0x00000000,  0x0001ffff )  AM_ROM
12011183
1202   AM_RANGE( 0x800000fc , 0x800000ff )  AM_READ_LEGACY(mboard_read_board_32 )
1203   AM_RANGE( 0x88000000 , 0x88000007 )  AM_WRITE_LEGACY(mboard_write_board_32 )
1204   AM_RANGE( 0x90000000 , 0x90000007 )  AM_WRITE_LEGACY(mboard_write_LED_32 )
1184   AM_RANGE( 0x800000fc , 0x800000ff )  AM_READ(mboard_read_board_32 )
1185   AM_RANGE( 0x88000000 , 0x88000007 )  AM_WRITE(mboard_write_board_32 )
1186   AM_RANGE( 0x90000000 , 0x90000007 )  AM_WRITE(mboard_write_LED_32 )
12051187   AM_RANGE( 0x800000ec , 0x800000ff )  AM_READ(read_buttons_van32 )
12061188   AM_RANGE( 0xa0000000 , 0xa0000003 )  AM_WRITE(write_LCD_data_32 )
12071189   AM_RANGE( 0xa0000010 , 0xa0000013 )  AM_WRITE(write_IOenables_32 )
r18572r18573
12271209
12281210   AM_RANGE( 0x000000,  0x03ffff )  AM_ROM
12291211
1230   AM_RANGE( 0xc00000 , 0xc00001 )  AM_READ_LEGACY(mboard_read_board_16 )
1231   AM_RANGE( 0xc80000 , 0xc80001 )  AM_WRITE_LEGACY(mboard_write_board_16 )
1232   AM_RANGE( 0xd00000 , 0xd00001 )  AM_WRITE_LEGACY(mboard_write_LED_16 )
1212   AM_RANGE( 0xc00000 , 0xc00001 )  AM_READ(mboard_read_board_16 )
1213   AM_RANGE( 0xc80000 , 0xc80001 )  AM_WRITE(mboard_write_board_16 )
1214   AM_RANGE( 0xd00000 , 0xd00001 )  AM_WRITE(mboard_write_LED_16 )
12331215   AM_RANGE( 0xf00000 , 0xf00009 )  AM_READ(read_buttons_van16 )
12341216   AM_RANGE( 0xd80000 , 0xd80001 )  AM_WRITE(write_LCD_data )
12351217   AM_RANGE( 0xd80008 , 0xd80009 )  AM_WRITE(write_IOenables )
r18572r18573
12461228
12471229   AM_RANGE( 0x000000,  0x01ffff )  AM_ROM
12481230
1249   AM_RANGE( 0xc00000 , 0xc00001 )  AM_READ_LEGACY(mboard_read_board_16 )
1250   AM_RANGE( 0xc80000 , 0xc80001 )  AM_WRITE_LEGACY(mboard_write_board_16 )
1251   AM_RANGE( 0xd00000 , 0xd00001 )  AM_WRITE_LEGACY(mboard_write_LED_16 )
1231   AM_RANGE( 0xc00000 , 0xc00001 )  AM_READ(mboard_read_board_16 )
1232   AM_RANGE( 0xc80000 , 0xc80001 )  AM_WRITE(mboard_write_board_16 )
1233   AM_RANGE( 0xd00000 , 0xd00001 )  AM_WRITE(mboard_write_LED_16 )
12521234   AM_RANGE( 0xf00000 , 0xf00009 )  AM_READ(read_buttons_van16 )
12531235   AM_RANGE( 0xd80000 , 0xd80001 )  AM_WRITE(write_LCD_data )
12541236   AM_RANGE( 0xd80008 , 0xd80009 )  AM_WRITE(write_IOenables )
r18572r18573
12781260   AM_RANGE( 0x0000, 0x1fff ) AM_RAM
12791261   AM_RANGE( 0x2400, 0x2400 ) AM_READ(read_keys_board_academy )
12801262   AM_RANGE( 0x2800, 0x2800 ) AM_WRITE(academy_write_board )      // Chessboard
1281   AM_RANGE( 0x2c00, 0x2c00 ) AM_WRITE_LEGACY(mboard_write_LED_8 )      // Chessboard
1263   AM_RANGE( 0x2c00, 0x2c00 ) AM_WRITE(mboard_write_LED_8 )      // Chessboard
12821264   AM_RANGE( 0x3002, 0x3002 ) AM_WRITE(beep_academy )
12831265   AM_RANGE( 0x3001, 0x3001 ) AM_WRITE(academy_inhibitNMI )
12841266   AM_RANGE( 0x3400, 0x3400 ) AM_WRITE(academy_write_LED )
r18572r18573
12901272   AM_RANGE( 0x0000, 0x1fff ) AM_RAM
12911273   AM_RANGE( 0x2400, 0x2400 ) AM_READ(read_keys_board_monteciv )
12921274   AM_RANGE( 0x2800, 0x2800 ) AM_WRITE(academy_write_board )      // Chessboard
1293   AM_RANGE( 0x2c00, 0x2c00 ) AM_WRITE_LEGACY(mboard_write_LED_8 )      // Chessboard
1275   AM_RANGE( 0x2c00, 0x2c00 ) AM_WRITE(mboard_write_LED_8 )      // Chessboard
12941276   AM_RANGE( 0x3400, 0x3400 ) AM_WRITE(academy_write_LED )         // Status LEDs
12951277   AM_RANGE( 0x3000, 0x3001 ) AM_WRITE(monteciv_select_line )         // Select Keyline
12961278   AM_RANGE( 0x3002, 0x3002 ) AM_WRITE(beep_academy )
r18572r18573
13061288   AM_RANGE( 0x0000, 0x1fff ) AM_RAM
13071289/// AM_RANGE( 0x2400, 0x2400 ) AM_READ(read_keys_board_monteciv )
13081290   AM_RANGE( 0x6800, 0x6800 ) AM_WRITE(academy_write_board )   // 2800 // Chessboard
1309/// AM_RANGE( 0x2c00, 0x2c00 ) AM_WRITE_LEGACY(mboard_write_LED_8 )      // Chessboard
1291/// AM_RANGE( 0x2c00, 0x2c00 ) AM_WRITE(mboard_write_LED_8 )      // Chessboard
13101292/// AM_RANGE( 0x3400, 0x3400 ) AM_WRITE(academy_write_LED )           // Status LEDs
13111293   AM_RANGE( 0x4400, 0x4400 ) AM_WRITE(megaiv_write_LED )   // 2400     // Select Keyline
13121294   AM_RANGE( 0x7000, 0x7001 ) AM_WRITE(megaiv_IO )         // Select Keyline
r18572r18573
15671549
15681550   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_nmi, attotime::from_hz(600))
15691551   MCFG_TIMER_START_DELAY(attotime::from_hz(60))
1570   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
1552   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(100))
15711553
15721554MACHINE_CONFIG_END
15731555
r18572r18573
15841566
15851567   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_M6502_irq, attotime::from_hz(600))
15861568   MCFG_TIMER_START_DELAY(attotime::from_hz(60))
1587   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
1569   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(100))
15881570MACHINE_CONFIG_END
15891571
15901572static MACHINE_CONFIG_START( alm32, polgar_state )
r18572r18573
15931575   MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
15941576   MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
15951577   MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750))
1596   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
1578   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
15971579
15981580   MCFG_FRAGMENT_ADD( chess_common )
15991581   MCFG_NVRAM_ADD_0FILL("nvram")
r18572r18573
16261608   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
16271609
16281610   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", polgar_state, cause_nmi, attotime::from_hz(600))
1629   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
1611   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(100))
16301612
16311613MACHINE_CONFIG_END
16321614
r18572r18573
16471629
16481630   MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq2, attotime::from_hz(60))
16491631   MCFG_TIMER_START_DELAY(attotime::from_hz(30))
1650   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
1632   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
16511633
16521634
16531635MACHINE_CONFIG_END
r18572r18573
16591641   MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
16601642   MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(600))
16611643   //MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(587))
1662   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
1644   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
16631645   MCFG_FRAGMENT_ADD( chess_common )
16641646   MCFG_NVRAM_ADD_0FILL("nvram")
16651647
r18572r18573
16761658   MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
16771659   MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
16781660   MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750))
1679   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
1661   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
16801662
16811663   MCFG_FRAGMENT_ADD( chess_common )
16821664   MCFG_NVRAM_ADD_0FILL("nvram")
r18572r18573
16881670   MCFG_CPU_PROGRAM_MAP(risc_mem)
16891671   MCFG_MACHINE_START_OVERRIDE(polgar_state,risc)
16901672   MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
1691   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
1673   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
16921674
16931675   MCFG_FRAGMENT_ADD( chess_common )
16941676//  MCFG_NVRAM_ADD_0FILL("nvram")
r18572r18573
17021684   MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
17031685   MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(375))
17041686   //MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(368.64))
1705   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(120))
1687   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(120))
17061688
17071689   MCFG_FRAGMENT_ADD( chess_common )
17081690   MCFG_NVRAM_ADD_0FILL("nvram")
r18572r18573
17251707   MCFG_MACHINE_START_OVERRIDE(polgar_state,van32)
17261708   MCFG_MACHINE_RESET_OVERRIDE(polgar_state,van16)
17271709   MCFG_TIMER_DRIVER_ADD_PERIODIC("int_timer", polgar_state, timer_update_irq6, attotime::from_hz(750))
1728   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
1710   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", polgar_state, mboard_update_artwork, attotime::from_hz(100))
17291711
17301712   MCFG_FRAGMENT_ADD( chess_common )
17311713   MCFG_NVRAM_ADD_0FILL("nvram")
trunk/src/mess/drivers/mephisto.c
r18572r18573
6565#include "sound/beep.h"
6666//#include "mephisto.lh"
6767
68#include "machine/mboard.h"
68#include "includes/mboard.h"
6969
7070
71class mephisto_state : public driver_device
71class mephisto_state : public mboard_state
7272{
7373public:
7474   mephisto_state(const machine_config &mconfig, device_type type, const char *tag)
75      : driver_device(mconfig, type, tag),
75      : mboard_state(mconfig, type, tag),
7676   m_maincpu(*this, "maincpu"),
7777   m_beep(*this, BEEPER_TAG)
7878   { }
r18572r18573
163163   AM_RANGE( 0x0000, 0x1fff) AM_RAM                  // AM_BASE(m_p_ram)
164164   AM_RANGE( 0x2000, 0x2007) AM_WRITE(write_led)         // Status LEDs+ buzzer
165165   AM_RANGE( 0x3000, 0x3007) AM_READ(read_keys)         // Rebel 5.0
166   AM_RANGE( 0x3000, 0x4000) AM_READ_LEGACY(mboard_read_board_8)      // Chessboard
166   AM_RANGE( 0x3000, 0x4000) AM_READ(mboard_read_board_8)      // Chessboard
167167   AM_RANGE( 0x5000, 0x5000) AM_WRITE(write_lcd)
168   AM_RANGE( 0x6000, 0x6000) AM_WRITE_LEGACY(mboard_write_LED_8)      // Chessboard
169   AM_RANGE( 0x7000, 0x7000) AM_WRITE_LEGACY(mboard_write_board_8)   // Chessboard
168   AM_RANGE( 0x6000, 0x6000) AM_WRITE(mboard_write_LED_8)      // Chessboard
169   AM_RANGE( 0x7000, 0x7000) AM_WRITE(mboard_write_board_8)   // Chessboard
170170   AM_RANGE( 0x8000, 0xffff) AM_ROM
171171ADDRESS_MAP_END
172172
r18572r18573
174174static ADDRESS_MAP_START( mephisto_mem, AS_PROGRAM, 8, mephisto_state )
175175   AM_RANGE( 0x0000, 0x1fff) AM_RAM //AM_BASE(m_p_ram)
176176   AM_RANGE( 0x2000, 0x2000) AM_WRITE(write_lcd)
177   AM_RANGE( 0x2400, 0x2407) AM_WRITE_LEGACY(mboard_write_LED_8)      // Chessboard
178   AM_RANGE( 0x2800, 0x2800) AM_WRITE_LEGACY(mboard_write_board_8)      // Chessboard
177   AM_RANGE( 0x2400, 0x2407) AM_WRITE(mboard_write_LED_8)      // Chessboard
178   AM_RANGE( 0x2800, 0x2800) AM_WRITE(mboard_write_board_8)      // Chessboard
179179   AM_RANGE( 0x2c00, 0x2c07) AM_READ(read_keys)
180   AM_RANGE( 0x3000, 0x3000) AM_READ_LEGACY(mboard_read_board_8)      // Chessboard
180   AM_RANGE( 0x3000, 0x3000) AM_READ(mboard_read_board_8)      // Chessboard
181181   AM_RANGE( 0x3400, 0x3407) AM_WRITE(write_led)         // Status LEDs+ buzzer
182182   AM_RANGE( 0x3800, 0x3800) AM_WRITE(mephisto_NMI)         // NMI enable
183183   AM_RANGE( 0x4000, 0x7fff) AM_ROM                  // Opening Library
r18572r18573
188188   AM_RANGE( 0x0000, 0x0fff) AM_RAM //AM_BASE(m_p_ram)
189189   AM_RANGE( 0x1000, 0x1007) AM_WRITE(write_led_mm2)      //Status LEDs
190190   AM_RANGE( 0x1800, 0x1807) AM_READ(read_keys)
191   AM_RANGE( 0x2000, 0x2000) AM_READ_LEGACY(mboard_read_board_8)      //Chessboard
191   AM_RANGE( 0x2000, 0x2000) AM_READ(mboard_read_board_8)      //Chessboard
192192   AM_RANGE( 0x2800, 0x2800) AM_WRITE(write_lcd)
193   AM_RANGE( 0x3000, 0x3000) AM_WRITE_LEGACY(mboard_write_LED_8)      //Chessboard
194   AM_RANGE( 0x3800, 0x3800) AM_WRITE_LEGACY(mboard_write_board_8)      //Chessboard
193   AM_RANGE( 0x3000, 0x3000) AM_WRITE(mboard_write_LED_8)      //Chessboard
194   AM_RANGE( 0x3800, 0x3800) AM_WRITE(mboard_write_board_8)      //Chessboard
195195   AM_RANGE( 0x4000, 0x7fff) AM_ROM                  // Opening Library ?
196196   AM_RANGE( 0x8000, 0xffff) AM_ROM
197197ADDRESS_MAP_END
r18572r18573
361361{
362362   m_lcd_shift_counter = 3;
363363   m_allowNMI = 1;
364   mboard_savestate_register(machine());
364   mboard_savestate_register();
365365}
366366
367367MACHINE_START_MEMBER(mephisto_state,mm2)
r18572r18573
369369   m_lcd_shift_counter = 3;
370370   m_led7=0xff;
371371
372   mboard_savestate_register(machine());
372   mboard_savestate_register();
373373}
374374
375375
r18572r18573
411411   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
412412
413413   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", mephisto_state, update_nmi, attotime::from_hz(600))
414   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
414   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", mephisto_state, mboard_update_artwork, attotime::from_hz(100))
415415MACHINE_CONFIG_END
416416
417417static MACHINE_CONFIG_DERIVED( rebel5, mephisto )
trunk/src/mess/drivers/glasgow.c
r18572r18573
5050#include "cpu/m68000/m68000.h"
5151#include "glasgow.lh"
5252#include "sound/beep.h"
53#include "machine/mboard.h"
53#include "includes/mboard.h"
5454
5555
56class glasgow_state : public driver_device
56class glasgow_state : public mboard_state
5757{
5858public:
5959   glasgow_state(const machine_config &mconfig, device_type type, const char *tag)
60      : driver_device(mconfig, type, tag),
60      : mboard_state(mconfig, type, tag),
6161   m_maincpu(*this, "maincpu"),
6262   m_beep(*this, BEEPER_TAG)
6363   { }
r18572r18573
293293   m_lcd_shift_counter = 3;
294294   beep_set_frequency(m_beep, 44);
295295
296   mboard_savestate_register(machine());
296   mboard_savestate_register();
297297}
298298
299299
r18572r18573
303303   m_lcd_shift_counter = 3;
304304   beep_set_frequency(m_beep, 44);
305305
306   mboard_savestate_register(machine());
306   mboard_savestate_register();
307307}
308308
309309
r18572r18573
321321   AM_RANGE(0x00010000, 0x00010001) AM_WRITE(glasgow_lcd_w)
322322   AM_RANGE(0x00010002, 0x00010003) AM_READWRITE(glasgow_keys_r,glasgow_keys_w)
323323   AM_RANGE(0x00010004, 0x00010005) AM_WRITE(glasgow_lcd_flag_w)
324   AM_RANGE(0x00010006, 0x00010007) AM_READWRITE_LEGACY(mboard_read_board_16,mboard_write_LED_16)
325   AM_RANGE(0x00010008, 0x00010009) AM_WRITE_LEGACY(mboard_write_board_16)
324   AM_RANGE(0x00010006, 0x00010007) AM_READWRITE(mboard_read_board_16,mboard_write_LED_16)
325   AM_RANGE(0x00010008, 0x00010009) AM_WRITE(mboard_write_board_16)
326326   AM_RANGE(0x0001c000, 0x0001ffff) AM_RAM      // 16KB
327327ADDRESS_MAP_END
328328
r18572r18573
333333   AM_RANGE(0x00800002, 0x00800003) AM_WRITE(write_lcd)
334334   AM_RANGE(0x00800008, 0x00800009) AM_WRITE(write_lcd_flag)
335335   AM_RANGE(0x00800004, 0x00800005) AM_WRITE(write_irq_flag)
336   AM_RANGE(0x00800010, 0x00800011) AM_WRITE_LEGACY(mboard_write_board_16)
337   AM_RANGE(0x00800020, 0x00800021) AM_READ_LEGACY(mboard_read_board_16)
336   AM_RANGE(0x00800010, 0x00800011) AM_WRITE(mboard_write_board_16)
337   AM_RANGE(0x00800020, 0x00800021) AM_READ(mboard_read_board_16)
338338   AM_RANGE(0x00800040, 0x00800041) AM_READ(read_newkeys16)
339   AM_RANGE(0x00800088, 0x00800089) AM_WRITE_LEGACY(mboard_write_LED_16)
339   AM_RANGE(0x00800088, 0x00800089) AM_WRITE(mboard_write_LED_16)
340340   AM_RANGE(0x00ffc000, 0x00ffffff) AM_RAM      // 16KB
341341ADDRESS_MAP_END
342342
r18572r18573
348348   AM_RANGE(0x00800000, 0x00800003) AM_WRITE(write_lcd32)
349349   AM_RANGE(0x00800004, 0x00800007) AM_WRITE(write_beeper32)
350350   AM_RANGE(0x00800008, 0x0080000B) AM_WRITE(write_lcd_flag32)
351   AM_RANGE(0x00800010, 0x00800013) AM_WRITE_LEGACY(mboard_write_board_32)
352   AM_RANGE(0x00800020, 0x00800023) AM_READ_LEGACY(mboard_read_board_32)
351   AM_RANGE(0x00800010, 0x00800013) AM_WRITE(mboard_write_board_32)
352   AM_RANGE(0x00800020, 0x00800023) AM_READ(mboard_read_board_32)
353353   AM_RANGE(0x00800040, 0x00800043) AM_READ(read_newkeys32)
354   AM_RANGE(0x00800088, 0x0080008b) AM_WRITE_LEGACY(mboard_write_LED_32)
354   AM_RANGE(0x00800088, 0x0080008b) AM_WRITE(mboard_write_LED_32)
355355ADDRESS_MAP_END
356356
357357static INPUT_PORTS_START( new_keyboard ) //Amsterdam, Dallas 32, Roma, Roma 32
r18572r18573
517517   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
518518
519519   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", glasgow_state, update_nmi, attotime::from_hz(50))
520   MCFG_TIMER_ADD_PERIODIC("artwork_timer", mboard_update_artwork, attotime::from_hz(100))
520   MCFG_TIMER_DRIVER_ADD_PERIODIC("artwork_timer", glasgow_state, mboard_update_artwork, attotime::from_hz(100))
521521MACHINE_CONFIG_END
522522
523523static MACHINE_CONFIG_DERIVED( amsterd, glasgow )
trunk/src/mess/machine/mboard.h
r18572r18573
1/**********************************************************************
2
3     Mephisto Chess Computers
4
5**********************************************************************/
6
7#ifndef __MBOARD_H__
8#define __MBOARD_H__
9
10#include "emu.h"
11
12
13/***************************************************************************
14    MACROS
15***************************************************************************/
16
17enum
18{
19   EM,      /*No piece*/
20   BP,
21   BN,
22   BB,
23   BR,
24   BQ,
25   BK,
26   WP,
27   WN,
28   WB,
29   WR,
30   WQ,
31   WK
32};
33
34#define NOT_VALID      99
35#define BORDER_PIECE   64
36
37#define IsPiece(x)      ((m_board[x] >=1) && (m_board[x] <=12))
38
39#define IsBitSet(x,y)   ( y & (1<<x) )  //ersetzen durch BIT
40
41/***************************************************************************
42    TYPE DEFINITIONS
43***************************************************************************/
44
45struct MOUSE_HOLD {
46   int border_piece;
47   UINT8 from;
48   UINT8 piece;
49};
50
51/***************************************************************************
52    FUNCTION PROTOTYPES
53***************************************************************************/
54
55DECLARE_READ8_HANDLER( mboard_read_board_8 );
56DECLARE_WRITE8_HANDLER( mboard_write_board_8 );
57DECLARE_WRITE8_HANDLER( mboard_write_LED_8 );
58
59DECLARE_READ16_HANDLER( mboard_read_board_16 );
60DECLARE_WRITE16_HANDLER( mboard_write_board_16 );
61DECLARE_WRITE16_HANDLER( mboard_write_LED_16 );
62
63DECLARE_READ32_HANDLER( mboard_read_board_32 );
64DECLARE_WRITE32_HANDLER( mboard_write_board_32 );
65DECLARE_WRITE32_HANDLER( mboard_write_LED_32 );
66
67TIMER_DEVICE_CALLBACK( mboard_update_artwork );
68
69void mboard_savestate_register(running_machine &machine);
70
71void mboard_set_board( void );
72void mboard_set_border_pieces (void);
73
74INLINE UINT8 pos_to_num(UINT8 val)
75{
76   switch (val)
77   {
78      case 0xfe: return 7;
79      case 0xfd: return 6;
80      case 0xfb: return 5;
81      case 0xf7: return 4;
82      case 0xef: return 3;
83      case 0xdf: return 2;
84      case 0xbf: return 1;
85      case 0x7f: return 0;
86      default: return 0xff;
87   }
88}
89
90/***************************************************************************
91    GLOBALS
92***************************************************************************/
93
94extern UINT8 mboard_lcd_invert;
95extern UINT8 mboard_key_select;
96extern UINT8 mboard_key_selector;
97
98#endif /* __MBOARD_H__ */
trunk/src/mess/machine/mboard.c
r18572r18573
44
55**********************************************************************/
66#include "emu.h"
7#include "machine/mboard.h"
7#include "includes/mboard.h"
8/***************************************************************************
9    TYPE DEFINITIONS
10***************************************************************************/
811
9static void set_artwork(running_machine &machine );
10static void check_board_buttons(running_machine &machine );
12#define IsPiece(x)      ((m_board[x] >=1) && (m_board[x] <=12))
1113
12UINT8 mboard_lcd_invert;
13UINT8 mboard_key_select;
14UINT8 mboard_key_selector;
15
16static const int start_board[64] =
14const int mboard_state::start_board[64] =
1715{
1816   BR, BN, BB, BQ, BK, BB, BN, BR,
1917   BP, BP, BP, BP, BP, BP, BP, BP,
r18572r18573
2523   WR, WN, WB, WQ, WK, WB, WN, WR
2624};
2725
28static UINT8 border_pieces[12] = {WK,WQ,WR,WB,WN,WP,BK,BQ,BR,BB,BN,BP,};
26UINT8 mboard_state::border_pieces[12] = {WK,WQ,WR,WB,WN,WP,BK,BQ,BR,BB,BN,BP,};
2927
30static int m_board[64];
31static int save_board[64];
32static UINT16 Line18_LED;
33static UINT16 Line18_REED;
3428
35static MOUSE_HOLD mouse_hold;
36
37static int read_board_flag = TRUE;
38
39static int get_first_bit(UINT8 data)
29int mboard_state::get_first_bit(UINT8 data)
4030{
4131   int i;
4232
r18572r18573
4737   return NOT_VALID;
4838}
4939
50static int get_first_cleared_bit(UINT8 data)
40
41inline UINT8 mboard_state::pos_to_num(UINT8 val)
5142{
43   switch (val)
44   {
45      case 0xfe: return 7;
46      case 0xfd: return 6;
47      case 0xfb: return 5;
48      case 0xf7: return 4;
49      case 0xef: return 3;
50      case 0xdf: return 2;
51      case 0xbf: return 1;
52      case 0x7f: return 0;
53      default: return 0xff;
54   }
55}
56
57int mboard_state::get_first_cleared_bit(UINT8 data)
58{
5259   int i;
5360
5461   for (i=0;i<8;i++)
r18572r18573
5865   return NOT_VALID;
5966}
6067
61static UINT8 read_board(void)
68UINT8 mboard_state::read_board()
6269{
6370     UINT8 i_18, i_AH;
6471     UINT8 data;
r18572r18573
110117}
111118
112119
113static void write_board( running_machine &machine, UINT8 data)
120void mboard_state::write_board(UINT8 data)
114121{
115122
116123   Line18_REED=data;
117124
118   if (read_board_flag && !strcmp(machine.system().name,"glasgow") ) //HACK
125   if (read_board_flag && !strcmp(machine().system().name,"glasgow") ) //HACK
119126      Line18_LED = 0;
120127   else
121128      Line18_LED = data;
r18572r18573
128135
129136
130137
131static void write_LED(UINT8 data)
138void mboard_state::write_LED(UINT8 data)
132139{
133140   int i;
134141   UINT8 i_AH, i_18;
r18572r18573
169176
170177
171178
172READ8_HANDLER( mboard_read_board_8 )
179READ8_MEMBER(mboard_state::mboard_read_board_8)
173180{
174181   UINT8 data;
175182
r18572r18573
178185   return data;
179186}
180187
181READ16_HANDLER( mboard_read_board_16 )
188READ16_MEMBER(mboard_state::mboard_read_board_16)
182189{
183190   UINT8 data;
184191
r18572r18573
186193   return data << 8;
187194}
188195
189READ32_HANDLER( mboard_read_board_32 )
196READ32_MEMBER(mboard_state::mboard_read_board_32)
190197{
191198   UINT8 data;
192199
r18572r18573
194201   return data<<24;
195202}
196203
197WRITE8_HANDLER( mboard_write_board_8 )
204WRITE8_MEMBER(mboard_state::mboard_write_board_8)
198205{
199   write_board(space.machine(),data);
206   write_board(data);
200207   logerror("Write Board Port  Data = %02x\n",data);
201208}
202209
203WRITE16_HANDLER( mboard_write_board_16 )
210WRITE16_MEMBER(mboard_state::mboard_write_board_16)
204211{
205   if (data & 0xff) write_board(space.machine(),data);
212   if (data & 0xff) write_board(data);
206213   logerror("write board 16 %08x\n",data);
207   write_board(space.machine(),data>>8);
214   write_board(data>>8);
208215}
209216
210WRITE32_HANDLER( mboard_write_board_32 )
217WRITE32_MEMBER(mboard_state::mboard_write_board_32)
211218{
212219//  data |= data << 24;
213220//printf("write board %08x %08x\n",offset,data);
214221   logerror("write board 32 o: %08x d: %08x\n",offset,data);
215   if (offset) write_board(space.machine(),data);
216   else write_board(space.machine(),data>>24);
222   if (offset) write_board(data);
223   else write_board(data>>24);
217224}
218225
219WRITE8_HANDLER( mboard_write_LED_8 )
226WRITE8_MEMBER(mboard_state::mboard_write_LED_8)
220227{
221228   write_LED(data);
222229   space.device().execute().spin_until_time(attotime::from_usec(7));
223230}
224231
225WRITE16_HANDLER( mboard_write_LED_16 )
232WRITE16_MEMBER(mboard_state::mboard_write_LED_16)
226233{
227234    write_LED(data >> 8);
228235    space.device().execute().spin_until_time(attotime::from_usec(9));
229236}
230237
231WRITE32_HANDLER( mboard_write_LED_32 )
238WRITE32_MEMBER(mboard_state::mboard_write_LED_32)
232239{
233240//  data = data | data << 24;
234241//printf("write LED %08x %08x\n",offset,data);
r18572r18573
241248
242249/* save states callback */
243250
244static void board_presave(running_machine *machine)
251void mboard_state::board_presave()
245252{
246253   int i;
247254   for (i=0;i<64;i++)
248255      save_board[i]=m_board[i];
249256}
250257
251static void board_postload(running_machine *machine)
258void mboard_state::board_postload()
252259{
253260   int i;
254261   for (i=0;i<64;i++)
r18572r18573
256263
257264}
258265
259void mboard_savestate_register(running_machine &machine)
266void mboard_state::mboard_savestate_register()
260267{
261   state_save_register_global_array(machine,save_board);
262   machine.save().register_postload(save_prepost_delegate(FUNC(board_postload),&machine));
263   machine.save().register_presave(save_prepost_delegate(FUNC(board_presave),&machine));
268   state_save_register_global_array(machine(),save_board);
269   machine().save().register_postload(save_prepost_delegate(FUNC(mboard_state::board_postload),this));
270   machine().save().register_presave(save_prepost_delegate(FUNC(mboard_state::board_presave),this));
264271}
265272
266void mboard_set_board( void )
273void mboard_state::mboard_set_board()
267274{
275   read_board_flag = TRUE;
268276   int i;
269277   for (i=0;i<64;i++)
270278      m_board[i]=start_board[i];
271279}
272280
273static void clear_board( void )
281void mboard_state::clear_board()
274282{
275283   int i;
276284   for (i=0;i<64;i++)
277285      m_board[i]=EM;
278286}
279287
280static void set_artwork ( running_machine &machine )
288void mboard_state::set_artwork()
281289{
282290   int i;
283291   for (i=0;i<64;i++)
284292      output_set_indexed_value("P", i, m_board[i]);
285293}
286294
287void mboard_set_border_pieces (void)
295void mboard_state::mboard_set_border_pieces()
288296{
289297   int i;
290298   for (i=0;i<12;i++)
291299      output_set_indexed_value("Q", i, border_pieces[i]);
292300}
293301
294TIMER_DEVICE_CALLBACK( mboard_update_artwork )
302TIMER_DEVICE_CALLBACK_MEMBER(mboard_state::mboard_update_artwork )
295303{
296   check_board_buttons(timer.machine());
297   set_artwork(timer.machine());
304   check_board_buttons();
305   set_artwork();
298306   mboard_set_border_pieces();
299307}
300308
301static void check_board_buttons ( running_machine &machine )
309void mboard_state::check_board_buttons()
302310{
303311   int field;
304312   int i;
r18572r18573
315323
316324/* check click on border pieces */
317325   i=0;
318   port_input=machine.root_device().ioport("B_BLACK")->read();
326   port_input=machine().root_device().ioport("B_BLACK")->read();
319327   if (port_input)
320328   {
321329      i=get_first_bit(port_input)+6;
322330      click_on_border_piece=TRUE;
323331   }
324332
325   port_input=machine.root_device().ioport("B_WHITE")->read();
333   port_input=machine().root_device().ioport("B_WHITE")->read();
326334   if (port_input)
327335   {
328336      i=get_first_bit(port_input);
r18572r18573
335343      {
336344         if (border_pieces[i] > 12 )      /* second click on selected border piece */
337345         {
338            mouse_hold.border_piece=FALSE;
346            mouse_hold_border_piece=FALSE;
339347            border_pieces[i]=border_pieces[i]-12;
340            mouse_hold.from=0;
341            mouse_hold.piece=0;
348            mouse_hold_from=0;
349            mouse_hold_piece=0;
342350         }
343         else if (!mouse_hold.piece)      /*select border piece */
351         else if (!mouse_hold_piece)      /*select border piece */
344352         {
345            if  (mouse_hold.border_piece)
346               border_pieces[mouse_hold.from]=border_pieces[mouse_hold.from]-12;
353            if  (mouse_hold_border_piece)
354               border_pieces[mouse_hold_from]=border_pieces[mouse_hold_from]-12;
347355
348            mouse_hold.from=i;
349            mouse_hold.piece=border_pieces[i];
356            mouse_hold_from=i;
357            mouse_hold_piece=border_pieces[i];
350358            border_pieces[i]=border_pieces[i]+12;
351            mouse_hold.border_piece=TRUE;
359            mouse_hold_border_piece=TRUE;
352360         }
353361
354362         mouse_down = board_row + 1;
r18572r18573
359367
360368
361369/* check click on board */
362   data = machine.root_device().ioport(keynames[board_row])->read_safe(0xff);
370   data = machine().root_device().ioport(keynames[board_row])->read_safe(0xff);
363371
364372   if ((data != 0xff) && (!mouse_down) )
365373   {
r18572r18573
371379      if (!(pos2num_res < 8))
372380         logerror("Position out of bound!");
373381
374      else if ((mouse_hold.piece) && (!IsPiece(field)))
382      else if ((mouse_hold_piece) && (!IsPiece(field)))
375383      {
376384         /* Moving a piece onto a blank */
377         m_board[field] = mouse_hold.piece;
385         m_board[field] = mouse_hold_piece;
378386
379         if (mouse_hold.border_piece)
387         if (mouse_hold_border_piece)
380388         {
381            border_pieces[mouse_hold.from]=border_pieces[mouse_hold.from]-12;
382         }else if ( field != mouse_hold.from  )   /* Put a selected piece back to the source field */
383            m_board[mouse_hold.from] = 0;
389            border_pieces[mouse_hold_from]=border_pieces[mouse_hold_from]-12;
390         }else if ( field != mouse_hold_from  )   /* Put a selected piece back to the source field */
391            m_board[mouse_hold_from] = 0;
384392
385393
386         mouse_hold.from  = 0;
387         mouse_hold.piece = 0;
388         mouse_hold.border_piece=FALSE;
394         mouse_hold_from  = 0;
395         mouse_hold_piece = 0;
396         mouse_hold_border_piece=FALSE;
389397      }
390      else if ((!mouse_hold.piece) )
398      else if ((!mouse_hold_piece) )
391399      {
392400         /* Picking up a piece */
393401
394402         if (IsPiece(field))
395403         {
396            mouse_hold.from  = field;
397            mouse_hold.piece = m_board[field];
404            mouse_hold_from  = field;
405            mouse_hold_piece = m_board[field];
398406            m_board[field] = m_board[field]+12;
399407         }
400408
r18572r18573
406414      mouse_down = 0;
407415
408416/* check click on border - remove selected piece*/
409   if (machine.root_device().ioport("LINE10")->read_safe(0x01))
417   if (machine().root_device().ioport("LINE10")->read_safe(0x01))
410418   {
411      if (mouse_hold.piece)
419      if (mouse_hold_piece)
412420      {
413         if (mouse_hold.border_piece)
414            border_pieces[mouse_hold.from]=border_pieces[mouse_hold.from]-12;
421         if (mouse_hold_border_piece)
422            border_pieces[mouse_hold_from]=border_pieces[mouse_hold_from]-12;
415423         else
416            m_board[mouse_hold.from] = 0;
424            m_board[mouse_hold_from] = 0;
417425
418         mouse_hold.from  = 0;
419         mouse_hold.piece = 0;
420         mouse_hold.border_piece = FALSE;
426         mouse_hold_from  = 0;
427         mouse_hold_piece = 0;
428         mouse_hold_border_piece = FALSE;
421429      }
422430
423431      return;
r18572r18573
427435   if (data == 0xff)
428436   {
429437
430      port_input=machine.root_device().ioport("B_BUTTONS")->read();
438      port_input=machine().root_device().ioport("B_BUTTONS")->read();
431439      if (port_input==0x01)
432440      {
433441         clear_board();
trunk/src/mess/includes/mboard.h
r0r18573
1/**********************************************************************
2
3     Mephisto Chess Computers
4
5**********************************************************************/
6
7#ifndef __MBOARD_H__
8#define __MBOARD_H__
9
10/***************************************************************************
11    MACROS
12***************************************************************************/
13
14enum
15{
16   EM,      /*No piece*/
17   BP,
18   BN,
19   BB,
20   BR,
21   BQ,
22   BK,
23   WP,
24   WN,
25   WB,
26   WR,
27   WQ,
28   WK
29};
30
31#define NOT_VALID      99
32#define BORDER_PIECE   64
33
34
35/***************************************************************************
36    FUNCTION PROTOTYPES
37***************************************************************************/
38
39class mboard_state : public driver_device
40{
41public:
42   mboard_state(const machine_config &mconfig, device_type type, const char *tag)
43      : driver_device(mconfig, type, tag)
44   { }
45
46   DECLARE_READ8_MEMBER(mboard_read_board_8);
47   DECLARE_WRITE8_MEMBER(mboard_write_board_8);
48   DECLARE_WRITE8_MEMBER(mboard_write_LED_8);
49
50   DECLARE_READ16_MEMBER(mboard_read_board_16);
51   DECLARE_WRITE16_MEMBER(mboard_write_board_16);
52   DECLARE_WRITE16_MEMBER(mboard_write_LED_16);
53
54   DECLARE_READ32_MEMBER(mboard_read_board_32);
55   DECLARE_WRITE32_MEMBER(mboard_write_board_32);
56   DECLARE_WRITE32_MEMBER(mboard_write_LED_32);
57
58   TIMER_DEVICE_CALLBACK_MEMBER( mboard_update_artwork);
59
60   void mboard_savestate_register();
61
62   void mboard_set_board();
63   void mboard_set_border_pieces();
64
65   inline UINT8 pos_to_num(UINT8 val);
66
67   UINT8 mboard_lcd_invert;
68   UINT8 mboard_key_select;
69   UINT8 mboard_key_selector;
70
71   int get_first_cleared_bit(UINT8 data);
72private:
73   static const int start_board[64];
74   static UINT8 border_pieces[12];
75
76   int m_board[64];
77   int save_board[64];
78   UINT16 Line18_LED;
79   UINT16 Line18_REED;
80
81   int mouse_hold_border_piece;
82   UINT8 mouse_hold_from;
83   UINT8 mouse_hold_piece;
84
85   int read_board_flag;
86   int get_first_bit(UINT8 data);
87   UINT8 read_board();
88   void write_board(UINT8 data);
89   void write_LED(UINT8 data);
90   void board_presave();
91   void board_postload();
92   void clear_board();
93   void set_artwork();
94   void check_board_buttons();
95};
96
97
98
99#endif /* __MBOARD_H__ */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team