src/mess/drivers/pegasus.c
| r7906 | r7907 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | Aamber Pegasus computer (New Zealand) |
| 3 | Aamber Pegasus computer (New Zealand) |
| 4 | 4 | |
| 5 | 5 | http://web.mac.com/lord_philip/aamber_pegasus/Aamber_Pegasus.html |
| 6 | 6 | |
| 7 | | 23/04/2010 Skeleton driver. |
| 8 | | |
| 9 | 7 | Each copy of the monitor rom was made for an individual machine. |
| 10 | 8 | Therefore the only way to emulate is to hack out the protection check. |
| 11 | 9 | |
| 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 | |
| 12 | 31 | ****************************************************************************/ |
| 13 | 32 | |
| 14 | 33 | #include "emu.h" |
| r7906 | r7907 | |
| 16 | 35 | #include "machine/6821pia.h" |
| 17 | 36 | #include "devices/cartslot.h" |
| 18 | 37 | #include "devices/cassette.h" |
| 19 | | #include "machine/ctronics.h" |
| 20 | 38 | #include "includes/pegasus.h" |
| 21 | 39 | |
| 22 | 40 | static UINT8 pegasus_kbd_row = 0; |
| r7906 | r7907 | |
| 55 | 73 | |
| 56 | 74 | static WRITE8_DEVICE_HANDLER( pegasus_controls ) |
| 57 | 75 | { |
| 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 |
| 62 | 81 | */ |
| 63 | 82 | |
| 64 | 83 | pegasus_control_bits = data; |
| r7906 | r7907 | |
| 76 | 95 | |
| 77 | 96 | static WRITE_LINE_DEVICE_HANDLER( pegasus_cassette_w ) |
| 78 | 97 | { |
| 79 | | cassette_output(pegasus_cass, state ? 1 : -1); |
| 98 | cassette_output(pegasus_cass, state ? 0.75 : -0.75); |
| 80 | 99 | } |
| 81 | 100 | |
| 82 | 101 | static READ8_HANDLER( pegasus_pcg_r ) |
| r7906 | r7907 | |
| 100 | 119 | AM_RANGE(0xb000, 0xbdff) AM_RAM |
| 101 | 120 | AM_RANGE(0xbe00, 0xbfff) AM_RAM AM_BASE(&pegasus_video_ram) |
| 102 | 121 | AM_RANGE(0xc000, 0xdfff) AM_ROM AM_WRITENOP |
| 122 | /* AM_RANGE(0xe000, 0xe1ff) AM_READ(pegasus_protection) */ |
| 103 | 123 | AM_RANGE(0xe200, 0xe3ff) AM_READWRITE(pegasus_pcg_r,pegasus_pcg_w) |
| 104 | 124 | AM_RANGE(0xe400, 0xe403) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pegasus_pia_u", pia6821_r, pia6821_w) |
| 105 | 125 | AM_RANGE(0xe600, 0xe603) AM_MIRROR(0x1fc) AM_DEVREADWRITE("pegasus_pia_s", pia6821_r, pia6821_w) |
| 106 | 126 | 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 */ |
| 112 | 127 | ADDRESS_MAP_END |
| 113 | 128 | |
| 114 | 129 | /* Input ports */ |
| r7906 | r7907 | |
| 235 | 250 | (cassette_state)(CASSETTE_STOPPED|CASSETTE_MOTOR_ENABLED) |
| 236 | 251 | }; |
| 237 | 252 | |
| 253 | /* An encrypted single rom starts with 02, decrypted with 20. Not sure what |
| 254 | multipart roms will have. */ |
| 255 | static 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 | |
| 238 | 273 | static DEVICE_IMAGE_LOAD( pegasus_cart_1 ) |
| 239 | 274 | { |
| 240 | 275 | image_fread(image, memory_region(image->machine, "maincpu") + 0x0000, 0x1000); |
| 276 | pegasus_decrypt_rom( image->machine, 0x0000 ); |
| 241 | 277 | |
| 242 | 278 | return INIT_PASS; |
| 243 | 279 | } |
| r7906 | r7907 | |
| 245 | 281 | static DEVICE_IMAGE_LOAD( pegasus_cart_2 ) |
| 246 | 282 | { |
| 247 | 283 | image_fread(image, memory_region(image->machine, "maincpu") + 0x1000, 0x1000); |
| 284 | pegasus_decrypt_rom( image->machine, 0x1000 ); |
| 248 | 285 | |
| 249 | 286 | return INIT_PASS; |
| 250 | 287 | } |
| r7906 | r7907 | |
| 252 | 289 | static DEVICE_IMAGE_LOAD( pegasus_cart_3 ) |
| 253 | 290 | { |
| 254 | 291 | image_fread(image, memory_region(image->machine, "maincpu") + 0xc000, 0x1000); |
| 292 | pegasus_decrypt_rom( image->machine, 0xc000 ); |
| 255 | 293 | |
| 256 | 294 | return INIT_PASS; |
| 257 | 295 | } |
| r7906 | r7907 | |
| 259 | 297 | static DEVICE_IMAGE_LOAD( pegasus_cart_4 ) |
| 260 | 298 | { |
| 261 | 299 | image_fread(image, memory_region(image->machine, "maincpu") + 0xd000, 0x1000); |
| 300 | pegasus_decrypt_rom( image->machine, 0xd000 ); |
| 262 | 301 | |
| 263 | 302 | return INIT_PASS; |
| 264 | 303 | } |
| r7906 | r7907 | |
| 269 | 308 | FNT = memory_region(machine, "pcg"); |
| 270 | 309 | } |
| 271 | 310 | |
| 311 | static MACHINE_RESET( pegasus ) |
| 312 | { |
| 313 | pegasus_kbd_row = 0; |
| 314 | pegasus_kbd_irq = 1; |
| 315 | pegasus_control_bits = 0; |
| 316 | } |
| 317 | |
| 318 | static DRIVER_INIT( pegasus ) |
| 319 | { |
| 320 | pegasus_decrypt_rom( machine, 0xf000 ); |
| 321 | } |
| 322 | |
| 272 | 323 | static MACHINE_DRIVER_START( pegasus ) |
| 273 | 324 | /* basic machine hardware */ |
| 274 | 325 | MDRV_CPU_ADD("maincpu", M6809E, XTAL_4MHz) // actually a 6809C |
| r7906 | r7907 | |
| 276 | 327 | |
| 277 | 328 | MDRV_TIMER_ADD_PERIODIC("pegasus_firq", pegasus_firq, HZ(400)) // controls accuracy of the clock (ctrl-P) |
| 278 | 329 | MDRV_MACHINE_START(pegasus) |
| 330 | MDRV_MACHINE_RESET(pegasus) |
| 279 | 331 | /* video hardware */ |
| 280 | 332 | MDRV_SCREEN_ADD("screen", RASTER) |
| 281 | 333 | MDRV_SCREEN_REFRESH_RATE(50) |
| r7906 | r7907 | |
| 303 | 355 | MDRV_CARTSLOT_EXTENSION_LIST("bin") |
| 304 | 356 | MDRV_CARTSLOT_LOAD(pegasus_cart_4) |
| 305 | 357 | MDRV_CASSETTE_ADD( "cassette", pegasus_cassette_config ) |
| 306 | | // MDRV_CENTRONICS_ADD("centronics", standard_centronics) |
| 307 | 358 | MACHINE_DRIVER_END |
| 308 | 359 | |
| 309 | 360 | /* ROM definition */ |
| r7906 | r7907 | |
| 319 | 370 | /* Driver */ |
| 320 | 371 | |
| 321 | 372 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 322 | | COMP( 1981, pegasus, 0, 0, pegasus, pegasus, 0, "Technosys", "Aamber Pegasus", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 373 | COMP( 1981, pegasus, 0, 0, pegasus, pegasus, pegasus, "Technosys", "Aamber Pegasus", GAME_NO_SOUND ) |
| 323 | 374 | |