Previous 15994 Revisions Next

r15443 Monday 11th June, 2012 at 08:36:53 UTC by Miodrag Milanović
Clean-ups and version bump
[hash]cpc_flop.xml neogeo.xml nes.xml pcw.xml pico.xml
[src]version.c
[src/emu]mconfig.c uimain.c
[src/emu/cpu/i8008]i8008.c i8008.h
[src/emu/machine]68681.c am9517a.c am9517a.h im6402.c im6402.h mc2661.c mc2661.h ram.c
[src/emu/sound]pokey.c pokey.h ym2413.c
[src/lib/formats]esq16_dsk.c esq16_dsk.h
[src/lib/util]options.c
[src/mame]mame.lst mame.mak
[src/mame/audio]bwidow.c taito_en.c
[src/mame/drivers]atarisy2.c bankp.c bfm_sc1.c bfm_sc2.c bfm_sc4.c bfm_sc4h.c bzone.c cinemat.c clayshoo.c dec0.c dec8.c deshoros.c galaxold.c gyruss.c hng64.c irobot.c kontest.c lucky74.c metro.c mhavoc.c model2.c namcos22.c naomi.c pong.c* quantum.c rabbit.c taito_z.c topspeed.c vsnes.c
[src/mame/includes]bankp.h bfm_sc45.h gyruss.h hng64.h topspeed.h
[src/mame/machine]bfm_bd1.c bfm_bd1.h naomim4.c steppers.c steppers.h
[src/mame/video]bfm_adr2.c dec0.c
[src/mess/drivers]apple2.c atari400.c clcd.c dm7000.c esq1.c esq5505.c geniusiq.c itt3030.c kaypro.c m20.c mac.c pc.c wangpc.c x1.c
[src/mess/includes]dm7000.h
[src/mess/machine]a2videoterm.c c64_16kb.c c64_16kb.h e01.c e01.h econet.c econet.h esqvfd.c isa.c isa_fdc.c isa_ide_cd.c isa_sblaster.c laser128.c mb89352.c mc6854.c ncr5390.h nes_pcb.c pc.c upd765.c wangpc_emb.c wangpc_emb.h wangpc_lic.c wangpc_lic.h wangpc_lvc.c wangpc_lvc.h wangpc_mcc.c wangpc_mcc.h wangpc_mvc.c wangpc_mvc.h wangpc_rtc.c wangpc_rtc.h wangpc_tig.c wangpc_tig.h wangpc_wdc.c wangpc_wdc.h wangpckb.c
[src/mess/video]isa_ega.c uv201.h
[src/osd/sdl]sdlmain.c
[src/osd/windows]winmain.c

hash/pcw.xml
r15442r15443
22<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
33<softwarelist name="pcw" description="Amstrad PCW disk images">
44
5<!--
5<!--
66 Known undumped games (partial list, compiled from http://ciberia.ya.com/jevicac/ )
77
88 * 500 c.c. Championship
hash/pico.xml
r15442r15443
22<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
33<softwarelist name="pico" description="Sega Pico cartridges">
44
5<!--
5<!--
66
7Undumped known games
7Undumped known games
88(list based on lists at
99http://www2.plala.or.jp/master_s/pico/soft/pico_soft.html
10http://segaretro.org/
10http://segaretro.org/
1111with a lot of tweaks)
1212
1313
hash/neogeo.xml
r15442r15443
62946294            <rom name="242-v3.v3" offset="0x800000" size="0x400000" crc="044ea4e1" sha1="062a2f2e52098d73bc31c9ad66f5db8080395ce8" />            <!-- TC5332204 -->
62956295            <rom name="242-v4.v4" offset="0xc00000" size="0x400000" crc="7985ea30" sha1="54ed5f0324de6164ea81943ebccb3e8d298368ec" />            <!-- TC5332204 -->
62966296         </dataarea>
6297       <dataarea name="sprites" size="0x4000000">
6297      <dataarea name="sprites" size="0x4000000">
62986298            <rom loadflag="load16_byte" name="242-c1.c1" offset="0x000000" size="0x800000" crc="e564ecd6" sha1="78f22787a204f26bae9b2b1c945ddbc27143352f" />            <!-- Plane 0,1 -->            <!-- TC5364205 -->
62996299            <rom loadflag="load16_byte" name="242-c2.c2" offset="0x000001" size="0x800000" crc="bd959b60" sha1="2c97c59e77c9a3fe7d664e741d37944f3d56c10b" />            <!-- Plane 2,3 -->            <!-- TC5364205 -->
63006300            <rom loadflag="load16_byte" name="242-c3.c3" offset="0x1000000" size="0x800000" crc="22127b4f" sha1="bd0d00f889d9da7c6ac48f287d9ed8c605ae22cf" />            <!-- Plane 0,1 -->            <!-- TC5364205 -->
hash/nes.xml
r15442r15443
6920469204      </part>
6920569205   </software>
6920669206
69207<!-- This dump is supposed to be bad: all other carts with the same PCB have switched CHR bank order, redump needed
69207<!-- This dump is supposed to be bad: all other carts with the same PCB have switched CHR bank order, redump needed
6920869208to check why this is different -->
6920969209   <software name="mc_mario">
6921069210      <description>Mario 7 in 1 (Bad Dump)</description>
hash/cpc_flop.xml
r15442r15443
36153615
36163616
36173617
3618<!-- COMPILED LISTINGS
3619(These were never released as separate disks, but only as BASIC listings on magazines.
3620As such it makes not much sense to talk about good or bad dumps: we currently simply
3621stick to CPC-Power disks, when available)
3618<!-- COMPILED LISTINGS
3619(These were never released as separate disks, but only as BASIC listings on magazines.
3620As such it makes not much sense to talk about good or bad dumps: we currently simply
3621stick to CPC-Power disks, when available)
36223622-->
36233623
36243624   <!-- Identifying 002 Agent Double (F) (2 faces) (1990) [Amstar &amp; CPC].zip... --> <!-- CPC Power -->
r15442r15443
280543280543<!-- SCENE DEMOs/CRACKs/INTROs -->
280544280544<!--
280545280545
280546Shortnames are chosen to "preview" the content:
280546Shortnames are chosen to "preview" the content:
280547280547* d_xxxxx = Demo
280548280548* f_xxxxx = Fanzine
280549280549* i_xxxxx = Intro
r15442r15443
281346281346         </dataarea>
281347281347      </part>
281348281348   </software>
281349   
281350281349
281351281350
281352281351
281352
281353281353<!-- PIT OF DOOM: Hacked/Trained/Cracked Images + Possibly Bad Images + Alt Images for which we have a good disk from CPC Power (they might often be disks in the older DSK format!!) -->
281354281354
281355281355
src/mame/mame.lst
r15442r15443
2149421494jankenmn      // 1985, Sunwise.
2149521495
2149621496flipjack
21497
21498
21499// TTL logic games
21500pong         // (c) 1972 Atari
src/mame/audio/taito_en.c
r15442r15443
22
33    Taito Ensoniq ES5505-based sound hardware
44
5   TODO:
5    TODO:
66
7   * Implement ES5510 ESP
7    * Implement ES5510 ESP
88
99****************************************************************************/
1010
r15442r15443
2020 *  Statics
2121 *
2222 *************************************/
23
23
2424static UINT16   es5510_dsp_ram[0x200];
2525static UINT32   es5510_gpr[0xc0];
2626static UINT32   es5510_dram[1<<24];
r15442r15443
3737 *  Handlers
3838 *
3939 *************************************/
40
40
4141static READ16_HANDLER( en_68000_share_r )
4242{
4343   switch (offset & 3)
r15442r15443
217217 *  Reset
218218 *
219219 *************************************/
220
220
221221SOUND_RESET( taito_en_soundsystem_reset )
222222{
223223   /* Sound cpu program loads to 0xc00000 so we use a bank */
r15442r15443
251251   if (channel < 2)
252252   {
253253      es5505_device *es5505 = machine.device<es5505_device>("ensoniq");
254   
254
255255      es5505->set_output_gain(channel, percent / 100.0);
256256   }
257257}
r15442r15443
262262 *  M68681 callback
263263 *
264264 *************************************/
265
265
266266static void taito_en_duart_irq_handler(device_t *device, int state, UINT8 vector)
267267{
268268   if (state == ASSERT_LINE)
269   {     
269   {
270270      device_set_input_line_vector(device->machine().device("audiocpu"), M68K_IRQ_6, vector);
271      device_set_input_line(device->machine().device("audiocpu"), M68K_IRQ_6, ASSERT_LINE);     
271      device_set_input_line(device->machine().device("audiocpu"), M68K_IRQ_6, ASSERT_LINE);
272272   }
273273   else
274274   {
275      device_set_input_line(device->machine().device("audiocpu"), M68K_IRQ_6, CLEAR_LINE);   
275      device_set_input_line(device->machine().device("audiocpu"), M68K_IRQ_6, CLEAR_LINE);
276276   }
277277}
278278
r15442r15443
282282 *  Device interfaces
283283 *
284284 *************************************/
285
285
286286static const duart68681_config taito_en_duart68681_config =
287287{
288288   taito_en_duart_irq_handler,
r15442r15443
309309 *  Machine driver
310310 *
311311 *************************************/
312
312
313313MACHINE_CONFIG_FRAGMENT( taito_en_sound )
314314   MCFG_CPU_ADD("audiocpu", M68000, XTAL_16MHz)
315315   MCFG_CPU_PROGRAM_MAP(en_sound_map)
src/mame/audio/bwidow.c
r15442r15443
5353#define BW_C33      CAP_U(0.22)
5454
5555static discrete_op_amp_filt_info stage1_bwidow_info = {
56      BW_R45, 0, 0, 0,    /* r1 .. r4 */
56      BW_R45, 0, 0, 0,   /* r1 .. r4 */
5757      BW_R43,            /* rF */
5858      BW_C27,             /* C1 */
5959      BW_C30,            /* C2 */
60      0,               /* C3 */
60      0,               /* C3 */
6161      0.0,            /* vRef */
6262      15.0,            /* vP */
6363      -15.0,            /* vN */
r15442r15443
6767static discrete_op_amp_filt_info stage2_bwidow_info = {
6868      BW_R48, 0, 0, 0,   /* r1 .. r4 */
6969      BW_R44,            /* rF */
70      BW_C28,            /* C1 */        /* on schematic, not on parts list, gravitar retrofit manual says not needed - so what? */
70      BW_C28,            /* C1 */      /* on schematic, not on parts list, gravitar retrofit manual says not needed - so what? */
7171      0,               /* C2 */
7272      0,               /* C3 */
7373      0.0,            /* vRef */
r15442r15443
7676};
7777
7878static discrete_mixer_desc bwidow_mixer = {
79      DISC_MIXER_IS_OP_AMP,       /* type */
79      DISC_MIXER_IS_OP_AMP,      /* type */
8080      { BW_R49, BW_R46 },         /* r{} */
8181      {},                     /* r_node */
8282      { BW_C33, 0 },            /* c{} */
r15442r15443
111111#define GRAV_C27      CAP_N(1)
112112
113113static discrete_op_amp_filt_info stage1_gravitar_info = {
114      BW_R45, 0, 0, 0,    /* r1 .. r4 */
114      BW_R45, 0, 0, 0,   /* r1 .. r4 */
115115      BW_R43,            /* rF */
116116      GRAV_C27,          /* C1 */
117117      BW_C30,            /* C2 */
118      0,               /* C3 */
118      0,               /* C3 */
119119      0.0,            /* vRef */
120120      15.0,            /* vP */
121121      -15.0,            /* vN */
r15442r15443
125125static discrete_op_amp_filt_info stage2_gravitar_info = {
126126      BW_R48, 0, 0, 0,   /* r1 .. r4 */
127127      BW_R44,            /* rF */
128      BW_C28,            /* C1 */        /* on schematic, not on parts list, gravitar retrofit manual says not needed - so what? */
128      BW_C28,            /* C1 */      /* on schematic, not on parts list, gravitar retrofit manual says not needed - so what? */
129129      0,               /* C2 */
130130      0,               /* C3 */
131131      0.0,            /* vRef */
r15442r15443
134134};
135135
136136static discrete_mixer_desc gravitar_mixer = {
137      DISC_MIXER_IS_OP_AMP,       /* type */
137      DISC_MIXER_IS_OP_AMP,      /* type */
138138      { BW_R49, GRAV_R46 },      /* r{} */
139139      {},                     /* r_node */
140140      { BW_C33, 0 },            /* c{} */
src/mame/machine/bfm_bd1.h
r15442r15443
1#ifndef BFM_BD1
2#define BFM_BD1
1#pragma once
2#ifndef BFM_BD1_H
3#define BFM_BD1_H
34
4#define MAX_BD1  3     // max number of displays emulated
5//Based on the datasheet, the makimum oscillation rate for one character is 31.25 KHz, so we set our character clock to that.
6#define MCFG_BFMBD1_ADD(_tag,_val) \
7      MCFG_DEVICE_ADD(_tag, BFM_BD1,312500)\
8      MCFG_BD1_PORT(_val) \
59
6void   BFM_BD1_init( int id );               // setup a display
10#define MCFG_BD1_PORT(_val) \
11   bfm_bd1_t::static_set_value(*device, _val); \
712
8void   BFM_BD1_reset( int id);               // reset the alpha
13#define MCFG_BFMBD1_REMOVE(_tag) \
14    MCFG_DEVICE_REMOVE(_tag)
915
10void   BFM_BD1_shift_data(int id, int data);   // clock in a bit of data
16class bfm_bd1_t : public device_t
17{
18public:
19   typedef delegate<void (bool state)> line_cb;
20   bfm_bd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
1121
12int      BFM_BD1_newdata(   int id, int data);   // clock in 8 bits of data
1322
14UINT32   *BFM_BD1_get_segments(int id);         // get current segments displayed
15UINT32  *BFM_BD1_set_outputs(int id);         // convert segments to standard for display
16UINT32  *BFM_BD1_get_outputs(int id);         // get converted segments
23   // inline configuration helpers
24   static void static_set_value(device_t &device, int val);
1725
18char   *BFM_BD1_get_string( int id);         // get current string   displayed (not as accurate)
26    int write_char(int data);
27    virtual void update_display();
28   UINT8   m_port_val;
29   void blank(int data);
30   void shift_data(int data);
31   void setdata(int segdata, int data);
32    UINT32 set_display(UINT16 segin);
1933
20void   BFM_BD1_draw(int id);
34protected:
35    static const UINT8 AT_NORMAL  = 0x00;
36    static const UINT8 AT_FLASH   = 0x01;
37    static const UINT8 AT_FLASHED = 0x80;   // set when character should be blinked off
38
39   emu_timer *m_timer;
40
41   int m_cursor_pos;
42   int   m_window_start;      // display window start pos 0-15
43   int   m_window_end;      // display window end   pos 0-15
44   int   m_window_size;      // window  size
45   int   m_shift_count;
46   int   m_shift_data;
47   int m_pcursor_pos;
48   int m_blank_flag;
49   int m_flash_flag;
50   int m_scroll_active;
51   int m_display_mode;
52   int m_flash_rate;
53   int m_flash_control;
54    UINT8 m_cursor;
55    UINT16 m_chars[16];
56    UINT16 m_outputs[16];
57    UINT8 m_attrs[16];
58   UINT16 m_user_data;          // user defined character data (16 bit)
59   UINT16 m_user_def;         // user defined character state
60
61   virtual void device_start();
62   virtual void device_reset();
63   virtual void device_post_load();
64   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
65
66};
67
68extern const device_type BFM_BD1;
2169#endif
2270
src/mame/machine/steppers.c
r15442r15443
66//            also emulates the index optic                              //
77//                                                                       //
88// 26-05-2012: J. Wallace - Implemented proper phase alignment, we no    //
9//                          longer need reverse interfaces here, the     //
9//                          longer need reverse interfaces here, the     //
1010//                          layout will suffice. Added belt reel handler.//
1111// 09-04-2012: J. Wallace - Studied some old reel motors and added a     //
1212//                          number of new stepper types. I am yet to     //
src/mame/machine/steppers.h
r15442r15443
4141   INT16 index_start;/* start position of index (in half steps) */
4242   INT16 index_end;  /* end position of index (in half steps) */
4343   INT16 index_patt; /* pattern needed on coils (0=don't care) */
44   UINT8 initphase; /* Phase at 0, for opto linkage */   
44   UINT8 initphase; /* Phase at 0, for opto linkage */
4545};
4646
4747extern const stepper_interface starpoint_interface_48step;
src/mame/machine/naomim4.c
r15442r15443
9999void naomi_m4_board::board_setup_address(UINT32 address, bool is_dma)
100100{
101101   rom_cur_address = address & 0x1fffffff;
102   encryption = !(address & 0x20000000);
102   encryption = (!is_dma) && !(address & 0x20000000);
103103
104104   if(encryption) {
105105      enc_reset();
src/mame/machine/bfm_bd1.c
r15442r15443
22
33    Bellfruit BD1 VFD module interface and emulation by J.Wallace
44
5    TODO: Implement flashing (our only datasheet has that section
6    completely illegible)
57**********************************************************************/
68
79#include "emu.h"
810#include "bfm_bd1.h"
911
10static struct
11{
12   UINT8   type,            // type of alpha display
12const device_type BFM_BD1 = &device_creator<bfm_bd1_t>;
1313
14         changed,         // flag <>0, if contents are changed
15         window_start,      // display window start pos 0-15
16         window_end,         // display window end   pos 0-15
17         window_size,      // window  size
18         pad;            // unused align byte
1914
20   INT8   pcursor_pos,      // previous cursor pos
21         cursor_pos;         // current cursor pos
22
23   UINT16  user_def,         // user defined character state
24         user_data;         // user defined character data (16 bit)
25
26   UINT8   scroll_active,      // flag <>0, scrolling active
27         display_mode,      // display scroll   mode, 0/1/2/3
28         display_blanking,   // display blanking mode, 0/1/2/3
29         blank_flag,
30         flash_rate,         // flash rate 0-F
31         flash_control,      // flash control 0/1/2/3
32         flash_flag;
33
34   UINT8   string[18];         // text buffer
35   UINT32  segments[16],      // segments
36         outputs[16];      // standardised outputs
37
38   UINT8   count,            // bit counter
39         data;            // receive register
40
41} bd1[MAX_BD1];
42
43
44// local prototypes ///////////////////////////////////////////////////////
45
46static void ScrollLeft( int id);
47static int  BD1_setdata(int id, int segdata, int data);
48
49// local vars /////////////////////////////////////////////////////////////
50
51//
52// Bellfruit BD1 charset to ASCII conversion table
53//
54static const char BD1ASCII[] =
55//0123456789ABCDEF0123456789ABC DEF01 23456789ABCDEF0123456789ABCDEF
56 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?"
57 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?"
58 "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_ ?\"#$%%'()*+.-./0123456789&%<=>?";
59
6015/*
61   BD1 14 segment charset lookup table
16   BD1 14 segment charset lookup table, according to datasheet (we rewire this later)
17
6218        2
6319    ---------
6420   |\   |3  /|
r15442r15443
7127    ---------  C
7228        9
7329
30        8 is flashing
31
7432  */
7533
7634static const UINT16 BD1charset[]=
r15442r15443
11270   0x0009, // 0000 0000 0000 1001 ".
11371   0xC62A, // 1100 0110 0010 1010 #.
11472   0xC62D, // 1100 0110 0010 1101 $.
115   0x0100, // 0000 0000 0000 0000 flash ?
73   0x0100, // 0000 0001 0000 0000 flash character
11674   0x0000, // 0000 0000 0000 0000 not defined
11775   0x0040, // 0000 0000 1000 0000 '.
11876   0x0880, // 0000 1000 1000 0000 (.
r15442r15443
14199   0x4406, // 0100 0100 0000 0110 ?
142100};
143101
144///////////////////////////////////////////////////////////////////////////
145
146void BFM_BD1_init(int id)
102bfm_bd1_t::bfm_bd1_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
103   : device_t(mconfig, BFM_BD1, "BFM BD1 VFD controller", tag, owner, clock),
104   m_port_val(0)
147105{
148   assert_always((id >= 0) && (id < MAX_BD1), "BFM_BD1_init called on an invalid display ID!");
106}
149107
150   memset( &bd1[id], 0, sizeof(bd1[0]));
151
152   BFM_BD1_reset(id);
108void bfm_bd1_t::static_set_value(device_t &device, int val)
109{
110   bfm_bd1_t &bd1 = downcast<bfm_bd1_t &>(device);
111   bd1.m_port_val = val;
153112}
154113
155///////////////////////////////////////////////////////////////////////////
156
157void BFM_BD1_reset(int id)
114void bfm_bd1_t::device_start()
158115{
159   bd1[id].window_end  = 15;
160   bd1[id].window_size = (bd1[id].window_end - bd1[id].window_start)+1;
161   memset(bd1[id].string, ' ', 16);
116   m_timer=timer_alloc(0);
162117
163   bd1[id].count      = 0;
118    save_item(NAME(m_cursor));
119    save_item(NAME(m_cursor_pos));
120   save_item(NAME(m_window_start));      // display window start pos 0-15
121   save_item(NAME(m_window_end));      // display window end   pos 0-15
122   save_item(NAME(m_window_size));      // window  size
123   save_item(NAME(m_shift_count));
124   save_item(NAME(m_shift_data));
125   save_item(NAME(m_pcursor_pos));
126   save_item(NAME(m_blank_flag));
127   save_item(NAME(m_flash_flag));
128   save_item(NAME(m_scroll_active));
129   save_item(NAME(m_display_mode));
130   save_item(NAME(m_flash_rate));
131   save_item(NAME(m_flash_control));
132    save_item(NAME(m_chars));
133    save_item(NAME(m_attrs));
134   save_item(NAME(m_user_data));         // user defined character data (16 bit)
135   save_item(NAME(m_user_def));         // user defined character state
164136
165   bd1[id].changed |= 1;
137   device_reset();
166138}
167139
168///////////////////////////////////////////////////////////////////////////
169
170UINT32 *BFM_BD1_get_segments(int id)
140void bfm_bd1_t::device_reset()
171141{
172   return bd1[id].segments;
142   m_cursor = 0;
143    m_cursor_pos = 0;
144   m_window_start = 0;
145   m_window_end = 0;
146   m_window_size = 0;
147   m_shift_count = 0;
148   m_shift_data = 0;
149   m_pcursor_pos = 0;
150   m_blank_flag = 0;
151   m_flash_flag = 0;
152   m_scroll_active = 0;
153   m_display_mode = 0;
154   m_flash_rate = 0;
155   m_flash_control = 0;
156   m_user_data = 0;
157   m_user_def = 0;
158
159    memset(m_chars, 0, sizeof(m_chars));
160    memset(m_attrs, 0, sizeof(m_attrs));
161   m_timer->adjust(attotime::from_hz(clock()), 0);
173162}
174163
175///////////////////////////////////////////////////////////////////////////
176
177UINT32 *BFM_BD1_get_outputs(int id)
164void bfm_bd1_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
178165{
179   return bd1[id].outputs;
166   update_display();
167   m_timer->adjust(attotime::from_hz(clock()), 0);
180168}
181169
182///////////////////////////////////////////////////////////////////////////
170UINT32 bfm_bd1_t::set_display(UINT16 segin)
171{
172   UINT32 segout=0;
173   if ( segin & 0x0004 )   segout |=  0x0001;
174   else                   segout &= ~0x0001;
175   if ( segin & 0x0002 )   segout |=  0x0002;
176   else                   segout &= ~0x0002;
177   if ( segin & 0x0020 )   segout |=  0x0004;
178   else                   segout &= ~0x0004;
179   if ( segin & 0x0200 )   segout |=  0x0008;
180   else                   segout &= ~0x0008;
181   if ( segin & 0x2000 )   segout |=  0x0010;
182   else                    segout &= ~0x0010;
183   if ( segin & 0x0001 )   segout |=  0x0020;
184   else                    segout &= ~0x0020;
185   if ( segin & 0x8000 )   segout |=  0x0040;
186   else                    segout &= ~0x0040;
187   if ( segin & 0x4000 )   segout |=  0x0080;
188   else                   segout &= ~0x0080;
189   if ( segin & 0x0008 )   segout |=  0x0100;
190   else                  segout &= ~0x0100;
191   if ( segin & 0x0400 )   segout |=  0x0200;
192   else                    segout &= ~0x0200;
193   if ( segin & 0x0010 )   segout |=  0x0400;
194   else                    segout &= ~0x0400;
195   if ( segin & 0x0040 )   segout |=  0x0800;
196   else                    segout &= ~0x0800;
197   if ( segin & 0x0080 )   segout |=  0x1000;
198   else                    segout &= ~0x1000;
199   if ( segin & 0x0800 )   segout |=  0x2000;
200   else                    segout &= ~0x2000;
201   if ( segin & 0x1000 )   segout |=  0x4000;
202   else                    segout &= ~0x4000;
183203
184UINT32 *BFM_BD1_set_outputs(int id)
204   return segout;
205}
206
207void bfm_bd1_t::device_post_load()
185208{
186   int cursor;
187   for (cursor = 0; cursor < 16; cursor++)
209   for (int i =0; i<16; i++)
188210   {
189      if ( BFM_BD1_get_segments(id)[cursor] & 0x0004 )   bd1[id].outputs[cursor] |=  0x0001;
190      else                                          bd1[id].outputs[cursor] &= ~0x0001;
191      if ( BFM_BD1_get_segments(id)[cursor] & 0x0002 )   bd1[id].outputs[cursor] |=  0x0002;
192      else                                          bd1[id].outputs[cursor] &= ~0x0002;
193      if ( BFM_BD1_get_segments(id)[cursor] & 0x0020 )   bd1[id].outputs[cursor] |=  0x0004;
194      else                                          bd1[id].outputs[cursor] &= ~0x0004;
195      if ( BFM_BD1_get_segments(id)[cursor] & 0x0200 )   bd1[id].outputs[cursor] |=  0x0008;
196      else                                          bd1[id].outputs[cursor] &= ~0x0008;
197      if ( BFM_BD1_get_segments(id)[cursor] & 0x2000 )   bd1[id].outputs[cursor] |=  0x0010;
198      else                                          bd1[id].outputs[cursor] &= ~0x0010;
199      if ( BFM_BD1_get_segments(id)[cursor] & 0x0001 )   bd1[id].outputs[cursor] |=  0x0020;
200      else                                          bd1[id].outputs[cursor] &= ~0x0020;
201      if ( BFM_BD1_get_segments(id)[cursor] & 0x8000 )   bd1[id].outputs[cursor] |=  0x0040;
202      else                                          bd1[id].outputs[cursor] &= ~0x0040;
203      if ( BFM_BD1_get_segments(id)[cursor] & 0x4000 )   bd1[id].outputs[cursor] |=  0x0080;
204      else                                          bd1[id].outputs[cursor] &= ~0x0080;
205      if ( BFM_BD1_get_segments(id)[cursor] & 0x0008 )   bd1[id].outputs[cursor] |=  0x0100;
206      else                                          bd1[id].outputs[cursor] &= ~0x0100;
207      if ( BFM_BD1_get_segments(id)[cursor] & 0x0400 )   bd1[id].outputs[cursor] |=  0x0200;
208      else                                          bd1[id].outputs[cursor] &= ~0x0200;
209      if ( BFM_BD1_get_segments(id)[cursor] & 0x0010 )   bd1[id].outputs[cursor] |=  0x0400;
210      else                                          bd1[id].outputs[cursor] &= ~0x0400;
211      if ( BFM_BD1_get_segments(id)[cursor] & 0x0040 )   bd1[id].outputs[cursor] |=  0x0800;
212      else                                          bd1[id].outputs[cursor] &= ~0x0800;
213      if ( BFM_BD1_get_segments(id)[cursor] & 0x0080 )   bd1[id].outputs[cursor] |=  0x1000;
214      else                                          bd1[id].outputs[cursor] &= ~0x1000;
215      if ( BFM_BD1_get_segments(id)[cursor] & 0x0800 )   bd1[id].outputs[cursor] |=  0x2000;
216      else                                          bd1[id].outputs[cursor] &= ~0x2000;
217      if ( BFM_BD1_get_segments(id)[cursor] & 0x1000 )   bd1[id].outputs[cursor] |=  0x4000;
218      else                                          bd1[id].outputs[cursor] &= ~0x4000;
219      //Flashing ? Set an unused pin as a control
220      if ( BFM_BD1_get_segments(id)[cursor] & 0x100 )   bd1[id].outputs[cursor] |=  0x40000;
221      else                                    bd1[id].outputs[cursor] &= ~0x40000;
211      output_set_indexed_value("vfd", (m_port_val*16) + i, m_outputs[i]);
222212   }
223   return 0;
224213}
225///////////////////////////////////////////////////////////////////////////
226214
227char *BFM_BD1_get_string( int id)
215void bfm_bd1_t::update_display()
228216{
229   return (char *)bd1[id].string;
230}
217   m_outputs[m_cursor] = set_display(m_chars[m_cursor]);;
218   output_set_indexed_value("vfd", (m_port_val*16) + m_cursor, m_outputs[m_cursor]);
231219
220   m_cursor++;
221   if (m_cursor >15)
222   {
223      m_cursor=0;
224   }
225}
232226///////////////////////////////////////////////////////////////////////////
233
234void BFM_BD1_shift_data(int id, int data)
227void bfm_bd1_t::blank(int data)
235228{
236   bd1[id].data <<= 1;
237
238   if ( !data ) bd1[id].data |= 1;
239
240   if ( ++bd1[id].count >= 8 )
229   switch ( data & 0x04 )
241230   {
242      if ( BFM_BD1_newdata(id, bd1[id].data) )
231      case 0x00:   // blank all
243232      {
244         bd1[id].changed |= 1;
233         memset(m_chars, 0, sizeof(m_chars));
234         memset(m_attrs, 0, sizeof(m_attrs));
245235      }
246      //logerror("vfd %3d -> %02X \"%s\"\n", id, bd1[id].data, bd1[id].string);
236      break;
237      case 0x01:   // blank inside window
238      if ( m_window_size > 0 )
239      {
240         memset(m_chars+m_window_start,0,m_window_size);
241         memset(m_attrs+m_window_start,0,m_window_size);
242      }
243      break;
244      case 0x02:   // blank outside window
245      if ( m_window_size > 0 )
246      {
247         if ( m_window_start > 0 )
248         {
249            for (int i = 0; i < m_window_start; i++)
250            {
251               memset(m_chars+i,0,i);
252               memset(m_attrs+i,0,i);
253            }
254         }
247255
248      bd1[id].count = 0;
249      bd1[id].data  = 0;
256         if (m_window_end < 15 )
257         {
258            for (int i = m_window_end; i < 15- m_window_end ; i++)
259            {
260               memset(m_chars+i,0,i);
261               memset(m_attrs+i,0,i);
262            }
263         }
264      }
265      break;
266
267      case 0x03:   // blank entire display
268      {
269         memset(m_chars, 0, sizeof(m_chars));
270         memset(m_attrs, 0, sizeof(m_attrs));
271      }
272      break;
250273   }
251274}
252
253///////////////////////////////////////////////////////////////////////////
254
255int BFM_BD1_newdata(int id, int data)
275int bfm_bd1_t::write_char(int data)
256276{
257277   int change = 0;
258   int cursor;
259
260   if ( bd1[id].user_def )
278   if ( m_user_def )
261279   {
262      bd1[id].user_def--;
280      m_user_def--;
263281
264      bd1[id].user_data <<= 8;
265      bd1[id].user_data |= data;
282      m_user_data <<= 8;
283      m_user_data |= data;
266284
267      if ( bd1[id].user_def )
285      if ( m_user_def )
268286      {
269287         return 0;
270288      }
271289
272      data = '@';
273      change = BD1_setdata(id, bd1[id].user_def, data);
290      setdata( m_user_data, data);
291      change ++;
274292   }
275293   else
276294   {
277   }
278295
279   switch ( data & 0xF0 )
280   {
281      case 0x80:   // 0x80 - 0x8F Set display blanking
282
283      //TODO: Implement this, MAME artwork not mature enough
284      switch ( data & 0x04 )
296      if(data < 0x80)//characters
285297      {
286         case 0x00:   // blank all
287         break;
288         case 0x01:   // blank inside window
289         break;
290298
291         case 0x02:   // blank outside window
292         break;
293
294         case 0x03:   // blank entire display
295         break;
296
297         case 0x04:   // futaba setup
298
299         bd1[id].blank_flag = 1;
300         break;
301      }
302      break;
303
304      case 0x90:   // 0x90 - 0x9F Set cursor pos
305
306      bd1[id].cursor_pos = data & 0x0F;
307
308      bd1[id].scroll_active = 0;
309      if ( bd1[id].display_mode == 2 )
310      {
311         if ( bd1[id].cursor_pos >= bd1[id].window_end) bd1[id].scroll_active = 1;
312      }
313      break;
314
315      case 0xA0:   // 0xA0 - 0xAF Set display mode
316
317      bd1[id].display_mode = data &0x03;
318      break;
319
320      case 0xB0:   // 0xB0 - 0xBF Clear display area
321
322      switch ( data & 0x03 )
323      {
324         case 0x00:   // clr nothing
325         break;
326
327         case 0x01:   // clr inside window
328
329         if ( bd1[id].window_size > 0 )
299         if (m_blank_flag || m_flash_flag)
330300         {
331            memset( bd1[id].string+bd1[id].window_start, ' ',bd1[id].window_size );
332         }
333         break;
334
335         case 0x02:   // clr outside window
336
337         if ( bd1[id].window_size > 0 )
338         {
339            if ( bd1[id].window_start > 0 )
301            if (m_blank_flag)
340302            {
341               memset( bd1[id].string, ' ', bd1[id].window_start);
342               for (cursor = 0; cursor < bd1[id].window_start; cursor++)
343               {
344                  bd1[id].segments[cursor] = 0x0000;
345               }
303               //m_display_blanking = data & 0x0F;
304               blank( data & 0x04 );
305               m_blank_flag = 0;
346306            }
347
348            if (bd1[id].window_end < 15 )
307            if (m_flash_flag)
349308            {
350               memset( bd1[id].string+bd1[id].window_end, ' ', 15-bd1[id].window_end);
351               for (cursor = bd1[id].window_end; cursor < 15-bd1[id].window_end; cursor++)
352               {
353                  bd1[id].segments[cursor] = 0x0000;
354               }
355
309               //not setting yet
310               m_flash_flag = 0;
356311            }
357312         }
358         case 0x03:   // clr entire display
359
360         memset(bd1[id].string, ' ' , 16);
361         for (cursor = 0; cursor < 16; cursor++)
313         else
362314         {
363            bd1[id].segments[cursor] = 0x0000;
315            if (data > 0x3F)
316            {
317            //  logerror("Undefined character %x \n", data);
318            }
319
320            setdata(BD1charset[(data & 0x3F)], data);
364321         }
365         break;
366322      }
367      change = 1;
368      break;
323      else
324      {
325         switch ( data & 0xF0 )
326         {
327            case 0x80:   // 0x80 - 0x8F Set display blanking
328            if (data ==0x84)// futaba setup
329            {
330               m_blank_flag = 1;
331            }
332            else
333            {
334               blank(data&0x04);//use the blanking data
335            }
336            break;
369337
370      case 0xC0:   // 0xC0 - 0xCF Set flash rate
338            case 0x90:   // 0x90 - 0x9F Set cursor pos
339            m_cursor_pos = data & 0x0F;
340            m_scroll_active = 0;
341            if ( m_display_mode == 2 )
342            {
343               if ( m_cursor_pos >= m_window_end) m_scroll_active = 1;
344            }
345            break;
371346
372      bd1[id].flash_rate = data & 0x0F;
373      break;
347            case 0xA0:   // 0xA0 - 0xAF Set display mode
348            m_display_mode = data &0x03;
349            break;
374350
375      case 0xD0:   // 0xD0 - 0xDF Set Flash control
351            case 0xB0:   // 0xB0 - 0xBF Clear display area
352            switch ( data & 0x03 )
353            {
354               case 0x00:   // clr nothing
355               break;
376356
377      bd1[id].flash_control = data & 0x03;
378      break;
357               case 0x01:   // clr inside window
358               if ( m_window_size > 0 )
359               {
360                  memset(m_chars+m_window_start,0,m_window_size);
361                  memset(m_attrs+m_window_start,0,m_window_size);
362               }
379363
380      case 0xE0:   // 0xE0 - 0xEF Set window start pos
364               break;
381365
382      bd1[id].window_start = data &0x0F;
383      bd1[id].window_size  = (bd1[id].window_end - bd1[id].window_start)+1;
384      break;
366               case 0x02:   // clr outside window
367               if ( m_window_size > 0 )
368               {
369                  if ( m_window_start > 0 )
370                  {
371                     for (int i = 0; i < m_window_start; i++)
372                     {
373                        memset(m_chars+i,0,i);
374                        memset(m_attrs+i,0,i);
375                     }
376                  }
385377
386      case 0xF0:   // 0xF0 - 0xFF Set window end pos
378                  if (m_window_end < 15 )
379                  {
380                     for (int i = m_window_end; i < 15- m_window_end ; i++)
381                     {
382                        memset(m_chars+i,0,i);
383                        memset(m_attrs+i,0,i);
384                     }
385                  }
386               }
387               case 0x03:   // clr entire display
388               {
389                  memset(m_chars, 0, sizeof(m_chars));
390                  memset(m_attrs, 0, sizeof(m_attrs));
391               }
392            }
393            break;
387394
388      bd1[id].window_end   = data &0x0F;
389      bd1[id].window_size  = (bd1[id].window_end - bd1[id].window_start)+1;
395            case 0xC0:   // 0xC0 - 0xCF Set flash rate
396            m_flash_rate = data & 0x0F;
397            break;
390398
391      bd1[id].scroll_active = 0;
392      if ( bd1[id].display_mode == 2 )
393      {
394         if ( bd1[id].cursor_pos >= bd1[id].window_end)
395         {
396            bd1[id].scroll_active = 1;
397            bd1[id].cursor_pos    = bd1[id].window_end;
398         }
399      }
400      break;
399            case 0xD0:   // 0xD0 - 0xDF Set Flash control
400            m_flash_control = data & 0x03;
401            break;
401402
402      default:
403            case 0xE0:   // 0xE0 - 0xEF Set window start pos
404            m_window_start = data &0x0F;
405            m_window_size  = (m_window_end - m_window_start)+1;
406            break;
403407
404      if (bd1[id].blank_flag || bd1[id].flash_flag)
405      {
406         if (bd1[id].blank_flag)
407         {
408            bd1[id].display_blanking = data & 0x0F;
409            change = 1;
410            bd1[id].blank_flag = 0;
408            case 0xF0:   // 0xF0 - 0xFF Set window end pos
409            m_window_end   = data &0x0F;
410            m_window_size  = (m_window_end - m_window_start)+1;
411            m_scroll_active = 0;
412            if ( m_display_mode == 2 )
413            {
414               if ( m_cursor_pos >= m_window_end)
415               {
416                  m_scroll_active = 1;
417                  m_cursor_pos    = m_window_end;
418               }
419            }
420            break;
411421         }
412         if (bd1[id].flash_flag)
413         {
414            //not setting yet
415            bd1[id].blank_flag = 0;
416         }
417422      }
418      else
419      {
420
421         if (data > 0x3F)
422         {
423         //  logerror("Undefined character %x \n", data);
424         }
425         change = BD1_setdata(id, BD1charset[data & 0x3F], data);
426      }
427      break;
428423   }
429   return change;
424   return 0;
430425}
431
432
433
434
435426///////////////////////////////////////////////////////////////////////////
436427
437static void ScrollLeft(int id)
428void bfm_bd1_t::setdata(int segdata, int data)
438429{
439   int i = bd1[id].window_start;
440
441   while ( i < bd1[id].window_end )
442   {
443      bd1[id].string[ i ] = bd1[id].string[ i+1 ];
444      bd1[id].segments[i] = bd1[id].segments[i+1];
445      i++;
446   }
447}
448
449///////////////////////////////////////////////////////////////////////////
450
451static int BD1_setdata(int id, int segdata, int data)
452{
453
454   int change = 0, move = 0;
455
430   int move = 0;
431   int change =0;
456432   switch ( data )
457433   {
458434      case 0x25:   // flash
459      move++;
435      if(m_chars[m_pcursor_pos] & (1<<8))
436      {
437         move++;
438      }
439      else
440      {
441         m_chars[m_pcursor_pos] |= (1<<8);
442      }
460443      break;
461444
462445      case 0x26:  // undefined
r15442r15443
465448      case 0x2C:  // semicolon
466449      case 0x2E:  // decimal point
467450
468      bd1[id].segments[bd1[id].pcursor_pos] |= (1<<12);
469      change++;
451      if( m_chars[m_pcursor_pos] & (1<<12))
452      {
453         move++;
454      }
455      else
456      {
457         m_chars[m_pcursor_pos] |= (1<<12);
458      }
470459      break;
471460
472461      case 0x3B:   // dummy char
r15442r15443
474463      break;
475464
476465      case 0x3A:
477      bd1[id].user_def = 2;
466      m_user_def = 2;
478467      break;
479468
480469      default:
481      move   = 1;
482      change = 1;
470      move++;
471      change++;
483472   }
484473
485474   if ( move )
486475   {
487      int mode = bd1[id].display_mode;
488476
489      bd1[id].pcursor_pos = bd1[id].cursor_pos;
477      int mode = m_display_mode;
490478
491      if ( bd1[id].window_size <= 0 || (bd1[id].window_size > 16))
492      { // no window selected default to rotate mode
479      m_pcursor_pos = m_cursor_pos;
480
481      if ( m_window_size <= 0 || (m_window_size > 16))
482      { // if no window selected default to equivalent rotate mode
493483            if ( mode == 2 )      mode = 0;
494484            else if ( mode == 3 ) mode = 1;
495            //mode &= -2;
496485      }
497486
498487      switch ( mode )
499488      {
500489      case 0: // rotate left
501490
502      bd1[id].cursor_pos &= 0x0F;
491      m_cursor_pos &= 0x0F;
503492
504493      if ( change )
505494      {
506         bd1[id].string[bd1[id].cursor_pos]   = BD1ASCII[data];
507         bd1[id].segments[bd1[id].cursor_pos] = segdata;
495         m_chars[m_cursor_pos] = segdata;
508496      }
509      bd1[id].cursor_pos++;
510      if ( bd1[id].cursor_pos >= 16 ) bd1[id].cursor_pos = 0;
497      m_cursor_pos++;
498      if ( m_cursor_pos >= 16 ) m_cursor_pos = 0;
511499      break;
512500
513501
514502      case 1: // Rotate right
515503
516      bd1[id].cursor_pos &= 0x0F;
504      m_cursor_pos &= 0x0F;
517505
518506      if ( change )
519507      {
520         bd1[id].string[bd1[id].cursor_pos]   = BD1ASCII[data];
521         bd1[id].segments[bd1[id].cursor_pos] = segdata;
508         m_chars[m_cursor_pos] = segdata;
522509      }
523      bd1[id].cursor_pos--;
524      if ( bd1[id].cursor_pos < 0  ) bd1[id].cursor_pos = 15;
510      m_cursor_pos--;
511      if ( m_cursor_pos < 0  ) m_cursor_pos = 15;
525512      break;
526513
527514      case 2: // Scroll left
528515
529      if ( bd1[id].cursor_pos < bd1[id].window_end )
516      if ( m_cursor_pos < m_window_end )
530517      {
531         bd1[id].scroll_active = 0;
518         m_scroll_active = 0;
532519         if ( change )
533520         {
534            bd1[id].string[bd1[id].cursor_pos]   = BD1ASCII[data];
535            bd1[id].segments[bd1[id].cursor_pos] = segdata;
521            m_chars[m_cursor_pos] = segdata;
536522         }
537         if ( move ) bd1[id].cursor_pos++;
523         m_cursor_pos++;
538524      }
539525      else
540526      {
541527         if ( move )
542528         {
543            if   ( bd1[id].scroll_active ) ScrollLeft(id);
544            else                            bd1[id].scroll_active = 1;
529            if  ( m_scroll_active )
530            {
531               int i = m_window_start;
532               while ( i < m_window_end )
533               {
534                  m_chars[i] = m_chars[i+1];
535                  i++;
536               }
537            }
538            else   m_scroll_active = 1;
545539         }
546540
547541         if ( change )
548542         {
549            bd1[id].string[bd1[id].window_end]   = BD1ASCII[data];
550            bd1[id].segments[bd1[id].cursor_pos] = segdata;
543            m_chars[m_window_end] = segdata;
551544         }
552545         else
553546         {
554            bd1[id].string[bd1[id].window_end]   = ' ';
555            bd1[id].segments[bd1[id].cursor_pos] = 0;
547            m_chars[m_window_end] = 0;
556548         }
557549      }
558550      break;
559551
560552      case 3: // Scroll right
561553
562         if ( bd1[id].cursor_pos > bd1[id].window_start )
554         if ( m_cursor_pos > m_window_start )
563555         {
564556            if ( change )
565557            {
566               bd1[id].string[bd1[id].cursor_pos]   = BD1ASCII[data];
567               bd1[id].segments[bd1[id].cursor_pos] = segdata;
558               m_chars[m_cursor_pos] = segdata;
568559            }
569            bd1[id].cursor_pos--;
560            m_cursor_pos--;
561            if ( m_cursor_pos > 15  ) m_cursor_pos = 0;
570562         }
571563         else
572564         {
573            int i = bd1[id].window_end;
574
575            while ( i > bd1[id].window_start )
565            if ( move )
576566            {
577               bd1[id].string[ i ] = bd1[id].string[ i-1 ];
578               bd1[id].segments[i] = bd1[id].segments[i-1];
579               i--;
580            }
567               if  ( m_scroll_active )
568               {
569                  int i = m_window_end;
581570
571                  while ( i > m_window_start )
572                  {
573                     m_chars[i] = m_chars[i-1];
574                     i--;
575                  }
576               }
577               else   m_scroll_active = 1;
578            }
582579            if ( change )
583580            {
584               bd1[id].string[bd1[id].window_start]   = BD1ASCII[data];
585               bd1[id].segments[bd1[id].window_start] = segdata;
581                m_chars[m_window_start] = segdata;
582             }
583            else
584            {
585                m_chars[m_window_start] = 0;
586586            }
587587         }
588588         break;
589589      }
590590   }
591   return change;
592591}
593592
594void BFM_BD1_draw(int id)
593void bfm_bd1_t::shift_data(int data)
595594{
596   int cursor;
597   BFM_BD1_set_outputs(id);
595   m_shift_data <<= 1;
598596
599   for (cursor = 0; cursor < 16; cursor++)
600   {
601      output_set_indexed_value("vfd", (id*16)+cursor, BFM_BD1_get_outputs(id)[cursor]);
597   if ( !data ) m_shift_data |= 1;
602598
603      if (BFM_BD1_get_outputs(id)[cursor] & 0x40000)
604      {
605         //activate flashing (unimplemented, just toggle on and off)
606      }
607      else
608      {
609         //deactivate flashing (unimplemented)
610      }
599   if ( ++m_shift_count >= 8 )
600   {
601      write_char(m_shift_data);
602      m_shift_count = 0;
603      m_shift_data  = 0;
611604   }
612605}
src/mame/includes/bankp.h
r15442r15443
44
55***************************************************************************/
66
7
8#define BANKP_MASTER_CLOCK 15468000
9#define BANKP_CPU_CLOCK (BANKP_MASTER_CLOCK/6)
10#define BANKP_SN76496_CLOCK (BANKP_MASTER_CLOCK/6)
11
127class bankp_state : public driver_device
138{
149public:
src/mame/includes/bfm_sc45.h
r15442r15443
44#include "machine/sec.h"
55#include "machine/steppers.h" // stepper motor
66
7#include "machine/bfm_bd1.h"
78
89class sc4_state : public driver_device
910{
1011public:
1112   sc4_state(const machine_config &mconfig, device_type type, const char *tag)
1213      : driver_device(mconfig, type, tag),
13        m_maincpu(*this, "maincpu")
14        m_maincpu(*this, "maincpu"),
15        m_vfd0(*this, "vfd0")
16
1417   {
1518      m_chk41addr = -1;
1619      m_dochk41 = false;
r15442r15443
2225   device_t* m_duart;
2326   device_t* m_ymz;
2427   required_device<cpu_device> m_maincpu;
28   optional_device<bfm_bd1_t> m_vfd0;
2529
2630   // serial vfd
2731   int vfd_enabled;
src/mame/includes/topspeed.h
r15442r15443
2828   UINT16 m_msm_loop[2];
2929   UINT16 m_msm_pos[2];
3030   UINT8 m_msm_sel[2];
31   
31
3232   /* misc */
3333   UINT16     m_cpua_ctrl;
3434   INT32      m_ioc220_port;
src/mame/includes/hng64.h
r15442r15443
142142   DECLARE_WRITE32_MEMBER(hng64_soundram_w);
143143
144144   DECLARE_READ32_MEMBER(hng64_soundram_r);
145   
145
146146   // not actually used, but left in code so you can turn it and see the (possibly undesired?) behavior, see notes in memory map
147147   DECLARE_WRITE32_MEMBER(hng64_soundram2_w);
148148   DECLARE_READ32_MEMBER(hng64_soundram2_r);
src/mame/includes/gyruss.h
r15442r15443
44
55*************************************************************************/
66
7#include "sound/discrete.h"
8
79class gyruss_state : public driver_device
810{
911public:
1012   gyruss_state(const machine_config &mconfig, device_type type, const char *tag)
11      : driver_device(mconfig, type, tag) ,
13      : driver_device(mconfig, type, tag),
14      m_maincpu(*this, "maincpu"),
15      m_subcpu(*this, "sub"),
16      m_audiocpu(*this, "audiocpu"),
17      m_audiocpu_2(*this, "audio2"),
18      m_discrete(*this, "discrete"),
1219      m_colorram(*this, "colorram"),
1320      m_videoram(*this, "videoram"),
1421      m_flipscreen(*this, "flipscreen"),
15      m_spriteram(*this, "spriteram"){ }
22      m_spriteram(*this, "spriteram")
23   { }
1624
17   /* memory pointers */
25   /* devices/memory pointers */
26   required_device<cpu_device> m_maincpu;
27   required_device<cpu_device> m_subcpu;
28   required_device<cpu_device> m_audiocpu;
29   required_device<cpu_device> m_audiocpu_2;
30   required_device<discrete_device> m_discrete;
1831   required_shared_ptr<UINT8> m_colorram;
1932   required_shared_ptr<UINT8> m_videoram;
2033   required_shared_ptr<UINT8> m_flipscreen;
2134   required_shared_ptr<UINT8> m_spriteram;
2235
23   /* video-related */
24   tilemap_t    *m_tilemap;
36   tilemap_t *m_tilemap;
37   UINT8 m_master_nmi_mask;
38   UINT8 m_slave_irq_mask;
2539
26   /* devices */
27   cpu_device *m_audiocpu;
28   cpu_device *m_audiocpu_2;
29
30   UINT8      m_master_nmi_mask;
31   UINT8      m_slave_irq_mask;
3240   DECLARE_WRITE8_MEMBER(gyruss_irq_clear_w);
3341   DECLARE_WRITE8_MEMBER(gyruss_sh_irqtrigger_w);
3442   DECLARE_WRITE8_MEMBER(gyruss_i8039_irq_w);
r15442r15443
4553
4654/*----------- defined in video/gyruss.c -----------*/
4755
48
4956PALETTE_INIT( gyruss );
5057VIDEO_START( gyruss );
5158SCREEN_UPDATE_IND16( gyruss );
src/mame/mame.mak
r15442r15443
456456   $(DRIVERS)/nitedrvr.o $(MACHINE)/nitedrvr.o $(AUDIO)/nitedrvr.o $(VIDEO)/nitedrvr.o \
457457   $(DRIVERS)/offtwall.o $(VIDEO)/offtwall.o \
458458   $(DRIVERS)/orbit.o $(AUDIO)/orbit.o $(VIDEO)/orbit.o \
459   $(DRIVERS)/pong.o \
459460   $(DRIVERS)/poolshrk.o $(AUDIO)/poolshrk.o $(VIDEO)/poolshrk.o \
460461   $(DRIVERS)/quantum.o \
461462   $(DRIVERS)/quizshow.o \
r15442r15443
19611962         $(LAYOUT)/sltblgtk.lh
19621963
19631964$(DRIVERS)/bfm_sc4.o:   $(LAYOUT)/bfm_sc4.lh \
1964         $(LAYOUT)/sc4_dmd.lh
1965         $(LAYOUT)/sc4_dmd.lh
19651966
19661967$(DRIVERS)/bfm_sc4h.o:   $(LAYOUT)/bfm_sc4.lh \
1967         $(LAYOUT)/sc4_dmd.lh
1968         $(LAYOUT)/sc4_dmd.lh
19681969
19691970$(DRIVERS)/blockade.o:   $(LAYOUT)/blockade.lh
19701971
src/mame/video/dec0.c
r15442r15443
181181   deco_bac06_pf_control_1_w(state->m_tilegen3,1,state->m_automat_scroll_regs[0], 0xffff);
182182
183183   // sprites seem very different, probably need new functions
184   
184
185185   state->flip_screen_set(state->m_tilegen1->get_flip_state());
186186
187187   if (state->m_pri & 0x04)
r15442r15443
208208      state->m_tilegen2->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
209209   }
210210
211//   if (state->m_pri & 0x02)
212//      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
213//   else
214//      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
211//  if (state->m_pri & 0x02)
212//      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x08, trans^0x08, 0x0f);
213//  else
214//      state->m_spritegen->draw_sprites(screen.machine(), bitmap, cliprect, state->m_buffered_spriteram, 0x00, 0x00, 0x0f);
215215
216216   state->m_tilegen1->deco_bac06_pf_draw(screen.machine(),bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00);
217217   return 0;
r15442r15443
339339
340340VIDEO_START( automat )
341341{
342//   dec0_state *state = machine.driver_data<dec0_state>();
342//  dec0_state *state = machine.driver_data<dec0_state>();
343343}
344344
345345/******************************************************************************/
src/mame/video/bfm_adr2.c
r15442r15443
248248
249249///////////////////////////////////////////////////////////////////////////
250250
251MACHINE_RESET( adder2 )
252{
253   // setup the standard bellfruit BD1 display /////////////////////////////
254
255   BFM_BD1_init(0);
256}
257
258///////////////////////////////////////////////////////////////////////////
259
260251INTERRUPT_GEN( adder2_vbl )
261252{
262253   if ( adder2_c101 & 0x01 )
src/mame/drivers/bfm_sc1.c
r15442r15443
104104{
105105public:
106106   bfm_sc1_state(const machine_config &mconfig, device_type type, const char *tag)
107      : driver_device(mconfig, type, tag) { }
107      : driver_device(mconfig, type, tag),
108        m_vfd0(*this, "vfd0")
109      { }
108110
111   optional_device<bfm_bd1_t> m_vfd0;
112
109113   int m_mmtr_latch;
110114   int m_triac_latch;
111115   int m_vfd_latch;
r15442r15443
162166   DECLARE_READ8_MEMBER(nec_r);
163167   DECLARE_WRITE8_MEMBER(nec_reset_w);
164168   DECLARE_WRITE8_MEMBER(nec_latch_w);
169
165170};
166171
167172#define VFD_RESET  0x20
r15442r15443
347352      { // vfd reset line changed
348353         if ( !(data & VFD_RESET) )
349354         { // reset the vfd
350            BFM_BD1_reset(0);
351            BFM_BD1_reset(1);
352            BFM_BD1_reset(2);
355         m_vfd0->reset();
353356         }
354357      }
355358      if ( changed & VFD_CLOCK1 )
356359      { // clock line changed
357360         if ( !(data & VFD_CLOCK1) && (data & VFD_RESET) )
358361         { // new data clocked into vfd
359            BFM_BD1_shift_data(0, data & VFD_DATA );
362            m_vfd0->shift_data(data & VFD_DATA );
360363         }
361364      }
362      BFM_BD1_draw(0);
363      BFM_BD1_draw(1);
364      BFM_BD1_draw(2);
365365   }
366366}
367367
r15442r15443
633633static MACHINE_RESET( bfm_sc1 )
634634{
635635   bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
636   BFM_BD1_init(0);
637636   state->m_vfd_latch         = 0;
638637   state->m_mmtr_latch        = 0;
639638   state->m_triac_latch       = 0;
r15442r15443
649648   state->m_mux2_datahi        = 0;
650649   state->m_mux2_input        = 0;
651650
652   BFM_BD1_reset(0);   // reset display1
653   BFM_BD1_reset(1);   // reset display2
654   BFM_BD1_reset(2);   // reset display3
651   state->m_vfd0->reset();
655652
656653// reset stepper motors /////////////////////////////////////////////////////////////
657654   {
r15442r15443
10951092   MCFG_CPU_PERIODIC_INT(timer_irq, 1000 )            // generate 1000 IRQ's per second
10961093   MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
10971094
1095   MCFG_BFMBD1_ADD("vfd0",0)
10981096   MCFG_SPEAKER_STANDARD_MONO("mono")
10991097   MCFG_SOUND_ADD("aysnd",AY8912, MASTER_CLOCK/4)
11001098   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
r15442r15443
11681166   sc1_common_init(machine,3,1, 3);
11691167   adder2_decode_char_roms(machine);   // decode GFX roms
11701168   MechMtr_config(machine,8);
1171
1172   BFM_BD1_init(0);
11731169}
11741170
11751171static DRIVER_INIT(lotse)
11761172{
11771173   sc1_common_init(machine,6,1, 3);
11781174   MechMtr_config(machine,8);
1179
1180   BFM_BD1_init(0);
1181   BFM_BD1_init(1);
11821175}
11831176
11841177static DRIVER_INIT(lotse_bank0)
11851178{
11861179   sc1_common_init(machine,6,1, 0);
11871180   MechMtr_config(machine,8);
1188
1189   BFM_BD1_init(0);
1190   BFM_BD1_init(1);
11911181}
11921182
11931183
r15442r15443
11951185{
11961186   sc1_common_init(machine,6,0, 3);
11971187   MechMtr_config(machine,8);
1198
1199   BFM_BD1_init(0);
1200   BFM_BD1_init(1);
12011188}
12021189
12031190static DRIVER_INIT(nocrypt_bank0)
12041191{
12051192   sc1_common_init(machine,6,0, 0);
12061193   MechMtr_config(machine,8);
1207
1208   BFM_BD1_init(0);
1209   BFM_BD1_init(1);
12101194}
12111195
12121196
r15442r15443
12161200{
12171201   sc1_common_init(machine,6,0, 3);
12181202   MechMtr_config(machine,8);
1219
1220   BFM_BD1_init(0);
12211203}
12221204
12231205/////////////////////////////////////////////////////////////////////////////////////
r15442r15443
12281210   sc1_common_init(machine,6,1, 3);
12291211   MechMtr_config(machine,8);
12301212
1231   BFM_BD1_init(0);
1232
12331213   Scorpion1_SetSwitchState(state,3,2,1);
12341214   Scorpion1_SetSwitchState(state,3,3,1);
12351215   Scorpion1_SetSwitchState(state,3,6,1);
src/mame/drivers/model2.c
r15442r15443
26982698   MODEL2A_VID_BOARD
26992699ROM_END
27002700
2701ROM_START( manxtt ) /* Manx TT Superbike Revision C, Model 2A */
2701/*
2702
2703Manx TT
2704
2705837-10848-01-91  Model2 A-CRX CPU BD
2706837-10849-02     Model2 A-CRX VIDEO BD
2707837-12396        COMM BD MANX TT
2708
2709837-12279        SOUND BD MANX T.T (for DX only)
2710
2711Rom boards:
2712 834-12467  ROM BD MANX T.T TWIN
2713 834-12277  ROM BD MANX T.T DX
2714
2715Known missing roms:
2716
2717Manx TT DX
2718EPR-18742 - Sound CPU rom (on Sound BD)
2719MPR-18743 - Sound Samples (on Sound BD)
2720EPR-18744.12 - Program rom
2721EPR-18745.13 - Program rom
2722EPR-18784.14 - Program rom*
2723EPR-18785.15 - Program rom*
2724EPR-18746.30 - Sound CPU rom*
2725EPR-18767.5  - Data*
2726EPR-18768.4  - Data*
2727
2728EPR-18763.31 & alt sound CPU code EPR-18924a.30 are dumped
2729
2730* Note: The manual scan was low-res and these numbers might be incorrect as they were VERY hard to read!
2731
2732*/
2733
2734ROM_START( manxtt ) /* Manx TT Superbike Twin Revision C, Model 2A */
27022735   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
27032736   ROM_LOAD32_WORD( "epr-18822c.12",  0x000000, 0x020000, CRC(c7b3e45a) SHA1(d3a6910bf6efc138e0e40332219b90dea7d6ea56) )
27042737   ROM_LOAD32_WORD( "epr-18823c.13",  0x000002, 0x020000, CRC(6b0c1dfb) SHA1(6da5c071e3ce842a99f928f473d4ccf7165785ac) )
r15442r15443
27352768   ROM_LOAD32_WORD( "mpr-18759.24", 0x000002, 0x200000, CRC(278d8742) SHA1(5f285fc8cfe88c00ba2bbe1b509b49abd38e00ec) )
27362769
27372770   ROM_REGION( 0x100000, "audiocpu", 0 ) // Sound program
2738//  ROM_LOAD16_WORD_SWAP( "epr-18826.30",  0x080000, 0x040000, CRC(ed9fe4c1) SHA1(c3dd8a1324a4dc9b012bd9bf21d1f48578870f72) ) /* Alternate sound program */
2739   ROM_LOAD16_WORD_SWAP( "epr-18924a.30", 0x080000, 0x040000, CRC(ad6f40ec) SHA1(27aa0477dc325162766d459ffe95b61ee65dd28f) )
2771   ROM_LOAD16_WORD_SWAP( "epr-18826.30",  0x080000, 0x040000, CRC(ed9fe4c1) SHA1(c3dd8a1324a4dc9b012bd9bf21d1f48578870f72) ) /* Sound program for Twin set */
2772//  ROM_LOAD16_WORD_SWAP( "epr-18924a.30", 0x080000, 0x040000, CRC(ad6f40ec) SHA1(27aa0477dc325162766d459ffe95b61ee65dd28f) ) /* Sound program for ?? set */
27402773
27412774   ROM_REGION( 0x800000, "scsp", 0 ) // Samples
2742//  ROM_LOAD( "mpr-18827.31", 0x000000, 0x200000, CRC(58d78ca1) SHA1(95275ed8315c044bfde2f23c10416f22627b34df) ) /* Alternate sound sample */
2743   ROM_LOAD( "mpr-18763.31", 0x000000, 0x200000, CRC(1bcb2283) SHA1(a4a8a2f8f0901bfb57778351210ccfc421cacbd4) )
2775   ROM_LOAD( "mpr-18827.31", 0x000000, 0x200000, CRC(58d78ca1) SHA1(95275ed8315c044bfde2f23c10416f22627b34df) ) /* Sound sample for Twin set */
2776//  ROM_LOAD( "mpr-18763.31", 0x000000, 0x200000, CRC(1bcb2283) SHA1(a4a8a2f8f0901bfb57778351210ccfc421cacbd4) ) /* Sound sample for DX set */
27442777   ROM_LOAD( "mpr-18764.32", 0x200000, 0x200000, CRC(0dc6a860) SHA1(cb2ada0f8a592940de11ee781ad4beb5095c3b37) )
27452778   ROM_LOAD( "mpr-18765.36", 0x400000, 0x200000, CRC(ca4a803c) SHA1(70b59da8f2532a02e980caba5bb86ec13a4d7ab5) )
27462779   ROM_LOAD( "mpr-18766.37", 0x600000, 0x200000, CRC(e41892ea) SHA1(9ef5e26db4abf0ed36df63fc246b568e1c5d6cfa) )
27472780
2781   ROM_REGION( 0x20000, "cpu4", 0) // Communication program
2782   ROM_LOAD16_WORD_SWAP( "epr-18643.7",  0x000000, 0x020000, CRC(7166fca7) SHA1(f5d02906b64bb2fd1af8e3772c1b01a4e006c060) )
2783//  ROM_LOAD16_WORD_SWAP( "epr-18643a.7", 0x000000, 0x020000, CRC(b5e048ec) SHA1(8182e05a2ffebd590a936c1359c81e60caa79c2a) ) /* COMM boards found with either revision */
2784
27482785   MODEL2_CPU_BOARD
27492786   MODEL2A_VID_BOARD
27502787ROM_END
27512788
2752ROM_START( motoraid ) /* Motoraid, Model 2A */
2789ROM_START( motoraid ) /* Motoraid, Model 2A, Sega game ID# 833-13232 */
27532790   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
27542791   ROM_LOAD32_WORD( "epr-20007.12",  0x000000, 0x080000, CRC(f040c108) SHA1(a6a0fa8fb9d62d0cc2ac84ea3ad457953952d980) )
27552792   ROM_LOAD32_WORD( "epr-20008.13",  0x000002, 0x080000, CRC(78976e1a) SHA1(fd15e8c81b3b2f3bdf3bb8d9414b9b8a6f1f000f) )
r15442r15443
28542891   ROM_LOAD( "mpr-18421.37",   0x600000, 0x200000, CRC(00522390) SHA1(5dbbf2ba008adad36929fcecb7c2c1e5ffd12618) )
28552892ROM_END
28562893
2857ROM_START( vcop2 ) /* Virtua Cop 2, Model 2A */
2894ROM_START( vcop2 ) /* Virtua Cop 2, Model 2A, Sega Game ID# 833-12266, ROM board ID# 834-12267 */
28582895   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
28592896   ROM_LOAD32_WORD( "epr-18524.12", 0x000000, 0x080000, CRC(1858988b) SHA1(2979f8470cc31e6c5c32c6fec1a87dbd29b52309) )
28602897   ROM_LOAD32_WORD( "epr-18525.13", 0x000002, 0x080000, CRC(0c13df3f) SHA1(6b4188f04aad80b89f1826e8ca47cff763980410) )
r15442r15443
33223359   ROM_LOAD( "epr-18261.ic9", 0x000000, 0x010000, CRC(0c7fac58) SHA1(68c1724c41401e28a5123022981c8919fd22656e) )
33233360ROM_END
33243361
3325ROM_START( stcca ) /* Sega Touring Car Championship Revision A, Model 2C - Defaults to Japan, Twin & no "Default View" option */
3362ROM_START( stcca ) /* Sega Touring Car Championship Revision A, Model 2C - Defaults to Japan, Twin & no "Default View" option - Sega ROM board ID# 834-12780 */
33263363   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
33273364   ROM_LOAD32_WORD("epr-19272a.15", 0x000000, 0x080000, CRC(20cedd05) SHA1(e465967c784de18caaaac77e164796e9779f576a) )
33283365   ROM_LOAD32_WORD("epr-19273a.16", 0x000002, 0x080000, CRC(1b0ab4d6) SHA1(142bcd53fa6632fcc866bbda817aa83470111ef1) )
r15442r15443
34403477   ROM_LOAD( "epr-18261.ic9", 0x000000, 0x010000, CRC(0c7fac58) SHA1(68c1724c41401e28a5123022981c8919fd22656e) )
34413478ROM_END
34423479
3443ROM_START( skisuprg ) /* Sega Ski Super G, Model 2C */
3480ROM_START( skisuprg ) /* Sega Ski Super G, Model 2C, Sega Game ID# 833-12861, ROM board ID# 834-12862 */
34443481   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
34453482   ROM_LOAD32_WORD( "epr-19489.15", 0x000000, 0x080000, CRC(1df948a7) SHA1(a38faeb97c65b379ad05f7311b55217118c8d2be) )
34463483   ROM_LOAD32_WORD( "epr-19490.16", 0x000002, 0x080000, CRC(e6fc24d3) SHA1(1ac9172cf0b4d6a3488483ffa490a4ca5d410927) )
r15442r15443
34763513ROM_END
34773514
34783515/* Sega Water Ski - There should be a version with program roms EPR-19965 & EPR-19966 (currently undumped) */
3479ROM_START( segawski ) /* Sega Water Ski Revision A, Model 2C */
3516ROM_START( segawski ) /* Sega Water Ski Revision A, Model 2C, Sega Game ID# 833-13204, ROM board ID# 834-13205 */
34803517   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
34813518   ROM_LOAD32_WORD("epr-19963a.15", 0x000000, 0x080000, CRC(89c9cb0d) SHA1(7f1f600222447effb28cf2d56193ea9f45fd0646) )
34823519   ROM_LOAD32_WORD("epr-19964a.16", 0x000002, 0x080000, CRC(c382cefe) SHA1(c0ccee4eb19d9626dee0f77f08060f1d9708b39d) )
r15442r15443
35193556   ROM_LOAD("mpr-19989.34", 0x400000, 0x400000, CRC(8074a4b3) SHA1(98dc1d122ffb9b5c52994dea2b5d8c4f004a5f8e) )
35203557ROM_END
35213558
3522ROM_START( hotd ) /* House of the Dead, Model 2C */
3559ROM_START( hotd ) /* House of the Dead, Model 2C, Sega Game ID# 610-0396-13054 */
35233560   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
35243561   ROM_LOAD32_WORD("epr-19696.15", 0x000000, 0x080000, CRC(03da5623) SHA1(be0bd34a9216375c7204445f084f6c74c4d3b0c8) )
35253562   ROM_LOAD32_WORD("epr-19697.16", 0x000002, 0x080000, CRC(a9722d87) SHA1(0b14f9a81272f79a5b294bc024711042c5fb2637) )
r15442r15443
37363773   ROM_LOAD("mpr-21280.sd4", 0x0600000, 0x200000, CRC(aa548124) SHA1(a94adfe16b5c3236746451c181ccd3e1c27432f4) )
37373774ROM_END
37383775
3739ROM_START( indy500 ) /* Defaults to Twin (Stand Alone) Cab version.  2 credits to start - Can be set to Deluxe setting in service mode, Sega ROM board ID# 834-12362 */
3776ROM_START( indy500 ) /* Defaults to Twin (Stand Alone) Cab version.  2 credits to start - Can be set to Deluxe setting in service mode, Sega Game ID# 833-12361, ROM board ID# 834-12362 */
37403777   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
37413778   ROM_LOAD32_WORD("epr-18598a.15", 0x000000, 0x080000, CRC(3cdcac0f) SHA1(2f616e363f4d246fece309e81325e5e3c4e9d9f8) ) /* Higher rom numbers indicate a newer version */
37423779   ROM_LOAD32_WORD("epr-18599a.16", 0x000002, 0x080000, CRC(32bde9a2) SHA1(0982952ab3c5b035f37beb9304ac950c0e78aea8) ) /* Different attract mode... what else??? */
r15442r15443
37883825   ROM_LOAD("mpr-18244.35", 0x0600000, 0x200000, CRC(bfa75beb) SHA1(fec89260d887e90ee9c2803e2eaf937cf9bfa10b) )
37893826ROM_END
37903827
3791ROM_START( indy500d ) /* Defaults to Deluxe (Stand Alone) Cab version. 3 credits to start - Can be set to Twin setting in service mode */
3828ROM_START( indy500d ) /* Defaults to Deluxe (Stand Alone) Cab version. 3 credits to start - Can be set to Twin setting in service mode, Sega Game ID# 833-11992, ROM board ID# 834-11993 */
37923829   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
37933830   ROM_LOAD32_WORD("epr-18251a.15", 0x000000, 0x080000, CRC(fdabb40b) SHA1(e60a4814b54b76c7c0a4d9cf2b093c577c2f6ecf) )
37943831   ROM_LOAD32_WORD("epr-18252a.16", 0x000002, 0x080000, CRC(4935832a) SHA1(8fc9244fd0eaf93d016f4494604e5a70bf1f7303) )
r15442r15443
38403877   ROM_LOAD("mpr-18244.35", 0x0600000, 0x200000, CRC(bfa75beb) SHA1(fec89260d887e90ee9c2803e2eaf937cf9bfa10b) )
38413878ROM_END
38423879
3843ROM_START( indy500to ) /* Defaults to Twin (Stand Alone) Cab version. 2 credits to start - Can be set to Deluxe setting in service mode */
3880ROM_START( indy500to ) /* Defaults to Twin (Stand Alone) Cab version. 2 credits to start - Can be set to Deluxe setting in service mode, Sega Game ID# 833-11994, ROM board ID# 834-11995 */
38443881   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
38453882   ROM_LOAD32_WORD("epr-18254a.15", 0x000000, 0x080000, CRC(ad0f1fc5) SHA1(0bff35fc1d892aaffbf1a3965bf3109c54839f4b) )
38463883   ROM_LOAD32_WORD("epr-18255a.16", 0x000002, 0x080000, CRC(784daab8) SHA1(299e87f8ec7bdefa6f94f4ab65e29e91f290611e) )
r15442r15443
38923929   ROM_LOAD("mpr-18244.35", 0x0600000, 0x200000, CRC(bfa75beb) SHA1(fec89260d887e90ee9c2803e2eaf937cf9bfa10b) )
38933930ROM_END
38943931
3895ROM_START( waverunr ) /* Wave Runner Revision A (Japan), Model 2C */
3932ROM_START( waverunr ) /* Wave Runner Revision A (Japan), Model 2C, Sega Game ID# 833-12838, ROM board ID# 834-12839 */
38963933   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
38973934   ROM_LOAD32_WORD("epr-19282a.15", 0x000000, 0x080000, CRC(5df58604) SHA1(a136bb80746f37450be51f98ca60791b4022035d) )
38983935   ROM_LOAD32_WORD("epr-19283a.16", 0x000002, 0x080000, CRC(bca188e1) SHA1(428f156f60e61ef314b7b50474abddf6d4dc2aca) )
r15442r15443
41574194   ROM_LOAD32_WORD( "mpr-19994.9",   0x800000, 0x400000, CRC(e691fbd5) SHA1(b99c2f3f2a682966d792917dfcb8ed8e53bc0b7a) )
41584195   ROM_LOAD32_WORD( "mpr-19995.10",  0x800002, 0x400000, CRC(82a7828e) SHA1(4336a12a07a67f94091b4a9b491bab02c375dd15) )
41594196
4160   ROM_REGION( 0x800000, "cpu2", ROMREGION_ERASE00 ) // TGPx4 program (COPRO sockets)
4197   ROM_REGION( 0x800000, "user5", ROMREGION_ERASE00 ) // Coprocessor Data ROM
41614198
4162   ROM_REGION( 0x800000, "user2", 0 ) // Models (TGP sockets)
4199   ROM_REGION( 0x800000, "user2", 0 ) // Models
41634200   ROM_LOAD32_WORD( "mpr-19998.17",  0x000000, 0x200000, CRC(6a834574) SHA1(8be19bf42dbb157d6acde62a2018ef4c0d41aab4) )
41644201   ROM_LOAD32_WORD( "mpr-19999.21",  0x000002, 0x200000, CRC(ff590a2d) SHA1(ad29e4270b4a2f82189fbab83358eb1200f43777) )
41654202
4166   ROM_REGION( 0x400000, "user3", 0 ) // Textures (TEXTURE sockets)
4203   ROM_REGION( 0x400000, "user3", 0 ) // Textures
41674204   ROM_LOAD32_WORD( "mpr-20001.27",  0x000000, 0x200000, CRC(6ca236aa) SHA1(b3cb89fadb42afed13be4f229d7158dee487978a) )
41684205   ROM_LOAD32_WORD( "mpr-20000.25",  0x000002, 0x200000, CRC(894d8ded) SHA1(9bf7c754a29eef47fa49b5567980601895127306) )
41694206
r15442r15443
41754212   ROM_LOAD( "mpr-20004.34", 0x400000, 0x400000, CRC(0b9c5410) SHA1(e5bb30702fc853ccc03316be07a334269d3ebb4a) )
41764213ROM_END
41774214
4178ROM_START( topskatr ) /* Top Skater Revision A (Export), Model 2C */
4215ROM_START( topskatr ) /* Top Skater Revision A (Export), Model 2C, Sega Game ID# 833-13080-02, ROM board ID# 834-13081-02 */
41794216   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
41804217   ROM_LOAD32_WORD("epr-19755a.15", 0x000000, 0x080000, CRC(b80633b9) SHA1(5396da414beeb918e6f38f25a43dd76345a0c8ed) )
41814218   ROM_LOAD32_WORD("epr-19756a.16", 0x000002, 0x080000, CRC(472046a2) SHA1(06d0f609257ba476e6bd3b956e0850e7167429ce) )
r15442r15443
42154252   ROM_LOAD("mpr-19750.24s", 0xc00000, 0x400000, CRC(cd95d0bf) SHA1(40e2a2980c89049c339fefd48bf7aac79962cd2e) )
42164253ROM_END
42174254
4218ROM_START( topskatru ) /* Top Skater Revision A (USA), Model 2C */
4255ROM_START( topskatru ) /* Top Skater Revision A (USA), Model 2C, Sega Game ID# 833-13080-01, ROM board ID# 834-13081-01 */
42194256   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
42204257   ROM_LOAD32_WORD( "epr-19753a.15", 0x000000, 0x080000, CRC(3b3028de) SHA1(717ebf0ccd87128a24776e618cf15f07aaf48537) )
42214258   ROM_LOAD32_WORD( "epr-19754a.16", 0x000002, 0x080000, CRC(17535b98) SHA1(a2329d09821900ec4f867caf1a93759085bd0a62) )
r15442r15443
42554292   ROM_LOAD("mpr-19750.24s", 0xc00000, 0x400000, CRC(cd95d0bf) SHA1(40e2a2980c89049c339fefd48bf7aac79962cd2e) )
42564293ROM_END
42574294
4258ROM_START( topskatrj ) /* Top Skater (Japan), Model 2C */
4295ROM_START( topskatrj ) /* Top Skater (Japan), Model 2C, Sega Game ID# 833-13080-03, ROM board ID# 834-13081-03 */
42594296   ROM_REGION( 0x200000, "maincpu", 0 ) // i960 program
42604297   ROM_LOAD32_WORD( "epr-19751.15", 0x000000, 0x080000, CRC(d615a15f) SHA1(ca998de446c4c423db186696f3478f3daa4f8373) )
42614298   ROM_LOAD32_WORD( "epr-19752.16", 0x000002, 0x080000, CRC(42f0ba8b) SHA1(f72f25cbd380918b919c11a7d2051948c8c484db) )
r15442r15443
52645301GAME( 1994, vcopa,           0, model2o, daytona, 0,        ROT0, "Sega", "Virtua Cop (Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52655302
52665303// Model 2A-CRX (TGPs, SCSP sound board)
5267GAME( 1995, manxtt,          0, model2a, model2, 0,       ROT0, "Sega", "Manx TT Superbike (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5304GAME( 1995, manxtt,          0, model2a, model2, 0,       ROT0, "Sega", "Manx TT Superbike - Twin (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52685305GAME( 1995, srallyc,         0, srallyc, srallyc,srallyc, ROT0, "Sega", "Sega Rally Championship (Revision C)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52695306GAME( 1995, srallycb,  srallyc, srallyc, srallyc,srallyc, ROT0, "Sega", "Sega Rally Championship (Revision B)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52705307GAME( 1995, vf2,             0, model2a, model2, 0,       ROT0, "Sega", "Virtua Fighter 2 (Version 2.1)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
r15442r15443
52765313GAME( 1996, doaa,          doa, model2a, model2, doa,     ROT0, "Sega", "Dead or Alive (Model 2A, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52775314GAME( 1997, zeroguna,  zerogun, model2a, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52785315GAME( 1997, zerogunaj, zerogun, model2a, model2, zerogun, ROT0, "Psikyo", "Zero Gunner (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5279GAME( 1997, motoraid,        0, model2a, model2, 0,       ROT0, "Sega", "Motor Raid", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5316GAME( 1997, motoraid,        0, model2a, model2, 0,       ROT0, "Sega", "Motor Raid - Twin", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52805317GAME( 1998, dynamcop,        0, model2a, model2, genprot, ROT0, "Sega", "Dynamite Cop (Export, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52815318GAME( 1998, dyndeka2, dynamcop, model2a, model2, genprot, ROT0, "Sega", "Dynamite Deka 2 (Japan, Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
52825319GAME( 1998, pltkidsa,  pltkids, model2a, model2, pltkids, ROT0, "Psikyo", "Pilot Kids (Model 2A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
r15442r15443
53155352GAME( 1996, stccb,        stcc, model2c, model2, 0,       ROT0, "Sega", "Sega Touring Car Championship (Unknown Revision)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
53165353GAME( 1996, waverunr,        0, model2c, model2, 0,       ROT0, "Sega", "Wave Runner (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
53175354GAME( 1997, hotd,            0, model2c, model2, 0,       ROT0, "Sega", "House of the Dead", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5318GAME( 1997, overrev,         0, model2c, srallyc,overrev, ROT0, "Jaleco", "Over Rev (Model, 2C Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
5355GAME( 1997, overrev,         0, model2c, srallyc,overrev, ROT0, "Jaleco", "Over Rev (Model 2C, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
53195356GAME( 1997, segawski,        0, model2c, model2, 0,       ROT0, "Sega", "Sega Water Ski (Japan, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
53205357GAME( 1997, topskatr,        0, model2c, model2, 0,       ROT0, "Sega", "Top Skater (Export, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
53215358GAME( 1997, topskatru,topskatr, model2c, model2, 0,       ROT0, "Sega", "Top Skater (USA, Revision A)", GAME_NOT_WORKING|GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/cinemat.c
r15442r15443
10881088static MACHINE_CONFIG_DERIVED( armora, cinemat_jmi_16k )
10891089   MCFG_FRAGMENT_ADD(armora_sound)
10901090MACHINE_CONFIG_END
1091 
10921091
1092
10931093static MACHINE_CONFIG_DERIVED( ripoff, cinemat_jmi_8k )
10941094   MCFG_FRAGMENT_ADD(ripoff_sound)
10951095MACHINE_CONFIG_END
src/mame/drivers/metro.c
r15442r15443
109109READ16_MEMBER(metro_state::metro_irq_cause_r)
110110{
111111   /* interrupt cause, used by
112   
113   int[0] vblank
114   int[1] ?            DAITORIDE, BALCUBE, KARATOUR, MOUJA
115   int[2] blitter
116   int[3] ?            KARATOUR
117   int[4] ?
118   int[5] ?            KARATOUR, BLZNTRND
119   int[6] unused
120   int[7] unused
121   
122   */
123   
112
113    int[0] vblank
114    int[1] ?            DAITORIDE, BALCUBE, KARATOUR, MOUJA
115    int[2] blitter
116    int[3] ?            KARATOUR
117    int[4] ?
118    int[5] ?            KARATOUR, BLZNTRND
119    int[6] unused
120    int[7] unused
121
122    */
123
124124   UINT16 res = 0;
125125   for (int i = 0; i < 8; i++)
126126      res |= (m_requested_int[i] << i);
r15442r15443
59505950      state->m_vram_1[i] = machine.rand();
59515951      state->m_vram_2[i] = machine.rand();
59525952   }
5953   
5953
59545954   DRIVER_INIT_CALL(metro);
59555955}
59565956
src/mame/drivers/atarisy2.c
r15442r15443
654654   /* these gains are cheesed up, but give an approximate effect */
655655
656656   /*
657    * Before the volume adjustment, all channels pass through
658    * a high-pass filter which removes DC components. The
659    * filter frequency does also depend on the settings on
660    * the resistors.
661    *
662    * The op-amp after the pokey feeds mixes the op-amp output voltage
663    * with a low impedance back to the input. The internal resistance of the
664    * pokey now is the ground pole of a three pole resistor mixer: ground,
665    * 15V and op-amp output voltage.
666    *
667    * ==> DISCRETE candidate
668    *
669    */
657     * Before the volume adjustment, all channels pass through
658     * a high-pass filter which removes DC components. The
659     * filter frequency does also depend on the settings on
660     * the resistors.
661     *
662     * The op-amp after the pokey feeds mixes the op-amp output voltage
663     * with a low impedance back to the input. The internal resistance of the
664     * pokey now is the ground pole of a three pole resistor mixer: ground,
665     * 15V and op-amp output voltage.
666     *
667     * ==> DISCRETE candidate
668     *
669     */
670670
671671   /* bits 0-2 control the volume of the YM2151, using 22k, 47k, and 100k resistors */
672672   rtop = 1.0/(1.0/100 + 1.0/100);
src/mame/drivers/naomi.c
r15442r15443
2525    - ngdup23a, ngdup23c: missing DIMM emulation, hence they can't possibly work, emulate the DIMM means to add an extra SH-4 ...
2626    - games using "m4" decryption have never successfully worked, may be
2727      an issue there.
28
28
2929    - Following games doesn't boot, any attempt makes it to return to the system test mode (note these are also "m4" type games)
3030    * Illvelo
3131    * Akatsuki Blitzkampf Ausf Achse
32
32
3333    - Doesn't boot
3434    * Shootout Pool (all 3 Shootout Pool games show an animated loading screen and then lock up)
3535    * Shootout Pool Medal
3636    * Shootout Pool Prize
37
37
3838    - Boots and accepts coin, but won't accept start button
3939    * Usagi Yamashiro Hen
40
40
4141    - missing inputs (needs rotary channels):
4242    * Crakin' DJ
4343    * Dynamic Golf
r15442r15443
5252    - "com error occured between Naomi BD and I/O BD"
5353    * Samba de Amigo
5454    * Samba de Amigo Ver. 2000
55
55
5656    - other issues:
5757    * Death Crimson OX (boots now, but dies in YUV-mode movie; coining up before it appears to freeze the game)
5858    * La Keyboard (boots fine & attract mode looks OK, but no keyboard)
59
59
6060TODO (game-specific):
6161    - 18th Wheeler Deluxe: "MOTOR NETWORK ERR IN 01 OUT FF" msg pops up during gameplay;
6262    - Airline Pilots Deluxe: returns error 03
r15442r15443
79417941/* Cart games on Namco custom ROM board */
79427942/* 25209801 */ GAME( 2000, wldkicks, naomi, naomim2, naomi,    naomi,    ROT0, "Capcom / Namco", "World Kicks (WK2 Ver. A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
79437943/* 25349801 */ GAME( 2000, toukon4,  naomi, naomim2, naomi,    naomi,    ROT0, "Capcom / Namco", "Shin Nihon Pro Wrestling Toukon Retsuden 4 Arcade Edition (TRF1 Ver. A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
7944/* 25469801 */ GAME( 2000, ninjaslt, naomi, naomim2, naomi,    naomi,    ROT0, "Capcom / Namco", "Ninja Assault (NJA3 Ver. A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
7944/* 25469801 */ GAME( 2000, ninjaslt, naomi, naomim2, naomi,    naomi,    ROT0, "Capcom / Namco", "Ninja Assault (NJA3 Ver. A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
79457945/* 25709801 */ GAME( 2001, gunsur2,  naomi, naomi,   naomi,    naomi,    ROT0, "Capcom / Namco", "Gun Survivor 2 Biohazard Code: Veronica (BHF1)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
79467946/* 25869812 */ GAME( 2002, mazan,    naomi, naomim2, naomi,    naomi,    ROT0, "Capcom / Namco", "Mazan: Flash of the Blade (MAZ2 Ver. A)", GAME_UNEMULATED_PROTECTION|GAME_FLAGS )
79477947
src/mame/drivers/vsnes.c
r15442r15443
19681968
19691969/* From Gumshoe readme:
19701970
1971NOTE:  There is a small board modification which consists of 2 extra jumpers added.
1971NOTE:  There is a small board modification which consists of 2 extra jumpers added.
19721972They appear to be:
19731973
1974pin 26 of 6D to pin 1, 74ls04 at 5E.
1974pin 26 of 6D to pin 1, 74ls04 at 5E.
19751975pin 26 of 1D to pin 12, 74s32 at 4b.
19761976
19771977possibly an extra address?
src/mame/drivers/lucky74.c
r15442r15443
8787    |                                  '----------'  '-----------' '----------' '----------' '-----------' '-------------'   '-------------'    |
8888    '--.                 .------.      .-----. conn  .-----------. .----------. .----------. .-----------. .-------------.   .-------------.    |
8989       |                 |S12MD3|      | ??? |       |HD74LS161AP| |HD74LS86P | |HD74LS157P| |HD74LS245P | | 6116ALSP-12 |   | 6116ALSP-12 |  B |
90       |                 '------'      '-----'       '-----------' '----------' '----------' '-----------' '-------------'   '-------------'    |
90       |                 '------'      '-----'       '-----------' '----------' '----------' '-----------' '-------------'   '-------------'    |
9191    .--' 36              .-----------. .-----------. .-----------. .----------. .----------. .-----------. .--------------.  .--------------.   |
9292    |--                  |HD74LS174P | | TBP24S10N | | TBP24S10N | |HD74LS86P | |HD74LS86P | |HD74LS273P | |              |  |              | C |
93    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |    06B49P    |  | M5L8251AP-5  |   |
93    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |    06B49P    |  | M5L8251AP-5  |   |
9494    |--                  .-----------. .-----------. .-----------. .----------. .----------. .-----------. |              |  |              |   |
9595    |--                  |HD74LS174P | | TBP24S10N | | TBP24S10N | |HD74LS08P | |HD74LS86P | |HD74LS273P | >--------------<  >--------------< D |
96    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |              |  |              |   | 
96    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |              |  |              |   |
9797    |--                  .-----------. .-----------. .-----------. .----------. .----------. .-----------. |    06B53P    |  |    06B53P    |   |
9898    |--                  |HD74LS174P | | TBP24S10N | | TBP24S10N | |HD74LS21P | |HD74LS08P | |HD74LS240P | |              |  |              | E |
99    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' '--------------'  '--------------'   |
99    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' '--------------'  '--------------'   |
100100    |--                  .-----------. .-----------. .-----------. .----------. .----------. .-----------. .--------------.  .--------------.   |
101101    |--                  |HD74LS367AP| | HD74LS08P | |  HD7425P  | |HD74LS138P| |HD74LS138P| |HD74LS245P | |11            |  |16            | F |
102    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |    M27512    |  |    M27512    |   |
102    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |    M27512    |  |    M27512    |   |
103103    |--                  .-----------. .-----------. .-----------. .----------. .----------. .-----------. |              |  |              |   |
104104    |--                  |HD74LS174AP| | HD74LS10P | | HD74LS04P | |HD74LS138P| |HD74LS138P| |HD74LS245P | >--------------<  >--------------< H |
105    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |12            |  |17            |   |
105    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' |12            |  |17            |   |
106106    |--                  .-----------. .-----------. .-----------. .----------. .----------. .-----------. |    M27512    |  |    M27512    |   |
107107    |--                  |HD74LS174AP| | HD74LS10P | |HD74LS139P | |HD74LS32P | |HD74LS08P | |HD74LS273P | |              |  |              | J |
108    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' >--------------<  >--------------<   |
108    |--                  '-----------' '-----------' '-----------' '----------' '----------' '-----------' >--------------<  >--------------<   |
109109    |--                      .-------------------------------.     .----------. .----------. .-----------. |13            |  |18            |   |
110110    |--                      |                               |     | SW1 (x8) | |HD74LS157P| |HD74LS240P | |    M27512    |  |    M27512    | K |
111    |--                      |          MITSUBISHI           |     '----------' '----------' '-----------' |              |  |              |   |
111    |--                      |          MITSUBISHI           |     '----------' '----------' '-----------' |              |  |              |   |
112112    |--                      |         M5M82C255ASP          |     .----------. .----------. .-----------. >--------------<  >--------------<   |
113113    |--                      |                               |     | SW2 (x8) | |HD74LS32P | |HD74LS240P | |14            |  |19            | L |
114    |--                      '-------------------------------'     '----------' '----------' '-----------' |    M27512    |  |    M27512    |   |
114    |--                      '-------------------------------'     '----------' '----------' '-----------' |    M27512    |  |    M27512    |   |
115115    |--                      .-------------------------------.     .----------. .----------. .-----------. |              |  |              |   |
116116    |--                      |                               |     | SW3 (x8) | |HD74LS32P | |HD74LS244P | >--------------<  >--------------< M |
117    |--                      |          MITSUBISHI           |     '----------' '----------' '-----------' |15            |  |EMPTY         |   |
117    |--                      |          MITSUBISHI           |     '----------' '----------' '-----------' |15            |  |EMPTY         |   |
118118    |--                      |         M5M82C255ASP          |     .----------. .----------. .-----------. |    M27512    |  |     (M27512) |   |
119119    |--                      |                               |     | SW4 (x8) | | TC4019BP | |HD74LS240P | |              |  |              | N |
120    |--                      '-------------------------------'     '----------' '----------' '-----------' '--------------'  '--------------'   |
120    |--                      '-------------------------------'     '----------' '----------' '-----------' '--------------'  '--------------'   |
121121    |--                  .-----------. .-----------. .-----------. .----------. .------------------------. .--------------------------------.   |
122122    |--                  |HD74LS244P | |HD74LS368? | |HD74LS32P? | |HD74LS32P | |        YAMAHA          | |   B 0L2                        | P |
123    |--                  '-----------' '-----------' '-----------' '----------' |        YM2149F         | |   .-------+--------------+-.   |   |
123    |--                  '-----------' '-----------' '-----------' '----------' |        YM2149F         | |   .-------+--------------+-.   |   |
124124    |--                  .-----------. .-----------. .-----------. .----------. '------------------------' |\  | WING  |              | |  /|   |
125125    |--                  |HD74LS244P | |   ?????   | |HD74LS08P? | |HD74LS00P | .------------------------. | | | CPU   +--+--+--+--+--+ | | | R |
126    |--                  '-----------' '-----------' '-----------' '----------' |         09R81P         | |o| | A001  |  |  |  |  |  | | |o|   |
126    |--                  '-----------' '-----------' '-----------' '----------' |         09R81P         | |o| | A001  |  |  |  |  |  | | |o|   |
127127    '--. 01  .---------. .---------.   .-----------. .-----------. .----------. |                        | |o| '-------+--+--+--+--+--+-' |o|   |
128128       |     |   NEC   | |OKI M5205|   |   ?????   | | SN76489AN | |SN76489AN | '------------------------' | | .---+--------------------. | | S |
129       |     |UPC 1241H| '---------'   '-----------' '-----------' '----------' .------------.  .--------. |/  | 7 |  WE8703  1992.10   |  \|   |
129       |     |UPC 1241H| '---------'   '-----------' '-----------' '----------' .------------.  .--------. |/  | 7 |  WE8703  1992.10   |  \|   |
130130    .--'     '---------' .-----------.                             .----------. |    NPC     |  |  XTAL  | |   |   |  LUCKY 74-7        |   |   |
131131    |  .---. .---------. |   ?????   |                             |SN76489AN | |   SM7831   |  | 12 MHZ | |   '---+--------------------'   | T |
132    | =|RES| | BATTERY | '-----------'                             '----------' '------------'  '--------' '--------------------------------'   |
133    |  '---' '---------'       8             7             6             5            4            3              2                  1          |
132    | =|RES| | BATTERY | '-----------'                             '----------' '------------'  '--------' '--------------------------------'   |
133    |  '---' '---------'       8             7             6             5            4            3              2                  1          |
134134    '-------------------------------------------------------------------------------------------------------------------------------------------'
135135
136136    To confirm:
r15442r15443
173173
174174    There are 2 video layers...
175175
176   ROMS 1F, 1J, 1K & 1L have the background graphics, and are driven by the 06B53P at 1E.
177   ROMS 2F, 2J, 2K & 2L have the foreground graphics, and are driven by the 06B53P at 2E.
176    ROMS 1F, 1J, 1K & 1L have the background graphics, and are driven by the 06B53P at 1E.
177    ROMS 2F, 2J, 2K & 2L have the foreground graphics, and are driven by the 06B53P at 2E.
178178
179179    ROMS 2N & 1N have the 4-bits ADPCM samples.
180180
r15442r15443
14871487ROM_END
14881488
14891489/*
1490   
1490
14911491    Exciting Black Jack.
14921492    Sega (Wing?), 1992. (game say 198?).
14931493
src/mame/drivers/deshoros.c
r15442r15443
172172   AM_RANGE(0x9003, 0x9003) AM_READ_PORT("KEY1")
173173   AM_RANGE(0x9004, 0x9004) AM_READ_PORT("KEY2")
174174   AM_RANGE(0x9005, 0x9005) AM_READ_PORT("DIPSW") AM_WRITE(out_w)
175//   AM_RANGE(0x9006, 0x9006) AM_NOP // printer motor on
176//   AM_RANGE(0x9007, 0x9007) AM_NOP // printer data
175//  AM_RANGE(0x9006, 0x9006) AM_NOP // printer motor on
176//  AM_RANGE(0x9007, 0x9007) AM_NOP // printer data
177177   AM_RANGE(0x900a, 0x900a) AM_WRITE(sound_on_w)
178178   AM_RANGE(0x900b, 0x900b) AM_WRITE(sound_off_w)
179179   AM_RANGE(0x900c, 0x900c) AM_WRITE(bank_select_w)
180//   AM_RANGE(0x900d, 0x900d) AM_NOP // printer motor off
181//   AM_RANGE(0x900e, 0x900e) AM_NOP // printer motor jam reset
180//  AM_RANGE(0x900d, 0x900d) AM_NOP // printer motor off
181//  AM_RANGE(0x900e, 0x900e) AM_NOP // printer motor jam reset
182182   AM_RANGE(0xc000, 0xffff) AM_ROM
183183ADDRESS_MAP_END
184184
r15442r15443
222222   PORT_DIPSETTING(      0x20, DEF_STR( On ) )
223223   PORT_DIPNAME( 0xc0,   0x00, "Operation Mode" )      PORT_DIPLOCATION("SW1:7,8")
224224   PORT_DIPSETTING(      0x00, "Normal Mode" )
225//   PORT_DIPSETTING(      0x40, "Normal Mode" ) // dupe
225//  PORT_DIPSETTING(      0x40, "Normal Mode" ) // dupe
226226   PORT_DIPSETTING(      0x80, "Test Mode" )
227227   PORT_DIPSETTING(      0xc0, "I/O Test" )
228228
src/mame/drivers/topspeed.c
r15442r15443
435435   msm5205_data_w(device, state->m_msm_sel[chip] ? data & 0xf : data >> 4 & 0xf);
436436   state->m_msm_pos[chip] += state->m_msm_sel[chip];
437437   state->m_msm_sel[chip] ^= 1;
438   
438
439439   if ((state->m_msm_pos[chip]) == state->m_msm_loop[chip])
440440      state->m_msm_pos[chip] = state->m_msm_start[chip];
441441}
r15442r15443
454454WRITE8_MEMBER(topspeed_state::topspeed_msm5205_command_w)
455455{
456456   int chip = offset >> 12 & 1;
457   
457
458458   // disable 2nd chip for now... it doesn't work yet
459459   if (chip == 1) return;
460   
460
461461   switch (offset >> 8 & 0x2e)
462462   {
463463      // $b000 / $c000: start
r15442r15443
488488         break;
489489      case 0x22:
490490         break;
491     
491
492492      default:
493493         break;
494494   }
r15442r15443
555555   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Cabinet ) )         PORT_DIPLOCATION("SWA:1,2")
556556   PORT_DIPSETTING(    0x03, "Deluxe" )   // analog pedals, racing wheel, motor (tilt disabled)
557557   PORT_DIPSETTING(    0x02, "Standard" )   // digital pedals, continuous wheel
558//   PORT_DIPSETTING(    0x01, "Standard" )
558//  PORT_DIPSETTING(    0x01, "Standard" )
559559   PORT_DIPSETTING(    0x00, "Mini" )      // analog pedals, racing wheel
560560   TAITO_DSWA_BITS_2_TO_3_LOC(SWA)
561561   TAITO_COINAGE_WORLD_LOC(SWA)
r15442r15443
577577   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
578578   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
579579   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Continue_Price ) )   PORT_DIPLOCATION("SWB:8") // "KEEP OFF" in manual, see notes
580    PORT_DIPSETTING(    0x80, "Same as Start" )
580   PORT_DIPSETTING(    0x80, "Same as Start" )
581581   PORT_DIPSETTING(    0x00, "Half of Start" )
582582
583583   PORT_START("IN0")
r15442r15443
724724   state->m_cpua_ctrl = 0xff;
725725   state->m_ioc220_port = 0;
726726   state->m_banknum = -1;
727   
727
728728   msm5205_reset_w(state->m_msm_chip[0], 1);
729729   msm5205_reset_w(state->m_msm_chip[1], 1);
730730   state->m_msm_loop[0] = 0;
src/mame/drivers/bfm_sc4h.c
r15442r15443
3737#include "sound/ymz280b.h"
3838#include "machine/68681.h"
3939#include "bfm_sc4.lh"
40#include "machine/bfm_bd1.h"
4140#include "video/awpvid.h"
4241//DMD01
4342#include "video/bfm_dm01.h"
r15442r15443
456455{
457456   sc4_state *state = machine.driver_data<sc4_state>();
458457 
459   BFM_BD1_reset(0);
460   BFM_BD1_draw(0);
458   state->m_vfd0->reset();
461459   state->vfd_old_clock = false;
462460}
463461 
r15442r15443
481479         {
482480            if ( !clock )
483481            {
482            //Should move to the internal serial process when DM01 is device-ified
483//                  m_vfd0->shift_data(!data);
484484               state->vfd_ser_value <<= 1;
485485               if (data) state->vfd_ser_value |= 1;
486486 
r15442r15443
491491                  if (machine.device("matrix"))
492492                  {
493493                     BFM_dm01_writedata(machine,state->vfd_ser_value);
494                  }         
494                  }
495495                  else
496496                  {
497                     BFM_BD1_newdata(0, state->vfd_ser_value);
498                     BFM_BD1_draw(0);
497                     state->m_vfd0->write_char(state->vfd_ser_value);
499498                  }
500499               }
501500            }
r15442r15443
642641      bfm_sc4_68307_portb_w );
643642   m68307_set_duart68681(machine.device("maincpu"),machine.device("m68307_68681"));
644643 
645   BFM_BD1_init(0);
646 
647644   int reels = 6;
648645   state->m_reels=reels;
649646 
r15442r15443
782779 
783780   MCFG_DUART68681_ADD("duart68681", 16000000/4, bfm_sc4_duart68681_config) // ?? Mhz
784781 
782   MCFG_BFMBD1_ADD("vfd0",0)
785783 
786784   MCFG_DEFAULT_LAYOUT(layout_bfm_sc4)
787785 
r15442r15443
803801MACHINE_CONFIG_DERIVED_CLASS( sc4_adder4, sc4, sc4_adder4_state )
804802   MCFG_CPU_ADD("adder4", M68340, 25175000)    // 68340 (CPU32 core)
805803   MCFG_CPU_PROGRAM_MAP(sc4_adder4_map)
804   MCFG_BFMBD1_ADD("vfd0",0)
806805 
807806   MCFG_MACHINE_START( adder4 )
808807MACHINE_CONFIG_END
809808 
810809MACHINE_CONFIG_DERIVED_CLASS( sc4dmd, sc4, sc4_state )
811810   /* video hardware */
811   MCFG_BFMBD1_REMOVE("vfd0")
812 
812813   MCFG_DEFAULT_LAYOUT(layout_sc4_dmd)
813814   MCFG_CPU_ADD("matrix", M6809, 2000000 )            /* matrix board 6809 CPU at 2 Mhz ?? I don't know the exact freq.*/
814815   MCFG_CPU_PROGRAM_MAP(bfm_dm01_memmap)
r15442r15443
816817 
817818   MCFG_MACHINE_START( sc4 )
818819MACHINE_CONFIG_END
820 
819821INPUT_PORTS_START( sc4_base )
820822   PORT_START("IN-0")
821823   PORT_DIPNAME( 0x01, 0x00, "IN-0:0" )
src/mame/drivers/kontest.c
r15442r15443
11/***************************************************************************
22
3   GX800 (Konami Test board)
3    GX800 (Konami Test board)
44
5   driver by Angelo Salese
5    driver by Angelo Salese
66
7   Notes:
8    Z80, 8KB RAM, 2 * SN76489AN for sound, TTLs for video/misc
9    There are 5 x 005273 (Konami custom resistor array (SIL10)) on the PCB,
10    also seen on Jail Break HW
11   
12    menu translation:
13    * screen distortion adjustment normal
14    * screen distortion adjustment wide
15    * input/output check
16    * color check
17    * sound check
7    Notes:
8    Z80, 8KB RAM, 2 * SN76489AN for sound, TTLs for video/misc
9    There are 5 x 005273 (Konami custom resistor array (SIL10)) on the PCB,
10    also seen on Jail Break HW
1811
12    menu translation:
13    * screen distortion adjustment normal
14    * screen distortion adjustment wide
15    * input/output check
16    * color check
17    * sound check
18
1919***************************************************************************/
2020
2121#include "emu.h"
r15442r15443
153153   // d2: ? (reset during 1st grid test and color test)
154154   // other bits: ?
155155   m_control = data;
156   
156
157157   device_set_input_line(m_maincpu, 0, CLEAR_LINE);
158158}
159159
src/mame/drivers/bzone.c
r15442r15443
785785
786786Program rom locations as same as redbarona listed below
787787*/
788         
789788
789
790790ROM_START( redbaron ) /* Analog Vec Gen A035742-02 Rev. C+ */
791791   ROM_REGION( 0x8000, "maincpu", 0 )
792792   ROM_LOAD( "037587-01.fh1", 0x4800, 0x0800, CRC(60f23983) SHA1(7a9e5380bf49bf50a2d8ab0e0bd1ba3ac8efde24) ) /* == 037001-1E + 036999-1E */
src/mame/drivers/mhavoc.c
r15442r15443
500500   MCFG_SPEAKER_STANDARD_MONO("mono")
501501
502502   /* FIXME: Outputs 1,2,3 are tied together
503    * This signal and Output 4 are processed separately.
504    * Later they are mixed together again.
505    * ==> DISCRETE emulation, below is just an approximation.
506    */
503     * This signal and Output 4 are processed separately.
504     * Later they are mixed together again.
505     * ==> DISCRETE emulation, below is just an approximation.
506     */
507507
508508   MCFG_POKEY_ADD("pokey1", MHAVOC_CLOCK_1_25M)
509509   MCFG_POKEY_CONFIG(pokey_config)
src/mame/drivers/bfm_sc2.c
r15442r15443
178178{
179179public:
180180   bfm_sc2_state(const machine_config &mconfig, device_type type, const char *tag)
181      : driver_device(mconfig, type, tag) { }
181      : driver_device(mconfig, type, tag),
182        m_vfd0(*this, "vfd0"),
183        m_vfd1(*this, "vfd1")
184        { }
182185
186   optional_device<bfm_bd1_t> m_vfd0;
187   optional_device<bfm_bd1_t> m_vfd1;
188
183189   int m_sc2gui_update_mmtr;
184190   UINT8 *m_nvram;
185191   UINT8 m_key[16];
186192   UINT8 m_e2ram[1024];
187193   int m_mmtr_latch;
188194   int m_triac_latch;
189   int m_vfd1_latch;
190   int m_vfd2_latch;
191195   int m_irq_status;
192196   int m_optic_pattern;
193197   int m_uart1_data;
r15442r15443
323327static void on_scorpion2_reset(running_machine &machine)
324328{
325329   bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
326   state->m_vfd1_latch        = 0;
327   state->m_vfd2_latch        = 0;
328330   state->m_mmtr_latch        = 0;
329331   state->m_triac_latch       = 0;
330332   state->m_irq_status        = 0;
r15442r15443
351353   state->m_slide_states[4] = 0;
352354   state->m_slide_states[5] = 0;
353355
354   BFM_BD1_reset(0);   // reset display1
355   BFM_BD1_reset(1);   // reset display2
356
357356   e2ram_reset(machine);
358357
359358   devtag_reset(machine, "ymsnd");
r15442r15443
944943
945944WRITE8_MEMBER(bfm_sc2_state::vfd2_data_w)
946945{
947   m_vfd2_latch = data;
948   BFM_BD1_newdata(1, data);
949   BFM_BD1_draw(1);
946   m_vfd1->write_char(data);
950947}
951948
952949///////////////////////////////////////////////////////////////////////////
953950
954951WRITE8_MEMBER(bfm_sc2_state::vfd_reset_w)
955952{
956   BFM_BD1_reset(0);     // reset both VFD's
957   BFM_BD1_reset(1);
958   BFM_BD1_draw(0);
959   BFM_BD1_draw(1);
953   m_vfd0->reset();
954   m_vfd1->reset();
960955}
961956
962957///////////////////////////////////////////////////////////////////////////
r15442r15443
11771172
11781173WRITE8_MEMBER(bfm_sc2_state::vfd1_data_w)
11791174{
1180   m_vfd1_latch = data;
11811175
11821176   if (machine().device("matrix"))
11831177   {
r15442r15443
11851179   }
11861180   else
11871181   {
1188      BFM_BD1_newdata(0, data);
1189      BFM_BD1_draw(0);
1182      m_vfd0->write_char(data);
11901183   }
11911184}
11921185
r15442r15443
14141407
14151408static MACHINE_RESET( init )
14161409{
1417   // reset adder2
1418   MACHINE_RESET_CALL(adder2);
1410   bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
14191411
14201412   // reset the board //////////////////////////////////////////////////////
14211413
14221414   on_scorpion2_reset(machine);
1423   BFM_BD1_init(0);
1424   BFM_BD1_init(1);
1425}
1415   state->m_vfd0->reset();
1416   state->m_vfd1->reset();
14261417
1427static SCREEN_UPDATE_IND16( addersc2 )
1428{
1429   bfm_sc2_state *state = screen.machine().driver_data<bfm_sc2_state>();
1430   if ( state->m_sc2_show_door )
1431   {
1432      output_set_value("door",( Scorpion2_GetSwitchState(screen.machine(),state->m_sc2_door_state>>4, state->m_sc2_door_state & 0x0F) ) );
1433   }
1434
1435   return SCREEN_UPDATE16_CALL(adder2);
14361418}
14371419
14381420
r15442r15443
21642146   MCFG_CPU_PERIODIC_INT(timer_irq, 1000)            // generate 1000 IRQ's per second
21652147   MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
21662148
2149   MCFG_BFMBD1_ADD("vfd0",0)
2150
21672151   MCFG_NVRAM_ADD_0FILL("nvram")
21682152   MCFG_NVRAM_HANDLER(bfm_sc2)
21692153   MCFG_DEFAULT_LAYOUT(layout_bfm_sc2)
r15442r15443
21722156   MCFG_SCREEN_SIZE( 400, 280)
21732157   MCFG_SCREEN_VISIBLE_AREA(  0, 400-1, 0, 280-1)
21742158   MCFG_SCREEN_REFRESH_RATE(50)
2175   MCFG_SCREEN_UPDATE_STATIC(addersc2)
21762159
21772160   MCFG_VIDEO_START( adder2)
2161   MCFG_SCREEN_UPDATE_STATIC(adder2)
21782162   MCFG_VIDEO_RESET( adder2)
21792163
21802164   MCFG_PALETTE_LENGTH(16)
r15442r15443
26092593/* machine init (called only once) */
26102594static MACHINE_RESET( awp_init )
26112595{
2596   bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
2597
26122598   on_scorpion2_reset(machine);
2613   BFM_BD1_init(0);
2614   BFM_BD1_init(1);
2599   state->m_vfd0->reset();
2600   state->m_vfd1->reset();
26152601}
26162602
26172603
r15442r15443
37003686   MCFG_CPU_PERIODIC_INT(timer_irq, 1000 )
37013687   MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
37023688
3689   MCFG_BFMBD1_ADD("vfd0",0)
3690   MCFG_BFMBD1_ADD("vfd1",1)
3691
37033692   MCFG_SPEAKER_STANDARD_MONO("mono")
37043693   MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
37053694   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
r15442r15443
37313720   MCFG_CPU_PERIODIC_INT(timer_irq, 1000 )
37323721   MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_MONOSTABLE(120000,100e-9))
37333722
3734
37353723   MCFG_SPEAKER_STANDARD_MONO("mono")
37363724   MCFG_SOUND_ADD("ymsnd",YM2413, XTAL_3_579545MHz)
37373725   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
r15442r15443
37893777   sc2awp_common_init(machine,5, 1);
37903778   MechMtr_config(machine,8);
37913779
3792   BFM_BD1_init(0);
3793   BFM_BD1_init(1);
3794
37953780   state->m_has_hopper = 0;
37963781
37973782   Scorpion2_SetSwitchState(machine,4,0, 1);     /* GBP1 Low Level Switch */
r15442r15443
38123797
38133798   MechMtr_config(machine,8);
38143799
3815   BFM_BD1_init(0);
3816   BFM_BD1_init(1);
3817
38183800   state->m_has_hopper = 0;
38193801
38203802   Scorpion2_SetSwitchState(machine,4,0, 0);     /* GBP1 Low Level Switch */
r15442r15443
38443826{
38453827   sc2awp_common_init(machine,6, 1);
38463828   MechMtr_config(machine,5);
3847
3848   BFM_BD1_init(0);
38493829}
38503830
38513831static DRIVER_INIT (cpeno1)
r15442r15443
39343914   bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
39353915   sc2awp_common_init(machine,6, 1);
39363916   MechMtr_config(machine,8);
3937   BFM_BD1_init(0);
39383917   state->m_has_hopper = 0;
39393918}
39403919
src/mame/drivers/pong.c
r0r15443
1/***************************************************************************
2
3Pong (c) 1972 Atari
4
5driver by Couriersud
6
7Notes:
8
9TODO:
10
11============================================================================
12
13
14***************************************************************************/
15
16
17#include "emu.h"
18
19#include "machine/rescap.h"
20#include "sound/dac.h"
21
22/*
23 * H count width to 512
24 * Reset at 1C6 = 454
25 * V count width to 512, counts on HReset
26 * Reset at 105 = 261
27
28 * Clock = 7.159 MHz
29
30 * ==> 15.768 Khz Horz Freq
31 * ==> 60.41 Refresh
32
33 * HBlank 0 to 79
34 * HSync 32 to 63
35 * VBlank 0 to 15
36 * VSync 4 to 7
37
38 * Video = (HVID & VVID ) & (NET & PAD1 & PAD2)
39
40 * Net at 256H alternating at 4V
41 *
42 *
43 * http://www.youtube.com/watch?v=pDrRnJOCKZc
44 */
45
46#define MASTER_CLOCK   7139000
47#define V_TOTAL       (0x105+1)
48#define   H_TOTAL         (0x1C6+1)      // 454
49
50#define HBSTART               (H_TOTAL)
51#define HBEND               (80)
52#define VBSTART               (V_TOTAL)
53#define VBEND               (16)
54
55static UINT8 tab7448[16][7] =
56{
57      {   1, 1, 1, 1, 1, 1, 0 },  /* 00 - not blanked ! */
58      {   0, 1, 1, 0, 0, 0, 0 },  /* 01 */
59      {   1, 1, 0, 1, 1, 0, 1 },  /* 02 */
60      {   1, 1, 1, 1, 0, 0, 1 },  /* 03 */
61      {   0, 1, 1, 0, 0, 1, 1 },  /* 04 */
62      {   1, 0, 1, 1, 0, 1, 1 },  /* 05 */
63      {   0, 0, 1, 1, 1, 1, 1 },  /* 06 */
64      {   1, 1, 1, 0, 0, 0, 0 },  /* 07 */
65      {   1, 1, 1, 1, 1, 1, 1 },  /* 08 */
66      {   1, 1, 1, 0, 0, 1, 1 },  /* 09 */
67      {   0, 0, 0, 1, 1, 0, 1 },  /* 10 */
68      {   0, 0, 1, 1, 0, 0, 1 },  /* 11 */
69      {   0, 1, 0, 0, 0, 1, 1 },  /* 12 */
70      {   1, 0, 0, 1, 0, 1, 1 },  /* 13 */
71      {   0, 0, 0, 1, 1, 1, 1 },  /* 14 */
72      {   0, 0, 0, 0, 0, 0, 0 },  /* 15 */
73};
74
75class icMonoFlop
76{
77public:
78   icMonoFlop() { m_Q = 0; m_clocks = 0; m_last = 0; m_cnt = 0;}
79
80   void setPeriod555Std(double R, double C, double dt)
81   {
82      m_clocks = (1.1 * R * C) / dt;
83   }
84
85   inline void process(UINT8 in_trigger)
86   {
87      if (m_last && !in_trigger)
88      {
89         m_cnt = m_clocks;
90         m_Q = 1;
91      }
92      m_last = in_trigger;
93      if (m_Q)
94      {
95         m_cnt--;
96         if (m_cnt <= 0)
97         {
98            m_Q = 0;
99         }
100      }
101   }
102
103   inline UINT8 Q() { return m_Q; }
104
105   int m_clocks;
106
107private:
108   UINT8 m_Q;
109   int m_last;
110   int m_cnt;
111};
112
113
114class icRSFF
115{
116public:
117   icRSFF() { m_Q = 0; }
118
119   inline void process(UINT8 in_S, UINT8 in_R)
120   {
121      if (in_S)
122         m_Q = 1;
123      else if (in_R)
124         m_Q = 0;
125   }
126
127   inline UINT8 Q() { return m_Q; }
128   inline UINT8 QQ() { return !m_Q; }
129private:
130   UINT8 m_Q;
131};
132
133
134class ic7474
135{
136public:
137   ic7474() { m_lastclk = 0; m_Q = 0; }
138
139   void process(UINT8 clk, UINT8 in_D, UINT8 clrQ, UINT8 preQ)
140   {
141      if (!preQ)
142         m_Q = 1;
143      else if (!clrQ)
144         m_Q = 0;
145      else if (!m_lastclk && clk)
146         m_Q = in_D;
147      m_lastclk = clk;
148   }
149
150   inline UINT8 Q() { return m_Q; }
151   inline UINT8 QQ() { return !m_Q; }
152private:
153   UINT8 m_lastclk;
154   UINT8 m_Q;
155};
156
157/* 74107 does latch data during high !
158 * For modelling purposes, we assume 74107 and 74107A are the same
159 * */
160
161class ic74107A
162{
163public:
164   ic74107A() { m_lastclk = 0; m_Q = 0; }
165
166   void process(UINT8 clk, UINT8 in_J, UINT8 in_K, UINT8 clrQ)
167   {
168      if (!clrQ)
169         m_Q = 0;
170      else if (m_lastclk && !clk)
171      {
172         if (!in_J && in_K)
173            m_Q = 0;
174         else if (in_J && !in_K)
175            m_Q = 1;
176         else if (in_J && in_K)
177            m_Q = !m_Q;
178      }
179      m_lastclk = clk;
180   }
181
182   inline UINT8 Q() { return m_Q; }
183   inline UINT8 QQ() { return !m_Q; }
184private:
185   UINT8 m_lastclk;
186   UINT8 m_Q;
187};
188
189class ic74107 : public ic74107A
190{
191};
192
193class ic7493
194{
195public:
196   ic7493() { m_lastclk = 0; m_cnt = 0; }
197
198   void process(UINT8 clk, UINT8 R1, UINT8 R2)
199   {
200      if (R1 && R2)
201         m_cnt = 0;
202      else if (m_lastclk && !clk)
203      {
204         m_cnt = ( m_cnt + 1) & 0x0f;
205      }
206      m_lastclk = clk;
207   }
208
209   inline UINT8 QA() { return (m_cnt >> 0) & 1; }
210   inline UINT8 QB() { return (m_cnt >> 1) & 1; }
211   inline UINT8 QC() { return (m_cnt >> 2) & 1; }
212   inline UINT8 QD() { return (m_cnt >> 3) & 1; }
213
214   inline UINT8 count() { return m_cnt; }
215private:
216   UINT8 m_lastclk;
217   UINT8 m_cnt;
218};
219
220class ic7493_9 /* two chained 7493 + flipflop ==> 9 bit cnt */
221{
222public:
223   ic7493_9() { m_lastclk = 0; m_cnt = 0; }
224
225   void process(UINT8 clk, UINT8 R1)
226   {
227      if (R1)
228         m_cnt = 0;
229      else if (m_lastclk && !clk)
230      {
231         m_cnt = ( m_cnt + 1) & 0x1ff;
232      }
233      m_lastclk = clk;
234   }
235
236   inline UINT8 QA() { return (m_cnt >> 0) & 1; }
237   inline UINT8 QB() { return (m_cnt >> 1) & 1; }
238   inline UINT8 QC() { return (m_cnt >> 2) & 1; }
239   inline UINT8 QD() { return (m_cnt >> 3) & 1; }
240   inline UINT8 QE() { return (m_cnt >> 4) & 1; }
241   inline UINT8 QF() { return (m_cnt >> 5) & 1; }
242   inline UINT8 QG() { return (m_cnt >> 6) & 1; }
243   inline UINT8 QH() { return (m_cnt >> 7) & 1; }
244   inline UINT8 QI() { return (m_cnt >> 8) & 1; }
245
246   inline UINT16 count() { return m_cnt; }
247
248private:
249   UINT8 m_lastclk;
250   UINT16 m_cnt;
251};
252// ======================> pong_device
253
254class pong_device : public device_t,
255                 public device_execute_interface
256{
257public:
258   // construction/destruction
259   pong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
260
261   bitmap_rgb32 *m_bitmap;
262   int paddle0;
263   int paddle1;
264   UINT8 m_rst;
265
266   dac_device *m_dac; /* just to have a sound device */
267
268protected:
269   // device-level overrides
270   virtual void device_config_complete();
271   virtual void device_start();
272   virtual void device_reset();
273   virtual void device_post_load();
274   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
275
276   virtual void execute_run();
277
278    int m_icount;
279
280private:
281
282    void step_one_clock();
283
284    /* some gates */
285
286    inline UINT8 g_not(UINT8 in)   {return in ^ 1; }
287    inline UINT8 g_nand7(UINT8 in1, UINT8 in2, UINT8 in3, UINT8 in4, UINT8 in5, UINT8 in6, UINT8 in7)   { return (in1 && in2 && in3 && in4 && in5 && in6 && in7) ? 0 : 1; }
288    inline UINT8 g_nand5(UINT8 in1, UINT8 in2, UINT8 in3, UINT8 in4, UINT8 in5)    { return (in1 && in2 && in3 && in4 && in5) ? 0 : 1; }
289    inline UINT8 g_nand3(UINT8 in1, UINT8 in2, UINT8 in3)   { return (in1 && in2 && in3) ? 0 : 1; }
290    inline UINT8 g_nand2(UINT8 in1, UINT8 in2)   { return (in1 && in2) ? 0 : 1; }
291    inline UINT8 g_nor4(UINT8 in1, UINT8 in2, UINT8 in3, UINT8 in4)    { return (in1 || in2 || in3 || in4) ? 0 : 1; }
292    inline UINT8 g_nor3(UINT8 in1, UINT8 in2, UINT8 in3)   { return (in1 || in2 || in3) ? 0 : 1; }
293    inline UINT8 g_nor2(UINT8 in1, UINT8 in2)            { return (in1 || in2) ? 0 : 1; }
294
295    inline UINT8 s_4H()         { return ic_f8.QC(); }
296    inline UINT8 s_8H()         { return ic_f8.QD(); }
297    inline UINT8 s_16H()      { return ic_f8.QE(); }
298    inline UINT8 s_32H()      { return ic_f8.QF(); }
299    inline UINT8 s_64H()      { return ic_f8.QG(); }
300    inline UINT8 s_128H()      { return ic_f8.QH(); }
301    inline UINT8 s_256H()      { return ic_f8.QI(); }
302    inline UINT8 sQ_256H()      { return !s_256H(); }
303
304    inline UINT8 s_4V()         { return ic_e8.QC(); }
305    inline UINT8 s_8V()         { return ic_e8.QD(); }
306    inline UINT8 s_16V()      { return ic_e8.QE(); }
307    inline UINT8 s_32V()      { return ic_e8.QF(); }
308    inline UINT8 s_64V()      { return ic_e8.QG(); }
309    inline UINT8 s_128V()      { return ic_e8.QH(); }
310    inline UINT8 sQ_256V()      { return ic_e8.QI() ^ 1; }
311
312    inline UINT8 s_hreset()      { return ic_e7b.QQ(); }
313    inline UINT8 s_vreset()      { return ic_e7a.QQ(); }
314
315    inline UINT8 sQ_vblank()   { return ic_ff_vb.QQ(); }
316    inline UINT8 s_vblank()      { return ic_ff_vb.Q(); }
317    inline UINT8 sQ_vsync()      { return g_nand3(s_vblank(), s_4V(), g_not(s_8V())); }
318
319    inline UINT8 s_hblank()      { return (ic_ff_hb.Q()); }
320    inline UINT8 sQ_hsync()      { return g_nand2(s_hblank(),s_32H()); }
321
322    /* paddle triggers monoflop duration which triggers a counter up to 16 on hsync */
323    inline UINT8 sQ_vpad2()      { return !(ic_e8.count() >= paddle1 && ic_e8.count() < paddle1 + 16); }
324    inline UINT8 sQ_vpad1()      { return !(ic_e8.count() >= paddle0 && ic_e8.count() < paddle0 + 16); }
325
326    inline UINT8 sQ_hvid()      { return m_hvid; }
327    inline UINT8 sQ_vvid()      { return m_vvid; }
328    inline UINT8 s_vvid()      { return !m_vvid; }
329    inline UINT8 s_pad2()      { return g_nor3(g_nand2(s_128H(), m_ff_h3a), sQ_vpad2(), sQ_256H()); }
330    inline UINT8 s_pad1()      { return g_nor3(g_nand2(s_128H(), m_ff_h3a), sQ_vpad1(), s_256H()); }
331    inline UINT8 sQ_attract()   { return g_nor2(s_StopG(), sQ_run()); }
332    inline UINT8 s_attract()   { return !sQ_attract(); }
333    inline UINT8 s_net()      { return g_nor3(g_nand2(m_jk_256, s_256H()),s_vblank(),s_4V()); }
334    inline UINT8 s_video()      { return g_not(g_nor4(g_nor2(sQ_hvid(), sQ_vvid()), s_pad1(), s_pad2(), s_net())); }
335    inline UINT8 s_hit_sound_en() {return ic_c2a.QQ(); }
336    inline UINT8 s_hit_sound()   { return g_nand2(s_hit_sound_en(), s_vpos16()); }
337    inline UINT8 s_score_sound(){ return g_nand2(s_SC(),s_vpos32()); }
338    inline UINT8 s_topbothitsound() { return g_nand2(ic_f3_topbot.Q(), s_32V()); }
339
340    inline UINT8 s_sound()   { return g_nand2(sQ_attract(), g_nand3(s_topbothitsound(), s_hit_sound(), s_score_sound())); }
341
342    inline UINT8 sQ_hit()      { return !s_hit(); }
343    inline UINT8 s_hit()      { return g_nand2(sQ_hit1(), sQ_hit2()); }
344    inline UINT8 sQ_hit1()      { return g_nand2(s_pad1(), g_nor2(sQ_hvid(), sQ_vvid())); }
345    inline UINT8 sQ_hit2()      { return g_nand2(s_pad2(), g_nor2(sQ_hvid(), sQ_vvid())); }
346
347    inline UINT8 sQ_Miss()      { return g_nand2(s_hblank(), g_not(sQ_hvid())); }
348    inline UINT8 s_Missed()      { return g_nand2(g_not(sQ_Miss()), sQ_attract()); }
349
350
351    inline UINT8 scoreDigit()
352    {
353       if (!s_C5_EN())
354          return 15;
355       switch ((ic_f8.count() >> 5) & 3)  // 32H, 64H
356       {
357       case 0:
358          return (ic_c7_score1.count() >= 10) ? 1 : 15;
359       case 1:
360          return (ic_c7_score1.count() % 10);
361       case 2:
362          return (ic_d7_score2.count() >= 10) ? 1 : 15;
363       case 3:
364          return (ic_d7_score2.count() % 10);
365       }
366       return 0;
367    }
368    inline UINT8 s_scoreFE() { return g_nor3(g_not(s_16H()), s_4H(), s_8H()); }
369    inline UINT8 s_scoreBC() { return g_nor2(g_not(s_16H()), g_nand2(s_4H(), s_8H())); }
370    inline UINT8 s_scoreA() { return g_nor3(g_not(s_16H()), s_8V(), s_4V()); }
371    inline UINT8 s_scoreGD() { return g_not(g_nand3(s_16H(), s_8V(), s_4V())); }
372
373    inline UINT8 s_C5_EN()
374    {
375       UINT8 tmp1;
376       tmp1 = g_nor2(g_nor3(s_256H(),s_64H(),g_not(s_128H())), g_not(g_nand3(s_256H(),s_64H(),g_not(s_128H()))) );
377       return g_nor4(tmp1, s_64V(), s_128V(), g_not(s_32V()));
378    }
379    inline UINT8 s_score()
380    {
381       return g_nand7(
382             g_nand3(g_not(s_16V()), tab7448[scoreDigit()][5], s_scoreFE()),
383             g_nand3(       s_16V(), tab7448[scoreDigit()][4], s_scoreFE()),
384             g_nand3(g_not(s_16V()), tab7448[scoreDigit()][1], s_scoreBC()),
385             g_nand3(s_16V(), tab7448[scoreDigit()][2], s_scoreBC()),
386             g_nand3(g_not(s_16V()), tab7448[scoreDigit()][0], s_scoreA()),
387             g_nand3(g_not(s_16V()), tab7448[scoreDigit()][6], s_scoreGD()),
388             g_nand3(s_16V(), tab7448[scoreDigit()][3], s_scoreGD())
389             );
390    }
391    inline UINT8 s_Aa() { return g_nand2(s_Ba(),g_nand2(s_move(), ic_h3b.Q())); }
392    inline UINT8 s_Ba() { return g_nand2(s_move(), ic_h3b.QQ()); }
393    inline UINT8 s_Serve() { return ic_b5b_serve.QQ(); }
394    inline UINT8 sQ_Serve() { return ic_b5b_serve.Q(); }
395    inline UINT8 s_SC() { return ic_g4_sc.Q(); }       /* monoflop with NE555 determines score sound */
396    inline UINT8 s_SRST() { return m_rst; }
397    inline UINT8 sQ_SRST() { return !s_SRST(); }
398    inline UINT8 sQ_run() { return 0; }
399    inline UINT8 s_rstspeed() { return g_nand2(sQ_SRST(), sQ_Miss()); }
400    inline UINT8 s_StopG() { return g_nand2(sQ_StopG1(), sQ_StopG2()); }
401    inline UINT8 sQ_StopG1() { return (ic_c7_score1.count() != 15); } // FIXME later
402    inline UINT8 sQ_StopG2() { return (ic_d7_score2.count() != 15); } // FIXME later
403    inline UINT8 s_L() { return ic_h3b.Q(); }
404    inline UINT8 s_R() { return ic_h3b.QQ(); }
405
406    inline UINT8 s_vpos256() { return (m_vball_cnt & 0xf0) == 0xf0; }
407    inline UINT8 s_vpos16() { return (m_vball_cnt & 0x10) == 0x10; }
408    inline UINT8 s_vpos32() { return (m_vball_cnt & 0x20) == 0x20; }
409
410
411
412    void step_hball_cnt()
413    {
414       if (!s_hblank())
415       {
416           m_hball_cnt++;
417           if (m_hball_cnt > 0x1ff)
418              m_hball_cnt = 0x88 | (s_Ba() << 1) | s_Aa();
419       }
420       if (!g_nand2(s_Serve(),sQ_attract()))
421       {
422          m_hball_cnt = 0;
423       }
424       m_hvid = !((m_hball_cnt & 0x1fc) == 0x1fc);
425    }
426
427    void step_vball_cnt()
428    {
429       UINT8 add;
430       /* get paddle ofsets */
431       if (m_last_hit && !s_hit())
432       {
433          m_p_latch = (((s_256H() ? ic_e8.count() - paddle1 : ic_e8.count() - paddle0) >> 1) & 0x07) ^ 0x07;
434       }
435      m_last_hit = s_hit();
436
437       /* now step */
438       if (sQ_vblank())
439       {
440           if (ic_h2a_2.Q())
441           {
442              add = (m_p_latch ^ 0x07);
443           }
444           else
445           {
446              add = m_p_latch;
447           }
448
449           add += ( 0x06 + ((add >> 2) ^ 1));
450
451          if (m_last_hsync && !sQ_hsync())
452          {
453             m_vball_cnt++;
454               //printf("add %d\n", add);
455          }
456          m_last_hsync = sQ_hsync();
457           if (m_vball_cnt > 0xff)
458              m_vball_cnt = add;   /* A6 .. D6 */
459       }
460       m_vvid = !((m_vball_cnt & 0xfc) == 0xfc);
461
462    }
463
464    inline UINT8 s_move() { return g_nand2(ic_h2b.Q(), ic_h2a.Q()); }
465
466    ic7474   ic_c2a;
467    ic7493   ic_f1;
468    ic74107 ic_h2a;
469    ic74107 ic_h2b;
470    ic7474   ic_h3b;
471
472    /* horizontal counter */
473    ic7493_9 ic_f8;   /* f8, f9, f6b */
474    ic7474   ic_e7b;
475
476    /* vertical counter */
477    ic7493_9 ic_e8;   /* e8, e9, d9b */
478    ic7474   ic_e7a;
479
480    /* vblank flip flop */
481    icRSFF   ic_ff_vb;   /* f5b, f5c */
482
483    /* hblank flip flop */
484    icRSFF   ic_ff_hb;   /* h5b, h5c */
485
486    /* serve monoflog */
487    icMonoFlop ic_f4_serve;
488    ic7474 ic_b5b_serve;
489
490    ic74107 ic_h2a_2;   /* two marked at position h2a */
491
492    UINT8   m_jk_256;
493    UINT8   m_ff_h3a;
494    ic7493   ic_c7_score1;      /* FIXME: realized by 74LS90 and 74LS107, both falling edge, using a 93 for now ... */
495    ic7493   ic_d7_score2;      /* FIXME: realized by 74LS90 and 74LS107, both falling edge, using a 93 for now ... */
496
497    ic74107   ic_f3_topbot;
498    icMonoFlop ic_g4_sc;
499
500    UINT16  m_hball_cnt;   /* 2x 9316 and 74107 FF */
501    UINT8   m_hvid;
502
503    UINT16  m_vball_cnt;   /* 2x 9316  */
504
505    UINT8   m_last_hsync;
506    UINT8   m_vvid;
507    UINT8   m_p_latch;
508    UINT8   m_last_hit;
509};
510
511
512class pong_state : public driver_device
513{
514public:
515   pong_state(const machine_config &mconfig, device_type type, const char *tag)
516      : driver_device(mconfig, type, tag),
517        m_maincpu(*this, "maincpu")
518   {  }
519
520   // devices
521   required_device<pong_device> m_maincpu;
522
523   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
524
525protected:
526
527   // driver_device overrides
528   virtual void machine_start();
529   virtual void machine_reset();
530
531   virtual void video_start();
532};
533
534// device type definition
535const device_type PONG = &device_creator<pong_device>;
536
537void pong_state::machine_start()
538{
539//  save_item(NAME(m_sound_nmi_enabled));
540//  save_item(NAME(m_nmi_enable));
541   dac_device *t = machine().device<dac_device>("dac");
542   downcast<pong_device *>(m_maincpu.target())->m_dac = t;
543}
544
545void pong_state::machine_reset()
546{
547//  m_sound_nmi_enabled = FALSE;
548//  m_nmi_enable = 0;
549}
550
551
552void pong_state::video_start()
553{
554   //FIXME: createtemporary bitmap
555}
556
557
558UINT32 pong_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
559{
560   //draw_bullets(bitmap, cliprect);
561   //draw_sprites(bitmap, cliprect);
562   downcast<pong_device *>(m_maincpu.target())->paddle0 = ioport("PADDLE0")->read_safe(0);
563   downcast<pong_device *>(m_maincpu.target())->paddle1 = ioport("PADDLE1")->read_safe(0);
564   downcast<pong_device *>(m_maincpu.target())->m_rst = ioport("IN0")->read_safe(0) & 1;
565
566   copybitmap(bitmap, *(downcast<pong_device *>(m_maincpu.target())->m_bitmap), 0, 0, 0, 0, cliprect);
567   return 0;
568}
569
570pong_device::pong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
571   : device_t(mconfig, PONG, "PONG", tag, owner, clock),
572     device_execute_interface(mconfig, *this)
573{
574}
575
576
577void pong_device::device_config_complete()
578{
579
580}
581void pong_device::device_start()
582{
583
584   double dt = clocks_to_attotime(1).as_double();
585   ic_f4_serve.m_clocks = MASTER_CLOCK;  // about a second ..., but FIXME
586   ic_g4_sc.setPeriod555Std(RES_K(220), CAP_U(1), dt);
587
588   m_p_latch = 5;
589
590   m_bitmap = auto_bitmap_rgb32_alloc(machine(),H_TOTAL,V_TOTAL);
591
592   // set our instruction counter
593   m_icountptr = &m_icount;
594
595   save_item(NAME(m_p_latch));
596
597}
598void pong_device::device_reset()
599{
600
601}
602void pong_device::device_post_load()
603{
604
605}
606void pong_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
607{
608
609}
610
611void pong_device::execute_run()
612{
613   //bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
614
615   //printf("Burning %d cycles\n", m_icount);
616   do
617   {
618      // debugging
619      //m_ppc = m_pc; // copy PC to previous PC
620      //if (check_debugger)
621      //  debugger_instruction_hook(this, 0); //m_pc);
622
623      // instruction fetch
624      //UINT16 op = opcode_read();
625
626      step_one_clock();
627
628      /* TODO: score and video are mixed by resistor network */
629      if (s_video())
630      {
631         //printf("video %d %d\n", m_vcount, m_hcount);
632         m_bitmap->pix(ic_e8.count(), ic_f8.count()) = MAKE_RGB(255,255,255);
633      }
634      else if (s_score())
635         m_bitmap->pix(ic_e8.count(), ic_f8.count()) = MAKE_RGB(255,255,255);
636
637      m_icount--;
638   } while (m_icount > 0);
639}
640
641void pong_device::step_one_clock()
642{
643   UINT8 last_4H = s_4H();
644
645   /* falling edge */
646   m_jk_256 = sQ_256H();
647
648   ic_f8.process(0,ic_e7b.QQ());
649   ic_e7b.process(0, g_nand5(ic_f8.QB(),ic_f8.QC(), ic_f8.QG(), ic_f8.QH(), ic_f8.QI()),1,1);
650
651   ic_e8.process(s_hreset(),ic_e7a.QQ());
652   ic_e7a.process(s_hreset(), g_nand3(ic_e8.QA(),ic_e8.QC(), ic_e8.QI()),1,1);
653
654   ic_f8.process(1,ic_e7b.QQ());
655   ic_e7b.process(1, g_nand5(ic_f8.QB(),ic_f8.QC(), ic_f8.QG(), ic_f8.QH(), ic_f8.QI()),1,1);
656
657   ic_e8.process(s_hreset(),ic_e7a.QQ());
658   ic_e7a.process(s_hreset(), g_nand3(ic_e8.QA(),ic_e8.QC(), ic_e8.QI()),1,1);
659
660   ic_ff_vb.process(s_vreset(), s_16V());
661   ic_ff_hb.process(s_hreset(), g_not(g_nand2(s_16H(),s_64H())));
662
663   //if (s_hblank() && ic_e8.count()==0)
664   //  printf("hblank %d\n", ic_f8.count());
665
666   {
667      /* move logic */
668      UINT8 clk = g_nor2(sQ_256H(), s_vreset());
669      UINT8 tmp1 = g_nand2(ic_f1.QC(), ic_f1.QD());
670      UINT8 tmp2 = g_not(g_nor2(ic_f1.QC(), ic_f1.QD()));
671
672      ic_h2b.process(clk, 1, s_move(), g_nand2(s_vreset(), g_nand2(tmp1, tmp2)));
673      ic_h2a.process(clk, ic_h2b.Q(), 0, g_nand2(s_vreset(), tmp2));
674
675      ic_h3b.process(g_not(g_nand2(s_SC(), s_attract())), ic_h3b.QQ(), sQ_hit1(), sQ_hit2());
676
677   }
678
679   /* sound logic */
680   ic_c2a.process(s_vpos256(), 1, sQ_hit(), 1);
681   ic_f3_topbot.process(s_vblank(),s_vvid(),sQ_vvid(),sQ_Serve());
682   ic_g4_sc.process(sQ_Miss());
683
684   step_hball_cnt();
685   step_vball_cnt();
686
687   /* flipflop - vertical add */
688   ic_h2a_2.process(s_vblank(),!sQ_vvid(),!sQ_vvid(),sQ_hit());
689
690   ic_f1.process(g_nand2(s_hit_sound(), g_nand2(ic_f1.QC(), ic_f1.QD())),s_rstspeed(), s_rstspeed());
691
692   if (ic_e8.count() == 16 && ic_f8.count()==0)
693   {
694      m_bitmap->fill(MAKE_RGB(0,0,0));
695   }
696
697   if (!sQ_attract())
698      m_ff_h3a = 0;
699   else
700   {
701      if (!last_4H && s_4H()) // raising edge for 7474
702         m_ff_h3a = !s_128H();
703   }
704
705   ic_f4_serve.process(g_not(s_rstspeed()));
706   UINT8 tmpx = g_nor3(ic_f4_serve.Q(), s_StopG(), sQ_run());
707   ic_b5b_serve.process(s_pad1(), tmpx, tmpx, 1);
708
709   /* Score logic ... */
710   ic_c7_score1.process(g_nor2(s_L(), s_Missed()), s_SRST(), s_SRST());
711   ic_d7_score2.process(g_nor2(s_R(), s_Missed()), s_SRST(), s_SRST());
712
713   dac_w(m_dac, 0, 255*s_sound());
714#if 0
715   {
716      static UINT8 lst_sound = 0;
717      UINT8 ns = s_sound();
718      if (ns != lst_sound)
719         printf("sound toggle %d %d\n", ns,  s_SC()); // ic_f3_topbot.Q());
720      lst_sound=ns;
721   }
722
723#endif
724}
725
726
727
728static INPUT_PORTS_START( pong )
729   PORT_START( "PADDLE0" )   /* fake input port for player 1 paddle */
730   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15)
731
732   PORT_START( "PADDLE1" )   /* fake input port for player 2 paddle */
733   PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(30) PORT_KEYDELTA(15) PORT_PLAYER(2)
734
735   PORT_START("IN0") /* fake as well */
736   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
737   PORT_DIPNAME( 0x02, 0x00, "Game Won" )         PORT_DIPLOCATION("SW1B:4")
738   PORT_DIPSETTING(    0x00, "11" )
739   PORT_DIPSETTING(    0x02, "15" )
740
741INPUT_PORTS_END
742
743static MACHINE_CONFIG_START( pong, pong_state )
744
745   /* basic machine hardware */
746   MCFG_CPU_ADD("maincpu", PONG, MASTER_CLOCK)
747
748    /* video hardware */
749    MCFG_SCREEN_ADD("screen", RASTER)
750    MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK, H_TOTAL, HBEND, HBSTART, V_TOTAL, VBEND, VBSTART)
751   MCFG_SCREEN_UPDATE_DRIVER(pong_state, screen_update)
752
753   /* sound hardware */
754   MCFG_SPEAKER_STANDARD_MONO("mono")
755
756   MCFG_SOUND_ADD("dac", DAC, 0)
757
758   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
759
760   //MCFG_SPEAKER_STANDARD_MONO("mono")
761
762   //MCFG_SOUND_ADD("aysnd", AY8910, 1789750)
763   //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
764MACHINE_CONFIG_END
765
766/***************************************************************************
767
768  Game driver(s)
769
770***************************************************************************/
771
772ROM_START( pong ) /* dummy to satisfy game entry*/
773   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 )
774ROM_END
775
776
777GAME( 1972, pong,  0, pong, pong,  0, ROT0, "Atari", "Pong (Rev E)", GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
src/mame/drivers/bfm_sc4.c
r15442r15443
1010
1111    This file contains the set lists only, for the actual hardware
1212    emulation see bfm_sc4h.c
13   However, the handlers for DMD are currently here, because we only
14   have it hooked up for one game, there must be more.
13    However, the handlers for DMD are currently here, because we only
14    have it hooked up for one game, there must be more.
1515
1616
1717    note: default Jackpot keys are set to whatever value the game
src/mame/drivers/bankp.c
r15442r15443
9797#include "includes/bankp.h"
9898
9999
100#define MASTER_CLOCK   XTAL_15_468MHz
101
102// Video timing
103// PCB measured: H = 15.61khz V = 60.99hz, +/- 0.01hz
104// --> VTOTAL should be OK, HTOTAL not 100% certain
105#define PIXEL_CLOCK      MASTER_CLOCK/3
106
107#define HTOTAL         330
108#define HBEND         0+3*8
109#define HBSTART         224+3*8
110
111#define VTOTAL         256
112#define VBEND         0+2*8
113#define VBSTART         224+2*8
114
115
100116/*************************************
101117 *
102118 *  Address maps
r15442r15443
278294static MACHINE_CONFIG_START( bankp, bankp_state )
279295
280296   /* basic machine hardware */
281   MCFG_CPU_ADD("maincpu", Z80, BANKP_CPU_CLOCK)
297   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)
282298   MCFG_CPU_PROGRAM_MAP(bankp_map)
283299   MCFG_CPU_IO_MAP(bankp_io_map)
284300   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
r15442r15443
287303
288304   /* video hardware */
289305   MCFG_SCREEN_ADD("screen", RASTER)
290   MCFG_SCREEN_REFRESH_RATE(60)
291   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
292   MCFG_SCREEN_SIZE(32*8, 32*8)
293   MCFG_SCREEN_VISIBLE_AREA(3*8, 31*8-1, 2*8, 30*8-1)
306   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
294307   MCFG_SCREEN_UPDATE_STATIC(bankp)
295308
296309   MCFG_GFXDECODE(bankp)
r15442r15443
302315   /* sound hardware */
303316   MCFG_SPEAKER_STANDARD_MONO("mono")
304317
305   MCFG_SOUND_ADD("sn1", SN76489, BANKP_SN76496_CLOCK)
318   MCFG_SOUND_ADD("sn1", SN76489, MASTER_CLOCK/6)
306319   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
307320
308   MCFG_SOUND_ADD("sn2", SN76489, BANKP_SN76496_CLOCK)
321   MCFG_SOUND_ADD("sn2", SN76489, MASTER_CLOCK/6)
309322   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
310323
311   MCFG_SOUND_ADD("sn3", SN76489, BANKP_SN76496_CLOCK)
324   MCFG_SOUND_ADD("sn3", SN76489, MASTER_CLOCK/6)
312325   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
313326MACHINE_CONFIG_END
314327
src/mame/drivers/namcos22.c
r15442r15443
15191519
15201520static void EnableSlaveDSP( running_machine &machine )
15211521{
1522//   namcos22_state *state = machine.driver_data<namcos22_state>();
1522//  namcos22_state *state = machine.driver_data<namcos22_state>();
15231523//  device_set_input_line(state->m_slave, INPUT_LINE_RESET, CLEAR_LINE);
15241524   namcos22_enable_slave_simulation(machine, 1);
15251525}
src/mame/drivers/galaxold.c
r15442r15443
31513151
31523152Base Board
31533153----------
3154There are 2 x Toshiba 2114, 2 x Mitsubushi 2101 and 5 x Intel 2115 making up
3155the video RAM. There are 6 ROM sockets for the video ROM but the daughter card
3156only connects to two of them. I believe that this is a version of
3154There are 2 x Toshiba 2114, 2 x Mitsubushi 2101 and 5 x Intel 2115 making up
3155the video RAM. There are 6 ROM sockets for the video ROM but the daughter card
3156only connects to two of them. I believe that this is a version of
31573157Scramble/Galaxians video hardware.
31583158
31593159There are 4 x Toshiba 2114 that make up the CPU RAM. There are 8 ROM sockets
src/mame/drivers/dec0.c
r15442r15443
667667static ADDRESS_MAP_START( automat_s_map, AS_PROGRAM, 8, dec0_automat_state )
668668   AM_RANGE(0xc000, 0xc7ff) AM_RAM
669669   AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("2203a", ym2203_w)
670   AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r)   
670   AM_RANGE(0xd800, 0xd800) AM_READ(soundlatch_byte_r)
671671   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE_LEGACY("2203b", ym2203_w)
672672   AM_RANGE(0xf000, 0xf000) AM_WRITE(automat_adpcm_w)
673673   AM_RANGE(0x0000, 0xffff) AM_ROM
r15442r15443
14231423   else
14241424   {
14251425      msm5205_data_w(device, state->m_automat_adpcm_byte >> 4);
1426   //   cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
1426   //  cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
14271427   }
14281428
14291429   state->m_automat_msm5205_vclk_toggle ^= 1;
src/mame/drivers/clayshoo.c
r15442r15443
239239   AM_RANGE(0x00, 0x00) AM_WRITE(watchdog_reset_w)
240240   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("ppi8255_0", i8255_device, read, write)
241241   AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write)
242//   AM_RANGE(0x40, 0x43) AM_NOP // 8253 for sound?
243//   AM_RANGE(0x50, 0x50) AM_NOP // ?
244//   AM_RANGE(0x60, 0x60) AM_NOP // ?
242//  AM_RANGE(0x40, 0x43) AM_NOP // 8253 for sound?
243//  AM_RANGE(0x50, 0x50) AM_NOP // ?
244//  AM_RANGE(0x60, 0x60) AM_NOP // ?
245245ADDRESS_MAP_END
246246
247247
src/mame/drivers/taito_z.c
r15442r15443
13471347   {
13481348      case 0x0:
13491349         break;
1350   
1350
13511351      case 0x101:
13521352         /* outputs will go here, but driver is still broken */
13531353         break;
13541354   }
1355   
1355
13561356   logerror("CPU #0 PC %06x: warning - write %04x to motor cpu %03x\n",cpu_get_pc(&space.device()),data,offset);
13571357}
13581358
r15442r15443
20312031   PORT_DIPSETTING(    0x01, "Cockpit" )         // analog pedals
20322032   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )   // digital pedals, no brake?, allow free steering wheel
20332033   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Continue_Price ) )   PORT_DIPLOCATION("SW A:2")
2034    PORT_DIPSETTING(    0x02, "Same as Start" )
2034   PORT_DIPSETTING(    0x02, "Same as Start" )
20352035   PORT_DIPSETTING(    0x00, "Discount" )
20362036   PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW A:3" )
20372037   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW A:4")
r15442r15443
21222122   PORT_DIPSETTING(    0x10, "3" )
21232123   PORT_DIPSETTING(    0x00, "5" )
21242124   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Continue_Price ) )   PORT_DIPLOCATION("SW B:6")
2125    PORT_DIPSETTING(    0x20, "Same as Start" )
2125   PORT_DIPSETTING(    0x20, "Same as Start" )
21262126   PORT_DIPSETTING(    0x00, "Discount" )
21272127   PORT_DIPNAME( 0x40, 0x40, "Clear Damage on Continue" )   PORT_DIPLOCATION("SW B:7")
21282128   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
src/mame/drivers/irobot.c
r15442r15443
318318   MCFG_SPEAKER_STANDARD_MONO("mono")
319319
320320   /* FIXME: I-Robot has all channels of the quad-pokey tied together
321    *        This needs to be taken into account in the design.
322    */
321     *        This needs to be taken into account in the design.
322     */
323323   MCFG_POKEY_ADD("pokey1", MAIN_CLOCK/8)
324324   MCFG_POKEY_CONFIG(pokey_config)
325325   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
src/mame/drivers/quantum.c
r15442r15443
243243      RES_K(220), 0, 0, 0, /* r1 .. r4 */
244244      RES_K(220),          /* rF */
245245      CAP_U(0.022),       /* C1 */
246      CAP_U(0.1),           /* C2 */
247      0,                  /* C3 */
246      CAP_U(0.1),          /* C2 */
247      0,                /* C3 */
248248      0.0,             /* vRef */
249249      15.0,             /* vP */
250250      -15.0,             /* vN */
r15442r15443
271271
272272   /* Convert Pokey output to 5V Signal */
273273   DISCRETE_INPUTX_STREAM(NODE_100, 0, 5.0 / 32768, 5.0)   /* Add VRef again */
274   DISCRETE_INPUTX_STREAM(NODE_110, 1, 5.0 / 32768, 5.0)    /* Add VRef again */
274   DISCRETE_INPUTX_STREAM(NODE_110, 1, 5.0 / 32768, 5.0)   /* Add VRef again */
275275
276276   DISCRETE_OP_AMP_FILTER(NODE_150, 1, NODE_100, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1, &pokey1_info)
277277
src/mame/drivers/hng64.c
r15442r15443
10621062      }
10631063      else
10641064      {
1065         printf("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd);
1065         printf("unknown hng64_soundcpu_enable_w cmd %04x\n", cmd);
10661066      }
10671067   }
10681068
10691069   if (mem_mask&0x0000ffff)
10701070   {
1071         printf("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
1071         printf("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
10721072   }
10731073}
10741074
r15442r15443
11651165   AM_RANGE(0x30200000, 0x3025ffff) AM_READWRITE(hng64_3d_2_r, hng64_3d_2_w) AM_SHARE("3d_2")   // 3D Display Buffer B
11661166
11671167   // Sound
1168//   AM_RANGE(0x60000000, 0x601fffff) AM_READWRITE(hng64_soundram2_r, hng64_soundram2_w) // if this area acts as RAM then xrally will copy the sound program here and blank out the usual area below.  None of the other games test this as sound ram (usually just write to the first byte) -- maybe it's actually unmapped?
1168//  AM_RANGE(0x60000000, 0x601fffff) AM_READWRITE(hng64_soundram2_r, hng64_soundram2_w) // if this area acts as RAM then xrally will copy the sound program here and blank out the usual area below.  None of the other games test this as sound ram (usually just write to the first byte) -- maybe it's actually unmapped?
11691169   AM_RANGE(0x60200000, 0x603fffff) AM_READWRITE(hng64_soundram_r, hng64_soundram_w)   // uploads the v53 sound program here, elsewhere on ss64-2
11701170
11711171   // These are sound ports of some sort
src/mame/drivers/gyruss.c
r15442r15443
6666#include "includes/gyruss.h"
6767
6868
69#define MASTER_CLOCK   XTAL_18_432MHz
70#define SOUND_CLOCK      XTAL_14_31818MHz
71
72// Video timing
73// PCB measured: H = 15.50khz V = 60.56hz, +/- 0.01hz
74// --> VTOTAL should be OK, HTOTAL not 100% certain
75#define PIXEL_CLOCK      MASTER_CLOCK/3
76
77#define HTOTAL         396
78#define HBEND         0
79#define HBSTART         256
80
81#define VTOTAL         256
82#define VBEND         0+2*8
83#define VBSTART         224+2*8
84
85
6986/* The timer clock which feeds the upper 4 bits of                      */
7087/* AY-3-8910 port A is based on the same clock                          */
7188/* feeding the sound CPU Z80.  It is a divide by                        */
r15442r15443
96113
97114WRITE8_MEMBER(gyruss_state::gyruss_dac_w)
98115{
99   device_t *device = machine().device("discrete");
100   discrete_sound_w(device, NODE(16), data);
116   discrete_sound_w(m_discrete, NODE(16), data);
101117}
102118
103119WRITE8_MEMBER(gyruss_state::gyruss_irq_clear_w)
r15442r15443
121137
122138WRITE8_MEMBER(gyruss_state::gyruss_filter0_w)
123139{
124   device_t *device = machine().device("discrete");
125   filter_w(device, 0, data);
140   filter_w(m_discrete, 0, data);
126141}
127142
128143WRITE8_MEMBER(gyruss_state::gyruss_filter1_w)
129144{
130   device_t *device = machine().device("discrete");
131   filter_w(device, 1, data);
145   filter_w(m_discrete, 1, data);
132146}
133147
134148
r15442r15443
145159
146160WRITE8_MEMBER(gyruss_state::master_nmi_mask_w)
147161{
148
149162   m_master_nmi_mask = data & 1;
150163}
151164
152165WRITE8_MEMBER(gyruss_state::slave_irq_mask_w)
153166{
154
155167   m_slave_irq_mask = data & 1;
156168}
157169
r15442r15443
385397
386398static const discrete_mixer_desc konami_right_mixer_desc =
387399   {DISC_MIXER_IS_RESISTOR,
388      {RES_K(2.2), RES_K(2.2), RES_K(2.2), RES_K(3.3)/3, RES_K(3.3)/3 },
389      {0,0,0,0,0,0},   /* no variable resistors   */
390      {0,0,0,0,0,0},  /* no node capacitors      */
391      0, 200,
392      CAP_U(0.1),
393      CAP_U(1),      /* DC - Removal, not in schematics */
394      0, 1};
400   {RES_K(2.2), RES_K(2.2), RES_K(2.2), RES_K(3.3)/3, RES_K(3.3)/3 },
401   {0,0,0,0,0,0},   /* no variable resistors   */
402   {0,0,0,0,0,0},  /* no node capacitors      */
403   0, 200,
404   CAP_U(0.1),
405   CAP_U(1),      /* DC - Removal, not in schematics */
406   0, 1};
395407
396408static const discrete_mixer_desc konami_left_mixer_desc =
397409   {DISC_MIXER_IS_RESISTOR,
r15442r15443
480492{
481493   gyruss_state *state = machine.driver_data<gyruss_state>();
482494
483   state->m_audiocpu = machine.device<cpu_device>("audiocpu");
484   state->m_audiocpu_2 = machine.device<cpu_device>("audio2");
495   state->save_item(NAME(state->m_master_nmi_mask));
496   state->save_item(NAME(state->m_slave_irq_mask));
485497}
486498
487499static INTERRUPT_GEN( master_vblank_irq )
488500{
489501   gyruss_state *state = device->machine().driver_data<gyruss_state>();
490502
491   if(state->m_master_nmi_mask)
503   if (state->m_master_nmi_mask)
492504      device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
493505}
494506
r15442r15443
496508{
497509   gyruss_state *state = device->machine().driver_data<gyruss_state>();
498510
499   if(state->m_slave_irq_mask)
511   if (state->m_slave_irq_mask)
500512      device_set_input_line(device, 0, HOLD_LINE);
501513}
502514
503515static MACHINE_CONFIG_START( gyruss, gyruss_state )
504516
505517   /* basic machine hardware */
506   MCFG_CPU_ADD("maincpu", Z80, 3072000)   /* 3.072 MHz (?) */
518   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
507519   MCFG_CPU_PROGRAM_MAP(main_cpu1_map)
508520   MCFG_CPU_VBLANK_INT("screen", master_vblank_irq)
509521
510   MCFG_CPU_ADD("sub", M6809, 2000000)        /* 2 MHz ??? */
522   MCFG_CPU_ADD("sub", M6809, MASTER_CLOCK/12)      /* 1.536 MHz */
511523   MCFG_CPU_PROGRAM_MAP(main_cpu2_map)
512524   MCFG_CPU_VBLANK_INT("screen", slave_vblank_irq)
513525
514   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)   /* 3.579545 MHz */
526   MCFG_CPU_ADD("audiocpu", Z80, SOUND_CLOCK/4)   /* 3.579545 MHz */
515527   MCFG_CPU_PROGRAM_MAP(audio_cpu1_map)
516528   MCFG_CPU_IO_MAP(audio_cpu1_io_map)
517529
518   MCFG_CPU_ADD("audio2", I8039,8000000)   /* 8MHz crystal */
530   MCFG_CPU_ADD("audio2", I8039, XTAL_8MHz)
519531   MCFG_CPU_PROGRAM_MAP(audio_cpu2_map)
520532   MCFG_CPU_IO_MAP(audio_cpu2_io_map)
521533
r15442r15443
525537
526538   /* video hardware */
527539   MCFG_SCREEN_ADD("screen", RASTER)
528   MCFG_SCREEN_REFRESH_RATE(60)
529   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
530   MCFG_SCREEN_SIZE(32*8, 32*8)
531   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
540   MCFG_SCREEN_RAW_PARAMS(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART)
532541   MCFG_SCREEN_UPDATE_STATIC(gyruss)
533542
534543   MCFG_GFXDECODE(gyruss)
r15442r15443
540549   /* sound hardware */
541550   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
542551
543   MCFG_SOUND_ADD("ay1", AY8910, 14318180/8)
552   MCFG_SOUND_ADD("ay1", AY8910, SOUND_CLOCK/8)
544553   MCFG_SOUND_CONFIG(ay8910_interface_1)
545554   MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 0)
546555   MCFG_SOUND_ROUTE_EX(1, "discrete", 1.0, 1)
547556   MCFG_SOUND_ROUTE_EX(2, "discrete", 1.0, 2)
548557
549   MCFG_SOUND_ADD("ay2", AY8910, 14318180/8)
558   MCFG_SOUND_ADD("ay2", AY8910, SOUND_CLOCK/8)
550559   MCFG_SOUND_CONFIG(ay8910_interface_2)
551560   MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 3)
552561   MCFG_SOUND_ROUTE_EX(1, "discrete", 1.0, 4)
553562   MCFG_SOUND_ROUTE_EX(2, "discrete", 1.0, 5)
554563
555   MCFG_SOUND_ADD("ay3", AY8910, 14318180/8)
564   MCFG_SOUND_ADD("ay3", AY8910, SOUND_CLOCK/8)
556565   MCFG_SOUND_CONFIG(ay8910_interface_3)
557566   MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 6)
558567   MCFG_SOUND_ROUTE_EX(1, "discrete", 1.0, 7)
559568   MCFG_SOUND_ROUTE_EX(2, "discrete", 1.0, 8)
560569
561   MCFG_SOUND_ADD("ay4", AY8910, 14318180/8)
570   MCFG_SOUND_ADD("ay4", AY8910, SOUND_CLOCK/8)
562571   MCFG_SOUND_CONFIG(ay8910_interface_4)
563572   MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 9)
564573   MCFG_SOUND_ROUTE_EX(1, "discrete", 1.0, 10)
565574   MCFG_SOUND_ROUTE_EX(2, "discrete", 1.0, 11)
566575
567   MCFG_SOUND_ADD("ay5", AY8910, 14318180/8)
576   MCFG_SOUND_ADD("ay5", AY8910, SOUND_CLOCK/8)
568577   MCFG_SOUND_CONFIG(ay8910_interface_5)
569578   MCFG_SOUND_ROUTE_EX(0, "discrete", 1.0, 12)
570579   MCFG_SOUND_ROUTE_EX(1, "discrete", 1.0, 13)
r15442r15443
723732}
724733
725734
726GAME( 1983, gyruss,   0,        gyruss,   gyruss,   gyruss, ROT90, "Konami", "Gyruss (Konami)", GAME_SUPPORTS_SAVE )
735GAME( 1983, gyruss,   0,        gyruss,   gyruss,   gyruss, ROT90, "Konami", "Gyruss", GAME_SUPPORTS_SAVE )
727736GAME( 1983, gyrussce, gyruss,   gyruss,   gyrussce, gyruss, ROT90, "Konami (Centuri license)", "Gyruss (Centuri)", GAME_SUPPORTS_SAVE )
728GAME( 1983, gyrussb,  gyruss,   gyruss,   gyruss,   gyruss, ROT90, "bootleg", "Gyruss", GAME_SUPPORTS_SAVE ) /* Supposed Taito NZ license, but (c) Konami */
729GAME( 1983, venus,    gyruss,   gyruss,   gyruss,   gyruss, ROT90, "bootleg", "Venus", GAME_SUPPORTS_SAVE )
737GAME( 1983, gyrussb,  gyruss,   gyruss,   gyruss,   gyruss, ROT90, "bootleg?", "Gyruss (bootleg?)", GAME_SUPPORTS_SAVE ) /* Supposed Taito NZ license, but (c) Konami */
738GAME( 1983, venus,    gyruss,   gyruss,   gyruss,   gyruss, ROT90, "bootleg", "Venus (bootleg of Gyruss)", GAME_SUPPORTS_SAVE )
src/mame/drivers/dec8.c
r15442r15443
36623662GAME( 1987, meikyuha, ghostb,   ghostb,   meikyuh,   meikyuh,     ROT0,   "Data East Corporation", "Meikyuu Hunter G (Japan, set 2)", GAME_SUPPORTS_SAVE )
36633663GAME( 1987, csilver,  0,        csilver,  csilver,   csilver,     ROT0,   "Data East Corporation", "Captain Silver (World)", GAME_SUPPORTS_SAVE )
36643664GAME( 1987, csilverj, csilver,  csilver,  csilverj,  csilver,     ROT0,   "Data East Corporation", "Captain Silver (Japan)", GAME_SUPPORTS_SAVE )
3665GAME( 1987, oscar,    0,        oscar,    oscar,     oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (World revision 0)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
3666GAME( 1988, oscaru,   oscar,    oscar,    oscarj,    oscar,       ROT0,   "Data East USA", "Psycho-Nics Oscar (US)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
3667GAME( 1987, oscarj1,  oscar,    oscar,    oscarj,    oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 1)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
3668GAME( 1987, oscarj2,  oscar,    oscar,    oscarj,    oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 2)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
3665GAME( 1987, oscar,    0,        oscar,    oscar,     oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (World revision 0)", GAME_SUPPORTS_SAVE )
3666GAME( 1988, oscaru,   oscar,    oscar,    oscarj,    oscar,       ROT0,   "Data East USA", "Psycho-Nics Oscar (US)", GAME_SUPPORTS_SAVE )
3667GAME( 1987, oscarj1,  oscar,    oscar,    oscarj,    oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 1)", GAME_SUPPORTS_SAVE )
3668GAME( 1987, oscarj2,  oscar,    oscar,    oscarj,    oscar,       ROT0,   "Data East Corporation", "Psycho-Nics Oscar (Japan revision 2)", GAME_SUPPORTS_SAVE )
36693669GAME( 1987, srdarwin, 0,        srdarwin, srdarwin,  srdarwin,    ROT270, "Data East Corporation", "Super Real Darwin (World)", GAME_SUPPORTS_SAVE )
36703670GAME( 1987, srdarwinj,srdarwin, srdarwin, srdarwinj, srdarwin,    ROT270, "Data East Corporation", "Super Real Darwin (Japan)", GAME_SUPPORTS_SAVE )
3671GAME( 1988, cobracom, 0,        cobracom, cobracom,  cobracom,    ROT0,   "Data East Corporation", "Cobra-Command (World revision 5)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
3672GAME( 1988, cobracomj,cobracom, cobracom, cobracom,  cobracom,    ROT0,   "Data East Corporation", "Cobra-Command (Japan)", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
3671GAME( 1988, cobracom, 0,        cobracom, cobracom,  cobracom,    ROT0,   "Data East Corporation", "Cobra-Command (World revision 5)", GAME_SUPPORTS_SAVE )
3672GAME( 1988, cobracomj,cobracom, cobracom, cobracom,  cobracom,    ROT0,   "Data East Corporation", "Cobra-Command (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/rabbit.c
r15442r15443
167167         case 0xc:
168168            tileno += 0x20000;
169169            break;
170         
170
171171         default:
172172            //printf("tilebank %x\n",bank);
173173            break;
src/osd/sdl/sdlmain.c
r15442r15443
115115   { SDLOPTION_CENTERV,                      "1",        OPTION_BOOLEAN,    "center vertically within the view area" },
116116   #if (SDL_VERSION_ATLEAST(1,2,10))
117117   { SDLOPTION_WAITVSYNC ";vs",              "0",        OPTION_BOOLEAN,    "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" },
118   { SDLOPTION_SYNCREFRESH ";sr",            "0",        OPTION_BOOLEAN,    "enable using the start of VBLANK for throttling instead of the game time" },
118   { SDLOPTION_SYNCREFRESH ";srf",           "0",        OPTION_BOOLEAN,    "enable using the start of VBLANK for throttling instead of the game time" },
119119   #endif
120120#if (SDLMAME_SDL2)
121121   { SDLOPTION_SCALEMODE ";sm",         SDLOPTVAL_NONE,  OPTION_STRING,     "Scale mode: none, hwblit, hwbest, yv12, yuy2, yv12x2, yuy2x2 (-video soft only)" },
src/osd/windows/winmain.c
r15442r15443
318318   { WINOPTION_KEEPASPECT ";ka",                     "1",        OPTION_BOOLEAN,    "constrain to the proper aspect ratio" },
319319   { WINOPTION_PRESCALE,                             "1",        OPTION_INTEGER,    "scale screen rendering by this amount in software" },
320320   { WINOPTION_WAITVSYNC ";vs",                      "0",        OPTION_BOOLEAN,    "enable waiting for the start of VBLANK before flipping screens; reduces tearing effects" },
321   { WINOPTION_SYNCREFRESH ";sr",                    "0",        OPTION_BOOLEAN,    "enable using the start of VBLANK for throttling instead of the game time" },
321   { WINOPTION_SYNCREFRESH ";srf",                   "0",        OPTION_BOOLEAN,    "enable using the start of VBLANK for throttling instead of the game time" },
322322   { WINOPTION_MENU,                               "0",        OPTION_BOOLEAN,    "enable menu bar if available by UI implementation" },
323323
324324   // DirectDraw-specific options
src/emu/cpu/i8008/i8008.c
r15442r15443
9595   astring tempstr;
9696   for (int addrnum = 0; addrnum < 8; addrnum++)
9797      state_add(I8008_ADDR1 + addrnum, tempstr.format("ADDR%d", addrnum + 1), m_ADDR[addrnum].w.l).mask(0xfff);
98   
98
9999   init_tables();
100100}
101101
src/emu/cpu/i8008/i8008.h
r15442r15443
3939   virtual UINT32 execute_max_cycles() const;
4040   virtual void execute_run();
4141   virtual void execute_set_input(int inputnum, int state);
42   
42
4343   // device_memory_interface overrides
4444   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
45   
45
4646   // device_state_interface overrides
4747   virtual void state_import(const device_state_entry &entry);
4848   virtual void state_export(const device_state_entry &entry);
r15442r15443
5353   virtual UINT32 disasm_min_opcode_bytes() const;
5454   virtual UINT32 disasm_max_opcode_bytes() const;
5555   virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
56   
56
5757   virtual void execute_one(int opcode);
5858
5959   void push_stack();
r15442r15443
6868   void illegal(UINT8 opcode);
6969   void take_interrupt();
7070   void init_tables(void);
71   
71
7272   int   m_pc_pos; // PC possition in ADDR
7373   int   m_icount;
74   
74
7575   // configuration
7676   const address_space_config      m_program_config;
7777   const address_space_config      m_io_config;
r15442r15443
8585   UINT8   m_PF; // Parity flag
8686   UINT8   m_HALT;
8787   UINT8   m_flags; // temporary I/O only
88   
88
8989   UINT8   m_irq_state;
90   
90
9191   UINT8 m_PARITY[256];
92   
92
9393   address_space *m_program;
9494   address_space *m_io;
9595   direct_read_data *m_direct;
src/emu/sound/ym2413.c
r15442r15443
17511751         }
17521752         else
17531753         {
1754            if ((chip->rhythm&0x20)==1)
1754            if (chip->rhythm&0x20)
17551755            /*rhythm on to off*/
17561756            {
17571757               logerror("YM2413: Rhythm mode disable\n");
src/emu/sound/pokey.c
r15442r15443
259259   vol_init();
260260
261261   /* The pokey does not have a reset line. These should be initialized
262    * with random values.
263    */
262     * with random values.
263     */
264264
265265   m_KBCODE = 0x09;       /* Atari 800 'no key' */
266266   m_SKCTL = SK_RESET;    /* let the RNG run after reset */
r15442r15443
454454   do
455455   {
456456      // debugging
457      //m_ppc = m_pc;   // copy PC to previous PC
457      //m_ppc = m_pc; // copy PC to previous PC
458458      if (check_debugger)
459459         debugger_instruction_hook(this, 0); //m_pc);
460460
r15442r15443
728728      out = (out > 0x7fff) ? 0x7fff : out;
729729      while( samples > 0 )
730730      {
731             *buffer++ = out;
732             samples--;
731          *buffer++ = out;
732          samples--;
733733      }
734734   }
735735   else if (m_output_type == RC_LOWPASS)
r15442r15443
741741
742742      while( samples > 0 )
743743      {
744             /* store sum of output signals into the buffer */
745             m_out_filter += (V0 - m_out_filter) * mult;
746             *buffer++ = m_out_filter;
747             samples--;
744          /* store sum of output signals into the buffer */
745          m_out_filter += (V0 - m_out_filter) * mult;
746          *buffer++ = m_out_filter;
747          samples--;
748748
749749      }
750750   }
751751   else if (m_output_type == OPAMP_C_TO_GROUND)
752752   {
753753      double rTot = m_voltab[m_output];
754          /* In this configuration there is a capacitor in parallel to the pokey output to ground.
755           * With a LM324 in LTSpice this causes the opamp circuit to oscillate at around 100 kHz.
756           * We are ignoring the capacitor here, since this oscillation would not be audible.
757           */
754       /* In this configuration there is a capacitor in parallel to the pokey output to ground.
755         * With a LM324 in LTSpice this causes the opamp circuit to oscillate at around 100 kHz.
756         * We are ignoring the capacitor here, since this oscillation would not be audible.
757         */
758758
759          /* This post-pokey stage usually has a high-pass filter behind it
760           * It is approximated by eliminating m_v_ref ( -1.0 term)
761           */
759       /* This post-pokey stage usually has a high-pass filter behind it
760         * It is approximated by eliminating m_v_ref ( -1.0 term)
761         */
762762
763763      double V0 = ((rTot+m_r_pullup) / rTot - 1.0) * m_v_ref  / 5.0 * 32767.0;
764764
765765      while( samples > 0 )
766766      {
767             /* store sum of output signals into the buffer */
768             *buffer++ = V0;
769             samples--;
767          /* store sum of output signals into the buffer */
768          *buffer++ = V0;
769          samples--;
770770
771771      }
772772   }
773773   else if (m_output_type == OPAMP_LOW_PASS)
774774   {
775775      double rTot = m_voltab[m_output];
776          /* This post-pokey stage usually has a low-pass filter behind it
777           * It is approximated by not adding in VRef below.
778           */
776       /* This post-pokey stage usually has a low-pass filter behind it
777         * It is approximated by not adding in VRef below.
778         */
779779
780780      double V0 = (m_r_pullup / rTot) * m_v_ref  / 5.0 * 32767.0;
781781      double mult = (m_cap == 0.0) ? 1.0 : 1.0 - exp(-1.0 / (m_cap * m_r_pullup) * m_clock_period.as_double());
782782
783783      while( samples > 0 )
784784      {
785             /* store sum of output signals into the buffer */
786             m_out_filter += (V0 - m_out_filter) * mult;
787             *buffer++ = m_out_filter /* + m_v_ref */;      // see above
788             samples--;
785          /* store sum of output signals into the buffer */
786          m_out_filter += (V0 - m_out_filter) * mult;
787          *buffer++ = m_out_filter /* + m_v_ref */;      // see above
788          samples--;
789789      }
790790   }
791791   else if (m_output_type == DISCRETE_VAR_R)
r15442r15443
793793      INT32 out = m_voltab[m_output];
794794      while( samples > 0 )
795795      {
796             *buffer++ = out;
797             samples--;
796          *buffer++ = out;
797          samples--;
798798      }
799799   }
800800}
r15442r15443
11121112         if (r == 0)
11131113         {
11141114            /* immediately set the ready - bit of m_ALLPOT
1115             * In this case, most likely no capacitor is connected
1116             */
1115                 * In this case, most likely no capacitor is connected
1116                 */
11171117            m_ALLPOT |= (1<<pot);
11181118         }
11191119
r15442r15443
11281128   double resistors[4] = {90000, 26500, 8050, 3400};
11291129   double pull_up = 10000;
11301130   /* just a guess, there has to be a resistance since the doc specifies that
1131    * Vout is at least 4.2V if all channels turned off.
1132    */
1131     * Vout is at least 4.2V if all channels turned off.
1132     */
11331133   double r_off = 8e6;
11341134   double r_chan[16];
11351135   double rTot;
r15442r15443
12761276
12771277pokey_device::pokey_channel::pokey_channel()
12781278   :   m_AUDF(0),
1279       m_AUDC(0),
1279      m_AUDC(0),
12801280      m_borrow_cnt(0),
1281       m_counter(0),
1282       m_output(0),
1283       m_filter_sample(0),
1284       m_div2(0)
1281      m_counter(0),
1282      m_output(0),
1283      m_filter_sample(0),
1284      m_div2(0)
12851285{
12861286}
12871287
src/emu/sound/pokey.h
r15442r15443
180180
181181   enum /* sync-operations */
182182   {
183      SYNC_NOOP       = 11,
184      SYNC_SET_IRQST    = 12,
183      SYNC_NOOP      = 11,
184      SYNC_SET_IRQST   = 12,
185185      SYNC_POT      = 13,
186186      SYNC_WRITE      = 14
187187   };
src/emu/uimain.c
r15442r15443
412412      if (idx==-2) idx = slot_get_length(slot) -1;
413413      if (idx==-1) return "";
414414      if (slot->get_slot_interfaces()[idx].internal) idx--;
415   } while (slot->get_slot_interfaces()[idx].internal);   
415   } while (slot->get_slot_interfaces()[idx].internal);
416416   return slot->get_slot_interfaces()[idx].name;
417417}
418418
r15442r15443
479479   if (menu_event != NULL && menu_event->itemref != NULL)
480480   {
481481      if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT) {
482         device_slot_interface *slot = (device_slot_interface *)menu_event->itemref;         
482         device_slot_interface *slot = (device_slot_interface *)menu_event->itemref;
483483         const char *val = (menu_event->iptkey == IPT_UI_LEFT) ? slot_get_prev(slot) : slot_get_next(slot);
484484         set_slot_device(slot,val);
485485         reset(UI_MENU_RESET_REMEMBER_REF);
src/emu/machine/ram.c
r15442r15443
168168      mame_printf_warning("Setting value to default %s\n",m_default_size);
169169      astring error;
170170      mconfig().options().set_value(OPTION_RAMSIZE, m_default_size, OPTION_PRIORITY_CMDLINE, error);
171      assert(!error);   
171      assert(!error);
172172   }
173173}
174174
src/emu/machine/mc2661.c
r15442r15443
309309
310310   case REGISTER_SYNC:
311311      if (LOG) logerror("MC2661 '%s' Sync Register %u: %02x\n", tag(), m_sync_index + 1, data);
312     
312
313313      m_sync[m_sync_index] = data;
314314
315315      m_sync_index++;
r15442r15443
329329
330330         switch (MODE_STOP_BITS)
331331         {
332         case STOP_BITS_1:    stop_bits = 1;       break;
333         case STOP_BITS_1_5: stop_bits = 1.5;    break;
334         case STOP_BITS_2:    stop_bits = 2;       break;
332         case STOP_BITS_1:   stop_bits = 1;      break;
333         case STOP_BITS_1_5: stop_bits = 1.5;   break;
334         case STOP_BITS_2:   stop_bits = 2;      break;
335335         }
336336
337337         if (!MODE_PARITY) parity_code = SERIAL_PARITY_NONE;
338338         else if (MODE_PARITY_EVEN) parity_code = SERIAL_PARITY_EVEN;
339339         else parity_code = SERIAL_PARITY_ODD;
340340
341         set_data_frame(word_length, stop_bits, parity_code);         
341         set_data_frame(word_length, stop_bits, parity_code);
342342      }
343343
344344      m_mode_index++;
src/emu/machine/mc2661.h
r15442r15443
108108   inline void receive();
109109   inline void transmit();
110110
111   enum
111   enum
112112   {
113113      TIMER_RX,
114114      TIMER_TX
src/emu/machine/68681.c
r15442r15443
289289
290290UINT16 duart68681_get_ct_count(duart68681_state *duart68681)
291291{
292   double clock = duart68681_get_ct_rate(duart68681);   
292   double clock = duart68681_get_ct_rate(duart68681);
293293   return (duart68681->duart_timer->remaining() * clock).as_double();
294294}
295295
296296void duart68681_start_ct(duart68681_state *duart68681, int count)
297297{
298   double clock = duart68681_get_ct_rate(duart68681);   
298   double clock = duart68681_get_ct_rate(duart68681);
299299   duart68681->duart_timer->adjust(attotime::from_hz(clock) * count, 0);
300300}
301301
r15442r15443
600600      case 0x05: /* ISR */
601601         r = duart68681->ISR;
602602         break;
603         
603
604604      case 0x06: /* CUR */
605605         r = duart68681_get_ct_count(duart68681) >> 8;
606606         break;
r15442r15443
608608      case 0x07: /* CLR */
609609         r = duart68681_get_ct_count(duart68681) & 0xff;
610610         break;
611           
611
612612      case 0x08: /* MR1B/MR2B */
613613         if ( duart68681->channel[1].MR_ptr == 0 )
614614         {
src/emu/machine/im6402.c
r15442r15443
7474inline void im6402_device::receive_bit(int state)
7575{
7676   if (LOG) logerror("IM6402 '%s' Receive Bit %u\n", tag(), state);
77   
77
7878   receive_register_update_bit(state);
7979 
8080   if (is_receive_register_full())
8181   {
8282      receive_register_extract();
8383      m_rbr = get_received_char();
84     
84
8585      if (LOG) logerror("IM6402 '%s' Receive Data %02x\n", tag(), m_rbr);
8686 
8787      if (m_dr)
r15442r15443
9090      }
9191 
9292      set_dr(ASSERT_LINE);
93   }   
93   }
9494}
9595 
9696 
r15442r15443
283283void im6402_device::input_callback(UINT8 state)
284284{
285285   int bit = (state & SERIAL_STATE_RX_DATA) ? 1 : 0;
286   
286
287287   receive_bit(bit);
288288}
289289 
r15442r15443
496496WRITE_LINE_MEMBER( im6402_device::sbs_w )
497497{
498498   if (LOG) logerror("IM6402 '%s' Stop Bit Select %u\n", tag(), state);
499   
499
500500   m_sbs = state;
501501}
502502 
r15442r15443
520520WRITE_LINE_MEMBER( im6402_device::cls2_w )
521521{
522522   if (LOG) logerror("IM6402 '%s' Character Length Select 2 %u\n", tag(), state);
523   
523
524524   m_cls2 = state;
525525}
526526 
src/emu/machine/im6402.h
r15442r15443
130130   inline void receive();
131131   inline void transmit();
132132 
133   enum
133   enum
134134   {
135135      TIMER_RX,
136136      TIMER_TX
src/emu/machine/am9517a.c
r15442r15443
99 
1010/*
1111 
12   TODO:
12    TODO:
1313 
14   - memory-to-memory transfer
15   - external EOP
14    - memory-to-memory transfer
15    - external EOP
1616 
1717*/
1818 
r15442r15443
271271      if (MODE_ADDRESS_DECREMENT)
272272      {
273273         m_channel[m_current_channel].m_address--;
274         
274
275275         if ((m_channel[m_current_channel].m_address & 0xff) == 0xff)
276276         {
277277            msb_changed = true;
r15442r15443
280280      else
281281      {
282282         m_channel[m_current_channel].m_address++;
283         
283
284284         if ((m_channel[m_current_channel].m_address & 0xff) == 0x00)
285285         {
286286            msb_changed = true;
r15442r15443
314314         set_dack();
315315         m_state = STATE_SI;
316316         break;
317         
317
318318      case MODE_BLOCK:
319319         m_state = get_state1(msb_changed);
320320         break;
321         
321
322322      case MODE_CASCADE:
323323         break;
324324      }
r15442r15443
514514         {
515515            m_current_channel = -1;
516516            m_state = STATE_SI;
517         }
517         }
518518 
519519         set_dack();
520520         break;
r15442r15443
527527         set_dack();
528528         m_state = COMMAND_COMPRESSED_TIMING ? STATE_S4 : STATE_S3;
529529         break;
530         
530
531531      case STATE_S3:
532532         dma_read();
533533 
534534         if (COMMAND_EXTENDED_WRITE)
535535         {
536            dma_write();         
536            dma_write();
537537         }
538538 
539539         m_state = m_ready ? STATE_S4 : STATE_SW;
r15442r15443
542542      case STATE_SW:
543543         m_state = m_ready ? STATE_S4 : STATE_SW;
544544         break;
545         
545
546546      case STATE_S4:
547547         if (COMMAND_COMPRESSED_TIMING)
548548         {
r15442r15443
556556 
557557         dma_advance();
558558         break;
559         
559
560560      case STATE_S11:
561561         m_current_channel = 0;
562562 
r15442r15443
570570      case STATE_S13:
571571         m_state = STATE_S14;
572572         break;
573         
573
574574      case STATE_S14:
575575         dma_read();
576576 
577577         m_state = STATE_S21;
578578         break;
579         
579
580580      case STATE_S21:
581581         m_current_channel = 1;
582582 
583583         m_state = STATE_S22;
584584         break;
585         
585
586586      case STATE_S22:
587587         m_state = STATE_S23;
588588         break;
589         
589
590590      case STATE_S23:
591591         m_state = STATE_S24;
592592         break;
593         
593
594594      case STATE_S24:
595595         dma_write();
596596         dma_advance();
r15442r15443
603603 
604604 
605605//-------------------------------------------------
606//  read -
606//  read -
607607//-------------------------------------------------
608608 
609609READ8_MEMBER( am9517a_device::read )
r15442r15443
655655      case REGISTER_TEMPORARY:
656656         data = m_temp;
657657         break;
658     
658
659659      case REGISTER_MASK:
660660         data = m_mask;
661661         break;
r15442r15443
667667 
668668 
669669//-------------------------------------------------
670//  write -
670//  write -
671671//-------------------------------------------------
672672 
673673WRITE8_MEMBER( am9517a_device::write )
r15442r15443
675675   if (!BIT(offset, 3))
676676   {
677677      int channel = (offset >> 1) & 0x03;
678     
678
679679      switch (offset & 0x01)
680680      {
681681      case REGISTER_ADDRESS:
r15442r15443
737737            if (LOG) logerror("AM9517A '%s' Request Register: %01x\n", tag(), m_request);
738738         }
739739         break;
740         
740
741741      case REGISTER_SINGLE_MASK:
742742         {
743743            int channel = data & 0x03;
r15442r15443
754754            if (LOG) logerror("AM9517A '%s' Mask Register: %01x\n", tag(), m_mask);
755755         }
756756         break;
757         
757
758758      case REGISTER_MODE:
759759         {
760760            int channel = data & 0x03;
r15442r15443
767767            if (LOG) logerror("AM9517A '%s' Channel %u Mode: %02x\n", tag(), channel, data & 0xfc);
768768         }
769769         break;
770         
770
771771      case REGISTER_BYTE_POINTER:
772772         if (LOG) logerror("AM9517A '%s' Clear Byte Pointer Flip-Flop\n", tag());
773773 
774774         m_msb = 0;
775775         break;
776         
776
777777      case REGISTER_MASTER_CLEAR:
778778         if (LOG) logerror("AM9517A '%s' Master Clear\n", tag());
779         
779
780780         device_reset();
781781         break;
782         
782
783783      case REGISTER_CLEAR_MASK:
784784         if (LOG) logerror("AM9517A '%s' Clear Mask Register\n", tag());
785785 
786786         m_mask = 0;
787787         break;
788         
788
789789      case REGISTER_MASK:
790790         m_mask = data & 0x0f;
791791 
src/emu/machine/am9517a.h
r15442r15443
1/***************************************************************************
2
3    AMD AM9517A/8237A Multimode DMA Controller emulation
4
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8****************************************************************************
9                            _____   _____
10                  _IOR   1 |*    \_/     | 40  A7
11                  _IOW   2 |             | 39  A6
12                 _MEMR   3 |             | 38  A5
13                 _MEMW   4 |             | 37  A4
14                     *   5 |             | 36  _EOP
15                 READY   6 |             | 35  A3
16                  HACK   7 |             | 34  A2
17                 ADSTB   8 |             | 33  A1
18                   AEN   9 |             | 32  A0
19                  HREQ  10 |   AM9517A   | 31  Vcc
20                   _CS  11 |    8237A    | 30  DB0
21                   CLK  12 |             | 29  DB1
22                 RESET  13 |             | 28  DB2
23                 DACK2  14 |             | 27  DB3
24                 DACK3  15 |             | 26  DB4
25                 DREQ3  16 |             | 25  DACK0
26                 DREQ2  17 |             | 24  DACK1
27                 DREQ1  18 |             | 23  DB5
28                 DREQ0  19 |             | 22  DB6
29                   Vss  20 |_____________| 21  DB7
30
31***************************************************************************/
32
33#pragma once
34
35#ifndef __AM9517A__
36#define __AM9517A__
37
38#include "emu.h"
39
40
41
42/***************************************************************************
43    DEVICE CONFIGURATION MACROS
44***************************************************************************/
45
46#define MCFG_AM9517A_ADD(_tag, _clock, _config) \
47   MCFG_DEVICE_ADD(_tag, AM9517A, _clock) \
48   MCFG_DEVICE_CONFIG(_config)
49
50#define MCFG_I8237_ADD(_tag, _clock, _config) \
51   MCFG_DEVICE_ADD(_tag, AM9517A, _clock) \
52   MCFG_DEVICE_CONFIG(_config)
53
54
55#define AM9517A_INTERFACE(_name) \
56   const am9517a_interface (_name) =
57
58#define I8237_INTERFACE(_name) \
59   const am9517a_interface (_name) =
60
61
62
63/***************************************************************************
64    TYPE DEFINITIONS
65***************************************************************************/
66
67// ======================> am9517a_interface
68
69struct am9517a_interface
70{
71   devcb_write_line   m_out_hreq_cb;
72   devcb_write_line   m_out_eop_cb;
73
74   devcb_read8         m_in_memr_cb;
75   devcb_write8      m_out_memw_cb;
76
77   devcb_read8         m_in_ior_cb[4];
78   devcb_write8      m_out_iow_cb[4];
79   devcb_write_line   m_out_dack_cb[4];
80};
81
82
83// ======================> am9517a_device
84
85class am9517a_device :  public device_t,
86                   public device_execute_interface,
87                   public am9517a_interface
88{
89public:
90   // construction/destruction
91   am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
92
93   DECLARE_READ8_MEMBER( read );
94   DECLARE_WRITE8_MEMBER( write );
95
96   DECLARE_WRITE_LINE_MEMBER( hack_w );
97   DECLARE_WRITE_LINE_MEMBER( ready_w );
98   DECLARE_WRITE_LINE_MEMBER( eop_w );
99
100   DECLARE_WRITE_LINE_MEMBER( dreq0_w );
101   DECLARE_WRITE_LINE_MEMBER( dreq1_w );
102   DECLARE_WRITE_LINE_MEMBER( dreq2_w );
103   DECLARE_WRITE_LINE_MEMBER( dreq3_w );
104
105protected:
106   // device-level overrides
107   virtual void device_config_complete();
108   virtual void device_start();
109   virtual void device_reset();
110   virtual void execute_run();
111
112    int m_icount;
113
114private:
115   inline void dma_request(int channel, int state);
116   inline bool is_request_active(int channel);
117   inline bool is_software_request_active(int channel);
118   inline void set_hreq(int state);
119   inline void set_dack();
120   inline void set_eop(int state);
121   inline int get_state1(bool msb_changed);
122   inline void dma_read();
123   inline void dma_write();
124   inline void dma_advance();
125   inline void end_of_process();
126
127   devcb_resolved_write_line   m_out_hreq_func;
128   devcb_resolved_write_line   m_out_eop_func;
129   devcb_resolved_read8      m_in_memr_func;
130   devcb_resolved_write8      m_out_memw_func;
131   
132   struct
133   {
134      devcb_resolved_read8      m_in_ior_func;
135      devcb_resolved_write8      m_out_iow_func;
136      devcb_resolved_write_line   m_out_dack_func;
137
138      UINT16 m_address;
139      UINT16 m_count;
140      UINT16 m_base_address;
141      UINT16 m_base_count;
142      UINT8 m_mode;
143   } m_channel[4];
144
145   int m_msb;
146   int m_hreq;
147   int m_hack;
148   int m_ready;
149   int m_eop;
150   int m_state;
151   int m_current_channel;
152   int m_last_channel;
153   UINT8 m_command;
154   UINT8 m_mask;
155   UINT8 m_status;
156   UINT8 m_temp;
157   UINT8 m_request;
158};
159
160
161// device type definition
162extern const device_type AM9517A;
163
164 
165
166#endif
1/***************************************************************************
2 
3    AMD AM9517A/8237A Multimode DMA Controller emulation
4 
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8****************************************************************************
9                            _____   _____
10                  _IOR   1 |*    \_/     | 40  A7
11                  _IOW   2 |             | 39  A6
12                 _MEMR   3 |             | 38  A5
13                 _MEMW   4 |             | 37  A4
14                     *   5 |             | 36  _EOP
15                 READY   6 |             | 35  A3
16                  HACK   7 |             | 34  A2
17                 ADSTB   8 |             | 33  A1
18                   AEN   9 |             | 32  A0
19                  HREQ  10 |   AM9517A   | 31  Vcc
20                   _CS  11 |    8237A    | 30  DB0
21                   CLK  12 |             | 29  DB1
22                 RESET  13 |             | 28  DB2
23                 DACK2  14 |             | 27  DB3
24                 DACK3  15 |             | 26  DB4
25                 DREQ3  16 |             | 25  DACK0
26                 DREQ2  17 |             | 24  DACK1
27                 DREQ1  18 |             | 23  DB5
28                 DREQ0  19 |             | 22  DB6
29                   Vss  20 |_____________| 21  DB7
30 
31***************************************************************************/
32 
33#pragma once
34 
35#ifndef __AM9517A__
36#define __AM9517A__
37 
38#include "emu.h"
39 
40 
41 
42/***************************************************************************
43    DEVICE CONFIGURATION MACROS
44***************************************************************************/
45 
46#define MCFG_AM9517A_ADD(_tag, _clock, _config) \
47   MCFG_DEVICE_ADD(_tag, AM9517A, _clock) \
48   MCFG_DEVICE_CONFIG(_config)
49 
50#define MCFG_I8237_ADD(_tag, _clock, _config) \
51   MCFG_DEVICE_ADD(_tag, AM9517A, _clock) \
52   MCFG_DEVICE_CONFIG(_config)
53 
54 
55#define AM9517A_INTERFACE(_name) \
56   const am9517a_interface (_name) =
57 
58#define I8237_INTERFACE(_name) \
59   const am9517a_interface (_name) =
60 
61 
62 
63/***************************************************************************
64    TYPE DEFINITIONS
65***************************************************************************/
66 
67// ======================> am9517a_interface
68 
69struct am9517a_interface
70{
71   devcb_write_line   m_out_hreq_cb;
72   devcb_write_line   m_out_eop_cb;
73 
74   devcb_read8         m_in_memr_cb;
75   devcb_write8      m_out_memw_cb;
76 
77   devcb_read8         m_in_ior_cb[4];
78   devcb_write8      m_out_iow_cb[4];
79   devcb_write_line   m_out_dack_cb[4];
80};
81 
82 
83// ======================> am9517a_device
84 
85class am9517a_device :  public device_t,
86                   public device_execute_interface,
87                   public am9517a_interface
88{
89public:
90   // construction/destruction
91   am9517a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
92 
93   DECLARE_READ8_MEMBER( read );
94   DECLARE_WRITE8_MEMBER( write );
95 
96   DECLARE_WRITE_LINE_MEMBER( hack_w );
97   DECLARE_WRITE_LINE_MEMBER( ready_w );
98   DECLARE_WRITE_LINE_MEMBER( eop_w );
99 
100   DECLARE_WRITE_LINE_MEMBER( dreq0_w );
101   DECLARE_WRITE_LINE_MEMBER( dreq1_w );
102   DECLARE_WRITE_LINE_MEMBER( dreq2_w );
103   DECLARE_WRITE_LINE_MEMBER( dreq3_w );
104 
105protected:
106   // device-level overrides
107   virtual void device_config_complete();
108   virtual void device_start();
109   virtual void device_reset();
110   virtual void execute_run();
111 
112    int m_icount;
113 
114private:
115   inline void dma_request(int channel, int state);
116   inline bool is_request_active(int channel);
117   inline bool is_software_request_active(int channel);
118   inline void set_hreq(int state);
119   inline void set_dack();
120   inline void set_eop(int state);
121   inline int get_state1(bool msb_changed);
122   inline void dma_read();
123   inline void dma_write();
124   inline void dma_advance();
125   inline void end_of_process();
126 
127   devcb_resolved_write_line   m_out_hreq_func;
128   devcb_resolved_write_line   m_out_eop_func;
129   devcb_resolved_read8      m_in_memr_func;
130   devcb_resolved_write8      m_out_memw_func;
131 
132   struct
133   {
134      devcb_resolved_read8      m_in_ior_func;
135      devcb_resolved_write8      m_out_iow_func;
136      devcb_resolved_write_line   m_out_dack_func;
137 
138      UINT16 m_address;
139      UINT16 m_count;
140      UINT16 m_base_address;
141      UINT16 m_base_count;
142      UINT8 m_mode;
143   } m_channel[4];
144 
145   int m_msb;
146   int m_hreq;
147   int m_hack;
148   int m_ready;
149   int m_eop;
150   int m_state;
151   int m_current_channel;
152   int m_last_channel;
153   UINT8 m_command;
154   UINT8 m_mask;
155   UINT8 m_status;
156   UINT8 m_temp;
157   UINT8 m_request;
158};
159 
160 
161// device type definition
162extern const device_type AM9517A;
163 
164 
165 
166#endif
src/emu/mconfig.c
r15442r15443
9696                     device_t *new_dev = device_add(&owner, intf[i].name, intf[i].devtype, is_default ? slot->default_clock() : 0);
9797                     found = true;
9898                     if (is_default) {
99                        device_t::static_set_input_default(*new_dev, slot->input_ports_defaults());                       
99                        device_t::static_set_input_default(*new_dev, slot->input_ports_defaults());
100100                        if (slot->default_config()) {
101101                           device_t::static_set_static_config(*new_dev, slot->default_config());
102102                        }
src/lib/formats/esq16_dsk.c
r15442r15443
33    formats/esq16_dsk.c
44
55    Formats for 16-bit Ensoniq synthesizers and samplers
6
6
77    Disk is PC MFM, 80 tracks, double-sided, with 10 sectors per track
88
99*********************************************************************/
src/lib/formats/esq16_dsk.h
r15442r15443
33    formats/esq16_dsk.h
44
55    Formats for 16-bit Ensoniq synthesizers and samplers
6
6
77    Disk is PC MFM, 80 tracks, double-sided, with 10 sectors per track
88
99*********************************************************************/
src/lib/util/options.c
r15442r15443
575575
576576
577577//-------------------------------------------------
578//  priority - return the priority of option
578//  priority - return the priority of option
579579//-------------------------------------------------
580580
581581int core_options::priority(const char *name) const
src/version.c
r15442r15443
3838***************************************************************************/
3939
4040extern const char build_version[];
41const char build_version[] = "0.146 ("__DATE__")";
41const char build_version[] = "0.146u1 ("__DATE__")";
src/mess/machine/isa_fdc.c
r15442r15443
360360      case 6: /* FDC reserved */
361361         hdd = device->machine().device(":board3:ide:ide");
362362         if (hdd)
363            data = ide_controller16_r(hdd, 0x3f6/2, 0x00ff);     
363            data = ide_controller16_r(hdd, 0x3f6/2, 0x00ff);
364364         break;
365365      case 7:
366366         device_t *dev = get_floppy_subdevice(device, fdc->digital_output_register & 0x03);
src/mess/machine/mc6854.c
r15442r15443
5959
6060typedef struct
6161{
62   devcb_resolved_write_line    out_irq_func;
63   devcb_resolved_read_line    in_rxd_func;
64   devcb_resolved_write_line    out_txd_func;
65   devcb_resolved_write_line    out_rts_func;
66   devcb_resolved_write_line    out_dtr_func;
62   devcb_resolved_write_line   out_irq_func;
63   devcb_resolved_read_line   in_rxd_func;
64   devcb_resolved_write_line   out_txd_func;
65   devcb_resolved_write_line   out_rts_func;
66   devcb_resolved_write_line   out_dtr_func;
6767
6868   /* interface */
6969   const mc6854_interface* iface;
src/mess/machine/esqvfd.c
r15442r15443
1919    0x0009, // 0000 0000 0000 1001 ".
2020    0xC62A, // 1100 0110 0010 1010 #.
2121    0xC62D, // 1100 0110 0010 1101 $.
22    0x0000, // 0000 0000 0000 0000 % (not defined)
23    0x0000, // 0000 0000 0000 0000 & (not defined)
22    0x0000, // 0000 0000 0000 0000 % (not defined)
23    0x0000, // 0000 0000 0000 0000 & (not defined)
2424    0x0040, // 0000 0000 1000 0000 '.
2525    0x0880, // 0000 1000 1000 0000 (.
2626    0x0050, // 0000 0000 0101 0000 ).
2727    0xCCD8, // 1100 1100 1101 1000 *.
2828    0xC408, // 1100 0100 0000 1000 +.
29    0x0000, // 0000 0000 0000 0000 , (not defined)
29    0x0000, // 0000 0000 0000 0000 , (not defined)
3030    0xC000, // 1100 0000 0000 0000 -.
3131    0x1000, // 0001 0000 0000 0000 .
3232    0x0090, // 0000 0000 1001 0000 /
src/mess/machine/laser128.c
r15442r15443
6666
6767void a2bus_laser128_device::device_reset()
6868{
69    m_rom = device().machine().root_device().memregion("maincpu")->base();
69    m_rom = device().machine().root_device().memregion("maincpu")->base();
7070    m_slot7_bank = 0;
7171}
7272
src/mess/machine/wangpc_lvc.c
r15442r15443
1/**********************************************************************
2
3    Wang PC Low-Resolution Video Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11   
12   TODO:
13
14   - cursor
15   - scroll
16   - option bit 1?
17
18*/
19
20#include "wangpc_lvc.h"
21
22
23
24//**************************************************************************
25//  MACROS/CONSTANTS
26//**************************************************************************
27
28#define LOG 0
29
30#define OPTION_ID      0x10
31
32#define MC6845_TAG      "mc6845"
33#define SCREEN_TAG      "screen"
34
35#define RAM_SIZE      0x8000
36
37#define OPTION_VRAM      BIT(m_option, 0)
38#define OPTION_UNKNOWN   BIT(m_option, 1)
39#define OPTION_80_COL   BIT(m_option, 2)
40#define OPTION_VSYNC   BIT(m_option, 3)
41
42
43
44//**************************************************************************
45//  DEVICE DEFINITIONS
46//**************************************************************************
47
48const device_type WANGPC_LVC = &device_creator<wangpc_lvc_device>;
49
50
51//-------------------------------------------------
52//  mc6845_interface crtc_intf
53//-------------------------------------------------
54
55void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
56{
57   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
58
59   offs_t scroll_y = (((m_scroll >> 8) + 0x15) & 0xff) * 0x80;
60
61   if (OPTION_80_COL)
62   {
63       for (int column = 0; column < x_count; column++)
64       {
65          offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
66           UINT16 data = m_video_ram[addr & 0x7fff];
67
68           for (int bit = 0; bit < 8; bit++)
69           {
70               int x = (column * 8) + bit;
71               int color = (BIT(data, 15) << 1) | BIT(data, 7);
72
73               if (column == cursor_x) color = 0x03;
74
75               bitmap.pix32(y, x) = palette[color];
76
77               data <<= 1;
78           }
79       }
80   }
81   else
82   {
83       //offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + ((ma / 40) * 0x480) + (((ra & 0x0f) << 7));
84       offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + (y * 0x80);
85
86       for (int column = 0; column < x_count; column++)
87       {
88           UINT32 data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff];
89
90           for (int bit = 0; bit < 8; bit++)
91           {
92               int x = (column * 8) + bit;
93               int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7);
94
95               if (column == cursor_x) color = 0x03;
96
97               bitmap.pix32(y, x) = palette[color];
98
99               data <<= 1;
100           }
101
102           addr += 2;
103       }
104   }
105}
106
107static MC6845_UPDATE_ROW( wangpc_lvc_update_row )
108{
109   wangpc_lvc_device *lvc = downcast<wangpc_lvc_device *>(device->owner());
110
111   lvc->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param);
112}
113
114WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w )
115{
116   if (OPTION_VSYNC && state)
117   {
118      set_irq(ASSERT_LINE);
119   }
120}
121
122static const mc6845_interface crtc_intf =
123{
124   SCREEN_TAG,
125   8,
126   NULL,
127   wangpc_lvc_update_row,
128   NULL,
129   DEVCB_NULL,
130   DEVCB_NULL,
131   DEVCB_NULL,
132   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_lvc_device, vsync_w),
133   NULL
134};
135
136
137//-------------------------------------------------
138//  MACHINE_CONFIG_FRAGMENT( wangpc_lvc )
139//-------------------------------------------------
140
141static MACHINE_CONFIG_FRAGMENT( wangpc_lvc )
142   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
143   MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
144   MCFG_SCREEN_SIZE(80*8, 25*9)
145   MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*9-1)
146   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
147   MCFG_SCREEN_REFRESH_RATE(60)
148
149   MCFG_PALETTE_LENGTH(16)
150
151   MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf)
152MACHINE_CONFIG_END
153
154
155//-------------------------------------------------
156//  machine_config_additions - device-specific
157//  machine configurations
158//-------------------------------------------------
159
160machine_config_constructor wangpc_lvc_device::device_mconfig_additions() const
161{
162   return MACHINE_CONFIG_NAME( wangpc_lvc );
163}
164
165
166
167//**************************************************************************
168//  INLINE HELPERS
169//**************************************************************************
170
171//-------------------------------------------------
172//  set_irq -
173//-------------------------------------------------
174
175inline void wangpc_lvc_device::set_irq(int state)
176{
177   m_irq = state;
178
179   m_bus->irq3_w(m_irq);
180}
181
182
183
184//**************************************************************************
185//  LIVE DEVICE
186//**************************************************************************
187
188//-------------------------------------------------
189//  wangpc_lvc_device - constructor
190//-------------------------------------------------
191
192wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
193   device_t(mconfig, WANGPC_LVC, "Wang PC Low Resolution Video Card", tag, owner, clock),
194   device_wangpcbus_card_interface(mconfig, *this),
195   m_crtc(*this, MC6845_TAG),
196   m_option(0),
197   m_irq(CLEAR_LINE)
198{
199}
200
201
202//-------------------------------------------------
203//  device_start - device-specific startup
204//-------------------------------------------------
205
206void wangpc_lvc_device::device_start()
207{
208   // allocate memory
209   m_video_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE);
210
211   // state saving
212   save_pointer(NAME(m_video_ram), RAM_SIZE);
213   save_item(NAME(m_option));
214   save_item(NAME(m_scroll));
215   save_item(NAME(m_irq));
216}
217
218
219//-------------------------------------------------
220//  device_reset - device-specific reset
221//-------------------------------------------------
222
223void wangpc_lvc_device::device_reset()
224{
225   m_option = 0;
226
227   set_irq(CLEAR_LINE);
228}
229
230
231//-------------------------------------------------
232//  wangpcbus_mrdc_r - memory read
233//-------------------------------------------------
234
235UINT16 wangpc_lvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
236{
237   UINT16 data = 0xffff;
238
239   if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
240   {
241      offs_t addr = offset & 0x7fff;
242
243      data = m_video_ram[addr];
244   }
245
246   return data;
247}
248
249
250//-------------------------------------------------
251//  wangpcbus_amwc_w - memory write
252//-------------------------------------------------
253
254void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
255{
256   if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
257   {
258      offs_t addr = offset & 0x7fff;
259
260      m_video_ram[addr] = data;
261   }
262}
263
264
265//-------------------------------------------------
266//  wangpcbus_iorc_r - I/O read
267//-------------------------------------------------
268
269UINT16 wangpc_lvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
270{
271   UINT16 data = 0xffff;
272
273   if (sad(offset))
274   {
275      switch (offset & 0x7f)
276      {
277      case 0x02/2:
278         data = 0xff00 | m_crtc->register_r(space, 0);
279         break;
280
281      case 0x30/2:
282         data = 0xffe3;
283         data |= m_crtc->de_r() << 2;
284         data |= m_crtc->vsync_r() << 3;
285         data |= m_crtc->hsync_r() << 4;
286         break;
287
288      case 0xfe/2:
289         data = 0xff00 | (m_irq << 7) | OPTION_ID;
290         break;
291      }
292   }
293
294   return data;
295}
296
297
298//-------------------------------------------------
299//  wangpcbus_aiowc_w - I/O write
300//-------------------------------------------------
301
302void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
303{
304   if (sad(offset))
305   {
306      switch (offset & 0x7f)
307      {
308      case 0x00/2:
309         if (ACCESSING_BITS_0_7)
310         {
311            m_crtc->address_w(space, 0, data & 0xff);
312         }
313         break;
314
315      case 0x02/2:
316         if (ACCESSING_BITS_0_7)
317         {
318            m_crtc->register_w(space, 0, data & 0xff);
319         }
320         break;
321
322      case 0x10/2:
323         if (ACCESSING_BITS_0_7)
324         {
325            if (LOG) logerror("LVC option %02x\n", data & 0xff);
326            m_option = data & 0xff;
327           
328            if (OPTION_80_COL)
329            {
330               m_crtc->set_clock(XTAL_14_31818MHz / 8);
331            }
332            else
333            {
334               m_crtc->set_clock(XTAL_14_31818MHz / 16);
335            }
336         }
337         break;
338
339      case 0x20/2:
340         if (LOG) logerror("LVC scroll %04x\n", data);
341         m_scroll = data;
342         break;
343
344      case 0x40/2: case 0x42/2: case 0x44/2: case 0x46/2: case 0x48/2: case 0x4a/2: case 0x4c/2: case 0x4e/2:
345      case 0x50/2: case 0x52/2: case 0x55/2: case 0x56/2: case 0x58/2: case 0x5a/2: case 0x5c/2: case 0x5e/2:
346         {
347            offs_t index = offset & 0x0f;
348
349            int i = BIT(data, 15);
350            int r = BIT(data, 11) ? (i ? 0xff : 0x80) : 0;
351            int g = BIT(data, 7) ? (i ? 0xff : 0x80) : 0;
352            int b = BIT(data, 3) ? (i ? 0xff : 0x80) : 0;
353
354            palette_set_color_rgb(machine(), index, r, g, b);
355         }
356         break;
357
358      case 0x70/2:
359         set_irq(CLEAR_LINE);
360         break;
361      }
362   }
363}
1/**********************************************************************
2 
3    Wang PC Low-Resolution Video Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10/*
11 
12    TODO:
13 
14    - cursor
15    - scroll
16    - option bit 1?
17 
18*/
19 
20#include "wangpc_lvc.h"
21 
22 
23 
24//**************************************************************************
25//  MACROS/CONSTANTS
26//**************************************************************************
27 
28#define LOG 0
29 
30#define OPTION_ID      0x10
31 
32#define MC6845_TAG      "mc6845"
33#define SCREEN_TAG      "screen"
34 
35#define RAM_SIZE      0x8000
36 
37#define OPTION_VRAM      BIT(m_option, 0)
38#define OPTION_UNKNOWN   BIT(m_option, 1)
39#define OPTION_80_COL   BIT(m_option, 2)
40#define OPTION_VSYNC   BIT(m_option, 3)
41 
42 
43 
44//**************************************************************************
45//  DEVICE DEFINITIONS
46//**************************************************************************
47 
48const device_type WANGPC_LVC = &device_creator<wangpc_lvc_device>;
49 
50 
51//-------------------------------------------------
52//  mc6845_interface crtc_intf
53//-------------------------------------------------
54 
55void wangpc_lvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
56{
57   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
58 
59   offs_t scroll_y = (((m_scroll >> 8) + 0x15) & 0xff) * 0x80;
60 
61   if (OPTION_80_COL)
62   {
63       for (int column = 0; column < x_count; column++)
64       {
65          offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f));
66           UINT16 data = m_video_ram[addr & 0x7fff];
67 
68           for (int bit = 0; bit < 8; bit++)
69           {
70               int x = (column * 8) + bit;
71               int color = (BIT(data, 15) << 1) | BIT(data, 7);
72 
73               if (column == cursor_x) color = 0x03;
74 
75               bitmap.pix32(y, x) = palette[color];
76 
77               data <<= 1;
78           }
79       }
80   }
81   else
82   {
83       //offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + ((ma / 40) * 0x480) + (((ra & 0x0f) << 7));
84       offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + (y * 0x80);
85 
86       for (int column = 0; column < x_count; column++)
87       {
88           UINT32 data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff];
89 
90           for (int bit = 0; bit < 8; bit++)
91           {
92               int x = (column * 8) + bit;
93               int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7);
94 
95               if (column == cursor_x) color = 0x03;
96 
97               bitmap.pix32(y, x) = palette[color];
98 
99               data <<= 1;
100           }
101 
102           addr += 2;
103       }
104   }
105}
106 
107static MC6845_UPDATE_ROW( wangpc_lvc_update_row )
108{
109   wangpc_lvc_device *lvc = downcast<wangpc_lvc_device *>(device->owner());
110 
111   lvc->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param);
112}
113 
114WRITE_LINE_MEMBER( wangpc_lvc_device::vsync_w )
115{
116   if (OPTION_VSYNC && state)
117   {
118      set_irq(ASSERT_LINE);
119   }
120}
121 
122static const mc6845_interface crtc_intf =
123{
124   SCREEN_TAG,
125   8,
126   NULL,
127   wangpc_lvc_update_row,
128   NULL,
129   DEVCB_NULL,
130   DEVCB_NULL,
131   DEVCB_NULL,
132   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_lvc_device, vsync_w),
133   NULL
134};
135 
136 
137//-------------------------------------------------
138//  MACHINE_CONFIG_FRAGMENT( wangpc_lvc )
139//-------------------------------------------------
140 
141static MACHINE_CONFIG_FRAGMENT( wangpc_lvc )
142   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
143   MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
144   MCFG_SCREEN_SIZE(80*8, 25*9)
145   MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*9-1)
146   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
147   MCFG_SCREEN_REFRESH_RATE(60)
148 
149   MCFG_PALETTE_LENGTH(16)
150 
151   MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf)
152MACHINE_CONFIG_END
153 
154 
155//-------------------------------------------------
156//  machine_config_additions - device-specific
157//  machine configurations
158//-------------------------------------------------
159 
160machine_config_constructor wangpc_lvc_device::device_mconfig_additions() const
161{
162   return MACHINE_CONFIG_NAME( wangpc_lvc );
163}
164 
165 
166 
167//**************************************************************************
168//  INLINE HELPERS
169//**************************************************************************
170 
171//-------------------------------------------------
172//  set_irq -
173//-------------------------------------------------
174 
175inline void wangpc_lvc_device::set_irq(int state)
176{
177   m_irq = state;
178 
179   m_bus->irq3_w(m_irq);
180}
181 
182 
183 
184//**************************************************************************
185//  LIVE DEVICE
186//**************************************************************************
187 
188//-------------------------------------------------
189//  wangpc_lvc_device - constructor
190//-------------------------------------------------
191 
192wangpc_lvc_device::wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
193   device_t(mconfig, WANGPC_LVC, "Wang PC Low Resolution Video Card", tag, owner, clock),
194   device_wangpcbus_card_interface(mconfig, *this),
195   m_crtc(*this, MC6845_TAG),
196   m_option(0),
197   m_irq(CLEAR_LINE)
198{
199}
200 
201 
202//-------------------------------------------------
203//  device_start - device-specific startup
204//-------------------------------------------------
205 
206void wangpc_lvc_device::device_start()
207{
208   // allocate memory
209   m_video_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE);
210 
211   // state saving
212   save_pointer(NAME(m_video_ram), RAM_SIZE);
213   save_item(NAME(m_option));
214   save_item(NAME(m_scroll));
215   save_item(NAME(m_irq));
216}
217 
218 
219//-------------------------------------------------
220//  device_reset - device-specific reset
221//-------------------------------------------------
222 
223void wangpc_lvc_device::device_reset()
224{
225   m_option = 0;
226 
227   set_irq(CLEAR_LINE);
228}
229 
230 
231//-------------------------------------------------
232//  wangpcbus_mrdc_r - memory read
233//-------------------------------------------------
234 
235UINT16 wangpc_lvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
236{
237   UINT16 data = 0xffff;
238 
239   if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
240   {
241      offs_t addr = offset & 0x7fff;
242 
243      data = m_video_ram[addr];
244   }
245 
246   return data;
247}
248 
249 
250//-------------------------------------------------
251//  wangpcbus_amwc_w - memory write
252//-------------------------------------------------
253 
254void wangpc_lvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
255{
256   if (OPTION_VRAM && (offset >= 0xe0000/2) && (offset < 0xf0000/2))
257   {
258      offs_t addr = offset & 0x7fff;
259 
260      m_video_ram[addr] = data;
261   }
262}
263 
264 
265//-------------------------------------------------
266//  wangpcbus_iorc_r - I/O read
267//-------------------------------------------------
268 
269UINT16 wangpc_lvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
270{
271   UINT16 data = 0xffff;
272 
273   if (sad(offset))
274   {
275      switch (offset & 0x7f)
276      {
277      case 0x02/2:
278         data = 0xff00 | m_crtc->register_r(space, 0);
279         break;
280 
281      case 0x30/2:
282         data = 0xffe3;
283         data |= m_crtc->de_r() << 2;
284         data |= m_crtc->vsync_r() << 3;
285         data |= m_crtc->hsync_r() << 4;
286         break;
287 
288      case 0xfe/2:
289         data = 0xff00 | (m_irq << 7) | OPTION_ID;
290         break;
291      }
292   }
293 
294   return data;
295}
296 
297 
298//-------------------------------------------------
299//  wangpcbus_aiowc_w - I/O write
300//-------------------------------------------------
301 
302void wangpc_lvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
303{
304   if (sad(offset))
305   {
306      switch (offset & 0x7f)
307      {
308      case 0x00/2:
309         if (ACCESSING_BITS_0_7)
310         {
311            m_crtc->address_w(space, 0, data & 0xff);
312         }
313         break;
314 
315      case 0x02/2:
316         if (ACCESSING_BITS_0_7)
317         {
318            m_crtc->register_w(space, 0, data & 0xff);
319         }
320         break;
321 
322      case 0x10/2:
323         if (ACCESSING_BITS_0_7)
324         {
325            if (LOG) logerror("LVC option %02x\n", data & 0xff);
326            m_option = data & 0xff;
327 
328            if (OPTION_80_COL)
329            {
330               m_crtc->set_clock(XTAL_14_31818MHz / 8);
331            }
332            else
333            {
334               m_crtc->set_clock(XTAL_14_31818MHz / 16);
335            }
336         }
337         break;
338 
339      case 0x20/2:
340         if (LOG) logerror("LVC scroll %04x\n", data);
341         m_scroll = data;
342         break;
343 
344      case 0x40/2: case 0x42/2: case 0x44/2: case 0x46/2: case 0x48/2: case 0x4a/2: case 0x4c/2: case 0x4e/2:
345      case 0x50/2: case 0x52/2: case 0x55/2: case 0x56/2: case 0x58/2: case 0x5a/2: case 0x5c/2: case 0x5e/2:
346         {
347            offs_t index = offset & 0x0f;
348 
349            int i = BIT(data, 15);
350            int r = BIT(data, 11) ? (i ? 0xff : 0x80) : 0;
351            int g = BIT(data, 7) ? (i ? 0xff : 0x80) : 0;
352            int b = BIT(data, 3) ? (i ? 0xff : 0x80) : 0;
353 
354            palette_set_color_rgb(machine(), index, r, g, b);
355         }
356         break;
357 
358      case 0x70/2:
359         set_irq(CLEAR_LINE);
360         break;
361      }
362   }
363}
src/mess/machine/wangpc_lvc.h
r15442r15443
1/**********************************************************************
2
3    Wang PC Low-Resolution Video Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_LVC__
13#define __WANGPC_LVC__
14
15
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "video/mc6845.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> wangpc_lvc_device
27
28class wangpc_lvc_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37
38   // not really public
39   void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
40   DECLARE_WRITE_LINE_MEMBER( vsync_w );
41
42protected:
43   // device-level overrides
44   virtual void device_start();
45   virtual void device_reset();
46   virtual void device_config_complete() { m_shortname = "wangpc_lvc"; }
47
48   // device_wangpcbus_card_interface overrides
49   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
50   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
51   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
52   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
53
54private:
55   inline void set_irq(int state);
56
57   // internal state
58   required_device<mc6845_device> m_crtc;
59
60   UINT16 *m_video_ram;
61   UINT8 m_option;
62   UINT16 m_scroll;
63   int m_irq;
64};
65
66
67// device type definition
68extern const device_type WANGPC_LVC;
69
70
71#endif
1/**********************************************************************
2 
3    Wang PC Low-Resolution Video Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_LVC__
13#define __WANGPC_LVC__
14 
15 
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "video/mc6845.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> wangpc_lvc_device
27 
28class wangpc_lvc_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_lvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37 
38   // not really public
39   void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
40   DECLARE_WRITE_LINE_MEMBER( vsync_w );
41 
42protected:
43   // device-level overrides
44   virtual void device_start();
45   virtual void device_reset();
46   virtual void device_config_complete() { m_shortname = "wangpc_lvc"; }
47 
48   // device_wangpcbus_card_interface overrides
49   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
50   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
51   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
52   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
53 
54private:
55   inline void set_irq(int state);
56 
57   // internal state
58   required_device<mc6845_device> m_crtc;
59 
60   UINT16 *m_video_ram;
61   UINT8 m_option;
62   UINT16 m_scroll;
63   int m_irq;
64};
65 
66 
67// device type definition
68extern const device_type WANGPC_LVC;
69 
70 
71#endif
src/mess/machine/wangpc_tig.c
r15442r15443
1/**********************************************************************
2
3    Wang PC Text/Image/Graphics controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11   
12   TODO:
13
14   - all
15
16*/
17
18#include "wangpc_tig.h"
19
20
21
22//**************************************************************************
23//  MACROS/CONSTANTS
24//**************************************************************************
25
26#define LOG 1
27
28#define OPTION_ID_0         0x13
29#define OPTION_ID_1         0x17
30
31#define UPD7720_0_TAG      "upd7220_0"
32#define UPD7720_1_TAG      "upd7220_1"
33#define SCREEN_TAG         "screen"
34
35#define DMA_GRAPHICS      BIT(m_option, 0)
36#define DMA_DREQ1         BIT(m_option, 1)
37#define DMA_DREQ2         BIT(m_option, 2)
38#define DMA_DREQ3         BIT(m_option, 3)
39#define DMA_ID            BIT(m_option, 4)
40
41#define ATTR_ALT_FONT      BIT(data, 8)
42#define ATTR_UNDERSCORE      BIT(data, 9)
43#define ATTR_BLINK         BIT(data, 10)
44#define ATTR_REVERSE      BIT(data, 11)
45#define ATTR_BLANK         BIT(data, 12)
46#define ATTR_BOLD         BIT(data, 13)
47#define ATTR_SUBSCRIPT      BIT(data, 14)
48#define ATTR_SUPERSCRIPT   BIT(data, 15)
49
50
51
52//**************************************************************************
53//  DEVICE DEFINITIONS
54//**************************************************************************
55
56const device_type WANGPC_TIG = &device_creator<wangpc_tig_device>;
57
58
59//-------------------------------------------------
60//  ROM( wangpc_tig )
61//-------------------------------------------------
62
63ROM_START( wangpc_tig )
64   ROM_REGION( 0x100, "plds", 0 )
65   ROM_LOAD( "377-3072.l26", 0x000, 0x100, NO_DUMP ) // PAL10L8
66   ROM_LOAD( "377-3073.l16", 0x000, 0x100, NO_DUMP ) // PAL10L8
67ROM_END
68
69
70//-------------------------------------------------
71//  rom_region - device-specific ROM region
72//-------------------------------------------------
73
74const rom_entry *wangpc_tig_device::device_rom_region() const
75{
76   return ROM_NAME( wangpc_tig );
77}
78
79
80//-------------------------------------------------
81//  UPD7220_INTERFACE( hgdc0_intf )
82//-------------------------------------------------
83
84static ADDRESS_MAP_START( upd7220_0_map, AS_0, 8, wangpc_tig_device )
85   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
86   AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x1000) AM_RAM // frame buffer
87   AM_RANGE(0x4000, 0x7fff) AM_RAM // font memory
88ADDRESS_MAP_END
89
90static UPD7220_DRAW_TEXT_LINE( hgdc_display_text)
91{
92}
93
94static UPD7220_INTERFACE( hgdc0_intf )
95{
96   SCREEN_TAG,
97   NULL,
98   hgdc_display_text,
99   DEVCB_NULL,
100   DEVCB_NULL,
101   DEVCB_NULL
102};
103
104
105//-------------------------------------------------
106//  UPD7220_INTERFACE( hgdc1_intf )
107//-------------------------------------------------
108
109static ADDRESS_MAP_START( upd7220_1_map, AS_0, 8, wangpc_tig_device )
110   ADDRESS_MAP_GLOBAL_MASK(0xffff)
111   AM_RANGE(0x0000, 0xffff) AM_RAM // graphics memory
112ADDRESS_MAP_END
113
114static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
115{
116}
117
118static UPD7220_INTERFACE( hgdc1_intf )
119{
120   SCREEN_TAG,
121   hgdc_display_pixels,
122   NULL,
123   DEVCB_NULL,
124   DEVCB_NULL,
125   DEVCB_NULL
126};
127
128
129//-------------------------------------------------
130//  MACHINE_CONFIG_FRAGMENT( wangpc_tig )
131//-------------------------------------------------
132
133static MACHINE_CONFIG_FRAGMENT( wangpc_tig )
134   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
135   MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, wangpc_tig_device, screen_update)
136   MCFG_SCREEN_SIZE(80*10, 25*12)
137   MCFG_SCREEN_VISIBLE_AREA(0, 80*10-1, 0, 25*12-1)
138   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
139   MCFG_SCREEN_REFRESH_RATE(60)
140
141   MCFG_PALETTE_LENGTH(3)
142
143   MCFG_UPD7220_ADD(UPD7720_0_TAG, XTAL_52_832MHz/10, hgdc0_intf, upd7220_0_map)
144   MCFG_UPD7220_ADD(UPD7720_1_TAG, XTAL_52_832MHz/16, hgdc1_intf, upd7220_1_map)
145MACHINE_CONFIG_END
146
147
148//-------------------------------------------------
149//  machine_config_additions - device-specific
150//  machine configurations
151//-------------------------------------------------
152
153machine_config_constructor wangpc_tig_device::device_mconfig_additions() const
154{
155   return MACHINE_CONFIG_NAME( wangpc_tig );
156}
157
158
159//**************************************************************************
160//  LIVE DEVICE
161//**************************************************************************
162
163//-------------------------------------------------
164//  wangpc_tig_device - constructor
165//-------------------------------------------------
166
167wangpc_tig_device::wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
168   device_t(mconfig, WANGPC_TIG, "Wang PC TIG Controller", tag, owner, clock),
169   device_wangpcbus_card_interface(mconfig, *this),
170   m_hgdc0(*this, UPD7720_0_TAG),
171   m_hgdc1(*this, UPD7720_1_TAG),
172   m_option(0)
173{
174}
175
176
177//-------------------------------------------------
178//  device_start - device-specific startup
179//-------------------------------------------------
180
181void wangpc_tig_device::device_start()
182{
183   // initialize palette
184   palette_set_color_rgb(machine(), 0, 0, 0, 0);
185   palette_set_color_rgb(machine(), 1, 0, 0x80, 0);
186   palette_set_color_rgb(machine(), 2, 0, 0xff, 0);
187
188   // state saving
189   save_item(NAME(m_option));
190   save_item(NAME(m_attr));
191   save_item(NAME(m_underline));
192}
193
194
195//-------------------------------------------------
196//  device_reset - device-specific reset
197//-------------------------------------------------
198
199void wangpc_tig_device::device_reset()
200{
201   m_option = 0;
202}
203
204
205//-------------------------------------------------
206//  screen_update -
207//-------------------------------------------------
208
209UINT32 wangpc_tig_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
210{
211   m_hgdc0->screen_update(screen, bitmap, cliprect);
212   m_hgdc1->screen_update(screen, bitmap, cliprect);
213
214   return 0;
215}
216
217
218//-------------------------------------------------
219//  wangpcbus_iorc_r - I/O read
220//-------------------------------------------------
221
222UINT16 wangpc_tig_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
223{
224   UINT16 data = 0xffff;
225
226   if (sad(offset))
227   {
228      switch (offset & 0x7f)
229      {
230      case 0x20/2:
231      case 0x22/2:
232         data = m_hgdc0->read(space, offset);
233         break;
234
235      case 0x24/2:
236      case 0x26/2:
237         data = m_hgdc1->read(space, offset);
238         break;
239
240      case 0xfe/2:
241         data = 0xff00 | (DMA_ID ? OPTION_ID_1 : OPTION_ID_0);
242         break;
243      }
244   }
245
246   return data;
247}
248
249
250//-------------------------------------------------
251//  wangpcbus_aiowc_w - I/O write
252//-------------------------------------------------
253
254void wangpc_tig_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
255{
256   if (sad(offset) && ACCESSING_BITS_0_7)
257   {
258      switch (offset & 0x7f)
259      {
260      case 0x00/2: case 0x02/2: case 0x04/2: case 0x06/2: case 0x08/2: case 0x0a/2: case 0x0c/2: case 0x0e/2:
261      case 0x10/2: case 0x12/2: case 0x14/2: case 0x16/2: case 0x18/2: case 0x1a/2: case 0x1c/2: case 0x1e/2:
262         if (LOG) logerror("TIG attribute %u: %02x\n", offset, data & 0xff);
263
264         m_attr[offset] = data & 0xff;
265         break;
266
267      case 0x20/2:
268      case 0x22/2:
269         m_hgdc0->write(space, offset, data);
270         break;
271
272      case 0x24/2:
273      case 0x26/2:
274         m_hgdc1->write(space, offset, data);
275         break;
276
277      case 0x28/2:
278         if (LOG) logerror("TIG underline %02x\n", data & 0xff);
279
280         m_underline = data & 0xff;
281         break;
282
283      case 0x2a/2:
284         if (LOG) logerror("TIG option %02x\n", data & 0xff);
285         
286         m_option = data & 0xff;
287         break;
288
289      case 0xfc/2:
290         device_reset();
291         break;
292      }
293   }
294}
295
296
297//-------------------------------------------------
298//  wangpcbus_dack_r - DMA read
299//-------------------------------------------------
300
301UINT8 wangpc_tig_device::wangpcbus_dack_r(address_space &space, int line)
302{
303   UINT8 data = 0;
304
305   if (DMA_GRAPHICS)
306   {
307      data = m_hgdc1->dack_r(space, 0);
308   }
309   else
310   {
311      data = m_hgdc0->dack_r(space, 0);
312   }
313
314   return data;
315}
316
317
318//-------------------------------------------------
319//  wangpcbus_dack_w - DMA write
320//-------------------------------------------------
321
322void wangpc_tig_device::wangpcbus_dack_w(address_space &space, int line, UINT8 data)
323{
324   if (DMA_GRAPHICS)
325   {
326      m_hgdc1->dack_w(space, 0, data);
327   }
328   else
329   {
330      m_hgdc0->dack_w(space, 0, data);
331   }
332}
333
334
335//-------------------------------------------------
336//  wangpcbus_have_dack - DMA acknowledge
337//-------------------------------------------------
338
339bool wangpc_tig_device::wangpcbus_have_dack(int line)
340{
341   return (line == 1 && DMA_DREQ1) || (line == 2 && DMA_DREQ2) || (line == 3 && DMA_DREQ3);
342}
1/**********************************************************************
2 
3    Wang PC Text/Image/Graphics controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10/*
11 
12    TODO:
13 
14    - all
15 
16*/
17 
18#include "wangpc_tig.h"
19 
20 
21 
22//**************************************************************************
23//  MACROS/CONSTANTS
24//**************************************************************************
25 
26#define LOG 1
27 
28#define OPTION_ID_0         0x13
29#define OPTION_ID_1         0x17
30 
31#define UPD7720_0_TAG      "upd7220_0"
32#define UPD7720_1_TAG      "upd7220_1"
33#define SCREEN_TAG         "screen"
34 
35#define DMA_GRAPHICS      BIT(m_option, 0)
36#define DMA_DREQ1         BIT(m_option, 1)
37#define DMA_DREQ2         BIT(m_option, 2)
38#define DMA_DREQ3         BIT(m_option, 3)
39#define DMA_ID            BIT(m_option, 4)
40 
41#define ATTR_ALT_FONT      BIT(data, 8)
42#define ATTR_UNDERSCORE      BIT(data, 9)
43#define ATTR_BLINK         BIT(data, 10)
44#define ATTR_REVERSE      BIT(data, 11)
45#define ATTR_BLANK         BIT(data, 12)
46#define ATTR_BOLD         BIT(data, 13)
47#define ATTR_SUBSCRIPT      BIT(data, 14)
48#define ATTR_SUPERSCRIPT   BIT(data, 15)
49 
50 
51 
52//**************************************************************************
53//  DEVICE DEFINITIONS
54//**************************************************************************
55 
56const device_type WANGPC_TIG = &device_creator<wangpc_tig_device>;
57 
58 
59//-------------------------------------------------
60//  ROM( wangpc_tig )
61//-------------------------------------------------
62 
63ROM_START( wangpc_tig )
64   ROM_REGION( 0x100, "plds", 0 )
65   ROM_LOAD( "377-3072.l26", 0x000, 0x100, NO_DUMP ) // PAL10L8
66   ROM_LOAD( "377-3073.l16", 0x000, 0x100, NO_DUMP ) // PAL10L8
67ROM_END
68 
69 
70//-------------------------------------------------
71//  rom_region - device-specific ROM region
72//-------------------------------------------------
73 
74const rom_entry *wangpc_tig_device::device_rom_region() const
75{
76   return ROM_NAME( wangpc_tig );
77}
78 
79 
80//-------------------------------------------------
81//  UPD7220_INTERFACE( hgdc0_intf )
82//-------------------------------------------------
83 
84static ADDRESS_MAP_START( upd7220_0_map, AS_0, 8, wangpc_tig_device )
85   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
86   AM_RANGE(0x0000, 0x0fff) AM_MIRROR(0x1000) AM_RAM // frame buffer
87   AM_RANGE(0x4000, 0x7fff) AM_RAM // font memory
88ADDRESS_MAP_END
89 
90static UPD7220_DRAW_TEXT_LINE( hgdc_display_text)
91{
92}
93 
94static UPD7220_INTERFACE( hgdc0_intf )
95{
96   SCREEN_TAG,
97   NULL,
98   hgdc_display_text,
99   DEVCB_NULL,
100   DEVCB_NULL,
101   DEVCB_NULL
102};
103 
104 
105//-------------------------------------------------
106//  UPD7220_INTERFACE( hgdc1_intf )
107//-------------------------------------------------
108 
109static ADDRESS_MAP_START( upd7220_1_map, AS_0, 8, wangpc_tig_device )
110   ADDRESS_MAP_GLOBAL_MASK(0xffff)
111   AM_RANGE(0x0000, 0xffff) AM_RAM // graphics memory
112ADDRESS_MAP_END
113 
114static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
115{
116}
117 
118static UPD7220_INTERFACE( hgdc1_intf )
119{
120   SCREEN_TAG,
121   hgdc_display_pixels,
122   NULL,
123   DEVCB_NULL,
124   DEVCB_NULL,
125   DEVCB_NULL
126};
127 
128 
129//-------------------------------------------------
130//  MACHINE_CONFIG_FRAGMENT( wangpc_tig )
131//-------------------------------------------------
132 
133static MACHINE_CONFIG_FRAGMENT( wangpc_tig )
134   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
135   MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, wangpc_tig_device, screen_update)
136   MCFG_SCREEN_SIZE(80*10, 25*12)
137   MCFG_SCREEN_VISIBLE_AREA(0, 80*10-1, 0, 25*12-1)
138   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
139   MCFG_SCREEN_REFRESH_RATE(60)
140 
141   MCFG_PALETTE_LENGTH(3)
142 
143   MCFG_UPD7220_ADD(UPD7720_0_TAG, XTAL_52_832MHz/10, hgdc0_intf, upd7220_0_map)
144   MCFG_UPD7220_ADD(UPD7720_1_TAG, XTAL_52_832MHz/16, hgdc1_intf, upd7220_1_map)
145MACHINE_CONFIG_END
146 
147 
148//-------------------------------------------------
149//  machine_config_additions - device-specific
150//  machine configurations
151//-------------------------------------------------
152 
153machine_config_constructor wangpc_tig_device::device_mconfig_additions() const
154{
155   return MACHINE_CONFIG_NAME( wangpc_tig );
156}
157 
158 
159//**************************************************************************
160//  LIVE DEVICE
161//**************************************************************************
162 
163//-------------------------------------------------
164//  wangpc_tig_device - constructor
165//-------------------------------------------------
166 
167wangpc_tig_device::wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
168   device_t(mconfig, WANGPC_TIG, "Wang PC TIG Controller", tag, owner, clock),
169   device_wangpcbus_card_interface(mconfig, *this),
170   m_hgdc0(*this, UPD7720_0_TAG),
171   m_hgdc1(*this, UPD7720_1_TAG),
172   m_option(0)
173{
174}
175 
176 
177//-------------------------------------------------
178//  device_start - device-specific startup
179//-------------------------------------------------
180 
181void wangpc_tig_device::device_start()
182{
183   // initialize palette
184   palette_set_color_rgb(machine(), 0, 0, 0, 0);
185   palette_set_color_rgb(machine(), 1, 0, 0x80, 0);
186   palette_set_color_rgb(machine(), 2, 0, 0xff, 0);
187 
188   // state saving
189   save_item(NAME(m_option));
190   save_item(NAME(m_attr));
191   save_item(NAME(m_underline));
192}
193 
194 
195//-------------------------------------------------
196//  device_reset - device-specific reset
197//-------------------------------------------------
198 
199void wangpc_tig_device::device_reset()
200{
201   m_option = 0;
202}
203 
204 
205//-------------------------------------------------
206//  screen_update -
207//-------------------------------------------------
208 
209UINT32 wangpc_tig_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
210{
211   m_hgdc0->screen_update(screen, bitmap, cliprect);
212   m_hgdc1->screen_update(screen, bitmap, cliprect);
213 
214   return 0;
215}
216 
217 
218//-------------------------------------------------
219//  wangpcbus_iorc_r - I/O read
220//-------------------------------------------------
221 
222UINT16 wangpc_tig_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
223{
224   UINT16 data = 0xffff;
225 
226   if (sad(offset))
227   {
228      switch (offset & 0x7f)
229      {
230      case 0x20/2:
231      case 0x22/2:
232         data = m_hgdc0->read(space, offset);
233         break;
234 
235      case 0x24/2:
236      case 0x26/2:
237         data = m_hgdc1->read(space, offset);
238         break;
239 
240      case 0xfe/2:
241         data = 0xff00 | (DMA_ID ? OPTION_ID_1 : OPTION_ID_0);
242         break;
243      }
244   }
245 
246   return data;
247}
248 
249 
250//-------------------------------------------------
251//  wangpcbus_aiowc_w - I/O write
252//-------------------------------------------------
253 
254void wangpc_tig_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
255{
256   if (sad(offset) && ACCESSING_BITS_0_7)
257   {
258      switch (offset & 0x7f)
259      {
260      case 0x00/2: case 0x02/2: case 0x04/2: case 0x06/2: case 0x08/2: case 0x0a/2: case 0x0c/2: case 0x0e/2:
261      case 0x10/2: case 0x12/2: case 0x14/2: case 0x16/2: case 0x18/2: case 0x1a/2: case 0x1c/2: case 0x1e/2:
262         if (LOG) logerror("TIG attribute %u: %02x\n", offset, data & 0xff);
263 
264         m_attr[offset] = data & 0xff;
265         break;
266 
267      case 0x20/2:
268      case 0x22/2:
269         m_hgdc0->write(space, offset, data);
270         break;
271 
272      case 0x24/2:
273      case 0x26/2:
274         m_hgdc1->write(space, offset, data);
275         break;
276 
277      case 0x28/2:
278         if (LOG) logerror("TIG underline %02x\n", data & 0xff);
279 
280         m_underline = data & 0xff;
281         break;
282 
283      case 0x2a/2:
284         if (LOG) logerror("TIG option %02x\n", data & 0xff);
285 
286         m_option = data & 0xff;
287         break;
288 
289      case 0xfc/2:
290         device_reset();
291         break;
292      }
293   }
294}
295 
296 
297//-------------------------------------------------
298//  wangpcbus_dack_r - DMA read
299//-------------------------------------------------
300 
301UINT8 wangpc_tig_device::wangpcbus_dack_r(address_space &space, int line)
302{
303   UINT8 data = 0;
304 
305   if (DMA_GRAPHICS)
306   {
307      data = m_hgdc1->dack_r(space, 0);
308   }
309   else
310   {
311      data = m_hgdc0->dack_r(space, 0);
312   }
313 
314   return data;
315}
316 
317 
318//-------------------------------------------------
319//  wangpcbus_dack_w - DMA write
320//-------------------------------------------------
321 
322void wangpc_tig_device::wangpcbus_dack_w(address_space &space, int line, UINT8 data)
323{
324   if (DMA_GRAPHICS)
325   {
326      m_hgdc1->dack_w(space, 0, data);
327   }
328   else
329   {
330      m_hgdc0->dack_w(space, 0, data);
331   }
332}
333 
334 
335//-------------------------------------------------
336//  wangpcbus_have_dack - DMA acknowledge
337//-------------------------------------------------
338 
339bool wangpc_tig_device::wangpcbus_have_dack(int line)
340{
341   return (line == 1 && DMA_DREQ1) || (line == 2 && DMA_DREQ2) || (line == 3 && DMA_DREQ3);
342}
src/mess/machine/wangpc_tig.h
r15442r15443
1/**********************************************************************
2
3    Wang PC PM-001B Medium-Resolution Video Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_TIG__
13#define __WANGPC_TIG__
14
15
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "video/upd7220.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> wangpc_tig_device
27
28class wangpc_tig_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_reset();
44   virtual void device_config_complete() { m_shortname = "wangpc_tig"; }
45
46   // device_wangpcbus_card_interface overrides
47   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
48   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
49   virtual UINT8 wangpcbus_dack_r(address_space &space, int line);
50   virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data);
51   virtual bool wangpcbus_have_dack(int line);
52
53private:
54   // internal state
55   required_device<upd7220_device> m_hgdc0;
56   required_device<upd7220_device> m_hgdc1;
57
58   UINT8 m_option;
59   UINT8 m_attr[16];
60   UINT8 m_underline;
61};
62
63
64// device type definition
65extern const device_type WANGPC_TIG;
66
67
68#endif
1/**********************************************************************
2 
3    Wang PC PM-001B Medium-Resolution Video Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_TIG__
13#define __WANGPC_TIG__
14 
15 
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "video/upd7220.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> wangpc_tig_device
27 
28class wangpc_tig_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_tig_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39 
40protected:
41   // device-level overrides
42   virtual void device_start();
43   virtual void device_reset();
44   virtual void device_config_complete() { m_shortname = "wangpc_tig"; }
45 
46   // device_wangpcbus_card_interface overrides
47   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
48   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
49   virtual UINT8 wangpcbus_dack_r(address_space &space, int line);
50   virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data);
51   virtual bool wangpcbus_have_dack(int line);
52 
53private:
54   // internal state
55   required_device<upd7220_device> m_hgdc0;
56   required_device<upd7220_device> m_hgdc1;
57 
58   UINT8 m_option;
59   UINT8 m_attr[16];
60   UINT8 m_underline;
61};
62 
63 
64// device type definition
65extern const device_type WANGPC_TIG;
66 
67 
68#endif
src/mess/machine/c64_16kb.c
r15442r15443
1/**********************************************************************
2
3    Commodore 64 16KB EPROM cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "c64_16kb.h"
11
12
13
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17
18const device_type C64_16KB = &device_creator<c64_16kb_cartridge_device>;
19
20
21//-------------------------------------------------
22//  ROM( c64_16kb )
23//-------------------------------------------------
24
25ROM_START( c64_16kb )
26   ROM_REGION( 0x2000, "roml", 0 )
27   ROM_CART_LOAD( "roml", 0x0000, 0x2000, ROM_MIRROR )
28
29   ROM_REGION( 0x2000, "romh", 0 )
30   ROM_CART_LOAD( "romh", 0x0000, 0x2000, ROM_MIRROR )
31ROM_END
32
33
34//-------------------------------------------------
35//  rom_region - device-specific ROM region
36//-------------------------------------------------
37
38const rom_entry *c64_16kb_cartridge_device::device_rom_region() const
39{
40   return ROM_NAME( c64_16kb );
41}
42
43
44//-------------------------------------------------
45//  MACHINE_CONFIG_FRAGMENT( c64_16kb )
46//-------------------------------------------------
47
48static MACHINE_CONFIG_FRAGMENT( c64_16kb )
49   MCFG_CARTSLOT_ADD("roml")
50   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,80")
51
52   MCFG_CARTSLOT_ADD("romh")
53   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a0,e0")
54MACHINE_CONFIG_END
55
56
57//-------------------------------------------------
58//  machine_config_additions - device-specific
59//  machine configurations
60//-------------------------------------------------
61
62machine_config_constructor c64_16kb_cartridge_device::device_mconfig_additions() const
63{
64   return MACHINE_CONFIG_NAME( c64_16kb );
65}
66
67
68//-------------------------------------------------
69//  INPUT_PORTS( c64_16kb )
70//-------------------------------------------------
71
72static INPUT_PORTS_START( c64_16kb )
73   PORT_START("SW1")
74   PORT_DIPNAME( 0x03, 0x00, "Mode" )
75   PORT_DIPSETTING(    0x03, "Off" )
76   PORT_DIPSETTING(    0x02, "8 KB" )
77   PORT_DIPSETTING(    0x00, "16 KB" )
78   PORT_DIPSETTING(    0x01, "Ultimax" )
79INPUT_PORTS_END
80
81
82//-------------------------------------------------
83//  input_ports - device-specific input ports
84//-------------------------------------------------
85
86ioport_constructor c64_16kb_cartridge_device::device_input_ports() const
87{
88   return INPUT_PORTS_NAME( c64_16kb );
89}
90
91
92//**************************************************************************
93//  LIVE DEVICE
94//**************************************************************************
95
96//-------------------------------------------------
97//  c64_16kb_cartridge_device - constructor
98//-------------------------------------------------
99
100c64_16kb_cartridge_device::c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
101   device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock),
102   device_c64_expansion_card_interface(mconfig, *this)
103{
104}
105
106
107//-------------------------------------------------
108//  device_start - device-specific startup
109//-------------------------------------------------
110
111void c64_16kb_cartridge_device::device_start()
112{
113   m_roml = memregion("roml")->base();
114   m_romh = memregion("romh")->base();
115}
116
117
118//-------------------------------------------------
119//  device_reset - device-specific reset
120//-------------------------------------------------
121
122void c64_16kb_cartridge_device::device_reset()
123{
124   UINT8 mode = device().ioport("SW1")->read();
125
126   m_exrom = BIT(mode, 0);
127   m_game = BIT(mode, 1);
128}
129
130
131//-------------------------------------------------
132//  c64_cd_r - cartridge data read
133//-------------------------------------------------
134
135UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2)
136{
137   UINT8 data = 0;
138
139   if (!roml)
140   {
141      data = m_roml[offset & 0x1fff];
142   }
143   else if (!romh)
144   {
145      data = m_romh[offset & 0x1fff];
146   }
147
148   return data;
149}
1/**********************************************************************
2 
3    Commodore 64 16KB EPROM cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "c64_16kb.h"
11 
12 
13 
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17 
18const device_type C64_16KB = &device_creator<c64_16kb_cartridge_device>;
19 
20 
21//-------------------------------------------------
22//  ROM( c64_16kb )
23//-------------------------------------------------
24 
25ROM_START( c64_16kb )
26   ROM_REGION( 0x2000, "roml", 0 )
27   ROM_CART_LOAD( "roml", 0x0000, 0x2000, ROM_MIRROR )
28 
29   ROM_REGION( 0x2000, "romh", 0 )
30   ROM_CART_LOAD( "romh", 0x0000, 0x2000, ROM_MIRROR )
31ROM_END
32 
33 
34//-------------------------------------------------
35//  rom_region - device-specific ROM region
36//-------------------------------------------------
37 
38const rom_entry *c64_16kb_cartridge_device::device_rom_region() const
39{
40   return ROM_NAME( c64_16kb );
41}
42 
43 
44//-------------------------------------------------
45//  MACHINE_CONFIG_FRAGMENT( c64_16kb )
46//-------------------------------------------------
47 
48static MACHINE_CONFIG_FRAGMENT( c64_16kb )
49   MCFG_CARTSLOT_ADD("roml")
50   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,80")
51 
52   MCFG_CARTSLOT_ADD("romh")
53   MCFG_CARTSLOT_EXTENSION_LIST("rom,bin,a0,e0")
54MACHINE_CONFIG_END
55 
56 
57//-------------------------------------------------
58//  machine_config_additions - device-specific
59//  machine configurations
60//-------------------------------------------------
61 
62machine_config_constructor c64_16kb_cartridge_device::device_mconfig_additions() const
63{
64   return MACHINE_CONFIG_NAME( c64_16kb );
65}
66 
67 
68//-------------------------------------------------
69//  INPUT_PORTS( c64_16kb )
70//-------------------------------------------------
71 
72static INPUT_PORTS_START( c64_16kb )
73   PORT_START("SW1")
74   PORT_DIPNAME( 0x03, 0x00, "Mode" )
75   PORT_DIPSETTING(    0x03, "Off" )
76   PORT_DIPSETTING(    0x02, "8 KB" )
77   PORT_DIPSETTING(    0x00, "16 KB" )
78   PORT_DIPSETTING(    0x01, "Ultimax" )
79INPUT_PORTS_END
80 
81 
82//-------------------------------------------------
83//  input_ports - device-specific input ports
84//-------------------------------------------------
85 
86ioport_constructor c64_16kb_cartridge_device::device_input_ports() const
87{
88   return INPUT_PORTS_NAME( c64_16kb );
89}
90 
91 
92//**************************************************************************
93//  LIVE DEVICE
94//**************************************************************************
95 
96//-------------------------------------------------
97//  c64_16kb_cartridge_device - constructor
98//-------------------------------------------------
99 
100c64_16kb_cartridge_device::c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
101   device_t(mconfig, C64_16KB, "C64 16KB EPROM cartridge", tag, owner, clock),
102   device_c64_expansion_card_interface(mconfig, *this)
103{
104}
105 
106 
107//-------------------------------------------------
108//  device_start - device-specific startup
109//-------------------------------------------------
110 
111void c64_16kb_cartridge_device::device_start()
112{
113   m_roml = memregion("roml")->base();
114   m_romh = memregion("romh")->base();
115}
116 
117 
118//-------------------------------------------------
119//  device_reset - device-specific reset
120//-------------------------------------------------
121 
122void c64_16kb_cartridge_device::device_reset()
123{
124   UINT8 mode = device().ioport("SW1")->read();
125 
126   m_exrom = BIT(mode, 0);
127   m_game = BIT(mode, 1);
128}
129 
130 
131//-------------------------------------------------
132//  c64_cd_r - cartridge data read
133//-------------------------------------------------
134 
135UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2)
136{
137   UINT8 data = 0;
138 
139   if (!roml)
140   {
141      data = m_roml[offset & 0x1fff];
142   }
143   else if (!romh)
144   {
145      data = m_romh[offset & 0x1fff];
146   }
147 
148   return data;
149}
src/mess/machine/c64_16kb.h
r15442r15443
1/**********************************************************************
2
3    Commodore 64 16KB EPROM cartridge emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __C64_16KB__
13#define __C64_16KB__
14
15
16#include "emu.h"
17#include "imagedev/cartslot.h"
18#include "machine/c64exp.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> c64_16kb_cartridge_device
27
28class c64_16kb_cartridge_device : public device_t,
29                          public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38   virtual ioport_constructor device_input_ports() const;
39
40protected:
41   // device-level overrides
42   virtual void device_config_complete() { m_shortname = "c64_16kb"; }
43   virtual void device_start();
44   virtual void device_reset();
45
46   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2);
48};
49
50
51// device type definition
52extern const device_type C64_16KB;
53
54
55
56#endif
1/**********************************************************************
2 
3    Commodore 64 16KB EPROM cartridge emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __C64_16KB__
13#define __C64_16KB__
14 
15 
16#include "emu.h"
17#include "imagedev/cartslot.h"
18#include "machine/c64exp.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> c64_16kb_cartridge_device
27 
28class c64_16kb_cartridge_device : public device_t,
29                          public device_c64_expansion_card_interface
30{
31public:
32   // construction/destruction
33   c64_16kb_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual const rom_entry *device_rom_region() const;
37   virtual machine_config_constructor device_mconfig_additions() const;
38   virtual ioport_constructor device_input_ports() const;
39 
40protected:
41   // device-level overrides
42   virtual void device_config_complete() { m_shortname = "c64_16kb"; }
43   virtual void device_start();
44   virtual void device_reset();
45 
46   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, int ba, int roml, int romh, int io1, int io2);
48};
49 
50 
51// device type definition
52extern const device_type C64_16KB;
53 
54 
55 
56#endif
src/mess/machine/wangpc_mvc.c
r15442r15443
1/**********************************************************************
2
3    Wang PC PM-001B Medium-Resolution Video Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11   
12   TODO:
13
14   - character clock
15   - blink
16
17*/
18
19#include "wangpc_mvc.h"
20
21
22
23//**************************************************************************
24//  MACROS/CONSTANTS
25//**************************************************************************
26
27#define LOG 0
28
29#define OPTION_ID         0x15
30
31#define MC6845_TAG         "mc6845"
32#define SCREEN_TAG         "screen"
33
34#define VIDEO_RAM_SIZE      0x800
35#define CHAR_RAM_SIZE      0x1000
36#define BITMAP_RAM_SIZE      0x4000
37
38#define OPTION_VRAM         BIT(m_option, 0)
39#define OPTION_VSYNC      BIT(m_option, 3)
40
41#define ATTR_BLINK         BIT(attr, 0)
42#define ATTR_REVERSE      BIT(attr, 1)
43#define ATTR_BLANK         BIT(attr, 2)
44#define ATTR_BOLD         BIT(attr, 3)
45#define ATTR_OVERSCORE      BIT(attr, 4)
46#define ATTR_UNDERSCORE      BIT(attr, 5)
47#define ATTR_SUBSCRIPT      BIT(attr, 6)
48#define ATTR_SUPERSCRIPT   BIT(attr, 7)
49
50
51
52//**************************************************************************
53//  DEVICE DEFINITIONS
54//**************************************************************************
55
56const device_type WANGPC_MVC = &device_creator<wangpc_mvc_device>;
57
58
59//-------------------------------------------------
60//  mc6845_interface crtc_intf
61//-------------------------------------------------
62
63void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
64{
65   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
66
67   for (int sx = 0; sx < 50; sx++)
68   {
69      offs_t addr = (y * 50) + sx;
70      UINT16 data = m_bitmap_ram[addr];
71
72      for (int bit = 0; bit < 16; bit++)
73      {
74         int x = (sx * 16) + bit;
75         int color = BIT(data, 15);
76
77         bitmap.pix32(y, x) = palette[color];
78
79         data <<= 1;
80      }     
81   }
82
83   for (int column = 0; column < x_count; column++)
84   {
85      UINT16 code = m_video_ram[((ma + column) & 0x7ff)];
86      UINT8 attr = code & 0xff;
87
88      UINT8 new_ra = ra + 1;
89
90      if (ATTR_SUPERSCRIPT)
91      {
92         new_ra = ra + 3;
93      }
94      else if (ATTR_SUBSCRIPT)
95      {
96         new_ra = ra;
97      }
98
99      offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f);
100      UINT16 data = m_char_ram[addr & 0xfff];
101
102      if ((column == cursor_x) ||   (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE))
103      {
104         data = 0xffff;
105      }
106
107      for (int bit = 0; bit < 10; bit++)
108      {
109         int x = (column * 10) + bit;
110         int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE);
111
112         if ((color | bitmap.pix32(y, x)) & ATTR_BOLD) color = 2;
113         if (color) bitmap.pix32(y, x) = palette[color];
114
115         data <<= 1;
116      }
117   }
118}
119
120static MC6845_UPDATE_ROW( wangpc_mvc_update_row )
121{
122   wangpc_mvc_device *mvc = downcast<wangpc_mvc_device *>(device->owner());
123
124   mvc->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param);
125}
126
127WRITE_LINE_MEMBER( wangpc_mvc_device::vsync_w )
128{
129   if (OPTION_VSYNC && state)
130   {
131      set_irq(ASSERT_LINE);
132   }
133}
134
135static const mc6845_interface crtc_intf =
136{
137   SCREEN_TAG,
138   10,
139   NULL,
140   wangpc_mvc_update_row,
141   NULL,
142   DEVCB_NULL,
143   DEVCB_NULL,
144   DEVCB_NULL,
145   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_mvc_device, vsync_w),
146   NULL
147};
148
149
150//-------------------------------------------------
151//  MACHINE_CONFIG_FRAGMENT( wangpc_mvc )
152//-------------------------------------------------
153
154static MACHINE_CONFIG_FRAGMENT( wangpc_mvc )
155   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
156   MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
157   MCFG_SCREEN_SIZE(80*10, 25*12)
158   MCFG_SCREEN_VISIBLE_AREA(0, 80*10-1, 0, 25*12-1)
159   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
160   MCFG_SCREEN_REFRESH_RATE(60)
161
162   MCFG_PALETTE_LENGTH(3)
163
164   MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf)
165MACHINE_CONFIG_END
166
167
168//-------------------------------------------------
169//  machine_config_additions - device-specific
170//  machine configurations
171//-------------------------------------------------
172
173machine_config_constructor wangpc_mvc_device::device_mconfig_additions() const
174{
175   return MACHINE_CONFIG_NAME( wangpc_mvc );
176}
177
178
179
180//**************************************************************************
181//  INLINE HELPERS
182//**************************************************************************
183
184//-------------------------------------------------
185//  set_irq -
186//-------------------------------------------------
187
188inline void wangpc_mvc_device::set_irq(int state)
189{
190   m_irq = state;
191
192   m_bus->irq3_w(m_irq);
193}
194
195
196
197//**************************************************************************
198//  LIVE DEVICE
199//**************************************************************************
200
201//-------------------------------------------------
202//  wangpc_mvc_device - constructor
203//-------------------------------------------------
204
205wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
206   device_t(mconfig, WANGPC_MVC, "Wang PC Medium Resolution Video Card", tag, owner, clock),
207   device_wangpcbus_card_interface(mconfig, *this),
208   m_crtc(*this, MC6845_TAG),
209   m_option(0),
210   m_irq(CLEAR_LINE)
211{
212}
213
214
215//-------------------------------------------------
216//  device_start - device-specific startup
217//-------------------------------------------------
218
219void wangpc_mvc_device::device_start()
220{
221   // allocate memory
222   m_video_ram = auto_alloc_array(machine(), UINT16, VIDEO_RAM_SIZE);
223   m_char_ram = auto_alloc_array(machine(), UINT16, CHAR_RAM_SIZE);
224   m_bitmap_ram = auto_alloc_array(machine(), UINT16, BITMAP_RAM_SIZE);
225
226   // initialize palette
227   palette_set_color_rgb(machine(), 0, 0, 0, 0);
228   palette_set_color_rgb(machine(), 1, 0, 0x80, 0);
229   palette_set_color_rgb(machine(), 2, 0, 0xff, 0);
230
231   // state saving
232   save_pointer(NAME(m_video_ram), VIDEO_RAM_SIZE);
233   save_pointer(NAME(m_char_ram), CHAR_RAM_SIZE);
234   save_pointer(NAME(m_bitmap_ram), BITMAP_RAM_SIZE);
235   save_item(NAME(m_option));
236   save_item(NAME(m_irq));
237}
238
239
240//-------------------------------------------------
241//  device_reset - device-specific reset
242//-------------------------------------------------
243
244void wangpc_mvc_device::device_reset()
245{
246   m_option = 0;
247
248   set_irq(CLEAR_LINE);
249}
250
251
252//-------------------------------------------------
253//  wangpcbus_mrdc_r - memory read
254//-------------------------------------------------
255
256UINT16 wangpc_mvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
257{
258   UINT16 data = 0xffff;
259
260   if (OPTION_VRAM)
261   {
262      if (offset >= 0xe0000/2 && offset < 0xe8000/2)
263      {
264         data = m_bitmap_ram[offset & 0x3fff];
265      }
266      else if (offset >= 0xf0000/2 && offset < 0xf1000/2)
267      {
268         data = m_video_ram[offset & 0x7ff];
269      }
270      else if (offset >= 0xf2000/2 && offset < 0xf4000/2)
271      {
272         data = m_char_ram[offset & 0xfff];
273      }
274   }
275
276   return data;
277}
278
279
280//-------------------------------------------------
281//  wangpcbus_amwc_w - memory write
282//-------------------------------------------------
283
284void wangpc_mvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
285{
286   if (OPTION_VRAM)
287   {
288      if (offset >= 0xe0000/2 && offset < 0xe8000/2)
289      {
290         m_bitmap_ram[offset & 0x3fff] = data;
291      }
292      else if (offset >= 0xf0000/2 && offset < 0xf1000/2)
293      {
294         m_video_ram[offset & 0x7ff] = data;
295      }
296      else if (offset >= 0xf2000/2 && offset < 0xf4000/2)
297      {
298         m_char_ram[offset & 0xfff] = data;
299      }
300   }
301}
302
303
304//-------------------------------------------------
305//  wangpcbus_iorc_r - I/O read
306//-------------------------------------------------
307
308UINT16 wangpc_mvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
309{
310   UINT16 data = 0xffff;
311
312   if (sad(offset))
313   {
314      switch (offset & 0x7f)
315      {
316      case 0xfe/2:
317         data = 0xff00 | (m_irq << 7) | OPTION_ID;
318
319         set_irq(CLEAR_LINE);
320         break;
321      }
322   }
323
324   return data;
325}
326
327
328//-------------------------------------------------
329//  wangpcbus_aiowc_w - I/O write
330//-------------------------------------------------
331
332void wangpc_mvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
333{
334   if (sad(offset) && ACCESSING_BITS_0_7)
335   {
336      switch (offset & 0x7f)
337      {
338      case 0x00/2:
339         m_crtc->address_w(space, 0, data & 0xff);
340         break;
341
342      case 0x02/2:
343         m_crtc->register_w(space, 0, data & 0xff);
344         break;
345
346      case 0x10/2:
347      case 0x12/2:
348         if (LOG) logerror("MVC option %02x\n", data & 0xff);
349         
350         m_option = data & 0xff;
351         break;
352      }
353   }
354}
1/**********************************************************************
2 
3    Wang PC PM-001B Medium-Resolution Video Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10/*
11 
12    TODO:
13 
14    - character clock
15    - blink
16 
17*/
18 
19#include "wangpc_mvc.h"
20 
21 
22 
23//**************************************************************************
24//  MACROS/CONSTANTS
25//**************************************************************************
26 
27#define LOG 0
28 
29#define OPTION_ID         0x15
30 
31#define MC6845_TAG         "mc6845"
32#define SCREEN_TAG         "screen"
33 
34#define VIDEO_RAM_SIZE      0x800
35#define CHAR_RAM_SIZE      0x1000
36#define BITMAP_RAM_SIZE      0x4000
37 
38#define OPTION_VRAM         BIT(m_option, 0)
39#define OPTION_VSYNC      BIT(m_option, 3)
40 
41#define ATTR_BLINK         BIT(attr, 0)
42#define ATTR_REVERSE      BIT(attr, 1)
43#define ATTR_BLANK         BIT(attr, 2)
44#define ATTR_BOLD         BIT(attr, 3)
45#define ATTR_OVERSCORE      BIT(attr, 4)
46#define ATTR_UNDERSCORE      BIT(attr, 5)
47#define ATTR_SUBSCRIPT      BIT(attr, 6)
48#define ATTR_SUPERSCRIPT   BIT(attr, 7)
49 
50 
51 
52//**************************************************************************
53//  DEVICE DEFINITIONS
54//**************************************************************************
55 
56const device_type WANGPC_MVC = &device_creator<wangpc_mvc_device>;
57 
58 
59//-------------------------------------------------
60//  mc6845_interface crtc_intf
61//-------------------------------------------------
62 
63void wangpc_mvc_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
64{
65   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
66 
67   for (int sx = 0; sx < 50; sx++)
68   {
69      offs_t addr = (y * 50) + sx;
70      UINT16 data = m_bitmap_ram[addr];
71 
72      for (int bit = 0; bit < 16; bit++)
73      {
74         int x = (sx * 16) + bit;
75         int color = BIT(data, 15);
76 
77         bitmap.pix32(y, x) = palette[color];
78 
79         data <<= 1;
80      }
81   }
82 
83   for (int column = 0; column < x_count; column++)
84   {
85      UINT16 code = m_video_ram[((ma + column) & 0x7ff)];
86      UINT8 attr = code & 0xff;
87 
88      UINT8 new_ra = ra + 1;
89 
90      if (ATTR_SUPERSCRIPT)
91      {
92         new_ra = ra + 3;
93      }
94      else if (ATTR_SUBSCRIPT)
95      {
96         new_ra = ra;
97      }
98 
99      offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f);
100      UINT16 data = m_char_ram[addr & 0xfff];
101 
102      if ((column == cursor_x) ||   (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE))
103      {
104         data = 0xffff;
105      }
106 
107      for (int bit = 0; bit < 10; bit++)
108      {
109         int x = (column * 10) + bit;
110         int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE);
111 
112         if ((color | bitmap.pix32(y, x)) & ATTR_BOLD) color = 2;
113         if (color) bitmap.pix32(y, x) = palette[color];
114 
115         data <<= 1;
116      }
117   }
118}
119 
120static MC6845_UPDATE_ROW( wangpc_mvc_update_row )
121{
122   wangpc_mvc_device *mvc = downcast<wangpc_mvc_device *>(device->owner());
123 
124   mvc->crtc_update_row(device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param);
125}
126 
127WRITE_LINE_MEMBER( wangpc_mvc_device::vsync_w )
128{
129   if (OPTION_VSYNC && state)
130   {
131      set_irq(ASSERT_LINE);
132   }
133}
134 
135static const mc6845_interface crtc_intf =
136{
137   SCREEN_TAG,
138   10,
139   NULL,
140   wangpc_mvc_update_row,
141   NULL,
142   DEVCB_NULL,
143   DEVCB_NULL,
144   DEVCB_NULL,
145   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, wangpc_mvc_device, vsync_w),
146   NULL
147};
148 
149 
150//-------------------------------------------------
151//  MACHINE_CONFIG_FRAGMENT( wangpc_mvc )
152//-------------------------------------------------
153 
154static MACHINE_CONFIG_FRAGMENT( wangpc_mvc )
155   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
156   MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update)
157   MCFG_SCREEN_SIZE(80*10, 25*12)
158   MCFG_SCREEN_VISIBLE_AREA(0, 80*10-1, 0, 25*12-1)
159   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
160   MCFG_SCREEN_REFRESH_RATE(60)
161 
162   MCFG_PALETTE_LENGTH(3)
163 
164   MCFG_MC6845_ADD(MC6845_TAG, MC6845_1, XTAL_14_31818MHz/16, crtc_intf)
165MACHINE_CONFIG_END
166 
167 
168//-------------------------------------------------
169//  machine_config_additions - device-specific
170//  machine configurations
171//-------------------------------------------------
172 
173machine_config_constructor wangpc_mvc_device::device_mconfig_additions() const
174{
175   return MACHINE_CONFIG_NAME( wangpc_mvc );
176}
177 
178 
179 
180//**************************************************************************
181//  INLINE HELPERS
182//**************************************************************************
183 
184//-------------------------------------------------
185//  set_irq -
186//-------------------------------------------------
187 
188inline void wangpc_mvc_device::set_irq(int state)
189{
190   m_irq = state;
191 
192   m_bus->irq3_w(m_irq);
193}
194 
195 
196 
197//**************************************************************************
198//  LIVE DEVICE
199//**************************************************************************
200 
201//-------------------------------------------------
202//  wangpc_mvc_device - constructor
203//-------------------------------------------------
204 
205wangpc_mvc_device::wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
206   device_t(mconfig, WANGPC_MVC, "Wang PC Medium Resolution Video Card", tag, owner, clock),
207   device_wangpcbus_card_interface(mconfig, *this),
208   m_crtc(*this, MC6845_TAG),
209   m_option(0),
210   m_irq(CLEAR_LINE)
211{
212}
213 
214 
215//-------------------------------------------------
216//  device_start - device-specific startup
217//-------------------------------------------------
218 
219void wangpc_mvc_device::device_start()
220{
221   // allocate memory
222   m_video_ram = auto_alloc_array(machine(), UINT16, VIDEO_RAM_SIZE);
223   m_char_ram = auto_alloc_array(machine(), UINT16, CHAR_RAM_SIZE);
224   m_bitmap_ram = auto_alloc_array(machine(), UINT16, BITMAP_RAM_SIZE);
225 
226   // initialize palette
227   palette_set_color_rgb(machine(), 0, 0, 0, 0);
228   palette_set_color_rgb(machine(), 1, 0, 0x80, 0);
229   palette_set_color_rgb(machine(), 2, 0, 0xff, 0);
230 
231   // state saving
232   save_pointer(NAME(m_video_ram), VIDEO_RAM_SIZE);
233   save_pointer(NAME(m_char_ram), CHAR_RAM_SIZE);
234   save_pointer(NAME(m_bitmap_ram), BITMAP_RAM_SIZE);
235   save_item(NAME(m_option));
236   save_item(NAME(m_irq));
237}
238 
239 
240//-------------------------------------------------
241//  device_reset - device-specific reset
242//-------------------------------------------------
243 
244void wangpc_mvc_device::device_reset()
245{
246   m_option = 0;
247 
248   set_irq(CLEAR_LINE);
249}
250 
251 
252//-------------------------------------------------
253//  wangpcbus_mrdc_r - memory read
254//-------------------------------------------------
255 
256UINT16 wangpc_mvc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
257{
258   UINT16 data = 0xffff;
259 
260   if (OPTION_VRAM)
261   {
262      if (offset >= 0xe0000/2 && offset < 0xe8000/2)
263      {
264         data = m_bitmap_ram[offset & 0x3fff];
265      }
266      else if (offset >= 0xf0000/2 && offset < 0xf1000/2)
267      {
268         data = m_video_ram[offset & 0x7ff];
269      }
270      else if (offset >= 0xf2000/2 && offset < 0xf4000/2)
271      {
272         data = m_char_ram[offset & 0xfff];
273      }
274   }
275 
276   return data;
277}
278 
279 
280//-------------------------------------------------
281//  wangpcbus_amwc_w - memory write
282//-------------------------------------------------
283 
284void wangpc_mvc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
285{
286   if (OPTION_VRAM)
287   {
288      if (offset >= 0xe0000/2 && offset < 0xe8000/2)
289      {
290         m_bitmap_ram[offset & 0x3fff] = data;
291      }
292      else if (offset >= 0xf0000/2 && offset < 0xf1000/2)
293      {
294         m_video_ram[offset & 0x7ff] = data;
295      }
296      else if (offset >= 0xf2000/2 && offset < 0xf4000/2)
297      {
298         m_char_ram[offset & 0xfff] = data;
299      }
300   }
301}
302 
303 
304//-------------------------------------------------
305//  wangpcbus_iorc_r - I/O read
306//-------------------------------------------------
307 
308UINT16 wangpc_mvc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
309{
310   UINT16 data = 0xffff;
311 
312   if (sad(offset))
313   {
314      switch (offset & 0x7f)
315      {
316      case 0xfe/2:
317         data = 0xff00 | (m_irq << 7) | OPTION_ID;
318 
319         set_irq(CLEAR_LINE);
320         break;
321      }
322   }
323 
324   return data;
325}
326 
327 
328//-------------------------------------------------
329//  wangpcbus_aiowc_w - I/O write
330//-------------------------------------------------
331 
332void wangpc_mvc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
333{
334   if (sad(offset) && ACCESSING_BITS_0_7)
335   {
336      switch (offset & 0x7f)
337      {
338      case 0x00/2:
339         m_crtc->address_w(space, 0, data & 0xff);
340         break;
341 
342      case 0x02/2:
343         m_crtc->register_w(space, 0, data & 0xff);
344         break;
345 
346      case 0x10/2:
347      case 0x12/2:
348         if (LOG) logerror("MVC option %02x\n", data & 0xff);
349 
350         m_option = data & 0xff;
351         break;
352      }
353   }
354}
src/mess/machine/wangpc_mvc.h
r15442r15443
1/**********************************************************************
2
3    Wang PC PM-001B Medium-Resolution Video Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_MVC__
13#define __WANGPC_MVC__
14
15
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "video/mc6845.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> wangpc_mvc_device
27
28class wangpc_mvc_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37
38   // not really public
39   void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
40   DECLARE_WRITE_LINE_MEMBER( vsync_w );
41
42protected:
43   // device-level overrides
44   virtual void device_start();
45   virtual void device_reset();
46   virtual void device_config_complete() { m_shortname = "wangpc_mvc"; }
47
48   // device_wangpcbus_card_interface overrides
49   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
50   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
51   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
52   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
53
54private:
55   inline void set_irq(int state);
56
57   // internal state
58   required_device<mc6845_device> m_crtc;
59
60   UINT16 *m_video_ram;
61   UINT16 *m_char_ram;
62   UINT16 *m_bitmap_ram;
63   UINT8 m_option;
64   int m_irq;
65};
66
67
68// device type definition
69extern const device_type WANGPC_MVC;
70
71
72#endif
1/**********************************************************************
2 
3    Wang PC PM-001B Medium-Resolution Video Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_MVC__
13#define __WANGPC_MVC__
14 
15 
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "video/mc6845.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> wangpc_mvc_device
27 
28class wangpc_mvc_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_mvc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37 
38   // not really public
39   void crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
40   DECLARE_WRITE_LINE_MEMBER( vsync_w );
41 
42protected:
43   // device-level overrides
44   virtual void device_start();
45   virtual void device_reset();
46   virtual void device_config_complete() { m_shortname = "wangpc_mvc"; }
47 
48   // device_wangpcbus_card_interface overrides
49   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
50   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
51   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
52   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
53 
54private:
55   inline void set_irq(int state);
56 
57   // internal state
58   required_device<mc6845_device> m_crtc;
59 
60   UINT16 *m_video_ram;
61   UINT16 *m_char_ram;
62   UINT16 *m_bitmap_ram;
63   UINT8 m_option;
64   int m_irq;
65};
66 
67 
68// device type definition
69extern const device_type WANGPC_MVC;
70 
71 
72#endif
src/mess/machine/isa_sblaster.c
r15442r15443
317317                break;
318318
319319            case 0x1c:  // 8-bit DMA with autoinit
320//               printf("Start DMA (autoinit, size = %x)\n", m_dsp.dma_length);
320//              printf("Start DMA (autoinit, size = %x)\n", m_dsp.dma_length);
321321                m_dsp.dma_transferred = 0;
322322                m_dsp.dma_autoinit = 1;
323323                m_dsp.dma_timer_started = false;
src/mess/machine/wangpc_emb.c
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM031-B Extended Memory Board emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "wangpc_emb.h"
11
12
13
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17
18#define LOG 0
19
20#define OPTION_ID      0x3f
21
22#define RAM_SIZE      0x40000
23
24#define A19_A18_A17      ((offset >> 16) & 0x07)
25#define BASE(bank)       ((m_option >> (bank * 4)) & 0x07)
26#define ENABLE(bank)   BIT(m_option, (bank * 4) + 3)
27#define RAM_BANK(bank)  m_ram[(bank * 0x10000) | (offset & 0xffff)]
28
29
30
31//**************************************************************************
32//  DEVICE DEFINITIONS
33//**************************************************************************
34
35const device_type WANGPC_EMB = &device_creator<wangpc_emb_device>;
36
37
38
39//**************************************************************************
40//  LIVE DEVICE
41//**************************************************************************
42
43//-------------------------------------------------
44//  wangpc_emb_device - constructor
45//-------------------------------------------------
46
47wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
48   device_t(mconfig, WANGPC_EMB, "Wang PC-PM031-B", tag, owner, clock),
49   device_wangpcbus_card_interface(mconfig, *this)
50{
51}
52
53
54//-------------------------------------------------
55//  device_start - device-specific startup
56//-------------------------------------------------
57
58void wangpc_emb_device::device_start()
59{
60   // allocate memory
61   m_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE);
62
63   // state saving
64   save_pointer(NAME(m_ram), RAM_SIZE);
65   save_item(NAME(m_option));
66   save_item(NAME(m_parity_error));
67   save_item(NAME(m_parity_odd));
68}
69
70
71//-------------------------------------------------
72//  device_reset - device-specific reset
73//-------------------------------------------------
74
75void wangpc_emb_device::device_reset()
76{
77   m_option = 0;
78   m_parity_error = 0;
79   m_parity_odd = 1;
80}
81
82
83//-------------------------------------------------
84//  wangpcbus_mrdc_r - memory read
85//-------------------------------------------------
86
87UINT16 wangpc_emb_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
88{
89   UINT16 data = 0xffff;
90
91   for (int bank = 0; bank < 4; bank++)
92   {
93      if (ENABLE(bank) && (A19_A18_A17 == BASE(bank)))
94      {
95         data &= RAM_BANK(bank);
96      }
97   }
98
99   return data;
100}
101
102
103//-------------------------------------------------
104//  wangpcbus_amwc_w - memory write
105//-------------------------------------------------
106
107void wangpc_emb_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
108{
109   for (int bank = 0; bank < 4; bank++)
110   {
111      if (ENABLE(bank) && (A19_A18_A17 == BASE(bank)))
112      {
113         RAM_BANK(bank) = data;
114      }
115   }
116}
117
118
119//-------------------------------------------------
120//  wangpcbus_iorc_r - I/O read
121//-------------------------------------------------
122
123UINT16 wangpc_emb_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
124{
125   UINT16 data = 0xffff;
126
127   if (sad(offset))
128   {
129      switch (offset & 0x7f)
130      {
131      case 0xc0/2:
132         data = m_option;
133         break;
134
135      case 0xfe/2:
136         data = 0xfc00 | (m_parity_odd << 9) | (m_parity_error << 8) | OPTION_ID;
137         break;
138      }
139
140      logerror("emb read %06x:%02x\n", offset*2, data);
141   }
142
143   return data;
144}
145
146
147//-------------------------------------------------
148//  wangpcbus_aiowc_w - I/O write
149//-------------------------------------------------
150
151void wangpc_emb_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
152{
153   if (sad(offset))
154   {
155      logerror("emb write %06x:%02x\n", offset*2, data);
156
157      switch (offset & 0x7f)
158      {
159      case 0xc0/2:
160         m_option = data;
161         break;
162
163      case 0xce/2:
164         m_parity_error = 0;
165         break;
166
167      case 0xfc/2:
168         device_reset();
169         break;
170
171      case 0xfe/2:
172         m_parity_odd = BIT(data, 9);
173         break;
174      }
175   }
176}
1/**********************************************************************
2 
3    Wang PC-PM031-B Extended Memory Board emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "wangpc_emb.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17 
18#define LOG 0
19 
20#define OPTION_ID      0x3f
21 
22#define RAM_SIZE      0x40000
23 
24#define A19_A18_A17      ((offset >> 16) & 0x07)
25#define BASE(bank)      ((m_option >> (bank * 4)) & 0x07)
26#define ENABLE(bank)   BIT(m_option, (bank * 4) + 3)
27#define RAM_BANK(bank)  m_ram[(bank * 0x10000) | (offset & 0xffff)]
28 
29 
30 
31//**************************************************************************
32//  DEVICE DEFINITIONS
33//**************************************************************************
34 
35const device_type WANGPC_EMB = &device_creator<wangpc_emb_device>;
36 
37 
38 
39//**************************************************************************
40//  LIVE DEVICE
41//**************************************************************************
42 
43//-------------------------------------------------
44//  wangpc_emb_device - constructor
45//-------------------------------------------------
46 
47wangpc_emb_device::wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
48   device_t(mconfig, WANGPC_EMB, "Wang PC-PM031-B", tag, owner, clock),
49   device_wangpcbus_card_interface(mconfig, *this)
50{
51}
52 
53 
54//-------------------------------------------------
55//  device_start - device-specific startup
56//-------------------------------------------------
57 
58void wangpc_emb_device::device_start()
59{
60   // allocate memory
61   m_ram = auto_alloc_array(machine(), UINT16, RAM_SIZE);
62 
63   // state saving
64   save_pointer(NAME(m_ram), RAM_SIZE);
65   save_item(NAME(m_option));
66   save_item(NAME(m_parity_error));
67   save_item(NAME(m_parity_odd));
68}
69 
70 
71//-------------------------------------------------
72//  device_reset - device-specific reset
73//-------------------------------------------------
74 
75void wangpc_emb_device::device_reset()
76{
77   m_option = 0;
78   m_parity_error = 0;
79   m_parity_odd = 1;
80}
81 
82 
83//-------------------------------------------------
84//  wangpcbus_mrdc_r - memory read
85//-------------------------------------------------
86 
87UINT16 wangpc_emb_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
88{
89   UINT16 data = 0xffff;
90 
91   for (int bank = 0; bank < 4; bank++)
92   {
93      if (ENABLE(bank) && (A19_A18_A17 == BASE(bank)))
94      {
95         data &= RAM_BANK(bank);
96      }
97   }
98 
99   return data;
100}
101 
102 
103//-------------------------------------------------
104//  wangpcbus_amwc_w - memory write
105//-------------------------------------------------
106 
107void wangpc_emb_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
108{
109   for (int bank = 0; bank < 4; bank++)
110   {
111      if (ENABLE(bank) && (A19_A18_A17 == BASE(bank)))
112      {
113         RAM_BANK(bank) = data;
114      }
115   }
116}
117 
118 
119//-------------------------------------------------
120//  wangpcbus_iorc_r - I/O read
121//-------------------------------------------------
122 
123UINT16 wangpc_emb_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
124{
125   UINT16 data = 0xffff;
126 
127   if (sad(offset))
128   {
129      switch (offset & 0x7f)
130      {
131      case 0xc0/2:
132         data = m_option;
133         break;
134 
135      case 0xfe/2:
136         data = 0xfc00 | (m_parity_odd << 9) | (m_parity_error << 8) | OPTION_ID;
137         break;
138      }
139 
140      logerror("emb read %06x:%02x\n", offset*2, data);
141   }
142 
143   return data;
144}
145 
146 
147//-------------------------------------------------
148//  wangpcbus_aiowc_w - I/O write
149//-------------------------------------------------
150 
151void wangpc_emb_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
152{
153   if (sad(offset))
154   {
155      logerror("emb write %06x:%02x\n", offset*2, data);
156 
157      switch (offset & 0x7f)
158      {
159      case 0xc0/2:
160         m_option = data;
161         break;
162 
163      case 0xce/2:
164         m_parity_error = 0;
165         break;
166 
167      case 0xfc/2:
168         device_reset();
169         break;
170 
171      case 0xfe/2:
172         m_parity_odd = BIT(data, 9);
173         break;
174      }
175   }
176}
src/mess/machine/wangpc_emb.h
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM031-B Extended Memory Board emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_EMB__
13#define __WANGPC_EMB__
14
15
16#include "emu.h"
17#include "machine/wangpcbus.h"
18
19
20
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24
25// ======================> wangpc_emb_device
26
27class wangpc_emb_device : public device_t,
28                    public device_wangpcbus_card_interface
29{
30public:
31   // construction/destruction
32   wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33
34protected:
35   // device-level overrides
36   virtual void device_start();
37   virtual void device_reset();
38   virtual void device_config_complete() { m_shortname = "wangpc_emb"; }
39
40   // device_wangpcbus_card_interface overrides
41   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
42   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
43   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
44   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
45
46private:
47   UINT16 *m_ram;
48   UINT16 m_option;
49   int m_parity_error;
50   int m_parity_odd;
51};
52
53
54// device type definition
55extern const device_type WANGPC_EMB;
56
57
58#endif
1/**********************************************************************
2 
3    Wang PC-PM031-B Extended Memory Board emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_EMB__
13#define __WANGPC_EMB__
14 
15 
16#include "emu.h"
17#include "machine/wangpcbus.h"
18 
19 
20 
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24 
25// ======================> wangpc_emb_device
26 
27class wangpc_emb_device : public device_t,
28                    public device_wangpcbus_card_interface
29{
30public:
31   // construction/destruction
32   wangpc_emb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33 
34protected:
35   // device-level overrides
36   virtual void device_start();
37   virtual void device_reset();
38   virtual void device_config_complete() { m_shortname = "wangpc_emb"; }
39 
40   // device_wangpcbus_card_interface overrides
41   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
42   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
43   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
44   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
45 
46private:
47   UINT16 *m_ram;
48   UINT16 m_option;
49   int m_parity_error;
50   int m_parity_odd;
51};
52 
53 
54// device type definition
55extern const device_type WANGPC_EMB;
56 
57 
58#endif
src/mess/machine/pc.c
r15442r15443
11671167MACHINE_START( mc1502 )
11681168{
11691169   pc_state *st = machine.driver_data<pc_state>();
1170//   pc_fdc_init( machine, &pcjr_fdc_interface_nc );
1170//  pc_fdc_init( machine, &pcjr_fdc_interface_nc );
11711171   pcjr_keyb.keyb_signal_timer = machine.scheduler().timer_alloc(FUNC(pcjr_keyb_signal_callback));
11721172   pc_int_delay_timer = machine.scheduler().timer_alloc(FUNC(pcjr_delayed_pic8259_irq));
11731173   st->m_maincpu = machine.device("maincpu" );
src/mess/machine/wangpc_mcc.c
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM043 Multiport Communications Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10/*
11   
12   TODO:
13
14   - all
15
16*/
17
18#include "wangpc_mcc.h"
19
20
21
22//**************************************************************************
23//  MACROS/CONSTANTS
24//**************************************************************************
25
26#define LOG 0
27
28#define OPTION_ID      0x1f
29
30#define Z80SIO2_TAG      "z80sio2"
31#define Z80DART_TAG      "z80dart"
32
33#define FUNCTION_PORT1_EXT_CLK      BIT(m_option, 0)
34#define FUNCTION_PORT1_NRZI         BIT(m_option, 1)
35#define FUNCTION_PORT1_RI_IE      BIT(m_option, 2)
36#define FUNCTION_PORT2_EXT_CLK      BIT(m_option, 3)
37#define FUNCTION_PORT2_NRZI         BIT(m_option, 4)
38#define FUNCTION_PORT2_RI_IE      BIT(m_option, 5)
39#define FUNCTION_IRQ_MASK         (m_option & 0xc0)
40#define FUNCTION_IRQ2            0x00
41#define FUNCTION_IRQ3            0x40
42#define FUNCTION_IRQ4            0x80
43#define FUNCTION_IRQ_INVALID      0xc0
44
45
46
47//**************************************************************************
48//  DEVICE DEFINITIONS
49//**************************************************************************
50
51const device_type WANGPC_MCC = &device_creator<wangpc_mcc_device>;
52
53
54//-------------------------------------------------
55//  Z80DART_INTERFACE( sio_intf )
56//-------------------------------------------------
57
58static Z80DART_INTERFACE( sio_intf )
59{
60   0, 0, 0, 0,
61
62   DEVCB_NULL,
63   DEVCB_NULL,
64   DEVCB_NULL,
65   DEVCB_NULL,
66   DEVCB_NULL,
67   DEVCB_NULL,
68
69   DEVCB_NULL,
70   DEVCB_NULL,
71   DEVCB_NULL,
72   DEVCB_NULL,
73   DEVCB_NULL,
74   DEVCB_NULL,
75
76   DEVCB_NULL
77};
78
79
80//-------------------------------------------------
81//  Z80DART_INTERFACE( dart_intf )
82//-------------------------------------------------
83
84static Z80DART_INTERFACE( dart_intf )
85{
86   0, 0, 0, 0,
87
88   DEVCB_NULL,
89   DEVCB_NULL,
90   DEVCB_NULL,
91   DEVCB_NULL,
92   DEVCB_NULL,
93   DEVCB_NULL,
94
95   DEVCB_NULL,
96   DEVCB_NULL,
97   DEVCB_NULL,
98   DEVCB_NULL,
99   DEVCB_NULL,
100   DEVCB_NULL,
101
102   DEVCB_NULL
103};
104
105
106//-------------------------------------------------
107//  MACHINE_CONFIG_FRAGMENT( wangpc_mcc )
108//-------------------------------------------------
109
110static MACHINE_CONFIG_FRAGMENT( wangpc_mcc )
111   MCFG_Z80SIO2_ADD(Z80SIO2_TAG, 4000000, sio_intf)
112   MCFG_Z80DART_ADD(Z80DART_TAG, 4000000, dart_intf)
113MACHINE_CONFIG_END
114
115
116//-------------------------------------------------
117//  machine_config_additions - device-specific
118//  machine configurations
119//-------------------------------------------------
120
121machine_config_constructor wangpc_mcc_device::device_mconfig_additions() const
122{
123   return MACHINE_CONFIG_NAME( wangpc_mcc );
124}
125
126
127
128//**************************************************************************
129//  INLINE HELPERS
130//**************************************************************************
131
132//-------------------------------------------------
133//  set_irq -
134//-------------------------------------------------
135
136inline void wangpc_mcc_device::set_irq(int state)
137{
138   m_irq = state;
139
140   switch (FUNCTION_IRQ_MASK)
141   {
142   case FUNCTION_IRQ2: m_bus->irq2_w(m_irq); break;
143   case FUNCTION_IRQ3: m_bus->irq3_w(m_irq); break;
144   case FUNCTION_IRQ4: m_bus->irq4_w(m_irq); break;
145   }
146}
147
148
149
150//**************************************************************************
151//  LIVE DEVICE
152//**************************************************************************
153
154//-------------------------------------------------
155//  wangpc_mcc_device - constructor
156//-------------------------------------------------
157
158wangpc_mcc_device::wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
159   device_t(mconfig, WANGPC_MCC, "Wang PC-PM043", tag, owner, clock),
160   device_wangpcbus_card_interface(mconfig, *this),
161   m_sio(*this, Z80SIO2_TAG),
162   m_dart(*this, Z80DART_TAG)
163{
164}
165
166
167//-------------------------------------------------
168//  device_start - device-specific startup
169//-------------------------------------------------
170
171void wangpc_mcc_device::device_start()
172{
173   // state saving
174   save_item(NAME(m_option));
175}
176
177
178//-------------------------------------------------
179//  device_reset - device-specific reset
180//-------------------------------------------------
181
182void wangpc_mcc_device::device_reset()
183{
184   m_option = 0;
185
186   set_irq(CLEAR_LINE);
187}
188
189
190//-------------------------------------------------
191//  wangpcbus_iorc_r - I/O read
192//-------------------------------------------------
193
194UINT16 wangpc_mcc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
195{
196   UINT16 data = 0xffff;
197
198   if (sad(offset))
199   {
200      switch (offset & 0x7f)
201      {
202       case 0x00/2:
203      case 0x02/2:
204         if (ACCESSING_BITS_0_7)
205         {
206            data = 0xff00 | m_sio->data_read(offset & 0x01);
207         }
208         break;
209
210      case 0x04/2:
211      case 0x06/2:
212         if (ACCESSING_BITS_0_7)
213         {
214            data = 0xff00 | m_sio->control_read(offset & 0x01);
215         }
216         break;
217
218       case 0x08/2:
219      case 0x0a/2:
220         if (ACCESSING_BITS_0_7)
221         {
222            data = 0xff00 | m_dart->data_read(offset & 0x01);
223         }
224         break;
225
226      case 0x0c/2:
227      case 0x0e/2:
228         if (ACCESSING_BITS_0_7)
229         {
230            data = 0xff00 | m_dart->control_read(offset & 0x01);
231         }
232         break;
233
234      case 0x10/2:
235         // board status
236         /*
237         
238             bit     description
239         
240             0       SIO channel A WAIT/RDY
241             1       SIO channel B WAIT/RDY
242             2       SIO channel A DSR
243             3       SIO channel B DSR
244             4       SIO channel A RI
245             5       SIO channel B RI
246             6       DART channel A WAIT/RDY
247             7      DART channel A DSR
248             8      DART channel B WAIT/RDY
249             9      0 (1 for PC-PM042)
250             10      0 (1 for PC-PM042)
251             11      0 (1 for PC-PM042)
252             12      1
253             13      1
254             14      1
255             15      1       
256         
257         */
258         data = 0xf000;
259         break;
260
261      case 0xfe/2:
262         data = 0xff00 | (m_irq << 7) | OPTION_ID;
263         break;
264      }
265   }
266
267   return data;
268}
269
270
271//-------------------------------------------------
272//  wangpcbus_aiowc_w - I/O write
273//-------------------------------------------------
274
275void wangpc_mcc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
276{
277   if (sad(offset) && ACCESSING_BITS_0_7)
278   {
279      switch (offset & 0x7f)
280      {
281       case 0x00/2:
282      case 0x02/2:
283         m_sio->data_write(offset & 0x01, data & 0xff);
284         break;
285
286      case 0x04/2:
287      case 0x06/2:
288         m_sio->control_write(offset & 0x01, data & 0xff);
289         break;
290
291       case 0x08/2:
292      case 0x0a/2:
293         m_dart->data_write(offset & 0x01, data & 0xff);
294         break;
295
296      case 0x0c/2:
297      case 0x0e/2:
298         m_dart->control_write(offset & 0x01, data & 0xff);
299         break;
300
301      case 0x12/2:
302         // port 1 baud rate
303         break;
304
305      case 0x14/2:
306         // port 2 baud rate
307         break;
308
309      case 0x16/2:
310         {
311            // ports 1 and 2 function
312            bool irq = (m_irq == ASSERT_LINE);
313            bool changed = (FUNCTION_IRQ_MASK != (data & 0xc0));
314
315            if (irq && changed) set_irq(CLEAR_LINE);
316
317            m_option = data & 0xff;
318
319            if (irq && changed) set_irq(ASSERT_LINE);
320         }
321         break;
322
323      case 0x18/2:
324         // port 3 channel A baud rate
325         break;
326
327      case 0x1a/2:
328         // port 3 channel B baud rate
329         break;
330
331      case 0xfc/2:
332         device_reset();
333         break;
334      }
335   }
336}
1/**********************************************************************
2 
3    Wang PC-PM043 Multiport Communications Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10/*
11 
12    TODO:
13 
14    - all
15 
16*/
17 
18#include "wangpc_mcc.h"
19 
20 
21 
22//**************************************************************************
23//  MACROS/CONSTANTS
24//**************************************************************************
25 
26#define LOG 0
27 
28#define OPTION_ID      0x1f
29 
30#define Z80SIO2_TAG      "z80sio2"
31#define Z80DART_TAG      "z80dart"
32 
33#define FUNCTION_PORT1_EXT_CLK      BIT(m_option, 0)
34#define FUNCTION_PORT1_NRZI         BIT(m_option, 1)
35#define FUNCTION_PORT1_RI_IE      BIT(m_option, 2)
36#define FUNCTION_PORT2_EXT_CLK      BIT(m_option, 3)
37#define FUNCTION_PORT2_NRZI         BIT(m_option, 4)
38#define FUNCTION_PORT2_RI_IE      BIT(m_option, 5)
39#define FUNCTION_IRQ_MASK         (m_option & 0xc0)
40#define FUNCTION_IRQ2            0x00
41#define FUNCTION_IRQ3            0x40
42#define FUNCTION_IRQ4            0x80
43#define FUNCTION_IRQ_INVALID      0xc0
44 
45 
46 
47//**************************************************************************
48//  DEVICE DEFINITIONS
49//**************************************************************************
50 
51const device_type WANGPC_MCC = &device_creator<wangpc_mcc_device>;
52 
53 
54//-------------------------------------------------
55//  Z80DART_INTERFACE( sio_intf )
56//-------------------------------------------------
57 
58static Z80DART_INTERFACE( sio_intf )
59{
60   0, 0, 0, 0,
61 
62   DEVCB_NULL,
63   DEVCB_NULL,
64   DEVCB_NULL,
65   DEVCB_NULL,
66   DEVCB_NULL,
67   DEVCB_NULL,
68 
69   DEVCB_NULL,
70   DEVCB_NULL,
71   DEVCB_NULL,
72   DEVCB_NULL,
73   DEVCB_NULL,
74   DEVCB_NULL,
75 
76   DEVCB_NULL
77};
78 
79 
80//-------------------------------------------------
81//  Z80DART_INTERFACE( dart_intf )
82//-------------------------------------------------
83 
84static Z80DART_INTERFACE( dart_intf )
85{
86   0, 0, 0, 0,
87 
88   DEVCB_NULL,
89   DEVCB_NULL,
90   DEVCB_NULL,
91   DEVCB_NULL,
92   DEVCB_NULL,
93   DEVCB_NULL,
94 
95   DEVCB_NULL,
96   DEVCB_NULL,
97   DEVCB_NULL,
98   DEVCB_NULL,
99   DEVCB_NULL,
100   DEVCB_NULL,
101 
102   DEVCB_NULL
103};
104 
105 
106//-------------------------------------------------
107//  MACHINE_CONFIG_FRAGMENT( wangpc_mcc )
108//-------------------------------------------------
109 
110static MACHINE_CONFIG_FRAGMENT( wangpc_mcc )
111   MCFG_Z80SIO2_ADD(Z80SIO2_TAG, 4000000, sio_intf)
112   MCFG_Z80DART_ADD(Z80DART_TAG, 4000000, dart_intf)
113MACHINE_CONFIG_END
114 
115 
116//-------------------------------------------------
117//  machine_config_additions - device-specific
118//  machine configurations
119//-------------------------------------------------
120 
121machine_config_constructor wangpc_mcc_device::device_mconfig_additions() const
122{
123   return MACHINE_CONFIG_NAME( wangpc_mcc );
124}
125 
126 
127 
128//**************************************************************************
129//  INLINE HELPERS
130//**************************************************************************
131 
132//-------------------------------------------------
133//  set_irq -
134//-------------------------------------------------
135 
136inline void wangpc_mcc_device::set_irq(int state)
137{
138   m_irq = state;
139 
140   switch (FUNCTION_IRQ_MASK)
141   {
142   case FUNCTION_IRQ2: m_bus->irq2_w(m_irq); break;
143   case FUNCTION_IRQ3: m_bus->irq3_w(m_irq); break;
144   case FUNCTION_IRQ4: m_bus->irq4_w(m_irq); break;
145   }
146}
147 
148 
149 
150//**************************************************************************
151//  LIVE DEVICE
152//**************************************************************************
153 
154//-------------------------------------------------
155//  wangpc_mcc_device - constructor
156//-------------------------------------------------
157 
158wangpc_mcc_device::wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
159   device_t(mconfig, WANGPC_MCC, "Wang PC-PM043", tag, owner, clock),
160   device_wangpcbus_card_interface(mconfig, *this),
161   m_sio(*this, Z80SIO2_TAG),
162   m_dart(*this, Z80DART_TAG)
163{
164}
165 
166 
167//-------------------------------------------------
168//  device_start - device-specific startup
169//-------------------------------------------------
170 
171void wangpc_mcc_device::device_start()
172{
173   // state saving
174   save_item(NAME(m_option));
175}
176 
177 
178//-------------------------------------------------
179//  device_reset - device-specific reset
180//-------------------------------------------------
181 
182void wangpc_mcc_device::device_reset()
183{
184   m_option = 0;
185 
186   set_irq(CLEAR_LINE);
187}
188 
189 
190//-------------------------------------------------
191//  wangpcbus_iorc_r - I/O read
192//-------------------------------------------------
193 
194UINT16 wangpc_mcc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
195{
196   UINT16 data = 0xffff;
197 
198   if (sad(offset))
199   {
200      switch (offset & 0x7f)
201      {
202      case 0x00/2:
203      case 0x02/2:
204         if (ACCESSING_BITS_0_7)
205         {
206            data = 0xff00 | m_sio->data_read(offset & 0x01);
207         }
208         break;
209 
210      case 0x04/2:
211      case 0x06/2:
212         if (ACCESSING_BITS_0_7)
213         {
214            data = 0xff00 | m_sio->control_read(offset & 0x01);
215         }
216         break;
217 
218      case 0x08/2:
219      case 0x0a/2:
220         if (ACCESSING_BITS_0_7)
221         {
222            data = 0xff00 | m_dart->data_read(offset & 0x01);
223         }
224         break;
225 
226      case 0x0c/2:
227      case 0x0e/2:
228         if (ACCESSING_BITS_0_7)
229         {
230            data = 0xff00 | m_dart->control_read(offset & 0x01);
231         }
232         break;
233 
234      case 0x10/2:
235         // board status
236         /*
237 
238                bit     description
239 
240                0       SIO channel A WAIT/RDY
241                1       SIO channel B WAIT/RDY
242                2       SIO channel A DSR
243                3       SIO channel B DSR
244                4       SIO channel A RI
245                5       SIO channel B RI
246                6       DART channel A WAIT/RDY
247                7       DART channel A DSR
248                8       DART channel B WAIT/RDY
249                9       0 (1 for PC-PM042)
250                10      0 (1 for PC-PM042)
251                11      0 (1 for PC-PM042)
252                12      1
253                13      1
254                14      1
255                15      1
256 
257            */
258         data = 0xf000;
259         break;
260 
261      case 0xfe/2:
262         data = 0xff00 | (m_irq << 7) | OPTION_ID;
263         break;
264      }
265   }
266 
267   return data;
268}
269 
270 
271//-------------------------------------------------
272//  wangpcbus_aiowc_w - I/O write
273//-------------------------------------------------
274 
275void wangpc_mcc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
276{
277   if (sad(offset) && ACCESSING_BITS_0_7)
278   {
279      switch (offset & 0x7f)
280      {
281      case 0x00/2:
282      case 0x02/2:
283         m_sio->data_write(offset & 0x01, data & 0xff);
284         break;
285 
286      case 0x04/2:
287      case 0x06/2:
288         m_sio->control_write(offset & 0x01, data & 0xff);
289         break;
290 
291      case 0x08/2:
292      case 0x0a/2:
293         m_dart->data_write(offset & 0x01, data & 0xff);
294         break;
295 
296      case 0x0c/2:
297      case 0x0e/2:
298         m_dart->control_write(offset & 0x01, data & 0xff);
299         break;
300 
301      case 0x12/2:
302         // port 1 baud rate
303         break;
304 
305      case 0x14/2:
306         // port 2 baud rate
307         break;
308 
309      case 0x16/2:
310         {
311            // ports 1 and 2 function
312            bool irq = (m_irq == ASSERT_LINE);
313            bool changed = (FUNCTION_IRQ_MASK != (data & 0xc0));
314 
315            if (irq && changed) set_irq(CLEAR_LINE);
316 
317            m_option = data & 0xff;
318 
319            if (irq && changed) set_irq(ASSERT_LINE);
320         }
321         break;
322 
323      case 0x18/2:
324         // port 3 channel A baud rate
325         break;
326 
327      case 0x1a/2:
328         // port 3 channel B baud rate
329         break;
330 
331      case 0xfc/2:
332         device_reset();
333         break;
334      }
335   }
336}
src/mess/machine/wangpc_mcc.h
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM043 Multiport Communications Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_MCC__
13#define __WANGPC_MCC__
14
15
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "machine/z80dart.h"
19
20
21
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25
26// ======================> wangpc_mcc_device
27
28class wangpc_mcc_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37
38protected:
39   // device-level overrides
40   virtual void device_start();
41   virtual void device_reset();
42   virtual void device_config_complete() { m_shortname = "wangpc_mcc"; }
43
44   // device_wangpcbus_card_interface overrides
45   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
46   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
47
48private:
49   inline void set_irq(int state);
50
51   required_device<z80dart_device> m_sio;
52   required_device<z80dart_device> m_dart;
53
54   UINT8 m_option;
55   int m_irq;
56};
57
58
59// device type definition
60extern const device_type WANGPC_MCC;
61
62
63#endif
1/**********************************************************************
2 
3    Wang PC-PM043 Multiport Communications Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_MCC__
13#define __WANGPC_MCC__
14 
15 
16#include "emu.h"
17#include "machine/wangpcbus.h"
18#include "machine/z80dart.h"
19 
20 
21 
22//**************************************************************************
23//  TYPE DEFINITIONS
24//**************************************************************************
25 
26// ======================> wangpc_mcc_device
27 
28class wangpc_mcc_device : public device_t,
29                    public device_wangpcbus_card_interface
30{
31public:
32   // construction/destruction
33   wangpc_mcc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
34 
35   // optional information overrides
36   virtual machine_config_constructor device_mconfig_additions() const;
37 
38protected:
39   // device-level overrides
40   virtual void device_start();
41   virtual void device_reset();
42   virtual void device_config_complete() { m_shortname = "wangpc_mcc"; }
43 
44   // device_wangpcbus_card_interface overrides
45   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
46   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
47 
48private:
49   inline void set_irq(int state);
50 
51   required_device<z80dart_device> m_sio;
52   required_device<z80dart_device> m_dart;
53 
54   UINT8 m_option;
55   int m_irq;
56};
57 
58 
59// device type definition
60extern const device_type WANGPC_MCC;
61 
62 
63#endif
src/mess/machine/upd765.c
r15442r15443
146146
147147   char *data_buffer;
148148   const upd765_interface *intf;
149   
149
150150   bool pool;
151151};
152152
r15442r15443
20612061         {
20622062            /* clear ready changed bit */
20632063            fdc->ready_changed &= ~(1 << fdc->drive);
2064           
2064
20652065            if (!fdc->pool) {
20662066               fdc->ready_changed = 0;
20672067            }
r15442r15443
24262426   fdc->out_drq_func.resolve(fdc->intf->out_drq_func, *device);
24272427
24282428   // plain upd765 is doing pooling
2429   fdc->pool = true;   
2429   fdc->pool = true;
24302430   // register for state saving
24312431   //state_save_register_item(device->machine(), "upd765", device->tag(), 0, upd765->number);
24322432}
src/mess/machine/wangpckb.c
r15442r15443
400400{
401401    transmit_register_reset();
402402    receive_register_reset();
403   
403
404404    set_out_data_bit(1);
405405    serial_connection_out();
406406}
r15442r15443
420420    {
421421        m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
422422        receive_register_extract();
423       
423
424424        if (LOG) logerror("Wang PC keyboard receive data %02x\n", get_received_char());
425425    }
426426}
r15442r15443
506506        P1.3    led 3
507507        P1.4    led 4
508508        P1.5    led 5
509        P1.6   
509        P1.6
510510        P1.7
511511 
512512    */
r15442r15443
542542    */
543543 
544544   m_y = data & 0x0f;
545   
545
546546    if (LOG) logerror("P2 %02x\n", data);
547547}
548548 
r15442r15443
567567        P3.7
568568 
569569    */
570   
570
571571    if (LOG) logerror("P3 %02x\n", data);
572572}
src/mess/machine/isa_ide_cd.c
r15442r15443
387387}
388388 
389389static MACHINE_CONFIG_FRAGMENT( ide )
390   MCFG_DEVICE_ADD("cdrom", SCSICD, 0)
390   MCFG_DEVICE_ADD("cdrom", SCSICD, 0)
391391MACHINE_CONFIG_END
392392 
393393static INPUT_PORTS_START( ide )
src/mess/machine/mb89352.c
r15442r15443
531531         }
532532         if(m_phase == SCSI_PHASE_STATUS)
533533         {
534             void *image;
534            void *image;
535535            m_SCSIdevices[m_target]->GetDevice(&image);
536536            if (image != NULL)
537537               m_temp = 0x00;
src/mess/machine/ncr5390.h
r15442r15443
194194
195195   devcb_resolved_write_line   m_irq_func;
196196   devcb_resolved_write_line   m_drq_func;
197   
197
198198   void dma_set(int dir);
199199   void drq_set();
200200   void drq_clear();
src/mess/machine/econet.c
r15442r15443
1/**********************************************************************
2
3    Acorn Computers Econet local area network emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "econet.h"
11
12
13
14//**************************************************************************
15//  MACROS / CONSTANTS
16//**************************************************************************
17
18#define LOG 0
19
20
21static const char *const SIGNAL_NAME[] = { "CLK", "DATA" };
22
23
24
25//**************************************************************************
26//  DEVICE DEFINITIONS
27//**************************************************************************
28
29const device_type ECONET = &device_creator<econet_device>;
30const device_type ECONET_SLOT = &device_creator<econet_slot_device>;
31
32
33
34//**************************************************************************
35//  DEVICE INTERFACE
36//**************************************************************************
37
38//-------------------------------------------------
39//  device_econet_interface - constructor
40//-------------------------------------------------
41
42device_econet_interface::device_econet_interface(const machine_config &mconfig, device_t &device)
43   : device_slot_card_interface(mconfig, device)
44{
45}
46
47
48//-------------------------------------------------
49//  ~device_econet_interface - destructor
50//-------------------------------------------------
51
52device_econet_interface::~device_econet_interface()
53{
54}
55
56
57
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61
62//-------------------------------------------------
63//  econet_slot_device - constructor
64//-------------------------------------------------
65
66econet_slot_device::econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
67        device_t(mconfig, ECONET_SLOT, "Econet station", tag, owner, clock),
68      device_slot_interface(mconfig, *this)
69{
70}
71
72
73//-------------------------------------------------
74//  static_set_slot -
75//-------------------------------------------------
76
77void econet_slot_device::static_set_slot(device_t &device, int address)
78{
79   econet_slot_device &econet_card = dynamic_cast<econet_slot_device &>(device);
80   econet_card.m_address = address;
81}
82
83
84//-------------------------------------------------
85//  device_start - device-specific startup
86//-------------------------------------------------
87
88void econet_slot_device::device_start()
89{
90   m_econet = machine().device<econet_device>(ECONET_TAG);
91   device_econet_interface *dev = dynamic_cast<device_econet_interface *>(get_card_device());
92   if (dev) m_econet->add_device(get_card_device(), m_address);
93}
94
95
96
97//**************************************************************************
98//  DEVICE CONFIGURATION
99//**************************************************************************
100
101//-------------------------------------------------
102//  device_config_complete - perform any
103//  operations now that the configuration is
104//  complete
105//-------------------------------------------------
106
107void econet_device::device_config_complete()
108{
109   // inherit a copy of the static data
110   const econet_interface *intf = reinterpret_cast<const econet_interface *>(static_config());
111   if (intf != NULL)
112      *static_cast<econet_interface *>(this) = *intf;
113
114   // or initialize to defaults if none provided
115   else
116   {
117      memset(&m_out_clk_cb, 0, sizeof(m_out_clk_cb));
118      memset(&m_out_data_cb, 0, sizeof(m_out_data_cb));
119   }
120}
121
122
123
124//**************************************************************************
125//  INLINE HELPERS
126//**************************************************************************
127
128//-------------------------------------------------
129//  set_signal -
130//-------------------------------------------------
131
132inline void econet_device::set_signal(device_t *device, int signal, int state)
133{
134   bool changed = false;
135
136   if (device == this)
137   {
138      if (m_line[signal] != state)
139      {
140         if (LOG) logerror("Econet: '%s' %s %u\n", tag(), SIGNAL_NAME[signal], state);
141         m_line[signal] = state;
142         changed = true;
143      }
144   }
145   else
146   {
147      daisy_entry *entry = m_device_list.first();
148
149      while (entry)
150      {
151         if (!strcmp(entry->m_device->tag(), device->tag()))
152         {
153            if (entry->m_line[signal] != state)
154            {
155               if (LOG) logerror("Econet: '%s' %s %u\n", device->tag(), SIGNAL_NAME[signal], state);
156               entry->m_line[signal] = state;
157               changed = true;
158            }
159         }
160
161         entry = entry->next();
162      }
163   }
164
165   if (changed)
166   {
167      switch (signal)
168      {
169      case CLK:   m_out_clk_func(state);   break;
170      case DATA:   m_out_data_func(state);   break;
171      }
172
173      daisy_entry *entry = m_device_list.first();
174
175      while (entry)
176      {
177         switch (signal)
178         {
179         case CLK:
180            entry->m_interface->econet_clk(state);
181            break;
182
183         case DATA:
184            entry->m_interface->econet_data(state);
185            break;
186         }
187
188         entry = entry->next();
189      }
190
191      if (LOG) logerror("Econet: CLK %u DATA %u\n", get_signal(CLK), get_signal(DATA));
192   }
193}
194
195
196//-------------------------------------------------
197//  get_signal -
198//-------------------------------------------------
199
200inline int econet_device::get_signal(int signal)
201{
202   int state = m_line[signal];
203
204   if (state)
205   {
206      daisy_entry *entry = m_device_list.first();
207
208      while (entry)
209      {
210         if (!entry->m_line[signal])
211         {
212            state = 0;
213            break;
214         }
215
216         entry = entry->next();
217      }
218   }
219
220   return state;
221}
222
223
224
225//**************************************************************************
226//  LIVE DEVICE
227//**************************************************************************
228
229//-------------------------------------------------
230//  econet_device - constructor
231//-------------------------------------------------
232
233econet_device::econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
234    : device_t(mconfig, ECONET, "Econet", tag, owner, clock)
235{
236   for (int i = 0; i < SIGNAL_COUNT; i++)
237   {
238      m_line[i] = 1;
239   }
240}
241
242
243//-------------------------------------------------
244//  device_start - device-specific startup
245//-------------------------------------------------
246
247void econet_device::device_start()
248{
249   // resolve callbacks
250    m_out_clk_func.resolve(m_out_clk_cb, *this);
251    m_out_data_func.resolve(m_out_data_cb, *this);
252}
253
254
255//-------------------------------------------------
256//  device_stop - device-specific stop
257//-------------------------------------------------
258
259void econet_device::device_stop()
260{
261   m_device_list.reset();
262}
263
264
265//-------------------------------------------------
266//  add_device -
267//-------------------------------------------------
268
269void econet_device::add_device(device_t *target, int address)
270{
271   daisy_entry *entry = auto_alloc(machine(), daisy_entry(target));
272
273   entry->m_interface->m_econet = this;
274   entry->m_interface->m_address = address;
275
276   m_device_list.append(*entry);
277}
278
279
280//-------------------------------------------------
281//  daisy_entry - constructor
282//-------------------------------------------------
283
284econet_device::daisy_entry::daisy_entry(device_t *device)
285   : m_next(NULL),
286     m_device(device),
287     m_interface(NULL)
288{
289   for (int i = 0; i < SIGNAL_COUNT; i++)
290   {
291      m_line[i] = 1;
292   }
293
294   device->interface(m_interface);
295}
296
297
298//-------------------------------------------------
299//  clk_r -
300//-------------------------------------------------
301
302READ_LINE_MEMBER( econet_device::clk_r )
303{
304   return get_signal(CLK);
305}
306
307
308//-------------------------------------------------
309//  data_r -
310//-------------------------------------------------
311
312READ_LINE_MEMBER( econet_device::data_r )
313{
314   return get_signal(DATA);
315}
316
317
318//-------------------------------------------------
319//  clk_w -
320//-------------------------------------------------
321
322WRITE_LINE_MEMBER( econet_device::clk_w )
323{
324   set_signal(this, CLK, state);
325}
326
327
328//-------------------------------------------------
329//  data_w -
330//-------------------------------------------------
331
332WRITE_LINE_MEMBER( econet_device::data_w )
333{
334   set_signal(this, DATA, state);
335}
336
337
338//-------------------------------------------------
339//  clk_w -
340//-------------------------------------------------
341
342void econet_device::clk_w(device_t *device, int state)
343{
344   set_signal(device, CLK, state);
345}
346
347
348//-------------------------------------------------
349//  data_w -
350//-------------------------------------------------
351
352void econet_device::data_w(device_t *device, int state)
353{
354   set_signal(device, DATA, state);
355}
1/**********************************************************************
2 
3    Acorn Computers Econet local area network emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "econet.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS / CONSTANTS
16//**************************************************************************
17 
18#define LOG 0
19 
20 
21static const char *const SIGNAL_NAME[] = { "CLK", "DATA" };
22 
23 
24 
25//**************************************************************************
26//  DEVICE DEFINITIONS
27//**************************************************************************
28 
29const device_type ECONET = &device_creator<econet_device>;
30const device_type ECONET_SLOT = &device_creator<econet_slot_device>;
31 
32 
33 
34//**************************************************************************
35//  DEVICE INTERFACE
36//**************************************************************************
37 
38//-------------------------------------------------
39//  device_econet_interface - constructor
40//-------------------------------------------------
41 
42device_econet_interface::device_econet_interface(const machine_config &mconfig, device_t &device)
43   : device_slot_card_interface(mconfig, device)
44{
45}
46 
47 
48//-------------------------------------------------
49//  ~device_econet_interface - destructor
50//-------------------------------------------------
51 
52device_econet_interface::~device_econet_interface()
53{
54}
55 
56 
57 
58//**************************************************************************
59//  LIVE DEVICE
60//**************************************************************************
61 
62//-------------------------------------------------
63//  econet_slot_device - constructor
64//-------------------------------------------------
65 
66econet_slot_device::econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
67        device_t(mconfig, ECONET_SLOT, "Econet station", tag, owner, clock),
68      device_slot_interface(mconfig, *this)
69{
70}
71 
72 
73//-------------------------------------------------
74//  static_set_slot -
75//-------------------------------------------------
76 
77void econet_slot_device::static_set_slot(device_t &device, int address)
78{
79   econet_slot_device &econet_card = dynamic_cast<econet_slot_device &>(device);
80   econet_card.m_address = address;
81}
82 
83 
84//-------------------------------------------------
85//  device_start - device-specific startup
86//-------------------------------------------------
87 
88void econet_slot_device::device_start()
89{
90   m_econet = machine().device<econet_device>(ECONET_TAG);
91   device_econet_interface *dev = dynamic_cast<device_econet_interface *>(get_card_device());
92   if (dev) m_econet->add_device(get_card_device(), m_address);
93}
94 
95 
96 
97//**************************************************************************
98//  DEVICE CONFIGURATION
99//**************************************************************************
100 
101//-------------------------------------------------
102//  device_config_complete - perform any
103//  operations now that the configuration is
104//  complete
105//-------------------------------------------------
106 
107void econet_device::device_config_complete()
108{
109   // inherit a copy of the static data
110   const econet_interface *intf = reinterpret_cast<const econet_interface *>(static_config());
111   if (intf != NULL)
112      *static_cast<econet_interface *>(this) = *intf;
113 
114   // or initialize to defaults if none provided
115   else
116   {
117      memset(&m_out_clk_cb, 0, sizeof(m_out_clk_cb));
118      memset(&m_out_data_cb, 0, sizeof(m_out_data_cb));
119   }
120}
121 
122 
123 
124//**************************************************************************
125//  INLINE HELPERS
126//**************************************************************************
127 
128//-------------------------------------------------
129//  set_signal -
130//-------------------------------------------------
131 
132inline void econet_device::set_signal(device_t *device, int signal, int state)
133{
134   bool changed = false;
135 
136   if (device == this)
137   {
138      if (m_line[signal] != state)
139      {
140         if (LOG) logerror("Econet: '%s' %s %u\n", tag(), SIGNAL_NAME[signal], state);
141         m_line[signal] = state;
142         changed = true;
143      }
144   }
145   else
146   {
147      daisy_entry *entry = m_device_list.first();
148 
149      while (entry)
150      {
151         if (!strcmp(entry->m_device->tag(), device->tag()))
152         {
153            if (entry->m_line[signal] != state)
154            {
155               if (LOG) logerror("Econet: '%s' %s %u\n", device->tag(), SIGNAL_NAME[signal], state);
156               entry->m_line[signal] = state;
157               changed = true;
158            }
159         }
160 
161         entry = entry->next();
162      }
163   }
164 
165   if (changed)
166   {
167      switch (signal)
168      {
169      case CLK:   m_out_clk_func(state);   break;
170      case DATA:   m_out_data_func(state);   break;
171      }
172 
173      daisy_entry *entry = m_device_list.first();
174 
175      while (entry)
176      {
177         switch (signal)
178         {
179         case CLK:
180            entry->m_interface->econet_clk(state);
181            break;
182 
183         case DATA:
184            entry->m_interface->econet_data(state);
185            break;
186         }
187 
188         entry = entry->next();
189      }
190 
191      if (LOG) logerror("Econet: CLK %u DATA %u\n", get_signal(CLK), get_signal(DATA));
192   }
193}
194 
195 
196//-------------------------------------------------
197//  get_signal -
198//-------------------------------------------------
199 
200inline int econet_device::get_signal(int signal)
201{
202   int state = m_line[signal];
203 
204   if (state)
205   {
206      daisy_entry *entry = m_device_list.first();
207 
208      while (entry)
209      {
210         if (!entry->m_line[signal])
211         {
212            state = 0;
213            break;
214         }
215 
216         entry = entry->next();
217      }
218   }
219 
220   return state;
221}
222 
223 
224 
225//**************************************************************************
226//  LIVE DEVICE
227//**************************************************************************
228 
229//-------------------------------------------------
230//  econet_device - constructor
231//-------------------------------------------------
232 
233econet_device::econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
234    : device_t(mconfig, ECONET, "Econet", tag, owner, clock)
235{
236   for (int i = 0; i < SIGNAL_COUNT; i++)
237   {
238      m_line[i] = 1;
239   }
240}
241 
242 
243//-------------------------------------------------
244//  device_start - device-specific startup
245//-------------------------------------------------
246 
247void econet_device::device_start()
248{
249   // resolve callbacks
250    m_out_clk_func.resolve(m_out_clk_cb, *this);
251    m_out_data_func.resolve(m_out_data_cb, *this);
252}
253 
254 
255//-------------------------------------------------
256//  device_stop - device-specific stop
257//-------------------------------------------------
258 
259void econet_device::device_stop()
260{
261   m_device_list.reset();
262}
263 
264 
265//-------------------------------------------------
266//  add_device -
267//-------------------------------------------------
268 
269void econet_device::add_device(device_t *target, int address)
270{
271   daisy_entry *entry = auto_alloc(machine(), daisy_entry(target));
272 
273   entry->m_interface->m_econet = this;
274   entry->m_interface->m_address = address;
275 
276   m_device_list.append(*entry);
277}
278 
279 
280//-------------------------------------------------
281//  daisy_entry - constructor
282//-------------------------------------------------
283 
284econet_device::daisy_entry::daisy_entry(device_t *device)
285   : m_next(NULL),
286     m_device(device),
287     m_interface(NULL)
288{
289   for (int i = 0; i < SIGNAL_COUNT; i++)
290   {
291      m_line[i] = 1;
292   }
293 
294   device->interface(m_interface);
295}
296 
297 
298//-------------------------------------------------
299//  clk_r -
300//-------------------------------------------------
301 
302READ_LINE_MEMBER( econet_device::clk_r )
303{
304   return get_signal(CLK);
305}
306 
307 
308//-------------------------------------------------
309//  data_r -
310//-------------------------------------------------
311 
312READ_LINE_MEMBER( econet_device::data_r )
313{
314   return get_signal(DATA);
315}
316 
317 
318//-------------------------------------------------
319//  clk_w -
320//-------------------------------------------------
321 
322WRITE_LINE_MEMBER( econet_device::clk_w )
323{
324   set_signal(this, CLK, state);
325}
326 
327 
328//-------------------------------------------------
329//  data_w -
330//-------------------------------------------------
331 
332WRITE_LINE_MEMBER( econet_device::data_w )
333{
334   set_signal(this, DATA, state);
335}
336 
337 
338//-------------------------------------------------
339//  clk_w -
340//-------------------------------------------------
341 
342void econet_device::clk_w(device_t *device, int state)
343{
344   set_signal(device, CLK, state);
345}
346 
347 
348//-------------------------------------------------
349//  data_w -
350//-------------------------------------------------
351 
352void econet_device::data_w(device_t *device, int state)
353{
354   set_signal(device, DATA, state);
355}
src/mess/machine/econet.h
r15442r15443
1/**********************************************************************
2
3    Acorn Computers Econet local area network emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __ECONET__
13#define __ECONET__
14
15#include "emu.h"
16
17
18
19//**************************************************************************
20//  MACROS / CONSTANTS
21//**************************************************************************
22
23#define ECONET_TAG         "econet"
24
25
26
27//**************************************************************************
28//  INTERFACE CONFIGURATION MACROS
29//**************************************************************************
30
31#define MCFG_ECONET_ADD(_config) \
32    MCFG_DEVICE_ADD(ECONET_TAG, ECONET, 0) \
33    MCFG_DEVICE_CONFIG(_config)
34
35
36#define ECONET_INTERFACE(_name) \
37   const econet_interface (_name) =
38
39
40#define MCFG_ECONET_SLOT_ADD(_tag, _num, _slot_intf, _def_slot, _def_inp) \
41    MCFG_DEVICE_ADD(_tag, ECONET_SLOT, 0) \
42   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) \
43   econet_slot_device::static_set_slot(*device, _num);
44
45
46
47//**************************************************************************
48//  TYPE DEFINITIONS
49//**************************************************************************
50
51// ======================> econet_interface
52
53struct econet_interface
54{
55   devcb_write_line   m_out_clk_cb;
56   devcb_write_line   m_out_data_cb;
57};
58
59
60// ======================> econet_device
61
62class device_econet_interface;
63
64class econet_device : public device_t,
65                 public econet_interface
66{
67public:
68   // construction/destruction
69   econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
70
71   void add_device(device_t *target, int address);
72
73   // reads for both host and peripherals
74   DECLARE_READ_LINE_MEMBER( clk_r );
75   DECLARE_READ_LINE_MEMBER( data_r );
76
77   // writes for host (driver_device)
78   DECLARE_WRITE_LINE_MEMBER( clk_w );
79   DECLARE_WRITE_LINE_MEMBER( data_w );
80
81   // writes for peripherals (device_t)
82   void clk_w(device_t *device, int state);
83   void data_w(device_t *device, int state);
84
85protected:
86   enum
87   {
88      CLK = 0,
89      DATA,
90      SIGNAL_COUNT
91   };
92
93   // device-level overrides
94    virtual void device_config_complete();
95    virtual void device_start();
96    virtual void device_stop();
97
98   class daisy_entry
99   {
100   public:
101      daisy_entry(device_t *device);
102      daisy_entry *next() const { return m_next; }
103
104      daisy_entry *            m_next;         // next device
105      device_t *               m_device;      // associated device
106      device_econet_interface *   m_interface;   // associated device's daisy interface
107
108      int m_line[SIGNAL_COUNT];
109   };
110
111   simple_list<daisy_entry> m_device_list;
112
113private:
114   devcb_resolved_write_line   m_out_clk_func;
115   devcb_resolved_write_line   m_out_data_func;
116
117   inline void set_signal(device_t *device, int signal, int state);
118   inline int get_signal(int signal);
119
120   int m_line[SIGNAL_COUNT];
121};
122
123
124// ======================> econet_slot_device
125
126class econet_slot_device : public device_t,
127                     public device_slot_interface
128{
129public:
130   // construction/destruction
131   econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
132
133   // device-level overrides
134   virtual void device_start();
135
136    // inline configuration
137    static void static_set_slot(device_t &device, int address);
138
139private:
140   // configuration
141   UINT8 m_address;
142   econet_device  *m_econet;
143};
144
145
146// ======================> device_econet_interface
147
148class device_econet_interface : public device_slot_card_interface
149{
150   friend class econet_device;
151
152public:
153   // construction/destruction
154   device_econet_interface(const machine_config &mconfig, device_t &device);
155   virtual ~device_econet_interface();
156
157   device_econet_interface *next() const { return m_next; }
158   device_econet_interface *m_next;
159
160   // optional operation overrides
161   virtual void econet_clk(int state) = 0;
162   virtual void econet_data(int state) { };
163
164   econet_device  *m_econet;
165   UINT8 m_address;
166};
167
168
169// device type definition
170extern const device_type ECONET;
171extern const device_type ECONET_SLOT;
172
173
174
175#endif
1/**********************************************************************
2 
3    Acorn Computers Econet local area network emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __ECONET__
13#define __ECONET__
14 
15#include "emu.h"
16 
17 
18 
19//**************************************************************************
20//  MACROS / CONSTANTS
21//**************************************************************************
22 
23#define ECONET_TAG         "econet"
24 
25 
26 
27//**************************************************************************
28//  INTERFACE CONFIGURATION MACROS
29//**************************************************************************
30 
31#define MCFG_ECONET_ADD(_config) \
32    MCFG_DEVICE_ADD(ECONET_TAG, ECONET, 0) \
33    MCFG_DEVICE_CONFIG(_config)
34 
35 
36#define ECONET_INTERFACE(_name) \
37   const econet_interface (_name) =
38 
39 
40#define MCFG_ECONET_SLOT_ADD(_tag, _num, _slot_intf, _def_slot, _def_inp) \
41    MCFG_DEVICE_ADD(_tag, ECONET_SLOT, 0) \
42   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) \
43   econet_slot_device::static_set_slot(*device, _num);
44 
45 
46 
47//**************************************************************************
48//  TYPE DEFINITIONS
49//**************************************************************************
50 
51// ======================> econet_interface
52 
53struct econet_interface
54{
55   devcb_write_line   m_out_clk_cb;
56   devcb_write_line   m_out_data_cb;
57};
58 
59 
60// ======================> econet_device
61 
62class device_econet_interface;
63 
64class econet_device : public device_t,
65                 public econet_interface
66{
67public:
68   // construction/destruction
69   econet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
70 
71   void add_device(device_t *target, int address);
72 
73   // reads for both host and peripherals
74   DECLARE_READ_LINE_MEMBER( clk_r );
75   DECLARE_READ_LINE_MEMBER( data_r );
76 
77   // writes for host (driver_device)
78   DECLARE_WRITE_LINE_MEMBER( clk_w );
79   DECLARE_WRITE_LINE_MEMBER( data_w );
80 
81   // writes for peripherals (device_t)
82   void clk_w(device_t *device, int state);
83   void data_w(device_t *device, int state);
84 
85protected:
86   enum
87   {
88      CLK = 0,
89      DATA,
90      SIGNAL_COUNT
91   };
92 
93   // device-level overrides
94    virtual void device_config_complete();
95    virtual void device_start();
96    virtual void device_stop();
97 
98   class daisy_entry
99   {
100   public:
101      daisy_entry(device_t *device);
102      daisy_entry *next() const { return m_next; }
103 
104      daisy_entry *            m_next;         // next device
105      device_t *               m_device;      // associated device
106      device_econet_interface *   m_interface;   // associated device's daisy interface
107 
108      int m_line[SIGNAL_COUNT];
109   };
110 
111   simple_list<daisy_entry> m_device_list;
112 
113private:
114   devcb_resolved_write_line   m_out_clk_func;
115   devcb_resolved_write_line   m_out_data_func;
116 
117   inline void set_signal(device_t *device, int signal, int state);
118   inline int get_signal(int signal);
119 
120   int m_line[SIGNAL_COUNT];
121};
122 
123 
124// ======================> econet_slot_device
125 
126class econet_slot_device : public device_t,
127                     public device_slot_interface
128{
129public:
130   // construction/destruction
131   econet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
132 
133   // device-level overrides
134   virtual void device_start();
135 
136    // inline configuration
137    static void static_set_slot(device_t &device, int address);
138 
139private:
140   // configuration
141   UINT8 m_address;
142   econet_device  *m_econet;
143};
144 
145 
146// ======================> device_econet_interface
147 
148class device_econet_interface : public device_slot_card_interface
149{
150   friend class econet_device;
151 
152public:
153   // construction/destruction
154   device_econet_interface(const machine_config &mconfig, device_t &device);
155   virtual ~device_econet_interface();
156 
157   device_econet_interface *next() const { return m_next; }
158   device_econet_interface *m_next;
159 
160   // optional operation overrides
161   virtual void econet_clk(int state) = 0;
162   virtual void econet_data(int state) { };
163 
164   econet_device  *m_econet;
165   UINT8 m_address;
166};
167 
168 
169// device type definition
170extern const device_type ECONET;
171extern const device_type ECONET_SLOT;
172 
173 
174 
175#endif
src/mess/machine/nes_pcb.c
r15442r15443
49024902}
49034903
49044904/*************************************************************
4905
4905
49064906 Yoko Bootleg Board
4907
4907
49084908 Games: Mortal Kombat II, Master Figther VI'
4909 
4910 
4909
4910
49114911 Very similar to Cony board
4912
4912
49134913 In MESS: Supported.
4914
4914
49154915 *************************************************************/
49164916
49174917static WRITE8_HANDLER( yoko_l_w )
49184918{
49194919   nes_state *state = space->machine().driver_data<nes_state>();
49204920   LOG_MMC(("cony_l_w, offset: %04x, data: %02x\n", offset, data));
4921   
4921
49224922   if (offset >= 0x1300) // from 0x5400
49234923      state->m_mapper83_low_reg[offset & 0x03] = data;
49244924}
r15442r15443
49274927{
49284928   nes_state *state = space->machine().driver_data<nes_state>();
49294929   LOG_MMC(("cony_l_r, offset: %04x\n", offset));
4930   
4930
49314931   if (offset >= 0x0f00 && offset < 0x1300)   // 0x5000
49324932   {
49334933      // read dipswitch bit! - currently unimplemented
r15442r15443
49714971{
49724972   nes_state *state = space->machine().driver_data<nes_state>();
49734973   LOG_MMC(("yoko_w, offset: %04x, data: %02x\n", offset, data));
4974   
4974
49754975   switch (offset & 0x0c17)
49764976   {
49774977      case 0x0000:
r15442r15443
85768576}
85778577
85788578/*************************************************************
8579
8579
85808580 Board UNL-KS7057
8581
8581
85828582 Games: Street Fighter VI / Fight Street VI
8583
8583
85848584 MMC3 clone (identical, but for switched address lines)
8585
8585
85868586 In MESS: Supported
8587
8587
85888588 *************************************************************/
85898589
85908590static WRITE8_HANDLER( ks7057_w )
r15442r15443
92389238
92399239
92409240/*************************************************************
9241
9241
92429242 Board UNL-FS304
9243
9243
92449244 Games: A Link to the Past by Waixing
9245 
9245
92469246 iNES: mapper 162? (only found in UNIF format)
9247
9247
92489248 In MESS: Supported.
9249
9249
92509250 *************************************************************/
92519251
92529252static WRITE8_HANDLER( unl_fs304_l_w )
src/mess/machine/wangpc_rtc.c
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM040-B Remote Telecommunication controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "wangpc_rtc.h"
11
12
13
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17
18#define OPTION_ID      0x1c
19
20#define Z80_TAG         "z80"
21#define AM9517A_TAG      "am9517"
22#define Z80CTC_0_TAG   "z80ctc_0"
23#define Z80CTC_1_TAG   "z80ctc_1"
24#define Z80SIO_TAG      "z80sio"
25
26
27
28//**************************************************************************
29//  DEVICE DEFINITIONS
30//**************************************************************************
31
32const device_type WANGPC_RTC = &device_creator<wangpc_rtc_device>;
33
34
35//-------------------------------------------------
36//  ROM( wangpc_rtc )
37//-------------------------------------------------
38
39ROM_START( wangpc_rtc )
40   ROM_REGION( 0x1000, Z80_TAG, 0 )
41   ROM_LOAD( "remotecomms-l28.bin", 0x0000, 0x1000, CRC(c05a1bee) SHA1(6b3f0d787d014b1fd3925812c905ddb63c5055f1) )
42ROM_END
43
44
45//-------------------------------------------------
46//  rom_region - device-specific ROM region
47//-------------------------------------------------
48
49const rom_entry *wangpc_rtc_device::device_rom_region() const
50{
51   return ROM_NAME( wangpc_rtc );
52}
53
54
55//-------------------------------------------------
56//  ADDRESS_MAP( wangpc_rtc_mem )
57//-------------------------------------------------
58
59static ADDRESS_MAP_START( wangpc_rtc_mem, AS_PROGRAM, 8, wangpc_rtc_device )
60   AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION(Z80_TAG, 0)
61   AM_RANGE(0x1000, 0xffff) AM_RAM
62ADDRESS_MAP_END
63
64
65//-------------------------------------------------
66//  ADDRESS_MAP( wangpc_rtc_io )
67//-------------------------------------------------
68
69static ADDRESS_MAP_START( wangpc_rtc_io, AS_IO, 8, wangpc_rtc_device )
70   ADDRESS_MAP_GLOBAL_MASK(0xff)
71   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_cd_ba_r, z80dart_cd_ba_w)
72   AM_RANGE(0x10, 0x1f) AM_DEVREADWRITE(AM9517A_TAG, am9517a_device, read, write)
73   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE_LEGACY(Z80CTC_0_TAG, z80ctc_r, z80ctc_w)
74   AM_RANGE(0x30, 0x30) //AM_WRITE(clear_char_w)
75   AM_RANGE(0x31, 0x31) //AM_WRITE(set_char_w)
76   AM_RANGE(0x40, 0x40) AM_READ_PORT("SW1") //AM_WRITE(control_w)
77   AM_RANGE(0x44, 0x44) //AM_READ(i8086_status_r) AM_WRITE(reset_w)
78   AM_RANGE(0x48, 0x48) //AM_WRITE(dte_ready_w)
79   AM_RANGE(0x4c, 0x4c) //AM_READWRITE(8232_acu_r, 8232_acu_w)
80   AM_RANGE(0x50, 0x50) //AM_READ(outbound_data_r)
81   AM_RANGE(0x51, 0x52) //AM_WRITE(status_w)
82   AM_RANGE(0x54, 0x54) //AM_WRITE(enable_inbound_data_w)
83   AM_RANGE(0x51, 0x52) //AM_WRITE(inbound_data_w)
84   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE_LEGACY(Z80CTC_1_TAG, z80ctc_r, z80ctc_w)
85   AM_RANGE(0x70, 0x70) //AM_READWRITE(led_toggle_r, odd_parity_w)
86   AM_RANGE(0x71, 0x71) //AM_WRITE(even_parity_w)
87ADDRESS_MAP_END
88
89
90//-------------------------------------------------
91//  z80_daisy_config wangpc_rtc_daisy_chain
92//-------------------------------------------------
93
94static const z80_daisy_config wangpc_rtc_daisy_chain[] =
95{
96   { Z80SIO_TAG },
97   { Z80CTC_0_TAG },
98   { Z80CTC_1_TAG },
99   { NULL }
100};
101
102
103//-------------------------------------------------
104//  I8237_INTERFACE( dmac_intf )
105//-------------------------------------------------
106
107static I8237_INTERFACE( dmac_intf )
108{
109   DEVCB_NULL,
110   DEVCB_NULL,
111   DEVCB_NULL,
112   DEVCB_NULL,
113   { DEVCB_NULL,
114     DEVCB_NULL,
115     DEVCB_NULL,
116     DEVCB_NULL, },
117   { DEVCB_NULL,
118     DEVCB_NULL,
119     DEVCB_NULL,
120     DEVCB_NULL, },
121   { DEVCB_NULL,
122     DEVCB_NULL,
123     DEVCB_NULL,
124     DEVCB_NULL }
125};
126
127
128//-------------------------------------------------
129//  Z80CTC_INTERFACE( ctc0_intf )
130//-------------------------------------------------
131
132static Z80CTC_INTERFACE( ctc0_intf )
133{
134   0,
135   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
136   DEVCB_NULL,
137   DEVCB_NULL,
138   DEVCB_NULL
139};
140
141
142//-------------------------------------------------
143//  Z80CTC_INTERFACE( ctc1_intf )
144//-------------------------------------------------
145
146static Z80CTC_INTERFACE( ctc1_intf )
147{
148   0,
149   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
150   DEVCB_NULL,
151   DEVCB_NULL,
152   DEVCB_NULL
153};
154
155
156//-------------------------------------------------
157//  Z80DART_INTERFACE( sio_intf )
158//-------------------------------------------------
159
160static Z80DART_INTERFACE( sio_intf )
161{
162   0, 0, 0, 0,
163
164   DEVCB_NULL,
165   DEVCB_NULL,
166   DEVCB_NULL,
167   DEVCB_NULL,
168   DEVCB_NULL,
169   DEVCB_NULL,
170
171   DEVCB_NULL,
172   DEVCB_NULL,
173   DEVCB_NULL,
174   DEVCB_NULL,
175   DEVCB_NULL,
176   DEVCB_NULL,
177
178   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0)
179};
180
181
182//-------------------------------------------------
183//  MACHINE_CONFIG_FRAGMENT( wangpc_rtc )
184//-------------------------------------------------
185
186static MACHINE_CONFIG_FRAGMENT( wangpc_rtc )
187   MCFG_CPU_ADD(Z80_TAG, Z80, 2000000)
188   MCFG_CPU_CONFIG(wangpc_rtc_daisy_chain)
189   MCFG_CPU_PROGRAM_MAP(wangpc_rtc_mem)
190   MCFG_CPU_IO_MAP(wangpc_rtc_io)
191
192   MCFG_I8237_ADD(AM9517A_TAG, 2000000, dmac_intf)
193   MCFG_Z80CTC_ADD(Z80CTC_0_TAG, 2000000, ctc0_intf)
194   MCFG_Z80CTC_ADD(Z80CTC_1_TAG, 2000000, ctc1_intf)
195   MCFG_Z80DART_ADD(Z80SIO_TAG, 2000000, sio_intf)
196MACHINE_CONFIG_END
197
198
199//-------------------------------------------------
200//  machine_config_additions - device-specific
201//  machine configurations
202//-------------------------------------------------
203
204machine_config_constructor wangpc_rtc_device::device_mconfig_additions() const
205{
206   return MACHINE_CONFIG_NAME( wangpc_rtc );
207}
208
209
210//-------------------------------------------------
211//  INPUT_PORTS( wangpc_rtc )
212//-------------------------------------------------
213
214INPUT_PORTS_START( wangpc_rtc )
215   PORT_START("SW1")
216   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
217   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
218   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
219   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
220   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
221   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
222   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
223   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
225   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
226   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
228   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5")
229   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
230   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
231   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
232   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
233   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
234   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
235   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
236   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
237   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8")
238   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
240INPUT_PORTS_END
241
242
243//-------------------------------------------------
244//  input_ports - device-specific input ports
245//-------------------------------------------------
246
247ioport_constructor wangpc_rtc_device::device_input_ports() const
248{
249   return INPUT_PORTS_NAME( wangpc_rtc );
250}
251
252
253
254
255//**************************************************************************
256//  LIVE DEVICE
257//**************************************************************************
258
259//-------------------------------------------------
260//  wangpc_rtc_device - constructor
261//-------------------------------------------------
262
263wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
264   device_t(mconfig, WANGPC_RTC, "Wang PC-PM040-B", tag, owner, clock),
265   device_wangpcbus_card_interface(mconfig, *this),
266   m_maincpu(*this, Z80_TAG),
267   m_dmac(*this, AM9517A_TAG),
268   m_ctc0(*this, Z80CTC_0_TAG),
269   m_ctc1(*this, Z80CTC_1_TAG),
270   m_sio(*this, Z80SIO_TAG)
271{
272}
273
274
275//-------------------------------------------------
276//  device_start - device-specific startup
277//-------------------------------------------------
278
279void wangpc_rtc_device::device_start()
280{
281}
282
283
284//-------------------------------------------------
285//  device_reset - device-specific reset
286//-------------------------------------------------
287
288void wangpc_rtc_device::device_reset()
289{
290}
291
292
293//-------------------------------------------------
294//  wangpcbus_mrdc_r - memory read
295//-------------------------------------------------
296
297UINT16 wangpc_rtc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
298{
299   UINT16 data = 0xffff;
300   
301   return data;
302}
303
304
305//-------------------------------------------------
306//  wangpcbus_amwc_w - memory write
307//-------------------------------------------------
308
309void wangpc_rtc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
310{
311}
312
313
314//-------------------------------------------------
315//  wangpcbus_iorc_r - I/O read
316//-------------------------------------------------
317
318UINT16 wangpc_rtc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
319{
320   UINT16 data = 0xffff;
321
322   if (sad(offset))
323   {
324      switch (offset & 0x7f)
325      {
326      case 0xfe/2:
327         data = 0xff00 | OPTION_ID;
328         break;
329      }
330   }
331
332   return data;
333}
334
335
336//-------------------------------------------------
337//  wangpcbus_aiowc_w - I/O write
338//-------------------------------------------------
339
340void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
341{
342   if (sad(offset))
343   {
344      switch (offset & 0x7f)
345      {
346      case 0xfc/2:
347         device_reset();
348         break;
349      }
350   }
351}
1/**********************************************************************
2 
3    Wang PC-PM040-B Remote Telecommunication controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "wangpc_rtc.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17 
18#define OPTION_ID      0x1c
19 
20#define Z80_TAG         "z80"
21#define AM9517A_TAG      "am9517"
22#define Z80CTC_0_TAG   "z80ctc_0"
23#define Z80CTC_1_TAG   "z80ctc_1"
24#define Z80SIO_TAG      "z80sio"
25 
26 
27 
28//**************************************************************************
29//  DEVICE DEFINITIONS
30//**************************************************************************
31 
32const device_type WANGPC_RTC = &device_creator<wangpc_rtc_device>;
33 
34 
35//-------------------------------------------------
36//  ROM( wangpc_rtc )
37//-------------------------------------------------
38 
39ROM_START( wangpc_rtc )
40   ROM_REGION( 0x1000, Z80_TAG, 0 )
41   ROM_LOAD( "remotecomms-l28.bin", 0x0000, 0x1000, CRC(c05a1bee) SHA1(6b3f0d787d014b1fd3925812c905ddb63c5055f1) )
42ROM_END
43 
44 
45//-------------------------------------------------
46//  rom_region - device-specific ROM region
47//-------------------------------------------------
48 
49const rom_entry *wangpc_rtc_device::device_rom_region() const
50{
51   return ROM_NAME( wangpc_rtc );
52}
53 
54 
55//-------------------------------------------------
56//  ADDRESS_MAP( wangpc_rtc_mem )
57//-------------------------------------------------
58 
59static ADDRESS_MAP_START( wangpc_rtc_mem, AS_PROGRAM, 8, wangpc_rtc_device )
60   AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION(Z80_TAG, 0)
61   AM_RANGE(0x1000, 0xffff) AM_RAM
62ADDRESS_MAP_END
63 
64 
65//-------------------------------------------------
66//  ADDRESS_MAP( wangpc_rtc_io )
67//-------------------------------------------------
68 
69static ADDRESS_MAP_START( wangpc_rtc_io, AS_IO, 8, wangpc_rtc_device )
70   ADDRESS_MAP_GLOBAL_MASK(0xff)
71   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_cd_ba_r, z80dart_cd_ba_w)
72   AM_RANGE(0x10, 0x1f) AM_DEVREADWRITE(AM9517A_TAG, am9517a_device, read, write)
73   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE_LEGACY(Z80CTC_0_TAG, z80ctc_r, z80ctc_w)
74   AM_RANGE(0x30, 0x30) //AM_WRITE(clear_char_w)
75   AM_RANGE(0x31, 0x31) //AM_WRITE(set_char_w)
76   AM_RANGE(0x40, 0x40) AM_READ_PORT("SW1") //AM_WRITE(control_w)
77   AM_RANGE(0x44, 0x44) //AM_READ(i8086_status_r) AM_WRITE(reset_w)
78   AM_RANGE(0x48, 0x48) //AM_WRITE(dte_ready_w)
79   AM_RANGE(0x4c, 0x4c) //AM_READWRITE(8232_acu_r, 8232_acu_w)
80   AM_RANGE(0x50, 0x50) //AM_READ(outbound_data_r)
81   AM_RANGE(0x51, 0x52) //AM_WRITE(status_w)
82   AM_RANGE(0x54, 0x54) //AM_WRITE(enable_inbound_data_w)
83   AM_RANGE(0x51, 0x52) //AM_WRITE(inbound_data_w)
84   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE_LEGACY(Z80CTC_1_TAG, z80ctc_r, z80ctc_w)
85   AM_RANGE(0x70, 0x70) //AM_READWRITE(led_toggle_r, odd_parity_w)
86   AM_RANGE(0x71, 0x71) //AM_WRITE(even_parity_w)
87ADDRESS_MAP_END
88 
89 
90//-------------------------------------------------
91//  z80_daisy_config wangpc_rtc_daisy_chain
92//-------------------------------------------------
93 
94static const z80_daisy_config wangpc_rtc_daisy_chain[] =
95{
96   { Z80SIO_TAG },
97   { Z80CTC_0_TAG },
98   { Z80CTC_1_TAG },
99   { NULL }
100};
101 
102 
103//-------------------------------------------------
104//  I8237_INTERFACE( dmac_intf )
105//-------------------------------------------------
106 
107static I8237_INTERFACE( dmac_intf )
108{
109   DEVCB_NULL,
110   DEVCB_NULL,
111   DEVCB_NULL,
112   DEVCB_NULL,
113   { DEVCB_NULL,
114     DEVCB_NULL,
115     DEVCB_NULL,
116     DEVCB_NULL, },
117   { DEVCB_NULL,
118     DEVCB_NULL,
119     DEVCB_NULL,
120     DEVCB_NULL, },
121   { DEVCB_NULL,
122     DEVCB_NULL,
123     DEVCB_NULL,
124     DEVCB_NULL }
125};
126 
127 
128//-------------------------------------------------
129//  Z80CTC_INTERFACE( ctc0_intf )
130//-------------------------------------------------
131 
132static Z80CTC_INTERFACE( ctc0_intf )
133{
134   0,
135   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
136   DEVCB_NULL,
137   DEVCB_NULL,
138   DEVCB_NULL
139};
140 
141 
142//-------------------------------------------------
143//  Z80CTC_INTERFACE( ctc1_intf )
144//-------------------------------------------------
145 
146static Z80CTC_INTERFACE( ctc1_intf )
147{
148   0,
149   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
150   DEVCB_NULL,
151   DEVCB_NULL,
152   DEVCB_NULL
153};
154 
155 
156//-------------------------------------------------
157//  Z80DART_INTERFACE( sio_intf )
158//-------------------------------------------------
159 
160static Z80DART_INTERFACE( sio_intf )
161{
162   0, 0, 0, 0,
163 
164   DEVCB_NULL,
165   DEVCB_NULL,
166   DEVCB_NULL,
167   DEVCB_NULL,
168   DEVCB_NULL,
169   DEVCB_NULL,
170 
171   DEVCB_NULL,
172   DEVCB_NULL,
173   DEVCB_NULL,
174   DEVCB_NULL,
175   DEVCB_NULL,
176   DEVCB_NULL,
177 
178   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0)
179};
180 
181 
182//-------------------------------------------------
183//  MACHINE_CONFIG_FRAGMENT( wangpc_rtc )
184//-------------------------------------------------
185 
186static MACHINE_CONFIG_FRAGMENT( wangpc_rtc )
187   MCFG_CPU_ADD(Z80_TAG, Z80, 2000000)
188   MCFG_CPU_CONFIG(wangpc_rtc_daisy_chain)
189   MCFG_CPU_PROGRAM_MAP(wangpc_rtc_mem)
190   MCFG_CPU_IO_MAP(wangpc_rtc_io)
191 
192   MCFG_I8237_ADD(AM9517A_TAG, 2000000, dmac_intf)
193   MCFG_Z80CTC_ADD(Z80CTC_0_TAG, 2000000, ctc0_intf)
194   MCFG_Z80CTC_ADD(Z80CTC_1_TAG, 2000000, ctc1_intf)
195   MCFG_Z80DART_ADD(Z80SIO_TAG, 2000000, sio_intf)
196MACHINE_CONFIG_END
197 
198 
199//-------------------------------------------------
200//  machine_config_additions - device-specific
201//  machine configurations
202//-------------------------------------------------
203 
204machine_config_constructor wangpc_rtc_device::device_mconfig_additions() const
205{
206   return MACHINE_CONFIG_NAME( wangpc_rtc );
207}
208 
209 
210//-------------------------------------------------
211//  INPUT_PORTS( wangpc_rtc )
212//-------------------------------------------------
213 
214INPUT_PORTS_START( wangpc_rtc )
215   PORT_START("SW1")
216   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
217   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
218   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
219   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2")
220   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
221   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
222   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3")
223   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
225   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4")
226   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
227   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
228   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5")
229   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
230   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
231   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6")
232   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
233   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
234   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7")
235   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
236   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
237   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8")
238   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
239   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
240INPUT_PORTS_END
241 
242 
243//-------------------------------------------------
244//  input_ports - device-specific input ports
245//-------------------------------------------------
246 
247ioport_constructor wangpc_rtc_device::device_input_ports() const
248{
249   return INPUT_PORTS_NAME( wangpc_rtc );
250}
251 
252 
253 
254 
255//**************************************************************************
256//  LIVE DEVICE
257//**************************************************************************
258 
259//-------------------------------------------------
260//  wangpc_rtc_device - constructor
261//-------------------------------------------------
262 
263wangpc_rtc_device::wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
264   device_t(mconfig, WANGPC_RTC, "Wang PC-PM040-B", tag, owner, clock),
265   device_wangpcbus_card_interface(mconfig, *this),
266   m_maincpu(*this, Z80_TAG),
267   m_dmac(*this, AM9517A_TAG),
268   m_ctc0(*this, Z80CTC_0_TAG),
269   m_ctc1(*this, Z80CTC_1_TAG),
270   m_sio(*this, Z80SIO_TAG)
271{
272}
273 
274 
275//-------------------------------------------------
276//  device_start - device-specific startup
277//-------------------------------------------------
278 
279void wangpc_rtc_device::device_start()
280{
281}
282 
283 
284//-------------------------------------------------
285//  device_reset - device-specific reset
286//-------------------------------------------------
287 
288void wangpc_rtc_device::device_reset()
289{
290}
291 
292 
293//-------------------------------------------------
294//  wangpcbus_mrdc_r - memory read
295//-------------------------------------------------
296 
297UINT16 wangpc_rtc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
298{
299   UINT16 data = 0xffff;
300 
301   return data;
302}
303 
304 
305//-------------------------------------------------
306//  wangpcbus_amwc_w - memory write
307//-------------------------------------------------
308 
309void wangpc_rtc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
310{
311}
312 
313 
314//-------------------------------------------------
315//  wangpcbus_iorc_r - I/O read
316//-------------------------------------------------
317 
318UINT16 wangpc_rtc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
319{
320   UINT16 data = 0xffff;
321 
322   if (sad(offset))
323   {
324      switch (offset & 0x7f)
325      {
326      case 0xfe/2:
327         data = 0xff00 | OPTION_ID;
328         break;
329      }
330   }
331 
332   return data;
333}
334 
335 
336//-------------------------------------------------
337//  wangpcbus_aiowc_w - I/O write
338//-------------------------------------------------
339 
340void wangpc_rtc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
341{
342   if (sad(offset))
343   {
344      switch (offset & 0x7f)
345      {
346      case 0xfc/2:
347         device_reset();
348         break;
349      }
350   }
351}
src/mess/machine/wangpc_rtc.h
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM040-B Remote Telecommunication controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_RTC__
13#define __WANGPC_RTC__
14
15
16#include "emu.h"
17#include "cpu/z80/z80.h"
18#include "machine/am9517a.h"
19#include "machine/wangpcbus.h"
20#include "machine/z80ctc.h"
21#include "machine/z80dart.h"
22
23
24
25//**************************************************************************
26//  TYPE DEFINITIONS
27//**************************************************************************
28
29// ======================> wangpc_rtc_device
30
31class wangpc_rtc_device : public device_t,
32                    public device_wangpcbus_card_interface
33{
34public:
35   // construction/destruction
36   wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37
38   // optional information overrides
39   virtual const rom_entry *device_rom_region() const;
40   virtual machine_config_constructor device_mconfig_additions() const;
41   virtual ioport_constructor device_input_ports() const;
42
43protected:
44   // device-level overrides
45   virtual void device_start();
46   virtual void device_reset();
47   virtual void device_config_complete() { m_shortname = "wangpc_rtc"; }
48
49   // device_wangpcbus_card_interface overrides
50   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
51   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
52   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
53   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
54
55private:
56   required_device<cpu_device> m_maincpu;
57   required_device<am9517a_device> m_dmac;
58   required_device<z80ctc_device> m_ctc0;
59   required_device<z80ctc_device> m_ctc1;
60   required_device<z80dart_device> m_sio;
61
62   UINT8 m_char_ram[256];
63};
64
65
66// device type definition
67extern const device_type WANGPC_RTC;
68
69
70#endif
1/**********************************************************************
2 
3    Wang PC-PM040-B Remote Telecommunication controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_RTC__
13#define __WANGPC_RTC__
14 
15 
16#include "emu.h"
17#include "cpu/z80/z80.h"
18#include "machine/am9517a.h"
19#include "machine/wangpcbus.h"
20#include "machine/z80ctc.h"
21#include "machine/z80dart.h"
22 
23 
24 
25//**************************************************************************
26//  TYPE DEFINITIONS
27//**************************************************************************
28 
29// ======================> wangpc_rtc_device
30 
31class wangpc_rtc_device : public device_t,
32                    public device_wangpcbus_card_interface
33{
34public:
35   // construction/destruction
36   wangpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37 
38   // optional information overrides
39   virtual const rom_entry *device_rom_region() const;
40   virtual machine_config_constructor device_mconfig_additions() const;
41   virtual ioport_constructor device_input_ports() const;
42 
43protected:
44   // device-level overrides
45   virtual void device_start();
46   virtual void device_reset();
47   virtual void device_config_complete() { m_shortname = "wangpc_rtc"; }
48 
49   // device_wangpcbus_card_interface overrides
50   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
51   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
52   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
53   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
54 
55private:
56   required_device<cpu_device> m_maincpu;
57   required_device<am9517a_device> m_dmac;
58   required_device<z80ctc_device> m_ctc0;
59   required_device<z80ctc_device> m_ctc1;
60   required_device<z80dart_device> m_sio;
61 
62   UINT8 m_char_ram[256];
63};
64 
65 
66// device type definition
67extern const device_type WANGPC_RTC;
68 
69 
70#endif
src/mess/machine/a2videoterm.c
r15442r15443
8989
9090ROM_START( a2ap16 )
9191   ROM_REGION(0x2000, VIDEOTERM_ROM_REGION, 0)
92    ROM_LOAD( "space 84 video ap16.bin", 0x000000, 0x002000, CRC(0e188da2) SHA1(9a29250b6cc7b576fdc67769944de35e6f54b9d5) )
92    ROM_LOAD( "space 84 video ap16.bin", 0x000000, 0x002000, CRC(0e188da2) SHA1(9a29250b6cc7b576fdc67769944de35e6f54b9d5) )
9393
9494   ROM_REGION(0x4000, VIDEOTERM_GFX_REGION, 0)
95    ROM_LOAD( "space 84 video chargen ap16.bin", 0x000000, 0x002000, CRC(b9447088) SHA1(19c95f91a67b948fc00a14621d574d629479d451) )
95    ROM_LOAD( "space 84 video chargen ap16.bin", 0x000000, 0x002000, CRC(b9447088) SHA1(19c95f91a67b948fc00a14621d574d629479d451) )
9696ROM_END
9797
9898ROM_START( a2ap16alt )
9999   ROM_REGION(0x1000, VIDEOTERM_ROM_REGION, 0)
100    ROM_LOAD( "unknown apple ii clone video 3.bin", 0x000000, 0x001000, CRC(af1226d2) SHA1(18a569f417a47f54a17bd9046d306a54b46ed049) )
100    ROM_LOAD( "unknown apple ii clone video 3.bin", 0x000000, 0x001000, CRC(af1226d2) SHA1(18a569f417a47f54a17bd9046d306a54b46ed049) )
101101
102102   ROM_REGION(0x4000, VIDEOTERM_GFX_REGION, 0)
103    ROM_LOAD( "unknown apple ii clone video 1.bin", 0x000000, 0x001000, CRC(cf84811c) SHA1(135f4f35607dd74941f0a3cae813227bf8a8a020) )
103    ROM_LOAD( "unknown apple ii clone video 1.bin", 0x000000, 0x001000, CRC(cf84811c) SHA1(135f4f35607dd74941f0a3cae813227bf8a8a020) )
104104ROM_END
105105
106106ROM_START( vtc1 )
107107   ROM_REGION(0x800, VIDEOTERM_ROM_REGION, 0)
108    ROM_LOAD( "10.ic10.bin",  0x000000, 0x000800, CRC(ddbbc2fb) SHA1(15d6142b177b47c016f2745e1d95767b440d77c7) )
108    ROM_LOAD( "10.ic10.bin",  0x000000, 0x000800, CRC(ddbbc2fb) SHA1(15d6142b177b47c016f2745e1d95767b440d77c7) )
109109
110110   ROM_REGION(0x1000, VIDEOTERM_GFX_REGION, 0)
111    ROM_LOAD( "9.ic9.bin",    0x000000, 0x000800, CRC(094670f1) SHA1(aefae76fb07740d042cf294f01424efa7cc7a199) )
112    ROM_LOAD( "8.ic8.bin",    0x000800, 0x000800, CRC(fbd98d77) SHA1(0d9b1c3917e23ca35d5fbd405f05ff6e87122b92) )
111    ROM_LOAD( "9.ic9.bin",    0x000000, 0x000800, CRC(094670f1) SHA1(aefae76fb07740d042cf294f01424efa7cc7a199) )
112    ROM_LOAD( "8.ic8.bin",    0x000800, 0x000800, CRC(fbd98d77) SHA1(0d9b1c3917e23ca35d5fbd405f05ff6e87122b92) )
113113ROM_END
114114
115115ROM_START( vtc2 )
116116   ROM_REGION(0x800, VIDEOTERM_ROM_REGION, 0)
117    ROM_LOAD( "6.ic6.bin",    0x000000, 0x000800, CRC(5776fa24) SHA1(19f69011ed7d2551c39d5c1cac1f5a2defc8f8fb) )
117    ROM_LOAD( "6.ic6.bin",    0x000000, 0x000800, CRC(5776fa24) SHA1(19f69011ed7d2551c39d5c1cac1f5a2defc8f8fb) )
118118
119119   ROM_REGION(0x1000, VIDEOTERM_GFX_REGION, 0)
120    ROM_LOAD( "5.ic5.bin",    0x000000, 0x000800, CRC(aafa7085) SHA1(54d7c358f1927ba8f3b61145215a806d8cb6b673) )
121    ROM_LOAD( "4.ic4.bin",    0x000800, 0x000800, CRC(8a497a48) SHA1(50c3df528109c65491a001ec74e50351a652c1fd) )
120    ROM_LOAD( "5.ic5.bin",    0x000000, 0x000800, CRC(aafa7085) SHA1(54d7c358f1927ba8f3b61145215a806d8cb6b673) )
121    ROM_LOAD( "4.ic4.bin",    0x000800, 0x000800, CRC(8a497a48) SHA1(50c3df528109c65491a001ec74e50351a652c1fd) )
122122ROM_END
123123
124124/***************************************************************************
src/mess/machine/isa.c
r15442r15443
300300
301301
302302void isa8_device::install_memory(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler)
303{   
303{
304304   install_space(AS_PROGRAM, start, end, mask, mirror, rhandler, whandler);
305305}
306306
r15442r15443
562562            // we handle just misalligned by 2
563563            m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000);
564564         }
565         
565
566566         break;
567567      default:
568568         fatalerror("ISA16: Bus width %d not supported", buswidth);
r15442r15443
590590            // we handle just misalligned by 2
591591            m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start-2, end, mask, mirror, rhandler, whandler, 0xffff0000);
592592         }
593         
593
594594         break;
595595      default:
596596         fatalerror("ISA16: Bus width %d not supported", buswidth);
src/mess/machine/wangpc_wdc.c
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM001 Winchester Disk Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "wangpc_wdc.h"
11#include "machine/scsihd.h"
12
13
14
15//**************************************************************************
16//  MACROS/CONSTANTS
17//**************************************************************************
18
19#define OPTION_ID      0x01
20
21#define Z80_TAG         "l53"
22#define MK3882_TAG      "l07"
23#define SASIBUS_TAG      "sasi"
24
25#define OPTION_DREQ1   BIT(m_option, 1)
26#define OPTION_DREQ2   BIT(m_option, 2)
27#define OPTION_DREQ3   BIT(m_option, 3)
28
29
30
31//**************************************************************************
32//  DEVICE DEFINITIONS
33//**************************************************************************
34
35const device_type WANGPC_WDC = &device_creator<wangpc_wdc_device>;
36
37
38//-------------------------------------------------
39//  ROM( wangpc_wdc )
40//-------------------------------------------------
41
42ROM_START( wangpc_wdc )
43   ROM_REGION( 0x1000, Z80_TAG, 0 )
44   ROM_LOAD( "378-9040 r9.l19", 0x0000, 0x1000, CRC(282770d2) SHA1(a0e3bad5041e0dfd6087907015b07a093b576bc0) )
45
46   ROM_REGION( 0x1000, "address", 0 )
47   ROM_LOAD( "378-9041.l54", 0x0000, 0x1000, CRC(94e9a17d) SHA1(060c576d70069ece2d0dbce86ffc448df2b169e7) )
48
49   ROM_REGION( 0x100, "prom", 0 )
50   ROM_LOAD( "376-8002.l66", 0x000, 0x100, NO_DUMP ) // DL2212-105
51ROM_END
52
53
54//-------------------------------------------------
55//  rom_region - device-specific ROM region
56//-------------------------------------------------
57
58const rom_entry *wangpc_wdc_device::device_rom_region() const
59{
60   return ROM_NAME( wangpc_wdc );
61}
62
63
64//-------------------------------------------------
65//  ADDRESS_MAP( wangpc_wdc_mem )
66//-------------------------------------------------
67
68static ADDRESS_MAP_START( wangpc_wdc_mem, AS_PROGRAM, 8, wangpc_wdc_device )
69   AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION(Z80_TAG, 0)
70   AM_RANGE(0x1000, 0x17ff) AM_RAM
71   AM_RANGE(0x2000, 0x27ff) AM_RAM
72ADDRESS_MAP_END
73
74
75//-------------------------------------------------
76//  ADDRESS_MAP( wangpc_wdc_io )
77//-------------------------------------------------
78
79static ADDRESS_MAP_START( wangpc_wdc_io, AS_IO, 8, wangpc_wdc_device )
80   ADDRESS_MAP_GLOBAL_MASK(0xff)
81   //AM_RANGE(0x01, 0x01) AM_READ() should return 0x72 during self-test
82   AM_RANGE(0x03, 0x03) AM_WRITE(status_w)
83   //AM_RANGE(0x10, 0x10) AM_WRITE()
84   //AM_RANGE(0x14, 0x14) AM_WRITE()
85   //AM_RANGE(0x18, 0x18) AM_WRITE()
86   //AM_RANGE(0x1c, 0x1c) AM_WRITE()
87ADDRESS_MAP_END
88
89
90//-------------------------------------------------
91//  Z80CTC_INTERFACE( ctc_intf )
92//-------------------------------------------------
93
94static Z80CTC_INTERFACE( ctc_intf )
95{
96   0,                                      // timer disables
97   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   // interrupt handler
98   DEVCB_NULL,   // ZC/TO0 callback
99   DEVCB_NULL,   // ZC/TO1 callback
100   DEVCB_NULL   // ZC/TO2 callback
101};
102
103
104//-------------------------------------------------
105//  SCSIBus_interface sasi_intf
106//-------------------------------------------------
107
108static const SCSIConfigTable sasi_dev_table =
109{
110   1,
111   {
112      { SCSI_ID_0, "harddisk0" }
113   }
114};
115
116static const SCSIBus_interface sasi_intf =
117{
118    &sasi_dev_table,
119    NULL,
120   DEVCB_NULL,
121   DEVCB_NULL,
122   DEVCB_NULL,
123   DEVCB_NULL,
124   DEVCB_NULL,
125   DEVCB_NULL,
126   DEVCB_NULL
127};
128
129
130//-------------------------------------------------
131//  MACHINE_CONFIG_FRAGMENT( wangpc_wdc )
132//-------------------------------------------------
133
134static MACHINE_CONFIG_FRAGMENT( wangpc_wdc )
135   MCFG_CPU_ADD(Z80_TAG, Z80, 2000000) // XTAL_10MHz / ?
136   //MCFG_CPU_CONFIG(wangpc_wdc_daisy_chain)
137   MCFG_CPU_PROGRAM_MAP(wangpc_wdc_mem)
138   MCFG_CPU_IO_MAP(wangpc_wdc_io)
139
140   MCFG_Z80CTC_ADD(MK3882_TAG, 2000000, ctc_intf)
141
142   MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf)
143   MCFG_DEVICE_ADD("harddisk0", SCSIHD, 0)
144MACHINE_CONFIG_END
145
146
147//-------------------------------------------------
148//  machine_config_additions - device-specific
149//  machine configurations
150//-------------------------------------------------
151
152machine_config_constructor wangpc_wdc_device::device_mconfig_additions() const
153{
154   return MACHINE_CONFIG_NAME( wangpc_wdc );
155}
156
157
158
159//**************************************************************************
160//  INLINE HELPERS
161//**************************************************************************
162
163//-------------------------------------------------
164//  set_irq -
165//-------------------------------------------------
166
167inline void wangpc_wdc_device::set_irq(int state)
168{
169   m_irq = state;
170
171   if (OPTION_DREQ1) m_bus->irq5_w(m_irq);
172   if (OPTION_DREQ2) m_bus->irq6_w(m_irq);
173   if (OPTION_DREQ3) m_bus->irq7_w(m_irq);
174}
175
176
177
178//**************************************************************************
179//  LIVE DEVICE
180//**************************************************************************
181
182//-------------------------------------------------
183//  wangpc_wdc_device - constructor
184//-------------------------------------------------
185
186wangpc_wdc_device::wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
187   device_t(mconfig, WANGPC_WDC, "Wang PC-PM001", tag, owner, clock),
188   device_wangpcbus_card_interface(mconfig, *this),
189   m_maincpu(*this, Z80_TAG),
190   m_ctc(*this, MK3882_TAG),
191   m_sasibus(*this, SASIBUS_TAG)
192{
193}
194
195
196//-------------------------------------------------
197//  device_start - device-specific startup
198//-------------------------------------------------
199
200void wangpc_wdc_device::device_start()
201{
202   // state saving
203   save_item(NAME(m_status));
204   save_item(NAME(m_option));
205   save_item(NAME(m_irq));
206}
207
208
209//-------------------------------------------------
210//  device_reset - device-specific reset
211//-------------------------------------------------
212
213void wangpc_wdc_device::device_reset()
214{
215   m_status = 0;
216   m_option = 0;
217
218   set_irq(CLEAR_LINE);
219}
220
221
222//-------------------------------------------------
223//  wangpcbus_mrdc_r - memory read
224//-------------------------------------------------
225
226UINT16 wangpc_wdc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
227{
228   UINT16 data = 0xffff;
229   
230   return data;
231}
232
233
234//-------------------------------------------------
235//  wangpcbus_amwc_w - memory write
236//-------------------------------------------------
237
238void wangpc_wdc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
239{
240}
241
242
243//-------------------------------------------------
244//  wangpcbus_iorc_r - I/O read
245//-------------------------------------------------
246
247UINT16 wangpc_wdc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
248{
249   UINT16 data = 0xffff;
250
251   if (sad(offset))
252   {
253      switch (offset & 0x7f)
254      {
255      case 0x00/2:
256         data = m_status;
257         break;
258
259      case 0x02/2:
260         // TODO operation status register
261         break;
262
263      case 0x04/2:
264         set_irq(CLEAR_LINE);
265         break;
266
267      case 0xfe/2:
268         data = 0xff00 | (m_irq << 7) | OPTION_ID;
269         break;
270      }
271   }
272
273   return data;
274}
275
276
277//-------------------------------------------------
278//  wangpcbus_aiowc_w - I/O write
279//-------------------------------------------------
280
281void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
282{
283   if (sad(offset) && ACCESSING_BITS_0_7)
284   {
285      switch (offset & 0x7f)
286      {
287      case 0x02/2:
288         // TODO command register
289         break;
290
291      case 0xfc/2:
292         device_reset();
293         break;
294
295      case 0xfe/2:
296         {
297            bool irq = (m_irq == ASSERT_LINE);
298            bool changed = ((m_option & 0x0e) != (data & 0x0e));
299
300            if (irq && changed) set_irq(CLEAR_LINE);
301
302            m_option = data & 0xff;
303
304            if (irq && changed) set_irq(ASSERT_LINE);
305         }
306         break;
307      }
308   }
309}
310
311
312//-------------------------------------------------
313//  wangpcbus_dack_r - DMA acknowledge read
314//-------------------------------------------------
315
316UINT8 wangpc_wdc_device::wangpcbus_dack_r(address_space &space, int line)
317{
318   return 0;
319}
320
321
322//-------------------------------------------------
323//  wangpcbus_dack_r - DMA acknowledge write
324//-------------------------------------------------
325
326void wangpc_wdc_device::wangpcbus_dack_w(address_space &space, int line, UINT8 data)
327{
328
329}
330
331
332//-------------------------------------------------
333//  wangpcbus_have_dack -
334//-------------------------------------------------
335
336bool wangpc_wdc_device::wangpcbus_have_dack(int line)
337{
338   return (OPTION_DREQ1 && (line == 1)) || (OPTION_DREQ2 && (line == 2)) || (OPTION_DREQ3 && (line == 3));
339}
340
341
342//-------------------------------------------------
343//  status_w - status register write
344//-------------------------------------------------
345
346WRITE8_MEMBER( wangpc_wdc_device::status_w )
347{
348   m_status = data;
349}
1/**********************************************************************
2 
3    Wang PC-PM001 Winchester Disk Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "wangpc_wdc.h"
11#include "machine/scsihd.h"
12 
13 
14 
15//**************************************************************************
16//  MACROS/CONSTANTS
17//**************************************************************************
18 
19#define OPTION_ID      0x01
20 
21#define Z80_TAG         "l53"
22#define MK3882_TAG      "l07"
23#define SASIBUS_TAG      "sasi"
24 
25#define OPTION_DREQ1   BIT(m_option, 1)
26#define OPTION_DREQ2   BIT(m_option, 2)
27#define OPTION_DREQ3   BIT(m_option, 3)
28 
29 
30 
31//**************************************************************************
32//  DEVICE DEFINITIONS
33//**************************************************************************
34 
35const device_type WANGPC_WDC = &device_creator<wangpc_wdc_device>;
36 
37 
38//-------------------------------------------------
39//  ROM( wangpc_wdc )
40//-------------------------------------------------
41 
42ROM_START( wangpc_wdc )
43   ROM_REGION( 0x1000, Z80_TAG, 0 )
44   ROM_LOAD( "378-9040 r9.l19", 0x0000, 0x1000, CRC(282770d2) SHA1(a0e3bad5041e0dfd6087907015b07a093b576bc0) )
45 
46   ROM_REGION( 0x1000, "address", 0 )
47   ROM_LOAD( "378-9041.l54", 0x0000, 0x1000, CRC(94e9a17d) SHA1(060c576d70069ece2d0dbce86ffc448df2b169e7) )
48 
49   ROM_REGION( 0x100, "prom", 0 )
50   ROM_LOAD( "376-8002.l66", 0x000, 0x100, NO_DUMP ) // DL2212-105
51ROM_END
52 
53 
54//-------------------------------------------------
55//  rom_region - device-specific ROM region
56//-------------------------------------------------
57 
58const rom_entry *wangpc_wdc_device::device_rom_region() const
59{
60   return ROM_NAME( wangpc_wdc );
61}
62 
63 
64//-------------------------------------------------
65//  ADDRESS_MAP( wangpc_wdc_mem )
66//-------------------------------------------------
67 
68static ADDRESS_MAP_START( wangpc_wdc_mem, AS_PROGRAM, 8, wangpc_wdc_device )
69   AM_RANGE(0x0000, 0x0fff) AM_ROM AM_REGION(Z80_TAG, 0)
70   AM_RANGE(0x1000, 0x17ff) AM_RAM
71   AM_RANGE(0x2000, 0x27ff) AM_RAM
72ADDRESS_MAP_END
73 
74 
75//-------------------------------------------------
76//  ADDRESS_MAP( wangpc_wdc_io )
77//-------------------------------------------------
78 
79static ADDRESS_MAP_START( wangpc_wdc_io, AS_IO, 8, wangpc_wdc_device )
80   ADDRESS_MAP_GLOBAL_MASK(0xff)
81   //AM_RANGE(0x01, 0x01) AM_READ() should return 0x72 during self-test
82   AM_RANGE(0x03, 0x03) AM_WRITE(status_w)
83   //AM_RANGE(0x10, 0x10) AM_WRITE()
84   //AM_RANGE(0x14, 0x14) AM_WRITE()
85   //AM_RANGE(0x18, 0x18) AM_WRITE()
86   //AM_RANGE(0x1c, 0x1c) AM_WRITE()
87ADDRESS_MAP_END
88 
89 
90//-------------------------------------------------
91//  Z80CTC_INTERFACE( ctc_intf )
92//-------------------------------------------------
93 
94static Z80CTC_INTERFACE( ctc_intf )
95{
96   0,                                      // timer disables
97   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   // interrupt handler
98   DEVCB_NULL,   // ZC/TO0 callback
99   DEVCB_NULL,   // ZC/TO1 callback
100   DEVCB_NULL   // ZC/TO2 callback
101};
102 
103 
104//-------------------------------------------------
105//  SCSIBus_interface sasi_intf
106//-------------------------------------------------
107 
108static const SCSIConfigTable sasi_dev_table =
109{
110   1,
111   {
112      { SCSI_ID_0, "harddisk0" }
113   }
114};
115 
116static const SCSIBus_interface sasi_intf =
117{
118    &sasi_dev_table,
119    NULL,
120   DEVCB_NULL,
121   DEVCB_NULL,
122   DEVCB_NULL,
123   DEVCB_NULL,
124   DEVCB_NULL,
125   DEVCB_NULL,
126   DEVCB_NULL
127};
128 
129 
130//-------------------------------------------------
131//  MACHINE_CONFIG_FRAGMENT( wangpc_wdc )
132//-------------------------------------------------
133 
134static MACHINE_CONFIG_FRAGMENT( wangpc_wdc )
135   MCFG_CPU_ADD(Z80_TAG, Z80, 2000000) // XTAL_10MHz / ?
136   //MCFG_CPU_CONFIG(wangpc_wdc_daisy_chain)
137   MCFG_CPU_PROGRAM_MAP(wangpc_wdc_mem)
138   MCFG_CPU_IO_MAP(wangpc_wdc_io)
139 
140   MCFG_Z80CTC_ADD(MK3882_TAG, 2000000, ctc_intf)
141 
142   MCFG_SCSIBUS_ADD(SASIBUS_TAG, sasi_intf)
143   MCFG_DEVICE_ADD("harddisk0", SCSIHD, 0)
144MACHINE_CONFIG_END
145 
146 
147//-------------------------------------------------
148//  machine_config_additions - device-specific
149//  machine configurations
150//-------------------------------------------------
151 
152machine_config_constructor wangpc_wdc_device::device_mconfig_additions() const
153{
154   return MACHINE_CONFIG_NAME( wangpc_wdc );
155}
156 
157 
158 
159//**************************************************************************
160//  INLINE HELPERS
161//**************************************************************************
162 
163//-------------------------------------------------
164//  set_irq -
165//-------------------------------------------------
166 
167inline void wangpc_wdc_device::set_irq(int state)
168{
169   m_irq = state;
170 
171   if (OPTION_DREQ1) m_bus->irq5_w(m_irq);
172   if (OPTION_DREQ2) m_bus->irq6_w(m_irq);
173   if (OPTION_DREQ3) m_bus->irq7_w(m_irq);
174}
175 
176 
177 
178//**************************************************************************
179//  LIVE DEVICE
180//**************************************************************************
181 
182//-------------------------------------------------
183//  wangpc_wdc_device - constructor
184//-------------------------------------------------
185 
186wangpc_wdc_device::wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
187   device_t(mconfig, WANGPC_WDC, "Wang PC-PM001", tag, owner, clock),
188   device_wangpcbus_card_interface(mconfig, *this),
189   m_maincpu(*this, Z80_TAG),
190   m_ctc(*this, MK3882_TAG),
191   m_sasibus(*this, SASIBUS_TAG)
192{
193}
194 
195 
196//-------------------------------------------------
197//  device_start - device-specific startup
198//-------------------------------------------------
199 
200void wangpc_wdc_device::device_start()
201{
202   // state saving
203   save_item(NAME(m_status));
204   save_item(NAME(m_option));
205   save_item(NAME(m_irq));
206}
207 
208 
209//-------------------------------------------------
210//  device_reset - device-specific reset
211//-------------------------------------------------
212 
213void wangpc_wdc_device::device_reset()
214{
215   m_status = 0;
216   m_option = 0;
217 
218   set_irq(CLEAR_LINE);
219}
220 
221 
222//-------------------------------------------------
223//  wangpcbus_mrdc_r - memory read
224//-------------------------------------------------
225 
226UINT16 wangpc_wdc_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
227{
228   UINT16 data = 0xffff;
229 
230   return data;
231}
232 
233 
234//-------------------------------------------------
235//  wangpcbus_amwc_w - memory write
236//-------------------------------------------------
237 
238void wangpc_wdc_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
239{
240}
241 
242 
243//-------------------------------------------------
244//  wangpcbus_iorc_r - I/O read
245//-------------------------------------------------
246 
247UINT16 wangpc_wdc_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
248{
249   UINT16 data = 0xffff;
250 
251   if (sad(offset))
252   {
253      switch (offset & 0x7f)
254      {
255      case 0x00/2:
256         data = m_status;
257         break;
258 
259      case 0x02/2:
260         // TODO operation status register
261         break;
262 
263      case 0x04/2:
264         set_irq(CLEAR_LINE);
265         break;
266 
267      case 0xfe/2:
268         data = 0xff00 | (m_irq << 7) | OPTION_ID;
269         break;
270      }
271   }
272 
273   return data;
274}
275 
276 
277//-------------------------------------------------
278//  wangpcbus_aiowc_w - I/O write
279//-------------------------------------------------
280 
281void wangpc_wdc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
282{
283   if (sad(offset) && ACCESSING_BITS_0_7)
284   {
285      switch (offset & 0x7f)
286      {
287      case 0x02/2:
288         // TODO command register
289         break;
290 
291      case 0xfc/2:
292         device_reset();
293         break;
294 
295      case 0xfe/2:
296         {
297            bool irq = (m_irq == ASSERT_LINE);
298            bool changed = ((m_option & 0x0e) != (data & 0x0e));
299 
300            if (irq && changed) set_irq(CLEAR_LINE);
301 
302            m_option = data & 0xff;
303 
304            if (irq && changed) set_irq(ASSERT_LINE);
305         }
306         break;
307      }
308   }
309}
310 
311 
312//-------------------------------------------------
313//  wangpcbus_dack_r - DMA acknowledge read
314//-------------------------------------------------
315 
316UINT8 wangpc_wdc_device::wangpcbus_dack_r(address_space &space, int line)
317{
318   return 0;
319}
320 
321 
322//-------------------------------------------------
323//  wangpcbus_dack_r - DMA acknowledge write
324//-------------------------------------------------
325 
326void wangpc_wdc_device::wangpcbus_dack_w(address_space &space, int line, UINT8 data)
327{
328 
329}
330 
331 
332//-------------------------------------------------
333//  wangpcbus_have_dack -
334//-------------------------------------------------
335 
336bool wangpc_wdc_device::wangpcbus_have_dack(int line)
337{
338   return (OPTION_DREQ1 && (line == 1)) || (OPTION_DREQ2 && (line == 2)) || (OPTION_DREQ3 && (line == 3));
339}
340 
341 
342//-------------------------------------------------
343//  status_w - status register write
344//-------------------------------------------------
345 
346WRITE8_MEMBER( wangpc_wdc_device::status_w )
347{
348   m_status = data;
349}
src/mess/machine/wangpc_wdc.h
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM001 Winchester Disk Controller emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_WDC__
13#define __WANGPC_WDC__
14
15
16#include "emu.h"
17#include "cpu/z80/z80.h"
18#include "imagedev/harddriv.h"
19#include "machine/scsibus.h"
20#include "machine/wangpcbus.h"
21#include "machine/z80ctc.h"
22
23
24
25//**************************************************************************
26//  TYPE DEFINITIONS
27//**************************************************************************
28
29// ======================> wangpc_wdc_device
30
31class wangpc_wdc_device : public device_t,
32                    public device_wangpcbus_card_interface
33{
34public:
35   // construction/destruction
36   wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37
38   // optional information overrides
39   virtual const rom_entry *device_rom_region() const;
40   virtual machine_config_constructor device_mconfig_additions() const;
41
42   // not really public
43   DECLARE_WRITE8_MEMBER( status_w );
44
45protected:
46   // device-level overrides
47   virtual void device_start();
48   virtual void device_reset();
49   virtual void device_config_complete() { m_shortname = "wangpc_wdc"; }
50
51   // device_wangpcbus_card_interface overrides
52   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
53   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
54   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
55   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
56   virtual UINT8 wangpcbus_dack_r(address_space &space, int line);
57   virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data);
58   virtual bool wangpcbus_have_dack(int line);
59
60private:
61   inline void set_irq(int state);
62
63   required_device<cpu_device> m_maincpu;
64   required_device<z80ctc_device> m_ctc;
65   required_device<device_t> m_sasibus;
66
67   UINT8 m_status;
68   UINT8 m_option;
69   int m_irq;
70};
71
72
73// device type definition
74extern const device_type WANGPC_WDC;
75
76
77#endif
1/**********************************************************************
2 
3    Wang PC-PM001 Winchester Disk Controller emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_WDC__
13#define __WANGPC_WDC__
14 
15 
16#include "emu.h"
17#include "cpu/z80/z80.h"
18#include "imagedev/harddriv.h"
19#include "machine/scsibus.h"
20#include "machine/wangpcbus.h"
21#include "machine/z80ctc.h"
22 
23 
24 
25//**************************************************************************
26//  TYPE DEFINITIONS
27//**************************************************************************
28 
29// ======================> wangpc_wdc_device
30 
31class wangpc_wdc_device : public device_t,
32                    public device_wangpcbus_card_interface
33{
34public:
35   // construction/destruction
36   wangpc_wdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37 
38   // optional information overrides
39   virtual const rom_entry *device_rom_region() const;
40   virtual machine_config_constructor device_mconfig_additions() const;
41 
42   // not really public
43   DECLARE_WRITE8_MEMBER( status_w );
44 
45protected:
46   // device-level overrides
47   virtual void device_start();
48   virtual void device_reset();
49   virtual void device_config_complete() { m_shortname = "wangpc_wdc"; }
50 
51   // device_wangpcbus_card_interface overrides
52   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
53   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
54   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
55   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
56   virtual UINT8 wangpcbus_dack_r(address_space &space, int line);
57   virtual void wangpcbus_dack_w(address_space &space, int line, UINT8 data);
58   virtual bool wangpcbus_have_dack(int line);
59 
60private:
61   inline void set_irq(int state);
62 
63   required_device<cpu_device> m_maincpu;
64   required_device<z80ctc_device> m_ctc;
65   required_device<device_t> m_sasibus;
66 
67   UINT8 m_status;
68   UINT8 m_option;
69   int m_irq;
70};
71 
72 
73// device type definition
74extern const device_type WANGPC_WDC;
75 
76 
77#endif
src/mess/machine/wangpc_lic.c
r15442r15443
1/**********************************************************************
2
3    Wang PC Network card emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "wangpc_lic.h"
11
12
13
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17
18#define OPTION_ID      0x30
19
20
21
22//**************************************************************************
23//  DEVICE DEFINITIONS
24//**************************************************************************
25
26const device_type WANGPC_LIC = &device_creator<wangpc_lic_device>;
27
28
29//-------------------------------------------------
30//  ROM( wangpc_lic )
31//-------------------------------------------------
32
33ROM_START( wangpc_lic )
34   ROM_REGION( 0x1000, "network", 0 )
35   ROM_LOAD( "7025.l22", 0x0000, 0x1000, CRC(487e5f04) SHA1(81e52e70e0c6e34715119b121ec19a7758cd6772) )
36ROM_END
37
38
39//-------------------------------------------------
40//  rom_region - device-specific ROM region
41//-------------------------------------------------
42
43const rom_entry *wangpc_lic_device::device_rom_region() const
44{
45   return ROM_NAME( wangpc_lic );
46}
47
48
49//-------------------------------------------------
50//  MACHINE_CONFIG_FRAGMENT( wangpc_lic )
51//-------------------------------------------------
52
53static MACHINE_CONFIG_FRAGMENT( wangpc_lic )
54MACHINE_CONFIG_END
55
56
57//-------------------------------------------------
58//  machine_config_additions - device-specific
59//  machine configurations
60//-------------------------------------------------
61
62machine_config_constructor wangpc_lic_device::device_mconfig_additions() const
63{
64   return MACHINE_CONFIG_NAME( wangpc_lic );
65}
66
67
68
69//**************************************************************************
70//  LIVE DEVICE
71//**************************************************************************
72
73//-------------------------------------------------
74//  wangpc_lic_device - constructor
75//-------------------------------------------------
76
77wangpc_lic_device::wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
78   device_t(mconfig, WANGPC_LIC, "Wang PC-PM070", tag, owner, clock),
79   device_wangpcbus_card_interface(mconfig, *this)
80{
81}
82
83
84//-------------------------------------------------
85//  device_start - device-specific startup
86//-------------------------------------------------
87
88void wangpc_lic_device::device_start()
89{
90}
91
92
93//-------------------------------------------------
94//  device_reset - device-specific reset
95//-------------------------------------------------
96
97void wangpc_lic_device::device_reset()
98{
99}
100
101
102//-------------------------------------------------
103//  wangpcbus_mrdc_r - memory read
104//-------------------------------------------------
105
106UINT16 wangpc_lic_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
107{
108   UINT16 data = 0xffff;
109   
110   return data;
111}
112
113
114//-------------------------------------------------
115//  wangpcbus_amwc_w - memory write
116//-------------------------------------------------
117
118void wangpc_lic_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
119{
120}
121
122
123//-------------------------------------------------
124//  wangpcbus_iorc_r - I/O read
125//-------------------------------------------------
126
127UINT16 wangpc_lic_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
128{
129   UINT16 data = 0xffff;
130
131   if (sad(offset))
132   {
133      switch (offset & 0x7f)
134      {
135      case 0xfe/2:
136         data = 0xff00 | OPTION_ID;
137         break;
138      }
139   }
140
141   return data;
142}
143
144
145//-------------------------------------------------
146//  wangpcbus_aiowc_w - I/O write
147//-------------------------------------------------
148
149void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
150{
151   if (sad(offset))
152   {
153      switch (offset & 0x7f)
154      {
155      case 0xfc/2:
156         device_reset();
157         break;
158      }
159   }
160}
1/**********************************************************************
2 
3    Wang PC Network card emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "wangpc_lic.h"
11 
12 
13 
14//**************************************************************************
15//  MACROS/CONSTANTS
16//**************************************************************************
17 
18#define OPTION_ID      0x30
19 
20 
21 
22//**************************************************************************
23//  DEVICE DEFINITIONS
24//**************************************************************************
25 
26const device_type WANGPC_LIC = &device_creator<wangpc_lic_device>;
27 
28 
29//-------------------------------------------------
30//  ROM( wangpc_lic )
31//-------------------------------------------------
32 
33ROM_START( wangpc_lic )
34   ROM_REGION( 0x1000, "network", 0 )
35   ROM_LOAD( "7025.l22", 0x0000, 0x1000, CRC(487e5f04) SHA1(81e52e70e0c6e34715119b121ec19a7758cd6772) )
36ROM_END
37 
38 
39//-------------------------------------------------
40//  rom_region - device-specific ROM region
41//-------------------------------------------------
42 
43const rom_entry *wangpc_lic_device::device_rom_region() const
44{
45   return ROM_NAME( wangpc_lic );
46}
47 
48 
49//-------------------------------------------------
50//  MACHINE_CONFIG_FRAGMENT( wangpc_lic )
51//-------------------------------------------------
52 
53static MACHINE_CONFIG_FRAGMENT( wangpc_lic )
54MACHINE_CONFIG_END
55 
56 
57//-------------------------------------------------
58//  machine_config_additions - device-specific
59//  machine configurations
60//-------------------------------------------------
61 
62machine_config_constructor wangpc_lic_device::device_mconfig_additions() const
63{
64   return MACHINE_CONFIG_NAME( wangpc_lic );
65}
66 
67 
68 
69//**************************************************************************
70//  LIVE DEVICE
71//**************************************************************************
72 
73//-------------------------------------------------
74//  wangpc_lic_device - constructor
75//-------------------------------------------------
76 
77wangpc_lic_device::wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
78   device_t(mconfig, WANGPC_LIC, "Wang PC-PM070", tag, owner, clock),
79   device_wangpcbus_card_interface(mconfig, *this)
80{
81}
82 
83 
84//-------------------------------------------------
85//  device_start - device-specific startup
86//-------------------------------------------------
87 
88void wangpc_lic_device::device_start()
89{
90}
91 
92 
93//-------------------------------------------------
94//  device_reset - device-specific reset
95//-------------------------------------------------
96 
97void wangpc_lic_device::device_reset()
98{
99}
100 
101 
102//-------------------------------------------------
103//  wangpcbus_mrdc_r - memory read
104//-------------------------------------------------
105 
106UINT16 wangpc_lic_device::wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask)
107{
108   UINT16 data = 0xffff;
109 
110   return data;
111}
112 
113 
114//-------------------------------------------------
115//  wangpcbus_amwc_w - memory write
116//-------------------------------------------------
117 
118void wangpc_lic_device::wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
119{
120}
121 
122 
123//-------------------------------------------------
124//  wangpcbus_iorc_r - I/O read
125//-------------------------------------------------
126 
127UINT16 wangpc_lic_device::wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask)
128{
129   UINT16 data = 0xffff;
130 
131   if (sad(offset))
132   {
133      switch (offset & 0x7f)
134      {
135      case 0xfe/2:
136         data = 0xff00 | OPTION_ID;
137         break;
138      }
139   }
140 
141   return data;
142}
143 
144 
145//-------------------------------------------------
146//  wangpcbus_aiowc_w - I/O write
147//-------------------------------------------------
148 
149void wangpc_lic_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data)
150{
151   if (sad(offset))
152   {
153      switch (offset & 0x7f)
154      {
155      case 0xfc/2:
156         device_reset();
157         break;
158      }
159   }
160}
src/mess/machine/wangpc_lic.h
r15442r15443
1/**********************************************************************
2
3    Wang PC-PM070 Local Interconnect option card emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __WANGPC_LIC__
13#define __WANGPC_LIC__
14
15
16#include "emu.h"
17#include "machine/wangpcbus.h"
18
19
20
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24
25// ======================> wangpc_lic_device
26
27class wangpc_lic_device : public device_t,
28                      public device_wangpcbus_card_interface
29{
30public:
31   // construction/destruction
32   wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33
34   // optional information overrides
35   virtual const rom_entry *device_rom_region() const;
36   virtual machine_config_constructor device_mconfig_additions() const;
37
38protected:
39   // device-level overrides
40   virtual void device_start();
41   virtual void device_reset();
42   virtual void device_config_complete() { m_shortname = "wangpc_lic"; }
43
44   // device_wangpcbus_card_interface overrides
45   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
46   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
47   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
48   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
49};
50
51
52// device type definition
53extern const device_type WANGPC_LIC;
54
55
56#endif
1/**********************************************************************
2 
3    Wang PC-PM070 Local Interconnect option card emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __WANGPC_LIC__
13#define __WANGPC_LIC__
14 
15 
16#include "emu.h"
17#include "machine/wangpcbus.h"
18 
19 
20 
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24 
25// ======================> wangpc_lic_device
26 
27class wangpc_lic_device : public device_t,
28                      public device_wangpcbus_card_interface
29{
30public:
31   // construction/destruction
32   wangpc_lic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
33 
34   // optional information overrides
35   virtual const rom_entry *device_rom_region() const;
36   virtual machine_config_constructor device_mconfig_additions() const;
37 
38protected:
39   // device-level overrides
40   virtual void device_start();
41   virtual void device_reset();
42   virtual void device_config_complete() { m_shortname = "wangpc_lic"; }
43 
44   // device_wangpcbus_card_interface overrides
45   virtual UINT16 wangpcbus_mrdc_r(address_space &space, offs_t offset, UINT16 mem_mask);
46   virtual void wangpcbus_amwc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
47   virtual UINT16 wangpcbus_iorc_r(address_space &space, offs_t offset, UINT16 mem_mask);
48   virtual void wangpcbus_aiowc_w(address_space &space, offs_t offset, UINT16 mem_mask, UINT16 data);
49};
50 
51 
52// device type definition
53extern const device_type WANGPC_LIC;
54 
55 
56#endif
src/mess/machine/e01.c
r15442r15443
1/**********************************************************************
2
3    Acorn FileStore E01/E01S network hard disk emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8    http://acorn.chriswhy.co.uk/Network/Econet.html
9    http://acorn.chriswhy.co.uk/Network/Pics/Acorn_FileStoreE01.html
10    http://acorn.chriswhy.co.uk/8bit_Upgrades/Acorn_FileStoreE01S.html
11    http://www.heyrick.co.uk/econet/fs/emulator.html
12    http://www.pdfio.com/k-1019481.html#
13
14**********************************************************************/
15
16/*
17
18    The FileStore E01 is an Econet station in its own right which acts as a fileserver when connected to a network. It is a single unit
19    which does not require a monitor or keyboard. Communication with the FileStore is done via another Econet station when the FileStore
20    is in one of two "maintenance modes"
21
22    The E01 can be seen as a slimmed-down BBC computer tailored for its function as a fileserver. It has a 6502 processor at its heart
23    along with a 6522 VIA just like the BBC. It requires a Master series Econet module to be plugged in and connects to the network via
24    an Econet port in the same way as any other station.
25
26    The FileStore E01S was Acorns second generation Filestore replacing the FileStore E01. The FileStore is a dedicated Econet fileserver,
27    it does not support a keyboard and monitor, instead you use an Econet attached station to logon and perform administrative tasks.
28
29            Hitachi HD146818P Real Time Clock
30            Rockwell R65C102P3 CPU
31            2 x TMM27256D-20 white labelled EPROMs, TMSE01 MOS on left and E01 FS on the right
32    IC20    WD2793-APL-02 floppy disc controller
33            2 x NEC D41464C-12 64k x 4bit NMOS RAM ICs giving 64K memory
34    IC21    Rockwell RC6522AP VIA behind to the right
35
36*/
37
38/*
39
40    TODO:
41
42   - memory_bank::set_entry called for bank ':econet254:e01s:bank2' with invalid bank entry 0
43   - centronics strobe
44   - econet clock speed select
45    - ADLC interrupts
46    - ECONET device
47    - artwork
48    - hard disk
49
50       E20: Rodime RO652 (-chs 306,4,17,512)
51       E40S: Rodime RO3057S (-chs 680,5,26,512)
52       E60S:
53
54*/
55
56#include "e01.h"
57#include "machine/scsihd.h"
58
59
60
61//**************************************************************************
62//  MACROS / CONSTANTS
63//**************************************************************************
64
65#define R65C102_TAG      "r65c102"
66#define R6522_TAG      "ic21"
67#define WD2793_TAG      "ic20"
68#define MC6854_TAG      "mc6854"
69#define HD146818_TAG   "hd146818"
70#define CENTRONICS_TAG   "centronics"
71#define SCSIBUS_TAG      "scsi"
72
73
74
75//**************************************************************************
76//  DEVICE DEFINITIONS
77//**************************************************************************
78
79const device_type E01 = &device_creator<e01_device>;
80const device_type E01S = &device_creator<e01s_device>;
81
82e01s_device::e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
83   :e01_device(mconfig, E01S, "Acorn FileStore E01S", tag, owner, clock) { m_variant = TYPE_E01S; }
84
85
86//-------------------------------------------------
87//  ROM( e01 )
88//-------------------------------------------------
89
90ROM_START( e01 )
91    ROM_REGION( 0x10000, R65C102_TAG, 0 )
92   //ROM_DEFAULT_BIOS("v131")
93   //ROM_SYSTEM_BIOS( 0, "v131", "V 1.31" )
94   ROM_LOAD( "0254,205-04 e01 fs",  0x0000, 0x8000, CRC(ae666c76) SHA1(0954119eb5cd09cdbadf76d60d812aa845838d5a) )
95   ROM_LOAD( "0254,205-03 e01 mos", 0x8000, 0x8000, CRC(a13e8014) SHA1(6f44a1a48108c60a64a1774cb30c1a59c4a6a199) )
96ROM_END
97
98
99//-------------------------------------------------
100//  ROM( e01s )
101//-------------------------------------------------
102
103ROM_START( e01s )
104    ROM_REGION( 0x10000, R65C102_TAG, 0 )
105   //ROM_DEFAULT_BIOS("v140")
106   //ROM_SYSTEM_BIOS( 0, "v133", "V 1.33" ) // 0282,008-02 e01s rom
107   ROM_LOAD( "e01sv133.rom",  0x0000, 0x10000, CRC(2a4a0032) SHA1(54ad68ceae44992293ccdd64ec88ad8520deec22) ) // which label?
108   //ROM_SYSTEM_BIOS( 1, "v140", "V 1.40" )
109   ROM_LOAD( "e01sv140.rom",  0x0000, 0x10000, CRC(5068fe86) SHA1(9b8740face15b5541e2375b3054988af00757931) ) // which label?
110ROM_END
111
112
113//-------------------------------------------------
114//  rom_region - device-specific ROM region
115//-------------------------------------------------
116
117const rom_entry *e01_device::device_rom_region() const
118{
119   switch (m_variant)
120   {
121   default:
122   case TYPE_E01:
123      return ROM_NAME( e01 );
124
125   case TYPE_E01S:
126      return ROM_NAME( e01s );
127   }
128}
129
130
131//-------------------------------------------------
132//  MC146818_INTERFACE( rtc_intf )
133//-------------------------------------------------
134
135WRITE_LINE_MEMBER( e01_device::rtc_irq_w )
136{
137    m_rtc_irq = state;
138
139    update_interrupts();
140}
141
142static mc146818_interface rtc_intf =
143{
144   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, rtc_irq_w)
145};
146
147
148//-------------------------------------------------
149//  mc6854_interface adlc_intf
150//-------------------------------------------------
151
152WRITE_LINE_MEMBER( e01_device::adlc_irq_w )
153{
154    m_adlc_irq = state;
155
156    update_interrupts();
157}
158
159READ_LINE_MEMBER( e01_device::econet_data_r )
160{
161   return m_econet->data_r();
162}
163
164WRITE_LINE_MEMBER( e01_device::econet_data_w )
165{
166   m_econet->data_w(this, state);
167}
168
169static const mc6854_interface adlc_intf =
170{
171   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, adlc_irq_w),
172   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, econet_data_r),
173   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, econet_data_w),
174   NULL,
175   DEVCB_NULL,
176   DEVCB_NULL
177};
178
179
180//-------------------------------------------------
181//  via6522_interface via_intf
182//-------------------------------------------------
183
184WRITE_LINE_MEMBER( e01_device::via_irq_w )
185{
186   m_via_irq = state;
187
188   update_interrupts();
189}
190
191WRITE_LINE_MEMBER( e01_device::clk_en_w )
192{
193   m_clk_en = state;
194}
195
196static const via6522_interface via_intf =
197{
198   DEVCB_NULL,
199   DEVCB_NULL,
200   DEVCB_NULL,
201   DEVCB_NULL,
202   DEVCB_NULL,
203   DEVCB_NULL,
204
205   DEVCB_DEVICE_MEMBER(CENTRONICS_TAG, centronics_device, write),
206   DEVCB_NULL,
207   DEVCB_NULL,
208   DEVCB_NULL,
209   DEVCB_NULL,
210   DEVCB_NULL,
211
212   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, via_irq_w)
213};
214
215
216//-------------------------------------------------
217//  floppy_interface e01_floppy_interface
218//-------------------------------------------------
219
220static const floppy_interface e01_floppy_interface =
221{
222   DEVCB_NULL,
223   DEVCB_NULL,
224   DEVCB_NULL,
225   DEVCB_NULL,
226   DEVCB_NULL,
227   FLOPPY_STANDARD_3_5_DSDD, // NEC FD1036 A
228   LEGACY_FLOPPY_OPTIONS_NAME(default),
229   NULL,
230   NULL
231};
232
233
234//-------------------------------------------------
235//  wd17xx_interface fdc_intf
236//-------------------------------------------------
237
238WRITE_LINE_MEMBER( e01_device::fdc_irq_w )
239{
240   m_fdc_irq = state;
241
242   update_interrupts();
243}
244
245WRITE_LINE_MEMBER( e01_device::fdc_drq_w )
246{
247   m_fdc_drq = state;
248
249   update_interrupts();
250}
251
252static const wd17xx_interface fdc_intf =
253{
254   DEVCB_NULL,
255   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, fdc_irq_w),
256   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, fdc_drq_w),
257   { FLOPPY_0, FLOPPY_1, NULL, NULL }
258};
259
260
261//-------------------------------------------------
262//  SCSIBus_interface scsi_intf
263//-------------------------------------------------
264
265static const SCSIConfigTable scsi_dev_table =
266{
267   1,
268   {
269      { SCSI_ID_0, "harddisk0" }
270   }
271};
272
273WRITE_LINE_MEMBER( e01_device::scsi_bsy_w )
274{
275   if (!state)
276   {
277      scsi_sel_w(m_scsibus, 1);
278   }
279}
280
281WRITE_LINE_MEMBER( e01_device::scsi_req_w )
282{
283   if (state)
284   {
285      scsi_ack_w(m_scsibus, 1);
286   }
287
288   m_hdc_irq = !state;
289   update_interrupts();
290}
291
292static const SCSIBus_interface scsi_intf =
293{
294    &scsi_dev_table,
295    NULL,
296   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, scsi_bsy_w),
297   DEVCB_NULL,
298   DEVCB_NULL,
299   DEVCB_NULL,
300   DEVCB_NULL,
301   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, scsi_req_w),
302   DEVCB_NULL
303};
304
305
306//-------------------------------------------------
307//  centronics_interface e01_centronics_intf
308//-------------------------------------------------
309
310static centronics_interface e01_centronics_intf =
311{
312   DEVCB_DEVICE_LINE_MEMBER(R6522_TAG, via6522_device, write_ca1),
313   DEVCB_NULL,
314   DEVCB_NULL
315};
316
317
318//-------------------------------------------------
319//  ADDRESS_MAP( e01_mem )
320//-------------------------------------------------
321
322static ADDRESS_MAP_START( e01_mem, AS_PROGRAM, 8, e01_device )
323   AM_RANGE(0x0000, 0xfbff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2")
324   AM_RANGE(0xfc00, 0xfc00) AM_MIRROR(0x00c3) AM_READWRITE(rtc_address_r, rtc_address_w)
325   AM_RANGE(0xfc04, 0xfc04) AM_MIRROR(0x00c3) AM_READWRITE(rtc_data_r, rtc_data_w)
326   AM_RANGE(0xfc08, 0xfc08) AM_MIRROR(0x00c0) AM_READ(ram_select_r) AM_WRITE(floppy_w)
327   AM_RANGE(0xfc0c, 0xfc0f) AM_MIRROR(0x00c0) AM_DEVREADWRITE_LEGACY(WD2793_TAG, wd17xx_r, wd17xx_w)
328   AM_RANGE(0xfc10, 0xfc1f) AM_MIRROR(0x00c0) AM_DEVREADWRITE(R6522_TAG, via6522_device, read, write)
329   AM_RANGE(0xfc20, 0xfc23) AM_MIRROR(0x00c0) AM_DEVREADWRITE_LEGACY(MC6854_TAG, mc6854_r, mc6854_w)
330   AM_RANGE(0xfc24, 0xfc24) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_disable_r, network_irq_disable_w)
331   AM_RANGE(0xfc28, 0xfc28) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_enable_r, network_irq_enable_w)
332   AM_RANGE(0xfc2c, 0xfc2c) AM_MIRROR(0x00c3) AM_READ_PORT("FLAP")
333   AM_RANGE(0xfc30, 0xfc30) AM_MIRROR(0x00c0) AM_READWRITE(hdc_data_r, hdc_data_w)
334   AM_RANGE(0xfc31, 0xfc31) AM_MIRROR(0x00c0) AM_READ(hdc_status_r)
335   AM_RANGE(0xfc32, 0xfc32) AM_MIRROR(0x00c0) AM_WRITE(hdc_select_w)
336   AM_RANGE(0xfc33, 0xfc33) AM_MIRROR(0x00c0) AM_WRITE(hdc_irq_enable_w)
337   AM_RANGE(0xfd00, 0xffff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank4")
338ADDRESS_MAP_END
339
340
341//-------------------------------------------------
342//  MACHINE_DRIVER( e01 )
343//-------------------------------------------------
344
345static MACHINE_CONFIG_FRAGMENT( e01 )
346    // basic machine hardware
347   MCFG_CPU_ADD(R65C102_TAG, M65C02, XTAL_8MHz/4) // Rockwell R65C102P3
348    MCFG_CPU_PROGRAM_MAP(e01_mem)
349
350   MCFG_MC146818_IRQ_ADD(HD146818_TAG, MC146818_STANDARD, rtc_intf)
351
352   // devices
353   MCFG_VIA6522_ADD(R6522_TAG, XTAL_8MHz/4, via_intf)
354   MCFG_MC6854_ADD(MC6854_TAG, adlc_intf)
355   MCFG_WD2793_ADD(WD2793_TAG, fdc_intf)
356   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(e01_floppy_interface)
357   MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, e01_centronics_intf)
358
359   MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsi_intf)
360   MCFG_DEVICE_ADD("harddisk0", SCSIHD, 0)
361
362   // internal ram
363   MCFG_RAM_ADD(RAM_TAG)
364   MCFG_RAM_DEFAULT_SIZE("64K")
365MACHINE_CONFIG_END
366
367
368//-------------------------------------------------
369//  machine_config_additions - device-specific
370//  machine configurations
371//-------------------------------------------------
372
373machine_config_constructor e01_device::device_mconfig_additions() const
374{
375   return MACHINE_CONFIG_NAME( e01 );
376}
377
378
379//-------------------------------------------------
380//  INPUT_PORTS( e01 )
381//-------------------------------------------------
382
383static INPUT_PORTS_START( e01 )
384   PORT_START("FLAP")
385   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
386   PORT_CONFNAME( 0x40, 0x00, "Front Flap")
387   PORT_CONFSETTING( 0x00, "Closed" )
388   PORT_CONFSETTING( 0x40, "Open" )
389   PORT_DIPNAME( 0x80, 0x00, "SW3")
390   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
391   PORT_DIPSETTING( 0x80, DEF_STR( On ) )
392INPUT_PORTS_END
393
394
395//-------------------------------------------------
396//  input_ports - device-specific input ports
397//-------------------------------------------------
398
399ioport_constructor e01_device::device_input_ports() const
400{
401   return INPUT_PORTS_NAME( e01 );
402}
403
404
405
406//**************************************************************************
407//  INLINE HELPERS
408//**************************************************************************
409
410//-------------------------------------------------
411//  update_interrupts - update interrupt state
412//-------------------------------------------------
413
414inline void e01_device::update_interrupts()
415{
416   int irq = (m_via_irq || (m_hdc_ie & m_hdc_irq) || m_rtc_irq) ? ASSERT_LINE : CLEAR_LINE;
417   int nmi = (m_fdc_irq || m_fdc_drq || (m_adlc_ie & m_adlc_irq)) ? ASSERT_LINE : CLEAR_LINE;
418
419   m_maincpu->set_input_line(INPUT_LINE_IRQ0, irq);
420   m_maincpu->set_input_line(INPUT_LINE_NMI, nmi);
421}
422
423
424//-------------------------------------------------
425//   network_irq_enable - network interrupt enable
426//-------------------------------------------------
427
428inline void e01_device::network_irq_enable(int enabled)
429{
430   m_adlc_ie = enabled;
431
432   update_interrupts();
433}
434
435
436//-------------------------------------------------
437//   hdc_irq_enable - hard disk interrupt enable
438//-------------------------------------------------
439
440inline void e01_device::hdc_irq_enable(int enabled)
441{
442   m_hdc_ie = enabled;
443
444   update_interrupts();
445}
446
447
448
449//**************************************************************************
450//  LIVE DEVICE
451//**************************************************************************
452
453//-------------------------------------------------
454//  e01_device - constructor
455//-------------------------------------------------
456
457e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
458    : device_t(mconfig, E01, "Acorn FileStore E01", tag, owner, clock),
459      device_econet_interface(mconfig, *this),
460     m_maincpu(*this, R65C102_TAG),
461     m_fdc(*this, WD2793_TAG),
462     m_adlc(*this, MC6854_TAG),
463     m_rtc(*this, HD146818_TAG),
464     m_ram(*this, RAM_TAG),
465     m_scsibus(*this, SCSIBUS_TAG),
466     m_adlc_ie(0),
467     m_hdc_ie(0),
468     m_rtc_irq(CLEAR_LINE),
469     m_via_irq(CLEAR_LINE),
470     m_hdc_irq(CLEAR_LINE),
471     m_fdc_irq(CLEAR_LINE),
472     m_fdc_drq(CLEAR_LINE),
473     m_adlc_irq(CLEAR_LINE),
474     m_clk_en(0)
475{
476}
477
478
479e01_device::e01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
480    : device_t(mconfig, type, name, tag, owner, clock),
481      device_econet_interface(mconfig, *this),
482     m_maincpu(*this, R65C102_TAG),
483     m_fdc(*this, WD2793_TAG),
484     m_adlc(*this, MC6854_TAG),
485     m_rtc(*this, HD146818_TAG),
486     m_ram(*this, RAM_TAG),
487     m_scsibus(*this, SCSIBUS_TAG),
488     m_adlc_ie(0),
489     m_hdc_ie(0),
490     m_rtc_irq(CLEAR_LINE),
491     m_via_irq(CLEAR_LINE),
492     m_hdc_irq(CLEAR_LINE),
493     m_fdc_irq(CLEAR_LINE),
494     m_fdc_drq(CLEAR_LINE),
495     m_adlc_irq(CLEAR_LINE),
496     m_clk_en(0)
497{
498}
499
500
501//-------------------------------------------------
502//  device_config_complete - perform any
503//  operations now that the configuration is
504//  complete
505//-------------------------------------------------
506
507void e01_device::device_config_complete()
508{
509   switch (m_variant)
510   {
511   default:
512   case TYPE_E01:
513      m_shortname = "e01";
514      break;
515
516   case TYPE_E01S:
517      m_shortname = "e01s";
518      break;
519   }
520}
521
522
523//-------------------------------------------------
524//  device_start - device-specific startup
525//-------------------------------------------------
526
527void e01_device::device_start()
528{
529   // setup memory banking
530   UINT8 *ram = m_ram->pointer();
531   UINT8 *rom = memregion(R65C102_TAG)->base();
532
533   membank("bank1")->configure_entry(0, ram);
534   membank("bank1")->configure_entry(1, rom);
535   membank("bank1")->set_entry(1);
536
537   membank("bank2")->configure_entry(0, ram);
538//   membank("bank2")->set_entry(0);
539
540   membank("bank3")->configure_entry(0, ram + 0xfd00);
541   membank("bank3")->configure_entry(1, rom + 0xfd00);
542   membank("bank3")->set_entry(1);
543
544   membank("bank4")->configure_entry(0, ram + 0xfd00);
545   membank("bank4")->set_entry(0);
546
547   // allocate timers
548   m_clk_timer = timer_alloc();
549
550   // register for state saving
551   save_item(NAME(m_adlc_ie));
552   save_item(NAME(m_hdc_ie));
553   save_item(NAME(m_rtc_irq));
554   save_item(NAME(m_via_irq));
555   save_item(NAME(m_hdc_irq));
556   save_item(NAME(m_fdc_drq));
557   save_item(NAME(m_adlc_irq));
558}
559
560
561//-------------------------------------------------
562//  device_reset - device-specific reset
563//-------------------------------------------------
564
565void e01_device::device_reset()
566{
567   init_scsibus(m_scsibus, 512);
568
569   m_clk_timer->adjust(attotime::zero, 0, attotime::from_hz(200000));
570
571   membank("bank1")->set_entry(1);
572   membank("bank3")->set_entry(1);
573}
574
575
576//-------------------------------------------------
577//  device_timer - handler timer events
578//-------------------------------------------------
579
580void e01_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
581{
582   if (m_clk_en)
583   {
584      m_econet->clk_w(this, 1);
585      m_econet->clk_w(this, 0);
586   }
587}
588
589
590//-------------------------------------------------
591//  eprom_r - ROM/RAM select read
592//-------------------------------------------------
593
594READ8_MEMBER( e01_device::ram_select_r )
595{
596   membank("bank1")->set_entry(0);
597   membank("bank3")->set_entry(0);
598
599   return 0;
600}
601
602
603//-------------------------------------------------
604//  floppy_w - floppy control write
605//-------------------------------------------------
606
607WRITE8_MEMBER( e01_device::floppy_w )
608{
609   /*
610
611        bit     description
612
613        0       floppy 1 select
614        1       floppy 2 select
615        2       floppy side select
616        3       NVRAM select
617        4       floppy density
618        5       floppy master reset
619        6       floppy test
620        7       mode LED
621   
622   */
623   
624   // floppy 1 select
625   if (!BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
626
627   // floppy 2 select
628   if (!BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
629
630   // floppy side select
631   wd17xx_set_side(m_fdc, BIT(data, 2));
632
633   // TODO NVRAM select
634   //mc146818_stby_w(m_rtc, BIT(data, 3));
635
636   // floppy density
637   wd17xx_dden_w(m_fdc, BIT(data, 4));
638
639   // floppy master reset
640   wd17xx_mr_w(m_fdc, BIT(data, 5));
641
642   // TODO floppy test
643   //wd17xx_test_w(m_fdc, BIT(data, 6));
644
645   // mode LED
646   output_set_value("led_0", BIT(data, 7));
647}
648
649
650//-------------------------------------------------
651//  network_irq_disable_r -
652//-------------------------------------------------
653
654READ8_MEMBER( e01_device::network_irq_disable_r )
655{
656   network_irq_enable(0);
657
658   return 0;
659}
660
661
662//-------------------------------------------------
663//  network_irq_disable_w -
664//-------------------------------------------------
665
666WRITE8_MEMBER( e01_device::network_irq_disable_w )
667{
668   network_irq_enable(0);
669}
670
671
672//-------------------------------------------------
673//  network_irq_enable_r -
674//-------------------------------------------------
675
676READ8_MEMBER( e01_device::network_irq_enable_r )
677{
678   network_irq_enable(1);
679
680   return 0;
681}
682
683
684//-------------------------------------------------
685//  network_irq_enable_w -
686//-------------------------------------------------
687
688WRITE8_MEMBER( e01_device::network_irq_enable_w )
689{
690   network_irq_enable(1);
691}
692
693
694//-------------------------------------------------
695//  hdc_data_r -
696//-------------------------------------------------
697
698READ8_MEMBER( e01_device::hdc_data_r )
699{
700   UINT8 data = scsi_data_r(m_scsibus, 0);
701   
702   scsi_ack_w(m_scsibus, 0);
703
704   return data;
705}
706
707
708//-------------------------------------------------
709//  hdc_data_w -
710//-------------------------------------------------
711
712WRITE8_MEMBER( e01_device::hdc_data_w )
713{
714   scsi_data_w(m_scsibus, 0, data);
715
716   scsi_ack_w(m_scsibus, 0);
717}
718
719
720//-------------------------------------------------
721//  hdc_status_r -
722//-------------------------------------------------
723
724READ8_MEMBER( e01_device::hdc_status_r )
725{
726   /*
727   
728       bit     description
729   
730       0       MSG
731       1       BSY
732       2       0
733       3       0
734       4       NIRQ
735       5       REQ
736       6       I/O
737       7       C/D
738   
739   */
740
741   UINT8 data = 0;
742
743   // SCSI bus
744   data |= !scsi_msg_r(m_scsibus);
745   data |= !scsi_bsy_r(m_scsibus) << 1;
746   data |= !scsi_req_r(m_scsibus) << 5;
747   data |= !scsi_io_r(m_scsibus) << 6;
748   data |= !scsi_cd_r(m_scsibus) << 7;
749
750   // TODO NIRQ
751
752   return data;
753}
754
755
756//-------------------------------------------------
757//  hdc_select_w -
758//-------------------------------------------------
759
760WRITE8_MEMBER( e01_device::hdc_select_w )
761{
762   scsi_sel_w(m_scsibus, 0);
763}
764
765
766//-------------------------------------------------
767//  hdc_irq_enable_w -
768//-------------------------------------------------
769
770WRITE8_MEMBER( e01_device::hdc_irq_enable_w )
771{
772   hdc_irq_enable(BIT(data, 0));
773}
774
775
776//-------------------------------------------------
777//  rtc_address_r -
778//-------------------------------------------------
779
780READ8_MEMBER( e01_device::rtc_address_r )
781{
782   return m_rtc->read(space, 0);
783}
784
785
786//-------------------------------------------------
787//  rtc_address_w -
788//-------------------------------------------------
789
790WRITE8_MEMBER( e01_device::rtc_address_w )
791{
792   m_rtc->write(space, 0, data);
793}
794
795
796//-------------------------------------------------
797//  rtc_data_r -
798//-------------------------------------------------
799
800READ8_MEMBER( e01_device::rtc_data_r )
801{
802   return m_rtc->read(space, 1);
803}
804
805
806//-------------------------------------------------
807//  rtc_data_w -
808//-------------------------------------------------
809
810WRITE8_MEMBER( e01_device::rtc_data_w )
811{
812   m_rtc->write(space, 1, data);
813}
814
815
816//-------------------------------------------------
817//  econet_clk_w -
818//-------------------------------------------------
819
820void e01_device::econet_clk(int state)
821{
822   mc6854_rxc_w(m_adlc, state);
823   mc6854_txc_w(m_adlc, state);
824}
1/**********************************************************************
2 
3    Acorn FileStore E01/E01S network hard disk emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8    http://acorn.chriswhy.co.uk/Network/Econet.html
9    http://acorn.chriswhy.co.uk/Network/Pics/Acorn_FileStoreE01.html
10    http://acorn.chriswhy.co.uk/8bit_Upgrades/Acorn_FileStoreE01S.html
11    http://www.heyrick.co.uk/econet/fs/emulator.html
12    http://www.pdfio.com/k-1019481.html#
13 
14**********************************************************************/
15 
16/*
17 
18    The FileStore E01 is an Econet station in its own right which acts as a fileserver when connected to a network. It is a single unit
19    which does not require a monitor or keyboard. Communication with the FileStore is done via another Econet station when the FileStore
20    is in one of two "maintenance modes"
21 
22    The E01 can be seen as a slimmed-down BBC computer tailored for its function as a fileserver. It has a 6502 processor at its heart
23    along with a 6522 VIA just like the BBC. It requires a Master series Econet module to be plugged in and connects to the network via
24    an Econet port in the same way as any other station.
25 
26    The FileStore E01S was Acorns second generation Filestore replacing the FileStore E01. The FileStore is a dedicated Econet fileserver,
27    it does not support a keyboard and monitor, instead you use an Econet attached station to logon and perform administrative tasks.
28 
29            Hitachi HD146818P Real Time Clock
30            Rockwell R65C102P3 CPU
31            2 x TMM27256D-20 white labelled EPROMs, TMSE01 MOS on left and E01 FS on the right
32    IC20    WD2793-APL-02 floppy disc controller
33            2 x NEC D41464C-12 64k x 4bit NMOS RAM ICs giving 64K memory
34    IC21    Rockwell RC6522AP VIA behind to the right
35 
36*/
37 
38/*
39 
40    TODO:
41 
42    - memory_bank::set_entry called for bank ':econet254:e01s:bank2' with invalid bank entry 0
43    - centronics strobe
44    - econet clock speed select
45    - ADLC interrupts
46    - ECONET device
47    - artwork
48    - hard disk
49 
50        E20: Rodime RO652 (-chs 306,4,17,512)
51        E40S: Rodime RO3057S (-chs 680,5,26,512)
52        E60S:
53 
54*/
55 
56#include "e01.h"
57#include "machine/scsihd.h"
58 
59 
60 
61//**************************************************************************
62//  MACROS / CONSTANTS
63//**************************************************************************
64 
65#define R65C102_TAG      "r65c102"
66#define R6522_TAG      "ic21"
67#define WD2793_TAG      "ic20"
68#define MC6854_TAG      "mc6854"
69#define HD146818_TAG   "hd146818"
70#define CENTRONICS_TAG   "centronics"
71#define SCSIBUS_TAG      "scsi"
72 
73 
74 
75//**************************************************************************
76//  DEVICE DEFINITIONS
77//**************************************************************************
78 
79const device_type E01 = &device_creator<e01_device>;
80const device_type E01S = &device_creator<e01s_device>;
81 
82e01s_device::e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
83   :e01_device(mconfig, E01S, "Acorn FileStore E01S", tag, owner, clock) { m_variant = TYPE_E01S; }
84 
85 
86//-------------------------------------------------
87//  ROM( e01 )
88//-------------------------------------------------
89 
90ROM_START( e01 )
91    ROM_REGION( 0x10000, R65C102_TAG, 0 )
92   //ROM_DEFAULT_BIOS("v131")
93   //ROM_SYSTEM_BIOS( 0, "v131", "V 1.31" )
94   ROM_LOAD( "0254,205-04 e01 fs",  0x0000, 0x8000, CRC(ae666c76) SHA1(0954119eb5cd09cdbadf76d60d812aa845838d5a) )
95   ROM_LOAD( "0254,205-03 e01 mos", 0x8000, 0x8000, CRC(a13e8014) SHA1(6f44a1a48108c60a64a1774cb30c1a59c4a6a199) )
96ROM_END
97 
98 
99//-------------------------------------------------
100//  ROM( e01s )
101//-------------------------------------------------
102 
103ROM_START( e01s )
104    ROM_REGION( 0x10000, R65C102_TAG, 0 )
105   //ROM_DEFAULT_BIOS("v140")
106   //ROM_SYSTEM_BIOS( 0, "v133", "V 1.33" ) // 0282,008-02 e01s rom
107   ROM_LOAD( "e01sv133.rom",  0x0000, 0x10000, CRC(2a4a0032) SHA1(54ad68ceae44992293ccdd64ec88ad8520deec22) ) // which label?
108   //ROM_SYSTEM_BIOS( 1, "v140", "V 1.40" )
109   ROM_LOAD( "e01sv140.rom",  0x0000, 0x10000, CRC(5068fe86) SHA1(9b8740face15b5541e2375b3054988af00757931) ) // which label?
110ROM_END
111 
112 
113//-------------------------------------------------
114//  rom_region - device-specific ROM region
115//-------------------------------------------------
116 
117const rom_entry *e01_device::device_rom_region() const
118{
119   switch (m_variant)
120   {
121   default:
122   case TYPE_E01:
123      return ROM_NAME( e01 );
124 
125   case TYPE_E01S:
126      return ROM_NAME( e01s );
127   }
128}
129 
130 
131//-------------------------------------------------
132//  MC146818_INTERFACE( rtc_intf )
133//-------------------------------------------------
134 
135WRITE_LINE_MEMBER( e01_device::rtc_irq_w )
136{
137    m_rtc_irq = state;
138 
139    update_interrupts();
140}
141 
142static mc146818_interface rtc_intf =
143{
144   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, rtc_irq_w)
145};
146 
147 
148//-------------------------------------------------
149//  mc6854_interface adlc_intf
150//-------------------------------------------------
151 
152WRITE_LINE_MEMBER( e01_device::adlc_irq_w )
153{
154    m_adlc_irq = state;
155 
156    update_interrupts();
157}
158 
159READ_LINE_MEMBER( e01_device::econet_data_r )
160{
161   return m_econet->data_r();
162}
163 
164WRITE_LINE_MEMBER( e01_device::econet_data_w )
165{
166   m_econet->data_w(this, state);
167}
168 
169static const mc6854_interface adlc_intf =
170{
171   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, adlc_irq_w),
172   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, econet_data_r),
173   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, econet_data_w),
174   NULL,
175   DEVCB_NULL,
176   DEVCB_NULL
177};
178 
179 
180//-------------------------------------------------
181//  via6522_interface via_intf
182//-------------------------------------------------
183 
184WRITE_LINE_MEMBER( e01_device::via_irq_w )
185{
186   m_via_irq = state;
187 
188   update_interrupts();
189}
190 
191WRITE_LINE_MEMBER( e01_device::clk_en_w )
192{
193   m_clk_en = state;
194}
195 
196static const via6522_interface via_intf =
197{
198   DEVCB_NULL,
199   DEVCB_NULL,
200   DEVCB_NULL,
201   DEVCB_NULL,
202   DEVCB_NULL,
203   DEVCB_NULL,
204 
205   DEVCB_DEVICE_MEMBER(CENTRONICS_TAG, centronics_device, write),
206   DEVCB_NULL,
207   DEVCB_NULL,
208   DEVCB_NULL,
209   DEVCB_NULL,
210   DEVCB_NULL,
211 
212   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, via_irq_w)
213};
214 
215 
216//-------------------------------------------------
217//  floppy_interface e01_floppy_interface
218//-------------------------------------------------
219 
220static const floppy_interface e01_floppy_interface =
221{
222   DEVCB_NULL,
223   DEVCB_NULL,
224   DEVCB_NULL,
225   DEVCB_NULL,
226   DEVCB_NULL,
227   FLOPPY_STANDARD_3_5_DSDD, // NEC FD1036 A
228   LEGACY_FLOPPY_OPTIONS_NAME(default),
229   NULL,
230   NULL
231};
232 
233 
234//-------------------------------------------------
235//  wd17xx_interface fdc_intf
236//-------------------------------------------------
237 
238WRITE_LINE_MEMBER( e01_device::fdc_irq_w )
239{
240   m_fdc_irq = state;
241 
242   update_interrupts();
243}
244 
245WRITE_LINE_MEMBER( e01_device::fdc_drq_w )
246{
247   m_fdc_drq = state;
248 
249   update_interrupts();
250}
251 
252static const wd17xx_interface fdc_intf =
253{
254   DEVCB_NULL,
255   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, fdc_irq_w),
256   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, fdc_drq_w),
257   { FLOPPY_0, FLOPPY_1, NULL, NULL }
258};
259 
260 
261//-------------------------------------------------
262//  SCSIBus_interface scsi_intf
263//-------------------------------------------------
264 
265static const SCSIConfigTable scsi_dev_table =
266{
267   1,
268   {
269      { SCSI_ID_0, "harddisk0" }
270   }
271};
272 
273WRITE_LINE_MEMBER( e01_device::scsi_bsy_w )
274{
275   if (!state)
276   {
277      scsi_sel_w(m_scsibus, 1);
278   }
279}
280 
281WRITE_LINE_MEMBER( e01_device::scsi_req_w )
282{
283   if (state)
284   {
285      scsi_ack_w(m_scsibus, 1);
286   }
287 
288   m_hdc_irq = !state;
289   update_interrupts();
290}
291 
292static const SCSIBus_interface scsi_intf =
293{
294    &scsi_dev_table,
295    NULL,
296   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, scsi_bsy_w),
297   DEVCB_NULL,
298   DEVCB_NULL,
299   DEVCB_NULL,
300   DEVCB_NULL,
301   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, e01_device, scsi_req_w),
302   DEVCB_NULL
303};
304 
305 
306//-------------------------------------------------
307//  centronics_interface e01_centronics_intf
308//-------------------------------------------------
309 
310static centronics_interface e01_centronics_intf =
311{
312   DEVCB_DEVICE_LINE_MEMBER(R6522_TAG, via6522_device, write_ca1),
313   DEVCB_NULL,
314   DEVCB_NULL
315};
316 
317 
318//-------------------------------------------------
319//  ADDRESS_MAP( e01_mem )
320//-------------------------------------------------
321 
322static ADDRESS_MAP_START( e01_mem, AS_PROGRAM, 8, e01_device )
323   AM_RANGE(0x0000, 0xfbff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2")
324   AM_RANGE(0xfc00, 0xfc00) AM_MIRROR(0x00c3) AM_READWRITE(rtc_address_r, rtc_address_w)
325   AM_RANGE(0xfc04, 0xfc04) AM_MIRROR(0x00c3) AM_READWRITE(rtc_data_r, rtc_data_w)
326   AM_RANGE(0xfc08, 0xfc08) AM_MIRROR(0x00c0) AM_READ(ram_select_r) AM_WRITE(floppy_w)
327   AM_RANGE(0xfc0c, 0xfc0f) AM_MIRROR(0x00c0) AM_DEVREADWRITE_LEGACY(WD2793_TAG, wd17xx_r, wd17xx_w)
328   AM_RANGE(0xfc10, 0xfc1f) AM_MIRROR(0x00c0) AM_DEVREADWRITE(R6522_TAG, via6522_device, read, write)
329   AM_RANGE(0xfc20, 0xfc23) AM_MIRROR(0x00c0) AM_DEVREADWRITE_LEGACY(MC6854_TAG, mc6854_r, mc6854_w)
330   AM_RANGE(0xfc24, 0xfc24) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_disable_r, network_irq_disable_w)
331   AM_RANGE(0xfc28, 0xfc28) AM_MIRROR(0x00c3) AM_READWRITE(network_irq_enable_r, network_irq_enable_w)
332   AM_RANGE(0xfc2c, 0xfc2c) AM_MIRROR(0x00c3) AM_READ_PORT("FLAP")
333   AM_RANGE(0xfc30, 0xfc30) AM_MIRROR(0x00c0) AM_READWRITE(hdc_data_r, hdc_data_w)
334   AM_RANGE(0xfc31, 0xfc31) AM_MIRROR(0x00c0) AM_READ(hdc_status_r)
335   AM_RANGE(0xfc32, 0xfc32) AM_MIRROR(0x00c0) AM_WRITE(hdc_select_w)
336   AM_RANGE(0xfc33, 0xfc33) AM_MIRROR(0x00c0) AM_WRITE(hdc_irq_enable_w)
337   AM_RANGE(0xfd00, 0xffff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank4")
338ADDRESS_MAP_END
339 
340 
341//-------------------------------------------------
342//  MACHINE_DRIVER( e01 )
343//-------------------------------------------------
344 
345static MACHINE_CONFIG_FRAGMENT( e01 )
346    // basic machine hardware
347   MCFG_CPU_ADD(R65C102_TAG, M65C02, XTAL_8MHz/4) // Rockwell R65C102P3
348    MCFG_CPU_PROGRAM_MAP(e01_mem)
349 
350   MCFG_MC146818_IRQ_ADD(HD146818_TAG, MC146818_STANDARD, rtc_intf)
351 
352   // devices
353   MCFG_VIA6522_ADD(R6522_TAG, XTAL_8MHz/4, via_intf)
354   MCFG_MC6854_ADD(MC6854_TAG, adlc_intf)
355   MCFG_WD2793_ADD(WD2793_TAG, fdc_intf)
356   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(e01_floppy_interface)
357   MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, e01_centronics_intf)
358 
359   MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsi_intf)
360   MCFG_DEVICE_ADD("harddisk0", SCSIHD, 0)
361 
362   // internal ram
363   MCFG_RAM_ADD(RAM_TAG)
364   MCFG_RAM_DEFAULT_SIZE("64K")
365MACHINE_CONFIG_END
366 
367 
368//-------------------------------------------------
369//  machine_config_additions - device-specific
370//  machine configurations
371//-------------------------------------------------
372 
373machine_config_constructor e01_device::device_mconfig_additions() const
374{
375   return MACHINE_CONFIG_NAME( e01 );
376}
377 
378 
379//-------------------------------------------------
380//  INPUT_PORTS( e01 )
381//-------------------------------------------------
382 
383static INPUT_PORTS_START( e01 )
384   PORT_START("FLAP")
385   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNUSED )
386   PORT_CONFNAME( 0x40, 0x00, "Front Flap")
387   PORT_CONFSETTING( 0x00, "Closed" )
388   PORT_CONFSETTING( 0x40, "Open" )
389   PORT_DIPNAME( 0x80, 0x00, "SW3")
390   PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
391   PORT_DIPSETTING( 0x80, DEF_STR( On ) )
392INPUT_PORTS_END
393 
394 
395//-------------------------------------------------
396//  input_ports - device-specific input ports
397//-------------------------------------------------
398 
399ioport_constructor e01_device::device_input_ports() const
400{
401   return INPUT_PORTS_NAME( e01 );
402}
403 
404 
405 
406//**************************************************************************
407//  INLINE HELPERS
408//**************************************************************************
409 
410//-------------------------------------------------
411//  update_interrupts - update interrupt state
412//-------------------------------------------------
413 
414inline void e01_device::update_interrupts()
415{
416   int irq = (m_via_irq || (m_hdc_ie & m_hdc_irq) || m_rtc_irq) ? ASSERT_LINE : CLEAR_LINE;
417   int nmi = (m_fdc_irq || m_fdc_drq || (m_adlc_ie & m_adlc_irq)) ? ASSERT_LINE : CLEAR_LINE;
418 
419   m_maincpu->set_input_line(INPUT_LINE_IRQ0, irq);
420   m_maincpu->set_input_line(INPUT_LINE_NMI, nmi);
421}
422 
423 
424//-------------------------------------------------
425//   network_irq_enable - network interrupt enable
426//-------------------------------------------------
427 
428inline void e01_device::network_irq_enable(int enabled)
429{
430   m_adlc_ie = enabled;
431 
432   update_interrupts();
433}
434 
435 
436//-------------------------------------------------
437//   hdc_irq_enable - hard disk interrupt enable
438//-------------------------------------------------
439 
440inline void e01_device::hdc_irq_enable(int enabled)
441{
442   m_hdc_ie = enabled;
443 
444   update_interrupts();
445}
446 
447 
448 
449//**************************************************************************
450//  LIVE DEVICE
451//**************************************************************************
452 
453//-------------------------------------------------
454//  e01_device - constructor
455//-------------------------------------------------
456 
457e01_device::e01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
458    : device_t(mconfig, E01, "Acorn FileStore E01", tag, owner, clock),
459      device_econet_interface(mconfig, *this),
460     m_maincpu(*this, R65C102_TAG),
461     m_fdc(*this, WD2793_TAG),
462     m_adlc(*this, MC6854_TAG),
463     m_rtc(*this, HD146818_TAG),
464     m_ram(*this, RAM_TAG),
465     m_scsibus(*this, SCSIBUS_TAG),
466     m_adlc_ie(0),
467     m_hdc_ie(0),
468     m_rtc_irq(CLEAR_LINE),
469     m_via_irq(CLEAR_LINE),
470     m_hdc_irq(CLEAR_LINE),
471     m_fdc_irq(CLEAR_LINE),
472     m_fdc_drq(CLEAR_LINE),
473     m_adlc_irq(CLEAR_LINE),
474     m_clk_en(0)
475{
476}
477 
478 
479e01_device::e01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock)
480    : device_t(mconfig, type, name, tag, owner, clock),
481      device_econet_interface(mconfig, *this),
482     m_maincpu(*this, R65C102_TAG),
483     m_fdc(*this, WD2793_TAG),
484     m_adlc(*this, MC6854_TAG),
485     m_rtc(*this, HD146818_TAG),
486     m_ram(*this, RAM_TAG),
487     m_scsibus(*this, SCSIBUS_TAG),
488     m_adlc_ie(0),
489     m_hdc_ie(0),
490     m_rtc_irq(CLEAR_LINE),
491     m_via_irq(CLEAR_LINE),
492     m_hdc_irq(CLEAR_LINE),
493     m_fdc_irq(CLEAR_LINE),
494     m_fdc_drq(CLEAR_LINE),
495     m_adlc_irq(CLEAR_LINE),
496     m_clk_en(0)
497{
498}
499 
500 
501//-------------------------------------------------
502//  device_config_complete - perform any
503//  operations now that the configuration is
504//  complete
505//-------------------------------------------------
506 
507void e01_device::device_config_complete()
508{
509   switch (m_variant)
510   {
511   default:
512   case TYPE_E01:
513      m_shortname = "e01";
514      break;
515 
516   case TYPE_E01S:
517      m_shortname = "e01s";
518      break;
519   }
520}
521 
522 
523//-------------------------------------------------
524//  device_start - device-specific startup
525//-------------------------------------------------
526 
527void e01_device::device_start()
528{
529   // setup memory banking
530   UINT8 *ram = m_ram->pointer();
531   UINT8 *rom = memregion(R65C102_TAG)->base();
532 
533   membank("bank1")->configure_entry(0, ram);
534   membank("bank1")->configure_entry(1, rom);
535   membank("bank1")->set_entry(1);
536 
537   membank("bank2")->configure_entry(0, ram);
538//  membank("bank2")->set_entry(0);
539 
540   membank("bank3")->configure_entry(0, ram + 0xfd00);
541   membank("bank3")->configure_entry(1, rom + 0xfd00);
542   membank("bank3")->set_entry(1);
543 
544   membank("bank4")->configure_entry(0, ram + 0xfd00);
545   membank("bank4")->set_entry(0);
546 
547   // allocate timers
548   m_clk_timer = timer_alloc();
549 
550   // register for state saving
551   save_item(NAME(m_adlc_ie));
552   save_item(NAME(m_hdc_ie));
553   save_item(NAME(m_rtc_irq));
554   save_item(NAME(m_via_irq));
555   save_item(NAME(m_hdc_irq));
556   save_item(NAME(m_fdc_drq));
557   save_item(NAME(m_adlc_irq));
558}
559 
560 
561//-------------------------------------------------
562//  device_reset - device-specific reset
563//-------------------------------------------------
564 
565void e01_device::device_reset()
566{
567   init_scsibus(m_scsibus, 512);
568 
569   m_clk_timer->adjust(attotime::zero, 0, attotime::from_hz(200000));
570 
571   membank("bank1")->set_entry(1);
572   membank("bank3")->set_entry(1);
573}
574 
575 
576//-------------------------------------------------
577//  device_timer - handler timer events
578//-------------------------------------------------
579 
580void e01_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
581{
582   if (m_clk_en)
583   {
584      m_econet->clk_w(this, 1);
585      m_econet->clk_w(this, 0);
586   }
587}
588 
589 
590//-------------------------------------------------
591//  eprom_r - ROM/RAM select read
592//-------------------------------------------------
593 
594READ8_MEMBER( e01_device::ram_select_r )
595{
596   membank("bank1")->set_entry(0);
597   membank("bank3")->set_entry(0);
598 
599   return 0;
600}
601 
602 
603//-------------------------------------------------
604//  floppy_w - floppy control write
605//-------------------------------------------------
606 
607WRITE8_MEMBER( e01_device::floppy_w )
608{
609   /*
610 
611        bit     description
612 
613        0       floppy 1 select
614        1       floppy 2 select
615        2       floppy side select
616        3       NVRAM select
617        4       floppy density
618        5       floppy master reset
619        6       floppy test
620        7       mode LED
621 
622    */
623 
624   // floppy 1 select
625   if (!BIT(data, 0)) wd17xx_set_drive(m_fdc, 0);
626 
627   // floppy 2 select
628   if (!BIT(data, 1)) wd17xx_set_drive(m_fdc, 1);
629 
630   // floppy side select
631   wd17xx_set_side(m_fdc, BIT(data, 2));
632 
633   // TODO NVRAM select
634   //mc146818_stby_w(m_rtc, BIT(data, 3));
635 
636   // floppy density
637   wd17xx_dden_w(m_fdc, BIT(data, 4));
638 
639   // floppy master reset
640   wd17xx_mr_w(m_fdc, BIT(data, 5));
641 
642   // TODO floppy test
643   //wd17xx_test_w(m_fdc, BIT(data, 6));
644 
645   // mode LED
646   output_set_value("led_0", BIT(data, 7));
647}
648 
649 
650//-------------------------------------------------
651//  network_irq_disable_r -
652//-------------------------------------------------
653 
654READ8_MEMBER( e01_device::network_irq_disable_r )
655{
656   network_irq_enable(0);
657 
658   return 0;
659}
660 
661 
662//-------------------------------------------------
663//  network_irq_disable_w -
664//-------------------------------------------------
665 
666WRITE8_MEMBER( e01_device::network_irq_disable_w )
667{
668   network_irq_enable(0);
669}
670 
671 
672//-------------------------------------------------
673//  network_irq_enable_r -
674//-------------------------------------------------
675 
676READ8_MEMBER( e01_device::network_irq_enable_r )
677{
678   network_irq_enable(1);
679 
680   return 0;
681}
682 
683 
684//-------------------------------------------------
685//  network_irq_enable_w -
686//-------------------------------------------------
687 
688WRITE8_MEMBER( e01_device::network_irq_enable_w )
689{
690   network_irq_enable(1);
691}
692 
693 
694//-------------------------------------------------
695//  hdc_data_r -
696//-------------------------------------------------
697 
698READ8_MEMBER( e01_device::hdc_data_r )
699{
700   UINT8 data = scsi_data_r(m_scsibus, 0);
701 
702   scsi_ack_w(m_scsibus, 0);
703 
704   return data;
705}
706 
707 
708//-------------------------------------------------
709//  hdc_data_w -
710//-------------------------------------------------
711 
712WRITE8_MEMBER( e01_device::hdc_data_w )
713{
714   scsi_data_w(m_scsibus, 0, data);
715 
716   scsi_ack_w(m_scsibus, 0);
717}
718 
719 
720//-------------------------------------------------
721//  hdc_status_r -
722//-------------------------------------------------
723 
724READ8_MEMBER( e01_device::hdc_status_r )
725{
726   /*
727 
728        bit     description
729 
730        0       MSG
731        1       BSY
732        2       0
733        3       0
734        4       NIRQ
735        5       REQ
736        6       I/O
737        7       C/D
738 
739    */
740 
741   UINT8 data = 0;
742 
743   // SCSI bus
744   data |= !scsi_msg_r(m_scsibus);
745   data |= !scsi_bsy_r(m_scsibus) << 1;
746   data |= !scsi_req_r(m_scsibus) << 5;
747   data |= !scsi_io_r(m_scsibus) << 6;
748   data |= !scsi_cd_r(m_scsibus) << 7;
749 
750   // TODO NIRQ
751 
752   return data;
753}
754 
755 
756//-------------------------------------------------
757//  hdc_select_w -
758//-------------------------------------------------
759 
760WRITE8_MEMBER( e01_device::hdc_select_w )
761{
762   scsi_sel_w(m_scsibus, 0);
763}
764 
765 
766//-------------------------------------------------
767//  hdc_irq_enable_w -
768//-------------------------------------------------
769 
770WRITE8_MEMBER( e01_device::hdc_irq_enable_w )
771{
772   hdc_irq_enable(BIT(data, 0));
773}
774 
775 
776//-------------------------------------------------
777//  rtc_address_r -
778//-------------------------------------------------
779 
780READ8_MEMBER( e01_device::rtc_address_r )
781{
782   return m_rtc->read(space, 0);
783}
784 
785 
786//-------------------------------------------------
787//  rtc_address_w -
788//-------------------------------------------------
789 
790WRITE8_MEMBER( e01_device::rtc_address_w )
791{
792   m_rtc->write(space, 0, data);
793}
794 
795 
796//-------------------------------------------------
797//  rtc_data_r -
798//-------------------------------------------------
799 
800READ8_MEMBER( e01_device::rtc_data_r )
801{
802   return m_rtc->read(space, 1);
803}
804 
805 
806//-------------------------------------------------
807//  rtc_data_w -
808//-------------------------------------------------
809 
810WRITE8_MEMBER( e01_device::rtc_data_w )
811{
812   m_rtc->write(space, 1, data);
813}
814 
815 
816//-------------------------------------------------
817//  econet_clk_w -
818//-------------------------------------------------
819 
820void e01_device::econet_clk(int state)
821{
822   mc6854_rxc_w(m_adlc, state);
823   mc6854_txc_w(m_adlc, state);
824}
src/mess/machine/e01.h
r15442r15443
1/**********************************************************************
2
3    Acorn FileStore E01/E01S network hard disk emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#pragma once
11
12#ifndef __E01__
13#define __E01__
14
15#include "emu.h"
16#include "cpu/m6502/m6502.h"
17#include "imagedev/flopdrv.h"
18#include "imagedev/harddriv.h"
19#include "machine/6522via.h"
20#include "machine/ctronics.h"
21#include "machine/econet.h"
22#include "machine/mc146818.h"
23#include "machine/mc6854.h"
24#include "machine/ram.h"
25#include "machine/scsibus.h"
26#include "machine/wd17xx.h"
27
28class e01_device : public device_t,
29               public device_econet_interface
30{
31public:
32    // construction/destruction
33   e01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
34    e01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35
36   enum
37   {
38      TYPE_E01 = 0,
39      TYPE_E01S
40   };
41
42   DECLARE_READ8_MEMBER( ram_select_r );
43   DECLARE_WRITE8_MEMBER( floppy_w );
44   DECLARE_READ8_MEMBER( network_irq_disable_r );
45   DECLARE_WRITE8_MEMBER( network_irq_disable_w );
46   DECLARE_READ8_MEMBER( network_irq_enable_r );
47   DECLARE_WRITE8_MEMBER( network_irq_enable_w );
48   DECLARE_READ8_MEMBER( hdc_data_r );
49   DECLARE_WRITE8_MEMBER( hdc_data_w );
50   DECLARE_READ8_MEMBER( hdc_status_r );
51   DECLARE_WRITE8_MEMBER( hdc_select_w );
52   DECLARE_WRITE8_MEMBER( hdc_irq_enable_w );
53   DECLARE_READ8_MEMBER( rtc_address_r );
54   DECLARE_WRITE8_MEMBER( rtc_address_w );
55   DECLARE_READ8_MEMBER( rtc_data_r );
56   DECLARE_WRITE8_MEMBER( rtc_data_w );
57   DECLARE_WRITE_LINE_MEMBER( rtc_irq_w );
58   DECLARE_WRITE_LINE_MEMBER( adlc_irq_w );
59   DECLARE_READ_LINE_MEMBER( econet_data_r );
60   DECLARE_WRITE_LINE_MEMBER( econet_data_w );
61   DECLARE_WRITE_LINE_MEMBER( via_irq_w );
62   DECLARE_WRITE_LINE_MEMBER( clk_en_w );
63   DECLARE_WRITE_LINE_MEMBER( fdc_irq_w );
64   DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
65   DECLARE_WRITE_LINE_MEMBER( scsi_bsy_w );
66   DECLARE_WRITE_LINE_MEMBER( scsi_req_w );
67
68protected:
69    // device-level overrides
70    virtual void device_config_complete();
71    virtual void device_start();
72    virtual void device_reset();
73   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
74
75   // optional information overrides
76   virtual const rom_entry *device_rom_region() const;
77   virtual machine_config_constructor device_mconfig_additions() const;
78   virtual ioport_constructor device_input_ports() const;
79
80   // device_econet_interface overrides
81   virtual void econet_clk(int state);
82
83   required_device<cpu_device> m_maincpu;
84   required_device<device_t> m_fdc;
85   required_device<device_t> m_adlc;
86   required_device<mc146818_device> m_rtc;
87   required_device<ram_device> m_ram;
88   required_device<device_t> m_scsibus;
89
90   inline void update_interrupts();
91   inline void network_irq_enable(int enabled);
92   inline void hdc_irq_enable(int enabled);
93
94   // interrupt state
95   int m_adlc_ie;
96   int m_hdc_ie;
97   int m_rtc_irq;
98   int m_via_irq;
99   int m_hdc_irq;
100   int m_fdc_irq;
101   int m_fdc_drq;
102   int m_adlc_irq;
103
104   int m_clk_en;
105
106   int m_variant;
107
108   // timers
109   emu_timer *m_clk_timer;
110};
111
112
113// ======================> e01s_device
114
115class e01s_device :  public e01_device
116{
117public:
118    // construction/destruction
119    e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
120};
121
122
123// device type definition
124extern const device_type E01;
125extern const device_type E01S;
126
127
128
129#endif
1/**********************************************************************
2 
3    Acorn FileStore E01/E01S network hard disk emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#pragma once
11 
12#ifndef __E01__
13#define __E01__
14 
15#include "emu.h"
16#include "cpu/m6502/m6502.h"
17#include "imagedev/flopdrv.h"
18#include "imagedev/harddriv.h"
19#include "machine/6522via.h"
20#include "machine/ctronics.h"
21#include "machine/econet.h"
22#include "machine/mc146818.h"
23#include "machine/mc6854.h"
24#include "machine/ram.h"
25#include "machine/scsibus.h"
26#include "machine/wd17xx.h"
27 
28class e01_device : public device_t,
29               public device_econet_interface
30{
31public:
32    // construction/destruction
33   e01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
34    e01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
35 
36   enum
37   {
38      TYPE_E01 = 0,
39      TYPE_E01S
40   };
41 
42   DECLARE_READ8_MEMBER( ram_select_r );
43   DECLARE_WRITE8_MEMBER( floppy_w );
44   DECLARE_READ8_MEMBER( network_irq_disable_r );
45   DECLARE_WRITE8_MEMBER( network_irq_disable_w );
46   DECLARE_READ8_MEMBER( network_irq_enable_r );
47   DECLARE_WRITE8_MEMBER( network_irq_enable_w );
48   DECLARE_READ8_MEMBER( hdc_data_r );
49   DECLARE_WRITE8_MEMBER( hdc_data_w );
50   DECLARE_READ8_MEMBER( hdc_status_r );
51   DECLARE_WRITE8_MEMBER( hdc_select_w );
52   DECLARE_WRITE8_MEMBER( hdc_irq_enable_w );
53   DECLARE_READ8_MEMBER( rtc_address_r );
54   DECLARE_WRITE8_MEMBER( rtc_address_w );
55   DECLARE_READ8_MEMBER( rtc_data_r );
56   DECLARE_WRITE8_MEMBER( rtc_data_w );
57   DECLARE_WRITE_LINE_MEMBER( rtc_irq_w );
58   DECLARE_WRITE_LINE_MEMBER( adlc_irq_w );
59   DECLARE_READ_LINE_MEMBER( econet_data_r );
60   DECLARE_WRITE_LINE_MEMBER( econet_data_w );
61   DECLARE_WRITE_LINE_MEMBER( via_irq_w );
62   DECLARE_WRITE_LINE_MEMBER( clk_en_w );
63   DECLARE_WRITE_LINE_MEMBER( fdc_irq_w );
64   DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
65   DECLARE_WRITE_LINE_MEMBER( scsi_bsy_w );
66   DECLARE_WRITE_LINE_MEMBER( scsi_req_w );
67 
68protected:
69    // device-level overrides
70    virtual void device_config_complete();
71    virtual void device_start();
72    virtual void device_reset();
73   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
74 
75   // optional information overrides
76   virtual const rom_entry *device_rom_region() const;
77   virtual machine_config_constructor device_mconfig_additions() const;
78   virtual ioport_constructor device_input_ports() const;
79 
80   // device_econet_interface overrides
81   virtual void econet_clk(int state);
82 
83   required_device<cpu_device> m_maincpu;
84   required_device<device_t> m_fdc;
85   required_device<device_t> m_adlc;
86   required_device<mc146818_device> m_rtc;
87   required_device<ram_device> m_ram;
88   required_device<device_t> m_scsibus;
89 
90   inline void update_interrupts();
91   inline void network_irq_enable(int enabled);
92   inline void hdc_irq_enable(int enabled);
93 
94   // interrupt state
95   int m_adlc_ie;
96   int m_hdc_ie;
97   int m_rtc_irq;
98   int m_via_irq;
99   int m_hdc_irq;
100   int m_fdc_irq;
101   int m_fdc_drq;
102   int m_adlc_irq;
103 
104   int m_clk_en;
105 
106   int m_variant;
107 
108   // timers
109   emu_timer *m_clk_timer;
110};
111 
112 
113// ======================> e01s_device
114 
115class e01s_device :  public e01_device
116{
117public:
118    // construction/destruction
119    e01s_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
120};
121 
122 
123// device type definition
124extern const device_type E01;
125extern const device_type E01S;
126 
127 
128 
129#endif
src/mess/includes/dm7000.h
r15442r15443
2727   UINT8 m_scc0_lcr;
2828   UINT8 m_scc0_lsr;
2929   UINT8 m_term_data;
30   
3130
31
3232   DECLARE_WRITE8_MEMBER ( dm7000_gpio0_w );
3333   DECLARE_READ8_MEMBER ( dm7000_gpio0_r );
3434
src/mess/video/isa_ega.c
r15442r15443
790790         *p = ega->m_attribute.data[ ( data >> 4 ) & 0x03 ]; p++;
791791         *p = ega->m_attribute.data[ ( data >> 2 ) & 0x03 ]; p++;
792792         *p = ega->m_attribute.data[   data        & 0x03 ]; p++;
793         
793
794794         data = ega->m_plane[1][offset];
795795
796796         *p = ega->m_attribute.data[ ( data >> 6 )        ]; p++;
r15442r15443
803803   {
804804      // EGA mode
805805
806//      UINT8 mask = ega->m_attribute.data[0x12] & 0x0f;
806//      UINT8 mask = ega->m_attribute.data[0x12] & 0x0f;
807807
808808      for ( int i = 0; i < x_count; i++ )
809809      {
r15442r15443
817817         {
818818            UINT16 col = ( data0 & 0x01 ) | ( data1 & 0x02 ) | ( data2 & 0x04 ) | ( data3 & 0x08 );
819819
820//            col &= mask;
820//              col &= mask;
821821
822822            p[j] = ega->m_attribute.data[col];
823823
src/mess/video/uv201.h
r15442r15443
77 
88**********************************************************************
99                            _____   _____
10                   GND   1 |*    \_/     | 40   
11                     G   2 |             | 39   
10                   GND   1 |*    \_/     | 40
11                     G   2 |             | 39
1212                     I   3 |             | 38  RESET
1313                     B   4 |             | 37  BRC
14                     R   5 |             | 36 
14                     R   5 |             | 36
1515                   BA0   6 |             | 35  B1 STROBE
1616                   BA1   7 |             | 34  COLOR XTAL (3.636 MHz)
17                   BA2   8 |             | 33   
18                   BA3   9 |             | 32   
19                   BA4  10 |    UV201    | 31   
17                   BA2   8 |             | 33
18                   BA3   9 |             | 32
19                   BA4  10 |    UV201    | 31
2020                   BA5  11 |             | 30  EXTINT
2121                   BA6  12 |             | 29  O/E
2222                   BA7  13 |             | 28  BO7
r15442r15443
3232                         1 |*    \_/     | 40  B1 STROBE
3333                         2 |             | 39  CPU RQ1
3434               CPU RQ0   3 |             | 38  GND
35               XTAL IN   4 |             | 37 
35               XTAL IN   4 |             | 37
3636               XTAL IN   5 |             | 36  RESET
37                         6 |             | 35 
37                         6 |             | 35
3838               CPU phi   7 |             | 34  COLOR XTAL
3939                         8 |             | 33  BRC
4040                   BD0   9 |             | 32  BD7
r15442r15443
4545                   BO2  14 |             | 27  BO5
4646                   BD3  15 |             | 26  BD4
4747                   BO3  16 |             | 25  BO4
48                HBLANK  17 |             | 24   
49                        18 |             | 23   
50                        19 |             | 22   
51                        20 |_____________| 21   
48                HBLANK  17 |             | 24
49                        18 |             | 23
50                        19 |             | 22
51                        20 |_____________| 21
5252 
5353**********************************************************************/
5454 
src/mess/drivers/atari400.c
r15442r15443
11001100   MCFG_POKEY_CONFIG(atari_pokey_interface)
11011101   MCFG_POKEY_KEYBOARD_HANDLER(atari_a800_keyboard)
11021102   MCFG_POKEY_INTERRUPT_HANDLER(atari_interrupt_cb)
1103   
1103
11041104   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
11051105
11061106   /* internal ram */
r15442r15443
12911291   MCFG_POKEY_CONFIG(a5200_pokey_interface)
12921292   MCFG_POKEY_KEYBOARD_HANDLER(atari_a5200_keypads)
12931293   MCFG_POKEY_INTERRUPT_HANDLER(atari_interrupt_cb)
1294   
1294
12951295   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
12961296
12971297   MCFG_PIA6821_MODIFY( "pia", a5200_pia_interface )
src/mess/drivers/x1.c
r15442r15443
11711171
11721172         pcg_offset &= 0x7ff;
11731173
1174            gfx_element_mark_dirty(machine().gfx[1], pcg_offset >> 3);
1174         gfx_element_mark_dirty(machine().gfx[1], pcg_offset >> 3);
11751175      }
11761176      else // Compatible Mode
11771177      {
src/mess/drivers/m20.c
r15442r15443
166166
167167
168168/*
169port21      =   0x21      !TTL latch
170!   (see hw1 document, fig 2-33, pg 2-47)
171!      Output                  Input
172!      ======                  =====
173!   B0   0 selects floppy 0
174!      1 deselects floppy 0
175!   B1   0 selects floppy 1
176!      1 deselects floppy 1
177!   B2   Motor On (Not Used)
178!   B3   0 selects double density   0 => Skip basic tests
179!      1 selects single density   1 => Perform basic tests
180!                           Latched copy when B7 is written to Port21
181!   B4   Uncommitted output         0 => 128K card(s) present
182!                           1 => 32K(s) card present
183!                           Cannot mix types!
184!   B5   Uncommitted output         0 => 8-colour card present
185!                           1 => 4-colour card present
186!   B6   Uncommitted output         0 => RAM
187!                           1 => ROM (???)
188!   B7   See B3 input            0 => colour card present
169port21      =   0x21        !TTL latch
170!   (see hw1 document, fig 2-33, pg 2-47)
171!       Output                      Input
172!       ======                      =====
173!   B0  0 selects floppy 0
174!       1 deselects floppy 0
175!   B1  0 selects floppy 1
176!       1 deselects floppy 1
177!   B2  Motor On (Not Used)
178!   B3  0 selects double density    0 => Skip basic tests
179!       1 selects single density    1 => Perform basic tests
180!                                   Latched copy when B7 is written to Port21
181!   B4  Uncommitted output          0 => 128K card(s) present
182!                                   1 => 32K(s) card present
183!                                   Cannot mix types!
184!   B5  Uncommitted output          0 => 8-colour card present
185!                                   1 => 4-colour card present
186!   B6  Uncommitted output          0 => RAM
187!                                   1 => ROM (???)
188!   B7  See B3 input                0 => colour card present
189189*/
190190
191191READ16_MEMBER(m20_state::port21_r)
r15442r15443
265265WRITE_LINE_MEMBER( m20_state::timer_tick_w )
266266{
267267   /* Using HOLD_LINE is not completely correct:
268    * The output of the 8253 is connected to a 74LS74 flop chip.
269    * The output of the flop chip is connected to NVI CPU input.
270    * The flop is reset by a 1:8 decoder which compares CPU ST0-ST3
271    * outputs to detect an interrupt acknowledge transaction.
272    * 8253 is programmed in square wave mode, not rate
273    * generator mode.
274    */
268     * The output of the 8253 is connected to a 74LS74 flop chip.
269     * The output of the flop chip is connected to NVI CPU input.
270     * The flop is reset by a 1:8 decoder which compares CPU ST0-ST3
271     * outputs to detect an interrupt acknowledge transaction.
272     * 8253 is programmed in square wave mode, not rate
273     * generator mode.
274     */
275275   device_set_input_line(m_maincpu, 0, state ? HOLD_LINE /*ASSERT_LINE*/ : CLEAR_LINE);
276276}
277277
src/mess/drivers/wangpc.c
r15442r15443
1010 
1111/*
1212 
13   TODO:
13    TODO:
1414 
15   - hard disk
15    - hard disk
1616 
1717*/
1818 
r15442r15443
104104 
105105   m_enable_eop = BIT(data, 0);
106106   m_disable_dreq2 = BIT(data, 1);
107   
107
108108   if (BIT(data, 2)) m_fdc_dd0 = 0;
109109   if (BIT(data, 3)) m_fdc_dd1 = 0;
110110 
r15442r15443
404404READ8_MEMBER( wangpc_state::uart_r )
405405{
406406   m_uart_dr = 0;
407   
407
408408   check_level2_interrupts();
409   
409
410410   UINT8 data = m_uart->read(space, 0);
411411 
412412    if (LOG) logerror("%s: UART read %02x\n", machine().describe_context(), data);
r15442r15443
12361236    wangpc_state *state = static_cast<wangpc_state *>(image.device().owner());
12371237 
12381238    if (LOG) logerror("Door 2 disturbed\n");
1239   
1239
12401240   state->m_fdc_dd1 = 1;
12411241 
12421242   state->check_level2_interrupts();
src/mess/drivers/itt3030.c
r15442r15443
11/***************************************************************************
22
3   ITT 3030
3    ITT 3030
44
55***************************************************************************/
66
r15442r15443
3030   virtual void machine_reset();
3131
3232   virtual void video_start();
33public:   
34   
33public:
34
3535   DECLARE_READ8_MEMBER(unk1_r);
3636   DECLARE_READ8_MEMBER(unk2_r);
3737private:
r15442r15443
6767         drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0],  code , 0, 0,0, x*8,y*16);
6868      }
6969   }
70   
70
7171   return 0;
7272}
7373
r15442r15443
148148   ROM_REGION( 0x0800, "gfx1", ROMREGION_ERASE00 )
149149   ROM_LOAD( "gb136-0.bin", 0x0000, 0x0800, CRC(6a3895a8) SHA1(f3b977ffa2f54c346521c9ef034830de8f404621))
150150   ROM_REGION( 0x0400, "gfxcpu", ROMREGION_ERASE00 )
151   ROM_LOAD( "8741ad.bin", 0x0000, 0x0400, CRC(cabf4394) SHA1(e5d1416b568efa32b578ca295a29b7b5d20c0def))   
151   ROM_LOAD( "8741ad.bin", 0x0000, 0x0400, CRC(cabf4394) SHA1(e5d1416b568efa32b578ca295a29b7b5d20c0def))
152152ROM_END
153153
154154GAME( 1982, itt3030,  0,   itt3030,  itt3030,  0,       ROT0, "ITT RFA",      "ITT3030", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mess/drivers/esq1.c
r15442r15443
166166static ADDRESS_MAP_START( sq80_map, AS_PROGRAM, 8, esq1_state )
167167   AM_RANGE(0x0000, 0x1fff) AM_RAM               // OSRAM
168168   AM_RANGE(0x4000, 0x5fff) AM_RAM               // SEQRAM
169//   AM_RANGE(0x4000, 0x5fff) AM_READWRITE(seqdosram_r, seqdosram_w)
169//  AM_RANGE(0x4000, 0x5fff) AM_READWRITE(seqdosram_r, seqdosram_w)
170170   AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("es5503", es5503_device, read, write)
171171   AM_RANGE(0x6400, 0x640f) AM_DEVREADWRITE_LEGACY("duart", duart68681_r, duart68681_w)
172172    AM_RANGE(0x6c00, 0x6dff) AM_WRITE(mapper_w)
r15442r15443
332332
333333ROM_START( sq80 )
334334    ROM_REGION(0x10000, "osrom", 0)
335    ROM_LOAD( "sq80rom.low",  0x0000, 0x008000, CRC(97ecd9a0) SHA1(cadff16ebbc15b52cf1d3335d22dc930d430a058) )
336    ROM_LOAD( "sq80rom.hig",  0x8000, 0x008000, CRC(f83962b1) SHA1(e3e5cf41f15a37f8bf29b88fb1c85c0fca9ea912) )
335    ROM_LOAD( "sq80rom.low",  0x0000, 0x008000, CRC(97ecd9a0) SHA1(cadff16ebbc15b52cf1d3335d22dc930d430a058) )
336    ROM_LOAD( "sq80rom.hig",  0x8000, 0x008000, CRC(f83962b1) SHA1(e3e5cf41f15a37f8bf29b88fb1c85c0fca9ea912) )
337337
338338    ROM_REGION(0x40000, "es5503", 0)
339    ROM_LOAD( "2202.bin",     0x0000, 0x010000, CRC(dffd538c) SHA1(e90f6ff3a7804b54c8a3b1b574ec9c223a6c2bf9) )
340    ROM_LOAD( "2203.bin",     0x0000, 0x010000, CRC(9be8cceb) SHA1(1ee4d7e6d2171b44e88e464071bdc4b800b69c4a) )
341    ROM_LOAD( "2204.bin",     0x0000, 0x010000, CRC(4937c6f7) SHA1(4505efb9b28fe6d4bcc1f79e81a70bb215c399cb) )
342    ROM_LOAD( "2205.bin",     0x0000, 0x010000, CRC(0f917d40) SHA1(1cfae9c80088f4c90b3c9e0b284c3b91f7ff61b9) )
339    ROM_LOAD( "2202.bin",     0x0000, 0x010000, CRC(dffd538c) SHA1(e90f6ff3a7804b54c8a3b1b574ec9c223a6c2bf9) )
340    ROM_LOAD( "2203.bin",     0x0000, 0x010000, CRC(9be8cceb) SHA1(1ee4d7e6d2171b44e88e464071bdc4b800b69c4a) )
341    ROM_LOAD( "2204.bin",     0x0000, 0x010000, CRC(4937c6f7) SHA1(4505efb9b28fe6d4bcc1f79e81a70bb215c399cb) )
342    ROM_LOAD( "2205.bin",     0x0000, 0x010000, CRC(0f917d40) SHA1(1cfae9c80088f4c90b3c9e0b284c3b91f7ff61b9) )
343343
344344    ROM_REGION(0x8000, "kpc", 0)    // 68HC11 keyboard/front panel processor
345    ROM_LOAD( "sq80_kpc_150.bin", 0x000000, 0x008000, CRC(8170b728) SHA1(3ad68bb03948e51b20d2e54309baa5c02a468f7c) )
345    ROM_LOAD( "sq80_kpc_150.bin", 0x000000, 0x008000, CRC(8170b728) SHA1(3ad68bb03948e51b20d2e54309baa5c02a468f7c) )
346346ROM_END
347347
348348CONS( 1986, esq1, 0   , 0, esq1, esq1, 0, "Ensoniq", "ESQ-1", GAME_NOT_WORKING )
src/mess/drivers/mac.c
r15442r15443
19411941
19421942ROM_START( unitron )
19431943   ROM_REGION16_BE(0x20000, "bootrom", 0)
1944    ROM_LOAD16_WORD( "unitron_512.rom", 0x00000, 0x10000, CRC(1eabd37f) SHA1(a3d3696c08feac6805effb7ee07b68c2bf1a8dd7) )
1944    ROM_LOAD16_WORD( "unitron_512.rom", 0x00000, 0x10000, CRC(1eabd37f) SHA1(a3d3696c08feac6805effb7ee07b68c2bf1a8dd7) )
19451945ROM_END
19461946
19471947ROM_START( mac512ke )
src/mess/drivers/kaypro.c
r15442r15443
162162
163163//static WRITE_LINE_DEVICE_HANDLER( rx_tx_w )
164164//{
165//   downcast<z80sio_device *>(device)->rx_clock_in();
166//   downcast<z80sio_device *>(device)->tx_clock_in();
165//  downcast<z80sio_device *>(device)->rx_clock_in();
166//  downcast<z80sio_device *>(device)->tx_clock_in();
167167//}
168168
169169static COM8116_INTERFACE( kayproii_brg_intf )
src/mess/drivers/dm7000.c
r15442r15443
237237
238238   /* ENET - ASIX AX88796 */
239239   AM_RANGE(0x72000300, 0x720003ff) AM_READWRITE16(dm7000_enet_r, dm7000_enet_w, 0xffffffff)
240   
240
241241   AM_RANGE(0x7f800000, 0x7ffdffff) AM_ROM AM_REGION("user2",0)
242242   AM_RANGE(0x7ffe0000, 0x7fffffff) AM_ROM AM_REGION("user1",0)
243243   //AM_RANGE(0xfffe0000, 0xffffffff) AM_ROM AM_REGION("user1",0)
r15442r15443
312312
313313static MACHINE_CONFIG_START( dm7000, dm7000_state )
314314   /* basic machine hardware */
315   MCFG_CPU_ADD("maincpu",PPC405GP, 252000000 / 10) // Should be PPC405D4?
315   MCFG_CPU_ADD("maincpu",PPC405GP, 252000000 / 10) // Should be PPC405D4?
316316   // Slowed down 10 times in order to get normal response for now
317317   MCFG_CPU_CONFIG(ppc405_config)
318318   MCFG_CPU_PROGRAM_MAP(dm7000_mem)
src/mess/drivers/esq5505.c
r15442r15443
1010    Driver by R. Belmont
1111
1212    Memory map:
13
13
1414    0x000000-0x00ffff   work RAM low
1515    0x200000-0x20001f   OTTO(5505) regs
1616    0x240000-0x2400ff   DMAC (68450) regs (EPS/EPS-16)
r15442r15443
1818    0x280000-0x28001f   DUART (68681) regs
1919    0x2C0000-0x2C0003   Floppy (WD1772) regs (VFX-SD, SD-1, and EPS/EPS-16)
2020    0x300000-0x300003   EPS/EPS-16 SCSI (WD33C93, register at 300001, data at 300003)
21    0x340000-0x3bffff   EPS/EPS-16 sample RAM
21    0x340000-0x3bffff   EPS/EPS-16 sample RAM
2222    0xc00000-0xc3ffff   OS ROM
2323    0xff0000-0xffffff   work RAM hi (may or may not be mirrored with work RAM low)
24
24
2525    Interrupts:
2626    68681 uses custom vector 0x40 (address 0x100)
2727    5505 interrupts are on normal autovector IRQ 1
28
28
2929***************************************************************************/
3030
3131#include "emu.h"
r15442r15443
448448
449449ROM_START( vfxsd )
450450    ROM_REGION(0x40000, "osrom", 0)
451    ROM_LOAD16_BYTE( "vfxsd_200_lower.bin", 0x000000, 0x010000, CRC(7bd31aea) SHA1(812bf73c4861a5d963f128def14a4a98171c93ad) )
452    ROM_LOAD16_BYTE( "vfxsd_200_upper.bin", 0x000001, 0x010000, CRC(9a40efa2) SHA1(e38a2a4514519c1573361cb1526139bfcf94e45a) )
451    ROM_LOAD16_BYTE( "vfxsd_200_lower.bin", 0x000000, 0x010000, CRC(7bd31aea) SHA1(812bf73c4861a5d963f128def14a4a98171c93ad) )
452    ROM_LOAD16_BYTE( "vfxsd_200_upper.bin", 0x000001, 0x010000, CRC(9a40efa2) SHA1(e38a2a4514519c1573361cb1526139bfcf94e45a) )
453453
454454    ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
455455    ROM_LOAD( "vfxsd-waves-1.bin",  0x000000, 0x080000, NO_DUMP )
r15442r15443
458458
459459ROM_START( sd1 )
460460    ROM_REGION(0x40000, "osrom", 0)
461    ROM_LOAD16_BYTE( "sd1_410_lo.bin", 0x000000, 0x020000, CRC(faa613a6) SHA1(60066765cddfa9d3b5d09057d8f83fb120f4e65e) )
462    ROM_LOAD16_BYTE( "sd1_410_hi.bin", 0x000001, 0x010000, CRC(618c0aa8) SHA1(74acf458aa1d04a0a7a0cd5855c49e6855dbd301) )
461    ROM_LOAD16_BYTE( "sd1_410_lo.bin", 0x000000, 0x020000, CRC(faa613a6) SHA1(60066765cddfa9d3b5d09057d8f83fb120f4e65e) )
462    ROM_LOAD16_BYTE( "sd1_410_hi.bin", 0x000001, 0x010000, CRC(618c0aa8) SHA1(74acf458aa1d04a0a7a0cd5855c49e6855dbd301) )
463463
464464    ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
465465    ROM_LOAD( "sd1-waves-1.bin",  0x000000, 0x080000, NO_DUMP )
r15442r15443
468468
469469ROM_START( sd132 )
470470    ROM_REGION(0x40000, "osrom", 0)
471    ROM_LOAD16_BYTE( "sd1_32_402_lo.bin", 0x000000, 0x020000, CRC(5da2572b) SHA1(cb6ddd637ed13bfeb40a99df56000479e63fc8ec) )
472    ROM_LOAD16_BYTE( "sd1_32_402_hi.bin", 0x000001, 0x010000, CRC(fc45c210) SHA1(23b81ebd9176112e6eae0c7c75b39fcb1656c953) )
471    ROM_LOAD16_BYTE( "sd1_32_402_lo.bin", 0x000000, 0x020000, CRC(5da2572b) SHA1(cb6ddd637ed13bfeb40a99df56000479e63fc8ec) )
472    ROM_LOAD16_BYTE( "sd1_32_402_hi.bin", 0x000001, 0x010000, CRC(fc45c210) SHA1(23b81ebd9176112e6eae0c7c75b39fcb1656c953) )
473473
474474    ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
475475    ROM_LOAD( "sd1-waves-1.bin",  0x000000, 0x080000, NO_DUMP )
r15442r15443
529529CONS( 1988, eps,   0, 0, eps,   vfx, eps,    "Ensoniq", "EPS", GAME_NOT_WORKING )   // custom VFD: one alphanumeric 22-char row, one graphics-capable row (alpha row can also do bar graphs)
530530CONS( 1989, vfx,   0, 0, vfx,   vfx, common, "Ensoniq", "VFX", GAME_NOT_WORKING )       // 2x40 VFD
531531CONS( 1989, vfxsd, 0, 0, vfxsd, vfx, common, "Ensoniq", "VFX-SD", GAME_NOT_WORKING )    // 2x40 VFD
532CONS( 1990, sd1,   0, 0, vfxsd, vfx, common, "Ensoniq", "SD-1", GAME_NOT_WORKING )      // 2x40 VFD
532CONS( 1990, sd1,   0, 0, vfxsd, vfx, common, "Ensoniq", "SD-1", GAME_NOT_WORKING )      // 2x40 VFD
533533CONS( 1990, sd132, 0, 0, vfxsd, vfx, common, "Ensoniq", "SD-1 32", GAME_NOT_WORKING )   // 2x40 VFD
534534CONS( 1990, sq1,   0, 0, sq1,   vfx, sq1,    "Ensoniq", "SQ-1", GAME_NOT_WORKING )      // LCD of some sort
535535
src/mess/drivers/apple2.c
r15442r15443
985985   ROM_LOAD ( "341-0265-a.chr", 0x1000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10))
986986
987987   ROM_REGION(0x4000,"maincpu",0)
988    ROM_LOAD( "tk2000.rom",   0x000000, 0x004000, CRC(dfdbacc3) SHA1(bb37844c31616046630868a4399ee3d55d6df277) )
988    ROM_LOAD( "tk2000.rom",   0x000000, 0x004000, CRC(dfdbacc3) SHA1(bb37844c31616046630868a4399ee3d55d6df277) )
989989ROM_END
990990
991991ROM_START(prav8c)
r15442r15443
10591059   ROM_LOAD ( "341-0265-a.chr", 0x1000, 0x1000, BAD_DUMP CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) // need to dump real laser rom
10601060
10611061   ROM_REGION(0x8700,"maincpu",0)
1062    ROM_LOAD( "laser 128ex2 v6.1 rom.bin", 0x000000, 0x008000, CRC(7f911c90) SHA1(125754c1bd777d4c510f5239b96178c6f2e3236b) )
1062    ROM_LOAD( "laser 128ex2 v6.1 rom.bin", 0x000000, 0x008000, CRC(7f911c90) SHA1(125754c1bd777d4c510f5239b96178c6f2e3236b) )
10631063ROM_END
10641064
10651065ROM_START(apple2cp)
r15442r15443
11051105COMP( 1985, apple2ee, apple2e,  0,        apple2ee,      apple2e,  0,        "Apple Computer",    "Apple //e (enhanced)", GAME_SUPPORTS_SAVE )
11061106COMP( 1987, apple2ep, apple2e,  0,        apple2ep,      apple2ep, 0,        "Apple Computer",    "Apple //e (Platinum)", GAME_SUPPORTS_SAVE )
11071107COMP( 1984, apple2c,  0,        apple2,     apple2c,      apple2e,  0,        "Apple Computer",    "Apple //c" , GAME_SUPPORTS_SAVE )
1108COMP( 1984, tk2000,   apple2c,  0,       tk2000,      apple2e,  0,        "Microdigital",      "TK2000" , GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1108COMP( 1984, tk2000,   apple2c,  0,       tk2000,      apple2e,  0,        "Microdigital",      "TK2000" , GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
11091109COMP( 1989, prav8c,   apple2c,  0,        apple2c,      apple2e,  0,        "Pravetz",           "Pravetz 8C", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
11101110COMP( 1983, las3000,  apple2,   0,        apple2p,      apple2p,  0,        "Video Technology",  "Laser 3000",   GAME_NOT_WORKING )
11111111COMP( 1987, laser128, apple2c,  0,        laser128,      apple2e,  0,        "Video Technology",  "Laser 128 (version 4.2)", GAME_NOT_WORKING )
src/mess/drivers/geniusiq.c
r15442r15443
1/***************************************************************************
2Video Technology Genius computers:
3   VTech Genius PC (France)
4   VTech Genius IQ 512 (Germany)
5   The French packaging mentions distributions in Switzerland, the Netherlands,
6   USA, Canada, and UK as well. Looking for more information and ROM dumps.
7
8System driver:
9
10   Adrien Destugues <pulkomandy@gmail.com>, May 2012
11     - First attempt
12
13Memory map:
14   00000000 System ROM (2MB)
15   00200000 RAM (256K)
16   00600000 Some memory mapped hardware
17   ???????? Flash memory (128K)
18   ???????? Cartridge port
19
20TODO:
21    - Mostly everything besides CPU, RAM and ROM
22    - Check with different countries ROMs
23   
24Not very much is known about this computer released in 1997.
25
26****************************************************************************/
27
28#include "emu.h"
29#include "cpu/m68000/m68000.h"
30
31#define MACHINE_RESET_MEMBER(name) void name::machine_reset()
32
33class geniusiq_state : public driver_device
34{
35public:
36   geniusiq_state(const machine_config &mconfig, device_type type, const char *tag)
37      : driver_device(mconfig, type, tag),
38   m_maincpu(*this, "maincpu")
39   { }
40
41   required_device<cpu_device> m_maincpu;
42   virtual void machine_reset();
43};
44
45static ADDRESS_MAP_START(geniusiq_mem, AS_PROGRAM, 16, geniusiq_state)
46   ADDRESS_MAP_UNMAP_HIGH
47   AM_RANGE(0x000000, 0x1FFFFF) AM_ROM
48   AM_RANGE(0x200000, 0x23FFFF) AM_RAM
49   // 0x600000 : some memory mapped hardware
50   // Somewhere : internal flash
51   // Somewhere : cartridge port
52ADDRESS_MAP_END
53
54
55/* Input ports */
56static INPUT_PORTS_START( geniusiq )
57INPUT_PORTS_END
58
59
60MACHINE_RESET_MEMBER( geniusiq_state )
61{
62}
63
64static MACHINE_CONFIG_START( geniusiq, geniusiq_state )
65   /* basic machine hardware */
66   MCFG_CPU_ADD("maincpu", M68000, 16000000) // The main crystal is at 32MHz, not sure whats the CPU freq
67   MCFG_CPU_PROGRAM_MAP(geniusiq_mem)
68MACHINE_CONFIG_END
69
70/* ROM definition */
71ROM_START( geniusiq )
72   ROM_REGION(0x200000, "maincpu", 0)
73   ROM_LOAD( "geniusiq.bin", 0x0000, 0x200000, CRC(9b06cbf1) SHA1(b9438494a9575f78117c0033761f899e3c14e292) )
74ROM_END
75
76/* Driver */
77
78/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY                FULLNAME               FLAGS */
79COMP( 1997, geniusiq,   0,       0,    geniusiq,   geniusiq,  0,  "Video Technology", "Genius IQ 128", GAME_NO_SOUND_HW)
1/***************************************************************************
2Video Technology Genius computers:
3    VTech Genius PC (France)
4    VTech Genius IQ 512 (Germany)
5    The French packaging mentions distributions in Switzerland, the Netherlands,
6    USA, Canada, and UK as well. Looking for more information and ROM dumps.
7 
8System driver:
9 
10    Adrien Destugues <pulkomandy@gmail.com>, May 2012
11      - First attempt
12 
13Memory map:
14    00000000 System ROM (2MB)
15    00200000 RAM (256K)
16    00600000 Some memory mapped hardware
17    ???????? Flash memory (128K)
18    ???????? Cartridge port
19 
20TODO:
21    - Mostly everything besides CPU, RAM and ROM
22    - Check with different countries ROMs
23 
24Not very much is known about this computer released in 1997.
25 
26****************************************************************************/
27 
28#include "emu.h"
29#include "cpu/m68000/m68000.h"
30 
31#define MACHINE_RESET_MEMBER(name) void name::machine_reset()
32 
33class geniusiq_state : public driver_device
34{
35public:
36   geniusiq_state(const machine_config &mconfig, device_type type, const char *tag)
37      : driver_device(mconfig, type, tag),
38   m_maincpu(*this, "maincpu")
39   { }
40 
41   required_device<cpu_device> m_maincpu;
42   virtual void machine_reset();
43};
44 
45static ADDRESS_MAP_START(geniusiq_mem, AS_PROGRAM, 16, geniusiq_state)
46   ADDRESS_MAP_UNMAP_HIGH
47   AM_RANGE(0x000000, 0x1FFFFF) AM_ROM
48   AM_RANGE(0x200000, 0x23FFFF) AM_RAM
49   // 0x600000 : some memory mapped hardware
50   // Somewhere : internal flash
51   // Somewhere : cartridge port
52ADDRESS_MAP_END
53 
54 
55/* Input ports */
56static INPUT_PORTS_START( geniusiq )
57INPUT_PORTS_END
58 
59 
60MACHINE_RESET_MEMBER( geniusiq_state )
61{
62}
63 
64static MACHINE_CONFIG_START( geniusiq, geniusiq_state )
65   /* basic machine hardware */
66   MCFG_CPU_ADD("maincpu", M68000, 16000000) // The main crystal is at 32MHz, not sure whats the CPU freq
67   MCFG_CPU_PROGRAM_MAP(geniusiq_mem)
68MACHINE_CONFIG_END
69 
70/* ROM definition */
71ROM_START( geniusiq )
72   ROM_REGION(0x200000, "maincpu", 0)
73   ROM_LOAD( "geniusiq.bin", 0x0000, 0x200000, CRC(9b06cbf1) SHA1(b9438494a9575f78117c0033761f899e3c14e292) )
74ROM_END
75 
76/* Driver */
77 
78/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY                FULLNAME               FLAGS */
79COMP( 1997, geniusiq,   0,       0,    geniusiq,   geniusiq,  0,  "Video Technology", "Genius IQ 128", GAME_NO_SOUND_HW)
src/mess/drivers/pc.c
r15442r15443
132132   AM_RANGE(0x0020, 0x0021) AM_DEVREADWRITE_LEGACY("pic8259", pic8259_r, pic8259_w)
133133   AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w)
134134   AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
135//   AM_RANGE(0x0068, 0x006B) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)      // keyboard poll
135//  AM_RANGE(0x0068, 0x006B) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)      // keyboard poll
136136   AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r,            pc_page_w)   // check
137137   AM_RANGE(0x00a0, 0x00a0) AM_READWRITE( pcjr_nmi_enable_r, pc_nmi_enable_w )         // check
138//   has extra registers at 0x0100, 0x0108, 0x010a
138//  has extra registers at 0x0100, 0x0108, 0x010a
139139   AM_RANGE(0x010c, 0x010c) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_status_r, wd17xx_command_w)
140140   AM_RANGE(0x010d, 0x010d) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_track_r, wd17xx_track_w)
141141   AM_RANGE(0x010e, 0x010e) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_sector_r, wd17xx_sector_w)
142142   AM_RANGE(0x010f, 0x010f) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_data_r, wd17xx_data_w)
143//   AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w)
144//   AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE_LEGACY("ins8250_0", ins8250_r, ins8250_w)
145ADDRESS_MAP_END
143//  AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w)
144//  AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE_LEGACY("ins8250_0", ins8250_r, ins8250_w)
145ADDRESS_MAP_END
146146
147147static ADDRESS_MAP_START( zenith_map, AS_PROGRAM, 8, pc_state )
148148   ADDRESS_MAP_UNMAP_HIGH
r15442r15443
12601260   MCFG_I8255_ADD( "ppi8255", pcjr_ppi8255_interface )      /* check */
12611261
12621262   /* TODO: implement i8251 */
1263//   MCFG_INS8250_ADD( "ins8250_0", ibm5150_com_interface[0] )
1263//  MCFG_INS8250_ADD( "ins8250_0", ibm5150_com_interface[0] )
12641264
12651265   /* video hardware */
12661266   MCFG_FRAGMENT_ADD( pcvideo_mc1502 )            /* only 1 chargen, CGA_FONT dip always 1 */
r15442r15443
12721272   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
12731273
12741274   /* printer */
1275//   MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config)            /* TODO: non-standard */
1275//  MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config)             /* TODO: non-standard */
12761276
12771277   /* cassette */
12781278   MCFG_CASSETTE_ADD( CASSETTE_TAG, ibm5150_cassette_interface )   /* TODO: verify */
src/mess/drivers/clcd.c
r15442r15443
5555
5656   DECLARE_WRITE8_MEMBER(rambank_w)
5757   {
58//      printf( "ram bank:%02x %02x\n", offset, data );
58//      printf( "ram bank:%02x %02x\n", offset, data );
5959   }
6060
6161   DECLARE_WRITE8_MEMBER(rombank_w)
6262   {
63//      printf( "rom bank %02x\n", data);
63//      printf( "rom bank %02x\n", data);
6464      membank("bankedroms")->set_entry(0);
6565   }
6666

Previous 15994 Revisions Next


© 1998-2018 The MESS Team