Previous 15994 Revisions Next

r15434 Sunday 10th June, 2012 at 02:55:00 UTC by R. Belmont
Apple II: Add support for IBS AP16 VideoTerm clone [R. Belmont, rfka01]
[src/mess/drivers]apple2.c
[src/mess/machine]a2videoterm.c a2videoterm.h

src/mess/machine/a2videoterm.c
r15433r15434
3434//**************************************************************************
3535
3636const device_type A2BUS_VIDEOTERM = &device_creator<a2bus_videoterm_device>;
37const device_type A2BUS_IBSAP16 = &device_creator<a2bus_ap16_device>;
3738
3839#define VIDEOTERM_ROM_REGION  "vterm_rom"
3940#define VIDEOTERM_GFX_REGION  "vterm_gfx"
r15433r15434
5455   DEVCB_NULL,            /* on_de_changed */
5556   DEVCB_NULL,            /* on_cur_changed */
5657    DEVCB_NULL,         /* on hsync changed */
57   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_videoterm_device, vsync_changed),   /* on_vsync_changed */
58   DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_videx80_device, vsync_changed),   /* on_vsync_changed */
5859   NULL
5960};
6061
r15433r15434
8384    ROM_LOAD( "videx videoterm character rom symbol.bin", 0x004800, 0x000800, CRC(82bce582) SHA1(29dfa8c5257dbf25651c6bffa9cdb453482aa70e) )
8485ROM_END
8586
87ROM_START( a2ap16 )
88   ROM_REGION(0x2000, VIDEOTERM_ROM_REGION, 0)
89    ROM_LOAD( "space 84 video ap16.bin", 0x000000, 0x002000, CRC(0e188da2) SHA1(9a29250b6cc7b576fdc67769944de35e6f54b9d5) )
90
91   ROM_REGION(0x4000, VIDEOTERM_GFX_REGION, 0)
92    ROM_LOAD( "space 84 video chargen ap16.bin", 0x000000, 0x002000, CRC(b9447088) SHA1(19c95f91a67b948fc00a14621d574d629479d451) )
93ROM_END
94
8695/***************************************************************************
8796    FUNCTION PROTOTYPES
8897***************************************************************************/
r15433r15434
92101//  machine configurations
93102//-------------------------------------------------
94103
95machine_config_constructor a2bus_videoterm_device::device_mconfig_additions() const
104machine_config_constructor a2bus_videx80_device::device_mconfig_additions() const
96105{
97106   return MACHINE_CONFIG_NAME( a2videoterm );
98107}
r15433r15434
106115   return ROM_NAME( a2videoterm );
107116}
108117
118const rom_entry *a2bus_ap16_device::device_rom_region() const
119{
120   return ROM_NAME( a2ap16 );
121}
122
109123//**************************************************************************
110124//  LIVE DEVICE
111125//**************************************************************************
112126
113a2bus_videoterm_device::a2bus_videoterm_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
127a2bus_videx80_device::a2bus_videx80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
114128    device_t(mconfig, type, name, tag, owner, clock),
115129    device_a2bus_card_interface(mconfig, *this),
116130    m_crtc(*this, VIDEOTERM_MC6845_NAME)
117131{
118   m_shortname = "a2vidtrm";
119132}
120133
121134a2bus_videoterm_device::a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
122    device_t(mconfig, A2BUS_VIDEOTERM, "Videx VideoTerm", tag, owner, clock),
123    device_a2bus_card_interface(mconfig, *this),
124    m_crtc(*this, VIDEOTERM_MC6845_NAME)
135    a2bus_videx80_device(mconfig, A2BUS_VIDEOTERM, "Videx VideoTerm", tag, owner, clock)
125136{
126137   m_shortname = "a2vidtrm";
127138}
128139
140a2bus_ap16_device::a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
141    a2bus_videx80_device(mconfig, A2BUS_VIDEOTERM, "IBS AP-16 80 column card", tag, owner, clock)
142{
143   m_shortname = "a2ap16";
144}
145
129146//-------------------------------------------------
130147//  device_start - device-specific startup
131148//-------------------------------------------------
132149
133void a2bus_videoterm_device::device_start()
150void a2bus_videx80_device::device_start()
134151{
135152   // set_a2bus_device makes m_slot valid
136153   set_a2bus_device();
r15433r15434
148165    save_item(NAME(m_rambank));
149166}
150167
151void a2bus_videoterm_device::device_reset()
168void a2bus_videx80_device::device_reset()
152169{
153170    m_rambank = 0;
154171    m_framecnt = 0;
r15433r15434
159176    read_c0nx - called for reads from this card's c0nx space
160177-------------------------------------------------*/
161178
162UINT8 a2bus_videoterm_device::read_c0nx(address_space &space, UINT8 offset)
179UINT8 a2bus_videx80_device::read_c0nx(address_space &space, UINT8 offset)
163180{
164181//    printf("Read c0n%x (PC=%x)\n", offset, cpu_get_pc(&space.device()));
165182
r15433r15434
178195    write_c0nx - called for writes to this card's c0nx space
179196-------------------------------------------------*/
180197
181void a2bus_videoterm_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
198void a2bus_videx80_device::write_c0nx(address_space &space, UINT8 offset, UINT8 data)
182199{
183200//    printf("Write %02x to c0n%x (PC=%x)\n", data, offset, cpu_get_pc(&space.device()));
184201
r15433r15434
198215    read_cnxx - called for reads from this card's cnxx space
199216-------------------------------------------------*/
200217
201UINT8 a2bus_videoterm_device::read_cnxx(address_space &space, UINT8 offset)
218UINT8 a2bus_videx80_device::read_cnxx(address_space &space, UINT8 offset)
202219{
203    // one slot image at the start of the ROM, it appears
220    // one slot image at the end of the ROM, it appears
204221    return m_rom[offset+0x300];
205222}
206223
224UINT8 a2bus_ap16_device::read_cnxx(address_space &space, UINT8 offset)
225{
226    // one slot image at the end of the ROM, it appears
227    return m_rom[offset+0x1f00];
228}
229
207230/*-------------------------------------------------
208231    write_cnxx - called for writes to this card's cnxx space
209232    the firmware writes here to switch in our $C800 a lot
210233-------------------------------------------------*/
211void a2bus_videoterm_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data)
234void a2bus_videx80_device::write_cnxx(address_space &space, UINT8 offset, UINT8 data)
212235{
213236}
214237
r15433r15434
216239    read_c800 - called for reads from this card's c800 space
217240-------------------------------------------------*/
218241
219UINT8 a2bus_videoterm_device::read_c800(address_space &space, UINT16 offset)
242UINT8 a2bus_videx80_device::read_c800(address_space &space, UINT16 offset)
220243{
221244    // ROM at c800-cbff
222245    // bankswitched RAM at cc00-cdff
r15433r15434
234257/*-------------------------------------------------
235258    write_c800 - called for writes to this card's c800 space
236259-------------------------------------------------*/
237void a2bus_videoterm_device::write_c800(address_space &space, UINT16 offset, UINT8 data)
260void a2bus_videx80_device::write_c800(address_space &space, UINT16 offset, UINT8 data)
238261{
239262    if (offset >= 0x400)
240263    {
r15433r15434
245268
246269static MC6845_UPDATE_ROW( videoterm_update_row )
247270{
248   a2bus_videoterm_device   *vterm  = downcast<a2bus_videoterm_device *>(device->owner());
271   a2bus_videx80_device   *vterm  = downcast<a2bus_videx80_device *>(device->owner());
249272   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
250273   UINT32   *p = &bitmap.pix32(y);
251274   UINT16   chr_base = ra; //( ra & 0x08 ) ? 0x800 | ( ra & 0x07 ) : ra;
r15433r15434
278301   }
279302}
280303
281WRITE_LINE_MEMBER( a2bus_videoterm_device::vsync_changed )
304WRITE_LINE_MEMBER( a2bus_videx80_device::vsync_changed )
282305{
283306   if ( state )
284307   {
src/mess/machine/a2videoterm.h
r15433r15434
1717//  TYPE DEFINITIONS
1818//**************************************************************************
1919
20class a2bus_videoterm_device:
20class a2bus_videx80_device:
2121    public device_t,
2222    public device_a2bus_card_interface
2323{
2424public:
2525    // construction/destruction
26    a2bus_videoterm_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
27    a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
26    a2bus_videx80_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
2827
2928    // optional information overrides
3029    virtual machine_config_constructor device_mconfig_additions() const;
31    virtual const rom_entry *device_rom_region() const;
3230
3331    DECLARE_WRITE_LINE_MEMBER(vsync_changed);
3432
r15433r15434
5452    int m_rambank;
5553};
5654
55class a2bus_videoterm_device : public a2bus_videx80_device
56{
57public:
58    a2bus_videoterm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
59
60    virtual const rom_entry *device_rom_region() const;
61};
62
63class a2bus_ap16_device : public a2bus_videx80_device
64{
65public:
66    a2bus_ap16_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
67
68    virtual const rom_entry *device_rom_region() const;
69
70    virtual UINT8 read_cnxx(address_space &space, UINT8 offset);
71};
72
73
5774// device type definition
5875extern const device_type A2BUS_VIDEOTERM;
76extern const device_type A2BUS_IBSAP16;
5977
6078#endif /* __A2BUS_VIDEOTERM__ */
6179
src/mess/drivers/apple2.c
r15433r15434
628628    SLOT_INTERFACE("sam", A2BUS_SAM)    /* SAM Software Automated Mouth (8-bit DAC + speaker) */
629629    SLOT_INTERFACE("alfam2", A2BUS_ALFAM2)    /* ALF Apple Music II */
630630    SLOT_INTERFACE("echoii", A2BUS_ECHOII)    /* Street Electronics Echo II */
631    SLOT_INTERFACE("ap16", A2BUS_IBSAP16)    /* IBS AP16 (German VideoTerm clone) */
631632//    SLOT_INTERFACE("scsi", A2BUS_SCSI)  /* Apple II SCSI Card */
632633SLOT_INTERFACE_END
633634

Previous 15994 Revisions Next


© 1998-2018 The MESS Team