Previous 199869 Revisions Next

r20261 Monday 14th January, 2013 at 15:42:27 UTC by David Haywood
smc777
- avoid crash when loading some games (eg comp1, ghost) due to going past bounds in pen (might need a proper / better fix but the code is safe now)
- don't do string / hash lookup in inner most draw loop(!!) (this driver has excessive lookups all over the place on read/write accesses too)
[src/mess/drivers]smc777.c

trunk/src/mess/drivers/smc777.c
r20260r20261
2727#include "formats/basicdsk.h"
2828#include "imagedev/flopdrv.h"
2929
30#define SMC777_NUMPENS (0x10+8) //16 palette entries + 8 special colors
3031
3132class smc777_state : public driver_device
3233{
r20260r20261
109110   UINT8 *vram = machine().root_device().memregion("vram")->base();
110111   UINT8 *attr = machine().root_device().memregion("attr")->base();
111112   UINT8 *gram = memregion("fbuf")->base();
113   UINT8 *gfx_data = machine().root_device().memregion("pcg")->base();
114
112115   int x_width;
113116
114117   bitmap.fill(machine().pens[m_backdrop_pen], cliprect);
r20260r20261
192195         {
193196            for(xi=0;xi<8;xi++)
194197            {
195               UINT8 *gfx_data = machine().root_device().memregion("pcg")->base();
196198               int pen;
197199
198200               pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? (color+m_pal_mode) : bk_pen;
199201
200               if(pen != -1)
202               if ((pen != -1) && (pen < SMC777_NUMPENS))
201203                  bitmap.pix16(y*8+CRTC_MIN_Y+yi, x*8+CRTC_MIN_X+xi) = machine().pens[pen];
202204            }
203205         }
r20260r20261
10521054 *************************************/
10531055
10541056
1057
10551058//-------------------------------------------------
10561059//  sn76496_config psg_intf
10571060//-------------------------------------------------
r20260r20261
10801083   MCFG_SCREEN_VISIBLE_AREA(0, 660-1, 0, 220-1) //normal 640 x 200 + 20 pixels for border color
10811084   MCFG_SCREEN_UPDATE_DRIVER(smc777_state, screen_update_smc777)
10821085
1083   MCFG_PALETTE_LENGTH(0x10+8) //16 palette entries + 8 special colors
1086   MCFG_PALETTE_LENGTH(SMC777_NUMPENS)
10841087   MCFG_GFXDECODE(smc777)
10851088
10861089   MCFG_MC6845_ADD("crtc", H46505, MASTER_CLOCK/2, mc6845_intf)    /* unknown clock, hand tuned to get ~60 fps */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team