Previous 15994 Revisions Next

r6135 Monday 19th October, 2009 at 09:53:45 UTC by Nathan Woods
Cleanups to add static/const qualifiers, and to remove dead prototypes and code
[Atari Ace]
[docs]messnew.txt
[src/mess/devices]cococart.h flopdrv.c flopdrv.h
[src/mess/drivers]4004clk.c apple2.c at.c busicom.c cdi.c cgenie.c dc.c dectalk.c ec65.c einstein.c esq1.c fk1.c fm7.c fmtowns.c gba.c hx20.c junior.c mac.c mc10.c nanos.c osborne1.c p8k.c pippin.c pk8000.c pyl601.c samcoupe.c socrates.c vboy.c vt220.c vt320.c vt520.c x1.c x68k.c xerox820.c
[src/mess/formats]td0_dsk.c
[src/mess/includes]nes.h
[src/mess/machine]994x_ser.c amstr_pc.c beta.h dc.c i8212.c i8212.h nes_mmc.c nes_mmc.h samcoupe.c smartmed.c sms.c ti99pcod.c upd71071.c wd17xx.h
[src/mess/tools/imgtool/modules]amiga.c
[src/mess/tools/messtest]tststubs.c
[src/mess/video]apple1.c coco.c coco3.c fm7.c gba.c pc_vga.c vic6567.h

