Previous 15994 Revisions Next

r11048 Sunday 3rd April, 2011 at 02:05:05 UTC by Robbbert
[UTS20] More experiments with coding standards.
[src/mess/drivers]univac.c

src/mess/drivers/univac.c
r11047r11048
1717#include "emu.h"
1818#include "cpu/z80/z80.h"
1919
20#define UTS20_MACHINE_RESET void univac_state::machine_reset()
21#define UTS20_VIDEO_START void univac_state::video_start()
22#define UTS20_SCREEN_UPDATE bool univac_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
20#define MACHINE_RESET_MEMBER(name) void name::machine_reset()
21#define VIDEO_START_MEMBER(name) void name::video_start()
22#define SCREEN_UPDATE_MEMBER(name) bool name::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
2323
2424class univac_state : public driver_device
2525{
r11047r11048
3333   DECLARE_READ8_MEMBER( uts20_vram_r );
3434   DECLARE_WRITE8_MEMBER( uts20_vram_w );
3535   DECLARE_WRITE8_MEMBER( uts20_43_w );
36   const UINT8 *m_FNT;
37   UINT8 m_uts20_screen;
36   const UINT8 *m_p_chargen;
37   bool m_screen_num;
3838   UINT8 m_framecnt;
3939   virtual void machine_reset();
4040   virtual void video_start();
r11047r11048
4545
4646WRITE8_MEMBER( univac_state::uts20_43_w )
4747{
48   m_uts20_screen = data & 1;
48   m_screen_num = data & 1;
4949}
5050
5151READ8_MEMBER( univac_state::uts20_vram_r )
5252{
5353   UINT8 *RAM = machine().region("maincpu")->base();
54   return RAM[offset | ((m_uts20_screen) ? 0xe000 : 0xc000)];
54   return RAM[offset | ((m_screen_num) ? 0xe000 : 0xc000)];
5555}
5656
5757WRITE8_MEMBER( univac_state::uts20_vram_w )
5858{
5959   UINT8 *RAM = machine().region("maincpu")->base();
60   RAM[offset | ((m_uts20_screen) ? 0xe000 : 0xc000)] = data;
60   RAM[offset | ((m_screen_num) ? 0xe000 : 0xc000)] = data;
6161}
6262
6363
r11047r11048
8080INPUT_PORTS_END
8181
8282
83UTS20_MACHINE_RESET
83MACHINE_RESET_MEMBER(univac_state)
8484{
85   m_uts20_screen = 0;
85   m_screen_num = 0;
8686}
8787
88UTS20_VIDEO_START
88VIDEO_START_MEMBER(univac_state)
8989{
90   m_FNT = m_machine.region("chargen")->base();
90   m_p_chargen = m_machine.region("chargen")->base();
9191}
9292
93UTS20_SCREEN_UPDATE
93SCREEN_UPDATE_MEMBER(univac_state)
9494{
9595   UINT8 y,ra,chr,gfx;
9696   UINT16 sy=0,ma=0,x;
97   UINT8 *videoram = machine().region("maincpu")->base()+((m_uts20_screen) ? 0xe000 : 0xc000);
97   UINT8 *videoram = machine().region("maincpu")->base()+((m_screen_num) ? 0xe000 : 0xc000);
9898
9999   m_framecnt++;
100100
r11047r11048
118118
119119               chr &= 0x7f;
120120
121               gfx = m_FNT[(chr<<4) | ra ];
121               gfx = m_p_chargen[(chr<<4) | ra ];
122122            }
123123
124124            /* Display a scanline of a character */
r11047r11048
166166
167167   /* character generator not dumped, using the one from 'c10' for now */
168168   ROM_REGION( 0x2000, "chargen", 0 )
169   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))
169   ROM_LOAD("c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf) )
170170ROM_END
171171
172172/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team