Previous 15994 Revisions Next

r5061 Monday 22nd June, 2009 at 11:53:13 UTC by Nathan Woods
Static/const/include improvements. [Atari Ace]
[docs]messnew.txt
[src/mess/audio]mea8000.c
[src/mess/devices]aescart.c thomflop.h ti99cart.c ti99cart.h
[src/mess/drivers]ami1200.c apf.c atari.c atm.c bondwell.c cat.c chessmst.c craft.c exp85.c fm7.c fmtowns.c mmd1.c nanos.c nes.c ngp.c pc6001.c pcw16.c pentagon.c ply601.c pocketc.c scorpion.c spectrum.c trs80.c vt100.c z9001.c zrt80.c
[src/mess/formats]z80ne_dsk.c
[src/mess/includes]amstrad.h apple2.h c128.h kaypro.h llc.h mbee.h mc68328.h thomson.h trs80.h z80ne.h
[src/mess/machine]99_dsk.c amstr_pc.c apple2.c apple3.c at.c ataricrt.c ataridev.h atarifdc.c b2m.c bbc.c bebox.c beta.c c128.c c65.c cbmdrive.c concept.c geneve.c kaypro.c lisa.c llc.c lviv.c mac.c mc6843.c mc6846.c mc6854.c orion.c pc.c pc8801.c pc_fdc.h pce.c pmd85.c pp01.c radio86.c special.c tandy1t.c ti99_4x.c ti99_4x.h vc1541.c vector06.c z1013.c z80ne.c
[src/mess/tools/castool]main.c
[src/mess/video]pc_aga.c pc_cga.c pc_mda.c pc_t1t.c upd7220.h vtvideo.c vtvideo.h

