advision: add configurable screen size

This commit is contained in:
hap 2023-08-13 15:26:26 +02:00
parent 4f993e1d1d
commit 0b3b55d9d5
2 changed files with 44 additions and 31 deletions

View File

@ -15,9 +15,9 @@ Hardware notes:
right button panels are electronically the same) right button panels are electronically the same)
- expansion port (unused) - expansion port (unused)
A game cartridge is basically an EPROM chip wearing a jacket, there is no The cartridge slot is different from what is common on other consoles. A game
dedicated cartridge slot as is common on other consoles. Only 4 games were cartridge is basically an EPROM chip wearing a jacket. Only 4 games were released
released in total. in total.
The mirror rotates at around 7Hz, the motor speed is not controlled by software, The mirror rotates at around 7Hz, the motor speed is not controlled by software,
and it differs a bit per console. This can be adjusted after enabling -cheat. and it differs a bit per console. This can be adjusted after enabling -cheat.
@ -29,9 +29,6 @@ width of 150 is specified by the BIOS, but it's possible to update the leds at a
different rate, hence MAME configures a larger screen. In fact, the homebrew demo different rate, hence MAME configures a larger screen. In fact, the homebrew demo
Code Red doesn't use the BIOS for it, and runs at 50*40 to save some RAM. Code Red doesn't use the BIOS for it, and runs at 50*40 to save some RAM.
It's recommended to leave bilinear filtering on (it's the default for most of
MAME's video backends).
TODO: TODO:
- EA banking is ugly, it can be turd-polished but the real issue is in mcs48 - EA banking is ugly, it can be turd-polished but the real issue is in mcs48
- display refresh is actually ~14Hz, but doing that will make MAME very sluggish - display refresh is actually ~14Hz, but doing that will make MAME very sluggish
@ -81,6 +78,8 @@ public:
void advision(machine_config &config); void advision(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(set_screensize);
protected: protected:
virtual void machine_start() override; virtual void machine_start() override;
virtual void machine_reset() override; virtual void machine_reset() override;
@ -141,31 +140,36 @@ private:
Video Video
*******************************************************************************/ *******************************************************************************/
INPUT_CHANGED_MEMBER(advision_state::set_screensize)
{
// reconfigure screen size when settings changed
const int width = 9600 / (m_conf->read() & 0x3f);
const int height = 40 * 4 + 3 - (m_conf->read() >> 6 & 3);
m_screen->set_visible_area(0, width - 1, 0, height - 1);
}
u32 advision_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) u32 advision_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
const bool hint_enable = bool(m_conf->read() & 1); u8 led_height = (m_conf->read() >> 6 & 3) + 1;
bitmap.fill(0, cliprect);
for (int y = 0; y < 40; y++) for (int y = 0; y < 40; y++)
{ {
u8 *src = &m_display[y * DISPLAY_WIDTH]; u8 *src = &m_display[y * DISPLAY_WIDTH];
for (int x = 0; x < DISPLAY_WIDTH; x++) for (int x = cliprect.left(); x <= cliprect.right(); x++)
{
int dx = x;
int dy = y * 2 + 1;
if (cliprect.contains(dx, dy))
{ {
u8 red = src[x] ? 0xff : 0; u8 red = src[x] ? 0xff : 0;
// do some horizontal interpolation
if (hint_enable && red == 0 && dx > 0)
red = (bitmap.pix(dy, dx - 1) >> 16 & 0xff) * 0.75;
u8 green = red / 16; u8 green = red / 16;
u8 blue = red / 12; u8 blue = red / 12;
bitmap.pix(dy, dx) = red << 16 | green << 8 | blue; int dy = y * 4 + (4 - led_height);
for (int i = 0; i < led_height; i++)
{
if (cliprect.contains(x, dy))
bitmap.pix(dy + i, x) = red << 16 | green << 8 | blue;
} }
} }
} }
@ -198,7 +202,7 @@ void advision_state::av_control_w(u8 data)
void advision_state::vblank(int state) void advision_state::vblank(int state)
{ {
if (!state && (m_screen->frame_number() & 3) == 0) if (state && (m_screen->frame_number() & 3) == 0)
{ {
// starting a new frame // starting a new frame
std::fill_n(m_display.get(), DISPLAY_WIDTH * 40, 0); std::fill_n(m_display.get(), DISPLAY_WIDTH * 40, 0);
@ -226,7 +230,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(advision_state::led_update)
{ {
// for official games, 1 'pixel' is 60us, but there are two spots that have // for official games, 1 'pixel' is 60us, but there are two spots that have
// a longer duration: at x=50 and x=100 (see BTANB note about seams) // a longer duration: at x=50 and x=100 (see BTANB note about seams)
m_led_update->adjust(attotime::from_usec(10)); m_led_update->adjust(attotime::from_usec(m_conf->read() & 0x3f));
m_video_hpos++; m_video_hpos++;
} }
} }
@ -353,9 +357,16 @@ static INPUT_PORTS_START( advision )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_START("CONF") PORT_START("CONF")
PORT_CONFNAME( 0x01, 0x01, "H Interpolation" ) PORT_CONFNAME( 0x3f, 20, "Screen Width" ) PORT_CHANGED_MEMBER(DEVICE_SELF, advision_state, set_screensize, 0) // factors of 60
PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 60, "160" )
PORT_CONFSETTING( 0x01, DEF_STR( On ) ) PORT_CONFSETTING( 30, "320" )
PORT_CONFSETTING( 20, "480" )
PORT_CONFSETTING( 15, "640" )
PORT_CONFSETTING( 10, "960" )
PORT_CONFNAME( 0xc0, 0x80, "Led Height" ) PORT_CHANGED_MEMBER(DEVICE_SELF, advision_state, set_screensize, 0)
PORT_CONFSETTING( 0x40, "50%" )
PORT_CONFSETTING( 0x80, "75%" )
PORT_CONFSETTING( 0xc0, "100%" )
INPUT_PORTS_END INPUT_PORTS_END
@ -414,7 +425,7 @@ void advision_state::machine_reset()
void advision_state::advision(machine_config &config) void advision_state::advision(machine_config &config)
{ {
// basic machine hardware // basic machine hardware
I8048(config, m_maincpu, XTAL(11'000'000)); I8048(config, m_maincpu, 11_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &advision_state::program_map); m_maincpu->set_addrmap(AS_PROGRAM, &advision_state::program_map);
m_maincpu->set_addrmap(AS_IO, &advision_state::io_map); m_maincpu->set_addrmap(AS_IO, &advision_state::io_map);
m_maincpu->p1_in_cb().set(FUNC(advision_state::controller_r)); m_maincpu->p1_in_cb().set(FUNC(advision_state::controller_r));
@ -430,10 +441,10 @@ void advision_state::advision(machine_config &config)
// video hardware // video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER); SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(4*14); // see notes m_screen->set_refresh_hz(4 * 14); // see notes
m_screen->set_vblank_time(0); m_screen->set_vblank_time(0);
m_screen->set_size(960, 40 * 2 + 1); m_screen->set_size(960, 40 * 4 + 4);
m_screen->set_visarea_full(); m_screen->set_visarea(0, 480 - 1, 0, 40 * 4); // default setting
m_screen->set_screen_update(FUNC(advision_state::screen_update)); m_screen->set_screen_update(FUNC(advision_state::screen_update));
m_screen->screen_vblank().set(FUNC(advision_state::vblank)); m_screen->screen_vblank().set(FUNC(advision_state::vblank));

View File

@ -176,7 +176,8 @@ on Joerg Woerner's datamath.org: http://www.datamath.org/IC_List.htm
*MP3493 TMS1100 1980, Milton Bradley OMNI Entertainment System (1/2) *MP3493 TMS1100 1980, Milton Bradley OMNI Entertainment System (1/2)
*MP3494 TMS1100 1980, Milton Bradley OMNI Entertainment System (2/2) *MP3494 TMS1100 1980, Milton Bradley OMNI Entertainment System (2/2)
MP3496 TMS1100 1980, Microvision cartridge: Sea Duel MP3496 TMS1100 1980, Microvision cartridge: Sea Duel
M34009 TMS1100 1981, Microvision cartridge: Alien Raiders (note: MP3498, MP3499, M3400x..) *M34004A TMS1100 1981, Ideal Sky-Writer (note: MP3498, MP3499, M3400x..)
M34009 TMS1100 1981, Microvision cartridge: Alien Raiders
@M34012 TMS1100 1980, Mattel Dungeons & Dragons: Computer Labyrinth Game @M34012 TMS1100 1980, Mattel Dungeons & Dragons: Computer Labyrinth Game
*M34014 TMS1100 1981, Coleco Bowlatronic *M34014 TMS1100 1981, Coleco Bowlatronic
M34017 TMS1100 1981, Microvision cartridge: Cosmic Hunter M34017 TMS1100 1981, Microvision cartridge: Cosmic Hunter
@ -191,6 +192,7 @@ on Joerg Woerner's datamath.org: http://www.datamath.org/IC_List.htm
@MP6100A TMS0980 1979, Ideal Electronic Detective @MP6100A TMS0980 1979, Ideal Electronic Detective
@MP6101B TMS0980 1979, Parker Brothers Stop Thief @MP6101B TMS0980 1979, Parker Brothers Stop Thief
@MP6354 TMS1475 1982, Tsukuda The Dracula @MP6354 TMS1475 1982, Tsukuda The Dracula
*MP6358 TMS1475? 1982, Bandai U-Boat
*MP6361 TMS1475? 1983, <unknown> Defender Strikes *MP6361 TMS1475? 1983, <unknown> Defender Strikes
@MP7302 TMS1400 1980, Tiger Deluxe Football with Instant Replay @MP7302 TMS1400 1980, Tiger Deluxe Football with Instant Replay
@MP7304 TMS1400 1982, Tiger 7 in 1 Sports Stadium (model 7-555) @MP7304 TMS1400 1982, Tiger 7 in 1 Sports Stadium (model 7-555)