Previous 199869 Revisions Next

r17490 Sunday 26th August, 2012 at 23:29:17 UTC by Angelo Salese
F-Zero runs without hacks, needs to implement the communication now ...
[src/emu/video]m50458.c m50458.h
[src/mame/drivers]nss.c sfcbox.c snesb.c
[src/mame/includes]snes.h
[src/mame/video]snes.c
[src/mess/drivers]snes.c

trunk/src/mame/includes/snes.h
r17489r17490
425425   UINT16                m_vtime;
426426   UINT16                m_vmadd;
427427
428   UINT32 snes_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
429
428430   /* timers */
429431   emu_timer             *m_scanline_timer;
430432   emu_timer             *m_hblank_timer;
trunk/src/mame/video/snes.c
r17489r17490
17851785   state_save_register_global_pointer(machine, state->m_snes_oam, SNES_OAM_SIZE/2);
17861786}
17871787
1788SCREEN_UPDATE_RGB32( snes )
1788UINT32 snes_state::snes_screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
17891789{
1790   snes_state *state = screen.machine().driver_data<snes_state>();
17911790   int y;
17921791
17931792   /*NTSC SNES draw range is 1-225. */
17941793   for (y = cliprect.min_y; y <= cliprect.max_y; y++)
17951794   {
1796      state->snes_refresh_scanline(screen.machine(), bitmap, y + 1);
1795      snes_refresh_scanline(screen.machine(), bitmap, y + 1);
17971796   }
17981797   return 0;
17991798}
trunk/src/mame/drivers/sfcbox.c
r17489r17490
282282
283283   MCFG_SCREEN_ADD("screen", RASTER)
284284   MCFG_SCREEN_RAW_PARAMS(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC)
285   MCFG_SCREEN_UPDATE_STATIC( snes )
285   MCFG_SCREEN_UPDATE_DRIVER( snes_state, snes_screen_update )
286286
287287   /* sound hardware */
288288   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/drivers/snesb.c
r17489r17490
647647
648648   MCFG_SCREEN_ADD("screen", RASTER)
649649   MCFG_SCREEN_RAW_PARAMS(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC)
650   MCFG_SCREEN_UPDATE_STATIC( snes )
650   MCFG_SCREEN_UPDATE_DRIVER( snes_state, snes_screen_update )
651651
652652   /* sound hardware */
653653   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
trunk/src/mame/drivers/nss.c
r17489r17490
22
33   Nintendo Super System
44
5   driver by Angelo Salese, based off info from Nocash
5   driver by Angelo Salese, based off info from Noca$h
66
77   TODO:
88   - EEPROM
r17489r17490
315315   DECLARE_WRITE8_MEMBER(port_01_w);
316316   DECLARE_READ8_MEMBER(nss_prot_r);
317317   DECLARE_WRITE8_MEMBER(nss_prot_w);
318   DECLARE_WRITE8_MEMBER(eeprom_w);
319318
320319   DECLARE_DRIVER_INIT(nss);
320   bitmap_rgb32 *m_tmpbitmap;
321
321322};
322323
324
325
323326UINT32 nss_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
324327{
325328   m_m50458->screen_update(screen,bitmap,cliprect);
329
326330   return 0;
327331}
328332
r17489r17490
483487
484488WRITE8_MEMBER(nss_state::nss_prot_w)
485489{
486
487490   if (m_cart_sel == 0)
488491   {
489492      rp5h01_enable_w(m_rp5h01, 0, 0);
r17489r17490
492495      rp5h01_cs_w(m_rp5h01, 0, ~data & 0x01);
493496      rp5h01_enable_w(m_rp5h01, 0, 1);
494497   }
495   //ioport("EEPROMOUT")->write(data, 0xff);
496}
497
498WRITE8_MEMBER(nss_state::eeprom_w)
499{
500498   ioport("EEPROMOUT")->write(data, 0xff);
501499}
502500
501
503502static ADDRESS_MAP_START( bios_map, AS_PROGRAM, 8, nss_state )
504503   AM_RANGE(0x0000, 0x7fff) AM_ROM
505504   AM_RANGE(0x8000, 0x8fff) AM_RAM
506505   AM_RANGE(0x9000, 0x9fff) AM_READWRITE(ram_wp_r,ram_wp_w)
507506   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("EEPROMIN")
508507   AM_RANGE(0xc000, 0xdfff) AM_ROM AM_REGION("ibios_rom", 0x6000 )
509   AM_RANGE(0xe000, 0xe000) AM_WRITE(eeprom_w)
510508   AM_RANGE(0xe000, 0xffff) AM_READ(nss_prot_r)
511   AM_RANGE(0xe001, 0xffff) AM_WRITE(nss_prot_w)
509   AM_RANGE(0xe000, 0xffff) AM_WRITE(nss_prot_w)
512510ADDRESS_MAP_END
513511
514512READ8_MEMBER(nss_state::port_00_r)
r17489r17490
573571}
574572
575573static ADDRESS_MAP_START( bios_io_map, AS_IO, 8, nss_state )
576   /* TODO: I think that this actually masks to 0x7? */
577   ADDRESS_MAP_GLOBAL_MASK(0xff)
574   ADDRESS_MAP_GLOBAL_MASK(0x7)
578575   AM_RANGE(0x00, 0x00) AM_READ(port_00_r) AM_WRITE(port_00_w)
579   AM_RANGE(0x01, 0x01) AM_READ_PORT("FP")
576   AM_RANGE(0x01, 0x01) AM_READ_PORT("FP")  AM_WRITE(port_01_w)
580577   AM_RANGE(0x02, 0x02) AM_READ_PORT("SYSTEM") AM_WRITE(rtc_osd_w)
581578   AM_RANGE(0x03, 0x03) AM_READ_PORT("RTC")
582
583   AM_RANGE(0x72, 0x72) AM_WRITE(rtc_osd_w)
584   AM_RANGE(0x80, 0x80) AM_WRITE(port_00_w)
585   AM_RANGE(0x81, 0x81) AM_WRITE(port_01_w)
586   AM_RANGE(0x82, 0x82) AM_WRITE(rtc_osd_w)
587   AM_RANGE(0xea, 0xea) AM_WRITE(rtc_osd_w)
588579ADDRESS_MAP_END
589580
590581/* Mitsubishi M6M80011 */
r17489r17490
608599   MACHINE_START_CALL(snes);
609600
610601   state->m_wram = auto_alloc_array_clear(machine, UINT8, 0x1000);
602   state->m_tmpbitmap = auto_bitmap_rgb32_alloc(machine,24*12,12*18);
611603}
612604
613605static INPUT_PORTS_START( snes )
r17489r17490
785777
786778   MCFG_SCREEN_ADD("screen", RASTER)
787779   MCFG_SCREEN_RAW_PARAMS(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC)
788   MCFG_SCREEN_UPDATE_STATIC( snes )
780   MCFG_SCREEN_UPDATE_DRIVER( snes_state, snes_screen_update )
789781
790782   /* sound hardware */
791783   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r17489r17490
843835   ROM_LOAD("nss-c.dat"  , 0x00000, 0x8000, CRC(a8e202b3) SHA1(b7afcfe4f5cf15df53452dc04be81929ced1efb2) )   /* bios */ \
844836   ROM_LOAD("nss-ic14.02", 0x10000, 0x8000, CRC(e06cb58f) SHA1(62f507e91a2797919a78d627af53f029c7d81477) )   /* bios */ \
845837   ROM_REGION( 0x2000, "dspprg", ROMREGION_ERASEFF) \
846   ROM_REGION( 0x800, "dspdata", ROMREGION_ERASEFF)
838   ROM_REGION( 0x800, "dspdata", ROMREGION_ERASEFF) \
839   ROM_REGION( 0x200, "eeprom", ROMREGION_ERASEFF )
847840
848841
849842
trunk/src/emu/video/m50458.c
r17489r17490
3333
3434WRITE16_MEMBER( m50458_device::vreg_120_w)
3535{
36   // ...
36   printf("%04x\n",data);
3737}
3838
3939WRITE16_MEMBER( m50458_device::vreg_126_w)
4040{
41   // ...
41   /* Raster Color Setting */
42   m_phase = data & 7;
43
44   //printf("%04x\n",data);
4245}
4346
4447
r17489r17490
212215{
213216   int x,y;
214217   UINT8 *pcg = memregion("m50458")->base();
218   UINT8 bg_r,bg_g,bg_b;
215219
220   /* TODO: there's probably a way to control the brightness in this */
221   bg_r = m_phase & 1 ? 0xff : 0;
222   bg_g = m_phase & 2 ? 0xff : 0;
223   bg_b = m_phase & 4 ? 0xff : 0;
224   bitmap.fill(MAKE_ARGB(0xff,bg_r,bg_g,bg_b),cliprect);
225
216226   for(y=0;y<12;y++)
217227   {
218228      for(x=0;x<24;x++)
r17489r17490
244254               g = (tile & 0x200 && pix) ? 0xff : 0x00;
245255               b = (tile & 0x400 && pix) ? 0xff : 0x00;
246256
247               bitmap.pix32(y*18+yi,x*12+(xi-4)) = r << 16 | g << 8 | b;
257               if(r || g || b)
258                  bitmap.pix32(y*18+yi,x*12+(xi-4)) = r << 16 | g << 8 | b;
248259            }
249260         }
250261      }
trunk/src/emu/video/m50458.h
r17489r17490
6363   int m_cmd_stream_pos;
6464   UINT16 m_osd_addr;
6565   UINT8 m_bg_pen;
66   UINT8 m_phase;
6667
6768   m50458_state_t m_osd_state;
6869
trunk/src/mess/drivers/snes.c
r17489r17490
721721
722722   MCFG_SCREEN_ADD("screen", RASTER)
723723   MCFG_SCREEN_RAW_PARAMS(DOTCLK_NTSC, SNES_HTOTAL, 0, SNES_SCR_WIDTH, SNES_VTOTAL_NTSC, 0, SNES_SCR_HEIGHT_NTSC)
724   MCFG_SCREEN_UPDATE_STATIC(snes)
724   MCFG_SCREEN_UPDATE_DRIVER( snes_state, snes_screen_update )
725725
726726   /* sound hardware */
727727   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team