hp48: Removed first_screen and eliminated redundant function-name prefixes now that MAME is C++, nw

This commit is contained in:
mooglyguy 2018-03-10 05:46:58 +01:00
parent 796bb71902
commit b688161290
3 changed files with 304 additions and 320 deletions

View File

@ -1262,10 +1262,10 @@ MACHINE_CONFIG_START(hp48_state::hp48_common)
/* cpu */
MCFG_CPU_ADD ( "maincpu", SATURN, 3937007 ) /* almost 4 MHz */
MCFG_CPU_PROGRAM_MAP ( hp48)
MCFG_SATURN_CONFIG( WRITE32(hp48_state, hp48_reg_out), READ32(hp48_state, hp48_reg_in),
WRITELINE(hp48_state, hp48_mem_reset), WRITE32(hp48_state, hp48_mem_config),
WRITE32(hp48_state, hp48_mem_unconfig), READ32(hp48_state, hp48_mem_id),
WRITE32(hp48_state, hp48_mem_crc), WRITELINE(hp48_state, hp48_rsi) )
MCFG_SATURN_CONFIG( WRITE32(hp48_state, reg_out), READ32(hp48_state, reg_in),
WRITELINE(hp48_state, mem_reset), WRITE32(hp48_state, mem_config),
WRITE32(hp48_state, mem_unconfig), READ32(hp48_state, mem_id),
WRITE32(hp48_state, mem_crc), WRITELINE(hp48_state, rsi) )
/* memory */
MCFG_NVRAM_ADD_0FILL("nvram")

View File

