src/emu/cpu/i86/instr86.c
| r9959 | r9960 | |
| 10 | 10 | * timing value should move to separate array |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | /* |
| 14 | PHS - 2010-12-29 |
| 15 | |
| 16 | Moved several instruction stubs so that they are compiled separately for |
| 17 | the 8086 and 80186. The instructions affected are : |
| 18 | |
| 19 | _pop_ss, _es, _cs, _ss, _ds, _mov_sregw and _sti |
| 20 | |
| 21 | This is because they call the next instruction directly as it cannot be |
| 22 | interrupted. If they are not compiled separately when executing on an |
| 23 | 80186, the wrong set of instructions are used (the 8086 set). This has |
| 24 | the serious effect of ignoring the next instruction, as invalid, *IF* |
| 25 | it is an 80186 specific instruction. |
| 26 | |
| 27 | */ |
| 28 | |
| 13 | 29 | #undef ICOUNT |
| 14 | 30 | |
| 15 | 31 | #define ICOUNT cpustate->icount |
| r9959 | r9960 | |
| 821 | 837 | ICOUNT -= timing.push_seg; |
| 822 | 838 | } |
| 823 | 839 | |
| 824 | | static void PREFIX86(_pop_ss)(i8086_state *cpustate) /* Opcode 0x17 */ |
| 825 | | { |
| 826 | | #ifdef I80286 |
| 827 | | UINT16 tmp; |
| 828 | | POP(tmp); |
| 829 | | i80286_data_descriptor(cpustate, SS, tmp); |
| 830 | | #else |
| 831 | | POP(cpustate->sregs[SS]); |
| 832 | | cpustate->base[SS] = SegBase(SS); |
| 833 | | #endif |
| 834 | | ICOUNT -= timing.pop_seg; |
| 835 | | PREFIX(_instruction)[FETCHOP](cpustate); /* no interrupt before next instruction */ |
| 836 | | } |
| 837 | | |
| 838 | 840 | static void PREFIX86(_sbb_br8)(i8086_state *cpustate) /* Opcode 0x18 */ |
| 839 | 841 | { |
| 840 | 842 | DEF_br8(dst,src); |
| r9959 | r9960 | |
| 956 | 958 | cpustate->regs.w[AX]=dst; |
| 957 | 959 | } |
| 958 | 960 | |
| 959 | | static void PREFIX86(_es)(i8086_state *cpustate) /* Opcode 0x26 */ |
| 960 | | { |
| 961 | | cpustate->seg_prefix = TRUE; |
| 962 | | cpustate->prefix_seg = ES; |
| 963 | | ICOUNT -= timing.override; |
| 964 | | PREFIX(_instruction)[FETCHOP](cpustate); |
| 965 | | } |
| 966 | | |
| 967 | 961 | static void PREFIX86(_daa)(i8086_state *cpustate) /* Opcode 0x27 */ |
| 968 | 962 | { |
| 969 | 963 | if (AF || ((cpustate->regs.b[AL] & 0xf) > 9)) |
| r9959 | r9960 | |
| 1032 | 1026 | cpustate->regs.w[AX]=dst; |
| 1033 | 1027 | } |
| 1034 | 1028 | |
| 1035 | | static void PREFIX86(_cs)(i8086_state *cpustate) /* Opcode 0x2e */ |
| 1036 | | { |
| 1037 | | cpustate->seg_prefix = TRUE; |
| 1038 | | cpustate->prefix_seg = CS; |
| 1039 | | ICOUNT -= timing.override; |
| 1040 | | PREFIX(_instruction)[FETCHOP](cpustate); |
| 1041 | | } |
| 1042 | | |
| 1043 | 1029 | static void PREFIX86(_das)(i8086_state *cpustate) /* Opcode 0x2f */ |
| 1044 | 1030 | { |
| 1045 | 1031 | UINT8 tmpAL=cpustate->regs.b[AL]; |
| r9959 | r9960 | |
| 1109 | 1095 | cpustate->regs.w[AX]=dst; |
| 1110 | 1096 | } |
| 1111 | 1097 | |
| 1112 | | static void PREFIX86(_ss)(i8086_state *cpustate) /* Opcode 0x36 */ |
| 1113 | | { |
| 1114 | | cpustate->seg_prefix = TRUE; |
| 1115 | | cpustate->prefix_seg = SS; |
| 1116 | | ICOUNT -= timing.override; |
| 1117 | | PREFIX(_instruction)[FETCHOP](cpustate); |
| 1118 | | } |
| 1119 | | |
| 1120 | 1098 | static void PREFIX86(_aaa)(i8086_state *cpustate) /* Opcode 0x37 */ |
| 1121 | 1099 | { |
| 1122 | 1100 | UINT8 ALcarry=1; |
| r9959 | r9960 | |
| 1180 | 1158 | SUBW(dst,src); |
| 1181 | 1159 | } |
| 1182 | 1160 | |
| 1183 | | static void PREFIX86(_ds)(i8086_state *cpustate) /* Opcode 0x3e */ |
| 1184 | | { |
| 1185 | | cpustate->seg_prefix = TRUE; |
| 1186 | | cpustate->prefix_seg = DS; |
| 1187 | | ICOUNT -= timing.override; |
| 1188 | | PREFIX(_instruction)[FETCHOP](cpustate); |
| 1189 | | } |
| 1190 | | |
| 1191 | 1161 | static void PREFIX86(_aas)(i8086_state *cpustate) /* Opcode 0x3f */ |
| 1192 | 1162 | { |
| 1193 | 1163 | UINT8 ALcarry=1; |
| r9959 | r9960 | |
| 1880 | 1850 | RegWord(ModRM)=cpustate->eo; /* HJB 12/13/98 effective offset (no segment part) */ |
| 1881 | 1851 | } |
| 1882 | 1852 | |
| 1883 | | static void PREFIX86(_mov_sregw)(i8086_state *cpustate) /* Opcode 0x8e */ |
| 1884 | | { |
| 1885 | | unsigned ModRM = FETCH; |
| 1886 | | WORD src = GetRMWord(ModRM); |
| 1887 | | |
| 1888 | | ICOUNT -= (ModRM >= 0xc0) ? timing.mov_sr : timing.mov_sm; |
| 1889 | | #ifdef I80286 |
| 1890 | | switch (ModRM & 0x38) |
| 1891 | | { |
| 1892 | | case 0x00: /* mov es,ew */ |
| 1893 | | i80286_data_descriptor(cpustate,ES,src); |
| 1894 | | break; |
| 1895 | | case 0x18: /* mov ds,ew */ |
| 1896 | | i80286_data_descriptor(cpustate,DS,src); |
| 1897 | | break; |
| 1898 | | case 0x10: /* mov ss,ew */ |
| 1899 | | i80286_data_descriptor(cpustate,SS,src); |
| 1900 | | PREFIX(_instruction)[FETCHOP](cpustate); |
| 1901 | | break; |
| 1902 | | case 0x08: /* mov cs,ew */ |
| 1903 | | break; /* doesn't do a jump far */ |
| 1904 | | } |
| 1905 | | #else |
| 1906 | | switch (ModRM & 0x38) |
| 1907 | | { |
| 1908 | | case 0x00: /* mov es,ew */ |
| 1909 | | cpustate->sregs[ES] = src; |
| 1910 | | cpustate->base[ES] = SegBase(ES); |
| 1911 | | break; |
| 1912 | | case 0x18: /* mov ds,ew */ |
| 1913 | | cpustate->sregs[DS] = src; |
| 1914 | | cpustate->base[DS] = SegBase(DS); |
| 1915 | | break; |
| 1916 | | case 0x10: /* mov ss,ew */ |
| 1917 | | cpustate->sregs[SS] = src; |
| 1918 | | cpustate->base[SS] = SegBase(SS); /* no interrupt allowed before next instr */ |
| 1919 | | PREFIX(_instruction)[FETCHOP](cpustate); |
| 1920 | | break; |
| 1921 | | case 0x08: /* mov cs,ew */ |
| 1922 | | break; /* doesn't do a jump far */ |
| 1923 | | } |
| 1924 | | #endif |
| 1925 | | } |
| 1926 | | |
| 1927 | 1853 | static void PREFIX86(_popw)(i8086_state *cpustate) /* Opcode 0x8f */ |
| 1928 | 1854 | { |
| 1929 | 1855 | unsigned ModRM = FETCH; |
| r9959 | r9960 | |
| 2722 | 2648 | } |
| 2723 | 2649 | #endif |
| 2724 | 2650 | |
| 2651 | static void PREFIX(_pop_ss)(i8086_state *cpustate) /* Opcode 0x17 */ |
| 2652 | { |
| 2653 | #ifdef I80286 |
| 2654 | UINT16 tmp; |
| 2655 | POP(tmp); |
| 2656 | i80286_data_descriptor(cpustate, SS, tmp); |
| 2657 | #else |
| 2658 | POP(cpustate->sregs[SS]); |
| 2659 | cpustate->base[SS] = SegBase(SS); |
| 2660 | #endif |
| 2661 | ICOUNT -= timing.pop_seg; |
| 2662 | PREFIX(_instruction)[FETCHOP](cpustate); /* no interrupt before next instruction */ |
| 2663 | } |
| 2664 | |
| 2665 | static void PREFIX(_es)(i8086_state *cpustate) /* Opcode 0x26 */ |
| 2666 | { |
| 2667 | cpustate->seg_prefix = TRUE; |
| 2668 | cpustate->prefix_seg = ES; |
| 2669 | ICOUNT -= timing.override; |
| 2670 | PREFIX(_instruction)[FETCHOP](cpustate); |
| 2671 | } |
| 2672 | |
| 2673 | static void PREFIX(_cs)(i8086_state *cpustate) /* Opcode 0x2e */ |
| 2674 | { |
| 2675 | cpustate->seg_prefix = TRUE; |
| 2676 | cpustate->prefix_seg = CS; |
| 2677 | ICOUNT -= timing.override; |
| 2678 | PREFIX(_instruction)[FETCHOP](cpustate); |
| 2679 | } |
| 2680 | |
| 2681 | static void PREFIX(_ss)(i8086_state *cpustate) /* Opcode 0x36 */ |
| 2682 | { |
| 2683 | cpustate->seg_prefix = TRUE; |
| 2684 | cpustate->prefix_seg = SS; |
| 2685 | ICOUNT -= timing.override; |
| 2686 | PREFIX(_instruction)[FETCHOP](cpustate); |
| 2687 | } |
| 2688 | |
| 2689 | static void PREFIX(_ds)(i8086_state *cpustate) /* Opcode 0x3e */ |
| 2690 | { |
| 2691 | cpustate->seg_prefix = TRUE; |
| 2692 | cpustate->prefix_seg = DS; |
| 2693 | ICOUNT -= timing.override; |
| 2694 | PREFIX(_instruction)[FETCHOP](cpustate); |
| 2695 | } |
| 2696 | |
| 2697 | static void PREFIX(_mov_sregw)(i8086_state *cpustate) /* Opcode 0x8e */ |
| 2698 | { |
| 2699 | unsigned ModRM = FETCH; |
| 2700 | WORD src = GetRMWord(ModRM); |
| 2701 | |
| 2702 | ICOUNT -= (ModRM >= 0xc0) ? timing.mov_sr : timing.mov_sm; |
| 2703 | #ifdef I80286 |
| 2704 | switch (ModRM & 0x38) |
| 2705 | { |
| 2706 | case 0x00: /* mov es,ew */ |
| 2707 | i80286_data_descriptor(cpustate,ES,src); |
| 2708 | break; |
| 2709 | case 0x18: /* mov ds,ew */ |
| 2710 | i80286_data_descriptor(cpustate,DS,src); |
| 2711 | break; |
| 2712 | case 0x10: /* mov ss,ew */ |
| 2713 | i80286_data_descriptor(cpustate,SS,src); |
| 2714 | PREFIX(_instruction)[FETCHOP](cpustate); |
| 2715 | break; |
| 2716 | case 0x08: /* mov cs,ew */ |
| 2717 | break; /* doesn't do a jump far */ |
| 2718 | } |
| 2719 | #else |
| 2720 | switch (ModRM & 0x38) |
| 2721 | { |
| 2722 | case 0x00: /* mov es,ew */ |
| 2723 | cpustate->sregs[ES] = src; |
| 2724 | cpustate->base[ES] = SegBase(ES); |
| 2725 | break; |
| 2726 | case 0x18: /* mov ds,ew */ |
| 2727 | cpustate->sregs[DS] = src; |
| 2728 | cpustate->base[DS] = SegBase(DS); |
| 2729 | break; |
| 2730 | case 0x10: /* mov ss,ew */ |
| 2731 | cpustate->sregs[SS] = src; |
| 2732 | cpustate->base[SS] = SegBase(SS); /* no interrupt allowed before next instr */ |
| 2733 | PREFIX(_instruction)[FETCHOP](cpustate); |
| 2734 | break; |
| 2735 | case 0x08: /* mov cs,ew */ |
| 2736 | break; /* doesn't do a jump far */ |
| 2737 | } |
| 2738 | #endif |
| 2739 | } |
| 2740 | |
| 2725 | 2741 | static void PREFIX(_repne)(i8086_state *cpustate) /* Opcode 0xf2 */ |
| 2726 | 2742 | { |
| 2727 | 2743 | PREFIX(rep)(cpustate, 0); |
| r9959 | r9960 | |
| 2732 | 2748 | PREFIX(rep)(cpustate, 1); |
| 2733 | 2749 | } |
| 2734 | 2750 | |
| 2751 | static void PREFIX(_sti)(i8086_state *cpustate) /* Opcode 0xfb */ |
| 2752 | { |
| 2753 | ICOUNT -= timing.flag_ops; |
| 2754 | SetIF(1); |
| 2755 | PREFIX(_instruction)[FETCHOP](cpustate); /* no interrupt before next instruction */ |
| 2756 | |
| 2757 | /* if an interrupt is pending, signal an interrupt */ |
| 2758 | if (cpustate->irq_state) |
| 2759 | PREFIX86(_interrupt)(cpustate, (UINT32)-1); |
| 2760 | } |
| 2761 | |
| 2735 | 2762 | #ifndef I80186 |
| 2736 | 2763 | static void PREFIX86(_hlt)(i8086_state *cpustate) /* Opcode 0xf4 */ |
| 2737 | 2764 | { |
| r9959 | r9960 | |
| 3022 | 3049 | SetIF(0); |
| 3023 | 3050 | } |
| 3024 | 3051 | |
| 3025 | | static void PREFIX86(_sti)(i8086_state *cpustate) /* Opcode 0xfb */ |
| 3026 | | { |
| 3027 | | ICOUNT -= timing.flag_ops; |
| 3028 | | SetIF(1); |
| 3029 | | PREFIX(_instruction)[FETCHOP](cpustate); /* no interrupt before next instruction */ |
| 3030 | | |
| 3031 | | /* if an interrupt is pending, signal an interrupt */ |
| 3032 | | if (cpustate->irq_state) |
| 3033 | | PREFIX(_interrupt)(cpustate, (UINT32)-1); |
| 3034 | | } |
| 3035 | | |
| 3036 | 3052 | static void PREFIX86(_cld)(i8086_state *cpustate) /* Opcode 0xfc */ |
| 3037 | 3053 | { |
| 3038 | 3054 | ICOUNT -= timing.flag_ops; |
src/emu/cpu/i86/table186.h
| r9959 | r9960 | |
| 23 | 23 | PREFIX86(_adc_ald8), /* 0x14 */ |
| 24 | 24 | PREFIX86(_adc_axd16), /* 0x15 */ |
| 25 | 25 | PREFIX86(_push_ss), /* 0x16 */ |
| 26 | | PREFIX86(_pop_ss), /* 0x17 */ |
| 26 | PREFIX186(_pop_ss), /* 0x17 */ |
| 27 | 27 | PREFIX86(_sbb_br8), /* 0x18 */ |
| 28 | 28 | PREFIX86(_sbb_wr16), /* 0x19 */ |
| 29 | 29 | PREFIX86(_sbb_r8b), /* 0x1a */ |
| r9959 | r9960 | |
| 38 | 38 | PREFIX86(_and_r16w), /* 0x23 */ |
| 39 | 39 | PREFIX86(_and_ald8), /* 0x24 */ |
| 40 | 40 | PREFIX86(_and_axd16), /* 0x25 */ |
| 41 | | PREFIX86(_es), /* 0x26 */ |
| 41 | PREFIX186(_es), /* 0x26 */ |
| 42 | 42 | PREFIX86(_daa), /* 0x27 */ |
| 43 | 43 | PREFIX86(_sub_br8), /* 0x28 */ |
| 44 | 44 | PREFIX86(_sub_wr16), /* 0x29 */ |
| r9959 | r9960 | |
| 46 | 46 | PREFIX86(_sub_r16w), /* 0x2b */ |
| 47 | 47 | PREFIX86(_sub_ald8), /* 0x2c */ |
| 48 | 48 | PREFIX86(_sub_axd16), /* 0x2d */ |
| 49 | | PREFIX86(_cs), /* 0x2e */ |
| 50 | | PREFIX86(_das), /* 0x2f */ |
| 49 | PREFIX186(_cs), /* 0x2e */ |
| 50 | PREFIX86(_das), /* 0x2f */ |
| 51 | 51 | PREFIX86(_xor_br8), /* 0x30 */ |
| 52 | 52 | PREFIX86(_xor_wr16), /* 0x31 */ |
| 53 | 53 | PREFIX86(_xor_r8b), /* 0x32 */ |
| 54 | 54 | PREFIX86(_xor_r16w), /* 0x33 */ |
| 55 | 55 | PREFIX86(_xor_ald8), /* 0x34 */ |
| 56 | 56 | PREFIX86(_xor_axd16), /* 0x35 */ |
| 57 | | PREFIX86(_ss), /* 0x36 */ |
| 58 | | PREFIX86(_aaa), /* 0x37 */ |
| 57 | PREFIX186(_ss), /* 0x36 */ |
| 58 | PREFIX86(_aaa), /* 0x37 */ |
| 59 | 59 | PREFIX86(_cmp_br8), /* 0x38 */ |
| 60 | 60 | PREFIX86(_cmp_wr16), /* 0x39 */ |
| 61 | 61 | PREFIX86(_cmp_r8b), /* 0x3a */ |
| 62 | 62 | PREFIX86(_cmp_r16w), /* 0x3b */ |
| 63 | 63 | PREFIX86(_cmp_ald8), /* 0x3c */ |
| 64 | 64 | PREFIX86(_cmp_axd16), /* 0x3d */ |
| 65 | | PREFIX86(_ds), /* 0x3e */ |
| 66 | | PREFIX86(_aas), /* 0x3f */ |
| 65 | PREFIX186(_ds), /* 0x3e */ |
| 66 | PREFIX86(_aas), /* 0x3f */ |
| 67 | 67 | PREFIX86(_inc_ax), /* 0x40 */ |
| 68 | 68 | PREFIX86(_inc_cx), /* 0x41 */ |
| 69 | 69 | PREFIX86(_inc_dx), /* 0x42 */ |
| r9959 | r9960 | |
| 142 | 142 | PREFIX86(_mov_r16w), /* 0x8b */ |
| 143 | 143 | PREFIX86(_mov_wsreg), /* 0x8c */ |
| 144 | 144 | PREFIX86(_lea), /* 0x8d */ |
| 145 | | PREFIX86(_mov_sregw), /* 0x8e */ |
| 145 | PREFIX186(_mov_sregw), /* 0x8e */ |
| 146 | 146 | PREFIX86(_popw), /* 0x8f */ |
| 147 | 147 | PREFIX86(_nop), /* 0x90 */ |
| 148 | 148 | PREFIX86(_xchg_axcx), /* 0x91 */ |
| r9959 | r9960 | |
| 251 | 251 | PREFIX86(_clc), /* 0xf8 */ |
| 252 | 252 | PREFIX86(_stc), /* 0xf9 */ |
| 253 | 253 | PREFIX86(_cli), /* 0xfa */ |
| 254 | | PREFIX86(_sti), /* 0xfb */ |
| 254 | PREFIX186(_sti), /* 0xfb */ |
| 255 | 255 | PREFIX86(_cld), /* 0xfc */ |
| 256 | 256 | PREFIX86(_std), /* 0xfd */ |
| 257 | 257 | PREFIX86(_fepre), /* 0xfe */ |
| r9959 | r9960 | |
| 514 | 514 | case 0xf8: PREFIX86(_clc)(cpustate); break;\ |
| 515 | 515 | case 0xf9: PREFIX86(_stc)(cpustate); break;\ |
| 516 | 516 | case 0xfa: PREFIX86(_cli)(cpustate); break;\ |
| 517 | | case 0xfb: PREFIX86(_sti)(cpustate); break;\ |
| 517 | case 0xfb: PREFIX186(_sti)(cpustate); break;\ |
| 518 | 518 | case 0xfc: PREFIX86(_cld)(cpustate); break;\ |
| 519 | 519 | case 0xfd: PREFIX86(_std)(cpustate); break;\ |
| 520 | 520 | case 0xfe: PREFIX86(_fepre)(cpustate); break;\ |
src/mess/machine/rmnimbus.c
| r9959 | r9960 | |
| 43 | 43 | |
| 44 | 44 | The tracks, heads and sectors/track can be used with chdman -createblank |
| 45 | 45 | to create a blank hard disk which can then be formatted with the RM tools. |
| 46 | | |
| 46 | The important thing when doing this is to make sure that if using the Native |
| 47 | SCSI tools, that the disk has the same number of blocks as specified above, |
| 48 | even if you have to use unusual geometry to do so ! |
| 47 | 49 | */ |
| 48 | 50 | |
| 49 | 51 | |
| r9959 | r9960 | |
| 59 | 61 | #include "machine/pic8259.h" |
| 60 | 62 | #include "machine/pit8253.h" |
| 61 | 63 | #include "machine/msm8251.h" |
| 64 | #include "machine/ctronics.h" |
| 65 | #include "machine/6522via.h" |
| 62 | 66 | #include "machine/scsi.h" |
| 63 | 67 | #include "sound/ay8910.h" |
| 64 | 68 | #include "sound/msm5205.h" |
| r9959 | r9960 | |
| 102 | 106 | |
| 103 | 107 | #define DMA_BREAK 0x0000001 |
| 104 | 108 | #define DECODE_BIOS 0x0000002 |
| 109 | #define DECODE_DOS21 0x0000004 |
| 105 | 110 | |
| 106 | 111 | /* Z80 SIO */ |
| 107 | 112 | |
| r9959 | r9960 | |
| 153 | 158 | |
| 154 | 159 | static int instruction_hook(device_t &device, offs_t curpc); |
| 155 | 160 | static void decode_subbios(device_t *device,offs_t pc); |
| 161 | static void decode_dos21(device_t *device,offs_t pc); |
| 156 | 162 | static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si); |
| 157 | 163 | static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UINT16 si); |
| 158 | 164 | static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si); |
| r9959 | r9960 | |
| 1026 | 1032 | { |
| 1027 | 1033 | rmnimbus_state *state = space->machine->driver_data<rmnimbus_state>(); |
| 1028 | 1034 | int temp, which, data16 = data; |
| 1029 | | |
| 1035 | |
| 1030 | 1036 | switch (offset) |
| 1031 | 1037 | { |
| 1032 | 1038 | case 0x11: |
| r9959 | r9960 | |
| 1346 | 1352 | |
| 1347 | 1353 | addr_ptr = (UINT8*)space->get_read_ptr(curpc); |
| 1348 | 1354 | |
| 1349 | | if(DEBUG_SET(DECODE_BIOS)) |
| 1350 | | if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD) && (addr_ptr[1]==0xF0)) |
| 1351 | | decode_subbios(&device,curpc); |
| 1355 | if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD)) |
| 1356 | { |
| 1357 | if(DEBUG_SET(DECODE_BIOS) && (addr_ptr[1]==0xF0)) |
| 1358 | decode_subbios(&device,curpc); |
| 1352 | 1359 | |
| 1360 | if(DEBUG_SET(DECODE_DOS21) && (addr_ptr[1]==0x21)) |
| 1361 | decode_dos21(&device,curpc); |
| 1362 | } |
| 1363 | |
| 1353 | 1364 | return 0; |
| 1354 | 1365 | } |
| 1355 | 1366 | |
| r9959 | r9960 | |
| 1788 | 1799 | logerror("\n"); |
| 1789 | 1800 | } |
| 1790 | 1801 | |
| 1802 | static void decode_dos21(device_t *device,offs_t pc) |
| 1803 | { |
| 1804 | device_t *cpu = device->machine->device(MAINCPU_TAG); |
| 1805 | |
| 1806 | UINT16 ax = cpu_get_reg(cpu,I8086_AX); |
| 1807 | UINT16 bx = cpu_get_reg(cpu,I8086_BX); |
| 1808 | UINT16 cx = cpu_get_reg(cpu,I8086_CX); |
| 1809 | UINT16 dx = cpu_get_reg(cpu,I8086_DX); |
| 1810 | UINT16 cs = cpu_get_reg(cpu,I8086_CS); |
| 1811 | UINT16 ds = cpu_get_reg(cpu,I8086_DS); |
| 1812 | UINT16 es = cpu_get_reg(cpu,I8086_ES); |
| 1813 | UINT16 ss = cpu_get_reg(cpu,I8086_SS); |
| 1814 | |
| 1815 | UINT16 si = cpu_get_reg(cpu,I8086_SI); |
| 1816 | UINT16 di = cpu_get_reg(cpu,I8086_DI); |
| 1817 | UINT16 bp = cpu_get_reg(cpu,I8086_BP); |
| 1818 | |
| 1819 | logerror("=======================================================================\n"); |
| 1820 | logerror("DOS Int 0x21 call at %05X\n",pc); |
| 1821 | logerror("AX=%04X, BX=%04X, CX=%04X, DX=%04X\n",ax,bx,cx,dx); |
| 1822 | logerror("CS=%04X, DS=%04X, ES=%04X, SS=%04X\n",cs,ds,es,ss); |
| 1823 | logerror("SI=%04X, DI=%04X, BP=%04X\n",si,di,bp); |
| 1824 | logerror("=======================================================================\n"); |
| 1825 | |
| 1826 | if((ax & 0xff00)==0x0900) |
| 1827 | debugger_break(device->machine); |
| 1828 | } |
| 1829 | |
| 1830 | |
| 1791 | 1831 | /* |
| 1792 | 1832 | The Nimbus has 3 banks of memory each of which can be either 16x4164 or 16x41256 giving |
| 1793 | 1833 | 128K or 512K per bank. These banks are as follows : |
| r9959 | r9960 | |
| 2903 | 2943 | { |
| 2904 | 2944 | } |
| 2905 | 2945 | |
| 2946 | /********************************************************************** |
| 2947 | Paralell printer / User port. |
| 2948 | The Nimbus paralell printer port card is almost identical to the circuit |
| 2949 | in the BBC micro, so I have borrowed the driver code from the BBC :) |
| 2950 | |
| 2951 | Port A output is buffered before being connected to the printer connector. |
| 2952 | This means that they can only be operated as output lines. |
| 2953 | CA1 is pulled high by a 4K7 resistor. CA1 normally acts as an acknowledge |
| 2954 | line when a printer is used. CA2 is buffered so that it has become an open |
| 2955 | collector output only. It usially acts as the printer strobe line. |
| 2956 | ***********************************************************************/ |
| 2957 | |
| 2958 | /* USER VIA 6522 port B is connected to the BBC user port */ |
| 2959 | static READ8_DEVICE_HANDLER( nimbus_via_read_portb ) |
| 2960 | { |
| 2961 | return 0xff; |
| 2962 | } |
| 2963 | |
| 2964 | static WRITE8_DEVICE_HANDLER( nimbus_via_write_portb ) |
| 2965 | { |
| 2966 | } |
| 2967 | |
| 2968 | static WRITE_LINE_DEVICE_HANDLER( nimbus_via_irq_w ) |
| 2969 | { |
| 2970 | if(state) |
| 2971 | external_int(device->machine,VIA_INT,0x00); |
| 2972 | } |
| 2973 | |
| 2974 | const via6522_interface nimbus_via = |
| 2975 | { |
| 2976 | DEVCB_NULL, //via_user_read_porta, |
| 2977 | DEVCB_HANDLER(nimbus_via_read_portb), |
| 2978 | DEVCB_NULL, //via_user_read_ca1, |
| 2979 | DEVCB_NULL, //via_user_read_cb1, |
| 2980 | DEVCB_NULL, //via_user_read_ca2, |
| 2981 | DEVCB_NULL, //via_user_read_cb2, |
| 2982 | DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, centronics_data_w), |
| 2983 | DEVCB_HANDLER(nimbus_via_write_portb), |
| 2984 | DEVCB_NULL, //via_user_write_ca1 |
| 2985 | DEVCB_NULL, //via_user_write_cb1 |
| 2986 | DEVCB_DEVICE_LINE(CENTRONICS_TAG, centronics_strobe_w), |
| 2987 | DEVCB_NULL, //via_user_write_cb2, |
| 2988 | DEVCB_LINE(nimbus_via_irq_w) |
| 2989 | }; |
| 2990 | |
| 2991 | WRITE_LINE_DEVICE_HANDLER(nimbus_ack_w) |
| 2992 | { |
| 2993 | via6522_device *via_1 = device->machine->device<via6522_device>(VIA_TAG); |
| 2994 | via_1->write_ca1(!state); /* ack seems to be inverted? */ |
| 2995 | } |
| 2996 | |
src/mess/drivers/rmnimbus.c
| r9959 | r9960 | |
| 19 | 19 | #include "includes/rmnimbus.h" |
| 20 | 20 | #include "machine/er59256.h" |
| 21 | 21 | #include "machine/scsi.h" |
| 22 | #include "machine/6522via.h" |
| 23 | #include "machine/ctronics.h" |
| 22 | 24 | #include "sound/ay8910.h" |
| 23 | 25 | #include "sound/msm5205.h" |
| 24 | 26 | |
| r9959 | r9960 | |
| 94 | 96 | &nimbus_scsi_linechange |
| 95 | 97 | }; |
| 96 | 98 | |
| 99 | static const centronics_interface nimbus_centronics_config = |
| 100 | { |
| 101 | FALSE, |
| 102 | DEVCB_DEVICE_LINE(VIA_TAG,nimbus_ack_w), |
| 103 | DEVCB_NULL, |
| 104 | DEVCB_NULL |
| 105 | }; |
| 106 | |
| 97 | 107 | static ADDRESS_MAP_START(nimbus_mem, ADDRESS_SPACE_PROGRAM, 16) |
| 98 | 108 | AM_RANGE( 0x00000, 0x1FFFF ) AM_RAMBANK(RAM_BANK00_TAG) |
| 99 | 109 | AM_RANGE( 0x20000, 0x3FFFF ) AM_RAMBANK(RAM_BANK01_TAG) |
| r9959 | r9960 | |
| 116 | 126 | AM_RANGE( 0X00e0, 0X00ef) AM_READWRITE8( nimbus_sound_ay8910_r, nimbus_sound_ay8910_w, 0x00FF) |
| 117 | 127 | AM_RANGE( 0x00f0, 0x00f7) AM_DEVREADWRITE8(Z80SIO_TAG, z80sio_cd_ba_r, z80sio_cd_ba_w, 0x00ff) |
| 118 | 128 | AM_RANGE( 0x0400, 0x041f) AM_READWRITE8( nimbus_disk_r, nimbus_disk_w, 0x00FF) |
| 129 | AM_RANGE( 0x0480, 0x049f) AM_DEVREADWRITE8_MODERN(VIA_TAG, via6522_device, read, write, 0x00FF) |
| 119 | 130 | AM_RANGE( 0xff00, 0xffff) AM_READWRITE( nimbus_i186_internal_port_r, nimbus_i186_internal_port_w)/* CPU 80186 */ |
| 120 | 131 | ADDRESS_MAP_END |
| 121 | 132 | |
| r9959 | r9960 | |
| 339 | 350 | |
| 340 | 351 | MCFG_ER59256_ADD(ER59256_TAG) |
| 341 | 352 | |
| 353 | MCFG_VIA6522_ADD(VIA_TAG, 1000000, nimbus_via) |
| 354 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, nimbus_centronics_config) |
| 355 | |
| 342 | 356 | /* sound hardware */ |
| 343 | 357 | MCFG_SPEAKER_STANDARD_MONO(MONO_TAG) |
| 344 | 358 | MCFG_SOUND_ADD(AY8910_TAG, AY8910, 2000000) |
| 345 | 359 | MCFG_SOUND_CONFIG(nimbus_ay8910_interface) |
| 346 | | |
| 360 | MCFG_SOUND_ROUTE(ALL_OUTPUTS,MONO_TAG, 0.75) |
| 361 | |
| 347 | 362 | MCFG_SOUND_ADD(MSM5205_TAG, MSM5205, 384000) |
| 348 | 363 | MCFG_SOUND_CONFIG(msm5205_config) |
| 349 | | |
| 350 | 364 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, MONO_TAG, 0.75) |
| 351 | 365 | |
| 352 | 366 | |