diff options
Diffstat (limited to 'src/mess/drivers/apogee.c')
-rw-r--r-- | src/mess/drivers/apogee.c | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/src/mess/drivers/apogee.c b/src/mess/drivers/apogee.c index 949ec99a07e..f8d3dac2cc7 100644 --- a/src/mess/drivers/apogee.c +++ b/src/mess/drivers/apogee.c @@ -12,9 +12,7 @@ #include "sound/wave.h" #include "sound/speaker.h" #include "machine/i8255.h" -#include "machine/8257dma.h" #include "machine/pit8253.h" -#include "video/i8275.h" #include "imagedev/cassette.h" #include "formats/rk_cas.h" #include "includes/radio86.h" @@ -33,6 +31,7 @@ public: DECLARE_WRITE_LINE_MEMBER(pit8253_out0_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_out1_changed); DECLARE_WRITE_LINE_MEMBER(pit8253_out2_changed); + I8275_DRAW_CHARACTER_MEMBER(display_pixels); required_device<speaker_sound_device> m_speaker; }; @@ -45,8 +44,8 @@ static ADDRESS_MAP_START(apogee_mem, AS_PROGRAM, 8, apogee_state ) AM_RANGE( 0xec00, 0xec03 ) AM_DEVREADWRITE("pit8253", pit8253_device, read, write) AM_MIRROR(0x00fc) AM_RANGE( 0xed00, 0xed03 ) AM_DEVREADWRITE("ppi8255_1", i8255_device, read, write) AM_MIRROR(0x00fc) //AM_RANGE( 0xee00, 0xee03 ) AM_DEVREADWRITE("ppi8255_2", i8255_device, read, write) AM_MIRROR(0x00fc) - AM_RANGE( 0xef00, 0xef01 ) AM_DEVREADWRITE("i8275", i8275_device, read, write) AM_MIRROR(0x00fe) // video - AM_RANGE( 0xf000, 0xf0ff ) AM_DEVWRITE("dma8257", i8257_device, i8257_w) // DMA + AM_RANGE( 0xef00, 0xef01 ) AM_DEVREADWRITE("i8275", i8275x_device, read, write) AM_MIRROR(0x00fe) // video + AM_RANGE( 0xf000, 0xf0ff ) AM_DEVWRITE("dma8257", i8257n_device, write) // DMA AM_RANGE( 0xf000, 0xffff ) AM_ROM // System ROM ADDRESS_MAP_END @@ -178,6 +177,27 @@ WRITE_LINE_MEMBER(apogee_state::pit8253_out2_changed) m_speaker->level_w(m_out0+m_out1+m_out2); } +I8275_DRAW_CHARACTER_MEMBER(apogee_state::display_pixels) +{ + int i; + const rgb_t *palette = m_palette->palette()->entry_list_raw(); + const UINT8 *charmap = m_charmap + (gpa & 1) * 0x400; + UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff; + if(linecount == 8) + return; + if (vsp) { + pixels = 0; + } + if (lten) { + pixels = 0xff; + } + if (rvv) { + pixels ^= 0xff; + } + for(i=0;i<6;i++) { + bitmap.pix32(y, x + i) = palette[(pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0]; + } +} /* F4 Character Displayer */ static const gfx_layout apogee_charlayout = @@ -221,12 +241,15 @@ static MACHINE_CONFIG_START( apogee, apogee_state ) //MCFG_DEVICE_ADD("ppi8255_2", I8255, 0) - MCFG_I8275_ADD("i8275", apogee_i8275_interface) + MCFG_DEVICE_ADD("i8275", I8275x, XTAL_16MHz / 9 / 4) + MCFG_I8275_CHARACTER_WIDTH(6) + MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(apogee_state, display_pixels) + MCFG_I8275_DRQ_CALLBACK(DEVWRITELINE("dma8257",i8257n_device, dreq2_w)) + /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_UPDATE_DEVICE("i8275", i8275_device, screen_update) + MCFG_SCREEN_UPDATE_DEVICE("i8275", i8275x_device, screen_update) MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ MCFG_SCREEN_SIZE(78*6, 30*10) MCFG_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1) @@ -241,11 +264,12 @@ static MACHINE_CONFIG_START( apogee, apogee_state ) MCFG_SOUND_CONFIG(apogee_speaker_interface) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) - MCFG_DEVICE_ADD("dma8257", I8257, XTAL_16MHz / 9) + MCFG_DEVICE_ADD("dma8257", I8257N, XTAL_16MHz / 9) MCFG_I8257_OUT_HRQ_CB(WRITELINE(radio86_state, hrq_w)) MCFG_I8257_IN_MEMR_CB(READ8(radio86_state, memory_read_byte)) MCFG_I8257_OUT_MEMW_CB(WRITE8(radio86_state, memory_write_byte)) - MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("i8275", i8275_device, dack_w)) + MCFG_I8257_OUT_IOW_2_CB(DEVWRITE8("i8275", i8275x_device, dack_w)) + MCFG_I8257_REVERSE_RW_MODE(1) MCFG_CASSETTE_ADD( "cassette", apogee_cassette_interface ) MCFG_SOFTWARE_LIST_ADD("cass_list","apogee") |