@ -13,6 +13,7 @@
#pragma once
#include "sound/dac.h"
#include "screen.h"
/* model */
typedef enum {
@ -50,10 +51,72 @@ class hp48_state : public driver_device
{
public:
hp48_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_dac(*this, "dac"),
m_palette(*this, "palette") { }
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_dac(*this, "dac")
, m_palette(*this, "palette")
, m_screen(*this, "screen") {}
virtual void machine_reset() override;
void base_machine_start(hp48_models model);
DECLARE_DRIVER_INIT(hp48);
DECLARE_PALETTE_INIT(hp48);
DECLARE_MACHINE_START(hp49g);
DECLARE_MACHINE_START(hp48gx);
DECLARE_MACHINE_START(hp48g);
DECLARE_MACHINE_START(hp48gp);
DECLARE_MACHINE_START(hp48sx);
DECLARE_MACHINE_START(hp48s);
uint32_t screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(io_w);
DECLARE_READ8_MEMBER(io_r);
DECLARE_READ8_MEMBER(bank_r);
DECLARE_WRITE8_MEMBER(hp49_bank_w);
TIMER_CALLBACK_MEMBER(rs232_byte_recv_cb);
TIMER_CALLBACK_MEMBER(rs232_byte_sent_cb);
TIMER_CALLBACK_MEMBER(kbd_cb);
TIMER_CALLBACK_MEMBER(timer1_cb);
TIMER_CALLBACK_MEMBER(timer2_cb);
void update_annunciators();
void apply_modules();
void pulse_irq(int irq_line);
void rs232_start_recv_byte(uint8_t data);
void rs232_send_byte();
int get_in();
void update_kdn();
void reset_modules();
void decode_nibble(uint8_t* dst, uint8_t* src, int size);
void encode_nibble(uint8_t* dst, uint8_t* src, int size);
/* memory controller */
DECLARE_WRITE_LINE_MEMBER(mem_reset);
DECLARE_WRITE32_MEMBER(mem_config);
DECLARE_WRITE32_MEMBER(mem_unconfig);
DECLARE_READ32_MEMBER(mem_id);
/* CRC computation */
DECLARE_WRITE32_MEMBER(mem_crc);
/* IN/OUT registers */
DECLARE_READ32_MEMBER(reg_in);
DECLARE_WRITE32_MEMBER(reg_out);
/* keyboard interrupt system */
DECLARE_WRITE_LINE_MEMBER(rsi);
void hp48_common(machine_config &config);
void hp48s(machine_config &config);
void hp48gp(machine_config &config);
void hp48sx(machine_config &config);
void hp48g(machine_config &config);
void hp48gx(machine_config &config);
void hp49g(machine_config &config);
void hp48(address_map &map);
required_device<cpu_device> m_maincpu;
required_device<dac_bit_interface> m_dac;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
uint8_t *m_videoram;
uint8_t m_io[64];
@ -81,70 +144,12 @@ public:
uint16_t m_crc;
uint8_t m_timer1;
uint32_t m_timer2;
uint8_t m_screens[ HP48_NB_SCREENS ][ 64 ][ 144 ];
uint8_t m_screens[HP48_NB_SCREENS][64][144];
int m_cur_screen;
uint8_t* m_rom;
emu_timer *m_1st_timer;
emu_timer *m_2nd_timer;
emu_timer *m_kbd_timer;
DECLARE_DRIVER_INIT(hp48);
virtual void machine_reset() override;
DECLARE_PALETTE_INIT(hp48);
DECLARE_MACHINE_START(hp49g);
DECLARE_MACHINE_START(hp48gx);
DECLARE_MACHINE_START(hp48g);
DECLARE_MACHINE_START(hp48gp);
DECLARE_MACHINE_START(hp48sx);
DECLARE_MACHINE_START(hp48s);
uint32_t screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void hp48_machine_start(hp48_models model);
DECLARE_WRITE8_MEMBER(hp48_io_w);
DECLARE_READ8_MEMBER(hp48_io_r);
DECLARE_READ8_MEMBER(hp48_bank_r);
DECLARE_WRITE8_MEMBER(hp49_bank_w);
TIMER_CALLBACK_MEMBER(hp48_rs232_byte_recv_cb);
TIMER_CALLBACK_MEMBER(hp48_rs232_byte_sent_cb);
TIMER_CALLBACK_MEMBER(hp48_kbd_cb);
TIMER_CALLBACK_MEMBER(hp48_timer1_cb);
TIMER_CALLBACK_MEMBER(hp48_timer2_cb);
void hp48_update_annunciators();
void hp48_apply_modules();
required_device<cpu_device> m_maincpu;
required_device<dac_bit_interface> m_dac;
required_device<palette_device> m_palette;
void hp48_pulse_irq( int irq_line);
void hp48_rs232_start_recv_byte( uint8_t data );
void hp48_rs232_send_byte( );
int hp48_get_in( );
void hp48_update_kdn( );
void hp48_reset_modules( );
void hp48_decode_nibble( uint8_t* dst, uint8_t* src, int size );
void hp48_encode_nibble( uint8_t* dst, uint8_t* src, int size );
/* memory controller */
DECLARE_WRITE_LINE_MEMBER( hp48_mem_reset );
DECLARE_WRITE32_MEMBER( hp48_mem_config );
DECLARE_WRITE32_MEMBER( hp48_mem_unconfig );
DECLARE_READ32_MEMBER( hp48_mem_id );
/* CRC computation */
DECLARE_WRITE32_MEMBER( hp48_mem_crc );
/* IN/OUT registers */
DECLARE_READ32_MEMBER( hp48_reg_in );
DECLARE_WRITE32_MEMBER( hp48_reg_out );
/* keyboard interrupt system */
DECLARE_WRITE_LINE_MEMBER( hp48_rsi );
void hp48_common(machine_config &config);
void hp48s(machine_config &config);
void hp48gp(machine_config &config);
void hp48sx(machine_config &config);
void hp48g(machine_config &config);
void hp48gx(machine_config &config);
void hp49g(machine_config &config);
void hp48(address_map &map);
};
@ -218,8 +223,8 @@ protected:
// device-level overrides
virtual void device_start() override;
private:
void hp48_fill_port();
void hp48_unfill_port();
void fill_port();
void unfill_port();
int m_port; /* port index: 0 or 1 (for port 1 and 2) */
int m_module; /* memory module where the port is visible */

File diff suppressed because it is too large Load Diff