Previous 199869 Revisions Next

r25506 Thursday 3rd October, 2013 at 13:54:40 UTC by Robbbert
(MESS) sapi1 : more wip
[src/mess/drivers]sapi1.c

trunk/src/mess/drivers/sapi1.c
r25505r25506
88        With no available docs, the i/o ports are a guess. The ram
99        allocation is based on the actions of the various bios roms.
1010        Port 25 is used as a jump vector. in a,(25); ld l,a; jp(hl).
11        According to wikipedia, e800+ is the videoram area, and the
12        number of columns is 64.
1311
1412        2012-04-19 Connected sapizps3 to a terminal. It is trying to
1513        load a 128-byte boot sector from a floppy disk.
r25505r25506
5048   DECLARE_WRITE8_MEMBER(sapi1_keyboard_w);
5149   DECLARE_READ8_MEMBER(sapi2_keyboard_status_r);
5250   DECLARE_READ8_MEMBER(sapi2_keyboard_data_r);
51   DECLARE_READ8_MEMBER(sapi3_0c_r);
5352   DECLARE_WRITE8_MEMBER(sapi3_00_w);
5453   DECLARE_READ8_MEMBER(sapi3_25_r);
5554   DECLARE_WRITE8_MEMBER(sapi3_25_w);
r25505r25506
192191static ADDRESS_MAP_START(sapi3b_mem, AS_PROGRAM, 8, sapi1_state )
193192   ADDRESS_MAP_UNMAP_HIGH
194193   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_RAMBANK("bank1")
195   AM_RANGE(0x0800, 0xf7ff) AM_RAM
196   AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("videoram")
194   AM_RANGE(0x0800, 0xafff) AM_RAM
195   AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_SHARE("videoram")
196   AM_RANGE(0xb800, 0xffff) AM_RAM
197197ADDRESS_MAP_END
198198
199199static ADDRESS_MAP_START( sapi3_io, AS_IO, 8, sapi1_state )
r25505r25506
215215   ADDRESS_MAP_UNMAP_HIGH
216216   ADDRESS_MAP_GLOBAL_MASK(0xff)
217217   AM_RANGE(0x00, 0x00) AM_WRITE(sapi3_00_w)
218   AM_RANGE(0x0c, 0x0c) AM_READ(sapi3_0c_r)
218219   AM_RANGE(0x25, 0x25) AM_READWRITE(sapi3_25_r,sapi3_25_w)
219220   AM_RANGE(0xe0, 0xe0) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w)
220221   AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
r25505r25506
283284
284285UINT32 sapi1_state::screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
285286{
286   int x,y,j,b;
287287   bool val;
288   UINT16 addr;
289   int xpos;
288   UINT16 addr,xpos;
289   UINT8 chr,attr,ra,x,y,b;
290290
291291   for(y = 0; y < 24; y++ )
292292   {
r25505r25506
294294      xpos = 0;
295295      for(x = 0; x < 40; x++ )
296296      {
297         UINT8 code = m_p_videoram[addr + x];
298         UINT8 attr = (code >> 6) & 3;
299         code &= 0x3f;
300         for(j = 0; j < 9; j++ )
297         chr = m_p_videoram[addr + x];
298         attr = (chr >> 6) & 3;
299         chr &= 0x3f;
300         for(ra = 0; ra < 9; ra++ )
301301         {
302302            for(b = 0; b < 6; b++ )
303303            {
304304               val = 0;
305305
306               if (j==8)
306               if (ra==8)
307307               {
308308                  if (attr==2)
309309                     val = BIT(m_refresh_counter, 5);
310310               }
311311               else
312312               {
313                  val = BIT(MHB2501[code*8 + j], 5-b);
313                  val = BIT(MHB2501[(chr<<3) | ra], 5-b);
314314                  if (attr==1)
315315                     val = BIT(m_refresh_counter, 5) ? val : 0;
316316               }
317317
318318               if(attr==3)
319319               {
320                  bitmap.pix16(y*9+j, xpos+2*b   ) = val;
321                  bitmap.pix16(y*9+j, xpos+2*b+1 ) = val;
320                  bitmap.pix16(y*9+ra, xpos+2*b   ) = val;
321                  bitmap.pix16(y*9+ra, xpos+2*b+1 ) = val;
322322               }
323323               else
324324               {
325                  bitmap.pix16(y*9+j, xpos+b ) = val;
325                  bitmap.pix16(y*9+ra, xpos+b ) = val;
326326               }
327327            }
328328         }
r25505r25506
336336
337337static MC6845_UPDATE_ROW( update_row )
338338{
339   sapi1_state *state = device->machine().driver_data<sapi1_state>();
340   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
341   UINT8 chr,gfx,inv;
342   UINT16 mem,x;
343   UINT32 *p = &bitmap.pix32(y);
344
345   for (x = 0; x < x_count; x++)
346   {
347      inv = gfx = 0;
348      if (x == cursor_x) inv ^= 0xff;
349      mem = (2*(ma + x)) & 0xfff;
350      chr = state->m_p_videoram[mem] & 0x3f;
351
352      if (ra < 8)
353         gfx = MHB2501[(chr<<3) | ra] ^ inv;
354
355      /* Display a scanline of a character */
356      *p++ = palette[BIT(gfx, 5)];
357      *p++ = palette[BIT(gfx, 4)];
358      *p++ = palette[BIT(gfx, 3)];
359      *p++ = palette[BIT(gfx, 2)];
360      *p++ = palette[BIT(gfx, 1)];
361      *p++ = palette[BIT(gfx, 0)];
362   }
339363}
340364
341365static MC6845_INTERFACE( mc6845_intf )
r25505r25506
406430
407431**************************************/
408432
433READ8_MEMBER( sapi1_state::sapi3_0c_r )
434{
435   return 0xc0;
436}
437
409438/* switch out the rom shadow */
410439WRITE8_MEMBER( sapi1_state::sapi3_00_w )
411440{
r25505r25506
564593
565594ROM_START( sapizps3b )
566595   ROM_REGION( 0x10800, "maincpu", 0 )
567   // This bios uses a 6845 and unknown videoram
596   // This bios uses a 6845
568597   ROM_LOAD( "pkt1.bin",       0x10000, 0x0800, CRC(ed5a2725) SHA1(3383c15f87f976400b8d0f31829e2a95236c4b6c))
569598ROM_END
570599

Previous 199869 Revisions Next


© 1997-2024 The MAME Team