Previous 15994 Revisions Next

r9448 Monday 25th October, 2010 at 23:36:44 UTC by Angelo Salese
[PC-88VA]: Fixed a bank bug with byte accesses
[src/mess/drivers]pc88va.c

src/mess/drivers/pc88va.c
r9447r9448
1515#include "emu.h"
1616#include "cpu/nec/nec.h"
1717//#include "cpu/z80/z80.h"
18#include "machine/i8255a.h"
1819
1920static UINT16 *palram;
2021static UINT16 bank_reg;
r9447r9448
212213   ---- ---- xxxx ---- RBC1 (0xf0000 - 0xfffff ROM bank)
213214   ---- ---- ---- xxxx RBC0 (0xe0000 - 0xeffff ROM bank)
214215   */
215   bank_reg = data;
216   if ((mem_mask&0xffff) == 0xffff)
217      bank_reg = data;
218   else if ((mem_mask & 0xffff) == 0xff00)
219      bank_reg = (data & 0xff00) | (bank_reg & 0x00ff);
220   else if ((mem_mask & 0xffff) == 0x00ff)
221      bank_reg = (data & 0x00ff) | (bank_reg & 0xff00);
216222
223
217224   /* RBC1 */
218225   {
219226      UINT8 *ROM10 = memory_region(space->machine, "rom10");
r9447r9448
251258   backupram_wp = 0;
252259}
253260
261static READ8_HANDLER( hdd_status_r )
262{
263   return 0x20;
264}
265
266static READ8_HANDLER( fdc_r )
267{
268   return mame_rand(space->machine);
269}
270
254271static ADDRESS_MAP_START( pc88va_io_map, ADDRESS_SPACE_IO, 16 )
255272   AM_RANGE(0x0000, 0x000f) AM_READ8(key_r,0xffff) // Keyboard ROW reading
256273//   AM_RANGE(0x0010, 0x0010) Printer / Calendar Clock Interface
r9447r9448
268285//   AM_RANGE(0x0070, 0x0070) ? (*)
269286//   AM_RANGE(0x0071, 0x0071) Expansion ROM select (*)
270287//   AM_RANGE(0x0078, 0x0078) Memory offset increment (*)
271//   AM_RANGE(0x0080, 0x0083) HDD control, byte access 7-0
288//   AM_RANGE(0x0080, 0x0081) HDD related
289   AM_RANGE(0x0082, 0x0083) AM_READ8(hdd_status_r,0xff)// HDD control, byte access 7-0
272290//   AM_RANGE(0x00bc, 0x00bf) d8255 1
273291//   AM_RANGE(0x00e2, 0x00e3) Expansion RAM selection (*)
274292//   AM_RANGE(0x00e4, 0x00e4) 8214 IRQ control (*)
275293//   AM_RANGE(0x00e6, 0x00e6) 8214 IRQ mask (*)
276294//   AM_RANGE(0x00e8, 0x00e9) ? (*)
277295//   AM_RANGE(0x00ec, 0x00ed) ? (*)
278//   AM_RANGE(0x00fc, 0x00ff) d8255 2, FDD
296   AM_RANGE(0x00fc, 0x00ff) AM_DEVREADWRITE8("d8255_2", i8255a_r,i8255a_w,0xffff) // d8255 2, FDD
279297
280298//   AM_RANGE(0x0100, 0x0101) Screen Control Register
281299//   AM_RANGE(0x0102, 0x0103) Graphic Screen Control Register
r9447r9448
307325   AM_RANGE(0x019a, 0x019b) AM_WRITE(backupram_wp_0_w) //Backup RAM write permission
308326//   AM_RANGE(0x01a0, 0x01a7) TCU (timer counter unit)
309327//   AM_RANGE(0x01a8, 0x01a9) General-purpose timer 3 control port
310//   AM_RANGE(0x01b0, 0x01bb) FDC related (765)
328   AM_RANGE(0x01b0, 0x01bb) AM_READ8(fdc_r,0xffff)// FDC related (765)
311329//   AM_RANGE(0x01c0, 0x01c1) ?
312330//   AM_RANGE(0x01c8, 0x01cf) i8255 3 (byte access)
313331//   AM_RANGE(0x01d0, 0x01d1) Expansion RAM bank selection
r9447r9448
375393   GFXDECODE_ENTRY( "kanji",   0x00000, pc88va_chars_16x16,  0, 1 )
376394GFXDECODE_END
377395
396static READ8_DEVICE_HANDLER( fdd_porta_r )
397{
398   return 0xff;
399}
378400
401static READ8_DEVICE_HANDLER( fdd_portb_r )
402{
403   return 0xff;
404}
405
406static READ8_DEVICE_HANDLER( fdd_portc_r )
407{
408   static UINT8 test1,test2;
409
410   test1^=4;
411   test2^=1;
412
413   return 0xff ^ test1 ^ test2;
414}
415
416static WRITE8_DEVICE_HANDLER( fdd_porta_w )
417{
418   // ...
419}
420
421static WRITE8_DEVICE_HANDLER( fdd_portb_w )
422{
423   // ...
424}
425
426static WRITE8_DEVICE_HANDLER( fdd_portc_w )
427{
428   // ...
429}
430
431static I8255A_INTERFACE( fdd_intf )
432{
433   DEVCB_HANDLER(fdd_porta_r),                  /* Port A read */
434   DEVCB_HANDLER(fdd_portb_r),                  /* Port B read */
435   DEVCB_HANDLER(fdd_portc_r),                  /* Port C read */
436   DEVCB_HANDLER(fdd_porta_w),                  /* Port A write */
437   DEVCB_HANDLER(fdd_portb_w),                  /* Port B write */
438   DEVCB_HANDLER(fdd_portc_w)                  /* Port C write */
439};
440
379441static MACHINE_CONFIG_START( pc88va, driver_device )
380442
381443   MDRV_CPU_ADD("maincpu", V30, 8000000)        /* 8 MHz */
r9447r9448
402464
403465   MDRV_MACHINE_RESET( pc88va )
404466
467   MDRV_I8255A_ADD( "d8255_2", fdd_intf )
468
469
405470MACHINE_CONFIG_END
406471
407472

Previous 15994 Revisions Next


© 1998-2018 The MESS Team