Previous 15994 Revisions Next

r2722 Saturday 24th May, 2008 at 14:39:58 UTC by Miodrag Milanović
[GALAXYP] Video fixed a little bit
[src/mess/drivers]galaxy.c
[src/mess/video]galaxy.c

src/mess/video/galaxy.c
r2721r2722
4343UINT32 gal_cnt = 0;
4444static UINT8 code = 0;
4545static UINT8 first = 0;
46static UINT8 prev_R = 0;
47static UINT8 add_addr =0;
46
4847emu_timer *gal_video_timer = NULL;
4948
5049TIMER_CALLBACK( gal_video )
r2721r2722
5453      UINT8 *gfx = memory_region(REGION_GFX1);
5554      UINT8 dat = (gal_latch_value & 0x3c) >> 2;
5655      if ((gal_cnt > 48 * 2) && (gal_cnt < 48 * 210)) { // display on screen just first 208 lines
57         UINT8 mode = (gal_latch_value ) & 3; // bit 1 and 2 of latch represents mode
56         UINT8 mode = (gal_latch_value >> 1) & 1; // bit 2 latch represents mode
5857         UINT16 addr = (cpunum_get_reg(0, Z80_I) << 8) | cpunum_get_reg(0, Z80_R) | ((gal_latch_value & 0x80) ^ 0x80);
5958           if (mode == 0){
6059              // Text mode
r2721r2722
8483         }
8584         else
8685         { // Graphics mode
87            code = program_read_byte(addr);                           
86              if (first<4 && (cpunum_get_reg(0, Z80_R) & 0x1f) ==0) {
87                 // Due to a fact that on real processor latch value is set at
88                 // the end of last cycle we need to skip dusplay of 4 times
89                 // first char in each row
90                 code = 0xff;
91                 first++;
92            } else {
93               code = program_read_byte(addr);
94               first = 0;
95            }
8896            y = gal_cnt / 48 - 2;
8997            x = (gal_cnt % 48) * 8;
90            if (x < 11*8 || x > 42*8) code = 0xff;
98           
9199            *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 0) & 1; x++;
92100            *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 1) & 1; x++;
93101            *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 2) & 1; x++;
r2721r2722
111119{
112120   timer_adjust_periodic(gal_video_timer, attotime_zero, 0, attotime_never);
113121   if (galaxy_interrupts_enabled == FALSE) {
114      rectangle black_area = {0,384-1,0,212-2};
122      rectangle black_area = {0,384-1,0,208-1};
115123      fillbitmap(tmpbitmap, 1, &black_area);
116124   }
117125   galaxy_interrupts_enabled = FALSE;
118   add_addr = 0;
119   prev_R = 0;
120126   return VIDEO_UPDATE_CALL ( generic_bitmapped );
121127}
122128
src/mess/drivers/galaxy.c
r2721r2722
3939
4040static ADDRESS_MAP_START (galaxy_mem, ADDRESS_SPACE_PROGRAM, 8)
4141   AM_RANGE(0x0000, 0x0fff) AM_ROM
42   AM_RANGE(0x2000, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE ( galaxy_keyboard_r, galaxy_latch_w )
42   AM_RANGE(0x2000, 0x2037) AM_MIRROR(0x07c0) AM_READ ( galaxy_keyboard_r )
43   AM_RANGE(0x2038, 0x203f) AM_MIRROR(0x07c0) AM_WRITE ( galaxy_latch_w )   
4344ADDRESS_MAP_END
4445
4546static ADDRESS_MAP_START (galaxyp_mem, ADDRESS_SPACE_PROGRAM, 8)
4647   AM_RANGE(0x0000, 0x0fff) AM_ROM // ROM A
4748   AM_RANGE(0x1000, 0x1fff) AM_ROM // ROM B
48   AM_RANGE(0x2000, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE ( galaxy_keyboard_r, galaxy_latch_w )
49   AM_RANGE(0x2000, 0x2037) AM_MIRROR(0x07c0) AM_READ ( galaxy_keyboard_r )
50   AM_RANGE(0x2038, 0x203f) AM_MIRROR(0x07c0) AM_WRITE ( galaxy_latch_w )   
4951   AM_RANGE(0xe000, 0xefff) AM_ROM // ROM C
5052   AM_RANGE(0xf000, 0xffff) AM_ROM // ROM D
5153ADDRESS_MAP_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team