Previous 199869 Revisions Next

r35118 Wednesday 18th February, 2015 at 17:51:18 UTC by Osso
Merge pull request #136 from cuavas/master

Two quick debugger fixes
[src/mame/drivers]gluck2.c iqblock.c progolf.c quizo.c scotrsht.c
[src/mame/includes]iqblock.h scotrsht.h
[src/mame/video]iqblock.c scotrsht.c

trunk/src/mame/drivers/gluck2.c
r243629r243630
204204public:
205205   gluck2_state(const machine_config &mconfig, device_type type, const char *tag)
206206      : driver_device(mconfig, type, tag) ,
207      m_maincpu(*this, "maincpu"),
208      m_gfxdecode(*this, "gfxdecode"),
207209      m_videoram(*this, "videoram"),
208      m_colorram(*this, "colorram"),
209      m_maincpu(*this, "maincpu"),
210      m_gfxdecode(*this, "gfxdecode"){ }
210      m_colorram(*this, "colorram") { }
211211
212   required_device<cpu_device> m_maincpu;
213   required_device<gfxdecode_device> m_gfxdecode;
214   
212215   required_shared_ptr<UINT8> m_videoram;
213216   required_shared_ptr<UINT8> m_colorram;
217   
214218   tilemap_t *m_bg_tilemap;
215   DECLARE_WRITE8_MEMBER(gluck2_videoram_w);
216   DECLARE_WRITE8_MEMBER(gluck2_colorram_w);
219   
220   DECLARE_WRITE8_MEMBER(videoram_w);
221   DECLARE_WRITE8_MEMBER(colorram_w);
217222   DECLARE_WRITE8_MEMBER(counters_w);
218   TILE_GET_INFO_MEMBER(get_gluck2_tile_info);
223   TILE_GET_INFO_MEMBER(get_tile_info);
224   
219225   virtual void video_start();
220226   DECLARE_PALETTE_INIT(gluck2);
221   UINT32 screen_update_gluck2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
222   required_device<cpu_device> m_maincpu;
223   required_device<gfxdecode_device> m_gfxdecode;
227   
228   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
224229};
225230
226231
r243629r243630
229234*********************************************/
230235
231236
232WRITE8_MEMBER(gluck2_state::gluck2_videoram_w)
237WRITE8_MEMBER(gluck2_state::videoram_w)
233238{
234239   m_videoram[offset] = data;
235240   m_bg_tilemap->mark_tile_dirty(offset);
236241}
237242
238WRITE8_MEMBER(gluck2_state::gluck2_colorram_w)
243WRITE8_MEMBER(gluck2_state::colorram_w)
239244{
240245   m_colorram[offset] = data;
241246   m_bg_tilemap->mark_tile_dirty(offset);
242247}
243248
244249
245TILE_GET_INFO_MEMBER(gluck2_state::get_gluck2_tile_info)
250TILE_GET_INFO_MEMBER(gluck2_state::get_tile_info)
246251{
247252/*  - bits -
248253    7654 3210
r243629r243630
261266
262267void gluck2_state::video_start()
263268{
264   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gluck2_state::get_gluck2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
269   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gluck2_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
265270}
266271
267272
268UINT32 gluck2_state::screen_update_gluck2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
273UINT32 gluck2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
269274{
270275   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
271276   return 0;
r243629r243630
340345   AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_device, address_w)
341346   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
342347   AM_RANGE(0x0844, 0x084b) AM_NOP /* see below */
343   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(gluck2_videoram_w) AM_SHARE("videoram") /* 6116 #1 (2K x 8) RAM (only 1st half used) */
344   AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(gluck2_colorram_w) AM_SHARE("colorram") /* 6116 #2 (2K x 8) RAM (only 1st half used) */
348   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") /* 6116 #1 (2K x 8) RAM (only 1st half used) */
349   AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") /* 6116 #2 (2K x 8) RAM (only 1st half used) */
345350   AM_RANGE(0x2000, 0x2000) AM_READ_PORT("SW1")
346351   AM_RANGE(0x2d00, 0x2d01) AM_DEVWRITE("ymsnd", ym2413_device, write)
347352   AM_RANGE(0x3400, 0x3400) AM_READ_PORT("IN0")
r243629r243630
525530*/
526531   MCFG_SCREEN_SIZE((39+1)*8, (38+1)*8)                /* from MC6845 init, registers 00 & 04. (value - 1) */
527532   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)  /* from MC6845 init, registers 01 & 06. */
528   MCFG_SCREEN_UPDATE_DRIVER(gluck2_state, screen_update_gluck2)
533   MCFG_SCREEN_UPDATE_DRIVER(gluck2_state, screen_update)
529534   MCFG_SCREEN_PALETTE("palette")
530535
531536   MCFG_GFXDECODE_ADD("gfxdecode", "palette", gluck2)
r243629r243630
578583*********************************************/
579584
580585/*    YEAR  NAME      PARENT  MACHINE   INPUT     STATE          INIT   ROT    COMPANY          FULLNAME       FLAGS... */
581GAME( 1992, gluck2,   0,      gluck2,   gluck2,   driver_device, 0,     ROT0, "Yung Yu / CYE", "Good Luck II", 0 )
586GAME( 1992, gluck2,   0,      gluck2,   gluck2,   driver_device, 0,     ROT0, "Yung Yu / CYE", "Good Luck II", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/iqblock.c
r243629r243630
2525Stephh's notes :
2626
2727  - Coin 2 as well as buttons 2 to 4 for each player are only read in "test mode".
28    Same issue for Dip Siwtches 0-7 and 1-2 to 1-6.
28    Same issue for Dip Switches 0-7 and 1-2 to 1-6.
2929    Some other games on the same hardware might use them.
3030  - Dip Switch 0 is stored at 0xf0ac and Dip Switch 1 is stored at 0xf0ad.
3131    However they are both read back at the same time with "ld   hl,($F0AC)" instructions.
r243629r243630
7373}
7474
7575
76TIMER_DEVICE_CALLBACK_MEMBER(iqblock_state::iqblock_irq)
76TIMER_DEVICE_CALLBACK_MEMBER(iqblock_state::irq)
7777{
7878   int scanline = param;
7979
r243629r243630
8787}
8888
8989
90WRITE8_MEMBER(iqblock_state::iqblock_irqack_w)
90WRITE8_MEMBER(iqblock_state::irqack_w)
9191{
9292   m_maincpu->set_input_line(0, CLEAR_LINE);
9393}
r243629r243630
119119   AM_RANGE(0x5090, 0x5090) AM_READ_PORT("SW0")
120120   AM_RANGE(0x50a0, 0x50a0) AM_READ_PORT("SW1")
121121   AM_RANGE(0x50b0, 0x50b1) AM_DEVWRITE("ymsnd", ym2413_device, write) // UM3567_data_port_0_w
122   AM_RANGE(0x50c0, 0x50c0) AM_WRITE(iqblock_irqack_w)
123   AM_RANGE(0x6000, 0x603f) AM_WRITE(iqblock_fgscroll_w)
124   AM_RANGE(0x6800, 0x69ff) AM_WRITE(iqblock_fgvideoram_w) AM_SHARE("fgvideoram") /* initialized up to 6fff... bug or larger tilemap? */
125   AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(iqblock_bgvideoram_w) AM_SHARE("bgvideoram")
122   AM_RANGE(0x50c0, 0x50c0) AM_WRITE(irqack_w)
123   AM_RANGE(0x6000, 0x603f) AM_WRITE(fgscroll_w)
124   AM_RANGE(0x6800, 0x69ff) AM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram") /* initialized up to 6fff... bug or larger tilemap? */
125   AM_RANGE(0x7000, 0x7fff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram")
126126   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("user1", 0)
127127ADDRESS_MAP_END
128128
r243629r243630
340340   MCFG_CPU_ADD("maincpu", Z80,12000000/2) /* 6 MHz */
341341   MCFG_CPU_PROGRAM_MAP(main_map)
342342   MCFG_CPU_IO_MAP(main_portmap)
343   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", iqblock_state, iqblock_irq, "screen", 0, 1)
343   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", iqblock_state, irq, "screen", 0, 1)
344344
345345   MCFG_DEVICE_ADD("ppi8255", I8255A, 0)
346346   MCFG_I8255_IN_PORTA_CB(IOPORT("P1"))
r243629r243630
354354   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
355355   MCFG_SCREEN_SIZE(64*8, 32*8)
356356   MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 30*8-1)
357   MCFG_SCREEN_UPDATE_DRIVER(iqblock_state, screen_update_iqblock)
357   MCFG_SCREEN_UPDATE_DRIVER(iqblock_state, screen_update)
358358   MCFG_SCREEN_PALETTE("palette")
359359
360360   MCFG_GFXDECODE_ADD("gfxdecode", "palette", iqblock)
r243629r243630
531531
532532
533533
534GAME( 1993, iqblock,  0, iqblock,  iqblock, iqblock_state, iqblock,  ROT0, "IGS", "IQ-Block", 0 )
535GAME( 1993, grndtour, 0, iqblock,  grndtour,iqblock_state, grndtour, ROT0, "IGS", "Grand Tour", 0 )
534GAME( 1993, iqblock,  0, iqblock,  iqblock, iqblock_state, iqblock,  ROT0, "IGS", "IQ-Block", GAME_SUPPORTS_SAVE )
535GAME( 1993, grndtour, 0, iqblock,  grndtour,iqblock_state, grndtour, ROT0, "IGS", "Grand Tour", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/progolf.c
r243629r243630
6464public:
6565   progolf_state(const machine_config &mconfig, device_type type, const char *tag)
6666      : driver_device(mconfig, type, tag),
67      m_fbram(*this, "fbram"),
6867      m_maincpu(*this, "maincpu"),
6968      m_audiocpu(*this, "audiocpu"),
7069      m_gfxdecode(*this, "gfxdecode"),
71      m_palette(*this, "palette")  { }
70      m_palette(*this, "palette"),
71      m_videoram(*this, "videoram"),
72      m_fbram(*this, "fbram")  { }
7273
73   UINT8 *m_videoram;
74   required_device<cpu_device> m_maincpu;
75   required_device<cpu_device> m_audiocpu;
76   required_device<gfxdecode_device> m_gfxdecode;
77   required_device<palette_device> m_palette;
78
79   required_shared_ptr<UINT8> m_videoram;
80   required_shared_ptr<UINT8> m_fbram;
81   
7482   UINT8 m_char_pen;
7583   UINT8 m_char_pen_vreg;
7684   UINT8 *m_fg_fb;
77   required_shared_ptr<UINT8> m_fbram;
7885   UINT8 m_scrollx_hi;
7986   UINT8 m_scrollx_lo;
8087   UINT8 m_gfx_switch;
8188   UINT8 m_sound_cmd;
82   DECLARE_WRITE8_MEMBER(progolf_charram_w);
83   DECLARE_WRITE8_MEMBER(progolf_char_vregs_w);
84   DECLARE_WRITE8_MEMBER(progolf_scrollx_lo_w);
85   DECLARE_WRITE8_MEMBER(progolf_scrollx_hi_w);
86   DECLARE_WRITE8_MEMBER(progolf_flip_screen_w);
89   
90   DECLARE_WRITE8_MEMBER(charram_w);
91   DECLARE_WRITE8_MEMBER(char_vregs_w);
92   DECLARE_WRITE8_MEMBER(scrollx_lo_w);
93   DECLARE_WRITE8_MEMBER(scrollx_hi_w);
94   DECLARE_WRITE8_MEMBER(flip_screen_w);
8795   DECLARE_WRITE8_MEMBER(audio_command_w);
8896   DECLARE_READ8_MEMBER(audio_command_r);
89   DECLARE_READ8_MEMBER(progolf_videoram_r);
90   DECLARE_WRITE8_MEMBER(progolf_videoram_w);
97   DECLARE_READ8_MEMBER(videoram_r);
98   DECLARE_WRITE8_MEMBER(videoram_w);
99   
91100   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
101   
102   virtual void machine_start();
92103   virtual void video_start();
93104   DECLARE_PALETTE_INIT(progolf);
94   UINT32 screen_update_progolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
95   required_device<cpu_device> m_maincpu;
96   required_device<cpu_device> m_audiocpu;
97   required_device<gfxdecode_device> m_gfxdecode;
98   required_device<palette_device> m_palette;
105   
106   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
99107};
100108
101109
110void progolf_state::machine_start()
111{
112   save_item(NAME(m_sound_cmd));
113}
102114
103
104115void progolf_state::video_start()
105116{
106117   m_scrollx_hi = 0;
107118   m_scrollx_lo = 0;
108119
109120   m_fg_fb = auto_alloc_array(machine(), UINT8, 0x2000*8);
110   m_videoram = auto_alloc_array(machine(), UINT8, 0x1000);
121   
122   save_item(NAME(m_char_pen));
123   save_item(NAME(m_char_pen_vreg));
124   save_pointer(NAME(m_fg_fb), 0x2000*8);
125   save_item(NAME(m_scrollx_hi));
126   save_item(NAME(m_scrollx_lo));
127   save_item(NAME(m_gfx_switch));
111128}
112129
113130
114UINT32 progolf_state::screen_update_progolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
131UINT32 progolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
115132{
116   UINT8 *videoram = m_videoram;
117133   int count,color,x,y,xi,yi;
118134
119135   {
r243629r243630
125141      {
126142         for(y=0;y<32;y++)
127143         {
128            int tile = videoram[count];
144            int tile = m_videoram[count];
129145
130146            m_gfxdecode->gfx(0)->opaque(bitmap,cliprect,tile,1,0,0,(256-x*8)+scroll,y*8);
131147            /* wrap-around */
r243629r243630
163179   return 0;
164180}
165181
166WRITE8_MEMBER(progolf_state::progolf_charram_w)
182WRITE8_MEMBER(progolf_state::charram_w)
167183{
168184   int i;
169185   m_fbram[offset] = data;
r243629r243630
185201   }
186202}
187203
188WRITE8_MEMBER(progolf_state::progolf_char_vregs_w)
204WRITE8_MEMBER(progolf_state::char_vregs_w)
189205{
190206   m_char_pen = data & 0x07;
191207   m_gfx_switch = data & 0xf0;
192208   m_char_pen_vreg = data & 0x30;
193209}
194210
195WRITE8_MEMBER(progolf_state::progolf_scrollx_lo_w)
211WRITE8_MEMBER(progolf_state::scrollx_lo_w)
196212{
197213   m_scrollx_lo = data;
198214}
199215
200WRITE8_MEMBER(progolf_state::progolf_scrollx_hi_w)
216WRITE8_MEMBER(progolf_state::scrollx_hi_w)
201217{
202218   m_scrollx_hi = data;
203219}
204220
205WRITE8_MEMBER(progolf_state::progolf_flip_screen_w)
221WRITE8_MEMBER(progolf_state::flip_screen_w)
206222{
207223   flip_screen_set(data & 1);
208224   if(data & 0xfe)
r243629r243630
221237   return m_sound_cmd;
222238}
223239
224READ8_MEMBER(progolf_state::progolf_videoram_r)
240READ8_MEMBER(progolf_state::videoram_r)
225241{
226   UINT8 *videoram = m_videoram;
227242   UINT8 *gfx_rom = memregion("gfx1")->base();
228243
229244   if (offset >= 0x0800)
r243629r243630
235250      else if (m_gfx_switch == 0x70)
236251         return gfx_rom[offset + 0x2000];
237252      else
238         return videoram[offset];
253         return m_videoram[offset];
239254   } else {
240255      if      (m_gfx_switch == 0x10)
241256         return gfx_rom[offset];
r243629r243630
244259      else if (m_gfx_switch == 0x30)
245260         return gfx_rom[offset + 0x2000];
246261      else
247         return videoram[offset];
262         return m_videoram[offset];
248263   }
249264}
250265
251WRITE8_MEMBER(progolf_state::progolf_videoram_w)
266WRITE8_MEMBER(progolf_state::videoram_w)
252267{
253   UINT8 *videoram = m_videoram;
254268   //if(m_gfx_switch & 0x40)
255   videoram[offset] = data;
269   m_videoram[offset] = data;
256270}
257271
258272static ADDRESS_MAP_START( main_cpu, AS_PROGRAM, 8, progolf_state )
259273   AM_RANGE(0x0000, 0x5fff) AM_RAM
260   AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(progolf_charram_w) AM_SHARE("fbram")
261   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(progolf_videoram_r,progolf_videoram_w)
262   AM_RANGE(0x9000, 0x9000) AM_READ_PORT("IN2") AM_WRITE(progolf_char_vregs_w)
263   AM_RANGE(0x9200, 0x9200) AM_READ_PORT("P1") AM_WRITE(progolf_scrollx_hi_w) //p1 inputs
264   AM_RANGE(0x9400, 0x9400) AM_READ_PORT("P2") AM_WRITE(progolf_scrollx_lo_w) //p2 inputs
265   AM_RANGE(0x9600, 0x9600) AM_READ_PORT("IN0") AM_WRITE(progolf_flip_screen_w)   /* VBLANK */
274   AM_RANGE(0x6000, 0x7fff) AM_RAM_WRITE(charram_w) AM_SHARE("fbram")
275   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(videoram_r, videoram_w) AM_SHARE("videoram")
276   AM_RANGE(0x9000, 0x9000) AM_READ_PORT("IN2") AM_WRITE(char_vregs_w)
277   AM_RANGE(0x9200, 0x9200) AM_READ_PORT("P1") AM_WRITE(scrollx_hi_w) //p1 inputs
278   AM_RANGE(0x9400, 0x9400) AM_READ_PORT("P2") AM_WRITE(scrollx_lo_w) //p2 inputs
279   AM_RANGE(0x9600, 0x9600) AM_READ_PORT("IN0") AM_WRITE(flip_screen_w)   /* VBLANK */
266280   AM_RANGE(0x9800, 0x9800) AM_READ_PORT("DSW1")
267281   AM_RANGE(0x9800, 0x9800) AM_DEVWRITE("crtc", mc6845_device, address_w)
268282   AM_RANGE(0x9801, 0x9801) AM_DEVWRITE("crtc", mc6845_device, register_w)
r243629r243630
362376   PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH )
363377INPUT_PORTS_END
364378
365static const gfx_layout progolf_charlayout =
379static const gfx_layout charlayout =
366380{
367381   8,8,            /* 8*8 characters */
368382   RGN_FRAC(1,3),  /* 512 characters */
r243629r243630
374388};
375389
376390static GFXDECODE_START( progolf )
377   GFXDECODE_ENTRY( "gfx1", 0x0000, progolf_charlayout, 0, 8 ) /* sprites */
391   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 8 ) /* sprites */
378392GFXDECODE_END
379393
380394
r243629r243630
423437   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3072))
424438   MCFG_SCREEN_SIZE(256, 256)
425439   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
426   MCFG_SCREEN_UPDATE_DRIVER(progolf_state, screen_update_progolf)
440   MCFG_SCREEN_UPDATE_DRIVER(progolf_state, screen_update)
427441   MCFG_SCREEN_PALETTE("palette")
428442
429443   MCFG_GFXDECODE_ADD("gfxdecode", "palette", progolf)
r243629r243630
500514
501515
502516// this uses DECO222 style encryption
503GAME( 1981, progolf,  0,       progolf, progolf, driver_device, 0,       ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
517GAME( 1981, progolf,  0,       progolf, progolf, driver_device, 0,       ROT270, "Data East Corporation", "18 Holes Pro Golf (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
504518// this uses DECO CPU-6 as custom module CPU (the same as Zoar, are we sure? our Zoar has different encryption, CPU-7 style)
505GAME( 1981, progolfa, progolf, progolfa,progolf, driver_device, 0,       ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL )
519GAME( 1981, progolfa, progolf, progolfa,progolf, driver_device, 0,       ROT270, "Data East Corporation", "18 Holes Pro Golf (set 2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/quizo.c
r243629r243630
3535      : driver_device(mconfig, type, tag),
3636      m_maincpu(*this, "maincpu") { }
3737
38   required_device<cpu_device> m_maincpu;
39
3840   UINT8 *m_videoram;
3941   UINT8 m_port60;
4042   UINT8 m_port70;
43
4144   DECLARE_WRITE8_MEMBER(vram_w);
4245   DECLARE_WRITE8_MEMBER(port70_w);
4346   DECLARE_WRITE8_MEMBER(port60_w);
47
4448   DECLARE_DRIVER_INIT(quizo);
4549   DECLARE_PALETTE_INIT(quizo);
46   UINT32 screen_update_quizo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47   required_device<cpu_device> m_maincpu;
50
51   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4852};
4953
5054
r243629r243630
8286   }
8387}
8488
85UINT32 quizo_state::screen_update_quizo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
89UINT32 quizo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8690{
87   UINT8 *videoram = m_videoram;
8891   int x,y;
8992   for(y=0;y<200;y++)
9093   {
9194      for(x=0;x<80;x++)
9295      {
93         int data=videoram[y*80+x];
94         int data1=videoram[y*80+x+0x4000];
96         int data=m_videoram[y*80+x];
97         int data1=m_videoram[y*80+x+0x4000];
9598         int pix;
9699
97100         pix=(data&1)|(((data>>4)&1)<<1)|((data1&1)<<2)|(((data1>>4)&1)<<3);
r243629r243630
115118
116119WRITE8_MEMBER(quizo_state::vram_w)
117120{
118   UINT8 *videoram = m_videoram;
119121   int bank=(m_port70&8)?1:0;
120   videoram[offset+bank*0x4000]=data;
122   m_videoram[offset+bank*0x4000]=data;
121123}
122124
123125WRITE8_MEMBER(quizo_state::port70_w)
r243629r243630
133135      data=0;
134136   }
135137   m_port60=data;
136   membank("bank1")->set_base(&memregion("user1")->base()[rombankLookup[data]*0x4000] );
138   membank("bank1")->set_entry(rombankLookup[data]);
137139}
138140
139141static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8, quizo_state )
r243629r243630
218220   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
219221   MCFG_SCREEN_SIZE(320, 200)
220222   MCFG_SCREEN_VISIBLE_AREA(0*8, 320-1, 0*8, 200-1)
221   MCFG_SCREEN_UPDATE_DRIVER(quizo_state, screen_update_quizo)
223   MCFG_SCREEN_UPDATE_DRIVER(quizo_state, screen_update)
222224   MCFG_SCREEN_PALETTE("palette")
223225
224226   MCFG_PALETTE_ADD("palette", 16)
r243629r243630
265267DRIVER_INIT_MEMBER(quizo_state,quizo)
266268{
267269   m_videoram=auto_alloc_array(machine(), UINT8, 0x4000*2);
270   membank("bank1")->configure_entries(0, 6, memregion("user1")->base(), 0x4000);
271   
272   save_pointer(NAME(m_videoram), 0x4000*2);
273   //save_item(NAME(m_port60));
274   save_item(NAME(m_port70));
268275}
269276
270GAME( 1985, quizo,  0,       quizo,  quizo, quizo_state,  quizo, ROT0, "Seoul Coin Corp.", "Quiz Olympic (set 1)", 0 )
271GAME( 1985, quizoa, quizo,   quizo,  quizo, quizo_state,  quizo, ROT0, "Seoul Coin Corp.", "Quiz Olympic (set 2)", 0 )
277GAME( 1985, quizo,  0,       quizo,  quizo, quizo_state,  quizo, ROT0, "Seoul Coin Corp.", "Quiz Olympic (set 1)", GAME_SUPPORTS_SAVE )
278GAME( 1985, quizoa, quizo,   quizo,  quizo, quizo_state,  quizo, ROT0, "Seoul Coin Corp.", "Quiz Olympic (set 2)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/scotrsht.c
r243629r243630
4545   flip_screen_set(data & 0x08);
4646}
4747
48INTERRUPT_GEN_MEMBER(scotrsht_state::scotrsht_interrupt)
48INTERRUPT_GEN_MEMBER(scotrsht_state::interrupt)
4949{
5050   if (m_irq_enable)
51      device.execute().set_input_line(0, HOLD_LINE);
51      m_maincpu->set_input_line(0, HOLD_LINE);
5252}
5353
54WRITE8_MEMBER(scotrsht_state::scotrsht_soundlatch_w)
54WRITE8_MEMBER(scotrsht_state::soundlatch_w)
5555{
5656   soundlatch_byte_w(space, 0, data);
5757   m_audiocpu->set_input_line(0, HOLD_LINE);
5858}
5959
6060static ADDRESS_MAP_START( scotrsht_map, AS_PROGRAM, 8, scotrsht_state )
61   AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(scotrsht_colorram_w) AM_SHARE("colorram")
62   AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(scotrsht_videoram_w) AM_SHARE("videoram")
61   AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram")
62   AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
6363   AM_RANGE(0x1000, 0x10bf) AM_RAM AM_SHARE("spriteram") /* sprites */
6464   AM_RANGE(0x10c0, 0x1fff) AM_RAM /* work ram */
6565   AM_RANGE(0x2000, 0x201f) AM_RAM AM_SHARE("scroll") /* scroll registers */
6666   AM_RANGE(0x2040, 0x2040) AM_WRITENOP
6767   AM_RANGE(0x2041, 0x2041) AM_WRITENOP
6868   AM_RANGE(0x2042, 0x2042) AM_WRITENOP  /* it should be -> bit 2 = scroll direction like in jailbrek, but it's not used */
69   AM_RANGE(0x2043, 0x2043) AM_WRITE(scotrsht_charbank_w)
69   AM_RANGE(0x2043, 0x2043) AM_WRITE(charbank_w)
7070   AM_RANGE(0x2044, 0x2044) AM_WRITE(ctrl_w)
71   AM_RANGE(0x3000, 0x3000) AM_WRITE(scotrsht_palettebank_w)
72   AM_RANGE(0x3100, 0x3100) AM_WRITE(scotrsht_soundlatch_w)
71   AM_RANGE(0x3000, 0x3000) AM_WRITE(palettebank_w)
72   AM_RANGE(0x3100, 0x3100) AM_WRITE(soundlatch_w)
7373   AM_RANGE(0x3200, 0x3200) AM_WRITENOP /* it writes 0, 1 */
7474   AM_RANGE(0x3100, 0x3100) AM_READ_PORT("DSW2")
7575   AM_RANGE(0x3200, 0x3200) AM_READ_PORT("DSW3")
r243629r243630
182182   /* basic machine hardware */
183183   MCFG_CPU_ADD("maincpu", M6809, 18432000/6)        /* 3.072 MHz */
184184   MCFG_CPU_PROGRAM_MAP(scotrsht_map)
185   MCFG_CPU_VBLANK_INT_DRIVER("screen", scotrsht_state, scotrsht_interrupt)
185   MCFG_CPU_VBLANK_INT_DRIVER("screen", scotrsht_state, interrupt)
186186
187187   MCFG_CPU_ADD("audiocpu", Z80, 18432000/6)        /* 3.072 MHz */
188188   MCFG_CPU_PROGRAM_MAP(scotrsht_sound_map)
r243629r243630
194194   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
195195   MCFG_SCREEN_SIZE(32*8, 32*8)
196196   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
197   MCFG_SCREEN_UPDATE_DRIVER(scotrsht_state, screen_update_scotrsht)
197   MCFG_SCREEN_UPDATE_DRIVER(scotrsht_state, screen_update)
198198   MCFG_SCREEN_PALETTE("palette")
199199
200200   MCFG_GFXDECODE_ADD("gfxdecode", "palette", scotrsht)
r243629r243630
240240   ROM_LOAD( "gx545_6301_8f.bin", 0x0400, 0x0100, CRC(c1c7cf58) SHA1(08452228bf13e43ce4a05806f79e9cd1542416f1) ) /* sprites lookup */
241241ROM_END
242242
243GAME( 1985, scotrsht, 0, scotrsht, scotrsht, driver_device, 0, ROT90,"Konami", "Scooter Shooter", 0 )
243GAME( 1985, scotrsht, 0, scotrsht, scotrsht, driver_device, 0, ROT90,"Konami", "Scooter Shooter", GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/iqblock.h
r243629r243630
1111
1212   required_device<cpu_device> m_maincpu;
1313   required_device<gfxdecode_device> m_gfxdecode;
14
1415   required_shared_ptr<UINT8> m_rambase;
1516   required_shared_ptr<UINT8> m_bgvideoram;
1617   required_shared_ptr<UINT8> m_fgvideoram;
r243629r243630
2223
2324   DECLARE_WRITE8_MEMBER(iqblock_prot_w);
2425   DECLARE_WRITE8_MEMBER(grndtour_prot_w);
25   DECLARE_WRITE8_MEMBER(iqblock_irqack_w);
26   DECLARE_WRITE8_MEMBER(iqblock_fgvideoram_w);
27   DECLARE_WRITE8_MEMBER(iqblock_bgvideoram_w);
28   DECLARE_WRITE8_MEMBER(iqblock_fgscroll_w);
26   DECLARE_WRITE8_MEMBER(irqack_w);
27   DECLARE_WRITE8_MEMBER(fgvideoram_w);
28   DECLARE_WRITE8_MEMBER(bgvideoram_w);
29   DECLARE_WRITE8_MEMBER(fgscroll_w);
2930   DECLARE_WRITE8_MEMBER(port_C_w);
31
32   TIMER_DEVICE_CALLBACK_MEMBER(irq);
33
3034   DECLARE_DRIVER_INIT(grndtour);
3135   DECLARE_DRIVER_INIT(iqblock);
36   virtual void video_start();
37
3238   TILE_GET_INFO_MEMBER(get_bg_tile_info);
3339   TILE_GET_INFO_MEMBER(get_fg_tile_info);
34   virtual void video_start();
35   UINT32 screen_update_iqblock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
36   TIMER_DEVICE_CALLBACK_MEMBER(iqblock_irq);
40   
41   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3742};
trunk/src/mame/includes/scotrsht.h
r243629r243630
33public:
44   scotrsht_state(const machine_config &mconfig, device_type type, const char *tag)
55      : driver_device(mconfig, type, tag),
6      m_maincpu(*this, "maincpu"),
7      m_audiocpu(*this, "audiocpu"),
8      m_gfxdecode(*this, "gfxdecode"),
9      m_palette(*this, "palette"),
610      m_colorram(*this, "colorram"),
711      m_videoram(*this, "videoram"),
812      m_spriteram(*this, "spriteram"),
9      m_scroll(*this, "scroll"),
10      m_maincpu(*this, "maincpu"),
11      m_audiocpu(*this, "audiocpu"),
12      m_gfxdecode(*this, "gfxdecode"),
13      m_palette(*this, "palette")  { }
13      m_scroll(*this, "scroll")  { }
1414
15   int m_irq_enable;
15   required_device<cpu_device> m_maincpu;
16   required_device<cpu_device> m_audiocpu;
17   required_device<gfxdecode_device> m_gfxdecode;
18   required_device<palette_device> m_palette;
19
1620   required_shared_ptr<UINT8> m_colorram;
1721   required_shared_ptr<UINT8> m_videoram;
1822   required_shared_ptr<UINT8> m_spriteram;
1923   required_shared_ptr<UINT8> m_scroll;
24
2025   tilemap_t *m_bg_tilemap;
26
27   int m_irq_enable;
2128   int m_charbank;
2229   int m_palette_bank;
30
2331   DECLARE_WRITE8_MEMBER(ctrl_w);
24   DECLARE_WRITE8_MEMBER(scotrsht_soundlatch_w);
25   DECLARE_WRITE8_MEMBER(scotrsht_videoram_w);
26   DECLARE_WRITE8_MEMBER(scotrsht_colorram_w);
27   DECLARE_WRITE8_MEMBER(scotrsht_charbank_w);
28   DECLARE_WRITE8_MEMBER(scotrsht_palettebank_w);
29   TILE_GET_INFO_MEMBER(scotrsht_get_bg_tile_info);
32   DECLARE_WRITE8_MEMBER(soundlatch_w);
33   DECLARE_WRITE8_MEMBER(videoram_w);
34   DECLARE_WRITE8_MEMBER(colorram_w);
35   DECLARE_WRITE8_MEMBER(charbank_w);
36   DECLARE_WRITE8_MEMBER(palettebank_w);
37
38   TILE_GET_INFO_MEMBER(get_bg_tile_info);
39   
40   INTERRUPT_GEN_MEMBER(interrupt);
41
3042   virtual void video_start();
3143   DECLARE_PALETTE_INIT(scotrsht);
32   UINT32 screen_update_scotrsht(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
33   INTERRUPT_GEN_MEMBER(scotrsht_interrupt);
44
45   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3446   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
35   required_device<cpu_device> m_maincpu;
36   required_device<cpu_device> m_audiocpu;
37   required_device<gfxdecode_device> m_gfxdecode;
38   required_device<palette_device> m_palette;
3947};
trunk/src/mame/video/iqblock.c
r243629r243630
4141
4242   m_bg_tilemap->set_transparent_pen(0);
4343   m_fg_tilemap->set_scroll_cols(64);
44   
45   save_item(NAME(m_videoenable));
4446}
4547
4648
r243629r243630
5153
5254***************************************************************************/
5355
54WRITE8_MEMBER(iqblock_state::iqblock_fgvideoram_w)
56WRITE8_MEMBER(iqblock_state::fgvideoram_w)
5557{
5658   m_fgvideoram[offset] = data;
5759   m_fg_tilemap->mark_tile_dirty(offset);
5860}
5961
60WRITE8_MEMBER(iqblock_state::iqblock_bgvideoram_w)
62WRITE8_MEMBER(iqblock_state::bgvideoram_w)
6163{
6264   m_bgvideoram[offset] = data;
6365   m_bg_tilemap->mark_tile_dirty(offset & 0x7ff);
6466}
6567
66WRITE8_MEMBER(iqblock_state::iqblock_fgscroll_w)
68WRITE8_MEMBER(iqblock_state::fgscroll_w)
6769{
6870   m_fg_tilemap->set_scrolly(offset,data);
6971}
r243629r243630
7678
7779***************************************************************************/
7880
79UINT32 iqblock_state::screen_update_iqblock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
81UINT32 iqblock_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
8082{
8183   if (!m_videoenable) return 0;
8284   m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0);
trunk/src/mame/video/scotrsht.c
r243629r243630
3434   }
3535}
3636
37WRITE8_MEMBER(scotrsht_state::scotrsht_videoram_w)
37WRITE8_MEMBER(scotrsht_state::videoram_w)
3838{
3939   m_videoram[offset] = data;
4040   m_bg_tilemap->mark_tile_dirty(offset);
4141}
4242
43WRITE8_MEMBER(scotrsht_state::scotrsht_colorram_w)
43WRITE8_MEMBER(scotrsht_state::colorram_w)
4444{
4545   m_colorram[offset] = data;
4646   m_bg_tilemap->mark_tile_dirty(offset);
4747}
4848
49WRITE8_MEMBER(scotrsht_state::scotrsht_charbank_w)
49WRITE8_MEMBER(scotrsht_state::charbank_w)
5050{
5151   if (m_charbank != (data & 0x01))
5252   {
r243629r243630
5757   /* other bits unknown */
5858}
5959
60WRITE8_MEMBER(scotrsht_state::scotrsht_palettebank_w)
60WRITE8_MEMBER(scotrsht_state::palettebank_w)
6161{
6262   if (m_palette_bank != ((data & 0x70) >> 4))
6363   {
r243629r243630
7272}
7373
7474
75TILE_GET_INFO_MEMBER(scotrsht_state::scotrsht_get_bg_tile_info)
75TILE_GET_INFO_MEMBER(scotrsht_state::get_bg_tile_info)
7676{
7777   int attr = m_colorram[tile_index];
7878   int code = m_videoram[tile_index] + (m_charbank << 9) + ((attr & 0x40) << 2);
r243629r243630
9090/* Same as Jailbreak + palette bank */
9191void scotrsht_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect )
9292{
93   UINT8 *spriteram = m_spriteram;
94   int i;
95
96   for (i = 0; i < m_spriteram.bytes(); i += 4)
93   for (int i = 0; i < m_spriteram.bytes(); i += 4)
9794   {
98      int attr = spriteram[i + 1];    // attributes = ?tyxcccc
99      int code = spriteram[i] + ((attr & 0x40) << 2);
95      int attr = m_spriteram[i + 1];    // attributes = ?tyxcccc
96      int code = m_spriteram[i] + ((attr & 0x40) << 2);
10097      int color = (attr & 0x0f) + m_palette_bank * 16;
10198      int flipx = attr & 0x10;
10299      int flipy = attr & 0x20;
103      int sx = spriteram[i + 2] - ((attr & 0x80) << 1);
104      int sy = spriteram[i + 3];
100      int sx = m_spriteram[i + 2] - ((attr & 0x80) << 1);
101      int sy = m_spriteram[i + 3];
105102
106103      if (flip_screen())
107104      {
r243629r243630
119116
120117void scotrsht_state::video_start()
121118{
122   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(scotrsht_state::scotrsht_get_bg_tile_info),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
119   m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(scotrsht_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS,  8, 8, 64, 32);
123120
124121   m_bg_tilemap->set_scroll_cols(64);
122   
123   save_item(NAME(m_irq_enable));
124   save_item(NAME(m_charbank));
125   save_item(NAME(m_palette_bank));
125126}
126127
127UINT32 scotrsht_state::screen_update_scotrsht(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
128UINT32 scotrsht_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
128129{
129   int col;
130
131   for (col = 0; col < 32; col++)
130   for (int col = 0; col < 32; col++)
132131      m_bg_tilemap->set_scrolly(col, m_scroll[col]);
133132
134133   m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team