Previous 15994 Revisions Next

r3032 Saturday 9th August, 2008 at 08:59:42 UTC by Curt Coder
[COMX35] Fixed to boot again (#1629). Added 80-column screen. Configured BIOSes properly.
[docs]messnew.txt
[src/mess/drivers]comx35.c
[src/mess/machine]comx35.c
[src/mess/video]comx35.c

src/mess/video/comx35.c
r3031r3032
11#include "driver.h"
2#include "rendlay.h"
23#include "includes/comx35.h"
34#include "cpu/cdp1802/cdp1802.h"
45#include "video/cdp1869.h"
r3031r3032
121122
122123static VIDEO_UPDATE( comx35 )
123124{
124   const device_config *cdp1869 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1869_VIDEO, CDP1869_TAG);
125   const device_config *screen_40 = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, SCREEN_TAG);
125126
126   cdp1869_update(cdp1869, bitmap, cliprect);
127   if (screen == screen_40)
128   {
129      const device_config *cdp1869 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1869_VIDEO, CDP1869_TAG);
127130
131      cdp1869_update(cdp1869, bitmap, cliprect);
132   }
133   else
134   {
135      const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, MC6845_TAG);
136     
137      mc6845_update(mc6845, bitmap, cliprect);
138   }
139
128140   return 0;
129141}
130142
r3031r3032
132144
133145static MC6845_UPDATE_ROW( comx35_update_row )
134146{
147   const UINT8 *charrom = memory_region(device->machine, "chargen");
148   const UINT8 *videoram = memory_region(device->machine, "user1") + 0x1000;
149
135150   int column;
136   const UINT8 *charrom = memory_region(device->machine, "gfx1");
137   const UINT8 *usr1 = memory_region(device->machine, "user1");
138151
139152   for (column = 0; column < x_count; column++)
140153   {
141154      int bit;
142155
143      UINT8 code = usr1[((ma + column) & 0x7ff) + 0xd000];
156      UINT8 code = videoram[((ma + column) & 0x7ff)];
144157      UINT8 addr = (code << 4) | ra;
145158      UINT8 data = charrom[addr & 0x7ff];
146159
r3031r3032
163176   state->cdp1802_ef4 = vsync;
164177}
165178
166static const mc6845_interface comx35_mc6845_interface = {
179static const mc6845_interface comx35_mc6845_interface =
180{
167181   MC6845_SCREEN_TAG,
168182   XTAL_14_31818MHz,
169183   8,
r3031r3032
175189   comx35_vsync_changed
176190};
177191
178static VIDEO_UPDATE( comx35_80 )
179{
180   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, MC6845_TAG);
181   
182   mc6845_update(mc6845, bitmap, cliprect);
183
184   return 0;
185}
186
187192/* Machine Drivers */
188193
189194static MACHINE_DRIVER_START( comx35_80_video )
r3031r3032
194199   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
195200   MDRV_SCREEN_REFRESH_RATE(50)
196201
197   MDRV_PALETTE_LENGTH(2)
198   MDRV_PALETTE_INIT(black_and_white)
199
200   MDRV_VIDEO_START(comx35)
201   MDRV_VIDEO_UPDATE(comx35_80)
202
203202   MDRV_DEVICE_ADD(MC6845_TAG, MC6845)
204203   MDRV_DEVICE_CONFIG(comx35_mc6845_interface)
205204MACHINE_DRIVER_END
206205
207206MACHINE_DRIVER_START( comx35p_video )
207   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
208
208209   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
209210   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
210211   MDRV_SCREEN_RAW_PARAMS(CDP1869_DOT_CLK_PAL, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_PAL, CDP1869_SCANLINE_VBLANK_END_PAL, CDP1869_SCANLINE_VBLANK_START_PAL)
r3031r3032
218219   MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO)
219220   MDRV_DEVICE_CONFIG(comx35p_cdp1869_intf)
220221
221   //MDRV_IMPORT_FROM(comx35_80_video)
222   MDRV_IMPORT_FROM(comx35_80_video)
222223MACHINE_DRIVER_END
223224
224225MACHINE_DRIVER_START( comx35n_video )
226   MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
227
225228   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
226229   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
227230   MDRV_SCREEN_RAW_PARAMS(CDP1869_DOT_CLK_NTSC, CDP1869_SCREEN_WIDTH, CDP1869_HBLANK_END, CDP1869_HBLANK_START, CDP1869_TOTAL_SCANLINES_NTSC, CDP1869_SCANLINE_VBLANK_END_NTSC, CDP1869_SCANLINE_VBLANK_START_NTSC)
r3031r3032
235238   MDRV_DEVICE_ADD(CDP1869_TAG, CDP1869_VIDEO)
236239   MDRV_DEVICE_CONFIG(comx35n_cdp1869_intf)
237240
238   //MDRV_IMPORT_FROM(comx35_80_video)
241   MDRV_IMPORT_FROM(comx35_80_video)
239242MACHINE_DRIVER_END
src/mess/machine/comx35.c
r3031r3032
5050
5151static int expansion_box_installed(running_machine *machine)
5252{
53   return (memory_region(machine, "main")[0xe800] != 0xff);
53   return (memory_region(machine, CDP1802_TAG)[0xe800] != 0x00);
5454}
5555
5656static int dos_card_active(running_machine *machine)
r3031r3032
479479      break;
480480
481481   case BANK_JOYCARD:
482      data = input_port_read(machine, "JOY2");
483482      break;
484483
485484   case BANK_80_COLUMNS:
r3031r3032
523522{
524523   comx35_state *state = machine->driver_data;
525524
526   // opbase handling for DOS Card
525   /* opbase handling for DOS Card */
527526
528527   memory_set_opbase_handler(0, comx35_opbase_handler);
529528
530   // card slot banking
529   /* BASIC ROM banking */
531530
532   memory_configure_bank(1, 0, 1, memory_region(machine, "U3"), 0xc000);
531   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, SMH_BANK2, SMH_UNMAP);
532   memory_configure_bank(2, 0, 1, memory_region(machine, CDP1802_TAG) + 0x1000, 0); // normal ROM
533   memory_configure_bank(2, 1, 1, memory_region(machine, CDP1802_TAG) + 0xe000, 0); // expansion box ROM
534
535   memory_configure_bank(3, 0, 1, memory_region(machine, CDP1802_TAG) + 0xe000, 0);
536   memory_set_bank(3, 0);
537
538   if (expansion_box_installed(machine))
539   {
540      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_BANK3, SMH_UNMAP);
541      memory_set_bank(2, 1);
542   }
543   else
544   {
545      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, SMH_UNMAP, SMH_UNMAP);
546      memory_set_bank(2, 0);
547   }
548
549   /* card slot banking */
550
551   memory_configure_bank(1, 0, 1, memory_region(machine, CDP1802_TAG) + 0xc000, 0);
533552   memory_configure_bank(1, BANK_FLOPPY, 7, memory_region(machine, "user1"), 0x2000);
534553   memory_configure_bank(1, BANK_RAMCARD, 4, mess_ram, 0x2000);
535554
r3031r3032
540559      state->bank = read_expansion(machine);
541560   }
542561
543   // allocate reset timer
562   /* allocate reset timer */
544563   
545564   state->reset_timer = timer_alloc(reset_tick, NULL);
546565
547   // screen format
566   /* screen format */
548567
549568   state->pal_ntsc = CDP1869_PAL;
550569
570   /* initialize floppy disc controller */
571
551572   wd17xx_init(machine, WD_TYPE_1770, comx35_fdc_callback, NULL);
552573
553   // register save states
574   /* register for state saving */
554575
555576   state_save_register_postload(machine, comx35_state_save_postload, NULL);
556577
src/mess/drivers/comx35.c
r3031r3032
22
33   TODO:
44
5   - configure bioses properly
65   - unreliable DOS commands?
76   - tape input/output
87   - 80 column card
r3031r3032
3433static ADDRESS_MAP_START( comx35_map, ADDRESS_SPACE_PROGRAM, 8 )
3534   ADDRESS_MAP_UNMAP_HIGH
3635   AM_RANGE(0x0000, 0x3fff) AM_ROM
36   AM_RANGE(0x1000, 0x17ff) AM_ROMBANK(2)
37   AM_RANGE(0x1800, 0x3fff) AM_ROM
3738   AM_RANGE(0x4000, 0xbfff) AM_RAM
3839   AM_RANGE(0xc000, 0xdfff) AM_RAMBANK(1)
39   AM_RANGE(0xe000, 0xefff) AM_ROM
40   AM_RANGE(0xe000, 0xefff) AM_ROMBANK(3)
4041   AM_RANGE(0xf400, 0xf7ff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_charram_r, cdp1869_charram_w)
4142   AM_RANGE(0xf800, 0xffff) AM_DEVREADWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_pageram_r, cdp1869_pageram_w)
4243ADDRESS_MAP_END
r3031r3032
368369
369370   MDRV_SPEAKER_STANDARD_MONO("mono")
370371
371   MDRV_SOUND_ADD("cop1869", CDP1869, CDP1869_DOT_CLK_PAL)
372   MDRV_SOUND_ADD("cdp1869", CDP1869, CDP1869_DOT_CLK_PAL)
372373   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
373374
374375   MDRV_SOUND_ADD("tape", WAVE, 0)
r3031r3032
409410
410411   MDRV_SPEAKER_STANDARD_MONO("mono")
411412
412   MDRV_SOUND_ADD("cop1869", CDP1869, CDP1869_DOT_CLK_NTSC)
413   MDRV_SOUND_ADD("cdp1869", CDP1869, CDP1869_DOT_CLK_NTSC)
413414   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
414415
415416   MDRV_SOUND_ADD("tape", WAVE, 0)
r3031r3032
427428/* ROMs */
428429
429430ROM_START( comx35p )
430   ROM_REGION( 0x10000, "U3", 0 )
431   ROM_REGION( 0x10000, CDP1802_TAG, 0 )
431432   ROM_SYSTEM_BIOS( 0, "basic100", "COMX BASIC V1.00" )
432433   ROMX_LOAD( "comx_10.u21",         0x0000, 0x4000, CRC(68d0db2d) SHA1(062328361629019ceed9375afac18e2b7849ce47), ROM_BIOS(1) )
433   ROM_FILL( 0xe000, 0x1000, 0xff )
434
435   ROM_SYSTEM_BIOS( 1, "default", "COMX BASIC V1.00 with Expansion Box" )
434   ROM_SYSTEM_BIOS( 1, "basic100e", "COMX BASIC V1.00 with Expansion Box" )
436435   ROMX_LOAD( "comx_10.u21",         0x0000, 0x4000, CRC(68d0db2d) SHA1(062328361629019ceed9375afac18e2b7849ce47), ROM_BIOS(2) )
437436   ROMX_LOAD( "expansion.e5",         0xe000, 0x1000, CRC(52cb44e2) SHA1(3f9a3d9940b36d4fee5eca9f1359c99d7ed545b9), ROM_BIOS(2) )
438   ROM_COPY( "U3", 0xe000, 0x1000, 0x0800 )
439
440437   ROM_SYSTEM_BIOS( 2, "fmbasic31", "F&M BASIC V3.1 with Expansion Box" )
441438   ROMX_LOAD( "comx_10.u21",         0x0000, 0x4000, CRC(68d0db2d) SHA1(062328361629019ceed9375afac18e2b7849ce47), ROM_BIOS(3) )
442439   ROMX_LOAD( "f&m.expansion.3.1.e5",   0xe000, 0x1000, CRC(818ca2ef) SHA1(ea000097622e7fd472d53e7899e3c83773433045), ROM_BIOS(3) )
443   ROM_COPY( "U3", 0xe000, 0x1000, 0x0800 )
444
445440   ROM_SYSTEM_BIOS( 3, "basic101", "COMX BASIC V1.01" )
446441   ROMX_LOAD( "comx_11.u21",         0x0000, 0x4000, CRC(609d89cd) SHA1(799646810510d8236fbfafaff7a73d5170990f16), ROM_BIOS(4) )
447442
r3031r3032
453448   ROM_LOAD( "thermal.bin",         0x8000, 0x1000, CRC(41a72ba8) SHA1(3a8760c78bd8c7bec2dbf26657b930c9a6814803) )
454449   ROM_LOAD( "80.column.card.u3",      0xc000, 0x0800, NO_DUMP )
455450
456   ROM_REGION( 0x10000, "gfx1", 0 ) // MC6845 font
451   ROM_REGION( 0x10000, "chargen", 0 ) // MC6845 font
457452   ROM_LOAD( "mc6845.font.u",         0x0000, 0x0800, NO_DUMP )
458453ROM_END
459454
docs/messnew.txt
r3031r3032
1111- [AMIGA] Fixed crash in CDTV that when accessing the keyboard.
1212  [Roberto Zandona']
1313
14- [COMX35] Fixed to boot again. (bug #1629)  [Curt Coder]
15
1416- [DRAGON] Fixed crash that could occur when accessing the printer.  (bug
1517  #1643)  [Nate Woods]
1618
r3031r3032
2325  by Kevtris.  [Wilbert Pol]
2426
2527
26
2728User Interface Changes:
2829-----------------------
2930- [Windows] Ensured that the "Debugger..." menu item is always present when

Previous 15994 Revisions Next


© 1998-2018 The MESS Team