From e35934262407866ce8665b0e46a7a78b2041538b Mon Sep 17 00:00:00 2001 From: cracyc Date: Sat, 10 Feb 2018 21:49:21 -0600 Subject: olyboss: cleanup and add fdc (nw) --- src/mame/drivers/olyboss.cpp | 96 +++++--------------------------------------- 1 file changed, 11 insertions(+), 85 deletions(-) diff --git a/src/mame/drivers/olyboss.cpp b/src/mame/drivers/olyboss.cpp index bcaea7d6ce8..797ff6597fe 100644 --- a/src/mame/drivers/olyboss.cpp +++ b/src/mame/drivers/olyboss.cpp @@ -39,6 +39,7 @@ #include "video/upd3301.h" #include "machine/i8257.h" #include "machine/am9519.h" +#include "machine/upd765.h" #include "screen.h" #define Z80_TAG "z80" @@ -62,11 +63,7 @@ public: { } DECLARE_DRIVER_INIT(olyboss); - DECLARE_READ8_MEMBER( videoram_read ); - DECLARE_WRITE8_MEMBER( videoram_write ); DECLARE_READ8_MEMBER(keyboard_read); - DECLARE_READ8_MEMBER(port_read); - DECLARE_WRITE8_MEMBER(port_write); UPD3301_DRAW_CHARACTER_MEMBER( olyboss_display_pixels ); @@ -75,17 +72,14 @@ public: void olybossd(machine_config &config); -protected: +private: required_device m_maincpu; required_device m_dma; required_device m_crtc; required_memory_region m_char_rom; - //uint32_t screen_update_olyboss(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -private: bool m_keybhit; u8 m_keystroke; - uint8_t m_mainVideoram[0x2000]; void keyboard_put(u8 data); @@ -99,22 +93,17 @@ static ADDRESS_MAP_START(olyboss_mem, AS_PROGRAM, 8, olyboss_state) AM_RANGE(0x0000, 0x7ff ) AM_ROM AM_REGION("mainrom", 0) AM_RANGE(0x800, 0xbffd) AM_RAM AM_RANGE(0xbffe, 0xbfff) AM_READ(keyboard_read) - //AM_RANGE(0xc000, 0xf2c5) AM_RAM AM_RANGE(0xc000, 0xffff) AM_RAM - //AM_RANGE(0xf2c6, 0xffbf ) AM_READWRITE(videoram_read,videoram_write) - //AM_RANGE(0xffc0, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START(olyboss_io, AS_IO, 8, olyboss_state) ADDRESS_MAP_GLOBAL_MASK(0xff) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0x0, 0x8) AM_DEVREADWRITE(I8257_TAG, i8257_device, read, write) - AM_RANGE(0x9, 0x2f) AM_READWRITE(port_read,port_write) + AM_RANGE(0x10, 0x11) AM_DEVICE("fdc", upd765a_device, map) AM_RANGE(0x30, 0x30) AM_DEVREADWRITE("uic", am9519_device, data_r, data_w) AM_RANGE(0x31, 0x31) AM_DEVREADWRITE("uic", am9519_device, stat_r, cmd_w) - AM_RANGE(0x32, 0x7f) AM_READWRITE(port_read,port_write) AM_RANGE(0x80, 0x81) AM_DEVREADWRITE(UPD3301_TAG, upd3301_device, read, write) - AM_RANGE(0x82, 0xff) AM_READWRITE(port_read,port_write) ADDRESS_MAP_END static INPUT_PORTS_START( olyboss ) @@ -135,7 +124,6 @@ UPD3301_DRAW_CHARACTER_MEMBER( olyboss_state::olyboss_display_pixels ) //if (lc >= 8) return; if (csr) { - logerror("csr\n"); data = 0xff; } @@ -147,58 +135,6 @@ UPD3301_DRAW_CHARACTER_MEMBER( olyboss_state::olyboss_display_pixels ) } } -/* not used */ -/* -uint32_t olyboss_state::screen_update_olyboss(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - uint8_t *chargen = memregion(UPD3301_TAG)->base(); - //uint8_t *chargen = memregion("chargen")->base(); - uint8_t y,ra,chr,gfx; - uint16_t sy=0,ma=0,x; - - bitmap.fill(0); - - int numColumns=80; - for (y = 28; y > 0; y--) - { - for (ra = 0; ra < 11; ra++) - { - uint16_t *p = &bitmap.pix16(sy++); - - for (x = ma; x < ma + numColumns; x++) - { - chr = m_mainVideoram[x]; - gfx = chargen[(chr<<4) | ra ]; - - *p++ = BIT(gfx, 7); - *p++ = BIT(gfx, 6); - *p++ = BIT(gfx, 5); - *p++ = BIT(gfx, 4); - *p++ = BIT(gfx, 3); - *p++ = BIT(gfx, 2); - *p++ = BIT(gfx, 1); - *p++ = BIT(gfx, 0); - } - } - ma+=numColumns+40; - } - - - return 0; -} -*/ - -WRITE8_MEMBER( olyboss_state::videoram_write ) -{ - // logerror("vramw [%2.2x][%2.2x] port0 [%2.2x] fbfd [%2.2x] fbfe [%2.2x] PC [%4.4x]\n",offset,data,m_port0,m_fbfd,m_fbfe,m_maincpu->safe_pc()); - m_mainVideoram[offset]=data; -} - -READ8_MEMBER( olyboss_state::videoram_read ) -{ - return m_mainVideoram[offset]; -} - //************************************************************************** // KEYBOARD //************************************************************************** @@ -259,27 +195,12 @@ WRITE_LINE_MEMBER( olyboss_state::hrq_w ) READ8_MEMBER( olyboss_state::dma_mem_r ) { address_space &program = m_maincpu->space(AS_PROGRAM); - - if (offset==0xf2c6) - { - logerror("DMA read at offset [%x] val is [%2.2x]\n",offset,program.read_byte(offset)); - } - return program.read_byte(offset); } -/* ports */ - -WRITE8_MEMBER( olyboss_state::port_write ) -{ - logerror("Wrote to port [%2.2x] value [%2.2x]\n",offset,data); -} - -READ8_MEMBER( olyboss_state::port_read) -{ - logerror("Reading from port [%2.2x]\n",offset); - return 0xff; -} +static SLOT_INTERFACE_START( boss_floppies ) + SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) +SLOT_INTERFACE_END //************************************************************************** // MACHINE CONFIGURATION @@ -304,6 +225,11 @@ MACHINE_CONFIG_START( olyboss_state::olybossd ) MCFG_DEVICE_ADD("uic", AM9519, 0) MCFG_AM9519_OUT_INT_CB(INPUTLINE(Z80_TAG, 0)) + MCFG_UPD765A_ADD("fdc", true, true) + MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE("uic", am9519_device, ireq2_w)) MCFG_DEVCB_INVERT + MCFG_UPD765_DRQ_CALLBACK(NOOP) + MCFG_FLOPPY_DRIVE_ADD("fdc:0", boss_floppies, "525qd", floppy_image_device::default_floppy_formats) + MCFG_DEVICE_ADD(I8257_TAG, I8257, XTAL(4'000'000)) MCFG_I8257_OUT_HRQ_CB(WRITELINE(olyboss_state, hrq_w)) MCFG_I8257_IN_MEMR_CB(READ8(olyboss_state, dma_mem_r)) -- cgit v1.2.3