Merge pull request #3835 from fulivi/hpipc_dev4

Improvements to HP-1LL3 GPU
This commit is contained in:
R. Belmont 2018-08-08 10:01:08 -04:00 committed by GitHub
commit e47eeb12fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 637 additions and 311 deletions

File diff suppressed because it is too large Load Diff

View File

@ -43,16 +43,43 @@ protected:
virtual void device_reset() override;
private:
struct Point {
uint16_t x , y;
};
struct Rectangle {
Point origin;
Point size;
};
void command(int command);
inline void point(int x, int y, int px);
uint16_t get_pix_addr(uint16_t x , uint16_t y) const;
inline void point(int x, int y, bool pix, const uint16_t masks[]);
void label(uint8_t chr, int width);
void fill(int x, int y, int w, int h, int arg);
void line(int x_from, int y_from, int x_to, int y_to);
void bitblt(int dstx, int dsty, uint16_t srcaddr, int width, int height, int op);
void wr_video(uint16_t addr , uint16_t v);
uint16_t rd_video(uint16_t addr) const;
static void get_rop_masks(uint16_t rop , uint16_t masks[]);
static uint16_t apply_rop(uint16_t old_pix , uint16_t new_pix , uint16_t glob_mask , const uint16_t masks[]);
void rmw_rop(uint16_t addr , uint16_t new_pix , uint16_t glob_mask , const uint16_t masks[]);
void clip_coord(int size_1 , int& p1 , int origin_clip , int size_clip , int& origin_2 , int& size_2) const;
bool bitblt(uint16_t src_base_addr , unsigned src_width , unsigned src_height , Point src_p ,
const Rectangle& clip_rect , const Rectangle& dst_rect , uint16_t rop , bool use_m_org = true);
void rowbltpos(unsigned p1_pix , unsigned p2_pix , int width , const uint16_t masks[]);
void rowbltneg(unsigned p1_pix , unsigned p2_pix , int width , const uint16_t masks[]);
void fill(const Rectangle& fill_rect , uint16_t pattern_no);
uint16_t get_pattern_addr(uint16_t pattern_no) const;
void draw_cursor();
void draw_sprite();
void draw_cursor_sprite();
void set_pen_pos(Point p);
void set_sprite_pos(Point p);
Rectangle get_window() const;
Rectangle get_screen() const;
void apply_conf();
uint16_t m_conf[12], m_input[2];
int m_input_ptr, m_memory_ptr, m_conf_ptr;
uint16_t m_conf[ 11 ] , m_input[2] , m_io_word;
int m_io_ptr, m_memory_ptr;
int m_command, m_horiz_pix_total, m_vert_pix_total;
uint16_t m_sad;
@ -64,15 +91,20 @@ private:
bool m_enable_video, m_enable_cursor, m_enable_sprite;
uint16_t m_cursor_x, m_cursor_y, m_saved_x;
uint16_t m_cursor_pattern;
uint16_t m_cursor_offset;
uint16_t m_sprite_x, m_sprite_y;
uint16_t m_sprite_pattern;
struct {
uint16_t width, height, org_x, org_y, width_w;
uint16_t width, height, org_x, org_y;
} m_window;
std::unique_ptr<uint16_t[]> m_videoram;
uint16_t m_ram_addr_mask;
uint16_t m_rw_win_x , m_rw_win_y;
bool m_busy;
bitmap_ind16 m_bitmap, m_cursor, m_sprite;
bitmap_ind16 m_bitmap;
};

View File

@ -495,7 +495,7 @@ void hp_ipc_state::hp_ipc_mem_inner_base(address_map &map)
map(0x0600000, 0x060FFFF).rw(FUNC(hp_ipc_state::mmu_r), FUNC(hp_ipc_state::mmu_w));
map(0x0610000, 0x0610007).rw(FUNC(hp_ipc_state::floppy_id_r), FUNC(hp_ipc_state::floppy_id_w)).umask16(0x00ff);
map(0x0610008, 0x061000F).rw(m_fdc, FUNC(wd2797_device::read), FUNC(wd2797_device::write)).umask16(0x00ff);
map(0x0620000, 0x062000F).rw("gpu", FUNC(hp1ll3_device::read), FUNC(hp1ll3_device::write)).umask16(0x00ff);
map(0x0620000, 0x0620007).rw("gpu", FUNC(hp1ll3_device::read), FUNC(hp1ll3_device::write)).umask16(0x00ff);
map(0x0630000, 0x063FFFF).mask(0xf).rw("hpib" , FUNC(tms9914_device::reg8_r) , FUNC(tms9914_device::reg8_w)).umask16(0x00ff);
map(0x0640000, 0x064002F).rw("rtc", FUNC(mm58167_device::read), FUNC(mm58167_device::write)).umask16(0x00ff);
map(0x0660000, 0x06600FF).rw("mlc", FUNC(hp_hil_mlc_device::read), FUNC(hp_hil_mlc_device::write)).umask16(0x00ff); // 'caravan', scrn/caravan.h
@ -738,9 +738,7 @@ MACHINE_CONFIG_START(hp_ipc_state::hp_ipc_base)
MCFG_DEVICE_ADD("maincpu", M68000, 15.92_MHz_XTAL / 2)
MCFG_DEVICE_PROGRAM_MAP(hp_ipc_mem_outer)
MCFG_HP1LL3_ADD("gpu")
// MCFG_HP1LL3_IRQ_CALLBACK(WRITELINE(*this, hp_ipc_state, irq_4))
MCFG_VIDEO_SET_SCREEN("screen")
HP1LL3(config , "gpu" , 24_MHz_XTAL / 8).set_screen("screen");
// XXX actual clock is 1MHz; remove this workaround (and change 2000 to 100 in hp_ipc_dsk.cpp)
// XXX when floppy code correctly handles 600 rpm drives.
@ -799,12 +797,13 @@ MACHINE_CONFIG_START(hp_ipc_state::hp_ipc)
// horizontal time = 60 us (min)
// ver.refresh period = ~300 us
// ver.period = 16.7ms (~60 hz)
MCFG_SCREEN_ADD_MONOCHROME("screen", LCD, rgb_t::amber()) // actually a kind of EL display
MCFG_SCREEN_UPDATE_DEVICE("gpu", hp1ll3_device, screen_update)
MCFG_SCREEN_RAW_PARAMS(6_MHz_XTAL * 2, 720, 0, 512, 278, 0, 256)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE("mlc", hp_hil_mlc_device, ap_w)) // XXX actually it's driven by 555 (U59)
SCREEN(config , m_screen , SCREEN_TYPE_LCD);
m_screen->set_color(rgb_t::amber()); // actually a kind of EL display
m_screen->set_screen_update("gpu" , FUNC(hp1ll3_device::screen_update));
m_screen->set_raw(6_MHz_XTAL * 2 , 720 , 0 , 512 , 261 , 0 , 255);
m_screen->screen_vblank().set("mlc", FUNC(hp_hil_mlc_device::ap_w)); // XXX actually it's driven by 555 (U59)
m_screen->set_palette("palette");
MCFG_SCREEN_PALETTE("palette")
MCFG_PALETTE_ADD_MONOCHROME("palette")
MACHINE_CONFIG_END