| 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 |
| r5060 | r5061 | |
|---|---|---|
| 96 | 96 | }; |
| 97 | 97 | |
| 98 | 98 | |
| 99 | const char *get_extension(const char *name) | |
| 99 | static const char *get_extension(const char *name) | |
| 100 | 100 | { |
| 101 | 101 | const char *s; |
| 102 | 102 | s = name; |
| r5060 | r5061 | |
| 105 | 105 | return s ? s+1 : NULL; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | void display_usage(void) | |
| 108 | static void display_usage(void) | |
| 109 | 109 | { |
| 110 | 110 | fprintf(stderr, "Usage: \n"); |
| 111 | 111 | fprintf(stderr, " castool.exe convert <format> <inputfile> <outputfile.wav>\n"); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | void display_formats(void) | |
| 114 | static void display_formats(void) | |
| 115 | 115 | { |
| 116 | 116 | int i,j; |
| 117 | 117 | fprintf(stderr, "Supported formats:\n\n"); |
| r5060 | r5061 | |
|---|---|---|
| 480 | 480 | /* next sample in frame, sampling at 64 kHz */ |
| 481 | 481 | static TIMER_CALLBACK( mea8000_timer_expire ) |
| 482 | 482 | { |
| 483 | device_config* device = (device_config*) ptr; | |
| 483 | const device_config* device = (const device_config*) ptr; | |
| 484 | 484 | mea8000_t* mea8000 = get_safe_token( device ); |
| 485 | 485 | int pos = mea8000->framepos % SUPERSAMPLING; |
| 486 | 486 |
| r5060 | r5061 | |
|---|---|---|
| 69 | 69 | /* light pen strobe */ |
| 70 | 70 | void upd7220_lpen_w(const device_config *device, int state); |
| 71 | 71 | |
| 72 | /* screen update */ | |
| 73 | void upd7220_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); | |
| 74 | ||
| 75 | 72 | #endif |
| r5060 | r5061 | |
|---|---|---|
| 155 | 155 | //palette_set_color_rgb(device->machine, 1, data, data, data); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | void vt_video_display_char(const device_config *device,bitmap_t *bitmap, UINT8 code, | |
| 158 | static void vt_video_display_char(const device_config *device,bitmap_t *bitmap, UINT8 code, | |
| 159 | 159 | int x, int y,UINT8 scroll_region,UINT8 display_type) |
| 160 | 160 | { |
| 161 | 161 | UINT8 line=0; |
| r5060 | r5061 | |
|---|---|---|
| 365 | 365 | *************************************************************************/ |
| 366 | 366 | WRITE8_HANDLER ( pc_MDA_w ) |
| 367 | 367 | { |
| 368 | device_config | |
| 368 | const device_config | |
| 369 | 369 | switch( offset ) |
| 370 | 370 | { |
| 371 | 371 | case 0: case 2: case 4: case 6: |
| r5060 | r5061 | |
| 382 | 382 | |
| 383 | 383 | READ8_HANDLER ( pc_MDA_r ) |
| 384 | 384 | { |
| 385 | device_config | |
| 385 | const device_config | |
| 386 | 386 | int data = 0xff; |
| 387 | 387 | switch( offset ) |
| 388 | 388 | { |
| r5060 | r5061 | |
| 532 | 532 | |
| 533 | 533 | static void hercules_mode_control_w(running_machine *machine, int data) |
| 534 | 534 | { |
| 535 | device_config | |
| 535 | const device_config *devconf = | |
| 536 | 536 | |
| 537 | 537 | MDA_LOG(1,"hercules_mode_control_w",("$%02x: colums %d, gfx %d, enable %d, blink %d\n", |
| 538 | 538 | data, (data&1)?80:40, (data>>1)&1, (data>>3)&1, (data>>5)&1)); |
| r5060 | r5061 | |
| 568 | 568 | |
| 569 | 569 | static WRITE8_HANDLER ( pc_hercules_w ) |
| 570 | 570 | { |
| 571 | device_config | |
| 571 | const device_config | |
| 572 | 572 | |
| 573 | 573 | switch( offset ) |
| 574 | 574 | { |
| r5060 | r5061 | |
| 608 | 608 | |
| 609 | 609 | static READ8_HANDLER ( pc_hercules_r ) |
| 610 | 610 | { |
| 611 | device_config | |
| 611 | const device_config *devconf = | |
| 612 | 612 | int data = 0xff; |
| 613 | 613 | |
| 614 | 614 | switch( offset ) |
| r5060 | r5061 | |
|---|---|---|
| 54 | 54 | WRITE8_DEVICE_HANDLER ( vt_video_brightness_w ); |
| 55 | 55 | |
| 56 | 56 | |
| 57 | /* palette initialization */ | |
| 58 | PALETTE_INIT( vt_video ); | |
| 59 | ||
| 60 | 57 | /* screen update */ |
| 61 | 58 | void vt_video_update(const device_config *device, bitmap_t *bitmap, const rectangle *cliprect); |
| 62 | 59 |
| r5060 | r5061 | |
|---|---|---|
| 169 | 169 | |
| 170 | 170 | static VIDEO_UPDATE( mc6845_t1000 ) |
| 171 | 171 | { |
| 172 | const device_config | |
| 172 | const device_config *devconf = devtag_get_device(screen->machine, T1000_MC6845_NAME); | |
| 173 | 173 | mc6845_update( devconf, bitmap, cliprect); |
| 174 | 174 | return 0; |
| 175 | 175 | } |
| r5060 | r5061 | |
| 738 | 738 | |
| 739 | 739 | WRITE8_HANDLER ( pc_T1T_w ) |
| 740 | 740 | { |
| 741 | device_config | |
| 741 | const device_config *devconf; | |
| 742 | 742 | |
| 743 | 743 | switch( offset ) |
| 744 | 744 | { |
| 745 | 745 | case 0: case 2: case 4: case 6: |
| 746 | devconf = | |
| 746 | devconf = | |
| 747 | 747 | mc6845_address_w( devconf, offset, data ); |
| 748 | 748 | break; |
| 749 | 749 | case 1: case 3: case 5: case 7: |
| 750 | devconf = | |
| 750 | devconf = | |
| 751 | 751 | mc6845_register_w( devconf, offset, data ); |
| 752 | 752 | break; |
| 753 | 753 | case 8: |
| r5060 | r5061 | |
| 778 | 778 | |
| 779 | 779 | WRITE8_HANDLER( pc_pcjr_w ) |
| 780 | 780 | { |
| 781 | const device_config | |
| 781 | const device_config *devconf; | |
| 782 | 782 | |
| 783 | 783 | switch( offset ) |
| 784 | 784 | { |
| r5060 | r5061 | |
| 818 | 818 | |
| 819 | 819 | READ8_HANDLER ( pc_T1T_r ) |
| 820 | 820 | { |
| 821 | device_config | |
| 821 | const device_config *devconf; | |
| 822 | 822 | int data = 0xff; |
| 823 | 823 | |
| 824 | 824 | switch( offset ) |
| r5060 | r5061 | |
| 828 | 828 | break; |
| 829 | 829 | |
| 830 | 830 | case 1: case 3: case 5: case 7: |
| 831 | devconf = | |
| 831 | devconf = | |
| 832 | 832 | data = mc6845_register_r( devconf, offset ); |
| 833 | 833 | break; |
| 834 | 834 |
| r5060 | r5061 | |
|---|---|---|
| 479 | 479 | UINT8 data = 0xFF; |
| 480 | 480 | |
| 481 | 481 | if ( aga.mode == AGA_MONO ) { |
| 482 | device_config | |
| 482 | const device_config | |
| 483 | 483 | switch( offset ) |
| 484 | 484 | { |
| 485 | 485 | case 0: case 2: case 4: case 6: |
| r5060 | r5061 | |
| 501 | 501 | static WRITE8_HANDLER ( pc_aga_mda_w ) |
| 502 | 502 | { |
| 503 | 503 | if ( aga.mode == AGA_MONO ) { |
| 504 | device_config | |
| 504 | const device_config | |
| 505 | 505 | switch( offset ) |
| 506 | 506 | { |
| 507 | 507 | case 0: case 2: case 4: case 6: |
| r5060 | r5061 | |
| 534 | 534 | UINT8 data = 0xFF; |
| 535 | 535 | |
| 536 | 536 | if ( aga.mode == AGA_COLOR ) { |
| 537 | device_config | |
| 537 | const device_config *devconf = | |
| 538 | 538 | switch( offset ) { |
| 539 | 539 | case 0: case 2: case 4: case 6: |
| 540 | 540 | /* return last written mc6845 address value here? */ |
| r5060 | r5061 | |
| 580 | 580 | static WRITE8_HANDLER ( pc_aga_cga_w ) |
| 581 | 581 | { |
| 582 | 582 | if ( aga.mode == AGA_COLOR ) { |
| 583 | device_config | |
| 583 | const device_config *devconf = | |
| 584 | 584 | |
| 585 | 585 | switch(offset) { |
| 586 | 586 | case 0: case 2: case 4: case 6: |
| r5060 | r5061 | |
| 661 | 661 | |
| 662 | 662 | void pc_aga_set_mode(running_machine *machine, AGA_MODE mode) |
| 663 | 663 | { |
| 664 | device_config | |
| 664 | const device_config *devconf = | |
| 665 | 665 | |
| 666 | 666 | aga.mode = mode; |
| 667 | 667 |
| r5060 | r5061 | |
|---|---|---|
| 1061 | 1061 | */ |
| 1062 | 1062 | static void pc_cga_mode_control_w(running_machine *machine, int data) |
| 1063 | 1063 | { |
| 1064 | device_config | |
| 1064 | const device_config *devconf = | |
| 1065 | 1065 | |
| 1066 | 1066 | CGA_LOG(1,"CGA_mode_control_w",("$%02x: columns %d, gfx %d, hires %d, blink %d\n", |
| 1067 | 1067 | data, (data&1)?80:40, (data>>1)&1, (data>>4)&1, (data>>5)&1)); |
| r5060 | r5061 | |
| 1199 | 1199 | |
| 1200 | 1200 | static READ8_HANDLER( pc_cga8_r ) |
| 1201 | 1201 | { |
| 1202 | device_config | |
| 1202 | const device_config *devconf = | |
| 1203 | 1203 | int data = 0xff; |
| 1204 | 1204 | switch( offset ) |
| 1205 | 1205 | { |
| r5060 | r5061 | |
| 1220 | 1220 | |
| 1221 | 1221 | static WRITE8_HANDLER( pc_cga8_w ) |
| 1222 | 1222 | { |
| 1223 | device_config | |
| 1223 | const device_config *devconf; | |
| 1224 | 1224 | |
| 1225 | 1225 | switch(offset) { |
| 1226 | 1226 | case 0: case 2: case 4: case 6: |
| 1227 | devconf = | |
| 1227 | devconf = | |
| 1228 | 1228 | mc6845_address_w( devconf, offset, data ); |
| 1229 | 1229 | break; |
| 1230 | 1230 | case 1: case 3: case 5: case 7: |
| 1231 | devconf = | |
| 1231 | devconf = | |
| 1232 | 1232 | mc6845_register_w( devconf, offset, data ); |
| 1233 | 1233 | break; |
| 1234 | 1234 | case 8: |
| r5060 | r5061 | |
| 1490 | 1490 | |
| 1491 | 1491 | static WRITE8_HANDLER ( pc1512_w ) |
| 1492 | 1492 | { |
| 1493 | device_config | |
| 1493 | const device_config *devconf = | |
| 1494 | 1494 | |
| 1495 | 1495 | switch (offset) |
| 1496 | 1496 | { |
| r5060 | r5061 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | VIDEO_START(lx388); |
| 31 | 31 | |
| 32 | /*----------- defined in machine/z80ne.c -----------*/ | |
| 33 | ||
| 32 | 34 | READ8_HANDLER(lx383_r); |
| 33 | 35 | WRITE8_HANDLER(lx383_w); |
| 34 | 36 | READ8_HANDLER(lx385_data_r); |
| r5060 | r5061 | |
|---|---|---|
| 17 | 17 | #include "devices/basicdsk.h" |
| 18 | 18 | |
| 19 | 19 | |
| 20 | /*----------- defined in drivers/mbee.c -----------*/ | |
| 21 | ||
| 22 | extern size_t mbee_size; | |
| 23 | ||
| 20 | 24 | /*----------- defined in machine/mbee.c -----------*/ |
| 21 | 25 | |
| 22 | 26 | extern const wd17xx_interface mbee_wd17xx_interface; |
| r5060 | r5061 | |
| 37 | 41 | /*----------- defined in video/mbee.c -----------*/ |
| 38 | 42 | |
| 39 | 43 | extern UINT8 *mbee_pcgram; |
| 40 | extern size_t mbee_size; | |
| 41 | 44 | |
| 42 | 45 | READ8_HANDLER ( m6545_status_r ); |
| 43 | 46 | WRITE8_HANDLER ( m6545_index_w ); |
| r5060 | r5061 | |
|---|---|---|
| 104 | 104 | /* speech synthesis */ |
| 105 | 105 | extern const mea8000_interface to7_speech; |
| 106 | 106 | |
| 107 | /* floppy */ | |
| 108 | extern const mc6843_interface to7_6843_itf; | |
| 109 | extern const mc6854_interface to7_network_iface; | |
| 110 | ||
| 111 | 107 | /* modem */ |
| 112 | 108 | extern const acia6850_interface to7_modem; |
| 113 | 109 |
| r5060 | r5061 | |
|---|---|---|
| 7 | 7 | #include "devices/snapquik.h" |
| 8 | 8 | |
| 9 | 9 | |
| 10 | /* machine.c */ | |
| 10 | /*----------- defined in machine/kaypro.c -----------*/ | |
| 11 | 11 | |
| 12 | extern UINT8 kaypro2x_system_port; | |
| 13 | 12 | extern const z80pio_interface kayproii_pio_g_intf; |
| 14 | 13 | extern const z80pio_interface kayproii_pio_s_intf; |
| 15 | 14 | extern const z80sio_interface kaypro_sio_intf; |
| r5060 | r5061 | |
| 39 | 38 | QUICKLOAD_LOAD( kayproii ); |
| 40 | 39 | QUICKLOAD_LOAD( kaypro2x ); |
| 41 | 40 | |
| 42 | /* video.c */ | |
| 41 | /*----------- defined in video/kaypro.c -----------*/ | |
| 43 | 42 | |
| 43 | ||
| 44 | 44 | MC6845_UPDATE_ROW( kaypro2x_update_row ); |
| 45 | 45 | PALETTE_INIT( kaypro ); |
| 46 | 46 | VIDEO_START( kaypro ); |
| r5060 | r5061 | |
|---|---|---|
| 43 | 43 | WRITE8_HANDLER(c128_write_ff05); |
| 44 | 44 | |
| 45 | 45 | |
| 46 | void c128_m6510_port_write(const device_config *device, UINT8 direction, UINT8 data); | |
| 47 | UINT8 c128_m6510_port_read(const device_config *device, UINT8 direction); | |
| 48 | ||
| 49 | ||
| 50 | 46 | extern DRIVER_INIT( c128 ); |
| 51 | 47 | extern DRIVER_INIT( c128pal ); |
| 52 | 48 | extern DRIVER_INIT( c128d ); |
| r5060 | r5061 | |
|---|---|---|
| 139 | 139 | MDRV_DEVICE_ADD("dragonball", MC68328, 0) \ |
| 140 | 140 | MDRV_DEVICE_CONFIG(_intrf) |
| 141 | 141 | |
| 142 | /*----------- defined in machine/mc68328.c -----------*/ | |
| 143 | ||
| 142 | 144 | /*************************************************************************** |
| 143 | 145 | READ/WRITE HANDLERS |
| 144 | 146 | ***************************************************************************/ |
| r5060 | r5061 | |
| 153 | 155 | |
| 154 | 156 | void mc68328_set_penirq_line(const device_config *device, int state); |
| 155 | 157 | void mc68328_set_port_d_lines(const device_config *device, UINT8 state, int bit); |
| 156 | INPUT_CHANGED( mc68328_port_d_input ); | |
| 157 | 158 | |
| 158 | 159 | /*************************************************************************** |
| 159 | 160 | DEVICE INTERFACE |
| r5060 | r5061 | |
| 162 | 163 | #define MC68328 DEVICE_GET_INFO_NAME(mc68328) |
| 163 | 164 | DEVICE_GET_INFO( mc68328 ); |
| 164 | 165 | |
| 166 | /*----------- defined in video/mc68328.c -----------*/ | |
| 167 | ||
| 165 | 168 | /*************************************************************************** |
| 166 | 169 | VIDEO INTERFACE |
| 167 | 170 | ***************************************************************************/ |
| r5060 | r5061 | |
|---|---|---|
| 11 | 11 | #include "video/mc6845.h" |
| 12 | 12 | #include "devices/snapquik.h" |
| 13 | 13 | |
| 14 | /*----------- defined in machine/amstrad.c -----------*/ | |
| 14 | 15 | |
| 15 | 16 | READ8_HANDLER ( amstrad_cpc_io_r ); |
| 16 | 17 | WRITE8_HANDLER ( amstrad_cpc_io_w ); |
| r5060 | r5061 | |
|---|---|---|
| 11 | 11 | #include "machine/z80ctc.h" |
| 12 | 12 | |
| 13 | 13 | /*----------- defined in machine/llc.c -----------*/ |
| 14 | extern UINT8 *llc_video_ram; | |
| 15 | ||
| 16 | 14 | extern DRIVER_INIT( llc1 ); |
| 17 | 15 | extern MACHINE_START( llc1 ); |
| 18 | 16 | extern MACHINE_RESET( llc1 ); |
| r5060 | r5061 | |
| 27 | 25 | extern MACHINE_RESET( llc2 ); |
| 28 | 26 | extern WRITE8_HANDLER(llc2_rom_disable_w); |
| 29 | 27 | extern WRITE8_HANDLER(llc2_basic_enable_w); |
| 28 | ||
| 30 | 29 | /*----------- defined in video/llc.c -----------*/ |
| 30 | extern UINT8 *llc_video_ram; | |
| 31 | 31 | |
| 32 | 32 | extern VIDEO_START( llc1 ); |
| 33 | 33 | extern VIDEO_UPDATE( llc1 ); |
| r5060 | r5061 | |
|---|---|---|
| 14 | 14 | #define FH 12 |
| 15 | 15 | |
| 16 | 16 | |
| 17 | /*----------- defined in drivers/trs80.c -----------*/ | |
| 18 | ||
| 19 | extern UINT8 trs80_model4; | |
| 20 | extern UINT8 *gfxram; | |
| 21 | ||
| 17 | 22 | /*----------- defined in machine/trs80.c -----------*/ |
| 18 | 23 | |
| 19 | 24 | extern const wd17xx_interface trs80_wd17xx_interface; |
| 20 | 25 | extern UINT8 trs80_mode; |
| 21 | extern UINT8 trs80_model4; | |
| 22 | extern UINT8 *gfxram; | |
| 23 | 26 | |
| 24 | 27 | DEVICE_IMAGE_LOAD( trs80_floppy ); |
| 25 | 28 | QUICKLOAD_LOAD( trs80_cmd ); |
| r5060 | r5061 | |
| 41 | 44 | WRITE8_HANDLER ( trs80m4_e4_w ); |
| 42 | 45 | WRITE8_HANDLER ( trs80m4_e0_w ); |
| 43 | 46 | WRITE8_HANDLER ( trs80m4_90_w ); |
| 44 | WRITE8_HANDLER ( trs80m4_88_w ); | |
| 45 | 47 | WRITE8_HANDLER ( trs80m4_84_w ); |
| 46 | 48 | READ8_HANDLER ( lnw80_fe_r ); |
| 47 | 49 | READ8_HANDLER ( trs80_ff_r ); |
| 48 | READ8_HANDLER ( trs80_fe_r ); | |
| 49 | 50 | READ8_HANDLER ( sys80_f9_r ); |
| 50 | 51 | READ8_HANDLER ( trs80m4_ff_r ); |
| 51 | READ8_HANDLER ( trs80m4_f4_r ); | |
| 52 | 52 | READ8_HANDLER ( trs80m4_ec_r ); |
| 53 | 53 | READ8_HANDLER ( trs80m4_eb_r ); |
| 54 | 54 | READ8_HANDLER ( trs80m4_ea_r ); |
| r5060 | r5061 | |
| 60 | 60 | INTERRUPT_GEN( trs80_fdc_interrupt ); |
| 61 | 61 | |
| 62 | 62 | READ8_HANDLER( trs80_irq_status_r ); |
| 63 | WRITE8_HANDLER( trs80_irq_mask_w ); | |
| 64 | 63 | |
| 65 | 64 | READ8_HANDLER( trs80_printer_r ); |
| 66 | 65 | WRITE8_HANDLER( trs80_printer_w ); |
| r5060 | r5061 | |
| 76 | 75 | |
| 77 | 76 | VIDEO_START( trs80 ); |
| 78 | 77 | VIDEO_UPDATE( trs80 ); |
| 79 | VIDEO_UPDATE( model1 ); | |
| 80 | 78 | VIDEO_UPDATE( ht1080z ); |
| 81 | 79 | VIDEO_UPDATE( lnw80 ); |
| 82 | 80 | VIDEO_UPDATE( radionic ); |
| 83 | 81 | VIDEO_UPDATE( trs80m4 ); |
| 84 | 82 | |
| 83 | WRITE8_HANDLER ( trs80m4_88_w ); | |
| 84 | ||
| 85 | 85 | READ8_HANDLER( trs80_videoram_r ); |
| 86 | 86 | WRITE8_HANDLER( trs80_videoram_w ); |
| 87 | 87 | READ8_HANDLER( trs80_gfxram_r ); |
| r5060 | r5061 | |
|---|---|---|
| 57 | 57 | OTHER |
| 58 | 58 | ***************************************************************************/ |
| 59 | 59 | |
| 60 | /*----------- defined in drivers/apple2.c -----------*/ | |
| 61 | ||
| 62 | MACHINE_DRIVER_EXTERN( apple2e ); | |
| 63 | INPUT_PORTS_EXTERN( apple2ep ); | |
| 64 | PALETTE_INIT( apple2 ); | |
| 65 | ||
| 66 | ||
| 67 | /*----------- defined in machine/apple2.c -----------*/ | |
| 68 | ||
| 69 | extern UINT32 a2; | |
| 70 | ||
| 71 | extern const applefdc_interface apple2_fdc_interface; | |
| 72 | ||
| 73 | void apple2_iwm_setdiskreg(running_machine *machine, UINT8 data); | |
| 74 | UINT8 apple2_iwm_getdiskreg(void); | |
| 75 | ||
| 76 | void apple2_init_common(running_machine *machine); | |
| 77 | MACHINE_START( apple2 ); | |
| 78 | UINT8 apple2_getfloatingbusvalue(running_machine *machine); | |
| 79 | READ8_HANDLER( apple2_c0xx_r ); | |
| 80 | WRITE8_HANDLER( apple2_c0xx_w ); | |
| 81 | ||
| 82 | INTERRUPT_GEN( apple2_interrupt ); | |
| 83 | ||
| 84 | void apple2_setvar(running_machine *machine, UINT32 val, UINT32 mask); | |
| 85 | ||
| 86 | int apple2_pressed_specialkey(running_machine *machine, UINT8 key); | |
| 87 | ||
| 88 | ||
| 89 | /*----------- defined in video/apple2.c -----------*/ | |
| 90 | ||
| 91 | void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo); | |
| 92 | VIDEO_START( apple2 ); | |
| 93 | VIDEO_START( apple2p ); | |
| 94 | VIDEO_START( apple2e ); | |
| 95 | VIDEO_UPDATE( apple2 ); | |
| 96 | void apple2_set_fgcolor(int color); | |
| 97 | void apple2_set_bgcolor(int color); | |
| 98 | int apple2_get_fgcolor(void); | |
| 99 | int apple2_get_bgcolor(void); | |
| 100 | ||
| 101 | 60 | /* ----------------------------------------------------------------------- |
| 102 | 61 | * New Apple II memory manager |
| 103 | 62 | * ----------------------------------------------------------------------- */ |
| r5060 | r5061 | |
| 143 | 102 | }; |
| 144 | 103 | |
| 145 | 104 | |
| 105 | /*----------- defined in drivers/apple2.c -----------*/ | |
| 106 | ||
| 107 | MACHINE_DRIVER_EXTERN( apple2e ); | |
| 108 | INPUT_PORTS_EXTERN( apple2ep ); | |
| 109 | PALETTE_INIT( apple2 ); | |
| 110 | ||
| 111 | ||
| 146 | 112 | /*----------- defined in machine/apple2.c -----------*/ |
| 147 | 113 | |
| 114 | extern UINT32 a2; | |
| 115 | ||
| 116 | extern const applefdc_interface apple2_fdc_interface; | |
| 117 | ||
| 118 | void apple2_iwm_setdiskreg(running_machine *machine, UINT8 data); | |
| 119 | UINT8 apple2_iwm_getdiskreg(void); | |
| 120 | ||
| 121 | void apple2_init_common(running_machine *machine); | |
| 122 | MACHINE_START( apple2 ); | |
| 123 | UINT8 apple2_getfloatingbusvalue(running_machine *machine); | |
| 124 | READ8_HANDLER( apple2_c0xx_r ); | |
| 125 | WRITE8_HANDLER( apple2_c0xx_w ); | |
| 126 | ||
| 127 | INTERRUPT_GEN( apple2_interrupt ); | |
| 128 | ||
| 129 | void apple2_setvar(running_machine *machine, UINT32 val, UINT32 mask); | |
| 130 | ||
| 131 | int apple2_pressed_specialkey(running_machine *machine, UINT8 key); | |
| 132 | ||
| 148 | 133 | void apple2_setup_memory(running_machine *machine, const apple2_memmap_config *config); |
| 149 | 134 | void apple2_update_memory(running_machine *machine); |
| 150 | 135 | |
| 151 | 136 | |
| 137 | ||
| 138 | /*----------- defined in video/apple2.c -----------*/ | |
| 139 | ||
| 140 | void apple2_video_start(running_machine *machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo); | |
| 141 | VIDEO_START( apple2 ); | |
| 142 | VIDEO_START( apple2p ); | |
| 143 | VIDEO_START( apple2e ); | |
| 144 | VIDEO_UPDATE( apple2 ); | |
| 145 | void apple2_set_fgcolor(int color); | |
| 146 | void apple2_set_bgcolor(int color); | |
| 147 | int apple2_get_fgcolor(void); | |
| 148 | int apple2_get_bgcolor(void); | |
| 149 | ||
| 152 | 150 | #endif /* APPLE2_H_ */ |
| r5060 | r5061 | |
|---|---|---|
| 18 | 18 | * |
| 19 | 19 | *************************************/ |
| 20 | 20 | |
| 21 | ||
| 21 | # | |
| 22 | 22 | DRIVER_INIT( atari ) |
| 23 | 23 | { |
| 24 | 24 | offs_t ram_top; |
| r5060 | r5061 | |
| 42 | 42 | 0x0000, ram_top, 0, 0, SMH_BANK(2)); |
| 43 | 43 | memory_set_bankptr(machine, 2, mess_ram); |
| 44 | 44 | } |
| 45 | #endif | |
| 45 | 46 | |
| 46 | 47 | |
| 47 | 48 | static void a800_setbank(running_machine *machine, int n) |
| r5060 | r5061 | |
|---|---|---|
| 174 | 174 | apple3_flags |= VAR_EXTA0 << ((offset - 0xD0) / 2); |
| 175 | 175 | else |
| 176 | 176 | apple3_flags &= ~(VAR_EXTA0 << ((offset - 0xD0) / 2)); |
| 177 | apple3_update_drives( | |
| 177 | apple3_update_drives( | |
| 178 | 178 | result = 0x00; |
| 179 | 179 | break; |
| 180 | 180 | |
| r5060 | r5061 | |
| 238 | 238 | apple3_flags |= VAR_EXTA0 << ((offset - 0xD0) / 2); |
| 239 | 239 | else |
| 240 | 240 | apple3_flags &= ~(VAR_EXTA0 << ((offset - 0xD0) / 2)); |
| 241 | apple3_update_drives( | |
| 241 | apple3_update_drives( | |
| 242 | 242 | break; |
| 243 | 243 | |
| 244 | 244 | case 0xDB: |
| r5060 | r5061 | |
|---|---|---|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /* is this correct for c65 as well as c64? */ |
| 128 | void c65_vic_interrupt (running_machine *machine, int level) | |
| 128 | static void c65_vic_interrupt (running_machine *machine, int level) | |
| 129 | 129 | { |
| 130 | 130 | const device_config *cia_0 = devtag_get_device(machine, "cia_0"); |
| 131 | 131 | #if 1 |
| r5060 | r5061 | |
|---|---|---|
| 12 | 12 | #define ATARI_600XL 3 |
| 13 | 13 | #define ATARI_800XL 4 |
| 14 | 14 | |
| 15 | /* defined in ataricrt.c */ | |
| 15 | /*----------- defined in machine/ataricrt.c -----------*/ | |
| 16 | ||
| 16 | 17 | MACHINE_START( a400 ); |
| 17 | 18 | MACHINE_START( a800 ); |
| 18 | 19 | MACHINE_START( a800xl ); |
| r5060 | r5061 | |
| 27 | 28 | DEVICE_IMAGE_LOAD( a5200_cart ); |
| 28 | 29 | DEVICE_IMAGE_UNLOAD( a5200_cart ); |
| 29 | 30 | |
| 30 | /* defined in atarifdc.c */ | |
| 31 | ||
| 32 | /*----------- defined in machine/atarifdc.c -----------*/ | |
| 33 | ||
| 31 | 34 | DEVICE_IMAGE_LOAD( a800_floppy ); |
| 32 | 35 | READ8_HANDLER( atari_serin_r ); |
| 33 | 36 | WRITE8_HANDLER( atari_serout_w ); |
| r5060 | r5061 | |
|---|---|---|
| 332 | 332 | /* call-back to refill the bit-stream from the FIFO */ |
| 333 | 333 | static TIMER_CALLBACK(mc6854_tfifo_cb) |
| 334 | 334 | { |
| 335 | device_config* device = (device_config*) ptr; | |
| 335 | const device_config* device = (const device_config*) ptr; | |
| 336 | 336 | mc6854_t* mc6854 = get_safe_token( device ); |
| 337 | 337 | int i, data = mc6854->tfifo[ FIFO_SIZE - 1 ]; |
| 338 | 338 |
| r5060 | r5061 | |
|---|---|---|
| 1045 | 1045 | else if (bwg_rtc_enable) |
| 1046 | 1046 | { |
| 1047 | 1047 | if (! (offset & 1)) |
| 1048 | reply = mm58274c_r( | |
| 1048 | reply = mm58274c_r( | |
| 1049 | 1049 | } |
| 1050 | 1050 | else |
| 1051 | 1051 | { |
| r5060 | r5061 | |
| 1088 | 1088 | else if (bwg_rtc_enable) |
| 1089 | 1089 | { |
| 1090 | 1090 | if (! (offset & 1)) |
| 1091 | mm58274c_w( | |
| 1091 | mm58274c_w( | |
| 1092 | 1092 | } |
| 1093 | 1093 | else |
| 1094 | 1094 | { |
| r5060 | r5061 | |
| 1414 | 1414 | { |
| 1415 | 1415 | /* rtc */ |
| 1416 | 1416 | if (! (offset & 1)) |
| 1417 | reply = mm58274c_r( | |
| 1417 | reply = mm58274c_r( | |
| 1418 | 1418 | } |
| 1419 | 1419 | else if (offset < 0x1400) |
| 1420 | 1420 | { |
| r5060 | r5061 | |
| 1464 | 1464 | { |
| 1465 | 1465 | /* rtc */ |
| 1466 | 1466 | if (! (offset & 1)) |
| 1467 | mm58274c_w( | |
| 1467 | mm58274c_w( | |
| 1468 | 1468 | } |
| 1469 | 1469 | else if (offset < 0x1400) |
| 1470 | 1470 | { |
| r5060 | r5061 | |
|---|---|---|
| 143 | 143 | |
| 144 | 144 | WRITE8_DEVICE_HANDLER(radio86_write_video) |
| 145 | 145 | { |
| 146 | i8275_dack_set_data( | |
| 146 | i8275_dack_set_data( | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | const dma8257_interface radio86_dma = |
| r5060 | r5061 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | static PIT8253_OUTPUT_CHANGED(bm2_pit_out0) |
| 162 | 162 | { |
| 163 | pic8259_set_irq_line( | |
| 163 | pic8259_set_irq_line( | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| r5060 | r5061 | |
| 329 | 329 | |
| 330 | 330 | MACHINE_START(b2m) |
| 331 | 331 | { |
| 332 | wd17xx_set_pause_time( | |
| 332 | wd17xx_set_pause_time( | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | static IRQ_CALLBACK(b2m_irq_callback) |
| 336 | 336 | { |
| 337 | return pic8259_acknowledge( | |
| 337 | return pic8259_acknowledge( | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | |
| r5060 | r5061 | |
| 346 | 346 | { |
| 347 | 347 | vblank_state++; |
| 348 | 348 | if (vblank_state>1) vblank_state=0; |
| 349 | pic8259_set_irq_line( | |
| 349 | pic8259_set_irq_line( | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | MACHINE_RESET(b2m) |
| r5060 | r5061 | |
|---|---|---|
| 1755 | 1755 | /* Floppy loading clean-up, part 1: with cbm_floppy_image_loading we can finally split c1551 from vc1541 |
| 1756 | 1756 | Both struct have a GCR_data gcr component where we store the floppy data, but remaining parts are finally separated! |
| 1757 | 1757 | Later, everything should be changed to use devices for the drives... */ |
| 1758 | void cbm_floppy_image_loading( int format, int id1, int id2, UINT8 *copy, GCR_data gcr ) | |
| 1758 | static void cbm_floppy_image_loading( int format, int id1, int id2, UINT8 *copy, GCR_data gcr ) | |
| 1759 | 1759 | { |
| 1760 | 1760 | UINT8 sector_checksum; |
| 1761 | 1761 | int i = 0, j, k, l, pos; |
| r5060 | r5061 | |
|---|---|---|
| 201 | 201 | |
| 202 | 202 | static TIMER_CALLBACK( mc6846_timer_expire ) |
| 203 | 203 | { |
| 204 | device_config* device = (device_config*) ptr; | |
| 204 | const device_config* device = (const device_config*) ptr; | |
| 205 | 205 | mc6846_t* mc6846 = get_safe_token( device ); |
| 206 | 206 | int delay = FACTOR * (mc6846->latch+1); |
| 207 | 207 | |
| r5060 | r5061 | |
| 246 | 246 | |
| 247 | 247 | static TIMER_CALLBACK( mc6846_timer_one_shot ) |
| 248 | 248 | { |
| 249 | device_config* device = (device_config*) ptr; | |
| 249 | const device_config* device = (const device_config*) ptr; | |
| 250 | 250 | mc6846_t* mc6846 = get_safe_token( device ); |
| 251 | 251 | LOG (( "%f: mc6846 timer one shot called\n", attotime_to_double(timer_get_time(device->machine)) )); |
| 252 | 252 |
| r5060 | r5061 | |
|---|---|---|
| 520 | 520 | switch (offset & 0x80) |
| 521 | 521 | { |
| 522 | 522 | case 0x80: /* ROM module 8255 */ |
| 523 | return ppi8255_r( | |
| 523 | return ppi8255_r( | |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | break; |
| r5060 | r5061 | |
| 540 | 540 | } |
| 541 | 541 | break; |
| 542 | 542 | case 0x40: /* 8255 (GPIO/0, GPIO/1) */ |
| 543 | return ppi8255_r( | |
| 543 | return ppi8255_r( | |
| 544 | 544 | case 0x50: /* 8253 */ |
| 545 | return pit8253_r( | |
| 545 | return pit8253_r( | |
| 546 | 546 | case 0x70: /* 8255 (IMS-2) */ |
| 547 | return ppi8255_r( | |
| 547 | return ppi8255_r( | |
| 548 | 548 | } |
| 549 | 549 | break; |
| 550 | 550 | case 0x80: /* external interfaces */ |
| r5060 | r5061 | |
| 594 | 594 | switch (offset & 0x80) |
| 595 | 595 | { |
| 596 | 596 | case 0x80: /* ROM module 8255 */ |
| 597 | ppi8255_w( | |
| 597 | ppi8255_w( | |
| 598 | 598 | break; |
| 599 | 599 | } |
| 600 | 600 | } |
| r5060 | r5061 | |
| 615 | 615 | } |
| 616 | 616 | break; |
| 617 | 617 | case 0x40: /* 8255 (GPIO/0, GPIO/0) */ |
| 618 | ppi8255_w( | |
| 618 | ppi8255_w( | |
| 619 | 619 | break; |
| 620 | 620 | case 0x50: /* 8253 */ |
| 621 | pit8253_w( | |
| 621 | pit8253_w( | |
| 622 | 622 | logerror ("8253 writing. Address: %02x, Data: %02x\n", offset, data); |
| 623 | 623 | break; |
| 624 | 624 | case 0x70: /* 8255 (IMS-2) */ |
| 625 | ppi8255_w( | |
| 625 | ppi8255_w( | |
| 626 | 626 | break; |
| 627 | 627 | } |
| 628 | 628 | break; |
| r5060 | r5061 | |
| 656 | 656 | switch (offset & 0x80) |
| 657 | 657 | { |
| 658 | 658 | case 0x80: /* Motherboard 8255 */ |
| 659 | return ppi8255_r( | |
| 659 | return ppi8255_r( | |
| 660 | 660 | } |
| 661 | 661 | break; |
| 662 | 662 | } |
| r5060 | r5061 | |
| 679 | 679 | switch (offset & 0x80) |
| 680 | 680 | { |
| 681 | 681 | case 0x80: /* Motherboard 8255 */ |
| 682 | ppi8255_w( | |
| 682 | ppi8255_w( | |
| 683 | 683 | break; |
| 684 | 684 | } |
| 685 | 685 | break; |
| r5060 | r5061 | |
| 901 | 901 | |
| 902 | 902 | static TIMER_CALLBACK( setup_machine_state ) |
| 903 | 903 | { |
| 904 | device_config *pit8253 = | |
| 904 | const device_config *pit8253 = | |
| 905 | 905 | |
| 906 | 906 | pit8253_gate_w(pit8253, 0, 1); |
| 907 | 907 | pit8253_gate_w(pit8253, 1, 1); |
| r5060 | r5061 | |
|---|---|---|
| 174 | 174 | c128_irq (device->machine, level || vicirq); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | void c128_vic_interrupt (running_machine *machine, int level) | |
| 177 | static void c128_vic_interrupt (running_machine *machine, int level) | |
| 178 | 178 | { |
| 179 | 179 | const device_config *cia_0 = devtag_get_device(machine, "cia_0"); |
| 180 | 180 | #if 1 |
| r5060 | r5061 | |
|---|---|---|
| 415 | 415 | dma8237_drq_write( at_devices.dma8237_1, FDC_DMA, state); |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | static device_config * | |
| 418 | static const device_config * | |
| 419 | 419 | { |
| 420 | return | |
| 420 | return | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | static const struct pc_fdc_interface fdc_interface = |
| r5060 | r5061 | |
|---|---|---|
| 124 | 124 | }; |
| 125 | 125 | |
| 126 | 126 | READ8_HANDLER(vector_8255_1_r) { |
| 127 | return ppi8255_r( | |
| 127 | return ppi8255_r( | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | WRITE8_HANDLER(vector_8255_1_w) { |
| 131 | ppi8255_w( | |
| 131 | ppi8255_w( | |
| 132 | 132 | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | READ8_HANDLER(vector_8255_2_r) { |
| 136 | return ppi8255_r( | |
| 136 | return ppi8255_r( | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | WRITE8_HANDLER(vector_8255_2_w) { |
| 140 | ppi8255_w( | |
| 140 | ppi8255_w( | |
| 141 | 141 | |
| 142 | 142 | } |
| 143 | 143 |
| r5060 | r5061 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | READ8_HANDLER ( orion128_system_r ) |
| 81 | 81 | { |
| 82 | return ppi8255_r( | |
| 82 | return ppi8255_r( | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | WRITE8_HANDLER ( orion128_system_w ) |
| 86 | 86 | { |
| 87 | ppi8255_w( | |
| 87 | ppi8255_w( | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | READ8_HANDLER ( orion128_romdisk_r ) |
| 91 | 91 | { |
| 92 | return ppi8255_r( | |
| 92 | return ppi8255_r( | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | WRITE8_HANDLER ( orion128_romdisk_w ) |
| 96 | 96 | { |
| 97 | ppi8255_w( | |
| 97 | ppi8255_w( | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | static void orion_set_video_mode(running_machine *machine, int width) |
| r5060 | r5061 | |
|---|---|---|
| 1623 | 1623 | vc1541_state(machine, drive); |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | void drive_reset_write( CBM_Drive * drive, int level ) | |
| 1626 | static void drive_reset_write( CBM_Drive * drive, int level ) | |
| 1627 | 1627 | { |
| 1628 | 1628 | if (level == 0) |
| 1629 | 1629 | { |
| r5060 | r5061 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | UINT8 code = 0; |
| 15 | 15 | |
| 16 | UINT8 llc1_key_state = 0; | |
| 16 | static UINT8 llc1_key_state = 0; | |
| 17 | 17 | |
| 18 | 18 | static READ8_DEVICE_HANDLER (llc1_port_b_r) |
| 19 | 19 | { |
| r5060 | r5061 | |
|---|---|---|
| 10 | 10 | #include "includes/z1013.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | |
| 13 | UINT8 z1013_keyboard_line; | |
| 14 | UINT8 z1013_keyboard_part; | |
| 13 | static UINT8 z1013_keyboard_line; | |
| 14 | static UINT8 z1013_keyboard_part; | |
| 15 | 15 | |
| 16 | 16 | /* Wires on Z80 PIO are switched */ |
| 17 | 17 | READ8_DEVICE_HANDLER(z1013_z80pio_r) |
| r5060 | r5061 | |
|---|---|---|
| 184 | 184 | switch (offset) { |
| 185 | 185 | case 1: |
| 186 | 186 | tandy_ppi.portb = data; |
| 187 | pit8253_gate_w( | |
| 187 | pit8253_gate_w( | |
| 188 | 188 | pc_speaker_set_spkrdata( space->machine, data & 0x02 ); |
| 189 | 189 | pc_keyb_set_clock(data&0x40); |
| 190 | 190 | if ( data & 0x80 ) { |
| r5060 | r5061 | |
|---|---|---|
| 154 | 154 | pc1640.port61=data; |
| 155 | 155 | if (data==0x30) pc1640.port62=(pc1640.port65&0x10)>>4; |
| 156 | 156 | else if (data==0x34) pc1640.port62=pc1640.port65&0xf; |
| 157 | pit8253_gate_w( | |
| 157 | pit8253_gate_w( | |
| 158 | 158 | pc_speaker_set_spkrdata( space->machine, data & 0x02 ); |
| 159 | 159 | pc_keyb_set_clock(data&0x40); |
| 160 | 160 | break; |
| r5060 | r5061 | |
|---|---|---|
| 306 | 306 | return address; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | void reset_lx388(running_machine *machine) | |
| 309 | static void reset_lx388(running_machine *machine) | |
| 310 | 310 | { |
| 311 | 311 | lx388_kr2376 = devtag_get_device(machine, "lx388_kr2376"); |
| 312 | 312 | kr2376_set_input_pin( lx388_kr2376, KR2376_DSII, 0); |
| 313 | 313 | kr2376_set_input_pin( lx388_kr2376, KR2376_PII, 0); |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | void reset_lx382_banking(running_machine *machine) | |
| 316 | static void reset_lx382_banking(running_machine *machine) | |
| 317 | 317 | { |
| 318 | 318 | const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM); |
| 319 | 319 | |
| r5060 | r5061 | |
| 326 | 326 | memory_set_direct_update_handler(space, reset_delay_count); |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | void reset_lx390_banking(running_machine *machine) | |
| 329 | static void reset_lx390_banking(running_machine *machine) | |
| 330 | 330 | { |
| 331 | 331 | const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM); |
| 332 | 332 | reset_delay_counter = 0; |
| r5060 | r5061 | |
| 386 | 386 | */ |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | MACHINE_RESET(z80ne_base) | |
| 389 | static MACHINE_RESET(z80ne_base) | |
| 390 | 390 | { |
| 391 | 391 | int i; |
| 392 | 392 | const address_space *space = cputag_get_address_space(machine, "z80ne", ADDRESS_SPACE_PROGRAM); |
| r5060 | r5061 | |
|---|---|---|
| 1324 | 1324 | static int adb_keybinitialized, adb_keyb_wanted_srq; |
| 1325 | 1325 | |
| 1326 | 1326 | #if LOG_ADB |
| 1327 | static const char *adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" }; | |
| 1327 | static const char *const adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" }; | |
| 1328 | 1328 | #endif |
| 1329 | 1329 | |
| 1330 | 1330 | static void mac_adb_pollmouse(running_machine *machine) |
| r5060 | r5061 | |
|---|---|---|
| 329 | 329 | /* calendar R/W */ |
| 330 | 330 | VLOG(("concept_io_r: Calendar read at address 0x03%4.4x\n", offset << 1)); |
| 331 | 331 | if (!clock_enable) |
| 332 | return mm58274c_r( | |
| 332 | return mm58274c_r( | |
| 333 | 333 | break; |
| 334 | 334 | |
| 335 | 335 | case 7: |
| r5060 | r5061 | |
| 471 | 471 | /* calendar R/W */ |
| 472 | 472 | LOG(("concept_io_w: Calendar written to at address 0x03%4.4x, data: 0x%4.4x\n", offset << 1, data)); |
| 473 | 473 | if (!clock_enable) |
| 474 | mm58274c_w( | |
| 474 | mm58274c_w( | |
| 475 | 475 | break; |
| 476 | 476 | |
| 477 | 477 | case 7: |
| r5060 | r5061 | |
|---|---|---|
| 1178 | 1178 | /* initialize floppy */ |
| 1179 | 1179 | { |
| 1180 | 1180 | if (lisa_features.floppy_hardware == sony_lisa2) |
| 1181 | sony_set_enable_lines( | |
| 1181 | sony_set_enable_lines( | |
| 1182 | 1182 | } |
| 1183 | 1183 | } |
| 1184 | 1184 | |
| r5060 | r5061 | |
| 1327 | 1327 | /*if (lisa_features.floppy_hardware == twiggy) |
| 1328 | 1328 | twiggy_set_head_line(offset & 1); |
| 1329 | 1329 | else*/ if (lisa_features.floppy_hardware == sony_lisa210) |
| 1330 | sony_set_sel_line( | |
| 1330 | sony_set_sel_line( | |
| 1331 | 1331 | break; |
| 1332 | 1332 | case 6: |
| 1333 | 1333 | DISK_DIAG = offset & 1; |
| r5060 | r5061 | |
|---|---|---|
| 15 | 15 | static const device_config *kaypro_printer; |
| 16 | 16 | static const device_config *kaypro_fdc; |
| 17 | 17 | |
| 18 | UINT8 kaypro_system_port; | |
| 18 | static UINT8 kaypro_system_port; | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | /*********************************************************** |
| r5060 | r5061 | |
|---|---|---|
| 419 | 419 | case 0xf13d: |
| 420 | 420 | case 0xf13e: |
| 421 | 421 | case 0xf13f: |
| 422 | return mm58274c_r( | |
| 422 | return mm58274c_r( | |
| 423 | 423 | |
| 424 | 424 | default: |
| 425 | 425 | logerror("unmapped read offs=%d\n", (int) offset); |
| r5060 | r5061 | |
| 465 | 465 | case 0x801d: |
| 466 | 466 | case 0x801e: |
| 467 | 467 | case 0x801f: |
| 468 | return mm58274c_r( | |
| 468 | return mm58274c_r( | |
| 469 | 469 | |
| 470 | 470 | default: |
| 471 | 471 | logerror("unmapped read offs=%d\n", (int) offset); |
| r5060 | r5061 | |
| 682 | 682 | case 0xf13d: |
| 683 | 683 | case 0xf13e: |
| 684 | 684 | case 0xf13f: |
| 685 | mm58274c_w( | |
| 685 | mm58274c_w( | |
| 686 | 686 | return; |
| 687 | 687 | |
| 688 | 688 | default: |
| r5060 | r5061 | |
| 731 | 731 | case 0x801d: |
| 732 | 732 | case 0x801e: |
| 733 | 733 | case 0x801f: |
| 734 | mm58274c_w( | |
| 734 | mm58274c_w( | |
| 735 | 735 | return; |
| 736 | 736 | |
| 737 | 737 | default: |
| r5060 | r5061 | |
|---|---|---|
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | const wd17xx_interface beta_wd17xx_interface = { betadisk_wd179x_callback, NULL }; | |
| 105 | static const wd17xx_interface beta_wd17xx_interface = { betadisk_wd179x_callback, NULL }; | |
| 106 | 106 | |
| 107 | 107 | READ8_DEVICE_HANDLER(betadisk_status_r) |
| 108 | 108 | { |
| r5060 | r5061 | |
|---|---|---|
| 147 | 147 | switch ((offset >> 4) & 0x3) |
| 148 | 148 | { |
| 149 | 149 | case 0: |
| 150 | return ppi8255_r( | |
| 150 | return ppi8255_r( | |
| 151 | 151 | |
| 152 | 152 | case 1: |
| 153 | return ppi8255_r( | |
| 153 | return ppi8255_r( | |
| 154 | 154 | |
| 155 | 155 | case 2: |
| 156 | 156 | case 3: |
| r5060 | r5061 | |
| 183 | 183 | switch ((offset >> 4) & 0x3) |
| 184 | 184 | { |
| 185 | 185 | case 0: |
| 186 | ppi8255_w( | |
| 186 | ppi8255_w( | |
| 187 | 187 | break; |
| 188 | 188 | |
| 189 | 189 | case 1: |
| 190 | ppi8255_w( | |
| 190 | ppi8255_w( | |
| 191 | 191 | break; |
| 192 | 192 | |
| 193 | 193 | case 2: |
| r5060 | r5061 | |
|---|---|---|
| 724 | 724 | |
| 725 | 725 | static UINT8 load_8255_A(running_machine *machine, int chip) |
| 726 | 726 | { |
| 727 | return use_5FD ? ppi8255_get_port_b( | |
| 727 | return use_5FD ? ppi8255_get_port_b( | |
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | static UINT8 load_8255_B(running_machine *machine, int chip) |
| 731 | 731 | { |
| 732 | return use_5FD ? ppi8255_get_port_a( | |
| 732 | return use_5FD ? ppi8255_get_port_a( | |
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | static UINT8 load_8255_C(running_machine *machine, int chip) |
| r5060 | r5061 | |
| 739 | 739 | |
| 740 | 740 | if (use_5FD) |
| 741 | 741 | { |
| 742 | port_c = ppi8255_get_port_c( | |
| 742 | port_c = ppi8255_get_port_c( | |
| 743 | 743 | result = ((port_c >> 4) & 0x0F) | ((port_c << 4) & 0xF0); |
| 744 | 744 | } |
| 745 | 745 |
| r5060 | r5061 | |
|---|---|---|
| 29 | 29 | void (*pc_fdc_interrupt)(running_machine*,int); |
| 30 | 30 | void (*pc_fdc_dma_drq)(running_machine*,int,int); |
| 31 | 31 | 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*); | |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | extern const nec765_interface pc_fdc_nec765_connected_interface; |
| r5060 | r5061 | |
|---|---|---|
| 391 | 391 | /* bottom halves, called to continue / finish a command after some delay */ |
| 392 | 392 | static TIMER_CALLBACK( mc6843_cont ) |
| 393 | 393 | { |
| 394 | device_config* device = (device_config*) ptr; | |
| 394 | const device_config* device = (const device_config*) ptr; | |
| 395 | 395 | mc6843_t* mc6843 = get_safe_token( device ); |
| 396 | 396 | int cmd = mc6843->CMR & 0x0f; |
| 397 | 397 |
| r5060 | r5061 | |
|---|---|---|
| 119 | 119 | static UINT32 bebox_crossproc_interrupts; |
| 120 | 120 | |
| 121 | 121 | static 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; | |
| 126 | 126 | } bebox_devices; |
| 127 | 127 | |
| 128 | 128 | |
| r5060 | r5061 | |
| 431 | 431 | return image_from_devtype_and_index(machine, IO_FLOPPY, 0); |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | static device_config * bebox_get_device(running_machine *machine ) | |
| 434 | static const device_config * bebox_get_device(running_machine *machine ) | |
| 435 | 435 | { |
| 436 | return | |
| 436 | return | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
| r5060 | r5061 | |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | 874 | static int bebox_get_out2(running_machine *machine) { |
| 875 | return pit8253_get_output( | |
| 875 | return pit8253_get_output( | |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | static const struct kbdc8042_interface bebox_8042_interface = |
| r5060 | r5061 | |
| 1061 | 1061 | |
| 1062 | 1062 | |
| 1063 | 1063 | static 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"); | |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 |
| r5060 | r5061 | |
|---|---|---|
| 132 | 132 | |
| 133 | 133 | READ8_HANDLER( specialist_keyboard_r ) |
| 134 | 134 | { |
| 135 | return ppi8255_r( | |
| 135 | return ppi8255_r( | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | WRITE8_HANDLER( specialist_keyboard_w ) |
| 139 | 139 | { |
| 140 | ppi8255_w( | |
| 140 | ppi8255_w( | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| r5060 | r5061 | |
| 259 | 259 | |
| 260 | 260 | static TIMER_CALLBACK( setup_pit8253_gates ) |
| 261 | 261 | { |
| 262 | device_config *pit8253 = | |
| 262 | const device_config *pit8253 = | |
| 263 | 263 | |
| 264 | 264 | pit8253_gate_w(pit8253, 0, 0); |
| 265 | 265 | pit8253_gate_w(pit8253, 1, 0); |
| r5060 | r5061 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | static UINT8 memory_block[16]; |
| 15 | 15 | UINT8 pp01_video_scroll; |
| 16 | UINT8 pp01_video_write_mode; | |
| 16 | static UINT8 pp01_video_write_mode; | |
| 17 | 17 | |
| 18 | 18 | WRITE8_HANDLER (pp01_video_write_mode_w) |
| 19 | 19 | { |
| r5060 | r5061 | |
| 202 | 202 | pp01_video_scroll = data; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | UINT8 pp01_key_line = 0; | |
| 205 | static UINT8 pp01_key_line = 0; | |
| 206 | 206 | static READ8_DEVICE_HANDLER (pp01_8255_portb_r ) |
| 207 | 207 | { |
| 208 | 208 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", |
| r5060 | r5061 | |
|---|---|---|
| 1236 | 1236 | { |
| 1237 | 1237 | apple2_fdc_diskreg = data & 0xC0; |
| 1238 | 1238 | if (apple2_fdc_has_35(machine)) |
| 1239 | sony_set_sel_line( | |
| 1239 | sony_set_sel_line( | |
| 1240 | 1240 | } |
| 1241 | 1241 | |
| 1242 | 1242 |
| r5060 | r5061 | |
|---|---|---|
| 1113 | 1113 | dma8237_drq_write( pc_devices.dma8237, FDC_DMA, state); |
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | static device_config * pc_get_device(running_machine *machine ) | |
| 1116 | static const device_config * pc_get_device(running_machine *machine ) | |
| 1117 | 1117 | { |
| 1118 | return | |
| 1118 | return | |
| 1119 | 1119 | } |
| 1120 | 1120 | |
| 1121 | 1121 | static const struct pc_fdc_interface fdc_interface_nc = |
| r5060 | r5061 | |
|---|---|---|
| 249 | 249 | /* todo: how many input ports does the PCE have? */ |
| 250 | 250 | WRITE8_HANDLER ( pce_joystick_w ) |
| 251 | 251 | { |
| 252 | h6280io_set_buffer( | |
| 252 | h6280io_set_buffer( | |
| 253 | 253 | /* bump counter on a low-to-high transition of bit 1 */ |
| 254 | 254 | if((!joystick_data_select) && (data & JOY_CLOCK)) |
| 255 | 255 | { |
| r5060 | r5061 | |
|---|---|---|
| 226 | 226 | */ |
| 227 | 227 | |
| 228 | 228 | /* descriptor for console GROMs */ |
| 229 | GROM_port_t console_GROMs; | |
| 229 | static GROM_port_t console_GROMs; | |
| 230 | 230 | |
| 231 | 231 | /* true if hsgpl is enabled (i.e. has_hsgpl is true and hsgpl cru bit crdena is |
| 232 | 232 | set) */ |
| r5060 | r5061 | |
| 258 | 258 | /* NPW 23-Feb-2004 - externs no longer needed because we now use cpu_adjust_icount(cputag_get_cpu(space->machine, "maincpu"),) */ |
| 259 | 259 | |
| 260 | 260 | /* Link to the cartridge system. */ |
| 261 | const device_config *cartslots; | |
| 261 | static const device_config *cartslots; | |
| 262 | 262 | |
| 263 | 263 | /*===========================================================================*/ |
| 264 | 264 | /* |
| r5060 | r5061 | |
| 1084 | 1084 | GROM read for TI-99/8 |
| 1085 | 1085 | For comments, see the handler for TI-99/4A |
| 1086 | 1086 | */ |
| 1087 | READ8_HANDLER ( ti99_grom_r8 ) | |
| 1087 | static READ8_HANDLER ( ti99_grom_r8 ) | |
| 1088 | 1088 | { |
| 1089 | 1089 | UINT8 reply; |
| 1090 | 1090 | |
| r5060 | r5061 | |
| 1119 | 1119 | GROM write for TI-99/8 |
| 1120 | 1120 | For comments, see the handler for TI-99/4A |
| 1121 | 1121 | */ |
| 1122 | WRITE8_HANDLER ( ti99_grom_w8 ) | |
| 1122 | static WRITE8_HANDLER ( ti99_grom_w8 ) | |
| 1123 | 1123 | { |
| 1124 | 1124 | cpu_adjust_icount(space->machine->cpu[0],-4/*20+3*/); /* from 4 to 23? */ |
| 1125 | 1125 |
| r5060 | r5061 | |
|---|---|---|
| 35 | 35 | int serin_delay; |
| 36 | 36 | } ATARI_FDC; |
| 37 | 37 | |
| 38 | ATARI_FDC atari_fdc; | |
| 38 | static ATARI_FDC atari_fdc; | |
| 39 | 39 | |
| 40 | 40 | typedef struct _atari_drive atari_drive; |
| 41 | 41 | struct _atari_drive |
| r5060 | r5061 | |
|---|---|---|
| 157 | 157 | MACHINE_START( ti99_4ev_60hz ); |
| 158 | 158 | MACHINE_RESET( ti99 ); |
| 159 | 159 | |
| 160 | DEVICE_START( ti99_cart ); | |
| 160 | // DEVICE_START( ti99_cart ); | |
| 161 | 161 | // DEVICE_IMAGE_LOAD( ti99_cart ); |
| 162 | 162 | // DEVICE_IMAGE_UNLOAD( ti99_cart ); |
| 163 | 163 | |
| r5060 | r5061 | |
| 172 | 172 | READ16_HANDLER ( ti99_nop_8_r ); |
| 173 | 173 | WRITE16_HANDLER ( ti99_nop_8_w ); |
| 174 | 174 | |
| 175 | READ8_HANDLER ( ti99_cart_cru_r ); | |
| 176 | WRITE8_HANDLER ( ti99_cart_cru_w ); | |
| 177 | ||
| 178 | READ16_HANDLER ( ti99_cart_r ); | |
| 179 | WRITE16_HANDLER ( ti99_cart_w ); | |
| 180 | 175 | READ16_HANDLER ( ti99_4p_cart_r ); |
| 181 | 176 | WRITE16_HANDLER ( ti99_4p_cart_w ); |
| 182 | 177 |
| r5060 | r5061 | |
|---|---|---|
| 625 | 625 | return acia6850_data_r(acia, 0); |
| 626 | 626 | } |
| 627 | 627 | if ((myo>=0x10) && (myo<=0x17)) return 0xfe; /* Serial System Chip */ |
| 628 | if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r( | |
| 628 | if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r( | |
| 629 | 629 | if ((myo>=0x20) && (myo<=0x23)) return 0xfe; /* VideoULA */ |
| 630 | 630 | if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd1770l_read(space, myo-0x24); /* 1770 */ |
| 631 | 631 | if ((myo>=0x28) && (myo<=0x2f)) return bbcm_wd1770_read(space, myo-0x28); /* disc control latch */ |
| r5060 | r5061 | |
| 664 | 664 | return acia6850_data_w(acia, 0, data); |
| 665 | 665 | } |
| 666 | 666 | if ((myo>=0x10) && (myo<=0x17)) BBC_SerialULA_w(space, myo-0x10,data); /* Serial System Chip */ |
| 667 | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w( | |
| 667 | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w( | |
| 668 | 668 | if ((myo>=0x20) && (myo<=0x23)) bbc_videoULA_w(space, myo-0x20,data); /* VideoULA */ |
| 669 | 669 | if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(space, myo-0x24,data); /* 1770 */ |
| 670 | 670 | if ((myo>=0x28) && (myo<=0x2f)) bbcm_wd1770_write(space, myo-0x28,data); /* disc control latch */ |
| r5060 | r5061 | |
| 1239 | 1239 | /* joystick EOC */ |
| 1240 | 1240 | static READ8_DEVICE_HANDLER( bbcb_via_system_read_cb1 ) |
| 1241 | 1241 | { |
| 1242 | return uPD7002_EOC_r( | |
| 1242 | return uPD7002_EOC_r( | |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | 1245 | |
| r5060 | r5061 | |
| 1519 | 1519 | static READ8_HANDLER( bbc_i8271_read ) |
| 1520 | 1520 | { |
| 1521 | 1521 | int ret; |
| 1522 | device_config *i8271 = | |
| 1522 | const device_config *i8271 = | |
| 1523 | 1523 | ret=0x0ff; |
| 1524 | 1524 | logerror("i8271 read %d ",offset); |
| 1525 | 1525 | switch (offset) |
| r5060 | r5061 | |
| 1545 | 1545 | |
| 1546 | 1546 | static WRITE8_HANDLER( bbc_i8271_write ) |
| 1547 | 1547 | { |
| 1548 | device_config *i8271 = | |
| 1548 | const device_config *i8271 = | |
| 1549 | 1549 | logerror("i8271 write %d %d\n",offset,data); |
| 1550 | 1550 | |
| 1551 | 1551 | switch (offset) |
| r5060 | r5061 | |
|---|---|---|
| 1247 | 1247 | } |
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | DEVICE_GET_INFO(ti99_cartridge_pcb_none) | |
| 1250 | static DEVICE_GET_INFO(ti99_cartridge_pcb_none) | |
| 1251 | 1251 | { |
| 1252 | 1252 | switch(state) |
| 1253 | 1253 | { |
| r5060 | r5061 | |
| 1270 | 1270 | DEVICE_GET_INFO_CALL(ti99_cart_common); |
| 1271 | 1271 | } |
| 1272 | 1272 | |
| 1273 | DEVICE_GET_INFO(ti99_cartridge_pcb_paged) | |
| 1273 | static DEVICE_GET_INFO(ti99_cartridge_pcb_paged) | |
| 1274 | 1274 | { |
| 1275 | 1275 | switch(state) |
| 1276 | 1276 | { |
| r5060 | r5061 | |
| 1341 | 1341 | } |
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | DEVICE_GET_INFO(ti99_cartridge_pcb_super) | |
| 1344 | static DEVICE_GET_INFO(ti99_cartridge_pcb_super) | |
| 1345 | 1345 | { |
| 1346 | 1346 | switch(state) |
| 1347 | 1347 | { |
| r5060 | r5061 | |
|---|---|---|
| 90 | 90 | |
| 91 | 91 | /* cartridge PCB types */ |
| 92 | 92 | DEVICE_GET_INFO(ti99_cartridge_pcb_std); |
| 93 | DEVICE_GET_INFO(ti99_cartridge_pcb_exbas); | |
| 94 | 93 | DEVICE_GET_INFO(ti99_cartridge_pcb_minimem); |
| 95 | DEVICE_GET_INFO(ti99_cartridge_pcb_supersp); | |
| 96 | 94 | DEVICE_GET_INFO(ti99_cartridge_pcb_mbx); |
| 97 | 95 | |
| 98 | 96 | READ16_DEVICE_HANDLER(ti99_multicart_r); |
| r5060 | r5061 | |
|---|---|---|
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | DEVICE_GET_INFO(aes_cartridge_pcb_none) | |
| 366 | static DEVICE_GET_INFO(aes_cartridge_pcb_none) | |
| 367 | 367 | { |
| 368 | 368 | switch(state) |
| 369 | 369 | { |
| r5060 | r5061 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "device.h" |
| 13 | 13 | #include "image.h" |
| 14 | #include "machine/mc6843.h" | |
| 15 | #include "machine/mc6854.h" | |
| 14 | 16 | |
| 17 | extern const mc6843_interface to7_6843_itf; | |
| 18 | extern const mc6854_interface to7_network_iface; | |
| 15 | 19 | |
| 16 | 20 | extern UINT8 to7_controller_type; /* set during init */ |
| 17 | 21 | extern UINT8 to7_floppy_bank; |
| r5060 | r5061 | |
|---|---|---|
| 90 | 90 | #define dmk_idam_crc(x) (((x)[5] << 8) + (x)[6]) |
| 91 | 91 | #define dmk_idam_set_crc(x, crc) (x)[5] = ((crc) >> 8); (x)[6] = ((crc) >> 0); |
| 92 | 92 | |
| 93 | const char *needle_data = "\x00\x00\x00\x00\x00\x00\x00\x00\xFB\xFB"; | |
| 94 | const char *needle_deleted_data_fa = "\x00\x00\x00\x00\x00\x00\x00\x00\xFA\xFA"; | |
| 95 | const char *needle_deleted_data_f8 = "\x00\x00\x00\x00\x00\x00\x00\x00\xF8\xF8"; | |
| 93 | static const char needle_data[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xFB\xFB"; | |
| 94 | static const char needle_deleted_data_fa[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xFA\xFA"; | |
| 95 | static const char needle_deleted_data_f8[] = "\x00\x00\x00\x00\x00\x00\x00\x00\xF8\xF8"; | |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | static struct dmk_tag *get_dmk_tag(floppy_image *floppy) |
| r5060 | r5061 | |
| 360 | 360 | return get_dmk_tag(floppy)->track_size; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | UINT8 * my_memmem(UINT8 *haystack, size_t haystacklen, | |
| 363 | static UINT8 * my_memmem(UINT8 *haystack, size_t haystacklen, | |
| 364 | 364 | UINT8 *needle, size_t needlelen) |
| 365 | 365 | { |
| 366 | 366 | register UINT8 *h = haystack; |
| r5060 | r5061 | |
|---|---|---|
| 10 | 10 | #include "cpu/m6800/m6800.h" |
| 11 | 11 | #include "video/mc6845.h" |
| 12 | 12 | |
| 13 | UINT8 rom_page; | |
| 13 | static UINT8 rom_page; | |
| 14 | 14 | |
| 15 | 15 | static READ8_HANDLER (rom_page_r) |
| 16 | 16 | { |
| r5060 | r5061 | |
|---|---|---|
| 11 | 11 | #include "mmd1.lh" |
| 12 | 12 | #include "mmd2.lh" |
| 13 | 13 | |
| 14 | WRITE8_HANDLER (mmd1_port0_w) | |
| 14 | static WRITE8_HANDLER (mmd1_port0_w) | |
| 15 | 15 | { |
| 16 | 16 | output_set_value("p0_7", BIT(data,7) ? 0 : 1); |
| 17 | 17 | output_set_value("p0_6", BIT(data,6) ? 0 : 1); |
| r5060 | r5061 | |
| 23 | 23 | output_set_value("p0_0", BIT(data,0) ? 0 : 1); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | WRITE8_HANDLER (mmd1_port1_w) | |
| 26 | static WRITE8_HANDLER (mmd1_port1_w) | |
| 27 | 27 | { |
| 28 | 28 | output_set_value("p1_7", BIT(data,7) ? 0 : 1); |
| 29 | 29 | output_set_value("p1_6", BIT(data,6) ? 0 : 1); |
| r5060 | r5061 | |
| 35 | 35 | output_set_value("p1_0", BIT(data,0) ? 0 : 1); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | WRITE8_HANDLER (mmd1_port2_w) | |
| 38 | static WRITE8_HANDLER (mmd1_port2_w) | |
| 39 | 39 | { |
| 40 | 40 | output_set_value("p2_7", BIT(data,7) ? 0 : 1); |
| 41 | 41 | output_set_value("p2_6", BIT(data,6) ? 0 : 1); |
| r5060 | r5061 | |
| 47 | 47 | output_set_value("p2_0", BIT(data,0) ? 0 : 1); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | READ8_HANDLER (mmd1_keyboard_r) | |
| 50 | static READ8_HANDLER (mmd1_keyboard_r) | |
| 51 | 51 | { |
| 52 | 52 | UINT8 line1 = input_port_read(space->machine,"LINE1"); |
| 53 | 53 | UINT8 line2 = input_port_read(space->machine,"LINE2"); |
| r5060 | r5061 | |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | /* Input ports */ |
| 110 | INPUT_PORTS_START( mmd1 ) | |
| 110 | static INPUT_PORTS_START( mmd1 ) | |
| 111 | 111 | PORT_START("LINE1") |
| 112 | 112 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 113 | 113 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| r5060 | r5061 | |
| 131 | 131 | INPUT_PORTS_END |
| 132 | 132 | |
| 133 | 133 | |
| 134 | INPUT_PORTS_START( mmd2 ) | |
| 134 | static INPUT_PORTS_START( mmd2 ) | |
| 135 | 135 | /* |
| 136 | 136 | DIP switches: |
| 137 | 137 | WE 0 - Write enable for addresses $0000..$03FF |
| r5060 | r5061 | |
|---|---|---|
| 65 | 65 | #include "video/m6847.h" |
| 66 | 66 | #include "sound/ay8910.h" |
| 67 | 67 | |
| 68 | UINT8 *pc6001_ram; | |
| 69 | UINT8 *pc6001_video_ram; | |
| 68 | static UINT8 *pc6001_ram; | |
| 69 | static UINT8 *pc6001_video_ram; | |
| 70 | 70 | |
| 71 | WRITE8_HANDLER ( pc6001_system_latch_w ) | |
| 71 | static WRITE8_HANDLER ( pc6001_system_latch_w ) | |
| 72 | 72 | { |
| 73 | 73 | UINT16 startaddr[] = {0xC000, 0xE000, 0x8000, 0xA000 }; |
| 74 | 74 | |
| r5060 | r5061 | |
| 98 | 98 | return gfx[ch*16+line]; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | UINT8 port_c_8255; | |
| 101 | static UINT8 port_c_8255; | |
| 102 | 102 | |
| 103 | READ8_DEVICE_HANDLER(nec_ppi8255_r) { | |
| 103 | static READ8_DEVICE_HANDLER(nec_ppi8255_r) { | |
| 104 | 104 | if (offset==2) { |
| 105 | 105 | return port_c_8255; |
| 106 | 106 | } else { |
| r5060 | r5061 | |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | WRITE8_DEVICE_HANDLER(nec_ppi8255_w) { | |
| 111 | static WRITE8_DEVICE_HANDLER(nec_ppi8255_w) { | |
| 112 | 112 | if (offset==3) { |
| 113 | 113 | if(data & 1) { |
| 114 | 114 | port_c_8255 |= 1<<((data>>1)&0x07); |
| r5060 | r5061 | |
| 127 | 127 | ppi8255_w(device,offset,data); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | WRITE8_DEVICE_HANDLER(pc6100_ay8910_address_w) { | |
| 130 | static WRITE8_DEVICE_HANDLER(pc6100_ay8910_address_w) { | |
| 131 | 131 | ay8910_address_w(device,offset,data & 0x0f); |
| 132 | 132 | } |
| 133 | 133 | |
| r5060 | r5061 | |
| 149 | 149 | ADDRESS_MAP_END |
| 150 | 150 | |
| 151 | 151 | /* Input ports */ |
| 152 | INPUT_PORTS_START( pc6001 ) | |
| 152 | static INPUT_PORTS_START( pc6001 ) | |
| 153 | 153 | PORT_START("LINE0") |
| 154 | 154 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 155 | 155 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| r5060 | r5061 | |
| 161 | 161 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 162 | 162 | INPUT_PORTS_END |
| 163 | 163 | |
| 164 | UINT8 irq_vector = 0x00; | |
| 164 | static UINT8 irq_vector = 0x00; | |
| 165 | 165 | |
| 166 | INTERRUPT_GEN( pc6001_interrupt ) | |
| 166 | static INTERRUPT_GEN( pc6001_interrupt ) | |
| 167 | 167 | { |
| 168 | 168 | irq_vector = 0x16; |
| 169 | 169 | cpu_set_input_line(device, 0, HOLD_LINE); |
| r5060 | r5061 | |
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | |
| 228 | const ppi8255_interface pc6001_ppi8255_interface = | |
| 228 | static const ppi8255_interface pc6001_ppi8255_interface = | |
| 229 | 229 | { |
| 230 | 230 | DEVCB_HANDLER(pc6001_8255_porta_r), |
| 231 | 231 | DEVCB_HANDLER(pc6001_8255_portb_r), |
| r5060 | r5061 | |
| 235 | 235 | DEVCB_HANDLER(pc6001_8255_portc_w) |
| 236 | 236 | }; |
| 237 | 237 | |
| 238 | const msm8251_interface pc6001_usart_interface= | |
| 238 | static const msm8251_interface pc6001_usart_interface= | |
| 239 | 239 | { |
| 240 | 240 | NULL, |
| 241 | 241 | NULL, |
| r5060 | r5061 | |
|---|---|---|
| 800 | 800 | MDRV_CPU_PROGRAM_MAP( pc1255_mem) |
| 801 | 801 | MACHINE_DRIVER_END |
| 802 | 802 | |
| 803 | NVRAM_HANDLER( pc1260 ) | |
| 803 | static NVRAM_HANDLER( pc1260 ) | |
| 804 | 804 | { |
| 805 | 805 | const device_config *main_cpu = cputag_get_cpu(machine, "maincpu"); |
| 806 | 806 | UINT8 *ram = memory_region(machine, "maincpu") + 0x4000; |
| r5060 | r5061 | |
|---|---|---|
| 20 | 20 | ADDRESS_MAP_END |
| 21 | 21 | |
| 22 | 22 | /* Input ports */ |
| 23 | INPUT_PORTS_START( chessmst ) | |
| 23 | static INPUT_PORTS_START( chessmst ) | |
| 24 | 24 | INPUT_PORTS_END |
| 25 | 25 | |
| 26 | 26 |
| r5060 | r5061 | |
|---|---|---|
| 189 | 189 | |
| 190 | 190 | static int ROMSelection; |
| 191 | 191 | |
| 192 | static device_config* beta; | |
| 192 | static const device_config* beta; | |
| 193 | 193 | |
| 194 | 194 | //static UINT8 *rom_pointer; |
| 195 | 195 | |
| r5060 | r5061 | |
| 302 | 302 | static MACHINE_RESET( scorpion ) |
| 303 | 303 | { |
| 304 | 304 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 305 | beta = | |
| 305 | beta = | |
| 306 | 306 | |
| 307 | 307 | memory_install_read8_handler (space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1)); |
| 308 | 308 |
| r5060 | r5061 | |
|---|---|---|
| 310 | 310 | |
| 311 | 311 | /****************************************************************************************************/ |
| 312 | 312 | |
| 313 | INPUT_PORTS_START( spec_joys ) | |
| 313 | static INPUT_PORTS_START( spec_joys ) | |
| 314 | 314 | PORT_START("JOY_INTF") |
| 315 | 315 | PORT_CATEGORY_CLASS( 0x0f, 0x01, "Joystick Interface") |
| 316 | 316 | PORT_CATEGORY_ITEM( 0x00, "None (No Joystick)", 0 ) |
| r5060 | r5061 | |
|---|---|---|
| 116 | 116 | AM_RANGE(0x00860000, 0x00860001) AM_WRITE(cat_test_mode_w) // Test mode |
| 117 | 117 | ADDRESS_MAP_END |
| 118 | 118 | |
| 119 | UINT16 *swyft_video_ram; | |
| 119 | static UINT16 *swyft_video_ram; | |
| 120 | 120 | |
| 121 | 121 | static ADDRESS_MAP_START(swyft_mem, ADDRESS_SPACE_PROGRAM, 16) |
| 122 | 122 | ADDRESS_MAP_UNMAP_HIGH |
| r5060 | r5061 | |
| 125 | 125 | ADDRESS_MAP_END |
| 126 | 126 | |
| 127 | 127 | /* Input ports */ |
| 128 | INPUT_PORTS_START( cat ) | |
| 128 | static INPUT_PORTS_START( cat ) | |
| 129 | 129 | PORT_START("DIPSW1") |
| 130 | 130 | PORT_DIPNAME( 0x8000, 0x8000, "Mode" ) |
| 131 | 131 | PORT_DIPSETTING( 0x8000, DEF_STR( Normal ) ) |
| r5060 | r5061 | |
| 221 | 221 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("UNDO") PORT_CODE(KEYCODE_BACKSLASH) |
| 222 | 222 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+-") PORT_CODE(KEYCODE_TILDE) |
| 223 | 223 | INPUT_PORTS_END |
| 224 | INPUT_PORTS_START( swyft ) | |
| 224 | static INPUT_PORTS_START( swyft ) | |
| 225 | 225 | INPUT_PORTS_END |
| 226 | 226 | |
| 227 | 227 | |
| r5060 | r5061 | |
| 317 | 317 | { |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | UINT8 duart_inp = 0x0e; | |
| 320 | static UINT8 duart_inp = 0x0e; | |
| 321 | 321 | |
| 322 | 322 | static UINT8 duart_input(const device_config *device) |
| 323 | 323 | { |
| r5060 | r5061 | |
|---|---|---|
| 131 | 131 | }; |
| 132 | 132 | |
| 133 | 133 | |
| 134 | const z80sio_interface bw12_z80sio_intf = | |
| 134 | static const z80sio_interface bw12_z80sio_intf = | |
| 135 | 135 | { |
| 136 | 136 | 0, /* interrupt handler */ |
| 137 | 137 | 0, /* DTR changed handler */ |
| r5060 | r5061 | |
|---|---|---|
| 387 | 387 | return 0; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | const struct pit8253_config towns_pit8253_config = | |
| 390 | static const struct pit8253_config towns_pit8253_config = | |
| 391 | 391 | { |
| 392 | 392 | { |
| 393 | 393 | { |
| r5060 | r5061 | |
|---|---|---|
| 373 | 373 | PORT_BIT(0x80, 0x00, IPT_UNUSED) |
| 374 | 374 | INPUT_PORTS_END |
| 375 | 375 | |
| 376 | INPUT_PORTS_START( trs80m3 ) | |
| 376 | static INPUT_PORTS_START( trs80m3 ) | |
| 377 | 377 | PORT_INCLUDE (trs80) |
| 378 | 378 | PORT_START("E9") // these are the power-on uart settings |
| 379 | 379 | PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r5060 | r5061 | |
|---|---|---|
| 12 | 12 | #include "machine/beta.h" |
| 13 | 13 | |
| 14 | 14 | static int ROMSelection; |
| 15 | static device_config* beta; | |
| 15 | static const device_config* beta; | |
| 16 | 16 | |
| 17 | 17 | static DIRECT_UPDATE_HANDLER( atm_direct ) |
| 18 | 18 | { |
| r5060 | r5061 | |
| 95 | 95 | static MACHINE_RESET( atm ) |
| 96 | 96 | { |
| 97 | 97 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 98 | beta = | |
| 98 | beta = | |
| 99 | 99 | |
| 100 | 100 | memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1)); |
| 101 | 101 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| r5060 | r5061 | |
|---|---|---|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | const z80pio_interface nanos_z80pio_intf = | |
| 133 | static const z80pio_interface nanos_z80pio_intf = | |
| 134 | 134 | { |
| 135 | 135 | DEVCB_NULL, /* callback when change interrupt status */ |
| 136 | 136 | DEVCB_HANDLER(nanos_port_a_r), |
| r5060 | r5061 | |
|---|---|---|
| 23 | 23 | ADDRESS_MAP_END |
| 24 | 24 | |
| 25 | 25 | /* Input ports */ |
| 26 | INPUT_PORTS_START( z9001 ) | |
| 26 | static INPUT_PORTS_START( z9001 ) | |
| 27 | 27 | INPUT_PORTS_END |
| 28 | 28 | |
| 29 | 29 |
| r5060 | r5061 | |
|---|---|---|
| 88 | 88 | * when kana is active. |
| 89 | 89 | */ |
| 90 | 90 | // TODO: fill in shift,ctrl,graph and kana code |
| 91 | const UINT16 fm7_key_list[0x60][5] = | |
| 91 | static const UINT16 fm7_key_list[0x60][5] = | |
| 92 | 92 | { // norm shift ctrl graph kana |
| 93 | 93 | {0x00, 0x00, 0x00, 0x00, 0x00}, |
| 94 | 94 | {0x1b, 0x1b, 0x1b, 0x1b, 0x1b}, // ESC |
| r5060 | r5061 | |
| 205 | 205 | * bit 7 - SYNDET |
| 206 | 206 | * |
| 207 | 207 | */ |
| 208 | WRITE8_HANDLER( fm7_irq_mask_w ) | |
| 208 | static WRITE8_HANDLER( fm7_irq_mask_w ) | |
| 209 | 209 | { |
| 210 | 210 | irq_mask = data; |
| 211 | 211 | logerror("IRQ mask set: 0x%02x\n",irq_mask); |
| r5060 | r5061 | |
| 224 | 224 | * bit 6 - ??buzzer on/off |
| 225 | 225 | * bit 7 - ??buzzer on/off |
| 226 | 226 | */ |
| 227 | READ8_HANDLER( fm7_irq_cause_r ) | |
| 227 | static READ8_HANDLER( fm7_irq_cause_r ) | |
| 228 | 228 | { |
| 229 | 229 | UINT8 ret = ~irq_flags; |
| 230 | 230 | |
| r5060 | r5061 | |
| 233 | 233 | return ret; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | READ8_HANDLER( vector_r ) | |
| 236 | static READ8_HANDLER( vector_r ) | |
| 237 | 237 | { |
| 238 | 238 | UINT8* RAM = memory_region(space->machine,"maincpu"); |
| 239 | 239 | |
| 240 | 240 | return RAM[0xfff0+offset]; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | WRITE8_HANDLER( vector_w ) | |
| 243 | static WRITE8_HANDLER( vector_w ) | |
| 244 | 244 | { |
| 245 | 245 | UINT8* RAM = memory_region(space->machine,"maincpu"); |
| 246 | 246 | |
| r5060 | r5061 | |
| 253 | 253 | * bit 0 - attention IRQ active, clears flag when read. |
| 254 | 254 | * bit 1 - break key active |
| 255 | 255 | */ |
| 256 | READ8_HANDLER( fm7_fd04_r ) | |
| 256 | static READ8_HANDLER( fm7_fd04_r ) | |
| 257 | 257 | { |
| 258 | 258 | UINT8 ret = 0xff; |
| 259 | 259 | |
| r5060 | r5061 | |
| 275 | 275 | * On read, enables BASIC ROM at 0x8000 (default) |
| 276 | 276 | * On write, disables BASIC ROM, enables RAM (if more than 32kB) |
| 277 | 277 | */ |
| 278 | READ8_HANDLER( fm7_rom_en_r ) | |
| 278 | static READ8_HANDLER( fm7_rom_en_r ) | |
| 279 | 279 | { |
| 280 | 280 | UINT8* RAM = memory_region(space->machine,"maincpu"); |
| 281 | 281 | |
| r5060 | r5061 | |
| 286 | 286 | return 0x00; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | WRITE8_HANDLER( fm7_rom_en_w ) | |
| 289 | static WRITE8_HANDLER( fm7_rom_en_w ) | |
| 290 | 290 | { |
| 291 | 291 | UINT8* RAM = memory_region(space->machine,"maincpu"); |
| 292 | 292 | |
| r5060 | r5061 | |
| 300 | 300 | * Main CPU: I/O ports 0xfd18 - 0xfd1f |
| 301 | 301 | * Floppy Disk Controller (MB8877A) |
| 302 | 302 | */ |
| 303 | WD17XX_CALLBACK( fm7_fdc_irq ) | |
| 303 | static WD17XX_CALLBACK( fm7_fdc_irq ) | |
| 304 | 304 | { |
| 305 | 305 | switch(state) |
| 306 | 306 | { |
| r5060 | r5061 | |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | READ8_HANDLER( fm7_fdc_r ) | |
| 322 | static READ8_HANDLER( fm7_fdc_r ) | |
| 323 | 323 | { |
| 324 | 324 | const device_config* dev = devtag_get_device(space->machine,"fdc"); |
| 325 | 325 | UINT8 ret = 0; |
| r5060 | r5061 | |
| 353 | 353 | return 0x00; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | WRITE8_HANDLER( fm7_fdc_w ) | |
| 356 | static WRITE8_HANDLER( fm7_fdc_w ) | |
| 357 | 357 | { |
| 358 | 358 | const device_config* dev = devtag_get_device(space->machine,"fdc"); |
| 359 | 359 | switch(offset) |
| r5060 | r5061 | |
| 408 | 408 | * bit (MSB) in bit 7 of fd/d400. 0xfd00 also holds a flag for the main |
| 409 | 409 | * CPU clock speed in bit 0 (0 = 1.2MHz, 1 = 2MHz) |
| 410 | 410 | */ |
| 411 | READ8_HANDLER( fm7_keyboard_r) | |
| 411 | static READ8_HANDLER( fm7_keyboard_r) | |
| 412 | 412 | { |
| 413 | 413 | UINT8 ret; |
| 414 | 414 | switch(offset) |
| r5060 | r5061 | |
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | READ8_HANDLER( fm7_sub_keyboard_r) | |
| 427 | static READ8_HANDLER( fm7_sub_keyboard_r) | |
| 428 | 428 | { |
| 429 | 429 | UINT8 ret; |
| 430 | 430 | switch(offset) |
| r5060 | r5061 | |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | READ8_HANDLER( fm7_cassette_printer_r ) | |
| 442 | static READ8_HANDLER( fm7_cassette_printer_r ) | |
| 443 | 443 | { |
| 444 | 444 | // bit 7: cassette input |
| 445 | 445 | // bit 5: printer DET2 |
| r5060 | r5061 | |
| 492 | 492 | return ret; |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | WRITE8_HANDLER( fm7_cassette_printer_w ) | |
| 495 | static WRITE8_HANDLER( fm7_cassette_printer_w ) | |
| 496 | 496 | { |
| 497 | 497 | static UINT8 prev; |
| 498 | 498 | switch(offset) |
| r5060 | r5061 | |
| 752 | 752 | // When a key is pressed or released, an IRQ is generated on the main CPU, |
| 753 | 753 | // and an FIRQ on the sub CPU. Both CPUs have ports to read keyboard data. |
| 754 | 754 | // Scancodes are 9 bits. |
| 755 | void key_press(running_machine* machine, UINT16 scancode) | |
| 755 | static void key_press(running_machine* machine, UINT16 scancode) | |
| 756 | 756 | { |
| 757 | 757 | current_scancode = scancode; |
| 758 | 758 | |
| r5060 | r5061 | |
| 952 | 952 | ADDRESS_MAP_END |
| 953 | 953 | |
| 954 | 954 | /* Input ports */ |
| 955 | INPUT_PORTS_START( fm7 ) | |
| 955 | static INPUT_PORTS_START( fm7 ) | |
| 956 | 956 | |
| 957 | 957 | PORT_START("key1") |
| 958 | 958 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED) |
| r5060 | r5061 | |
|---|---|---|
| 21 | 21 | ADDRESS_MAP_END |
| 22 | 22 | |
| 23 | 23 | /* Input ports */ |
| 24 | INPUT_PORTS_START( exp85 ) | |
| 24 | static INPUT_PORTS_START( exp85 ) | |
| 25 | 25 | INPUT_PORTS_END |
| 26 | 26 | |
| 27 | 27 |
| r5060 | r5061 | |
|---|---|---|
| 141 | 141 | AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0x0) /* Kickstart */ |
| 142 | 142 | ADDRESS_MAP_END |
| 143 | 143 | |
| 144 | int cd32_input_port_val = 0; | |
| 145 | int cd32_input_select = 0; | |
| 146 | UINT16 potgo_value = 0; | |
| 147 | int cd32_shifter[2]; | |
| 144 | //int cd32_input_port_val = 0; | |
| 145 | //int cd32_input_select = 0; | |
| 146 | static UINT16 potgo_value = 0; | |
| 147 | static int cd32_shifter[2]; | |
| 148 | 148 | |
| 149 | 149 | static void cd32_potgo_w(running_machine *machine, UINT16 data) |
| 150 | 150 | { |
| r5060 | r5061 | |
|---|---|---|
| 725 | 725 | * |
| 726 | 726 | **************************************************************/ |
| 727 | 727 | |
| 728 | void a800xl_mmu(running_machine *machine, UINT8 new_mmu) | |
| 728 | static void a800xl_mmu(running_machine *machine, UINT8 new_mmu) | |
| 729 | 729 | { |
| 730 | 730 | read8_space_func rbank1, rbank2, rbank3, rbank4; |
| 731 | 731 | write8_space_func wbank1, wbank2, wbank3, wbank4; |
| r5060 | r5061 | |
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /* BASIC was available in a separate cart, so we don't test it */ |
| 798 | void a1200xl_mmu(running_machine *machine, UINT8 new_mmu) | |
| 798 | static void a1200xl_mmu(running_machine *machine, UINT8 new_mmu) | |
| 799 | 799 | { |
| 800 | 800 | read8_space_func rbank2, rbank3, rbank4; |
| 801 | 801 | write8_space_func wbank2, wbank3, wbank4; |
| r5060 | r5061 | |
| 874 | 874 | }; |
| 875 | 875 | |
| 876 | 876 | |
| 877 | const pia6821_interface atari_pia_interface = | |
| 877 | static const pia6821_interface atari_pia_interface = | |
| 878 | 878 | { |
| 879 | 879 | DEVCB_HANDLER(atari_pia_pa_r), /* port A in */ |
| 880 | 880 | DEVCB_HANDLER(atari_pia_pb_r), /* port B in */ |
| r5060 | r5061 | |
| 890 | 890 | DEVCB_NULL /* IRQB */ |
| 891 | 891 | }; |
| 892 | 892 | |
| 893 | const pia6821_interface a600xl_pia_interface = | |
| 893 | static const pia6821_interface a600xl_pia_interface = | |
| 894 | 894 | { |
| 895 | 895 | DEVCB_HANDLER(atari_pia_pa_r), /* port A in */ |
| 896 | 896 | DEVCB_HANDLER(atari_pia_pb_r), /* port B in */ |
| r5060 | r5061 | |
| 906 | 906 | DEVCB_NULL /* IRQB */ |
| 907 | 907 | }; |
| 908 | 908 | |
| 909 | const pia6821_interface a1200xl_pia_interface = | |
| 909 | static const pia6821_interface a1200xl_pia_interface = | |
| 910 | 910 | { |
| 911 | 911 | DEVCB_HANDLER(atari_pia_pa_r), /* port A in */ |
| 912 | 912 | DEVCB_HANDLER(atari_pia_pb_r), /* port B in */ |
| r5060 | r5061 | |
| 922 | 922 | DEVCB_NULL /* IRQB */ |
| 923 | 923 | }; |
| 924 | 924 | |
| 925 | const pia6821_interface a800xl_pia_interface = | |
| 925 | static const pia6821_interface a800xl_pia_interface = | |
| 926 | 926 | { |
| 927 | 927 | DEVCB_HANDLER(atari_pia_pa_r), /* port A in */ |
| 928 | 928 | DEVCB_HANDLER(atari_pia_pb_r), /* port B in */ |
| r5060 | r5061 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | static int ROMSelection; |
| 16 | static device_config* beta; | |
| 16 | static const device_config* beta; | |
| 17 | 17 | |
| 18 | 18 | static DIRECT_UPDATE_HANDLER( pentagon_direct ) |
| 19 | 19 | { |
| r5060 | r5061 | |
| 102 | 102 | static MACHINE_RESET( pentagon ) |
| 103 | 103 | { |
| 104 | 104 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 105 | beta = | |
| 105 | beta = | |
| 106 | 106 | |
| 107 | 107 | memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK(1)); |
| 108 | 108 | memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP); |
| r5060 | r5061 | |
|---|---|---|
| 738 | 738 | } |
| 739 | 739 | |
| 740 | 740 | |
| 741 | static k1ge_interface ngp_k1ge_interface = | |
| 741 | static const k1ge_interface ngp_k1ge_interface = | |
| 742 | 742 | { |
| 743 | 743 | "screen", |
| 744 | 744 | "vram", |
| r5060 | r5061 | |
| 747 | 747 | }; |
| 748 | 748 | |
| 749 | 749 | |
| 750 | static tlcs900_interface ngp_tlcs900_interface = | |
| 750 | static const tlcs900_interface ngp_tlcs900_interface = | |
| 751 | 751 | { |
| 752 | 752 | DEVCB_NULL, |
| 753 | 753 | DEVCB_HANDLER( ngp_tlcs900_to3 ) |
| r5060 | r5061 | |
|---|---|---|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| 177 | static ppu2c0x_interface nes_ppu_interface = | |
| 177 | static const ppu2c0x_interface nes_ppu_interface = | |
| 178 | 178 | { |
| 179 | 179 | NULL,//"gfx1", |
| 180 | 180 | 0, |
| r5060 | r5061 | |
|---|---|---|
| 1202 | 1202 | pcw16_trigger_fdc_int(machine); |
| 1203 | 1203 | } |
| 1204 | 1204 | |
| 1205 | static device_config * pcw16_get_device(running_machine *machine | |
| 1205 | static const device_config * pcw16_get_device(running_machine *machine | |
| 1206 | 1206 | { |
| 1207 | return | |
| 1207 | return | |
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | 1210 | static const struct pc_fdc_interface pcw16_fdc_interface= |
| r5060 | r5061 | |
|---|---|---|
| 13 | 13 | #include "video/vtvideo.h" |
| 14 | 14 | #include "vt100.lh" |
| 15 | 15 | |
| 16 | UINT8 *vt100_ram; | |
| 17 | UINT8 vt100_keyboard_int; | |
| 18 | UINT8 vt100_receiver_int; | |
| 19 | UINT8 vt100_vertical_int; | |
| 16 | static UINT8 *vt100_ram; | |
| 17 | static UINT8 vt100_keyboard_int; | |
| 18 | static UINT8 vt100_receiver_int; | |
| 19 | static UINT8 vt100_vertical_int; | |
| 20 | 20 | |
| 21 | double vt100_send_baud_rate; | |
| 22 | double vt100_recv_baud_rate; | |
| 21 | static double vt100_send_baud_rate; | |
| 22 | static double vt100_recv_baud_rate; | |
| 23 | 23 | |
| 24 | 24 | static ADDRESS_MAP_START(vt100_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 25 | 25 | ADDRESS_MAP_UNMAP_HIGH |
| r5060 | r5061 | |
| 49 | 49 | return retVal; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | UINT8 vt100_key_scan = 0; | |
| 52 | static UINT8 vt100_key_scan = 0; | |
| 53 | 53 | |
| 54 | 54 | static TIMER_CALLBACK(keyboard_callback) |
| 55 | 55 | { |
| r5060 | r5061 | |
|---|---|---|
| 351 | 351 | |
| 352 | 352 | static WRITE8_HANDLER(apf_wd179x_command_w) |
| 353 | 353 | { |
| 354 | wd17xx_command_w( | |
| 354 | wd17xx_command_w( | |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | static WRITE8_HANDLER(apf_wd179x_track_w) |
| 358 | 358 | { |
| 359 | wd17xx_track_w( | |
| 359 | wd17xx_track_w( | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | static WRITE8_HANDLER(apf_wd179x_sector_w) |
| 363 | 363 | { |
| 364 | wd17xx_sector_w( | |
| 364 | wd17xx_sector_w( | |
| 365 | 365 | } |
| 366 | 366 | |
| 367 | 367 | static WRITE8_HANDLER(apf_wd179x_data_w) |
| 368 | 368 | { |
| 369 | wd17xx_data_w( | |
| 369 | wd17xx_data_w( | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | static READ8_HANDLER(apf_wd179x_status_r) |
| 373 | 373 | { |
| 374 | return ~wd17xx_status_r( | |
| 374 | return ~wd17xx_status_r( | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | static READ8_HANDLER(apf_wd179x_track_r) |
| r5060 | r5061 | |
|---|---|---|
| 166 | 166 | UINT8 res20[57]; |
| 167 | 167 | } avr8_regs; |
| 168 | 168 | |
| 169 | avr8_regs regs; | |
| 169 | static avr8_regs regs; | |
| 170 | 170 | |
| 171 | 171 | static READ8_HANDLER( avr8_read ) |
| 172 | 172 | { |
| r5060 | r5061 | |
|---|---|---|
| 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 | ||
| 14 | static UINT8 *video_ram; | |
| 15 | ||
| 16 | static 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 | ||
| 24 | ADDRESS_MAP_END | |
| 25 | ||
| 26 | static 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") | |
| 34 | ADDRESS_MAP_END | |
| 35 | ||
| 36 | /* Input ports */ | |
| 37 | 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" ) | |
| 116 | INPUT_PORTS_END | |
| 117 | ||
| 118 | ||
| 119 | static MACHINE_RESET(zrt80) | |
| 120 | { | |
| 121 | } | |
| 122 | ||
| 123 | VIDEO_START( zrt80 ) | |
| 124 | { | |
| 125 | } | |
| 126 | ||
| 127 | static 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 | ||
| 134 | static 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 | ||
| 161 | static 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 | ||
| 175 | static INS8250_INTERRUPT( zrt80_com_interrupt ) | |
| 176 | { | |
| 177 | logerror("com int\r\n"); | |
| 178 | } | |
| 179 | ||
| 180 | static const ins8250_interface zrt80_com_interface = | |
| 181 | { | |
| 182 | 2457600, | |
| 183 | zrt80_com_interrupt, | |
| 184 | NULL, | |
| 185 | NULL, | |
| 186 | NULL | |
| 187 | }; | |
| 188 | static 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 ) | |
| 213 | MACHINE_DRIVER_END | |
| 214 | ||
| 215 | static SYSTEM_CONFIG_START(zrt80) | |
| 216 | SYSTEM_CONFIG_END | |
| 217 | ||
| 218 | /* ROM definition */ | |
| 219 | ROM_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)) | |
| 225 | ROM_END | |
| 226 | ||
| 227 | /* Driver */ | |
| 228 | ||
| 229 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ | |
| 230 | COMP( 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 | ||
| 14 | static UINT8 *video_ram; | |
| 15 | ||
| 16 | static 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 | ||
| 24 | ADDRESS_MAP_END | |
| 25 | ||
| 26 | static 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") | |
| 34 | ADDRESS_MAP_END | |
| 35 | ||
| 36 | /* Input ports */ | |
| 37 | static 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" ) | |
| 116 | INPUT_PORTS_END | |
| 117 | ||
| 118 | ||
| 119 | static MACHINE_RESET(zrt80) | |
| 120 | { | |
| 121 | } | |
| 122 | ||
| 123 | static VIDEO_START( zrt80 ) | |
| 124 | { | |
| 125 | } | |
| 126 | ||
| 127 | static 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 | ||
| 134 | static 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 | ||
| 161 | static 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 | ||
| 175 | static INS8250_INTERRUPT( zrt80_com_interrupt ) | |
| 176 | { | |
| 177 | logerror("com int\r\n"); | |
| 178 | } | |
| 179 | ||
| 180 | static const ins8250_interface zrt80_com_interface = | |
| 181 | { | |
| 182 | 2457600, | |
| 183 | zrt80_com_interrupt, | |
| 184 | NULL, | |
| 185 | NULL, | |
| 186 | NULL | |
| 187 | }; | |
| 188 | static 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 ) | |
| 213 | MACHINE_DRIVER_END | |
| 214 | ||
| 215 | static SYSTEM_CONFIG_START(zrt80) | |
| 216 | SYSTEM_CONFIG_END | |
| 217 | ||
| 218 | /* ROM definition */ | |
| 219 | ROM_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)) | |
| 225 | ROM_END | |
| 226 | ||
| 227 | /* Driver */ | |
| 228 | ||
| 229 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ | |
| 230 | COMP( 1982, zrt80, 0, 0, zrt80, zrt80, 0, zrt80, "Digital Research Computers", "ZRT-80", GAME_NOT_WORKING) | |
| 231 |
| r5060 | r5061 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | - Added natural keyboard support to KR2376. [Roberto Lavarone] |
| 62 | 62 | |
| 63 | - Static/const/include improvements. [Atari Ace] | |
| 63 | 64 | |
| 64 | 65 | |
| 66 | ||
| 65 | 67 | 0.132 |
| 66 | 68 | |
| 67 | 69 | New System Drivers Supported (in no particular order): |
| Previous | 15994 Revisions | Next |