1 // license:GPL-2.0+ 2 // copyright-holders:Kevin Thacker 3 /***************************************************************************** 4 * 5 * includes/timex.h 6 * 7 ****************************************************************************/ 8 9 #ifndef MAME_INCLUDES_TIMEX_H 10 #define MAME_INCLUDES_TIMEX_H 11 12 #pragma once 13 14 #include "bus/generic/carts.h" 15 #include "bus/generic/slot.h" 16 17 /* Border sizes for TS2068. These are guesses based on the number of cycles 18 available per frame. */ 19 #define TS2068_TOP_BORDER 32 20 #define TS2068_BOTTOM_BORDER 32 21 #define TS2068_SCREEN_HEIGHT (TS2068_TOP_BORDER + SPEC_DISPLAY_YSIZE + TS2068_BOTTOM_BORDER) 22 23 /* Double the border sizes to maintain ratio of screen to border */ 24 #define TS2068_LEFT_BORDER 96 /* Number of left hand border pixels */ 25 #define TS2068_DISPLAY_XSIZE 512 /* Horizontal screen resolution */ 26 #define TS2068_RIGHT_BORDER 96 /* Number of right hand border pixels */ 27 #define TS2068_SCREEN_WIDTH (TS2068_LEFT_BORDER + TS2068_DISPLAY_XSIZE + TS2068_RIGHT_BORDER) 28 29 enum 30 { 31 TIMEX_CART_NONE, 32 TIMEX_CART_DOCK, 33 TIMEX_CART_EXROM, 34 TIMEX_CART_HOME 35 }; 36 37 38 class timex_state : public spectrum_state 39 { 40 public: timex_state(const machine_config & mconfig,device_type type,const char * tag)41 timex_state(const machine_config &mconfig, device_type type, const char *tag) : 42 spectrum_state(mconfig, type, tag), 43 m_dock(*this, "dockslot") 44 { 45 } 46 47 void ts2068(machine_config &config); 48 void uk2086(machine_config &config); 49 void tc2048(machine_config &config); 50 51 private: 52 uint8_t ts2068_port_f4_r(); 53 void ts2068_port_f4_w(uint8_t data); 54 uint8_t ts2068_port_ff_r(); 55 void ts2068_port_ff_w(offs_t offset, uint8_t data); 56 void tc2048_port_ff_w(offs_t offset, uint8_t data); 57 58 DECLARE_MACHINE_RESET(tc2048); 59 DECLARE_MACHINE_RESET(ts2068); 60 DECLARE_VIDEO_START(ts2068); 61 uint32_t screen_update_tc2048(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 62 uint32_t screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 63 DECLARE_WRITE_LINE_MEMBER(screen_vblank_timex); 64 65 DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); 66 int m_dock_cart_type, m_ram_chunks; 67 memory_region *m_dock_crt; 68 69 virtual void ts2068_update_memory() override; 70 71 void tc2048_io(address_map &map); 72 void tc2048_mem(address_map &map); 73 void ts2068_io(address_map &map); 74 void ts2068_mem(address_map &map); 75 76 optional_device<generic_slot_device> m_dock; 77 78 inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color); 79 void ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines); 80 void ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor); 81 void ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen); 82 }; 83 84 85 #endif // MAME_INCLUDES_TIMEX_H 86