src/mess/devices/cococart.h
r6134r6135
2626#define COCO_CARTRIDGE_PCB_PAK_BANKED16K         DEVICE_GET_INFO_NAME(coco_cartridge_pcb_pak_banked16k)
2727#define COCO_CARTRIDGE_PCB_ORCH90               DEVICE_GET_INFO_NAME(coco_cartridge_pcb_orch90)
2828#define COCO_CARTRIDGE_PCB_RS232               DEVICE_GET_INFO_NAME(coco_cartridge_pcb_rs232)
29#define COCO_CARTRIDGE_PCB_SSC                  DEVICE_GET_INFO_NAME(coco_cartridge_pcb_speechsound)
3029
3130enum
3231{
r6134r6135
8584DEVICE_GET_INFO(coco_cartridge_pcb_pak_banked16k);
8685DEVICE_GET_INFO(coco_cartridge_pcb_orch90);
8786DEVICE_GET_INFO(coco_cartridge_pcb_rs232);
88DEVICE_GET_INFO(coco_cartridge_pcb_speechsound);
8987
9088/* sets a cartridge line */
9189void coco_cartridge_set_line(const device_config *device, cococart_line line, cococart_line_value value);
src/mess/devices/flopdrv.c
r6134r6135
234234   image_fsize_thunk
235235};
236236
237void floppy_drive_set_geometry_absolute(const device_config *img, int tracks, int sides)
237static void floppy_drive_set_geometry_absolute(const device_config *img, int tracks, int sides)
238238{
239239   floppy_drive *pDrive = get_safe_token( img );
240240   pDrive->max_track = tracks;
r6134r6135
266266static TIMER_CALLBACK(floppy_drive_index_callback);
267267
268268/* this is called on device init */
269void floppy_drive_init(const device_config *img)
269static void floppy_drive_init(const device_config *img)
270270{
271271   floppy_drive *pDrive = get_safe_token( img );
272272
src/mess/devices/flopdrv.h
r6134r6135
142142WRITE_LINE_DEVICE_HANDLER( floppy_ds3_w );
143143WRITE8_DEVICE_HANDLER( floppy_ds_w );
144144
145READ_LINE_DEVICE_HANDLER( floppy_idx_r );
146WRITE_LINE_DEVICE_HANDLER( floppy_mon_w );
147145WRITE_LINE_DEVICE_HANDLER( floppy_drtn_w );
148146WRITE_LINE_DEVICE_HANDLER( floppy_stp_w );
149147WRITE_LINE_DEVICE_HANDLER( floppy_wtd_w );
150148WRITE_LINE_DEVICE_HANDLER( floppy_wtg_w );
151READ_LINE_DEVICE_HANDLER( floppy_tk00_r );
152149READ_LINE_DEVICE_HANDLER( floppy_wpt_r );
153READ_LINE_DEVICE_HANDLER( floppy_rdy_r );
154150
155151#define FLOPPY   DEVICE_GET_INFO_NAME(floppy)
156152DEVICE_GET_INFO(floppy);
src/mess/tools/messtest/tststubs.c
r6134r6135
5353
5454
5555
56//============================================================
57//  osd_is_bad_read_ptr
58//============================================================
59
60int osd_is_bad_read_ptr(const void *ptr, size_t size)
61{
62#ifdef WIN32
63   return IsBadReadPtr(ptr, size);
64#else
65   return !ptr;
66#endif
67}
68
69
7056void osd_get_emulator_directory(char *dir, size_t dir_size)
7157{
7258}
src/mess/tools/imgtool/modules/amiga.c
r6134r6135
292292
293293
294294/* Returns TRUE if year is a leap year */
295int is_leap(int year)
295static int is_leap(int year)
296296{
297297   return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
298298}
r6134r6135
339339
340340
341341/* convert standard time to amiga time */
342void amiga_setup_time(time_t time, amiga_date *dest)
342static void amiga_setup_time(time_t time, amiga_date *dest)
343343{
344344   struct tm t = *localtime(&time);
345345   int year;
r6134r6135
358358
359359
360360/* convert flags to human readable form */
361void amiga_decode_flags(UINT32 flags, char *dest)
361static void amiga_decode_flags(UINT32 flags, char *dest)
362362{
363363   /* test for flags */
364364   dest[0] = (flags & 0x80) ? 'h' : '-';
r6134r6135
373373}
374374
375375
376void copy_integer_array_be(UINT32 *dest, const UINT32 *source, int size)
376static void copy_integer_array_be(UINT32 *dest, const UINT32 *source, int size)
377377{
378378   int i;
379379
r6134r6135
385385
386386
387387/* This function converts an array of UINT32s to an amiga_date */
388void copy_date_be(amiga_date *dest, const UINT32 *source)
388static void copy_date_be(amiga_date *dest, const UINT32 *source)
389389{
390390   dest->days  = BIG_ENDIANIZE_INT32(source[0]);
391391   dest->mins  = BIG_ENDIANIZE_INT32(source[1]);
r6134r6135
394394
395395
396396/* Calculate the block checksum of a byte array */
397UINT32 block_checksum(UINT8 *buffer, int length)
397static UINT32 block_checksum(UINT8 *buffer, int length)
398398{
399399   UINT32 chksum = 0;
400400   int i;
r6134r6135
23372337*****************************************************************************/
23382338
23392339
2340OPTION_GUIDE_START(amiga_createimage_optionguide)
2340static OPTION_GUIDE_START(amiga_createimage_optionguide)
23412341   OPTION_STRING( 'N', "name", "Volume name" )
23422342   OPTION_ENUM_START( 'S', "density", "Density" )
23432343      OPTION_ENUM( 0, "dd", "Double Density" )
src/mess/video/coco.c
r6134r6135
2929 *
3030 *************************************/
3131
32ATTR_CONST UINT8 coco_get_attributes_2(running_machine *machine, UINT8 c, int scanline, int pos)
32static ATTR_CONST UINT8 coco_get_attributes_2(running_machine *machine, UINT8 c, int scanline, int pos)
3333{
3434   coco_state *state = machine->driver_data;
3535   UINT8 result = 0x00;
src/mess/video/pc_vga.c
r6134r6135
11621162WRITE16_HANDLER( vga_port16le_03d0_w ) { write16le_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); }
11631163
11641164/* 32 bit */
1165READ32_HANDLER( vga_port32le_03b0_r ) { return read32le_with_read8_handler(vga_port_03b0_r, space, offset, mem_mask); }
1166READ32_HANDLER( vga_port32le_03c0_r ) { return read32le_with_read8_handler(vga_port_03c0_r, space, offset, mem_mask); }
1167READ32_HANDLER( vga_port32le_03d0_r ) { return read32le_with_read8_handler(vga_port_03d0_r, space, offset, mem_mask); }
1165static READ32_HANDLER( vga_port32le_03b0_r ) { return read32le_with_read8_handler(vga_port_03b0_r, space, offset, mem_mask); }
1166static READ32_HANDLER( vga_port32le_03c0_r ) { return read32le_with_read8_handler(vga_port_03c0_r, space, offset, mem_mask); }
1167static READ32_HANDLER( vga_port32le_03d0_r ) { return read32le_with_read8_handler(vga_port_03d0_r, space, offset, mem_mask); }
11681168
1169WRITE32_HANDLER( vga_port32le_03b0_w ) { write32le_with_write8_handler(vga_port_03b0_w, space, offset, data, mem_mask); }
1170WRITE32_HANDLER( vga_port32le_03c0_w ) { write32le_with_write8_handler(vga_port_03c0_w, space, offset, data, mem_mask); }
1171WRITE32_HANDLER( vga_port32le_03d0_w ) { write32le_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); }
1169static WRITE32_HANDLER( vga_port32le_03b0_w ) { write32le_with_write8_handler(vga_port_03b0_w, space, offset, data, mem_mask); }
1170static WRITE32_HANDLER( vga_port32le_03c0_w ) { write32le_with_write8_handler(vga_port_03c0_w, space, offset, data, mem_mask); }
1171static WRITE32_HANDLER( vga_port32le_03d0_w ) { write32le_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); }
11721172
11731173/* 64 bit */
11741174static READ64_HANDLER( vga_port64be_03b0_r ) { return read64be_with_read8_handler(vga_port_03b0_r, space, offset, mem_mask); }
src/mess/video/apple1.c
r6134r6135
194194   terminal_fill(terminal, terminal->blank_char);
195195}
196196
197struct terminal *terminal_create(
197static struct terminal *terminal_create(
198198   running_machine *machine,
199199   int gfx, int blank_char, int char_bits,
200200   int (*getcursorcode)(int original_code),
src/mess/video/coco3.c
r6134r6135
469469
470470
471471
472int coco3_new_frame(running_machine *machine)
472static int coco3_new_frame(running_machine *machine)
473473{
474474   int gime_field_sync = 0;
475475
src/mess/video/vic6567.h
r6134r6135
130130MACHINE_DRIVER_EXTERN( vh_vic2_pal );
131131extern VIDEO_START( vic2 );
132132extern VIDEO_UPDATE( vic2 );
133extern INTERRUPT_GEN( vic2_raster_irq );
133// extern INTERRUPT_GEN( vic2_raster_irq );
134134// extern emu_timer *vicii_scanline_timer;
135135// extern TIMER_CALLBACK( vicii_scanline_interrupt );
136136
src/mess/video/gba.c
r6134r6135
4949#include "gbamode2.c"
5050#include "gbam345.c"
5151
52void (*gba_draw_scanline_modes[8][3])(running_machine *machine, gba_state *gba_state, int y, UINT32* line0, UINT32* line1, UINT32* line2, UINT32* line3, UINT32* lineOBJ, UINT32* lineOBJWin, UINT32* lineMix, int aux) =
52static void (*const gba_draw_scanline_modes[8][3])(running_machine *machine, gba_state *gba_state, int y, UINT32* line0, UINT32* line1, UINT32* line2, UINT32* line3, UINT32* lineOBJ, UINT32* lineOBJWin, UINT32* lineMix, int aux) =
5353{
5454   /* All modes have three sub-modes: No effects, effects, and windowed effects. */
5555   {   /* Mode 0: 4 non-rotatable tilemaps and 1 OAM layer */
src/mess/video/fm7.c
r6134r6135
1010
1111struct fm7_video_flags fm7_video;
1212
13struct fm7_alu_flags
13static struct fm7_alu_flags
1414{
1515   UINT8 command;
1616   UINT8 lcolour;
r6134r6135
733733}
734734
735735// not pretty, but it should work.
736WRITE8_HANDLER( fm7_vram_banked_w )
736static WRITE8_HANDLER( fm7_vram_banked_w )
737737{
738738   int offs;
739739   UINT16 page = 0x0000;
src/mess/includes/nes.h
r6134r6135
104104void nes_partialhash(char *dest, const unsigned char *data,
105105   unsigned long length, unsigned int functions);
106106
107//TEMPORARY PPU STUFF
108
109/* mirroring types */
110#define PPU_MIRROR_NONE      0
111#define PPU_MIRROR_VERT      1
112#define PPU_MIRROR_HORZ      2
113#define PPU_MIRROR_HIGH      3
114#define PPU_MIRROR_LOW      4
115#define PPU_MIRROR_4SCREEN   5   // Same effect as NONE, but signals that we should never mirror
116
117void set_nt_mirroring(int mirroring );
118
119
120107/*----------- defined in video/nes.c -----------*/
121108
122109extern int nes_vram_sprite[8];
src/mess/machine/smartmed.c
r6134r6135
113113/*
114114    Init a SmartMedia image
115115*/
116DEVICE_START( smartmedia )
116static DEVICE_START( smartmedia )
117117{
118118   smartmedia_t *sm = get_safe_token(device);
119119
r6134r6135
136136/*
137137    Load a SmartMedia image
138138*/
139DEVICE_IMAGE_LOAD( smartmedia )
139static DEVICE_IMAGE_LOAD( smartmedia )
140140{
141141   smartmedia_t *sm = get_safe_token(image);
142142   disk_image_header custom_header;
r6134r6135
180180/*
181181    Unload a SmartMedia image
182182*/
183DEVICE_IMAGE_UNLOAD( smartmedia )
183static DEVICE_IMAGE_UNLOAD( smartmedia )
184184{
185185   smartmedia_t *sm = get_safe_token(image);
186186
src/mess/machine/upd71071.c
r6134r6135
196196   dmac->selected_channel = 0;
197197}
198198
199READ8_DEVICE_HANDLER(upd71071_read)
199static READ8_DEVICE_HANDLER(upd71071_read)
200200{
201201   upd71071_t* dmac = device->token;
202202   UINT8 ret = 0;
r6134r6135
267267   return ret;
268268}
269269
270WRITE8_DEVICE_HANDLER(upd71071_write)
270static WRITE8_DEVICE_HANDLER(upd71071_write)
271271{
272272   upd71071_t* dmac = device->token;
273273
src/mess/machine/sms.c
r6134r6135
179179
180180/* FIXME: this function is a hack. For Light Phaser X pos sms_vdp_hcount_latch
181181 function should be used instead, but emulation (timming?) needs to improve. */
182void sms_vdp_hcount_lphaser( running_machine *machine, int hpos)
182static void sms_vdp_hcount_lphaser( running_machine *machine, int hpos)
183183{
184184   UINT8 tmp = ((hpos - 46) >> 1) & 0xff;
185185   const device_config *smsvdp = devtag_get_device(machine, "sms_vdp");
src/mess/machine/wd17xx.h
r6134r6135
8888READ8_DEVICE_HANDLER( wd17xx_r );
8989WRITE8_DEVICE_HANDLER( wd17xx_w );
9090
91WRITE_LINE_DEVICE_HANDLER( wd17xx_mr_w );
9192WRITE_LINE_DEVICE_HANDLER( wd17xx_rdy_w );
9293READ_LINE_DEVICE_HANDLER( wd17xx_mo_r );
9394WRITE_LINE_DEVICE_HANDLER( wd17xx_tr00_w );
src/mess/machine/samcoupe.c
r6134r6135
172172    MOUSE
173173***************************************************************************/
174174
175TIMER_CALLBACK( samcoupe_mouse_reset )
175static TIMER_CALLBACK( samcoupe_mouse_reset )
176176{
177177   coupe_asic *asic = machine->driver_data;
178178   asic->mouse_index = 0;
src/mess/machine/amstr_pc.c
r6134r6135
212212   return data;
213213}
214214
215READ8_HANDLER( pc200_port278_r )
215static READ8_HANDLER( pc200_port278_r )
216216{
217217   const device_config *lpt = devtag_get_device(space->machine, "lpt_2");
218218   UINT8 data = pc_lpt_r(lpt, offset);
src/mess/machine/994x_ser.c
r6134r6135
426426   if (rs232_fp)
427427      image_fwrite(rs232_fp, &buf, 1);
428428}
429const tms9902_interface tms9902_params_0 =
429static const tms9902_interface tms9902_params_0 =
430430{
431431   3000000.,            /* clock rate (3MHz) */
432432   int_callback_0,         /* called when interrupt pin state changes */
r6134r6135
435435   xmit_callback_0         /* called when a character is transmitted */
436436};
437437
438const tms9902_interface tms9902_params_1 =
438static const tms9902_interface tms9902_params_1 =
439439{
440440   3000000.,            /* clock rate (3MHz) */
441441   int_callback_1,         /* called when interrupt pin state changes */
r6134r6135
444444   xmit_callback_1         /* called when a character is transmitted */
445445};
446446
447DEVICE_GET_INFO( ti99_4_rs232 )
447static DEVICE_GET_INFO( ti99_4_rs232 )
448448{
449449   switch ( state )
450450   {
r6134r6135
469469   }
470470}
471471
472DEVICE_GET_INFO( ti99_4_rs232 );
472static DEVICE_GET_INFO( ti99_4_rs232 );
473473
474474#define TI99_4_RS232   DEVICE_GET_INFO_NAME(ti99_4_rs232)
475475
src/mess/machine/i8212.c
r6134r6135
8989    i8212_md_w - mode write
9090-------------------------------------------------*/
9191
92#ifdef UNUSED_FUNCTION
9293WRITE_LINE_DEVICE_HANDLER( i8212_md_w )
9394{
9495   i8212_t *i8212 = get_safe_token(device);
r6134r6135
9798
9899   i8212->md = state;
99100}
101#endif
100102
101103/*-------------------------------------------------
102104    i8212_stb_w - strobe write
src/mess/machine/i8212.h
r6134r6135
7070READ8_DEVICE_HANDLER( i8212_r );
7171WRITE8_DEVICE_HANDLER( i8212_w );
7272
73/* mode */
74WRITE_LINE_DEVICE_HANDLER( i8212_mode_w );
75
7673/* strobe */
7774WRITE_LINE_DEVICE_HANDLER( i8212_stb_w );
7875
src/mess/machine/nes_mmc.c
r6134r6135
201201
202202static UINT8 MMC2_regs[4];   // these replace bank0/bank0_hi/bank1/bank1_hi
203203
204UINT8* extended_ntram;
204static UINT8* extended_ntram;
205205
206206
207207static int MMC5_rom_bank_mode;
src/mess/machine/dc.c
r6134r6135
523523    }
524524}
525525
526void dreamcast_atapi_exit(running_machine* machine)
526static void dreamcast_atapi_exit(running_machine* machine)
527527{
528528   if (gdrom_device != NULL)
529529   {
src/mess/machine/nes_mmc.h
r6134r6135
7070WRITE8_HANDLER( fds_w );
7171WRITE8_HANDLER( mapper50_add_w );
7272
73//TEMPORARY PPU STUFF
74
75/* mirroring types */
76#define PPU_MIRROR_NONE      0
77#define PPU_MIRROR_VERT      1
78#define PPU_MIRROR_HORZ      2
79#define PPU_MIRROR_HIGH      3
80#define PPU_MIRROR_LOW      4
81#define PPU_MIRROR_4SCREEN   5   // Same effect as NONE, but signals that we should never mirror
82
83void set_nt_mirroring(int mirroring);
84
85
7386#endif
src/mess/machine/beta.h
r6134r6135
1616void betadisk_disable(const device_config *device);
1717void betadisk_clear_status(const device_config *device);
1818
19void beta_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info);
20
2119#define BETA_DISK_TAG   "beta"
2220
2321#define BETA_DISK DEVICE_GET_INFO_NAME( beta_disk )
src/mess/machine/ti99pcod.c
r6134r6135
8181    Pointer to the pcode ROM data. We have three sections of the ROM
8282    code: 4K from one chip, 2 banks with 4K each from the second chip.
8383*/
84UINT8 *ti99_pcode_rom0;
85UINT8 *ti99_pcode_rom1;
86UINT8 *ti99_pcode_rom2;
87UINT8 *ti99_pcode_grom;
84static UINT8 *ti99_pcode_rom0;
85static UINT8 *ti99_pcode_rom1;
86static UINT8 *ti99_pcode_rom2;
87static UINT8 *ti99_pcode_grom;
8888
8989static READ8_HANDLER(pcode_mem_r);
9090static WRITE8_HANDLER(pcode_mem_w);
src/mess/formats/td0_dsk.c
r6134r6135
254254static floppy_image *floppy_file;
255255static UINT64 floppy_file_offset;
256256
257int data_read(UINT8 *buf,UINT16 size)
257static int data_read(UINT8 *buf,UINT16 size)
258258{
259259   if (floppy_file_offset + size > floppy_image_size(floppy_file) ) {
260260      size = floppy_image_size(floppy_file)- floppy_file_offset;
r6134r6135
378378 * pointing parent nodes.
379379 * area [T..(T + N_CHAR - 1)] are pointers for leaves
380380 */
381INT16 prnt[T + N_CHAR];
381static INT16 prnt[T + N_CHAR];
382382
383383/* pointing children nodes (son[], son[] + 1)*/
384INT16 son[T];
384static INT16 son[T];
385385
386386static UINT16 getbuf;
387387static UINT8 getlen;
src/mess/drivers/dectalk.c
r6134r6135
314314   dectalk.duart_outport = 0;
315315}
316316
317MACHINE_RESET( dectalk )
317static MACHINE_RESET( dectalk )
318318{
319319   /* hook the RESET line, which resets a slew of other components */
320320   m68k_set_reset_callback(cputag_get_cpu(machine, "maincpu"), dectalk_reset);
321321}
322322
323323/* Begin 68k i/o handlers */
324READ8_HANDLER( nvram_read ) // read from x2212 nvram chip and possibly do recall
324static READ8_HANDLER( nvram_read ) // read from x2212 nvram chip and possibly do recall
325325{
326326   UINT8 data = 0xFF;
327327   data = dectalk.nvram_local[offset&0xff]; // TODO: should this be before or after a possible /RECALL? I'm guessing before.
r6134r6135
333333   return data;
334334}
335335
336WRITE8_HANDLER( led_write )
336static WRITE8_HANDLER( led_write )
337337{
338338   dectalk.statusLED = data&0xFF;
339339   popmessage("LED status: %02X\n", data&0xFF);
r6134r6135
343343   //popmessage("LED status: %x %x %x %x %x %x %x %x\n", data&0x80, data&0x40, data&0x20, data&0x10, data&0x8, data&0x4, data&0x2, data&0x1);
344344}
345345
346WRITE8_HANDLER( nvram_write ) // write to X2212 NVRAM chip and possibly do store
346static WRITE8_HANDLER( nvram_write ) // write to X2212 NVRAM chip and possibly do store
347347{
348348#ifdef NVRAM_LOG
349349   logerror("m68k: nvram write at %08X: %02X\n", offset, data&0x0f);
r6134r6135
353353   dectalk_x2212_store(space->machine);
354354}
355355
356WRITE16_HANDLER( m68k_infifo_w ) // 68k write to the speech input fifo
356static WRITE16_HANDLER( m68k_infifo_w ) // 68k write to the speech input fifo
357357{
358358#ifdef USE_LOOSE_TIMING
359359   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(25));
r6134r6135
374374   dectalk.infifo_head_ptr&=0x1F;
375375}
376376
377READ16_HANDLER( m68k_spcflags_r ) // 68k read from the speech flags
377static READ16_HANDLER( m68k_spcflags_r ) // 68k read from the speech flags
378378{
379379   UINT8 data = 0;
380380   data |= dectalk.m68k_spcflags_latch; // bits 0 and 6
r6134r6135
386386   return data;
387387}
388388
389WRITE16_HANDLER( m68k_spcflags_w ) // 68k write to the speech flags (only 3 bits do anything)
389static WRITE16_HANDLER( m68k_spcflags_w ) // 68k write to the speech flags (only 3 bits do anything)
390390{
391391#ifdef USE_LOOSE_TIMING
392392   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(25));
r6134r6135
445445   }
446446}
447447
448READ16_HANDLER( m68k_tlcflags_r ) // dtmf flags read
448static READ16_HANDLER( m68k_tlcflags_r ) // dtmf flags read
449449{
450450   UINT16 data = 0;
451451   data |= dectalk.m68k_tlcflags_latch; // bits 6, 8, 14;
r6134r6135
457457   return data;
458458}
459459
460WRITE16_HANDLER( m68k_tlcflags_w ) // dtmf flags write
460static WRITE16_HANDLER( m68k_tlcflags_w ) // dtmf flags write
461461{
462462#ifdef TLC_LOG
463463   logerror("m68k: TLC flags written with %04X, only storing %04X\n",data, data&0x4140);
r6134r6135
519519   }
520520}
521521
522READ16_HANDLER( m68k_tlc_dtmf_r ) // dtmf chip read
522static READ16_HANDLER( m68k_tlc_dtmf_r ) // dtmf chip read
523523{
524524   UINT16 data = 0xFFFF;
525525   data = dectalk.tlc_dtmf&0xF;
r6134r6135
531531/* End 68k i/o handlers */
532532
533533/* Begin tms32010 i/o handlers */
534WRITE16_HANDLER( spc_latch_outfifo_error_stats ) // latch 74ls74 @ E64 upper and lower halves with d0 and 1 respectively
534static WRITE16_HANDLER( spc_latch_outfifo_error_stats ) // latch 74ls74 @ E64 upper and lower halves with d0 and 1 respectively
535535{
536536#ifdef USE_LOOSE_TIMING
537537   cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(25));
r6134r6135
543543   dectalk.spc_error_latch = (data&1);
544544}
545545
546READ16_HANDLER( spc_infifo_data_r )
546static READ16_HANDLER( spc_infifo_data_r )
547547{
548548   UINT16 data = 0xFFFF;
549549   data = dectalk.infifo[dectalk.infifo_tail_ptr];
r6134r6135
557557   return data;
558558}
559559
560WRITE16_HANDLER( spc_outfifo_data_w )
560static WRITE16_HANDLER( spc_outfifo_data_w )
561561{
562562   // the low 4 data bits are thrown out on the real unit due to use of a 12 bit dac (and to save use of another 16x4 fifo chip), though technically they're probably valid, and with suitable hacking a dtc-01 could probably output full 16 bit samples at 10khz.
563563#ifdef SPC_LOG_DSP
r6134r6135
578578   //dectalk_outfifo_check(space->machine); // commented to allow int to clear
579579}
580580
581READ16_HANDLER( spc_semaphore_r ) // Return state of d-latch 74ls74 @ E64 'lower half' in d0 which indicates whether infifo is readable
581static READ16_HANDLER( spc_semaphore_r ) // Return state of d-latch 74ls74 @ E64 'lower half' in d0 which indicates whether infifo is readable
582582{
583583#ifdef SPC_LOG_DSP
584584   //logerror("dsp: read infifo semaphore, returned %d\n", dectalk.infifo_semaphore); // commented due to extreme annoyance factor
r6134r6135
687687}
688688
689689/* Driver init: stuff that needs setting up which isn't directly affected by reset */
690DRIVER_INIT( dectalk )
690static DRIVER_INIT( dectalk )
691691{
692692   dectalk_clear_all_fifos(machine);
693693   dectalk.simulate_outfifo_error = 0;
src/mess/drivers/vt520.c
r6134r6135
3333ADDRESS_MAP_END
3434
3535/* Input ports */
36INPUT_PORTS_START( vt520 )
36static INPUT_PORTS_START( vt520 )
3737INPUT_PORTS_END
3838
3939
src/mess/drivers/x1.c
r6134r6135
20672067   }
20682068}
20692069
2070FLOPPY_OPTIONS_START( x1 )
2070static FLOPPY_OPTIONS_START( x1 )
20712071   FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default,
20722072      HEADS([2])
20732073      TRACKS([40])
src/mess/drivers/pippin.c
r6134r6135
3030ADDRESS_MAP_END
3131
3232/* Input ports */
33INPUT_PORTS_START( pippin )
33static INPUT_PORTS_START( pippin )
3434INPUT_PORTS_END
3535
3636
src/mess/drivers/at.c
r6134r6135
151151   }
152152}
153153
154READ32_HANDLER( at_kbdc8042_32le_r )
154static READ32_HANDLER( at_kbdc8042_32le_r )
155155{
156156   return read32le_with_read8_handler(at_kbdc8042_r, space, offset, mem_mask);
157157}
158158
159WRITE32_HANDLER( at_kbdc8042_32le_w )
159static WRITE32_HANDLER( at_kbdc8042_32le_w )
160160{
161161   write32le_with_write8_handler(at_kbdc8042_w, space, offset, data, mem_mask);
162162}
src/mess/drivers/vt220.c
r6134r6135
1818ADDRESS_MAP_END
1919
2020/* Input ports */
21INPUT_PORTS_START( vt220 )
21static INPUT_PORTS_START( vt220 )
2222INPUT_PORTS_END
2323
2424static MACHINE_RESET(vt220)
src/mess/drivers/fmtowns.c
r6134r6135
151151static UINT8 towns_rtc_select;
152152static UINT8 towns_rtc_data;
153153static UINT8 towns_rtc_reg[16];
154emu_timer* towns_rtc_timer;
154static emu_timer* towns_rtc_timer;
155155static UINT8 towns_timer_mask;
156156static UINT8 towns_crtc_mix;
157157static UINT16 towns_machine_id;  // default is 0x0101
r6134r6135
444444   }
445445}
446446
447UINT16 towns_fdc_dma_r(running_machine* machine)
447static UINT16 towns_fdc_dma_r(running_machine* machine)
448448{
449449   const device_config* fdc = devtag_get_device(machine,"fdc");
450450   return wd17xx_data_r(fdc,0);
451451}
452452
453void towns_fdc_dma_w(running_machine* machine, UINT16 data)
453static void towns_fdc_dma_w(running_machine* machine, UINT16 data)
454454{
455455   const device_config* fdc = devtag_get_device(machine,"fdc");
456456   wd17xx_data_w(fdc,0,data);
r6134r6135
12251225   {FLOPPY_0,FLOPPY_1,FLOPPY_2,FLOPPY_3}
12261226};
12271227
1228FLOPPY_OPTIONS_START( towns )
1228static FLOPPY_OPTIONS_START( towns )
12291229   FLOPPY_OPTION( fmt_bin, "bin", "BIN disk image", basicdsk_identify_default, basicdsk_construct_default,
12301230      HEADS([2])
12311231      TRACKS([77])
src/mess/drivers/einstein.c
r6134r6135
807807   PORT_CONFSETTING(0x08, "Double sided")
808808INPUT_PORTS_END
809809
810INPUT_PORTS_START( einstein_80col )
810static INPUT_PORTS_START( einstein_80col )
811811   PORT_INCLUDE(einstein)
812812
813813   /* dip switches on the 80 column card */
src/mess/drivers/vboy.c
r6134r6135
645645   MAKE_RGB(0x00, 0x00, 0x00)  // 3
646646};
647647
648PALETTE_INIT( vboy )
648static PALETTE_INIT( vboy )
649649{
650650   palette_set_colors(machine, 0, vboy_palette, ARRAY_LENGTH(vboy_palette));
651651}
src/mess/drivers/fk1.c
r6134r6135
1313#include "machine/msm8251.h"
1414#include "devices/messram.h"
1515
16UINT8 fk1_video_rol;
16static UINT8 fk1_video_rol;
1717/*
1818Port A:
1919        Printer
r6134r6135
6262//  logerror("fk1_ppi_1_c_r\n");
6363   return 0;
6464}
65I8255A_INTERFACE( fk1_ppi8255_interface_1 )
65static I8255A_INTERFACE( fk1_ppi8255_interface_1 )
6666{
6767   DEVCB_HANDLER(fk1_ppi_1_a_r),
6868   DEVCB_HANDLER(fk1_ppi_1_b_r),
r6134r6135
112112//  logerror("fk1_ppi_2_c_r\n");
113113   return 0;
114114}
115I8255A_INTERFACE( fk1_ppi8255_interface_2 )
115static I8255A_INTERFACE( fk1_ppi8255_interface_2 )
116116{
117117   DEVCB_NULL,
118118   DEVCB_HANDLER(fk1_ppi_2_b_r),
r6134r6135
175175//  logerror("fk1_ppi_3_c_r\n");
176176   return 0;
177177}
178I8255A_INTERFACE( fk1_ppi8255_interface_3 )
178static I8255A_INTERFACE( fk1_ppi8255_interface_3 )
179179{
180180   DEVCB_HANDLER(fk1_ppi_3_a_r),
181181   DEVCB_HANDLER(fk1_ppi_3_b_r),
r6134r6135
204204}
205205
206206
207const struct pit8253_config fk1_pit8253_intf =
207static const struct pit8253_config fk1_pit8253_intf =
208208{
209209   {
210210      {
r6134r6135
229229    8 any interruption allowed.
230230*/
231231
232WRITE8_HANDLER( fk1_intr_w )
232static WRITE8_HANDLER( fk1_intr_w )
233233{
234234   logerror("fk1_intr_w %02x\n",data);
235235}
236236
237READ8_HANDLER( fk1_bank_ram_r )
237static READ8_HANDLER( fk1_bank_ram_r )
238238{
239239   const address_space *space_mem = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
240240   memory_install_write8_handler(space_mem, 0x0000, 0x3fff, 0, 0, SMH_BANK(1));
r6134r6135
243243   return 0;
244244}
245245
246READ8_HANDLER( fk1_bank_rom_r )
246static READ8_HANDLER( fk1_bank_rom_r )
247247{
248248   const address_space *space_mem = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
249249   memory_install_write8_handler(space_mem, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
r6134r6135
260260    0 - READ
261261    Functions are allowed in one.
262262*/
263WRITE8_HANDLER( fk1_disk_w )
263static WRITE8_HANDLER( fk1_disk_w )
264264{
265265//  logerror("fk1_disk_w %02x\n",data);
266266}
r6134r6135
2742741 - / BX, X-axis
2752750 - / AX, X-axis
276276*/
277READ8_HANDLER( fk1_mouse_r )
277static READ8_HANDLER( fk1_mouse_r )
278278{
279279//  logerror("fk1_mouse_r\n");
280280   return 0;
r6134r6135
282282
283283/*Write to port 70 resets the interrupt from the system clock of 50 Hz. */
284284
285WRITE8_HANDLER( fk1_reset_int_w )
285static WRITE8_HANDLER( fk1_reset_int_w )
286286{
287287   logerror("fk1_reset_int_w\n");
288288}
r6134r6135
321321      PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
322322INPUT_PORTS_END
323323
324UINT8 int_vector;
324static UINT8 int_vector;
325325
326326static TIMER_CALLBACK(keyboard_callback)
327327{
src/mess/drivers/osborne1.c
r6134r6135
175175 * - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte)
176176 *
177177 */
178FLOPPY_OPTIONS_START(osborne1 )
178static FLOPPY_OPTIONS_START(osborne1 )
179179   FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default,
180180      HEADS([1])
181181      TRACKS([40])
src/mess/drivers/cdi.c
r6134r6135
4141
4242static const device_config *dmadac[2];
4343
44emu_timer *test_timer;
44static emu_timer *test_timer;
4545
4646#define ENABLE_UART_PRINTING (0)
4747
r6134r6135
111111static void mcd212_draw_cursor(running_machine *machine, UINT32 *scanline, int y);
112112static void mcd212_mix_lines(running_machine *machine, UINT8 *plane_a_r, UINT8 *plane_a_g, UINT8 *plane_a_b, UINT8 *plane_b_r, UINT8 *plane_b_g, UINT8 *plane_b_b, UINT32 *out);
113113static void mcd212_draw_scanline(running_machine *machine, int y);
114TIMER_CALLBACK( mcd212_perform_scan );
114static TIMER_CALLBACK( mcd212_perform_scan );
115115static VIDEO_START(cdi);
116116
117117// Miscellaneous
118TIMER_CALLBACK( test_timer_callback );
118static TIMER_CALLBACK( test_timer_callback );
119119
120120/***********************
121121* On-board peripherals *
r6134r6135
955955
956956static cdic_regs_t cdic_regs;
957957
958const INT32 cdic_adpcm_filter_coef[5][2] =
958static const INT32 cdic_adpcm_filter_coef[5][2] =
959959{
960960   { 0,0 },
961961   { 60,0 },
r6134r6135
964964   { 122,-60 },
965965};
966966
967int cdic_xa_last[4] = { 0, 0, 0, 0 };
967static int cdic_xa_last[4] = { 0, 0, 0, 0 };
968968
969969INLINE INT16 clamp(INT16 in)
970970{
r6134r6135
21052105   emu_timer *clock;
21062106} m48t08_regs_t;
21072107
2108m48t08_regs_t m48t08;
2108static m48t08_regs_t m48t08;
21092109
21102110static READ16_HANDLER( m48t08_r )
21112111{
r6134r6135
22142214   UINT8 region_flag_1[768];
22152215} mcd212_t;
22162216
2217mcd212_t mcd212;
2217static mcd212_t mcd212;
22182218
22192219#define MCD212_CURCNT_COLOR         0x00000f   // Cursor color
22202220#define MCD212_CURCNT_CUW         0x008000   // Cursor width
r6134r6135
28102810static BYTE68K mcd212_abDelta[16] = { 0, 1, 4, 9, 16, 27, 44, 79, 128, 177, 212, 229, 240, 247, 252, 255 };
28112811
28122812//* Color limit array.
2813BYTE68K mcd212_abLimit[3 * BYTE68K_MAX];
2813static BYTE68K mcd212_abLimit[3 * BYTE68K_MAX];
28142814
28152815//* Color clamp array.
2816BYTE68K mcd212_abClamp[3 * BYTE68K_MAX];
2816static BYTE68K mcd212_abClamp[3 * BYTE68K_MAX];
28172817
28182818//* U-to-B matrix array.
2819SWORD68K mcd212_abMatrixUB[BYTE68K_MAX + 1];
2819static SWORD68K mcd212_abMatrixUB[BYTE68K_MAX + 1];
28202820
28212821//* U-to-G matrix array.
2822SWORD68K mcd212_abMatrixUG[BYTE68K_MAX + 1];
2822static SWORD68K mcd212_abMatrixUG[BYTE68K_MAX + 1];
28232823
28242824//* V-to-G matrix array.
2825SWORD68K mcd212_abMatrixVG[BYTE68K_MAX + 1];
2825static SWORD68K mcd212_abMatrixVG[BYTE68K_MAX + 1];
28262826
28272827//* V-to-R matrix array.
2828SWORD68K mcd212_abMatrixVR[BYTE68K_MAX + 1];
2828static SWORD68K mcd212_abMatrixVR[BYTE68K_MAX + 1];
28292829
28302830//* Delta-Y decoding array.
2831BYTE68K mcd212_abDeltaY[BYTE68K_MAX + 1];
2831static BYTE68K mcd212_abDeltaY[BYTE68K_MAX + 1];
28322832
28332833//* Delta-U/V decoding array.
2834BYTE68K mcd212_abDeltaUV[BYTE68K_MAX + 1];
2834static BYTE68K mcd212_abDeltaUV[BYTE68K_MAX + 1];
28352835
28362836INLINE UINT8 MCD212_LIM(INT32 in)
28372837{
r6134r6135
35683568   mcd212_draw_cursor(machine, scanline, y);
35693569}
35703570
3571TIMER_CALLBACK( mcd212_perform_scan )
3571static TIMER_CALLBACK( mcd212_perform_scan )
35723572{
35733573   int scanline = video_screen_get_vpos(machine->primary_screen);
35743574   if(/*mcd212.channel[0].dcr & MCD212_DCR_DE*/1)
r6134r6135
36613661   timer_adjust_oneshot(mcd212.scan_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
36623662}
36633663
3664TIMER_CALLBACK( test_timer_callback )
3664static TIMER_CALLBACK( test_timer_callback )
36653665{
36663666   // This function manually triggers interrupt requests as a test.
36673667   static UINT8 set = 0;
src/mess/drivers/junior.c
r6134r6135
3434
3535
3636/* Input ports */
37INPUT_PORTS_START( junior )
37static INPUT_PORTS_START( junior )
3838PORT_START("LINE0")         /* IN0 keys row 0 */
3939   PORT_BIT( 0x80, 0x00, IPT_UNUSED )
4040   PORT_BIT( 0x40, 0x40, IPT_KEYBOARD ) PORT_NAME("0.6: 0") PORT_CODE(KEYCODE_0)
r6134r6135
111111}
112112
113113
114WRITE8_DEVICE_HANDLER(junior_riot_a_w)
114static WRITE8_DEVICE_HANDLER(junior_riot_a_w)
115115{
116116   UINT8 idx = ( junior_port_b >> 1 ) & 0x0f;
117117
r6134r6135
125125}
126126
127127
128WRITE8_DEVICE_HANDLER(junior_riot_b_w)
128static WRITE8_DEVICE_HANDLER(junior_riot_b_w)
129129{
130130   UINT8 newdata = data;
131131   UINT8 idx = ( newdata >> 1 ) & 0x0f;
src/mess/drivers/samcoupe.c
r6134r6135
519519};
520520
521521
522FLOPPY_OPTIONS_START( samcoupe )
522static FLOPPY_OPTIONS_START( samcoupe )
523523   FLOPPY_OPTION
524524   (
525525      coupe_mgt, "mgt,dsk,sad", "SAM Coupe MGT disk image", coupe_mgt_identify, coupe_mgt_construct,
src/mess/drivers/nanos.c
r6134r6135
272272   return 0;
273273}
274274
275UINT8 key_command;
276UINT8 last_code = 0;
277UINT8 key_pressed = 0xff;
275static UINT8 key_command;
276static UINT8 last_code = 0;
277static UINT8 key_pressed = 0xff;
278278static READ8_DEVICE_HANDLER (nanos_port_a_r)
279279{
280280   UINT8 retVal;
src/mess/drivers/fm7.c
r6134r6135
5252
5353UINT8* fm7_video_ram;
5454UINT8* shared_ram;
55UINT8* fm7_boot_ram;  // Boot RAM (AV only)
55static UINT8* fm7_boot_ram;  // Boot RAM (AV only)
5656UINT8 fm7_type;
5757static UINT8 irq_flags;  // active IRQ flags
5858static UINT8 irq_mask;  // IRQ mask
59emu_timer* fm7_timer;  // main timer, triggered every 2.0345ms
60emu_timer* fm7_subtimer;  // sub-CPU timer, triggered every 20ms
61emu_timer* fm7_keyboard_timer;
59static emu_timer* fm7_timer;  // main timer, triggered every 2.0345ms
60static emu_timer* fm7_subtimer;  // sub-CPU timer, triggered every 20ms
61static emu_timer* fm7_keyboard_timer;
6262emu_timer* fm77av_vsync_timer;
6363static UINT8 basic_rom_en;
6464static UINT8 init_rom_en;  // AV only
65unsigned int key_delay;
66unsigned int key_repeat;
65static unsigned int key_delay;
66static unsigned int key_repeat;
6767static UINT16 current_scancode;
6868static UINT32 key_data[4];
6969static UINT32 mod_data;
r6134r6135
8080static UINT16 fm7_kanji_address;
8181
8282
83struct key_encoder
83static struct key_encoder
8484{
8585   UINT8 buffer[12];
8686   UINT8 tx_count;
r6134r6135
9292   UINT8 position;
9393} fm7_encoder;
9494
95struct mmr
95static struct mmr
9696{
9797   UINT8 bank_addr[8][16];
9898   UINT8 segment;
r6134r6135
421421 *  Port is write-only.  Initiate ROM is on by default.
422422 *
423423 */
424WRITE8_HANDLER( fm7_init_en_w )
424static WRITE8_HANDLER( fm7_init_en_w )
425425{
426426   if(data & 0x02)
427427   {
r6134r6135
843843 *  Main CPU: 0xfd0b
844844 *   - bit 0: Boot mode: 0=BASIC, 1=DOS
845845 */
846READ8_HANDLER( fm77av_boot_mode_r )
846static READ8_HANDLER( fm77av_boot_mode_r )
847847{
848848   UINT8 ret = 0xff;
849849
r6134r6135
13701370   return -1;
13711371}
13721372
1373void fm77av_fmirq(const device_config* device,int irq)
1373static void fm77av_fmirq(const device_config* device,int irq)
13741374{
13751375   if(irq == 1)
13761376   {
src/mess/drivers/esq1.c
r6134r6135
6060static UINT8 uart_regs[0x10];
6161static UINT8 uart_outputport;
6262
63void esq1_doc_irq(const device_config *device, int state)
63static void esq1_doc_irq(const device_config *device, int state)
6464{
6565}
6666
src/mess/drivers/vt320.c
r6134r6135
4444ADDRESS_MAP_END
4545
4646/* Input ports */
47INPUT_PORTS_START( vt320 )
47static INPUT_PORTS_START( vt320 )
4848INPUT_PORTS_END
4949
5050static MACHINE_RESET(vt320)
src/mess/drivers/mac.c
r6134r6135
294294
295295
296296static UINT32 rbv_toggle = 0;
297READ16_HANDLER ( mac_rbv_r )
297static READ16_HANDLER ( mac_rbv_r )
298298{
299299   int data;
300300   const device_config *via_1 = devtag_get_device(space->machine, "via6522_1");
r6134r6135
324324   return (data & 0xff) | (data << 8);
325325}
326326
327WRITE16_HANDLER ( mac_rbv_w )
327static WRITE16_HANDLER ( mac_rbv_w )
328328{
329329   const device_config *via_1 = devtag_get_device(space->machine, "via6522_1");
330330
r6134r6135
476476   AM_RANGE(0xfeff8000, 0xfeffffff) AM_ROM AM_REGION("user1", 0x78000)
477477ADDRESS_MAP_END
478478
479VIDEO_START( maclc )
479static VIDEO_START( maclc )
480480{
481481}
482482
483VIDEO_UPDATE( maclc )
483static VIDEO_UPDATE( maclc )
484484{
485485   return 0;
486486}
src/mess/drivers/p8k.c
r6134r6135
1/***************************************************************************
2 
3    P8000
4 
5    09/2009 Skeleton driver based on Matt Knoth's emulator.
6    P8000emu (http://knothusa.net/Home.php) has been a great source of info.
7    Other info from
8      * http://www.pofo.de/P8000/notes/books/
9      * http://www.pofo.de/P8000/
10 
11    TODO:
12      * add Z8001 core so that we can handle the 16bit IO Map (Z8000 uses a
13        8bit IO Map, and hence I commented out the whole map)
14      * add floppy emulation to 8 bit board
15      * properly implement Z80 daisy chain in 16 bit board
16 
17****************************************************************************/
18 
19#include "driver.h"
20#include "cpu/z80/z80.h"
21#include "cpu/z8000/z8000.h"
22#include "cpu/z80/z80daisy.h"
23#include "machine/z80ctc.h"
24#include "machine/z80pio.h"
25#include "machine/z80sio.h"
26#include "machine/z80dma.h"
27#include "sound/beep.h"
28 
29 
30static READ8_DEVICE_HANDLER( sio2_r )
31{
32   switch (offset)
33   {
34   case 0:
35      return z80sio_d_r(device, 0);
36   case 1:
37      return z80sio_c_r(device, 0);
38   case 2:
39      return z80sio_d_r(device, 1);
40   case 3:
41      return z80sio_c_r(device, 1);
42   }
43 
44   return 0;
45}
46 
47static WRITE8_DEVICE_HANDLER( sio2_w )
48{
49   switch (offset)
50   {
51   case 0:
52      z80sio_d_w(device, 0, data);
53      break;
54   case 1:
55      z80sio_c_w(device, 0, data);
56      break;
57   case 2:
58      z80sio_d_w(device, 1, data);
59      break;
60   case 3:
61      z80sio_c_w(device, 1, data);
62      break;
63   }
64}
65 
66static ADDRESS_MAP_START(p8k_memmap, ADDRESS_SPACE_PROGRAM, 8)
67   AM_RANGE(0x0000, 0x1fff) AM_ROM
68   AM_RANGE(0x2000, 0xffff) AM_RAM
69ADDRESS_MAP_END
70 
71static ADDRESS_MAP_START(p8k_iomap, ADDRESS_SPACE_IO, 8)
72//  AM_RANGE(0x00, 0x07) // MH7489
73   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("z80ctc_0", z80ctc_r, z80ctc_w)
74   AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("z80pio_0", z80pio_alt_r, z80pio_alt_w)
75   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("z80pio_1", z80pio_alt_r, z80pio_alt_w)
76   AM_RANGE(0x1c, 0x1f) AM_DEVREADWRITE("z80pio_2", z80pio_alt_r, z80pio_alt_w)   // we still need to add the FDC related part of this one
77//  AM_RANGE(0x20, 0x23) // FDC
78   AM_RANGE(0x24, 0x27) AM_DEVREADWRITE("z80sio_0", sio2_r, sio2_w)
79   AM_RANGE(0x28, 0x2b) AM_DEVREADWRITE("z80sio_1", sio2_r, sio2_w)
80   AM_RANGE(0x2c, 0x2f) AM_DEVREADWRITE("z80ctc_1", z80ctc_r, z80ctc_w)
81   AM_RANGE(0x3c, 0x3c) AM_DEVREADWRITE("z80dma", z80dma_r, z80dma_w)   // FDC related
82ADDRESS_MAP_END
83 
84static ADDRESS_MAP_START(p8k_16_memmap, ADDRESS_SPACE_PROGRAM, 16)
85   AM_RANGE(0x00000, 0x03fff) AM_ROM
86   AM_RANGE(0x04000, 0x07fff) AM_RAM
87   AM_RANGE(0x08000, 0xfffff) AM_RAM
88ADDRESS_MAP_END
89 
90 
91#if 0 // we need a real Z8001 CPU core for the 16 bit IO map
92// TODO: could any of the following be implemented through a DEVREADWRITE8 + suitable mask?
93 
94static READ16_DEVICE_HANDLER( p8k_16_sio_r )
95{
96   switch (offset & 0x06)
97   {
98   case 0x00:
99      return (UINT16)z80sio_d_r(device, 0);
100   case 0x02:
101      return (UINT16)z80sio_d_r(device, 1);
102   case 0x04:
103      return (UINT16)z80sio_c_r(device, 0);
104   case 0x06:
105      return (UINT16)z80sio_c_r(device, 1);
106   }
107 
108   return 0;
109}
110 
111static WRITE16_DEVICE_HANDLER( p8k_16_sio_w )
112{
113   data &= 0xff;
114 
115   switch (offset & 0x06)
116   {
117   case 0x00:
118      z80sio_d_w(device, 0, (UINT8)data);
119      break;
120   case 0x02:
121      z80sio_d_w(device, 1, (UINT8)data);
122      break;
123   case 0x04:
124      z80sio_c_w(device, 0, (UINT8)data);
125      break;
126   case 0x06:
127      z80sio_c_w(device, 1, (UINT8)data);
128      break;
129   }
130}
131 
132static READ16_DEVICE_HANDLER( p8k_16_pio_r )
133{
134   return (UINT16)z80pio_r(device, (offset & 0x06) >> 1);
135}
136 
137static WRITE16_DEVICE_HANDLER( p8k_16_pio_w )
138{
139   z80pio_w(device, (offset & 0x06) >> 1, (UINT8)(data & 0xff));
140}
141 
142static READ16_DEVICE_HANDLER( p8k_16_ctc_r )
143{
144   return (UINT16)z80ctc_r(device, (offset & 0x06) >> 1);
145}
146 
147static WRITE16_DEVICE_HANDLER( p8k_16_ctc_w )
148{
149   z80ctc_w(device, (offset & 0x06) >> 1, (UINT8)(data & 0xff));
150}
151 
152static ADDRESS_MAP_START(p8k_16_iomap, ADDRESS_SPACE_IO, 16)
153//  AM_RANGE(0x0fef0, 0x0feff) // clock
154   AM_RANGE(0x0ff80, 0x0ff87) AM_DEVREADWRITE("z80sio_0", p8k_16_sio_r, p8k_16_sio_w)
155   AM_RANGE(0x0ff88, 0x0ff8f) AM_DEVREADWRITE("z80sio_1", p8k_16_sio_r, p8k_16_sio_w)
156   AM_RANGE(0x0ff90, 0x0ff97) AM_DEVREADWRITE("z80pio_0", p8k_16_pio_r, p8k_16_pio_w)
157   AM_RANGE(0x0ff98, 0x0ff9f) AM_DEVREADWRITE("z80pio_1", p8k_16_pio_r, p8k_16_pio_w)
158   AM_RANGE(0x0ffa0, 0x0ffa7) AM_DEVREADWRITE("z80pio_2", p8k_16_pio_r, p8k_16_pio_w)
159   AM_RANGE(0x0ffa8, 0x0ffaf) AM_DEVREADWRITE("z80ctc_0", p8k_16_ctc_r, p8k_16_ctc_w)
160   AM_RANGE(0x0ffb0, 0x0ffb7) AM_DEVREADWRITE("z80ctc_1", p8k_16_ctc_r, p8k_16_ctc_w)
161//  AM_RANGE(0x0ffc0, 0x0ffc1) // SCR
162//  AM_RANGE(0x0ffc8, 0x0ffc9) // SBR
163//  AM_RANGE(0x0ffd0, 0x0ffd1) // NBR
164//  AM_RANGE(0x0ffd8, 0x0ffd9) // SNVR
165//  AM_RANGE(0x0ffe0, 0x0ffe1) // RETI
166//  AM_RANGE(0x0fff0, 0x0fff1) // TRPL
167//  AM_RANGE(0x0fff8, 0x0fff9) // IF1L
168ADDRESS_MAP_END
169 
170#endif
171 
172 
173/* Input ports */
174INPUT_PORTS_START( p8k )
175INPUT_PORTS_END
176 
177 
178static MACHINE_RESET( p8k )
179{
180}
181 
182static MACHINE_RESET( p8k_16 )
183{
184}
185 
186static VIDEO_START( p8k )
187{
188}
189 
190static VIDEO_UPDATE( p8k )
191{
192    return 0;
193}
194 
195 
196/***************************************************************************
197 
198    P8000 8bit Peripherals
199 
200****************************************************************************/
201 
202static void p8k_daisy_interrupt(const device_config *device, int state)
203{
204   cputag_set_input_line(device->machine, "maincpu", 0, state);
205}
206 
207/* Z80 DMA */
208 
209static READ8_DEVICE_HANDLER(p8k_dma_read_byte)
210{
211   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
212   return memory_read_byte(space, offset);
213}
214 
215static WRITE8_DEVICE_HANDLER(p8k_dma_write_byte)
216{
217   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
218   memory_write_byte(space, offset, data);
219}
220 
221// still to implement: dma io read/write which handle FDC. also, the interrupt should deal with FDC as well, with p8k_daisy_interrupt as a fallback
222static const z80dma_interface p8k_dma_intf =
223{
224   "maincpu",
225   p8k_dma_read_byte,
226   p8k_dma_write_byte,
227   NULL, NULL, NULL, NULL,
228   p8k_daisy_interrupt
229};
230 
231/* Z80 CTC 0 */
232// to implement: callbacks!
233// manual states the callbacks should go to
234// Baud Gen 3, FDC, System-Kanal
235 
236static const z80ctc_interface p8k_ctc_0_intf =
237{
238   0,         /* timer disables */
239   p8k_daisy_interrupt,   /* interrupt handler */
240   NULL,         /* ZC/TO0 callback */
241   NULL,         /* ZC/TO1 callback */
242   NULL          /* ZC/TO2 callback */
243};
244 
245/* Z80 CTC 1 */
246// to implement: callbacks!
247// manual states the callbacks should go to
248// Baud Gen 0, Baud Gen 1, Baud Gen 2,
249 
250static const z80ctc_interface p8k_ctc_1_intf =
251{
252   0,         /* timer disables */
253   p8k_daisy_interrupt,   /* interrupt handler */
254   NULL,         /* ZC/TO0 callback */
255   NULL,         /* ZC/TO1 callback */
256   NULL,         /* ZC/TO2 callback */
257};
258 
259/* Z80 PIO 0 */
260 
261static const z80pio_interface p8k_pio_0_intf =
262{
263   DEVCB_LINE(p8k_daisy_interrupt),
264   DEVCB_NULL,
265   DEVCB_NULL,
266   DEVCB_NULL,
267   DEVCB_NULL,
268   DEVCB_NULL,
269   DEVCB_NULL
270};
271 
272/* Z80 PIO 1 */
273 
274static const z80pio_interface p8k_pio_1_intf =
275{
276   DEVCB_LINE(p8k_daisy_interrupt),
277   DEVCB_NULL,
278   DEVCB_NULL,
279   DEVCB_NULL,
280   DEVCB_NULL,
281   DEVCB_NULL,
282   DEVCB_NULL
283};
284 
285/* Z80 PIO 2 */
286 
287static const z80pio_interface p8k_pio_2_intf =
288{
289   DEVCB_LINE(p8k_daisy_interrupt),
290   DEVCB_NULL,
291   DEVCB_NULL,
292   DEVCB_NULL,
293   DEVCB_NULL,
294   DEVCB_NULL,
295   DEVCB_NULL
296};
297 
298/* Z80 SIO 0 */
299 
300static WRITE8_DEVICE_HANDLER( pk8_sio_0_serial_transmit )
301{
302// send character to terminal
303}
304 
305static const z80sio_interface p8k_sio_0_intf =
306{
307   p8k_daisy_interrupt,         /* interrupt handler */
308   NULL,               /* DTR changed handler */
309   NULL,               /* RTS changed handler */
310   NULL,               /* BREAK changed handler */
311   pk8_sio_0_serial_transmit,   /* transmit handler */
312   NULL               /* receive handler */
313};
314 
315/* Z80 SIO 1 */
316 
317static WRITE8_DEVICE_HANDLER( pk8_sio_1_serial_transmit )
318{
319// send character to terminal
320}
321 
322static const z80sio_interface p8k_sio_1_intf =
323{
324   p8k_daisy_interrupt,         /* interrupt handler */
325   NULL,               /* DTR changed handler */
326   NULL,               /* RTS changed handler */
327   NULL,               /* BREAK changed handler */
328   pk8_sio_1_serial_transmit,   /* transmit handler */
329   NULL               /* receive handler */
330};
331 
332 
333/* Z80 Daisy Chain */
334 
335static const z80_daisy_chain p8k_daisy_chain[] =
336{
337   { "z80dma" },   /* FDC related */
338   { "z80pio_2" },
339   { "z80ctc_0" },
340   { "z80sio_0" },
341   { "z80sio_1" },
342   { "z80pio_0" },
343   { "z80pio_1" },
344   { "z80ctc_1" },
345   { NULL }
346};
347 
348 
349/***************************************************************************
350 
351    P8000 16bit Peripherals
352 
353****************************************************************************/
354 
355static void p8k_16_daisy_interrupt(const device_config *device, int state)
356{
357   // this must be studied a little bit more :-)
358}
359 
360/* Z80 CTC 0 */
361 
362static const z80ctc_interface p8k_16_ctc_0_intf =
363{
364   0,            /* timer disables */
365   p8k_16_daisy_interrupt,   /* interrupt handler */
366   NULL,            /* ZC/TO0 callback */
367   NULL,            /* ZC/TO1 callback */
368   NULL             /* ZC/TO2 callback */
369};
370 
371/* Z80 CTC 1 */
372 
373static const z80ctc_interface p8k_16_ctc_1_intf =
374{
375   0,            /* timer disables */
376   p8k_16_daisy_interrupt,   /* interrupt handler */
377   NULL,            /* ZC/TO0 callback */
378   NULL,            /* ZC/TO1 callback */
379   NULL,            /* ZC/TO2 callback */
380};
381 
382/* Z80 PIO 0 */
383 
384static const z80pio_interface p8k_16_pio_0_intf =
385{
386   DEVCB_LINE(p8k_16_daisy_interrupt),
387   DEVCB_NULL,
388   DEVCB_NULL,
389   DEVCB_NULL,
390   DEVCB_NULL,
391   DEVCB_NULL,
392   DEVCB_NULL
393};
394 
395/* Z80 PIO 1 */
396 
397static const z80pio_interface p8k_16_pio_1_intf =
398{
399   DEVCB_LINE(p8k_16_daisy_interrupt),
400   DEVCB_NULL,
401   DEVCB_NULL,
402   DEVCB_NULL,
403   DEVCB_NULL,
404   DEVCB_NULL,
405   DEVCB_NULL
406};
407 
408/* Z80 PIO 2 */
409 
410static const z80pio_interface p8k_16_pio_2_intf =
411{
412   DEVCB_LINE(p8k_16_daisy_interrupt),
413   DEVCB_NULL,
414   DEVCB_NULL,
415   DEVCB_NULL,
416   DEVCB_NULL,
417   DEVCB_NULL,
418   DEVCB_NULL
419};
420 
421/* Z80 SIO 0 */
422 
423static WRITE8_DEVICE_HANDLER( pk8_16_sio_0_serial_transmit )
424{
425// send character to terminal
426}
427 
428static const z80sio_interface p8k_16_sio_0_intf =
429{
430   p8k_16_daisy_interrupt,         /* interrupt handler */
431   NULL,               /* DTR changed handler */
432   NULL,               /* RTS changed handler */
433   NULL,               /* BREAK changed handler */
434   pk8_16_sio_0_serial_transmit,   /* transmit handler */
435   NULL               /* receive handler */
436};
437 
438/* Z80 SIO 1 */
439 
440static WRITE8_DEVICE_HANDLER( pk8_16_sio_1_serial_transmit )
441{
442// send character to terminal
443}
444 
445static const z80sio_interface p8k_16_sio_1_intf =
446{
447   p8k_16_daisy_interrupt,         /* interrupt handler */
448   NULL,               /* DTR changed handler */
449   NULL,               /* RTS changed handler */
450   NULL,               /* BREAK changed handler */
451   pk8_16_sio_1_serial_transmit,   /* transmit handler */
452   NULL               /* receive handler */
453};
454 
455 
456/* Z80 Daisy Chain */
457 
458static const z80_daisy_chain p8k_16_daisy_chain[] =
459{
460   { "z80ctc_0" },
461   { "z80ctc_1" },
462   { "z80sio_0" },
463   { "z80sio_1" },
464   { "z80pio_0" },
465   { "z80pio_1" },
466   { "z80pio_2" },
467   { NULL }
468};
469 
470/***************************************************************************
471 
472    Machine Drivers
473 
474****************************************************************************/
475 
476static MACHINE_DRIVER_START( p8k )
477   /* basic machine hardware */
478   MDRV_CPU_ADD("maincpu", Z80, XTAL_4MHz )
479   MDRV_CPU_CONFIG(p8k_daisy_chain)
480   MDRV_CPU_PROGRAM_MAP(p8k_memmap)
481   MDRV_CPU_IO_MAP(p8k_iomap)
482 
483//  MDRV_MACHINE_START( p8000_8 )
484   MDRV_MACHINE_RESET(p8k)
485 
486   /* peripheral hardware */
487   MDRV_Z80DMA_ADD("z80dma", XTAL_4MHz, p8k_dma_intf)
488   MDRV_Z80CTC_ADD("z80ctc_0", 1229000, p8k_ctc_0_intf)   /* 1.22MHz clock */
489   MDRV_Z80CTC_ADD("z80ctc_1", 1229000, p8k_ctc_1_intf)   /* 1.22MHz clock */
490   MDRV_Z80SIO_ADD("z80sio_0", 9600, p8k_sio_0_intf)   /* 9.6kBaud default */
491   MDRV_Z80SIO_ADD("z80sio_1", 9600, p8k_sio_1_intf)   /* 9.6kBaud default */
492   MDRV_Z80PIO_ADD("z80pio_0", p8k_pio_0_intf)
493   MDRV_Z80PIO_ADD("z80pio_1", p8k_pio_1_intf)
494   MDRV_Z80PIO_ADD("z80pio_2", p8k_pio_2_intf)
495 
496   /* sound hardware */
497   MDRV_SPEAKER_STANDARD_MONO("mono")
498 
499   MDRV_SOUND_ADD("beep", BEEP, 0)
500   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
501 
502   /* video hardware */
503   MDRV_SCREEN_ADD("screen", RASTER)
504   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
505   MDRV_SCREEN_REFRESH_RATE(15)
506   MDRV_SCREEN_SIZE(640,480)
507   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
508   MDRV_PALETTE_LENGTH(2)
509   MDRV_PALETTE_INIT(black_and_white)
510 
511   MDRV_VIDEO_START(p8k)
512   MDRV_VIDEO_UPDATE(p8k)
513MACHINE_DRIVER_END
514 
515static MACHINE_DRIVER_START( p8k_16 )
516   /* basic machine hardware */
517   MDRV_CPU_ADD("maincpu", Z8000, XTAL_4MHz )   // actually z8001, appropriate changes pending
518   MDRV_CPU_CONFIG(p8k_16_daisy_chain)
519   MDRV_CPU_PROGRAM_MAP(p8k_16_memmap)
520//  MDRV_CPU_IO_MAP(p8k_16_iomap)
521 
522//  MDRV_MACHINE_START( p8000_16 )
523   MDRV_MACHINE_RESET(p8k_16)
524 
525   /* peripheral hardware */
526   MDRV_Z80CTC_ADD("z80ctc_0", XTAL_4MHz, p8k_16_ctc_0_intf)
527   MDRV_Z80CTC_ADD("z80ctc_1", XTAL_4MHz, p8k_16_ctc_1_intf)
528   MDRV_Z80SIO_ADD("z80sio_0", 9600, p8k_16_sio_0_intf)
529   MDRV_Z80SIO_ADD("z80sio_1", 9600, p8k_16_sio_1_intf)
530   MDRV_Z80PIO_ADD("z80pio_0", p8k_16_pio_0_intf )
531   MDRV_Z80PIO_ADD("z80pio_1", p8k_16_pio_1_intf )
532   MDRV_Z80PIO_ADD("z80pio_2", p8k_16_pio_2_intf )
533 
534   /* sound hardware */
535   MDRV_SPEAKER_STANDARD_MONO("mono")
536 
537   MDRV_SOUND_ADD("beep", BEEP, 0)
538   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
539 
540   /* video hardware */
541   MDRV_SCREEN_ADD("screen", RASTER)
542   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
543   MDRV_SCREEN_REFRESH_RATE(15)
544   MDRV_SCREEN_SIZE(640,480)
545   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
546   MDRV_PALETTE_LENGTH(2)
547   MDRV_PALETTE_INIT(black_and_white)
548 
549   MDRV_VIDEO_START(p8k)
550   MDRV_VIDEO_UPDATE(p8k)
551MACHINE_DRIVER_END
552 
553/* ROM definition */
554ROM_START( p8000 )
555   ROM_REGION( 0x2000, "maincpu", 0 )
556   ROM_LOAD("mon8_1_3.1",   0x0000, 0x1000, CRC(ad1bb118) SHA1(2332963acd74d5d1a009d9bce8a2b108de01d2a5))
557   ROM_LOAD("mon8_2_3.1",   0x1000, 0x1000, CRC(daced7c2) SHA1(f1f778e72568961b448020fc543ed6e81bbe81b1))
558 
559   ROM_REGION( 0x1000, "proms", 0 )
560   ROM_LOAD("p8t_zs",    0x0000, 0x0800, CRC(f9321251) SHA1(a6a796b58d50ec4a416f2accc34bd76bc83f18ea))
561      ROM_LOAD("p8tdzs.2",  0x0800, 0x0800, CRC(32736503) SHA1(6a1d7c55dddc64a7d601dfdbf917ce1afaefbb0a))
562ROM_END
563 
564ROM_START( p8000_16 )
565      ROM_REGION16_BE( 0x4000, "maincpu", 0 )
566      ROM_LOAD16_BYTE("mon16_1h_3.1_udos",   0x0000, 0x1000, CRC(0c3c28da) SHA1(0cd35444c615b404ebb9cf80da788593e573ddb5))
567      ROM_LOAD16_BYTE("mon16_1l_3.1_udos",   0x0001, 0x1000, CRC(e8857bdc) SHA1(f89c65cbc479101130c71806fd3ddc28e6383f12))
568      ROM_LOAD16_BYTE("mon16_2h_3.1_udos",   0x2000, 0x1000, CRC(cddf58d5) SHA1(588bad8df75b99580459c7a8e898a3396907e3a4))
569      ROM_LOAD16_BYTE("mon16_2l_3.1_udos",   0x2001, 0x1000, CRC(395ee7aa) SHA1(d72fadb1608cd0915cd5ce6440897303ac5a12a6))
570 
571   ROM_REGION( 0x1000, "proms", 0 )
572   ROM_LOAD("p8t_zs",    0x0000, 0x0800, CRC(f9321251) SHA1(a6a796b58d50ec4a416f2accc34bd76bc83f18ea))
573      ROM_LOAD("p8tdzs.2",  0x0800, 0x0800, CRC(32736503) SHA1(6a1d7c55dddc64a7d601dfdbf917ce1afaefbb0a))
574ROM_END
575 
576/* Driver */
577 
578/*    YEAR  NAME        PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY                   FULLNAME       FLAGS */
579COMP( 1989, p8000,      0,      0,       p8k,       p8k,     0,      0,   "EAW electronic Treptow", "P8000 (8bit Board)",  GAME_NOT_WORKING)
580COMP( 1989, p8000_16,   p8000,  0,       p8k_16,    p8k,     0,      0,   "EAW electronic Treptow", "P8000 (16bit Board)",  GAME_NOT_WORKING)
1/***************************************************************************
2
3    P8000
4
5    09/2009 Skeleton driver based on Matt Knoth's emulator.
6    P8000emu (http://knothusa.net/Home.php) has been a great source of info.
7    Other info from
8      * http://www.pofo.de/P8000/notes/books/
9      * http://www.pofo.de/P8000/
10
11    TODO:
12      * add Z8001 core so that we can handle the 16bit IO Map (Z8000 uses a
13        8bit IO Map, and hence I commented out the whole map)
14      * add floppy emulation to 8 bit board
15      * properly implement Z80 daisy chain in 16 bit board
16
17****************************************************************************/
18
19#include "driver.h"
20#include "cpu/z80/z80.h"
21#include "cpu/z8000/z8000.h"
22#include "cpu/z80/z80daisy.h"
23#include "machine/z80ctc.h"
24#include "machine/z80pio.h"
25#include "machine/z80sio.h"
26#include "machine/z80dma.h"
27#include "sound/beep.h"
28
29
30static READ8_DEVICE_HANDLER( sio2_r )
31{
32   switch (offset)
33   {
34   case 0:
35      return z80sio_d_r(device, 0);
36   case 1:
37      return z80sio_c_r(device, 0);
38   case 2:
39      return z80sio_d_r(device, 1);
40   case 3:
41      return z80sio_c_r(device, 1);
42   }
43
44   return 0;
45}
46
47static WRITE8_DEVICE_HANDLER( sio2_w )
48{
49   switch (offset)
50   {
51   case 0:
52      z80sio_d_w(device, 0, data);
53      break;
54   case 1:
55      z80sio_c_w(device, 0, data);
56      break;
57   case 2:
58      z80sio_d_w(device, 1, data);
59      break;
60   case 3:
61      z80sio_c_w(device, 1, data);
62      break;
63   }
64}
65
66static ADDRESS_MAP_START(p8k_memmap, ADDRESS_SPACE_PROGRAM, 8)
67   AM_RANGE(0x0000, 0x1fff) AM_ROM
68   AM_RANGE(0x2000, 0xffff) AM_RAM
69ADDRESS_MAP_END
70
71static ADDRESS_MAP_START(p8k_iomap, ADDRESS_SPACE_IO, 8)
72//  AM_RANGE(0x00, 0x07) // MH7489
73   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("z80ctc_0", z80ctc_r, z80ctc_w)
74   AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("z80pio_0", z80pio_alt_r, z80pio_alt_w)
75   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("z80pio_1", z80pio_alt_r, z80pio_alt_w)
76   AM_RANGE(0x1c, 0x1f) AM_DEVREADWRITE("z80pio_2", z80pio_alt_r, z80pio_alt_w)   // we still need to add the FDC related part of this one
77//  AM_RANGE(0x20, 0x23) // FDC
78   AM_RANGE(0x24, 0x27) AM_DEVREADWRITE("z80sio_0", sio2_r, sio2_w)
79   AM_RANGE(0x28, 0x2b) AM_DEVREADWRITE("z80sio_1", sio2_r, sio2_w)
80   AM_RANGE(0x2c, 0x2f) AM_DEVREADWRITE("z80ctc_1", z80ctc_r, z80ctc_w)
81   AM_RANGE(0x3c, 0x3c) AM_DEVREADWRITE("z80dma", z80dma_r, z80dma_w)   // FDC related
82ADDRESS_MAP_END
83
84static ADDRESS_MAP_START(p8k_16_memmap, ADDRESS_SPACE_PROGRAM, 16)
85   AM_RANGE(0x00000, 0x03fff) AM_ROM
86   AM_RANGE(0x04000, 0x07fff) AM_RAM
87   AM_RANGE(0x08000, 0xfffff) AM_RAM
88ADDRESS_MAP_END
89
90
91#if 0 // we need a real Z8001 CPU core for the 16 bit IO map
92// TODO: could any of the following be implemented through a DEVREADWRITE8 + suitable mask?
93
94static READ16_DEVICE_HANDLER( p8k_16_sio_r )
95{
96   switch (offset & 0x06)
97   {
98   case 0x00:
99      return (UINT16)z80sio_d_r(device, 0);
100   case 0x02:
101      return (UINT16)z80sio_d_r(device, 1);
102   case 0x04:
103      return (UINT16)z80sio_c_r(device, 0);
104   case 0x06:
105      return (UINT16)z80sio_c_r(device, 1);
106   }
107
108   return 0;
109}
110
111static WRITE16_DEVICE_HANDLER( p8k_16_sio_w )
112{
113   data &= 0xff;
114
115   switch (offset & 0x06)
116   {
117   case 0x00:
118      z80sio_d_w(device, 0, (UINT8)data);
119      break;
120   case 0x02:
121      z80sio_d_w(device, 1, (UINT8)data);
122      break;
123   case 0x04:
124      z80sio_c_w(device, 0, (UINT8)data);
125      break;
126   case 0x06:
127      z80sio_c_w(device, 1, (UINT8)data);
128      break;
129   }
130}
131
132static READ16_DEVICE_HANDLER( p8k_16_pio_r )
133{
134   return (UINT16)z80pio_r(device, (offset & 0x06) >> 1);
135}
136
137static WRITE16_DEVICE_HANDLER( p8k_16_pio_w )
138{
139   z80pio_w(device, (offset & 0x06) >> 1, (UINT8)(data & 0xff));
140}
141
142static READ16_DEVICE_HANDLER( p8k_16_ctc_r )
143{
144   return (UINT16)z80ctc_r(device, (offset & 0x06) >> 1);
145}
146
147static WRITE16_DEVICE_HANDLER( p8k_16_ctc_w )
148{
149   z80ctc_w(device, (offset & 0x06) >> 1, (UINT8)(data & 0xff));
150}
151
152static ADDRESS_MAP_START(p8k_16_iomap, ADDRESS_SPACE_IO, 16)
153//  AM_RANGE(0x0fef0, 0x0feff) // clock
154   AM_RANGE(0x0ff80, 0x0ff87) AM_DEVREADWRITE("z80sio_0", p8k_16_sio_r, p8k_16_sio_w)
155   AM_RANGE(0x0ff88, 0x0ff8f) AM_DEVREADWRITE("z80sio_1", p8k_16_sio_r, p8k_16_sio_w)
156   AM_RANGE(0x0ff90, 0x0ff97) AM_DEVREADWRITE("z80pio_0", p8k_16_pio_r, p8k_16_pio_w)
157   AM_RANGE(0x0ff98, 0x0ff9f) AM_DEVREADWRITE("z80pio_1", p8k_16_pio_r, p8k_16_pio_w)
158   AM_RANGE(0x0ffa0, 0x0ffa7) AM_DEVREADWRITE("z80pio_2", p8k_16_pio_r, p8k_16_pio_w)
159   AM_RANGE(0x0ffa8, 0x0ffaf) AM_DEVREADWRITE("z80ctc_0", p8k_16_ctc_r, p8k_16_ctc_w)
160   AM_RANGE(0x0ffb0, 0x0ffb7) AM_DEVREADWRITE("z80ctc_1", p8k_16_ctc_r, p8k_16_ctc_w)
161//  AM_RANGE(0x0ffc0, 0x0ffc1) // SCR
162//  AM_RANGE(0x0ffc8, 0x0ffc9) // SBR
163//  AM_RANGE(0x0ffd0, 0x0ffd1) // NBR
164//  AM_RANGE(0x0ffd8, 0x0ffd9) // SNVR
165//  AM_RANGE(0x0ffe0, 0x0ffe1) // RETI
166//  AM_RANGE(0x0fff0, 0x0fff1) // TRPL
167//  AM_RANGE(0x0fff8, 0x0fff9) // IF1L
168ADDRESS_MAP_END
169
170#endif
171
172
173/* Input ports */
174static INPUT_PORTS_START( p8k )
175INPUT_PORTS_END
176
177
178static MACHINE_RESET( p8k )
179{
180}
181
182static MACHINE_RESET( p8k_16 )
183{
184}
185
186static VIDEO_START( p8k )
187{
188}
189
190static VIDEO_UPDATE( p8k )
191{
192    return 0;
193}
194
195
196/***************************************************************************
197
198    P8000 8bit Peripherals
199
200****************************************************************************/
201
202static void p8k_daisy_interrupt(const device_config *device, int state)
203{
204   cputag_set_input_line(device->machine, "maincpu", 0, state);
205}
206
207/* Z80 DMA */
208
209static READ8_DEVICE_HANDLER(p8k_dma_read_byte)
210{
211   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
212   return memory_read_byte(space, offset);
213}
214
215static WRITE8_DEVICE_HANDLER(p8k_dma_write_byte)
216{
217   const address_space *space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
218   memory_write_byte(space, offset, data);
219}
220
221// still to implement: dma io read/write which handle FDC. also, the interrupt should deal with FDC as well, with p8k_daisy_interrupt as a fallback
222static const z80dma_interface p8k_dma_intf =
223{
224   "maincpu",
225   p8k_dma_read_byte,
226   p8k_dma_write_byte,
227   NULL, NULL, NULL, NULL,
228   p8k_daisy_interrupt
229};
230
231/* Z80 CTC 0 */
232// to implement: callbacks!
233// manual states the callbacks should go to
234// Baud Gen 3, FDC, System-Kanal
235
236static const z80ctc_interface p8k_ctc_0_intf =
237{
238   0,         /* timer disables */
239   p8k_daisy_interrupt,   /* interrupt handler */
240   NULL,         /* ZC/TO0 callback */
241   NULL,         /* ZC/TO1 callback */
242   NULL          /* ZC/TO2 callback */
243};
244
245/* Z80 CTC 1 */
246// to implement: callbacks!
247// manual states the callbacks should go to
248// Baud Gen 0, Baud Gen 1, Baud Gen 2,
249
250static const z80ctc_interface p8k_ctc_1_intf =
251{
252   0,         /* timer disables */
253   p8k_daisy_interrupt,   /* interrupt handler */
254   NULL,         /* ZC/TO0 callback */
255   NULL,         /* ZC/TO1 callback */
256   NULL,         /* ZC/TO2 callback */
257};
258
259/* Z80 PIO 0 */
260
261static const z80pio_interface p8k_pio_0_intf =
262{
263   DEVCB_LINE(p8k_daisy_interrupt),
264   DEVCB_NULL,
265   DEVCB_NULL,
266   DEVCB_NULL,
267   DEVCB_NULL,
268   DEVCB_NULL,
269   DEVCB_NULL
270};
271
272/* Z80 PIO 1 */
273
274static const z80pio_interface p8k_pio_1_intf =
275{
276   DEVCB_LINE(p8k_daisy_interrupt),
277   DEVCB_NULL,
278   DEVCB_NULL,
279   DEVCB_NULL,
280   DEVCB_NULL,
281   DEVCB_NULL,
282   DEVCB_NULL
283};
284
285/* Z80 PIO 2 */
286
287static const z80pio_interface p8k_pio_2_intf =
288{
289   DEVCB_LINE(p8k_daisy_interrupt),
290   DEVCB_NULL,
291   DEVCB_NULL,
292   DEVCB_NULL,
293   DEVCB_NULL,
294   DEVCB_NULL,
295   DEVCB_NULL
296};
297
298/* Z80 SIO 0 */
299
300static WRITE8_DEVICE_HANDLER( pk8_sio_0_serial_transmit )
301{
302// send character to terminal
303}
304
305static const z80sio_interface p8k_sio_0_intf =
306{
307   p8k_daisy_interrupt,         /* interrupt handler */
308   NULL,               /* DTR changed handler */
309   NULL,               /* RTS changed handler */
310   NULL,               /* BREAK changed handler */
311   pk8_sio_0_serial_transmit,   /* transmit handler */
312   NULL               /* receive handler */
313};
314
315/* Z80 SIO 1 */
316
317static WRITE8_DEVICE_HANDLER( pk8_sio_1_serial_transmit )
318{
319// send character to terminal
320}
321
322static const z80sio_interface p8k_sio_1_intf =
323{
324   p8k_daisy_interrupt,         /* interrupt handler */
325   NULL,               /* DTR changed handler */
326   NULL,               /* RTS changed handler */
327   NULL,               /* BREAK changed handler */
328   pk8_sio_1_serial_transmit,   /* transmit handler */
329   NULL               /* receive handler */
330};
331
332
333/* Z80 Daisy Chain */
334
335static const z80_daisy_chain p8k_daisy_chain[] =
336{
337   { "z80dma" },   /* FDC related */
338   { "z80pio_2" },
339   { "z80ctc_0" },
340   { "z80sio_0" },
341   { "z80sio_1" },
342   { "z80pio_0" },
343   { "z80pio_1" },
344   { "z80ctc_1" },
345   { NULL }
346};
347
348
349/***************************************************************************
350
351    P8000 16bit Peripherals
352
353****************************************************************************/
354
355static void p8k_16_daisy_interrupt(const device_config *device, int state)
356{
357   // this must be studied a little bit more :-)
358}
359
360/* Z80 CTC 0 */
361
362static const z80ctc_interface p8k_16_ctc_0_intf =
363{
364   0,            /* timer disables */
365   p8k_16_daisy_interrupt,   /* interrupt handler */
366   NULL,            /* ZC/TO0 callback */
367   NULL,            /* ZC/TO1 callback */
368   NULL             /* ZC/TO2 callback */
369};
370
371/* Z80 CTC 1 */
372
373static const z80ctc_interface p8k_16_ctc_1_intf =
374{
375   0,            /* timer disables */
376   p8k_16_daisy_interrupt,   /* interrupt handler */
377   NULL,            /* ZC/TO0 callback */
378   NULL,            /* ZC/TO1 callback */
379   NULL,            /* ZC/TO2 callback */
380};
381
382/* Z80 PIO 0 */
383
384static const z80pio_interface p8k_16_pio_0_intf =
385{
386   DEVCB_LINE(p8k_16_daisy_interrupt),
387   DEVCB_NULL,
388   DEVCB_NULL,
389   DEVCB_NULL,
390   DEVCB_NULL,
391   DEVCB_NULL,
392   DEVCB_NULL
393};
394
395/* Z80 PIO 1 */
396
397static const z80pio_interface p8k_16_pio_1_intf =
398{
399   DEVCB_LINE(p8k_16_daisy_interrupt),
400   DEVCB_NULL,
401   DEVCB_NULL,
402   DEVCB_NULL,
403   DEVCB_NULL,
404   DEVCB_NULL,
405   DEVCB_NULL
406};
407
408/* Z80 PIO 2 */
409
410static const z80pio_interface p8k_16_pio_2_intf =
411{
412   DEVCB_LINE(p8k_16_daisy_interrupt),
413   DEVCB_NULL,
414   DEVCB_NULL,
415   DEVCB_NULL,
416   DEVCB_NULL,
417   DEVCB_NULL,
418   DEVCB_NULL
419};
420
421/* Z80 SIO 0 */
422
423static WRITE8_DEVICE_HANDLER( pk8_16_sio_0_serial_transmit )
424{
425// send character to terminal
426}
427
428static const z80sio_interface p8k_16_sio_0_intf =
429{
430   p8k_16_daisy_interrupt,         /* interrupt handler */
431   NULL,               /* DTR changed handler */
432   NULL,               /* RTS changed handler */
433   NULL,               /* BREAK changed handler */
434   pk8_16_sio_0_serial_transmit,   /* transmit handler */
435   NULL               /* receive handler */
436};
437
438/* Z80 SIO 1 */
439
440static WRITE8_DEVICE_HANDLER( pk8_16_sio_1_serial_transmit )
441{
442// send character to terminal
443}
444
445static const z80sio_interface p8k_16_sio_1_intf =
446{
447   p8k_16_daisy_interrupt,         /* interrupt handler */
448   NULL,               /* DTR changed handler */
449   NULL,               /* RTS changed handler */
450   NULL,               /* BREAK changed handler */
451   pk8_16_sio_1_serial_transmit,   /* transmit handler */
452   NULL               /* receive handler */
453};
454
455
456/* Z80 Daisy Chain */
457
458static const z80_daisy_chain p8k_16_daisy_chain[] =
459{
460   { "z80ctc_0" },
461   { "z80ctc_1" },
462   { "z80sio_0" },
463   { "z80sio_1" },
464   { "z80pio_0" },
465   { "z80pio_1" },
466   { "z80pio_2" },
467   { NULL }
468};
469
470/***************************************************************************
471
472    Machine Drivers
473
474****************************************************************************/
475
476static MACHINE_DRIVER_START( p8k )
477   /* basic machine hardware */
478   MDRV_CPU_ADD("maincpu", Z80, XTAL_4MHz )
479   MDRV_CPU_CONFIG(p8k_daisy_chain)
480   MDRV_CPU_PROGRAM_MAP(p8k_memmap)
481   MDRV_CPU_IO_MAP(p8k_iomap)
482
483//  MDRV_MACHINE_START( p8000_8 )
484   MDRV_MACHINE_RESET(p8k)
485
486   /* peripheral hardware */
487   MDRV_Z80DMA_ADD("z80dma", XTAL_4MHz, p8k_dma_intf)
488   MDRV_Z80CTC_ADD("z80ctc_0", 1229000, p8k_ctc_0_intf)   /* 1.22MHz clock */
489   MDRV_Z80CTC_ADD("z80ctc_1", 1229000, p8k_ctc_1_intf)   /* 1.22MHz clock */
490   MDRV_Z80SIO_ADD("z80sio_0", 9600, p8k_sio_0_intf)   /* 9.6kBaud default */
491   MDRV_Z80SIO_ADD("z80sio_1", 9600, p8k_sio_1_intf)   /* 9.6kBaud default */
492   MDRV_Z80PIO_ADD("z80pio_0", p8k_pio_0_intf)
493   MDRV_Z80PIO_ADD("z80pio_1", p8k_pio_1_intf)
494   MDRV_Z80PIO_ADD("z80pio_2", p8k_pio_2_intf)
495
496   /* sound hardware */
497   MDRV_SPEAKER_STANDARD_MONO("mono")
498
499   MDRV_SOUND_ADD("beep", BEEP, 0)
500   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
501
502   /* video hardware */
503   MDRV_SCREEN_ADD("screen", RASTER)
504   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
505   MDRV_SCREEN_REFRESH_RATE(15)
506   MDRV_SCREEN_SIZE(640,480)
507   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
508   MDRV_PALETTE_LENGTH(2)
509   MDRV_PALETTE_INIT(black_and_white)
510
511   MDRV_VIDEO_START(p8k)
512   MDRV_VIDEO_UPDATE(p8k)
513MACHINE_DRIVER_END
514
515static MACHINE_DRIVER_START( p8k_16 )
516   /* basic machine hardware */
517   MDRV_CPU_ADD("maincpu", Z8000, XTAL_4MHz )   // actually z8001, appropriate changes pending
518   MDRV_CPU_CONFIG(p8k_16_daisy_chain)
519   MDRV_CPU_PROGRAM_MAP(p8k_16_memmap)
520//  MDRV_CPU_IO_MAP(p8k_16_iomap)
521
522//  MDRV_MACHINE_START( p8000_16 )
523   MDRV_MACHINE_RESET(p8k_16)
524
525   /* peripheral hardware */
526   MDRV_Z80CTC_ADD("z80ctc_0", XTAL_4MHz, p8k_16_ctc_0_intf)
527   MDRV_Z80CTC_ADD("z80ctc_1", XTAL_4MHz, p8k_16_ctc_1_intf)
528   MDRV_Z80SIO_ADD("z80sio_0", 9600, p8k_16_sio_0_intf)
529   MDRV_Z80SIO_ADD("z80sio_1", 9600, p8k_16_sio_1_intf)
530   MDRV_Z80PIO_ADD("z80pio_0", p8k_16_pio_0_intf )
531   MDRV_Z80PIO_ADD("z80pio_1", p8k_16_pio_1_intf )
532   MDRV_Z80PIO_ADD("z80pio_2", p8k_16_pio_2_intf )
533
534   /* sound hardware */
535   MDRV_SPEAKER_STANDARD_MONO("mono")
536
537   MDRV_SOUND_ADD("beep", BEEP, 0)
538   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
539
540   /* video hardware */
541   MDRV_SCREEN_ADD("screen", RASTER)
542   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB15)
543   MDRV_SCREEN_REFRESH_RATE(15)
544   MDRV_SCREEN_SIZE(640,480)
545   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
546   MDRV_PALETTE_LENGTH(2)
547   MDRV_PALETTE_INIT(black_and_white)
548
549   MDRV_VIDEO_START(p8k)
550   MDRV_VIDEO_UPDATE(p8k)
551MACHINE_DRIVER_END
552
553/* ROM definition */
554ROM_START( p8000 )
555   ROM_REGION( 0x2000, "maincpu", 0 )
556   ROM_LOAD("mon8_1_3.1",   0x0000, 0x1000, CRC(ad1bb118) SHA1(2332963acd74d5d1a009d9bce8a2b108de01d2a5))
557   ROM_LOAD("mon8_2_3.1",   0x1000, 0x1000, CRC(daced7c2) SHA1(f1f778e72568961b448020fc543ed6e81bbe81b1))
558
559   ROM_REGION( 0x1000, "proms", 0 )
560   ROM_LOAD("p8t_zs",    0x0000, 0x0800, CRC(f9321251) SHA1(a6a796b58d50ec4a416f2accc34bd76bc83f18ea))
561      ROM_LOAD("p8tdzs.2",  0x0800, 0x0800, CRC(32736503) SHA1(6a1d7c55dddc64a7d601dfdbf917ce1afaefbb0a))
562ROM_END
563
564ROM_START( p8000_16 )
565      ROM_REGION16_BE( 0x4000, "maincpu", 0 )
566      ROM_LOAD16_BYTE("mon16_1h_3.1_udos",   0x0000, 0x1000, CRC(0c3c28da) SHA1(0cd35444c615b404ebb9cf80da788593e573ddb5))
567      ROM_LOAD16_BYTE("mon16_1l_3.1_udos",   0x0001, 0x1000, CRC(e8857bdc) SHA1(f89c65cbc479101130c71806fd3ddc28e6383f12))
568      ROM_LOAD16_BYTE("mon16_2h_3.1_udos",   0x2000, 0x1000, CRC(cddf58d5) SHA1(588bad8df75b99580459c7a8e898a3396907e3a4))
569      ROM_LOAD16_BYTE("mon16_2l_3.1_udos",   0x2001, 0x1000, CRC(395ee7aa) SHA1(d72fadb1608cd0915cd5ce6440897303ac5a12a6))
570
571   ROM_REGION( 0x1000, "proms", 0 )
572   ROM_LOAD("p8t_zs",    0x0000, 0x0800, CRC(f9321251) SHA1(a6a796b58d50ec4a416f2accc34bd76bc83f18ea))
573      ROM_LOAD("p8tdzs.2",  0x0800, 0x0800, CRC(32736503) SHA1(6a1d7c55dddc64a7d601dfdbf917ce1afaefbb0a))
574ROM_END
575
576/* Driver */
577
578/*    YEAR  NAME        PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY                   FULLNAME       FLAGS */
579COMP( 1989, p8000,      0,      0,       p8k,       p8k,     0,      0,   "EAW electronic Treptow", "P8000 (8bit Board)",  GAME_NOT_WORKING)
580COMP( 1989, p8000_16,   p8000,  0,       p8k_16,    p8k,     0,      0,   "EAW electronic Treptow", "P8000 (16bit Board)",  GAME_NOT_WORKING)
src/mess/drivers/pk8000.c
r6134r6135
289289      PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
290290INPUT_PORTS_END
291291
292INTERRUPT_GEN( pk8000_interrupt )
292static INTERRUPT_GEN( pk8000_interrupt )
293293{
294294   cpu_set_input_line(device, 0, HOLD_LINE);
295295}
src/mess/drivers/hx20.c
r6134r6135
1515ADDRESS_MAP_END
1616
1717/* Input ports */
18INPUT_PORTS_START( ehx20 )
18static INPUT_PORTS_START( ehx20 )
1919INPUT_PORTS_END
2020
2121
src/mess/drivers/dc.c
r6134r6135
3131
3232// things from mess/machine/dc.c
3333void dreamcast_atapi_init(running_machine *machine);
34void dreamcast_atapi_exit(running_machine *machine);
3534void dreamcast_atapi_reset(running_machine *machine);
3635extern READ64_HANDLER( dc_mess_gdrom_r );
3736extern WRITE64_HANDLER( dc_mess_gdrom_w );
src/mess/drivers/cgenie.c
r6134r6135
400400};
401401
402402// This is currently broken
403FLOPPY_OPTIONS_START(cgenie )
403static FLOPPY_OPTIONS_START(cgenie )
404404   FLOPPY_OPTION( cgd, "cgd", "Colour Genie disk image", basicdsk_identify_default, basicdsk_construct_default,
405405      HEADS([2])
406406      TRACKS([40])
src/mess/drivers/x68k.c
r6134r6135
23372337   x68k_sys.fdc.disk_inserted[floppy_get_drive(image)] = 0;
23382338}
23392339
2340FLOPPY_OPTIONS_START( x68k )
2340static FLOPPY_OPTIONS_START( x68k )
23412341   FLOPPY_OPTION( dim, "dim",      "DIM floppy disk image",   dim_dsk_identify, dim_dsk_construct, NULL)
23422342   FLOPPY_OPTION( img2d, "xdf,hdm,2hd", "XDF disk image", basicdsk_identify_default, basicdsk_construct_default,
23432343      HEADS([2])
src/mess/drivers/socrates.c
r6134r6135
171171   }
172172}
173173
174MACHINE_RESET( socrates )
174static MACHINE_RESET( socrates )
175175{
176176 socrates.rom_bank = 0xF3; // actually set semi-randomly on real console but we need to initialize it somewhere...
177177 socrates_set_rom_bank( machine );
r6134r6135
193193 socrates.speech_load_settings_count = 0;
194194}
195195
196DRIVER_INIT( socrates )
196static DRIVER_INIT( socrates )
197197{
198198   UINT8 *gfx = memory_region(machine, "vram");
199199   int i;
r6134r6135
204204    cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), 0.45f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
205205}
206206
207READ8_HANDLER( socrates_rom_bank_r )
207static READ8_HANDLER( socrates_rom_bank_r )
208208{
209209 UINT8 data = 0xFF;
210210 data = socrates.rom_bank;
211211 return data;
212212}
213213
214WRITE8_HANDLER( socrates_rom_bank_w )
214static WRITE8_HANDLER( socrates_rom_bank_w )
215215{
216216 socrates.rom_bank = data;
217217 socrates_set_rom_bank( space->machine );
218218}
219219
220READ8_HANDLER( socrates_ram_bank_r )
220static READ8_HANDLER( socrates_ram_bank_r )
221221{
222222 UINT8 data = 0xFF;
223223 data = socrates.ram_bank;
224224 return data;
225225}
226226
227WRITE8_HANDLER( socrates_ram_bank_w )
227static WRITE8_HANDLER( socrates_ram_bank_w )
228228{
229229 socrates.ram_bank = data&0xF;
230230 socrates_set_ram_bank( space->machine );
231231}
232232
233READ8_HANDLER( read_f3 ) // used for read-only i/o ports as mame/mess doesn't have a way to set the unmapped area to read as 0xF3
233static READ8_HANDLER( read_f3 ) // used for read-only i/o ports as mame/mess doesn't have a way to set the unmapped area to read as 0xF3
234234{
235235 return 0xF3;
236236}
237237
238WRITE8_HANDLER( unknownlatch_30 ) // writes to i/o 0x3x do SOMETHING, possibly waitstate related (may halt cpu until vblank start?) or involve status reg bit 6
238static WRITE8_HANDLER( unknownlatch_30 ) // writes to i/o 0x3x do SOMETHING, possibly waitstate related (may halt cpu until vblank start?) or involve status reg bit 6
239239{
240240//logerror("write to i/o 0x30, data %x\n", data); // too annoying to leave enabled
241241}
242242
243READ8_HANDLER( status_and_speech ) // read 0x4x, some sort of status reg
243static READ8_HANDLER( status_and_speech ) // read 0x4x, some sort of status reg
244244{
245245// bit 7 - speech status: high when speech is playing, low when it is not (or when speech cart is not present)
246246// bit 6 - unknown, usually set, may involve the writes to 0x30, possibly some sort of fixed-length timer?
r6134r6135
293293   socrates.speech_load_settings_count = 0;
294294}
295295
296WRITE8_HANDLER( speech_command ) // write 0x4x, some sort of bitfield; speech chip is probably hitachi hd38880 related but not exact, w/4 bit interface
296static WRITE8_HANDLER( speech_command ) // write 0x4x, some sort of bitfield; speech chip is probably hitachi hd38880 related but not exact, w/4 bit interface
297297{
298298   logerror("write to i/o 0x4x of %x\n", data);
299299/*
r6134r6135
400400   socrates.io40_latch = data;
401401}
402402
403READ8_HANDLER( socrates_keyboard_low_r ) // keyboard code low
403static READ8_HANDLER( socrates_keyboard_low_r ) // keyboard code low
404404{
405405 socrates_update_kb( space->machine );
406406 socrates_check_kb_latch( space->machine );
407407 return socrates.kb_latch_low[0];
408408}
409409
410READ8_HANDLER( socrates_keyboard_high_r ) // keyboard code high
410static READ8_HANDLER( socrates_keyboard_high_r ) // keyboard code high
411411{
412412 socrates_update_kb( space->machine );
413413 socrates_check_kb_latch( space->machine );
414414 return socrates.kb_latch_high[0];
415415}
416416
417WRITE8_HANDLER( socrates_keyboard_clear ) // keyboard latch shift/clear
417static WRITE8_HANDLER( socrates_keyboard_clear ) // keyboard latch shift/clear
418418{
419419   socrates.kb_latch_low[0] = socrates.kb_latch_low[1];
420420   socrates.kb_latch_high[0] = socrates.kb_latch_high[1];
r6134r6135
422422   socrates.kb_latch_high[1] = 1;
423423}
424424
425WRITE8_HANDLER( reset_speech ) // i/o 60: reset speech synth
425static WRITE8_HANDLER( reset_speech ) // i/o 60: reset speech synth
426426{
427427 socrates.speech_running = 0;
428428 socrates.speech_address = 0;
r6134r6135
436436
437437/* stuff below belongs in video/socrates.c */
438438
439WRITE8_HANDLER( socrates_scroll_w )
439static WRITE8_HANDLER( socrates_scroll_w )
440440{
441441 if (offset == 0)
442442 socrates.scroll_offset = (socrates.scroll_offset&0x100) | data;
r6134r6135
549549
550550static rgb_t socrates_palette[256];
551551
552PALETTE_INIT( socrates )
552static PALETTE_INIT( socrates )
553553{
554554   int i; // iterator
555555   for (i = 0; i < 256; i++)
src/mess/drivers/mc10.c
r6134r6135
145145    DRIVER INIT
146146***************************************************************************/
147147
148DRIVER_INIT( mc10 )
148static DRIVER_INIT( mc10 )
149149{
150150   mc10_state *mc10 = machine->driver_data;
151151   const address_space *prg = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
src/mess/drivers/4004clk.c
r6134r6135
100100ADDRESS_MAP_END
101101
102102/* Input ports */
103INPUT_PORTS_START( 4004clk )
103static INPUT_PORTS_START( 4004clk )
104104   PORT_START("INPUT")
105105      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Select") PORT_CODE(KEYCODE_1)
106106      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Browse") PORT_CODE(KEYCODE_2)
src/mess/drivers/ec65.c
r6134r6135
2222#define VIA6522_1_TAG "via6522_1"
2323#define MC6845_TAG "mc6845"
2424
25UINT8 *video_ram;
25static UINT8 *video_ram;
2626
2727static ADDRESS_MAP_START(ec65_mem, ADDRESS_SPACE_PROGRAM, 8)
2828   ADDRESS_MAP_UNMAP_HIGH
r6134r6135
9393{
9494}
9595
96const via6522_interface ec65_via_1_intf=
96static const via6522_interface ec65_via_1_intf=
9797{
9898   DEVCB_NULL,   /* in_a_func */
9999   DEVCB_HANDLER(ec65_via_read_b),   /* in_b_func */
r6134r6135
110110   DEVCB_NULL,                       /* irq_func */
111111};
112112
113const via6522_interface ec65_via_0_intf=
113static const via6522_interface ec65_via_0_intf=
114114{
115115   DEVCB_HANDLER(ec65_via_read_a),      /* in_a_func */
116116   DEVCB_NULL,      /* in_b_func */
r6134r6135
128128};
129129
130130/* Input ports */
131INPUT_PORTS_START( ec65 )
131static INPUT_PORTS_START( ec65 )
132132
133133INPUT_PORTS_END
134134
src/mess/drivers/pyl601.c
r6134r6135
7272   return retVal;
7373}
7474
75UINT8 selectedline(UINT16 data)
75static UINT8 selectedline(UINT16 data)
7676{
7777   UINT8 i;
7878   for(i = 0; i < 16; i++)
r6134r6135
155155{
156156   return get_floppy_image(device->machine, (floppy_index & 1)^1);
157157}
158UINT8 floppy_ctrl = 0;
158static UINT8 floppy_ctrl = 0;
159159static WRITE8_HANDLER (floppy_w)
160160{
161161   // bit 0 is reset (if zero)
r6134r6135
457457   memset(messram_get_ptr(devtag_get_device(machine, "messram")), 0, 64 * 1024);
458458}
459459
460INTERRUPT_GEN( pyl601_interrupt )
460static INTERRUPT_GEN( pyl601_interrupt )
461461{
462462   tick50_mark = 0x80;
463463   cpu_set_input_line(device, 0, HOLD_LINE);
src/mess/drivers/apple2.c
r6134r6135
674674   MDRV_RAM_EXTRA_OPTIONS("64K")
675675MACHINE_DRIVER_END
676676
677MACHINE_DRIVER_START( mprof3 )
677static MACHINE_DRIVER_START( mprof3 )
678678   MDRV_IMPORT_FROM( apple2e )   
679679   
680680   /* internal ram */
src/mess/drivers/xerox820.c
r6134r6135
671671   state_save_register_global(machine, state->dsdd);
672672}
673673
674FLOPPY_OPTIONS_START(xerox820 )
674static FLOPPY_OPTIONS_START(xerox820 )
675675   FLOPPY_OPTION( sssd8, "dsk", "8\" SSSD", basicdsk_identify_default, basicdsk_construct_default,
676676      HEADS([1])
677677      TRACKS([77])
src/mess/drivers/busicom.c
r6134r6135
118118ADDRESS_MAP_END
119119
120120/* Input ports */
121INPUT_PORTS_START( busicom )
121static INPUT_PORTS_START( busicom )
122122   PORT_START("LINE0")
123123      PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CM") PORT_CODE(KEYCODE_1)
124124      PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RM") PORT_CODE(KEYCODE_2)
src/mess/drivers/gba.c
r6134r6135
9191   }
9292}
9393
94TIMER_CALLBACK( dma_complete )
94static TIMER_CALLBACK( dma_complete )
9595{
9696   int ctrl;
9797   FPTR ch;
r6134r6135
486486   }
487487}
488488
489TIMER_CALLBACK(handle_irq)
489static TIMER_CALLBACK(handle_irq)
490490{
491491   gba_state *gba_state = machine->driver_data;
492492
r6134r6135
19011901   AM_RANGE(0x0c000000, 0x0cffffff) AM_ROM AM_REGION("cartridge", 0)   // final mirror
19021902ADDRESS_MAP_END
19031903
1904INPUT_PORTS_START( gbadv )
1904static INPUT_PORTS_START( gbadv )
19051905   PORT_START("IN0")
19061906   PORT_BIT( 0xfc00, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_UNUSED
19071907   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 R") PORT_PLAYER(1)   // R
r6134r6135
19161916   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("A") PORT_PLAYER(1)   // A
19171917INPUT_PORTS_END
19181918
1919TIMER_CALLBACK( perform_hbl )
1919static TIMER_CALLBACK( perform_hbl )
19201920{
19211921   int ch, ctrl;
19221922   gba_state *gba_state = machine->driver_data;
r6134r6135
19471947   timer_adjust_oneshot(gba_state->hbl_timer, attotime_never, 0);
19481948}
19491949
1950TIMER_CALLBACK( perform_scan )
1950static TIMER_CALLBACK( perform_scan )
19511951{
19521952   int scanline;
19531953   gba_state *gba_state = machine->driver_data;
docs/messnew.txt
r6134r6135
9898
9999- Cleanups to use more *_NAME and *_CALL macros.  [Atari Ace]
100100
101- Cleanups to add static/const qualifiers, and to remove dead prototypes and
102  code.  [Atari Ace]
103
101104- Converted all drivers to use messram device.  [Miodrag Milanovic]
102105
106
107
1031080.134
104109
105110New System Drivers Supported (in no particular order):

Previous 15994 Revisions Next


© 1998-2018 The MESS Team