summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Jean-François DEL NERO <jeanfrancoisdelnero@free.fr>2015-12-29 00:29:02 +0100
committer Jean-François DEL NERO <jeanfrancoisdelnero@free.fr>2015-12-29 00:29:02 +0100
commitce099f6b22377a3ac1685c269224b1c8ae1c8b78 (patch)
treea95bd1d3f6362d4ef4c384ee6eb3f5153ee25914 /src
parent1ee34e50fb8d5733dbdc31470bb2d60ad93644cf (diff)
Memory read back function added.
Diffstat (limited to 'src')
-rw-r--r--src/devices/video/ef9365.cpp49
-rw-r--r--src/devices/video/ef9365.h9
2 files changed, 54 insertions, 4 deletions
diff --git a/src/devices/video/ef9365.cpp b/src/devices/video/ef9365.cpp
index d4aeb78914b..e6e98460043 100644
--- a/src/devices/video/ef9365.cpp
+++ b/src/devices/video/ef9365.cpp
@@ -30,7 +30,7 @@ const char * register_names[]=
"0x08 - X MSBs ",
"0x09 - X LSBs ",
"0x0A - Y MSBs ",
- "0x0B - X MSBs ",
+ "0x0B - Y LSBs ",
"0x0C - XLP ",
"0x0D - YLP ",
"0x0E - RESERVED ",
@@ -346,6 +346,22 @@ void ef9365_device::set_video_mode(void)
memset(m_border, 0, sizeof(m_border));
}
+// Read back the latched bitplan words
+UINT8 ef9365_device::get_last_readback_word(int bitplan_number, int * pixel_offset)
+{
+ if( pixel_offset )
+ *pixel_offset = m_readback_latch_pix_offset;
+
+ if( bitplan_number < nb_of_bitplans )
+ {
+ return m_readback_latch[bitplan_number];
+ }
+ else
+ {
+ return 0x00;
+ }
+}
+
void ef9365_device::draw_border(UINT16 line)
{
@@ -709,6 +725,34 @@ int ef9365_device::cycles_to_us(int cycles)
return ( (float)cycles * ( (float)1000000 / (float)clock_freq ) );
}
+// Latch the bitplan words pointed by the x & y regiters (Memory read back function)
+void ef9365_device::dump_bitplanes_word()
+{
+ int p;
+ int pixel_ptr;
+
+ pixel_ptr = ( ( ( ( bitplan_yres - 1 ) - ( get_y_reg() & ( bitplan_yres - 1 ) ) ) * bitplan_xres ) + ( get_x_reg() & ( bitplan_xres - 1 ) ) );
+
+ #ifdef DBGMODE
+ printf("dump : x = %d , y = %d\n", get_x_reg() ,get_y_reg());
+ #endif
+
+ for( p = 0; p < nb_of_bitplans ; p++ )
+ {
+ if( pixel_ptr & 0x4 )
+ {
+ m_readback_latch[p] = ( m_videoram->read_byte( (EF936X_BITPLAN_MAX_SIZE*p) + (pixel_ptr>>3) ) ) & 0xF ;
+ }
+ else
+ {
+ m_readback_latch[p] = ( m_videoram->read_byte( (EF936X_BITPLAN_MAX_SIZE*p) + (pixel_ptr>>3) ) >> 4 ) & 0xF ;
+ }
+
+ }
+
+ m_readback_latch_pix_offset = pixel_ptr & 0x3;
+}
+
void ef9365_device::screen_scanning( int force_clear )
{
int x,y,p;
@@ -822,7 +866,8 @@ void ef9365_device::ef9365_exec(UINT8 cmd)
set_busy_flag( cycles_to_us( 4 ) ); // Timing to check on the real hardware
break;
case 0xF: // Direct image memory access request for the next free cycle.
- set_busy_flag( cycles_to_us( 4 ) ); // Timing to check on the real hardware
+ set_busy_flag( cycles_to_us( 64 ) ); // Timing to check on the real hardware
+ dump_bitplanes_word();
break;
default:
logerror("Unemulated EF9365 cmd: %02x\n", cmd);
diff --git a/src/devices/video/ef9365.h b/src/devices/video/ef9365.h
index 2b20e6bdcf4..4716e69e20e 100644
--- a/src/devices/video/ef9365.h
+++ b/src/devices/video/ef9365.h
@@ -56,6 +56,8 @@ public:
void set_color_filler( UINT8 color );
void set_color_entry( int index, UINT8 r, UINT8 g, UINT8 b );
+ UINT8 get_last_readback_word(int bitplan_number, int * pixel_offset);
+
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
protected:
@@ -86,8 +88,8 @@ private:
void set_video_mode(void);
void draw_border(UINT16 line);
void ef9365_exec(UINT8 cmd);
- int cycles_to_us(int cycles);
-
+ int cycles_to_us(int cycles);
+ void dump_bitplanes_word();
void update_interrupts();
// internal state
@@ -115,6 +117,9 @@ private:
UINT16 overflow_mask_y;
int vsync_scanline_pos;
+ UINT8 m_readback_latch[EF936X_MAX_BITPLANS]; // Last DRAM Readback buffer (Filled after a Direct Memory Access Request command)
+ int m_readback_latch_pix_offset;
+
UINT32 clock_freq;
bitmap_rgb32 m_screen_out;