Previous 199869 Revisions Next

r27514 Thursday 6th February, 2014 at 17:44:32 UTC by Fabio Priuli
(MESS) nes: added support for Multi-Discrete PCB (aka Mapper 28) used
by Action 53 - Function 16 - Volume ONE - "Streemerz Bundle" homebrew
multicart. [Fabio Priuli]
[src/mess]mess.mak
[src/mess/drivers]nes.c
[src/mess/includes]nes.h
[src/mess/machine]nes_act53.c* nes_act53.h* nes_ines.inc nes_pcb.inc nes_slot.h

trunk/src/mess/mess.mak
r27513r27514
15351535   $(MESS_MACHINE)/nes_mmc3.o  \
15361536   $(MESS_MACHINE)/nes_mmc3_clones.o  \
15371537   $(MESS_MACHINE)/nes_mmc5.o  \
1538   $(MESS_MACHINE)/nes_act53.o  \
15381539   $(MESS_MACHINE)/nes_ave.o  \
15391540   $(MESS_MACHINE)/nes_bandai.o  \
15401541   $(MESS_MACHINE)/nes_benshieng.o  \
trunk/src/mess/drivers/nes.c
r27513r27514
10161016   SLOT_INTERFACE_INTERNAL("bmc_830118c",      NES_BMC_830118C)
10171017   SLOT_INTERFACE_INTERNAL("pjoy84",           NES_PJOY84)
10181018   SLOT_INTERFACE_INTERNAL("nocash_nochr",     NES_NOCHR)
1019   SLOT_INTERFACE_INTERNAL("nes_action53",     NES_ACTION53)
10191020// other unsupported...
10201021   SLOT_INTERFACE_INTERNAL("ninjaryu",         NES_NROM)    // mapper 111 - UNSUPPORTED
10211022   SLOT_INTERFACE_INTERNAL("unl_dance",        NES_NROM)    // UNSUPPORTED
trunk/src/mess/machine/nes_ines.inc
r27513r27514
5757   { 25, KONAMI_VRC4 },
5858   { 26, KONAMI_VRC6 },
5959   { 27, UNL_WORLDHERO },   // 27 World Hero board - Unsupported
60   // 28 Unused
60   { 28, BTL_ACTION53 },   // 28 - Multi-discrete PCB designed by Tepples for Action 53
6161   // 29 Unused
6262   // 30 Unused
6363   // 31 Unused
trunk/src/mess/machine/nes_act53.c
r0r27514
1/***********************************************************************************************************
2
3
4 NES/Famicom cartridge emulation for Action 53
5
6 Copyright MESS Team.
7 Visit http://mamedev.org for licensing and usage restrictions.
8
9
10 Here we emulate the Multi-Discrete PCB designed by Tepples for
11 this homebew multicart [mapper 28]
12
13 ***********************************************************************************************************/
14
15
16#include "emu.h"
17#include "machine/nes_act53.h"
18
19
20#ifdef NES_PCB_DEBUG
21#define VERBOSE 1
22#else
23#define VERBOSE 0
24#endif
25
26#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
27
28
29//-------------------------------------------------
30//  constructor
31//-------------------------------------------------
32
33const device_type NES_ACTION53 = &device_creator<nes_action53_device>;
34
35
36nes_action53_device::nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
37               : nes_nrom_device(mconfig, NES_ACTION53, "NES Cart Action 53 PCB", tag, owner, clock, "nes_action53", __FILE__)
38{
39}
40
41
42
43void nes_action53_device::device_start()
44{
45   common_start();
46   save_item(NAME(m_sel));
47   save_item(NAME(m_reg));
48   m_reg[0] = 0x00;
49   m_reg[1] = 0x0f;
50   m_reg[2] = 0x00;
51   m_reg[3] = 0x3f;
52}
53
54void nes_action53_device::pcb_reset()
55{
56   m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
57   // register content is not touched by reset
58   update_prg();
59}
60
61
62/*-------------------------------------------------
63 mapper specific handlers
64 -------------------------------------------------*/
65
66/*-------------------------------------------------
67
68 Board ACTION 53
69
70 In MESS: *VERY* preliminary support.
71 
72 This board uses 4 registers (reg is selected by writes to 0x5xxx)
73 Info from nesdev wiki
74 
75 R:$00:  [...M ..CC]
76     C = CHR Reg
77     M = Mirroring
78         This bit overwrites bit 0 of R:$80, but only if bit 1 of
79         R:$80 is clear
80 
81 R:$01:  [...M PPPP]
82     P = PRG Reg
83     M = Mirroring
84         This bit overwrites bit 0 of R:$80, but only if bit 1 of
85         R:$80 is clear
86 
87 R:$80:  [..GG PSMM]
88     G = Game Size (0=32K, 1=64K, 2=128K, 3=256K)
89     P = PRG Size (0=32k mode, 1=16k mode)
90     S = Slot select:
91         0 = $C000 swappable, $8000 fixed to bottom of 32K outer bank
92         1 = $8000 swappable, $C000 fixed to top of 32K outer bank
93         This bit is ignored when 'P' is clear (32k mode)
94     M = Mirroring control:
95         %00 = 1ScA
96         %01 = 1ScB
97         %10 = Vert
98         %11 = Horz
99
100 R:$81:  [..BB BBBB]
101     Outer PRG Reg
102
103
104 -------------------------------------------------*/
105
106void nes_action53_device::update_prg()
107{
108   UINT8 prg_lo = 0, prg_hi = 0, helper = 0;
109   UINT8 out = (m_reg[3] & 0x3f) << 1;      // Outer PRG reg
110   UINT8 size = (m_reg[2] & 0x30) >> 4;   // Game size
111   UINT8 mask = (1 << (size + 1)) - 1;      // Bits to be taken from PRG reg
112
113   if (!BIT(m_reg[2], 3))
114   {
115      helper = (out & ~mask) | ((m_reg[1] << 1) & mask);
116      //32K mode
117      prg_lo = (helper & 0xfe);
118      prg_hi = (helper | 0x01);
119   }
120   else
121   {
122      helper = (out & ~mask) | (m_reg[1] & mask);
123      if (BIT(m_reg[2], 2))
124      {
125         //16K mode with fixed HI
126         prg_lo = helper;
127         prg_hi = (out | 0x01);
128      }
129      else
130      {
131         //16K mode with fixed LO
132         prg_lo = (out & 0xfe);
133         prg_hi = helper;
134      }
135   }
136
137//   printf("banks : 0x%2X - 0x%2X\n", prg_lo, prg_hi);
138   prg16_89ab(prg_lo);
139   prg16_cdef(prg_hi);
140}
141
142void nes_action53_device::update_mirr()
143{
144   switch (m_reg[2] & 0x03)
145   {
146      case 0:
147         set_nt_mirroring(PPU_MIRROR_LOW);
148         break;
149      case 1:
150         set_nt_mirroring(PPU_MIRROR_HIGH);
151         break;
152      case 2:
153         set_nt_mirroring(PPU_MIRROR_VERT);
154         break;
155      case 3:
156         set_nt_mirroring(PPU_MIRROR_HORZ);
157         break;
158   }
159}
160
161WRITE8_MEMBER(nes_action53_device::write_l)
162{
163   LOG_MMC(("action 53 write_l, offset: %04x, data: %02x\n", offset, data));
164   offset += 0x100;
165   if (offset >= 0x1000)
166      m_sel = BIT(data, 0) | (BIT(data, 7) << 1);
167}
168
169
170WRITE8_MEMBER(nes_action53_device::write_h)
171{
172   LOG_MMC(("action 53 write_h, offset: %04x, data: %02x\n", offset, data));
173
174   if (m_reg[m_sel] != data)
175   {
176      m_reg[m_sel] = data;
177
178      switch (m_sel)
179      {
180         case 0:
181            if (!BIT(m_reg[2],1))
182            {
183               m_reg[2] &= 0xfe;
184               m_reg[2] |= BIT(data,4);
185               update_mirr();
186            }
187            chr8(m_reg[0] & 0x03, m_chr_source);
188            break;
189         case 1:
190            if (!BIT(m_reg[2],1))
191            {
192               m_reg[2] &= 0xfe;
193               m_reg[2] |= BIT(data,4);
194               update_mirr();
195            }
196            update_prg();
197            break;
198         case 2:
199            update_prg();
200            update_mirr();
201            break;
202         case 3:
203            update_prg();
204            break;
205      }
206   }
207}
Property changes on: trunk/src/mess/machine/nes_act53.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/machine/nes_act53.h
r0r27514
1#ifndef __NES_ACTION53_H
2#define __NES_ACTION53_H
3
4#include "machine/nes_nxrom.h"
5
6
7// ======================> nes_racermate_device
8
9class nes_action53_device : public nes_nrom_device
10{
11public:
12   // construction/destruction
13   nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
14
15   // device-level overrides
16   virtual void device_start();
17   virtual DECLARE_WRITE8_MEMBER(write_l);
18   virtual DECLARE_WRITE8_MEMBER(write_h);
19
20   virtual void pcb_reset();
21
22private:
23   void update_prg();
24   void update_mirr();
25   UINT8 m_sel;
26   UINT8 m_reg[4];
27};
28
29
30
31
32
33// device type definition
34extern const device_type NES_ACTION53;
35
36#endif
Property changes on: trunk/src/mess/machine/nes_act53.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/machine/nes_pcb.inc
r27513r27514
300300   { "tf1201",           UNL_TF1201 },
301301   { "unl_cfight",       UNL_CITYFIGHT },
302302   { "nocash_nochr",     NOCASH_NOCHR },
303   { "nes_action53",     BTL_ACTION53 },
303304   { "ffe3",             FFE3_BOARD },
304305   { "ffe4",             FFE4_BOARD },
305306   { "ffe8",             FFE8_BOARD },
trunk/src/mess/machine/nes_slot.h
r27513r27514
120120   KAY_BOARD, HOSENKAN_BOARD, NITRA_TDA, GOUDER_37017, NANJING_BOARD,
121121   WHIRLWIND_2706,
122122   NOCASH_NOCHR,   // homebrew PCB design which uses NTRAM for CHRRAM
123   BTL_ACTION53,   // homebrew PCB for homebrew multicarts
123124   /* FFE boards, for mappers 6, 8, 17 */
124125   FFE3_BOARD, FFE4_BOARD, FFE8_BOARD, TEST_BOARD,
125126   /* Unsupported (for place-holder boards, with no working emulation) & no-board (at init) */
trunk/src/mess/includes/nes.h
r27513r27514
3333#include "machine/nes_sunsoft_dcs.h"
3434#include "machine/nes_taito.h"
3535// unlicensed/bootleg/pirate PCBs
36#include "machine/nes_act53.h"
3637#include "machine/nes_ave.h"
3738#include "machine/nes_benshieng.h"
3839#include "machine/nes_camerica.h"

Previous 199869 Revisions Next


© 1997-2024 The MAME Team