src/mess/machine/lisa.c
| r9693 | r9694 | |
| 943 | 943 | return 0; |
| 944 | 944 | } |
| 945 | 945 | |
| 946 | | |
| 946 | #if 0 // we can execute directly out of read handlers now, so this shouldn't be necessary any more. #if 0'd for documentation until we get everything working. |
| 947 | 947 | DIRECT_UPDATE_HANDLER (lisa_OPbaseoverride) |
| 948 | 948 | { |
| 949 | 949 | /* upper 7 bits -> segment # */ |
| 950 | 950 | int segment = (address >> 17) & 0x7f; |
| 951 | | |
| 952 | 951 | int the_seg = seg; |
| 953 | 952 | |
| 954 | 953 | address &= 0xffffff; |
| 955 | | /*logerror("logical address%lX\n", address);*/ |
| 956 | 954 | |
| 955 | printf("lisa: logical address %x\n", address); |
| 957 | 956 | |
| 958 | 957 | if (setup) |
| 959 | 958 | { |
| r9693 | r9694 | |
| 965 | 964 | { |
| 966 | 965 | if (address & 0x008000) |
| 967 | 966 | { /* MMU register : BUS error ??? */ |
| 968 | | logerror("illegal opbase address%lX\n", (long) address); |
| 967 | printf("illegal opbase address %lX\n", (long) address); |
| 969 | 968 | } |
| 970 | 969 | else |
| 971 | 970 | { /* system ROMs */ |
| 972 | | direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_rom_ptr - (address & 0xffc000)); |
| 973 | | /*logerror("ROM (setup mode)\n");*/ |
| 971 | direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_rom_ptr - (address & 0x3fff)); |
| 974 | 972 | } |
| 975 | 973 | |
| 976 | 974 | return -1; |
| r9693 | r9694 | |
| 979 | 977 | } |
| 980 | 978 | |
| 981 | 979 | if (cpu_get_reg(machine->device("maincpu"), M68K_SR) & 0x2000) |
| 980 | { |
| 982 | 981 | /* supervisor mode -> force register file 0 */ |
| 983 | 982 | the_seg = 0; |
| 983 | } |
| 984 | 984 | |
| 985 | 985 | { |
| 986 | 986 | int seg_offset = address & 0x01ffff; |
| r9693 | r9694 | |
| 996 | 996 | if (seg_offset > mmu_regs[the_seg][segment].slim) |
| 997 | 997 | { |
| 998 | 998 | /* out of segment limits : bus error */ |
| 999 | | logerror("illegal opbase address%lX\n", (long) address); |
| 999 | printf("illegal opbase address%lX\n", (long) address); |
| 1000 | 1000 | } |
| 1001 | 1001 | direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_ram_ptr + mapped_address - address); |
| 1002 | | /*logerror("RAM\n");*/ |
| 1002 | printf("RAM\n"); |
| 1003 | 1003 | break; |
| 1004 | 1004 | |
| 1005 | 1005 | case RAM_stack_r: |
| r9693 | r9694 | |
| 1007 | 1007 | case IO: /* I/O : bus error ??? */ |
| 1008 | 1008 | case invalid: /* unmapped segment */ |
| 1009 | 1009 | /* bus error */ |
| 1010 | | logerror("illegal opbase address%lX\n", (long) address); |
| 1010 | printf("illegal opbase address%lX\n", (long) address); |
| 1011 | 1011 | break; |
| 1012 | 1012 | |
| 1013 | 1013 | case special_IO: |
| 1014 | 1014 | direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_rom_ptr + (mapped_address & 0x003fff) - address); |
| 1015 | | /*logerror("ROM\n");*/ |
| 1015 | printf("ROM\n"); |
| 1016 | 1016 | break; |
| 1017 | 1017 | } |
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | | |
| 1021 | | /*logerror("resulting offset%lX\n", answer);*/ |
| 1022 | | |
| 1023 | 1020 | return -1; |
| 1024 | 1021 | } |
| 1022 | #endif |
| 1025 | 1023 | |
| 1026 | | DIRECT_UPDATE_HANDLER (lisa_fdc_OPbaseoverride) |
| 1027 | | { |
| 1028 | | /* 8kb of address space -> wraparound */ |
| 1029 | | return (address & 0x1fff); |
| 1030 | | } |
| 1031 | | |
| 1032 | | |
| 1033 | 1024 | /* should save PRAM to file */ |
| 1034 | 1025 | /* TODO : save time difference with host clock, set default date, etc */ |
| 1035 | 1026 | NVRAM_HANDLER(lisa) |
| r9693 | r9694 | |
| 1147 | 1138 | { |
| 1148 | 1139 | lisa_ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET; |
| 1149 | 1140 | lisa_rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET; |
| 1150 | | |
| 1151 | 1141 | videoROM_ptr = memory_region(machine, "gfx1"); |
| 1152 | 1142 | |
| 1153 | | cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_OPbaseoverride, *machine)); |
| 1154 | | cputag_get_address_space(machine, "fdccpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_fdc_OPbaseoverride, *machine)); |
| 1143 | // cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)->set_direct_update_handler(direct_update_delegate_create_static(lisa_OPbaseoverride, *machine)); |
| 1144 | // m68k_set_reset_callback(machine->device("maincpu"), /*lisa_reset_instr_callback*/NULL); |
| 1155 | 1145 | |
| 1156 | | m68k_set_reset_callback(machine->device("maincpu"), /*lisa_reset_instr_callback*/NULL); |
| 1157 | | |
| 1158 | 1146 | /* init MMU */ |
| 1159 | | |
| 1160 | 1147 | setup = 1; |
| 1161 | | |
| 1162 | 1148 | seg = 0; |
| 1163 | 1149 | |
| 1164 | 1150 | /* init parity */ |
| 1165 | | |
| 1166 | 1151 | diag2 = 0; |
| 1167 | 1152 | test_parity = 0; |
| 1168 | 1153 | parity_error_pending = 0; |
| r9693 | r9694 | |
| 1189 | 1174 | /* initialize floppy */ |
| 1190 | 1175 | { |
| 1191 | 1176 | if (lisa_features.floppy_hardware == sony_lisa2) |
| 1177 | { |
| 1192 | 1178 | sony_set_enable_lines(machine->device("fdc"),1); /* on lisa2, drive unit 1 is always selected (?) */ |
| 1179 | } |
| 1193 | 1180 | } |
| 1181 | |
| 1182 | /* reset 68k to pick up proper vectors from MMU */ |
| 1183 | devtag_reset(machine, "maincpu"); |
| 1194 | 1184 | } |
| 1195 | 1185 | |
| 1196 | 1186 | INTERRUPT_GEN( lisa_interrupt ) |
| r9693 | r9694 | |
| 1507 | 1497 | } |
| 1508 | 1498 | else |
| 1509 | 1499 | { /* system ROMs */ |
| 1510 | | answer = ((UINT16*)lisa_rom_ptr)[offset & 0x001fff]; |
| 1511 | | |
| 1500 | answer = ((UINT16*)lisa_rom_ptr)[(offset & 0x001fff)]; |
| 1512 | 1501 | /*logerror("dst address in ROM (setup mode)\n");*/ |
| 1513 | 1502 | } |
| 1514 | 1503 | |
src/mess/drivers/lisa.c
| r9693 | r9694 | |
| 28 | 28 | ADDRESS_MAP_END |
| 29 | 29 | |
| 30 | 30 | static ADDRESS_MAP_START(lisa_fdc_map, ADDRESS_SPACE_PROGRAM, 8) |
| 31 | ADDRESS_MAP_GLOBAL_MASK(0x1fff) // only 8k of address space |
| 31 | 32 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&lisa_fdc_ram) /* RAM (shared with 68000) */ |
| 32 | 33 | AM_RANGE(0x0400, 0x07ff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w) /* disk controller (IWM and TTL logic) */ |
| 33 | 34 | AM_RANGE(0x0800, 0x0fff) AM_NOP |
| r9693 | r9694 | |
| 36 | 37 | ADDRESS_MAP_END |
| 37 | 38 | |
| 38 | 39 | static ADDRESS_MAP_START(lisa210_fdc_map, ADDRESS_SPACE_PROGRAM, 8) |
| 40 | ADDRESS_MAP_GLOBAL_MASK(0x1fff) // only 8k of address space |
| 39 | 41 | AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&lisa_fdc_ram) /* RAM (shared with 68000) */ |
| 40 | 42 | AM_RANGE(0x0400, 0x07ff) AM_NOP /* nothing, or RAM wrap-around ??? */ |
| 41 | 43 | AM_RANGE(0x0800, 0x0bff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w) /* disk controller (IWM and TTL logic) */ |