Previous 199869 Revisions Next

r20267 Monday 14th January, 2013 at 18:50:03 UTC by Angelo Salese
Further clean-ups
[src/mess/drivers]smc777.c

trunk/src/mess/drivers/smc777.c
r20266r20267
2727#include "formats/basicdsk.h"
2828#include "imagedev/flopdrv.h"
2929
30#define SMC777_NUMPENS (0x10+8) //16 palette entries + 8 special colors
31
3230class smc777_state : public driver_device
3331{
3432public:
r20266r20267
193191
194192         if(blink && machine().primary_screen->frame_number() & 0x10) //blinking, used by Dragon's Alphabet
195193            color = bk_pen;
196         else
197            color+=m_pal_mode;
198194
199195         for(yi=0;yi<8;yi++)
200196         {
r20266r20267
202198            {
203199               int pen;
204200
205               pen = ((m_pcg[tile*8+yi]>>(7-xi)) & 1) ? (color) : bk_pen;
201               pen = ((m_pcg[tile*8+yi]>>(7-xi)) & 1) ? (color+m_pal_mode) : bk_pen;
206202
207203               if (pen != -1)
208204                  bitmap.pix16(y*8+CRTC_MIN_Y+yi, x*8+CRTC_MIN_X+xi) = machine().pens[pen];
r20266r20267
965961   m_gvram = auto_alloc_array(machine(), UINT8, 0x8000);
966962   m_pcg = auto_alloc_array(machine(), UINT8, 0x800);
967963
968   beep_set_frequency(machine().device(BEEPER_TAG),300); //guesswork
969   beep_set_state(machine().device(BEEPER_TAG),0);
970
971964   state_save_register_global_pointer(machine(), m_work_ram, 0x10000);
972965   state_save_register_global_pointer(machine(), m_vram, 0x800);
973966   state_save_register_global_pointer(machine(), m_attr, 0x800);
r20266r20267
982975   m_raminh = 1;
983976   m_raminh_pending_change = 1;
984977   m_raminh_prefetch = 0xff;
978   m_pal_mode = 0x10;
979
980   beep_set_frequency(machine().device(BEEPER_TAG),300); //TODO: correct frequency
981   beep_set_state(machine().device(BEEPER_TAG),0);
985982}
986983
987984
r20266r20267
999996   NULL        /* update address callback */
1000997};
1001998
999/* set-up SMC-70 mode colors */
10021000void smc777_state::palette_init()
10031001{
10041002   int i;
r20266r20267
10121010      b = (i & 1) >> 0;
10131011
10141012      palette_set_color_rgb(machine(), i, pal1bit(r),pal1bit(g),pal1bit(b));
1013      palette_set_color_rgb(machine(), i+8, pal1bit(0),pal1bit(0),pal1bit(0));
10151014   }
10161015}
10171016
r20266r20267
10871086   MCFG_SCREEN_VISIBLE_AREA(0, 660-1, 0, 220-1) //normal 640 x 200 + 20 pixels for border color
10881087   MCFG_SCREEN_UPDATE_DRIVER(smc777_state, screen_update_smc777)
10891088
1090   MCFG_PALETTE_LENGTH(SMC777_NUMPENS)
1089   MCFG_PALETTE_LENGTH(0x20) // 16 + 8 colors (SMC-777 + SMC-70) + 8 empty entries (SMC-70)
10911090
10921091   MCFG_MC6845_ADD("crtc", H46505, MASTER_CLOCK/2, mc6845_intf)    /* unknown clock, hand tuned to get ~60 fps */
10931092

Previous 199869 Revisions Next


© 1997-2024 The MAME Team