Previous 15994 Revisions Next

r11992 Sunday 19th June, 2011 at 06:57:17 UTC by Robbbert
(nw) OKEAN240 - Fixed a few things with the test rom.
[src/mess/drivers]okean240.c

src/mess/drivers/okean240.c
r11991r11992
3333be useful to have the 2 screens side-by-side. Unfortunately they will not
3434co-exist, instead causing a crash at start ("Mandatory artwork is missing").
3535So, if you want to see the test rom results, you'll have to compile a modified
36driver (change the below line to 1).
37- All 'rand()' returns are only there to allow the tests to proceed.
36driver (uncomment the define below).
37- You need to press a key every so often.
3838
3939
4040ToDo:
4141- Add devices
4242- Find out if any unconnected keyboard entries are real keys
43- Colours (if it had colours)
43- Colours?
44- Sound? (perhaps port E4 bit 3)
4445- Add disks
45- Add cassette
46- Cassette?
47- Add memory banking (perhaps port C1)
4648
4749Usage of terminal:
4850- okean240 bios 0 - the keyboard
4951- okean240a bios 0 - not used
50- (either) bios 1 - the screen if compiled specially
52- (either) bios 1 - the keyboard (part of the testing), & the screen if compiled specially
5153 
5254****************************************************************************/
53#define OKEAN240_USING_TESTROM 0
55//#define OKEAN240_USING_TESTROM
5456
5557#define ADDRESS_MAP_MODERN
5658
r11991r11992
7476   DECLARE_READ8_MEMBER(okean240_kbd_status_r);
7577   DECLARE_READ8_MEMBER(okean240a_kbd_status_r);
7678   DECLARE_READ8_MEMBER(term_status_r);
79   DECLARE_READ8_MEMBER(term_r);
7780   DECLARE_READ8_MEMBER(okean240_keyboard_r);
7881   DECLARE_WRITE8_MEMBER(okean240_keyboard_w);
7982   DECLARE_READ8_MEMBER(okean240a_keyboard_r);
r11991r11992
8790   virtual void video_start();
8891};
8992
90
93// bios 0 requires bit 4 to change
9194READ8_MEMBER( okean240_state::okean240_kbd_status_r )
9295{
9396   if (m_term_data)
r11991r11992
113116   return machine().rand() & 0x10;
114117}
115118
119// for test rom
116120READ8_MEMBER( okean240_state::term_status_r )
117121{
118   return 1 | (machine().rand() & 2);
122   return (m_term_data) ? 3 : 1;
119123}
120124
121125READ8_MEMBER( okean240_state::okean240_keyboard_r )
122126{
123127   if (offset == 0) // port 40 (get ascii key value)
124   {
125      UINT8 ret = m_term_data;
126      m_term_data = 0;
127      return ret;
128   }
128      return term_r(space, offset);
129129   else
130   if (offset == 1) // port 41 bit 1 (status bit used by test rom)
130   if (offset == 1) // port 41 bit 1 (test rom status bit)
131131   {
132132      return (machine().rand() & 2);
133133   }
r11991r11992
157157      return 0;
158158   }
159159   else
160   if (offset == 1) // port 41 bits 6&7 (modifier keys), and bit 1 (unrelated status bit)
160   if (offset == 1) // port 41 bits 6&7 (modifier keys), and bit 1 (test rom status bit)
161161   {
162162      return (machine().rand() & 2) | input_port_read(machine(), "MODIFIERS");
163163   }
r11991r11992
181181// okean240a: port 42 bit 4
182182}
183183
184// for test rom
185READ8_MEMBER( okean240_state::term_r )
186{
187   UINT8 ret = m_term_data;
188   m_term_data = 0;
189   return ret;
190}
191
184192WRITE8_MEMBER( okean240_state::scroll_w )
185193{
186194   m_scroll = data;
r11991r11992
199207   ADDRESS_MAP_GLOBAL_MASK(0xff)
200208   AM_RANGE(0x40, 0x42) AM_READWRITE(okean240_keyboard_r,okean240_keyboard_w)
201209   AM_RANGE(0x80, 0x80) AM_READ(okean240_kbd_status_r)
202#if OKEAN240_USING_TESTROM
210#ifdef OKEAN240_USING_TESTROM
203211   AM_RANGE(0xa0, 0xa0) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write)
212#endif
213   AM_RANGE(0xa0, 0xa0) AM_READ(term_r)
204214   AM_RANGE(0xa1, 0xa1) AM_READ(term_status_r)
205#endif
206215   AM_RANGE(0xc0, 0xc0) AM_WRITE(scroll_w)
207216ADDRESS_MAP_END
208217
r11991r11992
210219   ADDRESS_MAP_GLOBAL_MASK(0xff)
211220   AM_RANGE(0x40, 0x42) AM_READWRITE(okean240a_keyboard_r,okean240_keyboard_w)
212221   AM_RANGE(0x80, 0x80) AM_READ(okean240a_kbd_status_r)
213#if OKEAN240_USING_TESTROM
222#ifdef OKEAN240_USING_TESTROM
214223   AM_RANGE(0xa0, 0xa0) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write)
224#endif
225   AM_RANGE(0xa0, 0xa0) AM_READ(term_r)
215226   AM_RANGE(0xa1, 0xa1) AM_READ(term_status_r)
216#endif
217227   AM_RANGE(0xc0, 0xc0) AM_WRITE(scroll_w)
218228   // AM_RANGE(0x00, 0x1f)=ppa00.data
219229   // AM_RANGE(0x20, 0x23)=dsk.data
r11991r11992
374384   DEVCB_DRIVER_MEMBER(okean240_state, kbd_put)
375385};
376386
377static GENERIC_TERMINAL_INTERFACE( okean240a_terminal_intf )
378{
379   DEVCB_NULL
380};
381
382387DRIVER_INIT( okean240 )
383388{
384389   UINT8 *RAM = machine.region("maincpu")->base();
r11991r11992
389394{
390395}
391396
397#ifndef OKEAN240_USING_TESTROM
392398static SCREEN_UPDATE( okean240 )
393399{
394400   okean240_state *state = screen->machine().driver_data<okean240_state>();
r11991r11992
417423   }
418424   return 0;
419425}
426#endif
420427
421428/* F4 Character Displayer */
422429static const gfx_layout okean240_charlayout =
r11991r11992
447454   MCFG_CPU_IO_MAP(okean240_io)
448455
449456   /* video hardware */
450#if OKEAN240_USING_TESTROM
457#ifdef OKEAN240_USING_TESTROM
451458   MCFG_FRAGMENT_ADD( generic_terminal )
452459#else
453460   MCFG_SCREEN_ADD("screen", RASTER)
r11991r11992
469476   MCFG_CPU_MODIFY("maincpu")
470477   MCFG_CPU_IO_MAP(okean240a_io)
471478   MCFG_GFXDECODE(okean240a)
472   MCFG_GENERIC_TERMINAL_REMOVE(TERMINAL_TAG)
473   //MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, okean240a_terminal_intf)
474479MACHINE_CONFIG_END
475480
476481/* ROM definition */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team