Previous 15994 Revisions Next

r15718 Thursday 2nd August, 2012 at 17:33:38 UTC by Curt Coder
[ABC800C] Added character display, promoted driver to working. [Curt Coder]
[src/mess/drivers]abc80x.c
[src/mess/includes]abc80x.h
[src/mess/video]abc800.c

src/mess/includes/abc80x.h
r15717r15718
8080        m_sio(*this, Z80SIO_TAG),
8181        m_discrete(*this, "discrete"),
8282        m_ram(*this, RAM_TAG),
83      m_video_ram(*this, "video_ram"),
84      m_char_ram(*this, "char_ram"){ }
83        m_video_ram(*this, "video_ram"),
84        m_char_ram(*this, "char_ram")
85   { }
8586
8687   required_device<cpu_device> m_maincpu;
8788   required_device<z80ctc_device> m_ctc;
r15717r15718
113114   int m_fetch_charram;         // opcode fetched from character RAM region (0x7800-0x7fff)
114115
115116   // video state
116   optional_shared_ptr<UINT8> m_video_ram;             // HR video RAM
117   optional_shared_ptr<UINT8> m_char_ram;            // character RAM
117   optional_shared_ptr<UINT8> m_video_ram;
118   optional_shared_ptr<UINT8> m_char_ram;
118119   const UINT8 *m_char_rom;      // character generator ROM
119120   const UINT8 *m_fgctl_prom;      // foreground control PROM
120121   UINT8 m_hrs;               // HR picture start scanline
r15717r15718
143144
144145   void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
145146
146   DECLARE_DIRECT_UPDATE_MEMBER(abc800m_direct_update_handler);
147   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
147148};
148149
149150class abc800c_state : public abc800_state
r15717r15718
158159
159160   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
160161
162   offs_t translate_trom_offset(offs_t offset);
161163   void hr_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
162164
163   DECLARE_DIRECT_UPDATE_MEMBER(abc800c_direct_update_handler);
165   DECLARE_READ8_MEMBER( char_ram_r );
166   DECLARE_WRITE8_MEMBER( char_ram_w );
167   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
164168};
165169
166170// ======================> abc802_state
r15717r15718
189193   DECLARE_WRITE_LINE_MEMBER( lrs_w );
190194   DECLARE_WRITE_LINE_MEMBER( mux80_40_w );
191195   DECLARE_WRITE_LINE_MEMBER( vs_w );
192   DECLARE_DIRECT_UPDATE_MEMBER(abc802_direct_update_handler);
196   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
193197
194198   // cpu state
195199   int m_lrs;               // low RAM select
r15717r15718
200204   int m_flshclk_ctr;         // flash clock counter
201205   int m_flshclk;            // flash clock
202206   int m_80_40_mux;         // 40/80 column mode
203
204   // fake keyboard state
205   int m_keylatch;
206207};
207208
208209
r15717r15718
246247   DECLARE_WRITE_LINE_MEMBER( keydtr_w );
247248   DECLARE_WRITE_LINE_MEMBER( hs_w );
248249   DECLARE_WRITE_LINE_MEMBER( vs_w );
249   DECLARE_DIRECT_UPDATE_MEMBER(abc806_direct_update_handler);
250   DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
250251
251252   // memory state
252253   int m_keydtr;            // keyboard DTR
r15717r15718
273274   UINT32 m_vsync_shift;      // vertical sync shift register
274275   int m_vsync;            // vertical sync
275276   int m_d_vsync;            // delayed vertical sync
276
277   // fake keyboard state
278   int m_keylatch;
279277};
280278
281279
src/mess/video/abc800.c
r15717r15718
55 ****************************************************************************/
66
77/*
8   
9   TODO:
810
9    TODO:
11   - color cursor
12   - color HR graphics
1013
11    - convert SAA5050 to C++ device and fix its memory interface
12    - ABC800C video: http://www.qsl.net/zl1vfo/teletext.htm
13
1414*/
1515
1616#include "includes/abc80x.h"
r15717r15718
2929//**************************************************************************
3030
3131//-------------------------------------------------
32//  abc800_hrs_w - high resolution scanline write
32//  hrs_w - high resolution scanline write
3333//-------------------------------------------------
3434
3535WRITE8_MEMBER( abc800_state::hrs_w )
r15717r15718
3939
4040
4141//-------------------------------------------------
42//  abc800_hrc_w - high resolution color write
42//  hrc_w - high resolution color write
4343//-------------------------------------------------
4444
4545WRITE8_MEMBER( abc800_state::hrc_w )
r15717r15718
5454//**************************************************************************
5555
5656//-------------------------------------------------
57//  abc800m_hr_update - color high resolution
58//  screen update
57//  translate_trom_offset -
5958//-------------------------------------------------
6059
60offs_t abc800c_state::translate_trom_offset(offs_t offset)
61{
62   int row = offset >> 7;
63   int col = offset & 0x7f;
64
65   if (col >= 80) row += 16;
66   else if (col >= 40) row += 8;
67
68   col %= 40;
69
70   return (row * 40) + col;
71}
72
73
74//-------------------------------------------------
75//  char_ram_r - character RAM read
76//-------------------------------------------------
77
78READ8_MEMBER( abc800c_state::char_ram_r )
79{
80   return saa5050_videoram_r(m_trom, translate_trom_offset(offset));
81}
82
83
84//-------------------------------------------------
85//  char_ram_w - character RAM write
86//-------------------------------------------------
87
88WRITE8_MEMBER( abc800c_state::char_ram_w )
89{
90   saa5050_videoram_w(m_trom, translate_trom_offset(offset), data);
91}
92
93
94//-------------------------------------------------
95//  hr_update - high resolution screen update
96//-------------------------------------------------
97
6198void abc800c_state::hr_update(bitmap_ind16 &bitmap, const rectangle &cliprect)
6299{
63100   UINT16 addr = 0;
64   int sx, y, dot;
65101
66   for (y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 240); y++)
102   for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 240); y++)
67103   {
68104      int x = 0;
69105
70      for (sx = 0; sx < 64; sx++)
106      for (int sx = 0; sx < 64; sx++)
71107      {
72108         UINT8 data = m_video_ram[addr++];
73109
74         for (dot = 0; dot < 4; dot++)
110         for (int dot = 0; dot < 4; dot++)
75111         {
76112            UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
77113            int color = m_fgctl_prom[fgctl_addr] & 0x07;
r15717r15718
86122
87123
88124//-------------------------------------------------
89//  VIDEO_START( abc800c )
125//  VIDEO_START( abc800 )
90126//-------------------------------------------------
91127
92128void abc800_state::video_start()
r15717r15718
116152   if (!BIT(m_fgctl, 7))
117153   {
118154      // draw text
119      //saa5050_update(m_trom, &bitmap, cliprect);
155      saa5050_update(m_trom, bitmap, cliprect);
120156   }
121157
122158   return 0;
r15717r15718
131167{
132168   SCREEN_TAG,
133169   0,   // starting gfxnum
134   40, 24 - 1, 0x80,  // x, y, size
170   40, 24, 40,  // x, y, size
135171   0   // rev y order
136172};
137173
r15717r15718
146182
147183   MCFG_SCREEN_REFRESH_RATE(60)
148184   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
149   MCFG_SCREEN_SIZE(640, 400)
150   MCFG_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1)
185   MCFG_SCREEN_SIZE(640, 480)
186   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
151187
152188   MCFG_PALETTE_LENGTH(128)
153189   MCFG_PALETTE_INIT(saa5050)
r15717r15718
175211
176212
177213//-------------------------------------------------
178//  abc800m_hr_update - monochrome high resolution
179//  screen update
214//  hr_update - high resolution screen update
180215//-------------------------------------------------
181216
182217void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
183218{
184219   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
185220   UINT16 addr = 0;
186   int sx, y, dot;
187221
188   for (y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++)
222   for (int y = m_hrs + VERTICAL_PORCH_HACK; y < MIN(cliprect.max_y + 1, m_hrs + VERTICAL_PORCH_HACK + 240); y++)
189223   {
190224      int x = HORIZONTAL_PORCH_HACK;
191225
192      for (sx = 0; sx < 64; sx++)
226      for (int sx = 0; sx < 64; sx++)
193227      {
194228         UINT8 data = m_video_ram[addr++];
195229
196         for (dot = 0; dot < 4; dot++)
230         for (int dot = 0; dot < 4; dot++)
197231         {
198232            UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
199233            int color = (m_fgctl_prom[fgctl_addr] & 0x07) ? 1 : 0;
src/mess/drivers/abc80x.c
r15717r15718
143143
144144*/
145145
146
147146#include "includes/abc80x.h"
148147
149148
r15717r15718
423422//  ADDRESS_MAP( abc800c_mem )
424423//-------------------------------------------------
425424
426static ADDRESS_MAP_START( abc800c_mem, AS_PROGRAM, 8, abc800_state )
425static ADDRESS_MAP_START( abc800c_mem, AS_PROGRAM, 8, abc800c_state )
427426   ADDRESS_MAP_UNMAP_HIGH
428427   AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE("video_ram")
429428   AM_RANGE(0x4000, 0x7bff) AM_ROM
430   AM_RANGE(0x7c00, 0x7fff) AM_DEVREADWRITE_LEGACY(SAA5052_TAG, saa5050_videoram_r, saa5050_videoram_w)
429   AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(char_ram_r, char_ram_w)
431430   AM_RANGE(0x8000, 0xffff) AM_RAM
432431ADDRESS_MAP_END
433432
r15717r15718
957956   // register for state saving
958957   save_item(NAME(m_lrs));
959958   save_item(NAME(m_pling));
960   save_item(NAME(m_keylatch));
961959}
962960
963961
r15717r15718
10151013   save_item(NAME(m_eme));
10161014   save_item(NAME(m_fetch_charram));
10171015   save_item(NAME(m_map));
1018   save_item(NAME(m_keylatch));
10191016}
10201017
10211018
r15717r15718
12941291   ROM_LOAD( "abc 3-12.1j", 0x3000, 0x1000, CRC(3ea2b5ee) SHA1(5a51ac4a34443e14112a6bae16c92b5eb636603f) )
12951292   ROM_LOAD( "abc 4-12.2m", 0x4000, 0x1000, CRC(695cb626) SHA1(9603ce2a7b2d7b1cbeb525f5493de7e5c1e5a803) )
12961293   ROM_LOAD( "abc 5-12.2l", 0x5000, 0x1000, CRC(b4b02358) SHA1(95338efa3b64b2a602a03bffc79f9df297e9534a) )
1297   ROM_LOAD_OPTIONAL( "abc 6-13.2k", 0x6000, 0x1000, CRC(6fa71fb6) SHA1(b037dfb3de7b65d244c6357cd146376d4237dab6) ) // 1982-07-19
1298   ROM_LOAD_OPTIONAL( "abc 6-11 ufd.2k", 0x6000, 0x1000, CRC(2a45be80) SHA1(bf08a18a74e8bdaee2656a3c8246c0122398b58f) ) // 1983-05-31, should this be "ABC 6-5" or "ABC 6-51" instead of handwritten label "ABC 6-11 UFD"?
1299   ROM_LOAD( "abc 6-52.2k", 0x6000, 0x1000, CRC(c311b57a) SHA1(4bd2a541314e53955a0d53ef2f9822a202daa485) ) // 1984-03-02
1294   ROM_SYSTEM_BIOS( 0, "13", "? (1982-07-19)" )
1295   ROMX_LOAD( "abc 6-13.2k", 0x6000, 0x1000, CRC(6fa71fb6) SHA1(b037dfb3de7b65d244c6357cd146376d4237dab6), ROM_BIOS(1) )
1296   ROM_SYSTEM_BIOS( 1, "11", "? (1983-05-31)" )
1297   ROMX_LOAD( "abc 6-11 ufd.2k", 0x6000, 0x1000, CRC(2a45be80) SHA1(bf08a18a74e8bdaee2656a3c8246c0122398b58f), ROM_BIOS(2) ) // is this "ABC 6-5" or "ABC 6-51" instead?
1298   ROM_SYSTEM_BIOS( 2, "52", "? (1984-03-02)" )
1299   ROMX_LOAD( "abc 6-52.2k", 0x6000, 0x1000, CRC(c311b57a) SHA1(4bd2a541314e53955a0d53ef2f9822a202daa485), ROM_BIOS(3) )
13001300   ROM_LOAD_OPTIONAL( "abc 7-21.2j", 0x7000, 0x1000, CRC(fd137866) SHA1(3ac914d90db1503f61397c0ea26914eb38725044) )
13011301   ROM_LOAD( "abc 7-22.2j", 0x7000, 0x1000, CRC(774511ab) SHA1(5171e43213a402c2d96dee33453c8306ac1aafc8) )
13021302
r15717r15718
14111411//  DRIVER_INIT( abc800c )
14121412//-------------------------------------------------
14131413
1414DIRECT_UPDATE_MEMBER(abc800c_state::abc800c_direct_update_handler)
1414DIRECT_UPDATE_MEMBER(abc800c_state::direct_update_handler)
14151415{
14161416   if (address >= 0x7c00 && address < 0x8000)
14171417   {
r15717r15718
14391439{
14401440   abc800c_state *state = machine.driver_data<abc800c_state>();
14411441   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1442   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800c_state::abc800c_direct_update_handler), state));
1442   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800c_state::direct_update_handler), state));
14431443}
14441444
14451445
r15717r15718
14471447//  DRIVER_INIT( abc800m )
14481448//-------------------------------------------------
14491449
1450DIRECT_UPDATE_MEMBER(abc800m_state::abc800m_direct_update_handler)
1450DIRECT_UPDATE_MEMBER( abc800m_state::direct_update_handler )
14511451{
14521452   if (address >= 0x7800 && address < 0x8000)
14531453   {
r15717r15718
14751475{
14761476   abc800m_state *state = machine.driver_data<abc800m_state>();
14771477   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1478   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800m_state::abc800m_direct_update_handler), state));
1478   program->set_direct_update_handler(direct_update_delegate(FUNC(abc800m_state::direct_update_handler), state));
14791479}
14801480
14811481
r15717r15718
14831483//  DRIVER_INIT( abc802 )
14841484//-------------------------------------------------
14851485
1486DIRECT_UPDATE_MEMBER(abc802_state::abc802_direct_update_handler)
1486DIRECT_UPDATE_MEMBER( abc802_state::direct_update_handler )
14871487{
14881488   if (m_lrs)
14891489   {
r15717r15718
15011501{
15021502   abc802_state *state = machine.driver_data<abc802_state>();
15031503   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1504   program->set_direct_update_handler(direct_update_delegate(FUNC(abc802_state::abc802_direct_update_handler), state));
1504   program->set_direct_update_handler(direct_update_delegate(FUNC(abc802_state::direct_update_handler), state));
15051505}
15061506
15071507
r15717r15718
15091509//  DRIVER_INIT( abc806 )
15101510//-------------------------------------------------
15111511
1512DIRECT_UPDATE_MEMBER(abc806_state::abc806_direct_update_handler)
1512DIRECT_UPDATE_MEMBER( abc806_state::direct_update_handler )
15131513{
15141514   if (address >= 0x7800 && address < 0x8000)
15151515   {
r15717r15718
15371537{
15381538   abc806_state *state = machine.driver_data<abc806_state>();
15391539   address_space *program = machine.device<cpu_device>(Z80_TAG)->space(AS_PROGRAM);
1540   program->set_direct_update_handler(direct_update_delegate(FUNC(abc806_state::abc806_direct_update_handler), state));
1540   program->set_direct_update_handler(direct_update_delegate(FUNC(abc806_state::direct_update_handler), state));
15411541}
15421542
15431543
r15717r15718
15471547//**************************************************************************
15481548
15491549//    YEAR  NAME        PARENT      COMPAT  MACHINE     INPUT   INIT     COMPANY             FULLNAME        FLAGS
1550COMP( 1981, abc800c,    0,         0,      abc800c,    abc800, abc800c, "Luxor Datorer AB", "ABC 800 C/HR", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
1550COMP( 1981, abc800c,    0,         0,      abc800c,    abc800, abc800c, "Luxor Datorer AB", "ABC 800 C/HR", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
15511551COMP( 1981, abc800m,    abc800c,   0,      abc800m,    abc800, abc800m, "Luxor Datorer AB", "ABC 800 M/HR", GAME_SUPPORTS_SAVE )
15521552COMP( 1983, abc802,     0,          0,      abc802,     abc802, abc802,  "Luxor Datorer AB", "ABC 802",       GAME_SUPPORTS_SAVE )
15531553COMP( 1983, abc806,     0,          0,      abc806,     abc806, abc806,  "Luxor Datorer AB", "ABC 806",       GAME_SUPPORTS_SAVE | GAME_NO_SOUND )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team