summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2018-06-12 18:09:15 +0200
committer Ivan Vangelista <mesgnet@yahoo.it>2018-06-12 18:09:15 +0200
commitd1d76492925c05c0111301f97a69c48c753c92dc (patch)
treed90d580407c4876e06fb3e61433d6bb578b57da2
parent755f17458bfee4b9487fec2c57498d82c54663e0 (diff)
magmax.cpp: device_finder (nw)
-rw-r--r--src/mame/drivers/magmax.cpp105
-rw-r--r--src/mame/includes/magmax.h44
-rw-r--r--src/mame/video/magmax.cpp55
3 files changed, 100 insertions, 104 deletions
diff --git a/src/mame/drivers/magmax.cpp b/src/mame/drivers/magmax.cpp
index 44af74b5432..65cb698f624 100644
--- a/src/mame/drivers/magmax.cpp
+++ b/src/mame/drivers/magmax.cpp
@@ -30,7 +30,6 @@ Stephh's notes (based on the game M68000 code and some tests) :
#include "cpu/m68000/m68000.h"
#include "cpu/z80/z80.h"
-#include "sound/ay8910.h"
#include "speaker.h"
@@ -39,7 +38,7 @@ WRITE16_MEMBER(magmax_state::cpu_irq_ack_w)
m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE);
}
-READ8_MEMBER(magmax_state::magmax_sound_r)
+READ8_MEMBER(magmax_state::sound_r)
{
return (m_soundlatch->read(space, 0) << 1) | m_LS74_q;
}
@@ -96,11 +95,6 @@ void magmax_state::machine_reset()
WRITE8_MEMBER(magmax_state::ay8910_portA_0_w)
{
-ay8910_device *ay1 = machine().device<ay8910_device>("ay1");
-ay8910_device *ay2 = machine().device<ay8910_device>("ay2");
-ay8910_device *ay3 = machine().device<ay8910_device>("ay3");
-float percent;
-
/*There are three AY8910 chips and four(!) separate amplifiers on the board
* Each of AY channels is hardware mapped in following way:
* amplifier 0 gain x 1.00 <- AY0 CHA
@@ -108,10 +102,10 @@ float percent;
* amplifier 2 gain x 4.54 (150K/33K) <- AY1 CHC + AY2 CHA
* amplifier 3 gain x 4.54 (150K/33K) <- AY2 CHB + AY2 CHC
*
-* Each of the amps has its own analog cuircit:
+* Each of the amps has its own analog circuit:
* amp0, amp1 and amp2 are different from each other; amp3 is the same as amp2
*
-* Outputs of those amps are inputs to post amps, each having own cuircit
+* Outputs of those amps are inputs to post amps, each having own circuit
* that is partially controlled by AY #0 port A.
* PORT A BIT 0 - control postamp 0 (gain x10.0 | gain x 5.00)
* PORT A BIT 1 - control postamp 1 (gain x4.54 | gain x 2.27)
@@ -120,7 +114,7 @@ float percent;
*
* The "control" means assert/clear input pins on chip called 4066 (it is analog switch)
* which results in volume gain (exactly 2 times).
-* I use mixer_set_volume() to emulate the effect.
+* I use set_output_gain() to emulate the effect.
gain summary:
port A control ON OFF
@@ -152,30 +146,30 @@ bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C
/*popmessage("gain_ctrl = %2x",data&0x0f);*/
- percent = (m_gain_control & 1) ? 1.0 : 0.50;
- ay1->set_output_gain(0, percent);
+ float percent = (m_gain_control & 1) ? 1.0 : 0.50;
+ m_ay[0]->set_output_gain(0, percent);
//fixme: set_RC_filter(0,10000,100000000,0,10000); /* 10K, 10000pF = 0.010uF */
percent = (m_gain_control & 2) ? 0.45 : 0.23;
- ay1->set_output_gain(1, percent);
- ay1->set_output_gain(2, percent);
- ay2->set_output_gain(0, percent);
- ay2->set_output_gain(1, percent);
+ m_ay[0]->set_output_gain(1, percent);
+ m_ay[0]->set_output_gain(2, percent);
+ m_ay[1]->set_output_gain(0, percent);
+ m_ay[1]->set_output_gain(1, percent);
//fixme: set_RC_filter(1,4700,100000000,0,4700); /* 4.7K, 4700pF = 0.0047uF */
//fixme: set_RC_filter(2,4700,100000000,0,4700); /* 4.7K, 4700pF = 0.0047uF */
//fixme: set_RC_filter(3,4700,100000000,0,4700); /* 4.7K, 4700pF = 0.0047uF */
//fixme: set_RC_filter(4,4700,100000000,0,4700); /* 4.7K, 4700pF = 0.0047uF */
percent = (m_gain_control & 4) ? 0.45 : 0.23;
- ay2->set_output_gain(2, percent);
- ay3->set_output_gain(0, percent);
+ m_ay[1]->set_output_gain(2, percent);
+ m_ay[2]->set_output_gain(0, percent);
percent = (m_gain_control & 8) ? 0.45 : 0.23;
- ay3->set_output_gain(1, percent);
- ay3->set_output_gain(2, percent);
+ m_ay[2]->set_output_gain(1, percent);
+ m_ay[2]->set_output_gain(2, percent);
}
-WRITE16_MEMBER(magmax_state::magmax_vreg_w)
+WRITE16_MEMBER(magmax_state::vreg_w)
{
/* VRAM CONTROL REGISTER */
/* bit0 - coin counter 1 */
@@ -186,28 +180,31 @@ WRITE16_MEMBER(magmax_state::magmax_vreg_w)
/* bit5 - sprite bank MSB (DP1) */
/* bit6 - BG display enable (BE)*/
COMBINE_DATA(m_vreg);
+
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
+ machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
}
-void magmax_state::magmax_map(address_map &map)
+void magmax_state::main_map(address_map &map)
{
map(0x000000, 0x013fff).rom();
map(0x018000, 0x018fff).ram();
- map(0x020000, 0x0207ff).ram().share("videoram");
- map(0x028000, 0x0281ff).ram().share("spriteram");
+ map(0x020000, 0x0207ff).ram().share(m_videoram);
+ map(0x028000, 0x0281ff).ram().share(m_spriteram);
map(0x030000, 0x030001).portr("P1");
map(0x030002, 0x030003).portr("P2");
map(0x030004, 0x030005).portr("SYSTEM");
map(0x030006, 0x030007).portr("DSW");
- map(0x030010, 0x030011).w(FUNC(magmax_state::magmax_vreg_w)).share("vreg");
- map(0x030012, 0x030013).writeonly().share("scroll_x");
- map(0x030014, 0x030015).writeonly().share("scroll_y");
+ map(0x030010, 0x030011).w(FUNC(magmax_state::vreg_w)).share(m_vreg);
+ map(0x030012, 0x030013).writeonly().share(m_scroll_x);
+ map(0x030014, 0x030015).writeonly().share(m_scroll_y);
map(0x03001d, 0x03001d).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x03001e, 0x03001f).w(FUNC(magmax_state::cpu_irq_ack_w));
}
-void magmax_state::magmax_sound_map(address_map &map)
+void magmax_state::sound_map(address_map &map)
{
map.global_mask(0x7fff); // A15 not connected
map(0x0000, 0x3fff).rom();
@@ -215,13 +212,13 @@ void magmax_state::magmax_sound_map(address_map &map)
map(0x6000, 0x67ff).mirror(0x1800).ram();
}
-void magmax_state::magmax_sound_io_map(address_map &map)
+void magmax_state::sound_io_map(address_map &map)
{
map.global_mask(0xff);
- map(0x00, 0x01).w("ay1", FUNC(ay8910_device::address_data_w));
- map(0x02, 0x03).w("ay2", FUNC(ay8910_device::address_data_w));
- map(0x04, 0x05).w("ay3", FUNC(ay8910_device::address_data_w));
- map(0x06, 0x06).r(FUNC(magmax_state::magmax_sound_r));
+ map(0x00, 0x01).w(m_ay[0], FUNC(ay8910_device::address_data_w));
+ map(0x02, 0x03).w(m_ay[1], FUNC(ay8910_device::address_data_w));
+ map(0x04, 0x05).w(m_ay[2], FUNC(ay8910_device::address_data_w));
+ map(0x06, 0x06).r(FUNC(magmax_state::sound_r));
}
@@ -323,54 +320,54 @@ static const gfx_layout spritelayout =
};
static GFXDECODE_START( gfx_magmax )
- GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) /*no color codes*/
- GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 1*16, 16 ) /*16 color codes*/
+ GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 1 ) /*no color codes*/
+ GFXDECODE_ENTRY( "sprites", 0, spritelayout, 1*16, 16 ) /*16 color codes*/
GFXDECODE_END
MACHINE_CONFIG_START(magmax_state::magmax)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", M68000, XTAL(16'000'000)/2) /* verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(magmax_map)
+ MCFG_DEVICE_ADD(m_maincpu, M68000, XTAL(16'000'000)/2) /* verified on pcb */
+ MCFG_DEVICE_PROGRAM_MAP(main_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", magmax_state, irq1_line_assert)
- MCFG_DEVICE_ADD("audiocpu", Z80,XTAL(20'000'000)/8) /* verified on pcb */
- MCFG_DEVICE_PROGRAM_MAP(magmax_sound_map)
- MCFG_DEVICE_IO_MAP(magmax_sound_io_map)
+ MCFG_DEVICE_ADD(m_audiocpu, Z80,XTAL(20'000'000)/8) /* verified on pcb */
+ MCFG_DEVICE_PROGRAM_MAP(sound_map)
+ MCFG_DEVICE_IO_MAP(sound_io_map)
MCFG_QUANTUM_TIME(attotime::from_hz(600))
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_ADD(m_screen, RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(magmax_state, screen_update_magmax)
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_UPDATE_DRIVER(magmax_state, screen_update)
+ MCFG_SCREEN_PALETTE(m_palette)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_magmax)
- MCFG_PALETTE_ADD("palette", 1*16 + 16*16 + 256)
+ MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_magmax)
+ MCFG_PALETTE_ADD(m_palette, 1*16 + 16*16 + 256)
MCFG_PALETTE_INDIRECT_ENTRIES(256)
MCFG_PALETTE_INIT_OWNER(magmax_state, magmax)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(20'000'000)/16) /* verified on pcb */
- MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, magmax_state, ay8910_portA_0_w)) /*write port A*/
- MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, magmax_state, ay8910_portB_0_w)) /*write port B*/
+ MCFG_DEVICE_ADD(m_ay[0], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
+ MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, magmax_state, ay8910_portA_0_w))
+ MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, magmax_state, ay8910_portB_0_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(20'000'000)/16) /* verified on pcb */
+ MCFG_DEVICE_ADD(m_ay[1], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
- MCFG_DEVICE_ADD("ay3", AY8910, XTAL(20'000'000)/16) /* verified on pcb */
+ MCFG_DEVICE_ADD(m_ay[2], AY8910, XTAL(20'000'000)/16) /* verified on pcb */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("audiocpu", 0))
+ MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_audiocpu, 0))
MCFG_GENERIC_LATCH_SEPARATE_ACKNOWLEDGE(true)
MACHINE_CONFIG_END
@@ -388,10 +385,10 @@ ROM_START( magmax )
ROM_LOAD( "15.17b", 0x00000, 0x2000, CRC(19e7b983) SHA1(b1cd0b728e7cce87d9b1039be179d0915d939a4f) )
ROM_LOAD( "16.18b", 0x02000, 0x2000, CRC(055e3126) SHA1(8c9b03eb7588512ef17f8c1b731a2fd7cf372bf8) )
- ROM_REGION( 0x02000, "gfx1", 0 ) /* chars */
+ ROM_REGION( 0x02000, "chars", 0 )
ROM_LOAD( "23.15g", 0x00000, 0x2000, CRC(a7471da2) SHA1(ec2815a5801bc55955e612173a845399fd493eb7) )
- ROM_REGION( 0x10000, "gfx2", 0 ) /* sprites */
+ ROM_REGION( 0x10000, "sprites", 0 )
ROM_LOAD( "17.3e", 0x00000, 0x2000, CRC(8e305b2e) SHA1(74c318089f6bebafbee31c22302e93a09d3ffa32) )
ROM_LOAD( "18.5e", 0x02000, 0x2000, CRC(14c55a60) SHA1(fd2a1b434bb65502f0f791995caf1cd869ccd254) )
ROM_LOAD( "19.6e", 0x04000, 0x2000, CRC(fa4141d8) SHA1(a5279d1ada5a13df14a8bbc18ceeea79f82a4c23) )
diff --git a/src/mame/includes/magmax.h b/src/mame/includes/magmax.h
index 5ed8624ba17..1e0b3315729 100644
--- a/src/mame/includes/magmax.h
+++ b/src/mame/includes/magmax.h
@@ -2,6 +2,7 @@
// copyright-holders:Takahiro Nogi
#include "screen.h"
#include "machine/gen_latch.h"
+#include "sound/ay8910.h"
class magmax_state : public driver_device
{
@@ -13,18 +14,36 @@ public:
m_vreg(*this, "vreg"),
m_scroll_x(*this, "scroll_x"),
m_scroll_y(*this, "scroll_y"),
+ m_rom18B(*this, "user1"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_ay(*this, "ay%u", 0U),
m_soundlatch(*this, "soundlatch"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette") { }
+ void magmax(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
+private:
required_shared_ptr<uint16_t> m_videoram;
required_shared_ptr<uint16_t> m_spriteram;
required_shared_ptr<uint16_t> m_vreg;
required_shared_ptr<uint16_t> m_scroll_x;
required_shared_ptr<uint16_t> m_scroll_y;
+ required_region_ptr<uint8_t> m_rom18B;
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_audiocpu;
+ required_device_array<ay8910_device, 3> m_ay;
+ required_device<generic_latch_8_device> m_soundlatch;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
uint8_t m_sound_latch;
uint8_t m_LS74_clr;
@@ -34,25 +53,18 @@ public:
int m_flipscreen;
std::unique_ptr<uint32_t[]> m_prom_tab;
bitmap_ind16 m_bitmap;
+
DECLARE_WRITE16_MEMBER(cpu_irq_ack_w);
- DECLARE_READ8_MEMBER(magmax_sound_r);
- DECLARE_WRITE16_MEMBER(magmax_vreg_w);
+ DECLARE_READ8_MEMBER(sound_r);
+ DECLARE_WRITE16_MEMBER(vreg_w);
DECLARE_WRITE8_MEMBER(ay8910_portB_0_w);
DECLARE_WRITE8_MEMBER(ay8910_portA_0_w);
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
+
DECLARE_PALETTE_INIT(magmax);
- uint32_t screen_update_magmax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(scanline_callback);
- required_device<cpu_device> m_maincpu;
- required_device<cpu_device> m_audiocpu;
- required_device<generic_latch_8_device> m_soundlatch;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
- void magmax(machine_config &config);
- void magmax_map(address_map &map);
- void magmax_sound_io_map(address_map &map);
- void magmax_sound_map(address_map &map);
+
+ void main_map(address_map &map);
+ void sound_io_map(address_map &map);
+ void sound_map(address_map &map);
};
diff --git a/src/mame/video/magmax.cpp b/src/mame/video/magmax.cpp
index b7a9ec495c4..d3a04f03441 100644
--- a/src/mame/video/magmax.cpp
+++ b/src/mame/video/magmax.cpp
@@ -29,10 +29,9 @@ Additional tweaking by Jarek Burczynski
PALETTE_INIT_MEMBER(magmax_state, magmax)
{
const uint8_t *color_prom = memregion("proms")->base();
- int i;
/* create a lookup table for the palette */
- for (i = 0; i < 0x100; i++)
+ for (int i = 0; i < 0x100; i++)
{
int r = pal4bit(color_prom[i + 0x000]);
int g = pal4bit(color_prom[i + 0x100]);
@@ -45,25 +44,24 @@ PALETTE_INIT_MEMBER(magmax_state, magmax)
color_prom += 0x300;
/* characters use colors 0-0x0f */
- for (i = 0; i < 0x10; i++)
+ for (int i = 0; i < 0x10; i++)
palette.set_pen_indirect(i, i);
/*sprites use colors 0x10-0x1f, color 0x1f being transparent*/
- for (i = 0x10; i < 0x110; i++)
+ for (int i = 0x10; i < 0x110; i++)
{
uint8_t ctabentry = (color_prom[i - 0x10] & 0x0f) | 0x10;
palette.set_pen_indirect(i, ctabentry);
}
/* background uses all colors (no lookup table) */
- for (i = 0x110; i < 0x210; i++)
+ for (int i = 0x110; i < 0x210; i++)
palette.set_pen_indirect(i, i - 0x110);
}
void magmax_state::video_start()
{
- int i,v;
uint8_t * prom14D = memregion("user2")->base();
/* Set up save state */
@@ -74,21 +72,17 @@ void magmax_state::video_start()
m_screen->register_screen_bitmap(m_bitmap);
/* Allocate temporary bitmap */
- for (i=0; i<256; i++)
+ for (int i = 0; i < 256; i++)
{
- v = (prom14D[i] << 4) + prom14D[i + 0x100];
+ int v = (prom14D[i] << 4) + prom14D[i + 0x100];
m_prom_tab[i] = ((v&0x1f)<<8) | ((v&0x10)<<10) | ((v&0xe0)>>1); /*convert data into more useful format*/
}
}
-uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t magmax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- uint16_t *videoram = m_videoram;
- uint16_t *spriteram16 = m_spriteram;
- int offs;
-
/* bit 2 flip screen */
m_flipscreen = *m_vreg & 0x04;
@@ -97,17 +91,14 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
bitmap.fill(0, cliprect);
else
{
- int v;
- uint8_t * rom18B = memregion("user1")->base();
uint32_t scroll_h = (*m_scroll_x) & 0x3fff;
uint32_t scroll_v = (*m_scroll_y) & 0xff;
/*clear background-over-sprites bitmap*/
m_bitmap.fill(0);
- for (v = 2*8; v < 30*8; v++) /*only for visible area*/
+ for (int v = 2*8; v < 30*8; v++) /*only for visible area*/
{
- int h;
uint16_t line_data[256];
uint32_t map_v_scr_100 = (scroll_v + v) & 0x100;
@@ -117,7 +108,7 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
pen_t pen_base = 0x110 + 0x20 + (map_v_scr_100>>1);
- for (h = 0; h < 0x100; h++)
+ for (int h = 0; h < 0x100; h++)
{
uint32_t graph_data;
uint32_t graph_color;
@@ -129,9 +120,9 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
if (!map_v_scr_100)
{
if (h & 0x80)
- LS283 = LS283 + (rom18B[ map_v_scr_1fe_6 + (h ^ 0xff) ] ^ 0xff);
+ LS283 = LS283 + (m_rom18B[ map_v_scr_1fe_6 + (h ^ 0xff) ] ^ 0xff);
else
- LS283 = LS283 + rom18B[ map_v_scr_1fe_6 + h ] + 0xff01;
+ LS283 = LS283 + m_rom18B[ map_v_scr_1fe_6 + h ] + 0xff01;
}
prom_data = m_prom_tab[ (LS283 >> 6) & 0xff ];
@@ -140,12 +131,12 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
rom18D_addr += (prom_data & 0x1f00) + ((LS283 & 0x38) >>3);
rom15F_addr &= 0x201c;
- rom15F_addr += (rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
+ rom15F_addr += (m_rom18B[0x4000 + rom18D_addr ]<<5) + ((LS283 & 0x6)>>1);
rom15F_addr += (prom_data & 0x4000);
graph_color = (prom_data & 0x0070);
- graph_data = rom18B[0x8000 + rom15F_addr];
+ graph_data = m_rom18B[0x8000 + rom15F_addr];
if ((LS283 & 1))
graph_data >>= 4;
graph_data &= 0x0f;
@@ -159,9 +150,8 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
if (m_flipscreen)
{
- int i;
uint16_t line_data_flip_x[256];
- for (i=0; i<256; i++)
+ for (int i = 0; i < 256; i++)
line_data_flip_x[i] = line_data[255-i];
draw_scanline16(bitmap, 0, 255-v, 256, line_data_flip_x, nullptr);
}
@@ -171,21 +161,19 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
}
/* draw the sprites */
- for (offs = 0; offs < m_spriteram.bytes()/2; offs += 4)
+ for (int offs = 0; offs < m_spriteram.bytes()/2; offs += 4)
{
- int sx, sy;
-
- sy = spriteram16[offs] & 0xff;
+ int sy = m_spriteram[offs] & 0xff;
if (sy)
{
- int code = spriteram16[offs + 1] & 0xff;
- int attr = spriteram16[offs + 2] & 0xff;
+ int code = m_spriteram[offs + 1] & 0xff;
+ int attr = m_spriteram[offs + 2] & 0xff;
int color = (attr & 0xf0) >> 4;
int flipx = attr & 0x04;
int flipy = attr & 0x08;
- sx = (spriteram16[offs + 3] & 0xff) - 0x80 + 0x100 * (attr & 0x01);
+ int sx = (m_spriteram[offs + 3] & 0xff) - 0x80 + 0x100 * (attr & 0x01);
sy = 239 - sy;
if (m_flipscreen)
@@ -212,12 +200,11 @@ uint32_t magmax_state::screen_update_magmax(screen_device &screen, bitmap_ind16
copybitmap_trans(bitmap, m_bitmap, m_flipscreen,m_flipscreen,0,0, cliprect, 0);
/* draw the foreground characters */
- for (offs = 32*32-1; offs >= 0; offs -= 1)
+ for (int offs = 32*32-1; offs >= 0; offs -= 1)
{
//int page = (*m_vreg>>3) & 0x1;
- int code;
+ int code = m_videoram[offs /*+ page*/] & 0xff;
- code = videoram[offs /*+ page*/] & 0xff;
if (code)
{
int sx = (offs % 32);