src/mess/tools/castool/main.c
r5060r5061
9696}; 
9797
9898
99const char *get_extension(const char *name)
99static const char *get_extension(const char *name)
100100{
101101   const char *s;
102102   s = name;
r5060r5061
105105   return s ? s+1 : NULL;
106106}
107107
108void display_usage(void)
108static void display_usage(void)
109109{
110110   fprintf(stderr, "Usage: \n");
111111   fprintf(stderr, "      castool.exe convert <format> <inputfile> <outputfile.wav>\n");
112112}
113113
114void display_formats(void)
114static void display_formats(void)
115115{
116116   int i,j;
117117   fprintf(stderr, "Supported formats:\n\n");
src/mess/audio/mea8000.c
r5060r5061
480480/* next sample in frame, sampling at 64 kHz */
481481static TIMER_CALLBACK( mea8000_timer_expire )
482482{
483   device_config* device = (device_config*) ptr;
483   const device_config* device = (const device_config*) ptr;
484484   mea8000_t* mea8000 = get_safe_token( device );
485485   int pos = mea8000->framepos % SUPERSAMPLING;
486486
src/mess/video/upd7220.h
r5060r5061
6969/* light pen strobe */
7070void upd7220_lpen_w(const device_config *device, int state);
7171
72/* screen update */
73void upd7220_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
74
7572#endif
src/mess/video/vtvideo.c
r5060r5061
155155   //palette_set_color_rgb(device->machine, 1, data, data, data);
156156}
157157
158void vt_video_display_char(const device_config *device,bitmap_t *bitmap, UINT8 code,
158static void vt_video_display_char(const device_config *device,bitmap_t *bitmap, UINT8 code,
159159   int x, int y,UINT8 scroll_region,UINT8 display_type)
160160{               
161161   UINT8 line=0;
src/mess/video/pc_mda.c
r5060r5061
365365 *************************************************************************/
366366WRITE8_HANDLER ( pc_MDA_w )
367367{
368   device_config   *devconf = (device_config *) devtag_get_device(space->machine, MDA_MC6845_NAME);
368   const device_config *devconf = devtag_get_device(space->machine, MDA_MC6845_NAME);
369369   switch( offset )
370370   {
371371      case 0: case 2: case 4: case 6:
r5060r5061
382382
383383 READ8_HANDLER ( pc_MDA_r )
384384{
385   device_config   *devconf = (device_config *) devtag_get_device(space->machine, MDA_MC6845_NAME);
385   const device_config *devconf = devtag_get_device(space->machine, MDA_MC6845_NAME);
386386   int data = 0xff;
387387   switch( offset )
388388   {
r5060r5061
532532
533533static void hercules_mode_control_w(running_machine *machine, int data)
534534{
535   device_config   *devconf = (device_config *) devtag_get_device(machine, HERCULES_MC6845_NAME);
535   const device_config *devconf = devtag_get_device(machine, HERCULES_MC6845_NAME);
536536
537537   MDA_LOG(1,"hercules_mode_control_w",("$%02x: colums %d, gfx %d, enable %d, blink %d\n",
538538      data, (data&1)?80:40, (data>>1)&1, (data>>3)&1, (data>>5)&1));
r5060r5061
568568
569569static WRITE8_HANDLER ( pc_hercules_w )
570570{
571   device_config   *devconf = (device_config *) devtag_get_device(space->machine, HERCULES_MC6845_NAME);
571   const device_config *devconf = devtag_get_device(space->machine, HERCULES_MC6845_NAME);
572572
573573   switch( offset )
574574   {
r5060r5061
608608
609609static READ8_HANDLER ( pc_hercules_r )
610610{
611   device_config   *devconf = (device_config *) devtag_get_device(space->machine, HERCULES_MC6845_NAME);
611   const device_config *devconf = devtag_get_device(space->machine, HERCULES_MC6845_NAME);
612612   int data = 0xff;
613613
614614   switch( offset )
src/mess/video/vtvideo.h
r5060r5061
5454WRITE8_DEVICE_HANDLER ( vt_video_brightness_w );
5555
5656
57/* palette initialization */
58PALETTE_INIT( vt_video );
59
6057/* screen update */
6158void vt_video_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect);
6259
src/mess/video/pc_t1t.c
r5060r5061
169169
170170static VIDEO_UPDATE( mc6845_t1000 )
171171{
172   const device_config   *devconf = devtag_get_device(screen->machine, T1000_MC6845_NAME);
172   const device_config *devconf = devtag_get_device(screen->machine, T1000_MC6845_NAME);
173173   mc6845_update( devconf, bitmap, cliprect);
174174   return 0;
175175}
r5060r5061
738738
739739WRITE8_HANDLER ( pc_T1T_w )
740740{
741   device_config   *devconf;
741   const device_config *devconf;
742742
743743   switch( offset )
744744   {
745745      case 0: case 2: case 4: case 6:
746         devconf = (device_config *) devtag_get_device(space->machine, T1000_MC6845_NAME);
746         devconf = devtag_get_device(space->machine, T1000_MC6845_NAME);
747747         mc6845_address_w( devconf, offset, data );
748748         break;
749749      case 1: case 3: case 5: case 7:
750         devconf = (device_config *) devtag_get_device(space->machine, T1000_MC6845_NAME);
750         devconf = devtag_get_device(space->machine, T1000_MC6845_NAME);
751751         mc6845_register_w( devconf, offset, data );
752752         break;
753753      case 8:
r5060r5061
778778
779779WRITE8_HANDLER( pc_pcjr_w )
780780{
781   const device_config   *devconf;
781   const device_config *devconf;
782782
783783   switch( offset )
784784   {
r5060r5061
818818
819819 READ8_HANDLER ( pc_T1T_r )
820820{
821   device_config   *devconf;
821   const device_config *devconf;
822822   int            data = 0xff;
823823
824824   switch( offset )
r5060r5061
828828         break;
829829
830830      case 1: case 3: case 5: case 7:
831         devconf = (device_config *) devtag_get_device(space->machine, T1000_MC6845_NAME);
831         devconf = devtag_get_device(space->machine, T1000_MC6845_NAME);
832832         data = mc6845_register_r( devconf, offset );
833833         break;
834834
src/mess/video/pc_aga.c
r5060r5061
479479   UINT8 data = 0xFF;
480480
481481   if ( aga.mode == AGA_MONO ) {
482      device_config   *devconf = (device_config *) devtag_get_device(space->machine, MDA_MC6845_NAME);
482      const device_config *devconf = devtag_get_device(space->machine, MDA_MC6845_NAME);
483483      switch( offset )
484484      {
485485      case 0: case 2: case 4: case 6:
r5060r5061
501501static WRITE8_HANDLER ( pc_aga_mda_w )
502502{
503503   if ( aga.mode == AGA_MONO ) {
504      device_config   *devconf = (device_config *) devtag_get_device(space->machine, AGA_MC6845_NAME);
504      const device_config *devconf = devtag_get_device(space->machine, AGA_MC6845_NAME);
505505      switch( offset )
506506      {
507507         case 0: case 2: case 4: case 6:
r5060r5061
534534   UINT8 data = 0xFF;
535535
536536   if ( aga.mode == AGA_COLOR ) {
537      device_config   *devconf = (device_config *) devtag_get_device(space->machine, AGA_MC6845_NAME);
537      const device_config *devconf = devtag_get_device(space->machine, AGA_MC6845_NAME);
538538      switch( offset ) {
539539      case 0: case 2: case 4: case 6:
540540         /* return last written mc6845 address value here? */
r5060r5061
580580static WRITE8_HANDLER ( pc_aga_cga_w )
581581{
582582   if ( aga.mode == AGA_COLOR ) {
583      device_config   *devconf = (device_config *) devtag_get_device(space->machine, AGA_MC6845_NAME);
583      const device_config *devconf = devtag_get_device(space->machine, AGA_MC6845_NAME);
584584
585585      switch(offset) {
586586      case 0: case 2: case 4: case 6:
r5060r5061
661661
662662void pc_aga_set_mode(running_machine *machine, AGA_MODE mode)
663663{
664   device_config   *devconf = (device_config *) devtag_get_device(machine, AGA_MC6845_NAME);
664   const device_config *devconf = devtag_get_device(machine, AGA_MC6845_NAME);
665665
666666   aga.mode = mode;
667667
src/mess/video/pc_cga.c
r5060r5061
10611061 */
10621062static void pc_cga_mode_control_w(running_machine *machine, int data)
10631063{
1064   device_config   *devconf = (device_config *) devtag_get_device(machine, CGA_MC6845_NAME);
1064   const device_config *devconf = devtag_get_device(machine, CGA_MC6845_NAME);
10651065
10661066   CGA_LOG(1,"CGA_mode_control_w",("$%02x: columns %d, gfx %d, hires %d, blink %d\n",
10671067      data, (data&1)?80:40, (data>>1)&1, (data>>4)&1, (data>>5)&1));
r5060r5061
11991199
12001200static READ8_HANDLER( pc_cga8_r )
12011201{
1202   device_config   *devconf = (device_config *) devtag_get_device(space->machine, CGA_MC6845_NAME);
1202   const device_config *devconf = devtag_get_device(space->machine, CGA_MC6845_NAME);
12031203   int data = 0xff;
12041204   switch( offset )
12051205   {
r5060r5061
12201220
12211221static WRITE8_HANDLER( pc_cga8_w )
12221222{
1223   device_config   *devconf;
1223   const device_config *devconf;
12241224
12251225   switch(offset) {
12261226   case 0: case 2: case 4: case 6:
1227      devconf = (device_config *) devtag_get_device(space->machine, CGA_MC6845_NAME);
1227      devconf = devtag_get_device(space->machine, CGA_MC6845_NAME);
12281228      mc6845_address_w( devconf, offset, data );
12291229      break;
12301230   case 1: case 3: case 5: case 7:
1231      devconf = (device_config *) devtag_get_device(space->machine, CGA_MC6845_NAME);
1231      devconf = devtag_get_device(space->machine, CGA_MC6845_NAME);
12321232      mc6845_register_w( devconf, offset, data );
12331233      break;
12341234   case 8:
r5060r5061
14901490
14911491static WRITE8_HANDLER ( pc1512_w )
14921492{
1493   device_config   *devconf = (device_config *) devtag_get_device(space->machine, CGA_MC6845_NAME);
1493   const device_config *devconf = devtag_get_device(space->machine, CGA_MC6845_NAME);
14941494
14951495   switch (offset)
14961496   {
src/mess/includes/z80ne.h
r5060r5061
2929
3030VIDEO_START(lx388);
3131
32/*----------- defined in machine/z80ne.c -----------*/
33
3234READ8_HANDLER(lx383_r);
3335WRITE8_HANDLER(lx383_w);
3436READ8_HANDLER(lx385_data_r);
src/mess/includes/mbee.h
r5060r5061
1717#include "devices/basicdsk.h"
1818
1919
20/*----------- defined in drivers/mbee.c -----------*/
21
22extern size_t mbee_size;
23
2024/*----------- defined in machine/mbee.c -----------*/
2125
2226extern const wd17xx_interface mbee_wd17xx_interface;
r5060r5061
3741/*----------- defined in video/mbee.c -----------*/
3842
3943extern UINT8 *mbee_pcgram;
40extern size_t mbee_size;
4144
4245READ8_HANDLER ( m6545_status_r );
4346WRITE8_HANDLER ( m6545_index_w );
src/mess/includes/thomson.h
r5060r5061
104104/* speech synthesis */
105105extern const mea8000_interface to7_speech;
106106
107/* floppy */
108extern const mc6843_interface to7_6843_itf;
109extern const mc6854_interface to7_network_iface;
110
111107/* modem */
112108extern const acia6850_interface to7_modem;
113109
src/mess/includes/kaypro.h
r5060r5061
77#include "devices/snapquik.h"
88
99
10/* machine.c */
10/*----------- defined in machine/kaypro.c -----------*/
1111
12extern UINT8 kaypro2x_system_port;
1312extern const z80pio_interface kayproii_pio_g_intf;
1413extern const z80pio_interface kayproii_pio_s_intf;
1514extern const z80sio_interface kaypro_sio_intf;
r5060r5061
3938QUICKLOAD_LOAD( kayproii );
4039QUICKLOAD_LOAD( kaypro2x );
4140
42/* video.c */
41/*----------- defined in video/kaypro.c -----------*/
4342
43
4444MC6845_UPDATE_ROW( kaypro2x_update_row );
4545PALETTE_INIT( kaypro );
4646VIDEO_START( kaypro );
src/mess/includes/c128.h
r5060r5061
4343WRITE8_HANDLER(c128_write_ff05);
4444
4545
46void c128_m6510_port_write(const device_config *device, UINT8 direction, UINT8 data);
47UINT8 c128_m6510_port_read(const device_config *device, UINT8 direction);
48
49
5046extern DRIVER_INIT( c128 );
5147extern DRIVER_INIT( c128pal );
5248extern DRIVER_INIT( c128d );
src/mess/includes/mc68328.h
r5060r5061
139139    MDRV_DEVICE_ADD("dragonball", MC68328, 0) \
140140    MDRV_DEVICE_CONFIG(_intrf)
141141
142/*----------- defined in machine/mc68328.c -----------*/
143
142144/***************************************************************************
143145    READ/WRITE HANDLERS
144146***************************************************************************/
r5060r5061
153155
154156void mc68328_set_penirq_line(const device_config *device, int state);
155157void mc68328_set_port_d_lines(const device_config *device, UINT8 state, int bit);
156INPUT_CHANGED( mc68328_port_d_input );
157158
158159/***************************************************************************
159160    DEVICE INTERFACE
r5060r5061
162163#define MC68328 DEVICE_GET_INFO_NAME(mc68328)
163164DEVICE_GET_INFO( mc68328 );
164165
166/*----------- defined in video/mc68328.c -----------*/
167
165168/***************************************************************************
166169    VIDEO INTERFACE
167170***************************************************************************/
src/mess/includes/amstrad.h
r5060r5061
1111#include "video/mc6845.h"
1212#include "devices/snapquik.h"
1313
14/*----------- defined in machine/amstrad.c -----------*/
1415
1516READ8_HANDLER ( amstrad_cpc_io_r );
1617WRITE8_HANDLER ( amstrad_cpc_io_w );
src/mess/includes/llc.h
r5060r5061
1111#include "machine/z80ctc.h"
1212
1313/*----------- defined in machine/llc.c -----------*/
14extern UINT8 *llc_video_ram;
15
1614extern DRIVER_INIT( llc1 );
1715extern MACHINE_START( llc1 );
1816extern MACHINE_RESET( llc1 );
r5060r5061
2725extern MACHINE_RESET( llc2 );
2826extern WRITE8_HANDLER(llc2_rom_disable_w);
2927extern WRITE8_HANDLER(llc2_basic_enable_w);
28
3029/*----------- defined in video/llc.c -----------*/
30extern UINT8 *llc_video_ram;
3131
3232extern VIDEO_START( llc1 );
3333extern VIDEO_UPDATE( llc1 );
src/mess/includes/trs80.h
r5060r5061
1414#define FH 12
1515
1616
17/*----------- defined in drivers/trs80.c -----------*/
18
19extern UINT8 trs80_model4;
20extern UINT8 *gfxram;
21
1722/*----------- defined in machine/trs80.c -----------*/
1823
1924extern const wd17xx_interface trs80_wd17xx_interface;
2025extern UINT8 trs80_mode;
21extern UINT8 trs80_model4;
22extern UINT8 *gfxram;
2326
2427DEVICE_IMAGE_LOAD( trs80_floppy );
2528QUICKLOAD_LOAD( trs80_cmd );
r5060r5061
4144WRITE8_HANDLER ( trs80m4_e4_w );
4245WRITE8_HANDLER ( trs80m4_e0_w );
4346WRITE8_HANDLER ( trs80m4_90_w );
44WRITE8_HANDLER ( trs80m4_88_w );
4547WRITE8_HANDLER ( trs80m4_84_w );
4648READ8_HANDLER ( lnw80_fe_r );
4749READ8_HANDLER ( trs80_ff_r );
48READ8_HANDLER ( trs80_fe_r );
4950READ8_HANDLER ( sys80_f9_r );
5051READ8_HANDLER ( trs80m4_ff_r );
51READ8_HANDLER ( trs80m4_f4_r );
5252READ8_HANDLER ( trs80m4_ec_r );
5353READ8_HANDLER ( trs80m4_eb_r );
5454READ8_HANDLER ( trs80m4_ea_r );
r5060r5061
6060INTERRUPT_GEN( trs80_fdc_interrupt );
6161
6262READ8_HANDLER( trs80_irq_status_r );
63WRITE8_HANDLER( trs80_irq_mask_w );
6463
6564READ8_HANDLER( trs80_printer_r );
6665WRITE8_HANDLER( trs80_printer_w );
r5060r5061
7675
7776VIDEO_START( trs80 );
7877VIDEO_UPDATE( trs80 );
79VIDEO_UPDATE( model1 );
8078VIDEO_UPDATE( ht1080z );
8179VIDEO_UPDATE( lnw80 );
8280VIDEO_UPDATE( radionic );
8381VIDEO_UPDATE( trs80m4 );
8482
83WRITE8_HANDLER ( trs80m4_88_w );
84
8585READ8_HANDLER( trs80_videoram_r );
8686WRITE8_HANDLER( trs80_videoram_w );
8787READ8_HANDLER( trs80_gfxram_r );
src/mess/includes/apple2.h
r5060r5061
5757    OTHER
5858***************************************************************************/
5959
60/*----------- defined in drivers/apple2.c -----------*/
61
62MACHINE_DRIVER_EXTERN( apple2e );
63INPUT_PORTS_EXTERN( apple2ep );
64PALETTE_INIT( apple2 );
65
66
67/*----------- defined in machine/apple2.c -----------*/
68
69extern UINT32 a2;
70
71extern const applefdc_interface apple2_fdc_interface;
72
73void apple2_iwm_setdiskreg(running_machine *machine, UINT8 data);
74UINT8 apple2_iwm_getdiskreg(void);
75
76void apple2_init_common(running_machine *machine);
77MACHINE_START( apple2 );
78UINT8 apple2_getfloatingbusvalue(running_machine *machine);
79READ8_HANDLER( apple2_c0xx_r );
80WRITE8_HANDLER( apple2_c0xx_w );
81
82INTERRUPT_GEN( apple2_interrupt );
83
84void apple2_setvar(running_machine *machine, UINT32 val, UINT32 mask);
85
86int apple2_pressed_specialkey(running_machine *machine, UINT8 key);
87
88
89/*----------- defined in video/apple2.c -----------*/
90
91void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo);
92VIDEO_START( apple2 );
93VIDEO_START( apple2p );
94VIDEO_START( apple2e );
95VIDEO_UPDATE( apple2 );
96void apple2_set_fgcolor(int color);
97void apple2_set_bgcolor(int color);
98int apple2_get_fgcolor(void);
99int apple2_get_bgcolor(void);
100
10160/* -----------------------------------------------------------------------
10261 * New Apple II memory manager
10362 * ----------------------------------------------------------------------- */
r5060r5061
143102};
144103
145104
105/*----------- defined in drivers/apple2.c -----------*/
106
107MACHINE_DRIVER_EXTERN( apple2e );
108INPUT_PORTS_EXTERN( apple2ep );
109PALETTE_INIT( apple2 );
110
111
146112/*----------- defined in machine/apple2.c -----------*/
147113
114extern UINT32 a2;
115
116extern const applefdc_interface apple2_fdc_interface;
117
118void apple2_iwm_setdiskreg(running_machine *machine, UINT8 data);
119UINT8 apple2_iwm_getdiskreg(void);
120
121void apple2_init_common(running_machine *machine);
122MACHINE_START( apple2 );
123UINT8 apple2_getfloatingbusvalue(running_machine *machine);
124READ8_HANDLER( apple2_c0xx_r );
125WRITE8_HANDLER( apple2_c0xx_w );
126
127INTERRUPT_GEN( apple2_interrupt );
128
129void apple2_setvar(running_machine *machine, UINT32 val, UINT32 mask);
130
131int apple2_pressed_specialkey(running_machine *machine, UINT8 key);
132
148133void apple2_setup_memory(running_machine *machine, const apple2_memmap_config *config);
149134void apple2_update_memory(running_machine *machine);
150135
151136
137
138/*----------- defined in video/apple2.c -----------*/
139
140void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo);
141VIDEO_START( apple2 );
142VIDEO_START( apple2p );
143VIDEO_START( apple2e );
144VIDEO_UPDATE( apple2 );
145void apple2_set_fgcolor(int color);
146void apple2_set_bgcolor(int color);
147int apple2_get_fgcolor(void);
148int apple2_get_bgcolor(void);
149
152150#endif /* APPLE2_H_ */
src/mess/machine/ataricrt.c
r5060r5061
1818 *
1919 *************************************/
2020
21/* 2009-04 FP: is this used anywhere? */
21#ifdef UNUSED_CODE
2222DRIVER_INIT( atari )
2323{
2424   offs_t ram_top;
r5060r5061
4242      0x0000, ram_top, 0, 0, SMH_BANK(2));
4343   memory_set_bankptr(machine, 2, mess_ram);
4444}
45#endif
4546
4647
4748static void a800_setbank(running_machine *machine, int n)
src/mess/machine/apple3.c
r5060r5061
174174            apple3_flags |= VAR_EXTA0 << ((offset - 0xD0) / 2);
175175         else
176176            apple3_flags &= ~(VAR_EXTA0 << ((offset - 0xD0) / 2));
177         apple3_update_drives((device_config*)devtag_get_device(space->machine, "fdc"));
177         apple3_update_drives(devtag_get_device(space->machine, "fdc"));
178178         result = 0x00;
179179         break;
180180
r5060r5061
238238            apple3_flags |= VAR_EXTA0 << ((offset - 0xD0) / 2);
239239         else
240240            apple3_flags &= ~(VAR_EXTA0 << ((offset - 0xD0) / 2));
241         apple3_update_drives((device_config*)devtag_get_device(space->machine, "fdc"));
241         apple3_update_drives(devtag_get_device(space->machine, "fdc"));
242242         break;
243243
244244      case 0xDB:
src/mess/machine/c65.c
r5060r5061
125125}
126126
127127/* is this correct for c65 as well as c64? */
128void c65_vic_interrupt (running_machine *machine, int level)
128static void c65_vic_interrupt (running_machine *machine, int level)
129129{
130130   const device_config *cia_0 = devtag_get_device(machine, "cia_0");
131131#if 1
src/mess/machine/ataridev.h
r5060r5061
1212#define ATARI_600XL 3
1313#define ATARI_800XL 4
1414
15/* defined in ataricrt.c */
15/*----------- defined in machine/ataricrt.c -----------*/
16
1617MACHINE_START( a400 );
1718MACHINE_START( a800 );
1819MACHINE_START( a800xl );
r5060r5061
2728DEVICE_IMAGE_LOAD( a5200_cart );
2829DEVICE_IMAGE_UNLOAD( a5200_cart );
2930
30/* defined in atarifdc.c */
31
32/*----------- defined in machine/atarifdc.c -----------*/
33
3134DEVICE_IMAGE_LOAD( a800_floppy );
3235READ8_HANDLER( atari_serin_r );
3336WRITE8_HANDLER( atari_serout_w );
src/mess/machine/mc6854.c
r5060r5061
332332/* call-back to refill the bit-stream from the FIFO */
333333static TIMER_CALLBACK(mc6854_tfifo_cb)
334334{
335   device_config* device = (device_config*) ptr;
335   const device_config* device = (const device_config*) ptr;
336336   mc6854_t* mc6854 = get_safe_token( device );
337337   int i, data = mc6854->tfifo[ FIFO_SIZE - 1 ];
338338
src/mess/machine/99_dsk.c
r5060r5061
10451045   else if (bwg_rtc_enable)
10461046   {
10471047      if (! (offset & 1))
1048         reply = mm58274c_r((device_config*)devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1);
1048         reply = mm58274c_r(devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1);
10491049   }
10501050   else
10511051   {
r5060r5061
10881088   else if (bwg_rtc_enable)
10891089   {
10901090      if (! (offset & 1))
1091         mm58274c_w((device_config*)devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1, data);
1091         mm58274c_w(devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1, data);
10921092   }
10931093   else
10941094   {
r5060r5061
14141414   {
14151415      /* rtc */
14161416      if (! (offset & 1))
1417         reply = mm58274c_r((device_config*)devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1);
1417         reply = mm58274c_r(devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1);
14181418   }
14191419   else if (offset < 0x1400)
14201420   {
r5060r5061
14641464   {
14651465      /* rtc */
14661466      if (! (offset & 1))
1467         mm58274c_w((device_config*)devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1, data);
1467         mm58274c_w(devtag_get_device(space->machine, "mm58274c_floppy"), (offset - 0x1FE0) >> 1, data);
14681468   }
14691469   else if (offset < 0x1400)
14701470   {
src/mess/machine/radio86.c
r5060r5061
143143
144144WRITE8_DEVICE_HANDLER(radio86_write_video)
145145{
146   i8275_dack_set_data((device_config*)devtag_get_device(device->machine, "i8275"),data);
146   i8275_dack_set_data(devtag_get_device(device->machine, "i8275"),data);
147147}
148148
149149const dma8257_interface radio86_dma =
src/mess/machine/b2m.c
r5060r5061
160160
161161static PIT8253_OUTPUT_CHANGED(bm2_pit_out0)
162162{
163   pic8259_set_irq_line((device_config*)devtag_get_device(device->machine, "pic8259"),1,state);     
163   pic8259_set_irq_line(devtag_get_device(device->machine, "pic8259"),1,state);     
164164}
165165
166166
r5060r5061
329329
330330MACHINE_START(b2m)
331331{
332   wd17xx_set_pause_time((device_config*)devtag_get_device(machine, "wd1793"),10);
332   wd17xx_set_pause_time(devtag_get_device(machine, "wd1793"),10);
333333}
334334
335335static IRQ_CALLBACK(b2m_irq_callback)
336336{   
337   return pic8259_acknowledge((device_config*)devtag_get_device(device->machine, "pic8259"));
337   return pic8259_acknowledge(devtag_get_device(device->machine, "pic8259"));
338338}
339339
340340
r5060r5061
346346{   
347347   vblank_state++;
348348   if (vblank_state>1) vblank_state=0;
349   pic8259_set_irq_line((device_config*)devtag_get_device(device->machine, "pic8259"), 0, vblank_state);     
349   pic8259_set_irq_line(devtag_get_device(device->machine, "pic8259"), 0, vblank_state);     
350350}
351351
352352MACHINE_RESET(b2m)
src/mess/machine/vc1541.c
r5060r5061
17551755/* Floppy loading clean-up, part 1: with cbm_floppy_image_loading we can finally split c1551 from vc1541
17561756   Both struct have a GCR_data gcr component where we store the floppy data, but remaining parts are finally separated!
17571757   Later, everything should be changed to use devices for the drives...      */
1758void cbm_floppy_image_loading( int format, int id1, int id2, UINT8 *copy, GCR_data gcr )
1758static void cbm_floppy_image_loading( int format, int id1, int id2, UINT8 *copy, GCR_data gcr )
17591759{
17601760   UINT8 sector_checksum;
17611761   int i = 0, j, k, l, pos;
src/mess/machine/mc6846.c
r5060r5061
201201
202202static TIMER_CALLBACK( mc6846_timer_expire )
203203{
204   device_config* device = (device_config*) ptr;
204   const device_config* device = (const device_config*) ptr;
205205   mc6846_t* mc6846 = get_safe_token( device );
206206   int delay = FACTOR * (mc6846->latch+1);
207207
r5060r5061
246246
247247static TIMER_CALLBACK( mc6846_timer_one_shot )
248248{
249   device_config* device = (device_config*) ptr;
249   const device_config* device = (const device_config*) ptr;
250250   mc6846_t* mc6846 = get_safe_token( device );
251251   LOG (( "%f: mc6846 timer one shot called\n", attotime_to_double(timer_get_time(device->machine)) ));
252252
src/mess/machine/pmd85.c
r5060r5061
520520                     switch (offset & 0x80)
521521                     {
522522                        case 0x80:   /* ROM module 8255 */
523                              return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_3"), offset & 0x03);
523                              return ppi8255_r(devtag_get_device(space->machine, "ppi8255_3"), offset & 0x03);
524524                     }
525525                  }
526526                  break;
r5060r5061
540540                              }
541541                              break;
542542                        case 0x40:      /* 8255 (GPIO/0, GPIO/1) */
543                              return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 0x03);
543                              return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 0x03);
544544                        case 0x50:   /* 8253 */
545                              return pit8253_r( (device_config*)devtag_get_device(space->machine, "pit8253"), offset & 0x03);
545                              return pit8253_r( devtag_get_device(space->machine, "pit8253"), offset & 0x03);
546546                        case 0x70:   /* 8255 (IMS-2) */
547                              return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_2"), offset & 0x03);
547                              return ppi8255_r(devtag_get_device(space->machine, "ppi8255_2"), offset & 0x03);
548548                     }
549549                     break;
550550               case 0x80:   /* external interfaces */
r5060r5061
594594                     switch (offset & 0x80)
595595                     {
596596                        case 0x80:   /* ROM module 8255 */
597                              ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_3"), offset & 0x03, data);
597                              ppi8255_w(devtag_get_device(space->machine, "ppi8255_3"), offset & 0x03, data);
598598                              break;
599599                     }
600600                  }
r5060r5061
615615                              }
616616                              break;
617617                        case 0x40:      /* 8255 (GPIO/0, GPIO/0) */
618                              ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 0x03, data);
618                              ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 0x03, data);
619619                              break;
620620                        case 0x50:   /* 8253 */
621                              pit8253_w((device_config*)devtag_get_device(space->machine, "pit8253"), offset & 0x03, data);
621                              pit8253_w(devtag_get_device(space->machine, "pit8253"), offset & 0x03, data);
622622                              logerror ("8253 writing. Address: %02x, Data: %02x\n", offset, data);
623623                              break;
624624                        case 0x70:   /* 8255 (IMS-2) */
625                              ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_2"), offset & 0x03, data);
625                              ppi8255_w(devtag_get_device(space->machine, "ppi8255_2"), offset & 0x03, data);
626626                              break;
627627                     }
628628                     break;
r5060r5061
656656            switch (offset & 0x80)
657657            {
658658               case 0x80:   /* Motherboard 8255 */
659                     return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_0"), offset & 0x03);
659                     return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset & 0x03);
660660            }
661661            break;
662662   }
r5060r5061
679679            switch (offset & 0x80)
680680            {
681681               case 0x80:   /* Motherboard 8255 */
682                     ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_0"), offset & 0x03, data);
682                     ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), offset & 0x03, data);
683683                     break;
684684            }
685685            break;
r5060r5061
901901
902902static TIMER_CALLBACK( setup_machine_state )
903903{
904   device_config *pit8253 = (device_config*)devtag_get_device(machine, "pit8253");
904   const device_config *pit8253 = devtag_get_device(machine, "pit8253");
905905
906906   pit8253_gate_w(pit8253, 0, 1);
907907   pit8253_gate_w(pit8253, 1, 1);
src/mess/machine/c128.c
r5060r5061
174174   c128_irq (device->machine, level || vicirq);
175175}
176176
177void c128_vic_interrupt (running_machine *machine, int level)
177static void c128_vic_interrupt (running_machine *machine, int level)
178178{
179179   const device_config *cia_0 = devtag_get_device(machine, "cia_0");
180180#if 1
src/mess/machine/at.c
r5060r5061
415415   dma8237_drq_write( at_devices.dma8237_1, FDC_DMA, state);
416416}
417417
418static device_config * at_get_device(running_machine *machine )
418static const device_config *at_get_device(running_machine *machine)
419419{
420   return (device_config*)devtag_get_device(machine, "nec765");
420   return devtag_get_device(machine, "nec765");
421421}
422422
423423static const struct pc_fdc_interface fdc_interface =
src/mess/machine/vector06.c
r5060r5061
124124};
125125
126126READ8_HANDLER(vector_8255_1_r) {
127   return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255"), (offset ^ 0x03));
127   return ppi8255_r(devtag_get_device(space->machine, "ppi8255"), (offset ^ 0x03));
128128}
129129
130130WRITE8_HANDLER(vector_8255_1_w) {
131   ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255"), (offset ^0x03) , data );
131   ppi8255_w(devtag_get_device(space->machine, "ppi8255"), (offset ^0x03) , data );
132132
133133}
134134
135135READ8_HANDLER(vector_8255_2_r) {
136   return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_2"), (offset ^ 0x03));
136   return ppi8255_r(devtag_get_device(space->machine, "ppi8255_2"), (offset ^ 0x03));
137137}
138138
139139WRITE8_HANDLER(vector_8255_2_w) {
140   ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_2"), (offset ^0x03) , data );
140   ppi8255_w(devtag_get_device(space->machine, "ppi8255_2"), (offset ^0x03) , data );
141141
142142}
143143
src/mess/machine/orion.c
r5060r5061
7979
8080READ8_HANDLER ( orion128_system_r )
8181{
82   return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_2"), offset & 3);
82   return ppi8255_r(devtag_get_device(space->machine, "ppi8255_2"), offset & 3);
8383}
8484
8585WRITE8_HANDLER ( orion128_system_w )
8686{
87   ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_2"), offset & 3, data);   
87   ppi8255_w(devtag_get_device(space->machine, "ppi8255_2"), offset & 3, data);   
8888}
8989
9090READ8_HANDLER ( orion128_romdisk_r )
9191{
92   return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 3);   
92   return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 3);   
9393}
9494
9595WRITE8_HANDLER ( orion128_romdisk_w )
9696{   
97   ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data);   
97   ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data);   
9898}
9999
100100static void orion_set_video_mode(running_machine *machine, int width)
src/mess/machine/cbmdrive.c
r5060r5061
16231623   vc1541_state(machine, drive);
16241624}
16251625
1626void drive_reset_write( CBM_Drive * drive, int level )
1626static void drive_reset_write( CBM_Drive * drive, int level )
16271627{
16281628   if (level == 0)
16291629   {
src/mess/machine/llc.c
r5060r5061
1313
1414UINT8 code = 0;
1515
16UINT8 llc1_key_state = 0;
16static UINT8 llc1_key_state = 0;
1717
1818static READ8_DEVICE_HANDLER (llc1_port_b_r)
1919{   
src/mess/machine/z1013.c
r5060r5061
1010#include "includes/z1013.h"
1111#include "cpu/z80/z80.h"
1212
13UINT8 z1013_keyboard_line;
14UINT8 z1013_keyboard_part;
13static UINT8 z1013_keyboard_line;
14static UINT8 z1013_keyboard_part;
1515
1616/* Wires on Z80 PIO are switched */
1717READ8_DEVICE_HANDLER(z1013_z80pio_r)
src/mess/machine/tandy1t.c
r5060r5061
184184   switch (offset) {
185185   case 1:
186186      tandy_ppi.portb = data;
187      pit8253_gate_w( (device_config*)devtag_get_device(space->machine, "pit8253"), 2, data & 1);
187      pit8253_gate_w( devtag_get_device(space->machine, "pit8253"), 2, data & 1);
188188      pc_speaker_set_spkrdata( space->machine, data & 0x02 );
189189      pc_keyb_set_clock(data&0x40);
190190      if ( data & 0x80 ) {
src/mess/machine/amstr_pc.c
r5060r5061
154154      pc1640.port61=data;
155155      if (data==0x30) pc1640.port62=(pc1640.port65&0x10)>>4;
156156      else if (data==0x34) pc1640.port62=pc1640.port65&0xf;
157      pit8253_gate_w( (device_config*)devtag_get_device(space->machine, "pit8253"), 2, data & 1);
157      pit8253_gate_w( devtag_get_device(space->machine, "pit8253"), 2, data & 1);
158158      pc_speaker_set_spkrdata( space->machine, data & 0x02 );
159159      pc_keyb_set_clock(data&0x40);
160160      break;
src/mess/machine/z80ne.c
r5060r5061
306306   return address;
307307}
308308
309void reset_lx388(running_machine *machine)
309static void reset_lx388(running_machine *machine)
310310{
311311   lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376");
312312   kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0);
313313   kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0);
314314}
315315
316void reset_lx382_banking(running_machine *machine)
316static void reset_lx382_banking(running_machine *machine)
317317{
318318   const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM);
319319
r5060r5061
326326   memory_set_direct_update_handler(space, reset_delay_count);
327327}
328328
329void reset_lx390_banking(running_machine *machine)
329static void reset_lx390_banking(running_machine *machine)
330330{
331331   const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM);
332332   reset_delay_counter = 0;
r5060r5061
386386     */
387387}
388388
389MACHINE_RESET(z80ne_base)
389static MACHINE_RESET(z80ne_base)
390390{
391391   int i;
392392   const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM);
src/mess/machine/mac.c
r5060r5061
13241324static int adb_keybinitialized, adb_keyb_wanted_srq;
13251325
13261326#if LOG_ADB
1327static const char *adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" };
1327static const char *const adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" };
13281328#endif
13291329
13301330static void mac_adb_pollmouse(running_machine *machine)
src/mess/machine/concept.c
r5060r5061
329329      /* calendar R/W */
330330      VLOG(("concept_io_r: Calendar read at address 0x03%4.4x\n", offset << 1));
331331      if (!clock_enable)
332         return mm58274c_r((device_config*)devtag_get_device(space->machine, "mm58274c"), clock_address);
332         return mm58274c_r(devtag_get_device(space->machine, "mm58274c"), clock_address);
333333      break;
334334
335335   case 7:
r5060r5061
471471      /* calendar R/W */
472472      LOG(("concept_io_w: Calendar written to at address 0x03%4.4x, data: 0x%4.4x\n", offset << 1, data));
473473      if (!clock_enable)
474         mm58274c_w((device_config*)devtag_get_device(space->machine, "mm58274c"), clock_address, data & 0xf);
474         mm58274c_w(devtag_get_device(space->machine, "mm58274c"), clock_address, data & 0xf);
475475      break;
476476
477477   case 7:
src/mess/machine/lisa.c
r5060r5061
11781178   /* initialize floppy */
11791179   {
11801180      if (lisa_features.floppy_hardware == sony_lisa2)
1181         sony_set_enable_lines((device_config*)devtag_get_device(machine, "fdc"),1);   /* on lisa2, drive unit 1 is always selected (?) */
1181         sony_set_enable_lines(devtag_get_device(machine, "fdc"),1);   /* on lisa2, drive unit 1 is always selected (?) */
11821182   }
11831183}
11841184
r5060r5061
13271327      /*if (lisa_features.floppy_hardware == twiggy)
13281328         twiggy_set_head_line(offset & 1);
13291329      else*/ if (lisa_features.floppy_hardware == sony_lisa210)
1330         sony_set_sel_line((device_config*)devtag_get_device(machine, "fdc"), offset & 1);
1330         sony_set_sel_line(devtag_get_device(machine, "fdc"), offset & 1);
13311331      break;
13321332   case 6:
13331333      DISK_DIAG = offset & 1;
src/mess/machine/kaypro.c
r5060r5061
1515static const device_config *kaypro_printer;
1616static const device_config *kaypro_fdc;
1717
18UINT8 kaypro_system_port;
18static UINT8 kaypro_system_port;
1919
2020
2121/***********************************************************
src/mess/machine/geneve.c
r5060r5061
419419         case 0xf13d:
420420         case 0xf13e:
421421         case 0xf13f:
422            return mm58274c_r((device_config*)devtag_get_device(space->machine, "mm58274c"), offset-0xf130);
422            return mm58274c_r(devtag_get_device(space->machine, "mm58274c"), offset-0xf130);
423423
424424         default:
425425            logerror("unmapped read offs=%d\n", (int) offset);
r5060r5061
465465         case 0x801d:
466466         case 0x801e:
467467         case 0x801f:
468            return mm58274c_r((device_config*)devtag_get_device(space->machine, "mm58274c"), offset-0xf130);
468            return mm58274c_r(devtag_get_device(space->machine, "mm58274c"), offset-0xf130);
469469
470470         default:
471471            logerror("unmapped read offs=%d\n", (int) offset);
r5060r5061
682682         case 0xf13d:
683683         case 0xf13e:
684684         case 0xf13f:
685            mm58274c_w((device_config*)devtag_get_device(space->machine, "mm58274c"), offset-0xf130, data);
685            mm58274c_w(devtag_get_device(space->machine, "mm58274c"), offset-0xf130, data);
686686            return;
687687
688688         default:
r5060r5061
731731         case 0x801d:
732732         case 0x801e:
733733         case 0x801f:
734            mm58274c_w((device_config*)devtag_get_device(space->machine, "mm58274c"), offset-0xf130, data);
734            mm58274c_w(devtag_get_device(space->machine, "mm58274c"), offset-0xf130, data);
735735            return;
736736
737737         default:
src/mess/machine/beta.c
r5060r5061
102102   }
103103}
104104
105const wd17xx_interface beta_wd17xx_interface = { betadisk_wd179x_callback, NULL };
105static const wd17xx_interface beta_wd17xx_interface = { betadisk_wd179x_callback, NULL };
106106
107107READ8_DEVICE_HANDLER(betadisk_status_r)
108108{
src/mess/machine/lviv.c
r5060r5061
147147      switch ((offset >> 4) & 0x3)
148148      {
149149      case 0:
150         return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_0"), offset & 3);
150         return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), offset & 3);
151151
152152      case 1:
153         return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 3);
153         return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), offset & 3);
154154
155155      case 2:
156156      case 3:
r5060r5061
183183      switch ((offset >> 4) & 0x3)
184184      {
185185      case 0:
186         ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_0"), offset & 3, data);
186         ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), offset & 3, data);
187187         break;
188188
189189      case 1:
190         ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data);
190         ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), offset & 3, data);
191191         break;
192192
193193      case 2:
src/mess/machine/pc8801.c
r5060r5061
724724
725725static UINT8 load_8255_A(running_machine *machine, int chip)
726726{
727   return use_5FD ? ppi8255_get_port_b((device_config*)devtag_get_device(machine, chip? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
727   return use_5FD ? ppi8255_get_port_b(devtag_get_device(machine, chip? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
728728}
729729
730730static UINT8 load_8255_B(running_machine *machine, int chip)
731731{
732   return use_5FD ? ppi8255_get_port_a((device_config*)devtag_get_device(machine, chip? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
732   return use_5FD ? ppi8255_get_port_a(devtag_get_device(machine, chip? "ppi8255_0" : "ppi8255_1" ) ) : 0xff;
733733}
734734
735735static UINT8 load_8255_C(running_machine *machine, int chip)
r5060r5061
739739
740740   if (use_5FD)
741741   {
742      port_c = ppi8255_get_port_c((device_config*)devtag_get_device(machine, chip? "ppi8255_0" : "ppi8255_1" ) );
742      port_c = ppi8255_get_port_c(devtag_get_device(machine, chip? "ppi8255_0" : "ppi8255_1" ) );
743743      result = ((port_c >> 4) & 0x0F) | ((port_c << 4) & 0xF0);
744744   }
745745
src/mess/machine/pc_fdc.h
r5060r5061
2929   void (*pc_fdc_interrupt)(running_machine*,int);
3030   void (*pc_fdc_dma_drq)(running_machine*,int,int);   
3131   const device_config *(*get_image)(running_machine*, int floppy_index);
32   device_config *(*get_device)(running_machine*);
32   const device_config *(*get_device)(running_machine*);
3333};
3434
3535extern const nec765_interface pc_fdc_nec765_connected_interface;
src/mess/machine/mc6843.c
r5060r5061
391391/* bottom halves, called to continue / finish a command after some delay */
392392static TIMER_CALLBACK( mc6843_cont )
393393{
394   device_config* device = (device_config*) ptr;
394   const device_config* device = (const device_config*) ptr;
395395   mc6843_t* mc6843 = get_safe_token( device );
396396   int cmd = mc6843->CMR & 0x0f;
397397
src/mess/machine/bebox.c
r5060r5061
119119static UINT32 bebox_crossproc_interrupts;
120120
121121static struct {
122   device_config   *pic8259_master;
123   device_config   *pic8259_slave;
124   device_config   *dma8237_1;
125   device_config   *dma8237_2;
122   const device_config   *pic8259_master;
123   const device_config   *pic8259_slave;
124   const device_config   *dma8237_1;
125   const device_config   *dma8237_2;
126126} bebox_devices;
127127
128128
r5060r5061
431431   return image_from_devtype_and_index(machine, IO_FLOPPY, 0);
432432}
433433
434static device_config * bebox_get_device(running_machine *machine )
434static const device_config * bebox_get_device(running_machine *machine )
435435{
436   return (device_config*)devtag_get_device(machine, "smc37c78");
436   return devtag_get_device(machine, "smc37c78");
437437}
438438
439439
r5060r5061
872872}
873873
874874static int bebox_get_out2(running_machine *machine) {
875   return pit8253_get_output((device_config*)devtag_get_device(machine, "pit8254"), 2 );
875   return pit8253_get_output(devtag_get_device(machine, "pit8254"), 2 );
876876}
877877
878878static const struct kbdc8042_interface bebox_8042_interface =
r5060r5061
10611061
10621062
10631063static TIMER_CALLBACK( bebox_get_devices ) {
1064   bebox_devices.pic8259_master = (device_config*)devtag_get_device(machine, "pic8259_master");
1065   bebox_devices.pic8259_slave = (device_config*)devtag_get_device(machine, "pic8259_slave");
1066   bebox_devices.dma8237_1 = (device_config*)devtag_get_device(machine, "dma8237_1");
1067   bebox_devices.dma8237_2 = (device_config*)devtag_get_device(machine, "dma8237_2");
1064   bebox_devices.pic8259_master = devtag_get_device(machine, "pic8259_master");
1065   bebox_devices.pic8259_slave = devtag_get_device(machine, "pic8259_slave");
1066   bebox_devices.dma8237_1 = devtag_get_device(machine, "dma8237_1");
1067   bebox_devices.dma8237_2 = devtag_get_device(machine, "dma8237_2");
10681068}
10691069
10701070
src/mess/machine/special.c
r5060r5061
132132
133133READ8_HANDLER( specialist_keyboard_r )
134134{   
135   return ppi8255_r((device_config*)devtag_get_device(space->machine, "ppi8255"), (offset & 3));
135   return ppi8255_r(devtag_get_device(space->machine, "ppi8255"), (offset & 3));
136136}
137137
138138WRITE8_HANDLER( specialist_keyboard_w )
139139{   
140   ppi8255_w((device_config*)devtag_get_device(space->machine, "ppi8255"), (offset & 3) , data );
140   ppi8255_w(devtag_get_device(space->machine, "ppi8255"), (offset & 3) , data );
141141}
142142
143143
r5060r5061
259259
260260static TIMER_CALLBACK( setup_pit8253_gates )
261261{
262   device_config *pit8253 = (device_config*)devtag_get_device(machine, "pit8253");
262   const device_config *pit8253 = devtag_get_device(machine, "pit8253");
263263
264264   pit8253_gate_w(pit8253, 0, 0);
265265   pit8253_gate_w(pit8253, 1, 0);
src/mess/machine/pp01.c
r5060r5061
1313
1414static UINT8 memory_block[16];
1515UINT8 pp01_video_scroll;
16UINT8 pp01_video_write_mode;
16static UINT8 pp01_video_write_mode;
1717
1818WRITE8_HANDLER (pp01_video_write_mode_w)
1919{
r5060r5061
202202   pp01_video_scroll = data;
203203}
204204
205UINT8 pp01_key_line = 0;
205static UINT8 pp01_key_line = 0;
206206static READ8_DEVICE_HANDLER (pp01_8255_portb_r )
207207{
208208   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
src/mess/machine/apple2.c
r5060r5061
12361236{
12371237   apple2_fdc_diskreg = data & 0xC0;
12381238   if (apple2_fdc_has_35(machine))
1239      sony_set_sel_line( (device_config*)devtag_get_device(machine, "fdc"),apple2_fdc_diskreg & 0x80);
1239      sony_set_sel_line( devtag_get_device(machine, "fdc"),apple2_fdc_diskreg & 0x80);
12401240}
12411241
12421242
src/mess/machine/pc.c
r5060r5061
11131113   dma8237_drq_write( pc_devices.dma8237, FDC_DMA, state);
11141114}
11151115
1116static device_config * pc_get_device(running_machine *machine )
1116static const device_config * pc_get_device(running_machine *machine )
11171117{
1118   return (device_config*)devtag_get_device(machine, "nec765");
1118   return devtag_get_device(machine, "nec765");
11191119}
11201120
11211121static const struct pc_fdc_interface fdc_interface_nc =
src/mess/machine/pce.c
r5060r5061
249249/* todo: how many input ports does the PCE have? */
250250WRITE8_HANDLER ( pce_joystick_w )
251251{
252   h6280io_set_buffer((device_config*) space->cpu, data);
252   h6280io_set_buffer(space->cpu, data);
253253    /* bump counter on a low-to-high transition of bit 1 */
254254    if((!joystick_data_select) && (data & JOY_CLOCK))
255255    {
src/mess/machine/ti99_4x.c
r5060r5061
226226*/
227227
228228/* descriptor for console GROMs */
229GROM_port_t console_GROMs;
229static GROM_port_t console_GROMs;
230230
231231/* true if hsgpl is enabled (i.e. has_hsgpl is true and hsgpl cru bit crdena is
232232set) */
r5060r5061
258258/* NPW 23-Feb-2004 - externs no longer needed because we now use cpu_adjust_icount(cputag_get_cpu(space->machine, "maincpu"),) */
259259
260260/* Link to the cartridge system. */
261const device_config *cartslots;
261static const device_config *cartslots;
262262
263263/*===========================================================================*/
264264/*
r5060r5061
10841084   GROM read for TI-99/8
10851085   For comments, see the handler for TI-99/4A
10861086*/
1087READ8_HANDLER ( ti99_grom_r8 )
1087static READ8_HANDLER ( ti99_grom_r8 )
10881088{
10891089   UINT8 reply;
10901090
r5060r5061
11191119   GROM write for TI-99/8
11201120   For comments, see the handler for TI-99/4A
11211121*/
1122WRITE8_HANDLER ( ti99_grom_w8 )
1122static WRITE8_HANDLER ( ti99_grom_w8 )
11231123{
11241124   cpu_adjust_icount(space->machine->cpu[0],-4/*20+3*/);      /* from 4 to 23? */
11251125
src/mess/machine/atarifdc.c
r5060r5061
3535   int  serin_delay;
3636}   ATARI_FDC;
3737 
38ATARI_FDC atari_fdc;
38static ATARI_FDC atari_fdc;
3939
4040typedef struct _atari_drive atari_drive;
4141struct _atari_drive
src/mess/machine/ti99_4x.h
r5060r5061
157157MACHINE_START( ti99_4ev_60hz );
158158MACHINE_RESET( ti99 );
159159
160DEVICE_START( ti99_cart );
160// DEVICE_START( ti99_cart );
161161// DEVICE_IMAGE_LOAD( ti99_cart );
162162// DEVICE_IMAGE_UNLOAD( ti99_cart );
163163
r5060r5061
172172READ16_HANDLER ( ti99_nop_8_r );
173173WRITE16_HANDLER ( ti99_nop_8_w );
174174
175READ8_HANDLER ( ti99_cart_cru_r );
176WRITE8_HANDLER ( ti99_cart_cru_w );
177
178READ16_HANDLER ( ti99_cart_r );
179WRITE16_HANDLER ( ti99_cart_w );
180175READ16_HANDLER ( ti99_4p_cart_r );
181176WRITE16_HANDLER ( ti99_4p_cart_w );
182177
src/mess/machine/bbc.c
r5060r5061
625625            return acia6850_data_r(acia, 0);
626626      }
627627      if ((myo>=0x10) && (myo<=0x17)) return 0xfe;                  /* Serial System Chip */
628      if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r((device_config*)devtag_get_device(space->machine, "upd7002"), myo-0x18);         /* A to D converter */
628      if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r(devtag_get_device(space->machine, "upd7002"), myo-0x18);         /* A to D converter */
629629      if ((myo>=0x20) && (myo<=0x23)) return 0xfe;                  /* VideoULA */
630630      if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd1770l_read(space, myo-0x24); /* 1770 */
631631      if ((myo>=0x28) && (myo<=0x2f)) return bbcm_wd1770_read(space, myo-0x28);  /* disc control latch */
r5060r5061
664664            return acia6850_data_w(acia, 0, data);
665665      }
666666      if ((myo>=0x10) && (myo<=0x17)) BBC_SerialULA_w(space, myo-0x10,data);      /* Serial System Chip */
667      if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w((device_config*)devtag_get_device(space->machine, "upd7002"),myo-0x18,data);         /* A to D converter */
667      if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(devtag_get_device(space->machine, "upd7002"),myo-0x18,data);         /* A to D converter */
668668      if ((myo>=0x20) && (myo<=0x23)) bbc_videoULA_w(space, myo-0x20,data);         /* VideoULA */
669669      if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(space, myo-0x24,data);    /* 1770 */
670670      if ((myo>=0x28) && (myo<=0x2f)) bbcm_wd1770_write(space, myo-0x28,data);     /* disc control latch */
r5060r5061
12391239/* joystick EOC */
12401240static READ8_DEVICE_HANDLER( bbcb_via_system_read_cb1 )
12411241{
1242   return uPD7002_EOC_r((device_config*)devtag_get_device(device->machine, "upd7002"),0);
1242   return uPD7002_EOC_r(devtag_get_device(device->machine, "upd7002"),0);
12431243}
12441244
12451245
r5060r5061
15191519static READ8_HANDLER( bbc_i8271_read )
15201520{
15211521   int ret;
1522   device_config *i8271 = (device_config*)devtag_get_device(space->machine, "i8271");
1522   const device_config *i8271 = devtag_get_device(space->machine, "i8271");
15231523   ret=0x0ff;
15241524   logerror("i8271 read %d  ",offset);
15251525   switch (offset)
r5060r5061
15451545
15461546static WRITE8_HANDLER( bbc_i8271_write )
15471547{
1548   device_config *i8271 = (device_config*)devtag_get_device(space->machine, "i8271");
1548   const device_config *i8271 = devtag_get_device(space->machine, "i8271");
15491549   logerror("i8271 write  %d  %d\n",offset,data);
15501550
15511551   switch (offset)
src/mess/devices/ti99cart.c
r5060r5061
12471247   }
12481248}
12491249
1250DEVICE_GET_INFO(ti99_cartridge_pcb_none)
1250static DEVICE_GET_INFO(ti99_cartridge_pcb_none)
12511251{
12521252   switch(state)
12531253   {
r5060r5061
12701270   DEVICE_GET_INFO_CALL(ti99_cart_common);
12711271}
12721272
1273DEVICE_GET_INFO(ti99_cartridge_pcb_paged)
1273static DEVICE_GET_INFO(ti99_cartridge_pcb_paged)
12741274{
12751275   switch(state)
12761276   {
r5060r5061
13411341   }
13421342}
13431343
1344DEVICE_GET_INFO(ti99_cartridge_pcb_super)
1344static DEVICE_GET_INFO(ti99_cartridge_pcb_super)
13451345{
13461346   switch(state)
13471347   {
src/mess/devices/ti99cart.h
r5060r5061
9090
9191/* cartridge PCB types */
9292DEVICE_GET_INFO(ti99_cartridge_pcb_std);
93DEVICE_GET_INFO(ti99_cartridge_pcb_exbas);
9493DEVICE_GET_INFO(ti99_cartridge_pcb_minimem);
95DEVICE_GET_INFO(ti99_cartridge_pcb_supersp);
9694DEVICE_GET_INFO(ti99_cartridge_pcb_mbx);
9795
9896READ16_DEVICE_HANDLER(ti99_multicart_r);
src/mess/devices/aescart.c
r5060r5061
363363   }
364364}
365365
366DEVICE_GET_INFO(aes_cartridge_pcb_none)
366static DEVICE_GET_INFO(aes_cartridge_pcb_none)
367367{
368368   switch(state)
369369   {
src/mess/devices/thomflop.h
r5060r5061
1111
1212#include "device.h"
1313#include "image.h"
14#include "machine/mc6843.h"
15#include "machine/mc6854.h"
1416
17extern const mc6843_interface to7_6843_itf;
18extern const mc6854_interface to7_network_iface;
1519
1620extern UINT8 to7_controller_type; /* set during init */
1721extern UINT8 to7_floppy_bank;
src/mess/formats/z80ne_dsk.c
r5060r5061
9090#define dmk_idam_crc(x)            (((x)[5] << 8) + (x)[6])
9191#define dmk_idam_set_crc(x, crc)   (x)[5] = ((crc) >> 8); (x)[6] = ((crc) >> 0);
9292
93const char *needle_data = "\x00\x00\x00\x00\x00\x00\x00\x00\xFB\xFB";
94const char *needle_deleted_data_fa = "\x00\x00\x00\x00\x00\x00\x00\x00\xFA\xFA";
95const char *needle_deleted_data_f8 = "\x00\x00\x00\x00\x00\x00\x00\x00\xF8\xF8";
93static const char needle_data[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xFB\xFB";
94static const char needle_deleted_data_fa[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xFA\xFA";
95static const char needle_deleted_data_f8[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xF8\xF8";
9696
9797
9898static struct dmk_tag *get_dmk_tag(floppy_image *floppy)
r5060r5061
360360   return get_dmk_tag(floppy)->track_size;
361361}
362362
363UINT8 * my_memmem(UINT8 *haystack, size_t haystacklen,
363static UINT8 * my_memmem(UINT8 *haystack, size_t haystacklen,
364364      UINT8 *needle, size_t needlelen)
365365{
366366        register UINT8 *h = haystack;
src/mess/drivers/ply601.c
r5060r5061
1010#include "cpu/m6800/m6800.h"
1111#include "video/mc6845.h"
1212
13UINT8 rom_page;
13static UINT8 rom_page;
1414
1515static READ8_HANDLER (rom_page_r)
1616{
src/mess/drivers/mmd1.c
r5060r5061
1111#include "mmd1.lh"
1212#include "mmd2.lh"
1313
14WRITE8_HANDLER (mmd1_port0_w)
14static WRITE8_HANDLER (mmd1_port0_w)
1515{
1616   output_set_value("p0_7", BIT(data,7) ? 0 : 1);
1717   output_set_value("p0_6", BIT(data,6) ? 0 : 1);
r5060r5061
2323   output_set_value("p0_0", BIT(data,0) ? 0 : 1);
2424}
2525
26WRITE8_HANDLER (mmd1_port1_w)
26static WRITE8_HANDLER (mmd1_port1_w)
2727{
2828   output_set_value("p1_7", BIT(data,7) ? 0 : 1);
2929   output_set_value("p1_6", BIT(data,6) ? 0 : 1);
r5060r5061
3535   output_set_value("p1_0", BIT(data,0) ? 0 : 1);
3636}
3737
38WRITE8_HANDLER (mmd1_port2_w)
38static WRITE8_HANDLER (mmd1_port2_w)
3939{
4040   output_set_value("p2_7", BIT(data,7) ? 0 : 1);
4141   output_set_value("p2_6", BIT(data,6) ? 0 : 1);
r5060r5061
4747   output_set_value("p2_0", BIT(data,0) ? 0 : 1);
4848}
4949
50READ8_HANDLER (mmd1_keyboard_r)
50static READ8_HANDLER (mmd1_keyboard_r)
5151{
5252   UINT8 line1 = input_port_read(space->machine,"LINE1");
5353   UINT8 line2 = input_port_read(space->machine,"LINE2");
r5060r5061
107107
108108
109109/* Input ports */
110INPUT_PORTS_START( mmd1 )
110static INPUT_PORTS_START( mmd1 )
111111   PORT_START("LINE1")
112112         PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0)
113113         PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
r5060r5061
131131INPUT_PORTS_END
132132
133133
134INPUT_PORTS_START( mmd2 )
134static INPUT_PORTS_START( mmd2 )
135135/*
136136DIP switches:
137137WE 0      - Write enable for addresses $0000..$03FF
src/mess/drivers/pc6001.c
r5060r5061
6565#include "video/m6847.h"
6666#include "sound/ay8910.h"
6767
68UINT8 *pc6001_ram;
69UINT8 *pc6001_video_ram;
68static UINT8 *pc6001_ram;
69static UINT8 *pc6001_video_ram;
7070
71WRITE8_HANDLER ( pc6001_system_latch_w )
71static WRITE8_HANDLER ( pc6001_system_latch_w )
7272{
7373   UINT16 startaddr[] = {0xC000, 0xE000, 0x8000, 0xA000 };
7474   
r5060r5061
9898   return gfx[ch*16+line];
9999}
100100
101UINT8 port_c_8255;
101static UINT8 port_c_8255;
102102
103READ8_DEVICE_HANDLER(nec_ppi8255_r) {
103static READ8_DEVICE_HANDLER(nec_ppi8255_r) {
104104   if (offset==2) {
105105      return port_c_8255;
106106   } else {
r5060r5061
108108   }
109109}
110110
111WRITE8_DEVICE_HANDLER(nec_ppi8255_w) {
111static WRITE8_DEVICE_HANDLER(nec_ppi8255_w) {
112112   if (offset==3) {
113113      if(data & 1) {
114114         port_c_8255 |=   1<<((data>>1)&0x07);
r5060r5061
127127   ppi8255_w(device,offset,data);
128128}
129129
130WRITE8_DEVICE_HANDLER(pc6100_ay8910_address_w) {
130static WRITE8_DEVICE_HANDLER(pc6100_ay8910_address_w) {
131131   ay8910_address_w(device,offset,data & 0x0f);
132132}
133133
r5060r5061
149149ADDRESS_MAP_END
150150
151151/* Input ports */
152INPUT_PORTS_START( pc6001 )
152static INPUT_PORTS_START( pc6001 )
153153   PORT_START("LINE0")
154154      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1)
155155      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2)
r5060r5061
161161      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8)   
162162INPUT_PORTS_END
163163
164UINT8 irq_vector = 0x00;
164static UINT8 irq_vector = 0x00;
165165
166INTERRUPT_GEN( pc6001_interrupt )
166static INTERRUPT_GEN( pc6001_interrupt )
167167{
168168   irq_vector = 0x16;
169169   cpu_set_input_line(device, 0, HOLD_LINE);
r5060r5061
225225
226226
227227
228const ppi8255_interface pc6001_ppi8255_interface =
228static const ppi8255_interface pc6001_ppi8255_interface =
229229{
230230   DEVCB_HANDLER(pc6001_8255_porta_r),
231231   DEVCB_HANDLER(pc6001_8255_portb_r),
r5060r5061
235235   DEVCB_HANDLER(pc6001_8255_portc_w)
236236};
237237
238const msm8251_interface pc6001_usart_interface=
238static const msm8251_interface pc6001_usart_interface=
239239{
240240   NULL,
241241   NULL,
src/mess/drivers/pocketc.c
r5060r5061
800800   MDRV_CPU_PROGRAM_MAP( pc1255_mem)
801801MACHINE_DRIVER_END
802802
803NVRAM_HANDLER( pc1260 )
803static NVRAM_HANDLER( pc1260 )
804804{
805805   const device_config *main_cpu = cputag_get_cpu(machine, "maincpu");
806806   UINT8 *ram = memory_region(machine, "maincpu") + 0x4000;
src/mess/drivers/chessmst.c
r5060r5061
2020ADDRESS_MAP_END
2121
2222/* Input ports */
23INPUT_PORTS_START( chessmst )
23static INPUT_PORTS_START( chessmst )
2424INPUT_PORTS_END
2525
2626
src/mess/drivers/scorpion.c
r5060r5061
189189
190190static int ROMSelection;
191191
192static device_config* beta;
192static const device_config* beta;
193193
194194//static UINT8 *rom_pointer;
195195
r5060r5061
302302static MACHINE_RESET( scorpion )
303303{   
304304   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
305   beta = (device_config*)devtag_get_device(machine, BETA_DISK_TAG);   
305   beta = devtag_get_device(machine, BETA_DISK_TAG);   
306306   
307307   memory_install_read8_handler (space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1));
308308   
src/mess/drivers/spectrum.c
r5060r5061
310310
311311/****************************************************************************************************/
312312
313INPUT_PORTS_START( spec_joys )
313static INPUT_PORTS_START( spec_joys )
314314   PORT_START("JOY_INTF")
315315   PORT_CATEGORY_CLASS( 0x0f, 0x01, "Joystick Interface")
316316   PORT_CATEGORY_ITEM(  0x00, "None (No Joystick)",   0 )
src/mess/drivers/cat.c
r5060r5061
116116   AM_RANGE(0x00860000, 0x00860001) AM_WRITE(cat_test_mode_w) // Test mode   
117117ADDRESS_MAP_END
118118
119UINT16 *swyft_video_ram;
119static UINT16 *swyft_video_ram;
120120
121121static ADDRESS_MAP_START(swyft_mem, ADDRESS_SPACE_PROGRAM, 16)
122122   ADDRESS_MAP_UNMAP_HIGH
r5060r5061
125125ADDRESS_MAP_END
126126
127127/* Input ports */
128INPUT_PORTS_START( cat )
128static INPUT_PORTS_START( cat )
129129   PORT_START("DIPSW1")
130130      PORT_DIPNAME( 0x8000, 0x8000, "Mode" )
131131      PORT_DIPSETTING(    0x8000, DEF_STR( Normal ) )
r5060r5061
221221      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UNDO") PORT_CODE(KEYCODE_BACKSLASH)
222222      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+-") PORT_CODE(KEYCODE_TILDE)
223223INPUT_PORTS_END
224INPUT_PORTS_START( swyft )
224static INPUT_PORTS_START( swyft )
225225INPUT_PORTS_END
226226
227227
r5060r5061
317317{
318318}
319319
320UINT8 duart_inp = 0x0e;
320static UINT8 duart_inp = 0x0e;
321321
322322static UINT8 duart_input(const device_config *device)
323323{
src/mess/drivers/bondwell.c
r5060r5061
131131};
132132
133133
134const z80sio_interface bw12_z80sio_intf =
134static const z80sio_interface bw12_z80sio_intf =
135135{
136136   0,   /* interrupt handler */
137137   0,         /* DTR changed handler */
src/mess/drivers/fmtowns.c
r5060r5061
387387    return 0;
388388}
389389
390const struct pit8253_config towns_pit8253_config =
390static const struct pit8253_config towns_pit8253_config =
391391{
392392   {
393393      {
src/mess/drivers/trs80.c
r5060r5061
373373   PORT_BIT(0x80, 0x00, IPT_UNUSED)
374374INPUT_PORTS_END
375375
376INPUT_PORTS_START( trs80m3 )
376static INPUT_PORTS_START( trs80m3 )
377377   PORT_INCLUDE (trs80)
378378   PORT_START("E9")   // these are the power-on uart settings
379379   PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED )
src/mess/drivers/atm.c
r5060r5061
1212#include "machine/beta.h"
1313
1414static int ROMSelection;
15static device_config* beta;
15static const device_config* beta;
1616
1717static DIRECT_UPDATE_HANDLER( atm_direct )
1818{   
r5060r5061
9595static MACHINE_RESET( atm )
9696{
9797   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
98   beta = (device_config*)devtag_get_device(machine, BETA_DISK_TAG);
98   beta = devtag_get_device(machine, BETA_DISK_TAG);
9999   
100100   memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1));
101101   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
src/mess/drivers/nanos.c
r5060r5061
130130   }
131131}
132132
133const z80pio_interface nanos_z80pio_intf =
133static const z80pio_interface nanos_z80pio_intf =
134134{
135135   DEVCB_NULL,   /* callback when change interrupt status */
136136   DEVCB_HANDLER(nanos_port_a_r),
src/mess/drivers/z9001.c
r5060r5061
2323ADDRESS_MAP_END
2424
2525/* Input ports */
26INPUT_PORTS_START( z9001 )
26static INPUT_PORTS_START( z9001 )
2727INPUT_PORTS_END
2828
2929
src/mess/drivers/fm7.c
r5060r5061
8888 * when kana is active.
8989 */
9090 // TODO: fill in shift,ctrl,graph and kana code
91const UINT16 fm7_key_list[0x60][5] = 
91static const UINT16 fm7_key_list[0x60][5] = 
9292{ // norm  shift ctrl  graph kana
9393   {0x00, 0x00, 0x00, 0x00, 0x00},
9494   {0x1b, 0x1b, 0x1b, 0x1b, 0x1b},  // ESC
r5060r5061
205205 *   bit 7 - SYNDET
206206 *
207207 */
208WRITE8_HANDLER( fm7_irq_mask_w )
208static WRITE8_HANDLER( fm7_irq_mask_w )
209209{
210210   irq_mask = data;
211211   logerror("IRQ mask set: 0x%02x\n",irq_mask);
r5060r5061
224224 *   bit 6 - ??buzzer on/off
225225 *   bit 7 - ??buzzer on/off
226226 */
227READ8_HANDLER( fm7_irq_cause_r )
227static READ8_HANDLER( fm7_irq_cause_r )
228228{
229229   UINT8 ret = ~irq_flags;
230230   
r5060r5061
233233   return ret;
234234}
235235
236READ8_HANDLER( vector_r )
236static READ8_HANDLER( vector_r )
237237{
238238   UINT8* RAM = memory_region(space->machine,"maincpu");
239239
240240   return RAM[0xfff0+offset];
241241}
242242
243WRITE8_HANDLER( vector_w )
243static WRITE8_HANDLER( vector_w )
244244{
245245   UINT8* RAM = memory_region(space->machine,"maincpu");
246246   
r5060r5061
253253 *  bit 0 - attention IRQ active, clears flag when read.
254254 *  bit 1 - break key active
255255 */
256READ8_HANDLER( fm7_fd04_r )
256static READ8_HANDLER( fm7_fd04_r )
257257{
258258   UINT8 ret = 0xff;
259259   
r5060r5061
275275 *  On read, enables BASIC ROM at 0x8000 (default)
276276 *  On write, disables BASIC ROM, enables RAM (if more than 32kB)
277277 */
278READ8_HANDLER( fm7_rom_en_r )
278static READ8_HANDLER( fm7_rom_en_r )
279279{
280280   UINT8* RAM = memory_region(space->machine,"maincpu");
281281   
r5060r5061
286286   return 0x00;
287287}
288288
289WRITE8_HANDLER( fm7_rom_en_w )
289static WRITE8_HANDLER( fm7_rom_en_w )
290290{
291291   UINT8* RAM = memory_region(space->machine,"maincpu");
292292   
r5060r5061
300300 *  Main CPU: I/O ports 0xfd18 - 0xfd1f
301301 *  Floppy Disk Controller (MB8877A)
302302 */
303WD17XX_CALLBACK( fm7_fdc_irq )
303static WD17XX_CALLBACK( fm7_fdc_irq )
304304{
305305   switch(state)
306306   {
r5060r5061
319319   }
320320}
321321 
322READ8_HANDLER( fm7_fdc_r )
322static READ8_HANDLER( fm7_fdc_r )
323323{
324324   const device_config* dev = devtag_get_device(space->machine,"fdc");
325325   UINT8 ret = 0;
r5060r5061
353353   return 0x00;
354354}
355355
356WRITE8_HANDLER( fm7_fdc_w )
356static WRITE8_HANDLER( fm7_fdc_w )
357357{
358358   const device_config* dev = devtag_get_device(space->machine,"fdc");
359359   switch(offset)
r5060r5061
408408 *  bit (MSB) in bit 7 of fd/d400.  0xfd00 also holds a flag for the main
409409 *  CPU clock speed in bit 0 (0 = 1.2MHz, 1 = 2MHz)
410410 */
411READ8_HANDLER( fm7_keyboard_r)
411static READ8_HANDLER( fm7_keyboard_r)
412412{
413413   UINT8 ret;
414414   switch(offset)
r5060r5061
424424   }
425425}
426426
427READ8_HANDLER( fm7_sub_keyboard_r)
427static READ8_HANDLER( fm7_sub_keyboard_r)
428428{
429429   UINT8 ret;
430430   switch(offset)
r5060r5061
439439   }
440440}
441441
442READ8_HANDLER( fm7_cassette_printer_r )
442static READ8_HANDLER( fm7_cassette_printer_r )
443443{
444444   // bit 7: cassette input
445445   // bit 5: printer DET2
r5060r5061
492492   return ret;
493493}
494494
495WRITE8_HANDLER( fm7_cassette_printer_w )
495static WRITE8_HANDLER( fm7_cassette_printer_w )
496496{
497497   static UINT8 prev;
498498   switch(offset)
r5060r5061
752752// When a key is pressed or released, an IRQ is generated on the main CPU,
753753// and an FIRQ on the sub CPU.  Both CPUs have ports to read keyboard data.
754754// Scancodes are 9 bits.
755void key_press(running_machine* machine, UINT16 scancode)
755static void key_press(running_machine* machine, UINT16 scancode)
756756{
757757   current_scancode = scancode;
758758
r5060r5061
952952ADDRESS_MAP_END
953953
954954/* Input ports */
955INPUT_PORTS_START( fm7 )
955static INPUT_PORTS_START( fm7 )
956956
957957  PORT_START("key1")
958958  PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED)
src/mess/drivers/exp85.c
r5060r5061
2121ADDRESS_MAP_END
2222
2323/* Input ports */
24INPUT_PORTS_START( exp85 )
24static INPUT_PORTS_START( exp85 )
2525INPUT_PORTS_END
2626
2727
src/mess/drivers/ami1200.c
r5060r5061
141141   AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0x0)      /* Kickstart */
142142ADDRESS_MAP_END
143143
144int cd32_input_port_val = 0;
145int cd32_input_select = 0;
146UINT16 potgo_value = 0;
147int cd32_shifter[2];
144//int cd32_input_port_val = 0;
145//int cd32_input_select = 0;
146static UINT16 potgo_value = 0;
147static int cd32_shifter[2];
148148
149149static void cd32_potgo_w(running_machine *machine, UINT16 data)
150150{
src/mess/drivers/atari.c
r5060r5061
725725 *
726726 **************************************************************/
727727
728void a800xl_mmu(running_machine *machine, UINT8 new_mmu)
728static void a800xl_mmu(running_machine *machine, UINT8 new_mmu)
729729{
730730   read8_space_func rbank1, rbank2, rbank3, rbank4;
731731   write8_space_func wbank1, wbank2, wbank3, wbank4;
r5060r5061
795795}
796796
797797/* BASIC was available in a separate cart, so we don't test it */
798void a1200xl_mmu(running_machine *machine, UINT8 new_mmu)
798static void a1200xl_mmu(running_machine *machine, UINT8 new_mmu)
799799{
800800   read8_space_func rbank2, rbank3, rbank4;
801801   write8_space_func wbank2, wbank3, wbank4;
r5060r5061
874874};
875875
876876
877const pia6821_interface atari_pia_interface =
877static const pia6821_interface atari_pia_interface =
878878{
879879   DEVCB_HANDLER(atari_pia_pa_r),      /* port A in */
880880   DEVCB_HANDLER(atari_pia_pb_r),   /* port B in */
r5060r5061
890890   DEVCB_NULL      /* IRQB */
891891};
892892
893const pia6821_interface a600xl_pia_interface =
893static const pia6821_interface a600xl_pia_interface =
894894{
895895   DEVCB_HANDLER(atari_pia_pa_r),      /* port A in */
896896   DEVCB_HANDLER(atari_pia_pb_r),   /* port B in */
r5060r5061
906906   DEVCB_NULL      /* IRQB */
907907};
908908
909const pia6821_interface a1200xl_pia_interface =
909static const pia6821_interface a1200xl_pia_interface =
910910{
911911   DEVCB_HANDLER(atari_pia_pa_r),      /* port A in */
912912   DEVCB_HANDLER(atari_pia_pb_r),   /* port B in */
r5060r5061
922922   DEVCB_NULL      /* IRQB */
923923};
924924
925const pia6821_interface a800xl_pia_interface =
925static const pia6821_interface a800xl_pia_interface =
926926{
927927   DEVCB_HANDLER(atari_pia_pa_r),      /* port A in */
928928   DEVCB_HANDLER(atari_pia_pb_r),   /* port B in */
src/mess/drivers/pentagon.c
r5060r5061
1313
1414
1515static int ROMSelection;
16static device_config* beta;
16static const device_config* beta;
1717
1818static DIRECT_UPDATE_HANDLER( pentagon_direct )
1919{   
r5060r5061
102102static MACHINE_RESET( pentagon )
103103{
104104   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
105   beta = (device_config*)devtag_get_device(machine, BETA_DISK_TAG);
105   beta = devtag_get_device(machine, BETA_DISK_TAG);
106106   
107107   memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1));
108108   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
src/mess/drivers/ngp.c
r5060r5061
738738}
739739
740740
741static k1ge_interface ngp_k1ge_interface =
741static const k1ge_interface ngp_k1ge_interface =
742742{
743743   "screen",
744744   "vram",
r5060r5061
747747};
748748
749749
750static tlcs900_interface ngp_tlcs900_interface =
750static const tlcs900_interface ngp_tlcs900_interface =
751751{
752752   DEVCB_NULL,
753753   DEVCB_HANDLER( ngp_tlcs900_to3 )
src/mess/drivers/nes.c
r5060r5061
174174}
175175
176176
177static ppu2c0x_interface nes_ppu_interface =
177static const ppu2c0x_interface nes_ppu_interface =
178178{
179179   NULL,//"gfx1",
180180   0,
src/mess/drivers/pcw16.c
r5060r5061
12021202   pcw16_trigger_fdc_int(machine);
12031203}
12041204
1205static device_config * pcw16_get_device(running_machine *machine )
1205static const device_config * pcw16_get_device(running_machine *machine)
12061206{
1207   return (device_config*)devtag_get_device(machine, "nec765");
1207   return devtag_get_device(machine, "nec765");
12081208}
12091209
12101210static const struct pc_fdc_interface pcw16_fdc_interface=
src/mess/drivers/vt100.c
r5060r5061
1313#include "video/vtvideo.h"
1414#include "vt100.lh"
1515
16UINT8 *vt100_ram;
17UINT8 vt100_keyboard_int;
18UINT8 vt100_receiver_int;
19UINT8 vt100_vertical_int;
16static UINT8 *vt100_ram;
17static UINT8 vt100_keyboard_int;
18static UINT8 vt100_receiver_int;
19static UINT8 vt100_vertical_int;
2020
21double vt100_send_baud_rate;
22double vt100_recv_baud_rate;
21static double vt100_send_baud_rate;
22static double vt100_recv_baud_rate;
2323
2424static ADDRESS_MAP_START(vt100_mem, ADDRESS_SPACE_PROGRAM, 8)
2525   ADDRESS_MAP_UNMAP_HIGH
r5060r5061
4949   return retVal;
5050}
5151
52UINT8 vt100_key_scan = 0;
52static UINT8 vt100_key_scan = 0;
5353
5454static TIMER_CALLBACK(keyboard_callback)
5555{
src/mess/drivers/apf.c
r5060r5061
351351
352352static WRITE8_HANDLER(apf_wd179x_command_w)
353353{   
354   wd17xx_command_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset,~data);
354   wd17xx_command_w(devtag_get_device(space->machine, "wd179x"), offset,~data);
355355}
356356
357357static WRITE8_HANDLER(apf_wd179x_track_w)
358358{
359   wd17xx_track_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset,~data);
359   wd17xx_track_w(devtag_get_device(space->machine, "wd179x"), offset,~data);
360360}
361361
362362static WRITE8_HANDLER(apf_wd179x_sector_w)
363363{
364   wd17xx_sector_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset,~data);
364   wd17xx_sector_w(devtag_get_device(space->machine, "wd179x"), offset,~data);
365365}
366366
367367static WRITE8_HANDLER(apf_wd179x_data_w)
368368{
369   wd17xx_data_w((device_config*)devtag_get_device(space->machine, "wd179x"), offset,~data);
369   wd17xx_data_w(devtag_get_device(space->machine, "wd179x"), offset,~data);
370370}
371371
372372static READ8_HANDLER(apf_wd179x_status_r)
373373{
374   return ~wd17xx_status_r((device_config*)devtag_get_device(space->machine, "wd179x"), offset);
374   return ~wd17xx_status_r(devtag_get_device(space->machine, "wd179x"), offset);
375375}
376376
377377static READ8_HANDLER(apf_wd179x_track_r)
src/mess/drivers/craft.c
r5060r5061
166166    UINT8 res20[57];
167167} avr8_regs;
168168
169avr8_regs regs;
169static avr8_regs regs;
170170
171171static READ8_HANDLER( avr8_read )
172172{
src/mess/drivers/zrt80.c
r5060r5061
1/***************************************************************************
2   
3        DEC ZRT-80
4 
5        12/05/2009 Skeleton driver.
6 
7****************************************************************************/
8 
9#include "driver.h"
10#include "cpu/z80/z80.h"
11#include "video/mc6845.h"
12#include "machine/ins8250.h"
13 
14static UINT8 *video_ram;
15 
16static ADDRESS_MAP_START(zrt80_mem, ADDRESS_SPACE_PROGRAM, 8)
17   ADDRESS_MAP_UNMAP_HIGH
18   AM_RANGE(0x0000, 0x0fff) AM_ROM // Z25 - Main firmware
19   AM_RANGE(0x1000, 0x1fff) AM_ROM // Z24 - Expansion
20   AM_RANGE(0x4000, 0x43ff) AM_RAM   // Board RAM
21   // Normaly video RAM is 0x800 but could be expanded up to 8K
22   AM_RANGE(0xc000, 0xdfff) AM_RAM    AM_BASE(&video_ram) // Video RAM
23   
24ADDRESS_MAP_END
25 
26static ADDRESS_MAP_START( zrt80_io , ADDRESS_SPACE_IO, 8)
27   ADDRESS_MAP_UNMAP_HIGH
28   ADDRESS_MAP_GLOBAL_MASK(0xff)
29   AM_RANGE(0x00, 0x07) AM_DEVREADWRITE("ins8250", ins8250_r, ins8250_w )
30   AM_RANGE(0x08, 0x08) AM_DEVWRITE("crtc", mc6845_address_w)
31   AM_RANGE(0x09, 0x09) AM_DEVREADWRITE("crtc", mc6845_register_r , mc6845_register_w)
32   AM_RANGE(0x18, 0x18) AM_READ_PORT("DIPSW2")
33   AM_RANGE(0x20, 0x20) AM_READ_PORT("DIPSW3")
34ADDRESS_MAP_END
35 
36/* Input ports */
37INPUT_PORTS_START( zrt80 )
38   PORT_START("DIPSW1")
39      PORT_DIPNAME( 0x01, 0x01, "Composite Sync" )
40      PORT_DIPSETTING(    0x01, "Negative" )
41      PORT_DIPSETTING(    0x00, "Positive" )
42      PORT_DIPNAME( 0x02, 0x02, "Vertical Sync" )
43      PORT_DIPSETTING(    0x02, "Negative" )
44      PORT_DIPSETTING(    0x00, "Positive" )
45      PORT_DIPNAME( 0x04, 0x00, "Video" )
46      PORT_DIPSETTING(    0x04, "Negative" )
47      PORT_DIPSETTING(    0x00, "Positive" )
48      PORT_DIPNAME( 0x08, 0x08, "Keypad" )
49      PORT_DIPSETTING(    0x08, "Numeric" )
50      PORT_DIPSETTING(    0x00, "Alternate Keyboard" )
51      PORT_DIPNAME( 0x10, 0x10, "Horizontal Sync" )
52      PORT_DIPSETTING(    0x10, "Negative" )
53      PORT_DIPSETTING(    0x00, "Positive" ) 
54      PORT_DIPNAME( 0x20, 0x20, "CPU" )
55      PORT_DIPSETTING(    0x20, "Operating" )
56      PORT_DIPSETTING(    0x00, "Reset" )
57      PORT_DIPNAME( 0x40, 0x40, "Keyboard strobe" )
58      PORT_DIPSETTING(    0x40, "Negative" )
59      PORT_DIPSETTING(    0x00, "Positive" )
60      PORT_DIPNAME( 0x80, 0x00, "Beeper" )
61      PORT_DIPSETTING(    0x80, "Silent" )
62      PORT_DIPSETTING(    0x00, "Enable" ) 
63   PORT_START("DIPSW2")
64      PORT_DIPNAME( 0x0f, 0x05, "Baud rate" )
65      PORT_DIPSETTING(    0x00, "50" )
66      PORT_DIPSETTING(    0x01, "75" )
67      PORT_DIPSETTING(    0x02, "110" )
68      PORT_DIPSETTING(    0x03, "134.5" )
69      PORT_DIPSETTING(    0x04, "150" )
70      PORT_DIPSETTING(    0x05, "300" )
71      PORT_DIPSETTING(    0x06, "600" )
72      PORT_DIPSETTING(    0x07, "1200" )
73      PORT_DIPSETTING(    0x08, "1800" )
74      PORT_DIPSETTING(    0x09, "2000" )
75      PORT_DIPSETTING(    0x0a, "2400" )
76      PORT_DIPSETTING(    0x0b, "3600" )
77      PORT_DIPSETTING(    0x0c, "4800" )
78      PORT_DIPSETTING(    0x0d, "7200" )
79      PORT_DIPSETTING(    0x0e, "9600" )
80      PORT_DIPSETTING(    0x0f, "19200" )
81      PORT_DIPNAME( 0x30, 0x20, "Parity" )
82      PORT_DIPSETTING(    0x00, "Odd" )
83      PORT_DIPSETTING(    0x10, "Even" )
84      PORT_DIPSETTING(    0x20, "Marking" )
85      PORT_DIPSETTING(    0x30, "Spacing" )
86      PORT_DIPNAME( 0x40, 0x40, "Handshake" )
87      PORT_DIPSETTING(    0x40, "CTS" )
88      PORT_DIPSETTING(    0x00, "XON/XOFF" )
89      PORT_DIPNAME( 0x80, 0x80, "Line Feed" )
90      PORT_DIPSETTING(    0x80, "No LF on CR" )
91      PORT_DIPSETTING(    0x00, "Auto" ) 
92   PORT_START("DIPSW3")
93      PORT_DIPNAME( 0x07, 0x07, "Video" )
94      PORT_DIPSETTING(    0x00, "96 x 24 15750Hz, 50Hz" )
95      PORT_DIPSETTING(    0x01, "80 x 48 15750Hz, 50Hz" )
96      PORT_DIPSETTING(    0x02, "80 x 24 15750Hz, 50Hz" )       
97      PORT_DIPSETTING(    0x03, "96 x 24 15750Hz, 60Hz" )
98      PORT_DIPSETTING(    0x04, "80 x 48 18700Hz, 50Hz" )
99      PORT_DIPSETTING(    0x05, "80 x 24 17540Hz, 60Hz" )
100      PORT_DIPSETTING(    0x06, "80 x 48 15750Hz, 60Hz" )
101      PORT_DIPSETTING(    0x07, "80 x 24 15750Hz, 60Hz" )
102      PORT_DIPNAME( 0x18, 0x18, "Emulation" )
103      PORT_DIPSETTING(    0x00, "Adds" )
104      PORT_DIPSETTING(    0x08, "Beehive" )
105      PORT_DIPSETTING(    0x10, "LSI ADM-3" )
106      PORT_DIPSETTING(    0x18, "Heath H-19" )
107      PORT_DIPNAME( 0x20, 0x20, "Mode" )
108      PORT_DIPSETTING(    0x20, "Line" )
109      PORT_DIPSETTING(    0x00, "Local" )
110      PORT_DIPNAME( 0x40, 0x40, "Duplex" )
111      PORT_DIPSETTING(    0x40, "Full" )
112      PORT_DIPSETTING(    0x00, "Half" )
113      PORT_DIPNAME( 0x80, 0x80, "Wraparound" )
114      PORT_DIPSETTING(    0x80, "Disabled" )
115      PORT_DIPSETTING(    0x00, "Enabled" ) 
116INPUT_PORTS_END
117 
118 
119static MACHINE_RESET(zrt80) 
120{   
121}
122 
123VIDEO_START( zrt80 )
124{
125}
126 
127static VIDEO_UPDATE( zrt80 )
128{
129   const device_config *mc6845 = devtag_get_device(screen->machine, "crtc");
130   mc6845_update(mc6845, bitmap, cliprect);
131   return 0;
132}
133 
134static MC6845_UPDATE_ROW( zrt80_update_row )
135{
136   UINT8 *charrom = memory_region(device->machine, "chargen");
137 
138   int column, bit;
139 
140   for (column = 0; column < x_count; column++)
141   {
142      UINT8 code = video_ram[ma + column] & 0x7f;
143      UINT16 addr = code << 4 | (ra & 0x0f);
144      UINT8 data = charrom[addr & 0x7ff];
145 
146      for (bit = 0; bit < 8; bit++)
147      {
148         int x = (column * 8) + bit;
149         int color = BIT(data, 7) ? 1 : 0;
150         if (input_port_read(device->machine, "DIPSW1") & 0x04) {
151            color = color ? 0 : 1;
152         }
153             
154         *BITMAP_ADDR16(bitmap, y, x) = color;
155 
156         data <<= 1;
157      }
158   }
159}
160 
161static const mc6845_interface zrt80_crtc6845_interface =
162{
163   "screen",
164   8 /*?*/,
165   NULL,
166   zrt80_update_row,
167   NULL,
168   DEVCB_NULL,
169   DEVCB_NULL,
170   DEVCB_NULL,
171   DEVCB_NULL,
172   NULL
173};
174 
175static INS8250_INTERRUPT( zrt80_com_interrupt )
176{
177   logerror("com int\r\n");
178}
179 
180static const ins8250_interface zrt80_com_interface =
181{
182   2457600,
183   zrt80_com_interrupt,
184   NULL,
185   NULL,
186   NULL
187};
188static MACHINE_DRIVER_START( zrt80 )
189    /* basic machine hardware */
190    MDRV_CPU_ADD("maincpu",Z80, XTAL_2_4576MHz)
191    MDRV_CPU_PROGRAM_MAP(zrt80_mem)
192    MDRV_CPU_IO_MAP(zrt80_io)   
193 
194    MDRV_MACHINE_RESET(zrt80)
195   
196    /* video hardware */
197    /* video hardware */
198   MDRV_SCREEN_ADD("screen", RASTER)
199   MDRV_SCREEN_REFRESH_RATE(60)
200   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
201   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
202   MDRV_SCREEN_SIZE(640, 200)
203   MDRV_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 200 - 1)
204   MDRV_PALETTE_LENGTH(2)
205   MDRV_PALETTE_INIT(black_and_white)
206 
207   MDRV_MC6845_ADD("crtc", MC6845, XTAL_20MHz / 8, zrt80_crtc6845_interface) 
208 
209    MDRV_VIDEO_START(zrt80)
210    MDRV_VIDEO_UPDATE(zrt80)
211     
212    MDRV_INS8250_ADD( "ins8250", zrt80_com_interface )
213MACHINE_DRIVER_END
214 
215static SYSTEM_CONFIG_START(zrt80)
216SYSTEM_CONFIG_END
217 
218/* ROM definition */
219ROM_START( zrt80 )
220    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
221   ROM_LOAD( "zrt80mon.z25", 0x0000, 0x1000, CRC(e6ea96dc) SHA1(e3075e30bb2b85f9288d0b8b8cdf1d2b4f7586fd))
222   //z24 is 2nd chip, used as expansion
223   ROM_REGION( 0x0800, "chargen", 0 )
224   ROM_LOAD( "zrt80chr.z30", 0x0000, 0x0800, CRC(4dbdc60f) SHA1(20e393f7207a8440029c8290cdf2f121d317a37e))
225ROM_END
226 
227/* Driver */
228 
229/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY   FULLNAME       FLAGS */
230COMP( 1982, zrt80,  0,       0,    zrt80,    zrt80,     0,       zrt80,      "Digital Research Computers",   "ZRT-80",      GAME_NOT_WORKING)
231 
1/***************************************************************************
2   
3        DEC ZRT-80
4
5        12/05/2009 Skeleton driver.
6
7****************************************************************************/
8
9#include "driver.h"
10#include "cpu/z80/z80.h"
11#include "video/mc6845.h"
12#include "machine/ins8250.h"
13
14static UINT8 *video_ram;
15
16static ADDRESS_MAP_START(zrt80_mem, ADDRESS_SPACE_PROGRAM, 8)
17   ADDRESS_MAP_UNMAP_HIGH
18   AM_RANGE(0x0000, 0x0fff) AM_ROM // Z25 - Main firmware
19   AM_RANGE(0x1000, 0x1fff) AM_ROM // Z24 - Expansion
20   AM_RANGE(0x4000, 0x43ff) AM_RAM   // Board RAM
21   // Normaly video RAM is 0x800 but could be expanded up to 8K
22   AM_RANGE(0xc000, 0xdfff) AM_RAM    AM_BASE(&video_ram) // Video RAM
23   
24ADDRESS_MAP_END
25
26static ADDRESS_MAP_START( zrt80_io , ADDRESS_SPACE_IO, 8)
27   ADDRESS_MAP_UNMAP_HIGH
28   ADDRESS_MAP_GLOBAL_MASK(0xff)
29   AM_RANGE(0x00, 0x07) AM_DEVREADWRITE("ins8250", ins8250_r, ins8250_w )
30   AM_RANGE(0x08, 0x08) AM_DEVWRITE("crtc", mc6845_address_w)
31   AM_RANGE(0x09, 0x09) AM_DEVREADWRITE("crtc", mc6845_register_r , mc6845_register_w)
32   AM_RANGE(0x18, 0x18) AM_READ_PORT("DIPSW2")
33   AM_RANGE(0x20, 0x20) AM_READ_PORT("DIPSW3")
34ADDRESS_MAP_END
35
36/* Input ports */
37static INPUT_PORTS_START( zrt80 )
38   PORT_START("DIPSW1")
39      PORT_DIPNAME( 0x01, 0x01, "Composite Sync" )
40      PORT_DIPSETTING(    0x01, "Negative" )
41      PORT_DIPSETTING(    0x00, "Positive" )
42      PORT_DIPNAME( 0x02, 0x02, "Vertical Sync" )
43      PORT_DIPSETTING(    0x02, "Negative" )
44      PORT_DIPSETTING(    0x00, "Positive" )
45      PORT_DIPNAME( 0x04, 0x00, "Video" )
46      PORT_DIPSETTING(    0x04, "Negative" )
47      PORT_DIPSETTING(    0x00, "Positive" )
48      PORT_DIPNAME( 0x08, 0x08, "Keypad" )
49      PORT_DIPSETTING(    0x08, "Numeric" )
50      PORT_DIPSETTING(    0x00, "Alternate Keyboard" )
51      PORT_DIPNAME( 0x10, 0x10, "Horizontal Sync" )
52      PORT_DIPSETTING(    0x10, "Negative" )
53      PORT_DIPSETTING(    0x00, "Positive" )
54      PORT_DIPNAME( 0x20, 0x20, "CPU" )
55      PORT_DIPSETTING(    0x20, "Operating" )
56      PORT_DIPSETTING(    0x00, "Reset" )
57      PORT_DIPNAME( 0x40, 0x40, "Keyboard strobe" )
58      PORT_DIPSETTING(    0x40, "Negative" )
59      PORT_DIPSETTING(    0x00, "Positive" )
60      PORT_DIPNAME( 0x80, 0x00, "Beeper" )
61      PORT_DIPSETTING(    0x80, "Silent" )
62      PORT_DIPSETTING(    0x00, "Enable" )
63   PORT_START("DIPSW2")
64      PORT_DIPNAME( 0x0f, 0x05, "Baud rate" )
65      PORT_DIPSETTING(    0x00, "50" )
66      PORT_DIPSETTING(    0x01, "75" )
67      PORT_DIPSETTING(    0x02, "110" )
68      PORT_DIPSETTING(    0x03, "134.5" )
69      PORT_DIPSETTING(    0x04, "150" )
70      PORT_DIPSETTING(    0x05, "300" )
71      PORT_DIPSETTING(    0x06, "600" )
72      PORT_DIPSETTING(    0x07, "1200" )
73      PORT_DIPSETTING(    0x08, "1800" )
74      PORT_DIPSETTING(    0x09, "2000" )
75      PORT_DIPSETTING(    0x0a, "2400" )
76      PORT_DIPSETTING(    0x0b, "3600" )
77      PORT_DIPSETTING(    0x0c, "4800" )
78      PORT_DIPSETTING(    0x0d, "7200" )
79      PORT_DIPSETTING(    0x0e, "9600" )
80      PORT_DIPSETTING(    0x0f, "19200" )
81      PORT_DIPNAME( 0x30, 0x20, "Parity" )
82      PORT_DIPSETTING(    0x00, "Odd" )
83      PORT_DIPSETTING(    0x10, "Even" )
84      PORT_DIPSETTING(    0x20, "Marking" )
85      PORT_DIPSETTING(    0x30, "Spacing" )
86      PORT_DIPNAME( 0x40, 0x40, "Handshake" )
87      PORT_DIPSETTING(    0x40, "CTS" )
88      PORT_DIPSETTING(    0x00, "XON/XOFF" )
89      PORT_DIPNAME( 0x80, 0x80, "Line Feed" )
90      PORT_DIPSETTING(    0x80, "No LF on CR" )
91      PORT_DIPSETTING(    0x00, "Auto" )
92   PORT_START("DIPSW3")
93      PORT_DIPNAME( 0x07, 0x07, "Video" )
94      PORT_DIPSETTING(    0x00, "96 x 24 15750Hz, 50Hz" )
95      PORT_DIPSETTING(    0x01, "80 x 48 15750Hz, 50Hz" )
96      PORT_DIPSETTING(    0x02, "80 x 24 15750Hz, 50Hz" )     
97      PORT_DIPSETTING(    0x03, "96 x 24 15750Hz, 60Hz" )
98      PORT_DIPSETTING(    0x04, "80 x 48 18700Hz, 50Hz" )
99      PORT_DIPSETTING(    0x05, "80 x 24 17540Hz, 60Hz" )
100      PORT_DIPSETTING(    0x06, "80 x 48 15750Hz, 60Hz" )
101      PORT_DIPSETTING(    0x07, "80 x 24 15750Hz, 60Hz" )
102      PORT_DIPNAME( 0x18, 0x18, "Emulation" )
103      PORT_DIPSETTING(    0x00, "Adds" )
104      PORT_DIPSETTING(    0x08, "Beehive" )
105      PORT_DIPSETTING(    0x10, "LSI ADM-3" )
106      PORT_DIPSETTING(    0x18, "Heath H-19" )
107      PORT_DIPNAME( 0x20, 0x20, "Mode" )
108      PORT_DIPSETTING(    0x20, "Line" )
109      PORT_DIPSETTING(    0x00, "Local" )
110      PORT_DIPNAME( 0x40, 0x40, "Duplex" )
111      PORT_DIPSETTING(    0x40, "Full" )
112      PORT_DIPSETTING(    0x00, "Half" )
113      PORT_DIPNAME( 0x80, 0x80, "Wraparound" )
114      PORT_DIPSETTING(    0x80, "Disabled" )
115      PORT_DIPSETTING(    0x00, "Enabled" )
116INPUT_PORTS_END
117
118
119static MACHINE_RESET(zrt80)
120{   
121}
122
123static VIDEO_START( zrt80 )
124{
125}
126
127static VIDEO_UPDATE( zrt80 )
128{
129   const device_config *mc6845 = devtag_get_device(screen->machine, "crtc");
130   mc6845_update(mc6845, bitmap, cliprect);
131   return 0;
132}
133
134static MC6845_UPDATE_ROW( zrt80_update_row )
135{
136   UINT8 *charrom = memory_region(device->machine, "chargen");
137
138   int column, bit;
139
140   for (column = 0; column < x_count; column++)
141   {
142      UINT8 code = video_ram[ma + column] & 0x7f;
143      UINT16 addr = code << 4 | (ra & 0x0f);
144      UINT8 data = charrom[addr & 0x7ff];
145
146      for (bit = 0; bit < 8; bit++)
147      {
148         int x = (column * 8) + bit;
149         int color = BIT(data, 7) ? 1 : 0;
150         if (input_port_read(device->machine, "DIPSW1") & 0x04) {
151            color = color ? 0 : 1;
152         }
153           
154         *BITMAP_ADDR16(bitmap, y, x) = color;
155
156         data <<= 1;
157      }
158   }
159}
160
161static const mc6845_interface zrt80_crtc6845_interface =
162{
163   "screen",
164   8 /*?*/,
165   NULL,
166   zrt80_update_row,
167   NULL,
168   DEVCB_NULL,
169   DEVCB_NULL,
170   DEVCB_NULL,
171   DEVCB_NULL,
172   NULL
173};
174
175static INS8250_INTERRUPT( zrt80_com_interrupt )
176{
177   logerror("com int\r\n");
178}
179
180static const ins8250_interface zrt80_com_interface =
181{
182   2457600,
183   zrt80_com_interrupt,
184   NULL,
185   NULL,
186   NULL
187};
188static MACHINE_DRIVER_START( zrt80 )
189    /* basic machine hardware */
190    MDRV_CPU_ADD("maincpu",Z80, XTAL_2_4576MHz)
191    MDRV_CPU_PROGRAM_MAP(zrt80_mem)
192    MDRV_CPU_IO_MAP(zrt80_io)   
193
194    MDRV_MACHINE_RESET(zrt80)
195   
196    /* video hardware */
197    /* video hardware */
198   MDRV_SCREEN_ADD("screen", RASTER)
199   MDRV_SCREEN_REFRESH_RATE(60)
200   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
201   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
202   MDRV_SCREEN_SIZE(640, 200)
203   MDRV_SCREEN_VISIBLE_AREA(0, 640 - 1, 0, 200 - 1)
204   MDRV_PALETTE_LENGTH(2)
205   MDRV_PALETTE_INIT(black_and_white)
206
207   MDRV_MC6845_ADD("crtc", MC6845, XTAL_20MHz / 8, zrt80_crtc6845_interface)
208
209    MDRV_VIDEO_START(zrt80)
210    MDRV_VIDEO_UPDATE(zrt80)
211   
212    MDRV_INS8250_ADD( "ins8250", zrt80_com_interface )
213MACHINE_DRIVER_END
214
215static SYSTEM_CONFIG_START(zrt80)
216SYSTEM_CONFIG_END
217
218/* ROM definition */
219ROM_START( zrt80 )
220    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
221   ROM_LOAD( "zrt80mon.z25", 0x0000, 0x1000, CRC(e6ea96dc) SHA1(e3075e30bb2b85f9288d0b8b8cdf1d2b4f7586fd))
222   //z24 is 2nd chip, used as expansion
223   ROM_REGION( 0x0800, "chargen", 0 )
224   ROM_LOAD( "zrt80chr.z30", 0x0000, 0x0800, CRC(4dbdc60f) SHA1(20e393f7207a8440029c8290cdf2f121d317a37e))
225ROM_END
226
227/* Driver */
228
229/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY   FULLNAME       FLAGS */
230COMP( 1982, zrt80,  0,       0,    zrt80,    zrt80,     0,       zrt80,      "Digital Research Computers",   "ZRT-80",      GAME_NOT_WORKING)
231
docs/messnew.txt
r5060r5061
6060
6161- Added natural keyboard support to KR2376.  [Roberto Lavarone]
6262
63- Static/const/include improvements.  [Atari Ace]
6364
6465
66
65670.132
6668
6769New System Drivers Supported (in no particular order):

Previous 15994 Revisions Next


© 1998-2018 The MESS Team