Previous 15994 Revisions Next

r7907 Tuesday 27th April, 2010 at 08:17:03 UTC by Robbbert
[PEGASUS] Added decryption of bios and carts, if first byte is 02. Added notes. Removed commented-out printer.
[src/mess/drivers]pegasus.c

src/mess/drivers/pegasus.c
r7906r7907
11/***************************************************************************
22   
3        Aamber Pegasus computer (New Zealand)
3   Aamber Pegasus computer (New Zealand)
44
55   http://web.mac.com/lord_philip/aamber_pegasus/Aamber_Pegasus.html
66
7        23/04/2010 Skeleton driver.
8
97   Each copy of the monitor rom was made for an individual machine.
108   Therefore the only way to emulate is to hack out the protection check.
119
10   Protection does not exist in all bios versions.
11
12   This computer has no sound.
13
14   The usual way of loading a new rom was to plug it into the board.
15   We have replaced this with cartslots, to save having to recompile
16   whenever a new rom is found. Single rom programs will usually work in
17   any slot (if it is going to work at all). A working rom will appear
18   in the menu. Press the first letter to run it.
19
20   If a machine language program is loaded via cassette, do it in the
21   Monitor (L command), when loaded press Enter, and it will be in the
22   menu.
23
24   Basic cassettes are loaded in the usual way, that is, start Basic,
25   type LOAD, press Enter. When done, RUN or LIST as needed.
26
27   TO DO:
28   - Identify which rom slots the multi-rom programs should be fitted to.
29   - Work on the other non-working programs
30
1231****************************************************************************/
1332
1433#include "emu.h"
r7906r7907
1635#include "machine/6821pia.h"
1736#include "devices/cartslot.h"
1837#include "devices/cassette.h"
19#include "machine/ctronics.h"
2038#include "includes/pegasus.h"
2139
2240static UINT8 pegasus_kbd_row = 0;
r7906r7907
5573
5674static WRITE8_DEVICE_HANDLER( pegasus_controls )
5775{
58/*   Bit 0 - Blank - Video blanking
59   Bit 1 - Char - select character rom or ram
60   Bit 2 - Page - enables video ram
61   Bit 3 - Asc - Select which half of the keyboard to read
76/*   d0,d2 - not emulated
77   d0 - Blank - Video blanking
78   d1 - Char - select character rom or ram
79   d2 - Page - enables writing to video ram
80   d3 - Asc - Select which half of the keyboard to read
6281*/
6382
6483   pegasus_control_bits = data;
r7906r7907
7695
7796static WRITE_LINE_DEVICE_HANDLER( pegasus_cassette_w )
7897{
79   cassette_output(pegasus_cass, state ? 1 : -1);
98   cassette_output(pegasus_cass, state ? 0.75 : -0.75);
8099}
81100
82101static READ8_HANDLER( pegasus_pcg_r )
r7906r7907
100119   AM_RANGE(0xb000, 0xbdff) AM_RAM
101120   AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_BASE(&pegasus_video_ram)
102121   AM_RANGE(0xc000, 0xdfff) AM_ROM AM_WRITENOP
122   /* AM_RANGE(0xe000, 0xe1ff) AM_READ(pegasus_protection) */
103123   AM_RANGE(0xe200, 0xe3ff) AM_READWRITE(pegasus_pcg_r,pegasus_pcg_w)
104124   AM_RANGE(0xe400, 0xe403) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pegasus_pia_u", pia6821_r, pia6821_w)
105125   AM_RANGE(0xe600, 0xe603) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pegasus_pia_s", pia6821_r, pia6821_w)
106126   AM_RANGE(0xf000, 0xffff) AM_ROM
107
108/*   AM_RANGE(0xe000, 0xe000) AM_READ(pegasus_protection)
109   AM_RANGE(0xe800, 0xe800) Printer Port
110   AM_RANGE(0xe808, 0xe808) Cassette Interface
111   AM_RANGE(0xe810, 0xe810) General Purpose User Interface */
112127ADDRESS_MAP_END
113128
114129/* Input ports */
r7906r7907
235250   (cassette_state)(CASSETTE_STOPPED|CASSETTE_MOTOR_ENABLED)
236251};
237252
253/* An encrypted single rom starts with 02, decrypted with 20. Not sure what
254   multipart roms will have. */
255static void pegasus_decrypt_rom( running_machine *machine, UINT16 addr )
256{
257   UINT8 b, *ROM = memory_region(machine, "maincpu");
258   UINT16 i, j;
259   if (ROM[addr] == 0x02)
260   {
261      for (i = 0; i < 0x1000; i++)
262      {
263         b = ROM[addr|i];
264         j = BITSWAP16( i, 15, 14, 13, 12, 11, 10, 9, 8, 0, 1, 2, 3, 4, 5, 6, 7 );
265         b = BITSWAP8( b, 3, 2, 1, 0, 7, 6, 5, 4 );
266         ROM[0x2000|(j&0xfff)] = b;
267      }
268      for (i = 0; i < 0x1000; i++)
269         ROM[addr|i] = ROM[0x2000|i];
270   }
271}
272
238273static DEVICE_IMAGE_LOAD( pegasus_cart_1 )
239274{
240275   image_fread(image, memory_region(image->machine, "maincpu") + 0x0000, 0x1000);
276   pegasus_decrypt_rom( image->machine, 0x0000 );
241277
242278   return INIT_PASS;
243279}
r7906r7907
245281static DEVICE_IMAGE_LOAD( pegasus_cart_2 )
246282{
247283   image_fread(image, memory_region(image->machine, "maincpu") + 0x1000, 0x1000);
284   pegasus_decrypt_rom( image->machine, 0x1000 );
248285
249286   return INIT_PASS;
250287}
r7906r7907
252289static DEVICE_IMAGE_LOAD( pegasus_cart_3 )
253290{
254291   image_fread(image, memory_region(image->machine, "maincpu") + 0xc000, 0x1000);
292   pegasus_decrypt_rom( image->machine, 0xc000 );
255293
256294   return INIT_PASS;
257295}
r7906r7907
259297static DEVICE_IMAGE_LOAD( pegasus_cart_4 )
260298{
261299   image_fread(image, memory_region(image->machine, "maincpu") + 0xd000, 0x1000);
300   pegasus_decrypt_rom( image->machine, 0xd000 );
262301
263302   return INIT_PASS;
264303}
r7906r7907
269308   FNT = memory_region(machine, "pcg");
270309}
271310
311static MACHINE_RESET( pegasus )
312{
313   pegasus_kbd_row = 0;
314   pegasus_kbd_irq = 1;
315   pegasus_control_bits = 0;
316}
317
318static DRIVER_INIT( pegasus )
319{
320   pegasus_decrypt_rom( machine, 0xf000 );
321}
322
272323static MACHINE_DRIVER_START( pegasus )
273324   /* basic machine hardware */
274325   MDRV_CPU_ADD("maincpu", M6809E, XTAL_4MHz)   // actually a 6809C
r7906r7907
276327
277328   MDRV_TIMER_ADD_PERIODIC("pegasus_firq", pegasus_firq, HZ(400))   // controls accuracy of the clock (ctrl-P)
278329   MDRV_MACHINE_START(pegasus)
330   MDRV_MACHINE_RESET(pegasus)
279331   /* video hardware */
280332   MDRV_SCREEN_ADD("screen", RASTER)
281333   MDRV_SCREEN_REFRESH_RATE(50)
r7906r7907
303355   MDRV_CARTSLOT_EXTENSION_LIST("bin")
304356   MDRV_CARTSLOT_LOAD(pegasus_cart_4)
305357   MDRV_CASSETTE_ADD( "cassette", pegasus_cassette_config )
306//   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
307358MACHINE_DRIVER_END
308359
309360/* ROM definition */
r7906r7907
319370/* Driver */
320371
321372/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
322COMP( 1981, pegasus,  0,     0,    pegasus,    pegasus,     0, "Technosys",   "Aamber Pegasus", GAME_NOT_WORKING | GAME_NO_SOUND)
373COMP( 1981, pegasus,  0,     0,      pegasus,    pegasus, pegasus, "Technosys",   "Aamber Pegasus", GAME_NO_SOUND )
323374

Previous 15994 Revisions Next


© 1998-2018 The MESS Team