Previous 15994 Revisions Next

r9694 Tuesday 30th November, 2010 at 03:35:41 UTC by R. Belmont
[LISA] Fix crashing, executes valid code (but debugger shows wrong), doesn't start up however. Also some very preliminary modernization.
[src/mess/drivers]lisa.c
[src/mess/machine]lisa.c

src/mess/machine/lisa.c
r9693r9694
943943   return 0;
944944}
945945
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.
947947DIRECT_UPDATE_HANDLER (lisa_OPbaseoverride)
948948{
949949   /* upper 7 bits -> segment # */
950950   int segment = (address >> 17) & 0x7f;
951
952951   int the_seg = seg;
953952
954953   address &= 0xffffff;
955   /*logerror("logical address%lX\n", address);*/
956954
955   printf("lisa: logical address %x\n", address);
957956
958957   if (setup)
959958   {
r9693r9694
965964      {
966965         if (address & 0x008000)
967966         {   /* MMU register : BUS error ??? */
968            logerror("illegal opbase address%lX\n", (long) address);
967            printf("illegal opbase address %lX\n", (long) address);
969968         }
970969         else
971970         {   /* 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));
974972         }
975973
976974         return -1;
r9693r9694
979977   }
980978
981979   if (cpu_get_reg(machine->device("maincpu"), M68K_SR) & 0x2000)
980   {                 
982981      /* supervisor mode -> force register file 0 */
983982      the_seg = 0;
983   }
984984
985985   {
986986      int seg_offset = address & 0x01ffff;
r9693r9694
996996         if (seg_offset > mmu_regs[the_seg][segment].slim)
997997         {
998998            /* out of segment limits : bus error */
999            logerror("illegal opbase address%lX\n", (long) address);
999            printf("illegal opbase address%lX\n", (long) address);
10001000         }
10011001         direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_ram_ptr + mapped_address - address);
1002         /*logerror("RAM\n");*/
1002         printf("RAM\n");
10031003         break;
10041004
10051005      case RAM_stack_r:
r9693r9694
10071007      case IO:         /* I/O : bus error ??? */
10081008      case invalid:      /* unmapped segment */
10091009         /* bus error */
1010         logerror("illegal opbase address%lX\n", (long) address);
1010         printf("illegal opbase address%lX\n", (long) address);
10111011         break;
10121012
10131013      case special_IO:
10141014         direct.explicit_configure((address & 0xffc000), (address & 0xffc000) + 0x003fff, 0xffffff, lisa_rom_ptr + (mapped_address & 0x003fff) - address);
1015         /*logerror("ROM\n");*/
1015         printf("ROM\n");
10161016         break;
10171017      }
10181018   }
10191019
1020
1021   /*logerror("resulting offset%lX\n", answer);*/
1022
10231020   return -1;
10241021}
1022#endif
10251023
1026DIRECT_UPDATE_HANDLER (lisa_fdc_OPbaseoverride)
1027{
1028   /* 8kb of address space -> wraparound */
1029   return (address & 0x1fff);
1030}
1031
1032
10331024/* should save PRAM to file */
10341025/* TODO : save time difference with host clock, set default date, etc */
10351026NVRAM_HANDLER(lisa)
r9693r9694
11471138{
11481139   lisa_ram_ptr = memory_region(machine, "maincpu") + RAM_OFFSET;
11491140   lisa_rom_ptr = memory_region(machine, "maincpu") + ROM_OFFSET;
1150
11511141   videoROM_ptr = memory_region(machine, "gfx1");
11521142
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);
11551145
1156   m68k_set_reset_callback(machine->device("maincpu"), /*lisa_reset_instr_callback*/NULL);
1157
11581146   /* init MMU */
1159
11601147   setup = 1;
1161
11621148   seg = 0;
11631149
11641150   /* init parity */
1165
11661151   diag2 = 0;
11671152   test_parity = 0;
11681153   parity_error_pending = 0;
r9693r9694
11891174   /* initialize floppy */
11901175   {
11911176      if (lisa_features.floppy_hardware == sony_lisa2)
1177      {
11921178         sony_set_enable_lines(machine->device("fdc"),1);   /* on lisa2, drive unit 1 is always selected (?) */
1179      }
11931180   }
1181
1182   /* reset 68k to pick up proper vectors from MMU */
1183   devtag_reset(machine, "maincpu");
11941184}
11951185
11961186INTERRUPT_GEN( lisa_interrupt )
r9693r9694
15071497         }
15081498         else
15091499         {   /* system ROMs */
1510            answer = ((UINT16*)lisa_rom_ptr)[offset & 0x001fff];
1511
1500            answer = ((UINT16*)lisa_rom_ptr)[(offset & 0x001fff)];
15121501            /*logerror("dst address in ROM (setup mode)\n");*/
15131502         }
15141503
src/mess/drivers/lisa.c
r9693r9694
2828ADDRESS_MAP_END
2929
3030static ADDRESS_MAP_START(lisa_fdc_map, ADDRESS_SPACE_PROGRAM, 8)
31   ADDRESS_MAP_GLOBAL_MASK(0x1fff)   // only 8k of address space
3132   AM_RANGE(0x0000, 0x03ff) AM_RAM   AM_BASE(&lisa_fdc_ram)            /* RAM (shared with 68000) */
3233   AM_RANGE(0x0400, 0x07ff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w)   /* disk controller (IWM and TTL logic) */
3334   AM_RANGE(0x0800, 0x0fff) AM_NOP
r9693r9694
3637ADDRESS_MAP_END
3738
3839static ADDRESS_MAP_START(lisa210_fdc_map, ADDRESS_SPACE_PROGRAM, 8)
40   ADDRESS_MAP_GLOBAL_MASK(0x1fff)   // only 8k of address space
3941   AM_RANGE(0x0000, 0x03ff) AM_RAM   AM_BASE(&lisa_fdc_ram)            /* RAM (shared with 68000) */
4042   AM_RANGE(0x0400, 0x07ff) AM_NOP                              /* nothing, or RAM wrap-around ??? */
4143   AM_RANGE(0x0800, 0x0bff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w)   /* disk controller (IWM and TTL logic) */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team