Previous 15994 Revisions Next

r10795 Monday 14th March, 2011 at 01:13:53 UTC by Phill Harvey-Smith
QL -
Added support for formatting disks, unfortunatly due to the way that
MESS implements disk images interacting with the way the QL detects
double sided disks this is currently only single sided.

Einstein -
Fixed 80 column mode, added dump of 80 column rom and fixed up
emulation based on circuit traces from a real TK02 card.
80 Column mode is now usable.
[docs]messnew.txt
[src/mess/drivers]einstein.c ql.c
[src/mess/includes]einstein.h ql.h
[src/mess/machine]wd17xx.c

src/mess/machine/wd17xx.c
r10794r10795
129129    - Copied multi-sector write code from r7263, for some reason this had been
130130      silently removed, but is required for the rmnimbus driver.
131131
132   2011-Mar-08 Phill Harvey-Smith
133   - Triggering intrq now clears the DRQ bit in the status as well as the busy bit.
134     Execution of the READ_DAM command now correctly sets w->command.
135
132136    TODO:
133137        - What happens if a track is read that doesn't have any id's on it?
134138         (e.g. unformatted disc)
r10794r10795
467471   wd1770_state *w = get_safe_token(device);
468472
469473   w->status &= ~STA_2_BUSY;
474   w->status &= ~STA_2_DRQ;
470475
471476   w->intrq = ASSERT_LINE;
472477   devcb_call_write_line(&w->out_intrq_func, w->intrq);
r10794r10795
16301635            logerror("wd17xx_command_w $%02X READ_DAM\n", data);
16311636
16321637         w->command_type = TYPE_III;
1638         w->command = data & ~FDC_MASK_TYPE_III;
16331639         w->status &= ~STA_2_LOST_DAT;
16341640         w->status |= STA_2_BUSY;
16351641
src/mess/includes/ql.h
r10794r10795
5858#define SANDY_MOTOR_MASK      0x08
5959#define SANDY_SIDE_SHIFT      0
6060#define SANDY_SIDE_MASK         (1 << SANDY_SIDE_SHIFT)
61#define SANDY_DDEN_SHIFT      4
62#define SANDY_DDEN_MASK         (1 << SANDY_DDEN_SHIFT)
6163#define SANDY_PRINTER_STROBE   0x20
6264#define SANDY_PRINTER_INTMASK   0x40
6365
r10794r10795
130132   
131133   int      disk_type;
132134   int      disk_io_base;
135   UINT8   disk_io_byte;
133136   UINT8   printer_char;
134137};
135138
src/mess/includes/einstein.h
r10794r10795
3535   device_t *mc6845;
3636   screen_device *crtc_screen;
3737   UINT8 *crtc_ram;
38   UINT8   de;
3839};
3940
4041/***************************************************************************
src/mess/drivers/ql.c
r10794r10795
8888#include "video/zx8301.h"
8989#include "includes/ql.h"
9090#include "machine/wd17xx.h"
91#include "debugger.h"
9192
93#define LOG_DISK_WRITE   0
94#define LOG_DISK_READ   0
95
9296//**************************************************************************
9397//  INTELLIGENT PERIPHERAL CONTROLLER
9498//**************************************************************************
r10794r10795
259263READ8_MEMBER( ql_state::disk_io_r )
260264{
261265   UINT8   result = 0;
262   
263   //logerror("%s DiskIO:Read of %08X\n",machine->describe_context(),disk_io_base+offset);
266
267   if(LOG_DISK_READ)
268      logerror("%s DiskIO:Read of %08X\n",machine->describe_context(),disk_io_base+offset);
264269     
265270   switch (offset)
266271   {
r10794r10795
276281
277282WRITE8_MEMBER( ql_state::disk_io_w )
278283{
279   //logerror("%s DiskIO:Write %02X to %08X\n",machine->describe_context(),data,disk_io_base+offset);
284   if(LOG_DISK_WRITE)
285      logerror("%s DiskIO:Write %02X to %08X\n",machine->describe_context(),data,disk_io_base+offset);
280286
281287   switch (offset)
282288   {
r10794r10795
335341{
336342   //logerror("sandy_set_control:%02X\n",data);
337343
344   disk_io_byte=data;
345
338346   if(data & SANDY_DRIVE0_MASK)
339347      wd17xx_set_drive(m_fdc,0);
340348     
r10794r10795
342350      wd17xx_set_drive(m_fdc,1);   
343351
344352   wd17xx_set_side(m_fdc,(data & SANDY_SIDE_MASK) >> SANDY_SIDE_SHIFT);
353   if (data & SANDY_SIDE_MASK)
354   {
355      logerror("Accessing side 1\n");
356   }
345357
346358   if (printer_is_ready(m_printer))
347359   {
r10794r10795
353365   }
354366}   
355367
356static READ_LINE_DEVICE_HANDLER( trump_card_dden_r )
368static READ_LINE_DEVICE_HANDLER( disk_io_dden_r )
357369{
358   //logerror("DiskIO:dden_read\n");
370   ql_state *state = device->machine->driver_data<ql_state>();
359371   
360   return 1;
372   if(state->disk_type==DISK_TYPE_SANDY)
373      return ((state->disk_io_byte & SANDY_DDEN_MASK) >> SANDY_DDEN_SHIFT);
374   else
375      return 0;
361376}
362377
363static WRITE_LINE_DEVICE_HANDLER( trump_card_intrq_w )
378static WRITE_LINE_DEVICE_HANDLER( disk_io_intrq_w )
364379{
365380   //logerror("DiskIO:intrq = %d\n",state);
366381}
367382
368static WRITE_LINE_DEVICE_HANDLER( trump_card_drq_w )
383static WRITE_LINE_DEVICE_HANDLER( disk_io_drq_w )
369384{
370385   //logerror("DiskIO:drq = %d\n",state);
371386}
r10794r10795
381396
382397static ADDRESS_MAP_START( ql_mem, ADDRESS_SPACE_PROGRAM, 8, ql_state )
383398   AM_RANGE(0x000000, 0x00bfff) AM_ROM   // 48K System ROM
384   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_WRITENOP //AM_READ( cart_rom_r ) // 16K Cartridge ROM
385   AM_RANGE(0x010000, 0x017fff) AM_ROM AM_WRITENOP //AM_READ( trump_card_rom_r ) // Trump card ROM
399   AM_RANGE(0x00c000, 0x00ffff) AM_ROM AM_WRITENOP                   // 16K Cartridge ROM
400   AM_RANGE(0x010000, 0x017fff) AM_UNMAP                            // Trump card ROM is mapped in here
386401   AM_RANGE(0x018000, 0x018003) AM_DEVREAD(ZX8302_TAG, zx8302_device, rtc_r)
387402   AM_RANGE(0x018000, 0x018001) AM_DEVWRITE(ZX8302_TAG, zx8302_device, rtc_w)
388403   AM_RANGE(0x018002, 0x018002) AM_DEVWRITE(ZX8302_TAG, zx8302_device, control_w)
r10794r10795
392407   AM_RANGE(0x018022, 0x018022) AM_DEVREADWRITE(ZX8302_TAG, zx8302_device, mdv_track_r, data_w)
393408   AM_RANGE(0x018023, 0x018023) AM_DEVREAD(ZX8302_TAG, zx8302_device, mdv_track_r) AM_WRITENOP
394409   AM_RANGE(0x018063, 0x018063) AM_DEVWRITE(ZX8301_TAG, zx8301_device, control_w)
395   AM_RANGE(0x01c000, 0x01ffff) AM_UNMAP //AM_READ(disk_io_r) AM_WRITE(disk_io_w) // 16K Expansion I/O
410   AM_RANGE(0x01c000, 0x01ffff) AM_UNMAP                            // 16K Expansion I/O
396411   AM_RANGE(0x020000, 0x03ffff) AM_DEVREADWRITE(ZX8301_TAG, zx8301_device, data_r, data_w)
397412   AM_RANGE(0x040000, 0x0fffff) AM_RAM
398413ADDRESS_MAP_END
r10794r10795
865880
866881wd17xx_interface ql_wd17xx_interface =
867882{
868   DEVCB_LINE(trump_card_dden_r),
869   DEVCB_LINE(trump_card_intrq_w),
870   DEVCB_LINE(trump_card_drq_w),
883   DEVCB_LINE(disk_io_dden_r),
884   DEVCB_LINE(disk_io_intrq_w),
885   DEVCB_LINE(disk_io_drq_w),
871886   {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
872887};
873888
r10794r10795
917932   state_save_register_global(machine, m_comdata);
918933   state_save_register_global(machine, m_baudx4);
919934   state_save_register_global(machine, printer_char);
935   state_save_register_global(machine, disk_io_byte);
920936}
921937
922938void ql_state::machine_reset()
r10794r10795
927943   logerror("disktype=%d\n",disk_type);
928944
929945   printer_char=0;
946   disk_io_byte=0;
930947
931948   logerror("Configuring RAM\n");
932949   // configure RAM
src/mess/drivers/einstein.c
r10794r10795
4444    Kevin Thacker [MESS driver]
4545
4646
47   2011-Mar-14, Phill Harvey-Smith.
48      Having traced out the circuit of the TK02 80 coumn card, I have changed the
49      emulation to match what the hardware does, the emulation was mostly correct,
50      just some minor issues with the addressing of the VRAM, and bit 0 of the
51      status register is the latched output of the 6845 DE, and not vblank.
52     
53      Also added defines to stop the log being flooded with keyboard messages :)
4754
4855 ******************************************************************************/
4956
r10794r10795
6471#include "machine/ram.h"
6572#include "includes/einstein.h"
6673
74#define VERBOSE_KEYBOARD   0
75#define VERBOSE_DISK      0
76
6777/***************************************************************************
6878    80 COLUMN DEVICE
6979***************************************************************************/
r10794r10795
8595}
8696
8797/* TODO: Verify implementation */
98/* From traces of the TK02 board character ROM is addressed by the 6845 as follows
99   bit 0..2    ra0..ra2
100   bit 3..10   data 0..7 from VRAM
101   bit 11      ra3
102   bit 12      jumper M004, this could be used to select two different character
103            sets.
104*/
88105static MC6845_UPDATE_ROW( einstein_6845_update_row )
89106{
90107   einstein_state *einstein = device->machine->driver_data<einstein_state>();
r10794r10795
95112   for (i = 0, x = 0; i < x_count; i++, x += 8)
96113   {
97114      char_code = einstein->crtc_ram[(ma + i) & 0x07ff];
98      data_byte = data[(char_code << 3) + ra];
115      data_byte = data[(char_code << 3) + (ra & 0x07) + ((ra & 0x08) << 8)];
99116
100117      *BITMAP_ADDR16(bitmap, y, x + 0) = TMS9928A_PALETTE_SIZE + BIT(data_byte, 7);
101118      *BITMAP_ADDR16(bitmap, y, x + 1) = TMS9928A_PALETTE_SIZE + BIT(data_byte, 6);
r10794r10795
108125   }
109126}
110127
111/* bit 0 - vsync state?
112 * bit 1 - 0 = 40 column mode (color monitor), 1 = 80 column mode (b/w monitor)
113 * bit 2 - 0 = 50Hz, 1 = 60Hz
128static WRITE_LINE_DEVICE_HANDLER( einstein_6845_de_changed )
129{
130   einstein_state *einstein = device->machine->driver_data<einstein_state>();
131   einstein->de=state;
132}
133
134/* bit 0 - latched display enabled (DE) from 6845
135 * bit 1 - Jumper M003 0 = 40 column mode (color monitor), 1 = 80 column mode (b/w monitor)
136 * bit 2 - Jumper M002 0 = 50Hz, 1 = 60Hz
137 * bit 3 - Jumper M001 0 = ???, 1=??? perminently wired high on both the boards I have seen - PHS.
114138 */
115139static READ8_HANDLER( einstein_80col_state_r )
116140{
117141   einstein_state *einstein = space->machine->driver_data<einstein_state>();
118142   UINT8 result = 0;
119143
120   result |= einstein->crtc_screen->vblank() ? 1 : 0;
144   result |= einstein->de;
121145   result |= input_port_read(space->machine, "80column_dips") & 0x06;
122146
123   logerror("%s: einstein_80col_state_r %02x\n", space->machine->describe_context(), result);
124
125147   return result;
126148}
127149
r10794r10795
185207{
186208   einstein_state *einstein = space->machine->driver_data<einstein_state>();
187209
188   logerror("einstein_keyboard_line_write: %02x\n", data);
210   if (VERBOSE_KEYBOARD)
211      logerror("einstein_keyboard_line_write: %02x\n", data);
189212
190213   einstein->keyboard_line = data;
191214
r10794r10795
200223   /* re-scan the keyboard */
201224   einstein_scan_keyboard(space->machine);
202225
203   logerror("einstein_keyboard_data_read: %02x\n", einstein->keyboard_data);
226   if (VERBOSE_KEYBOARD)
227      logerror("einstein_keyboard_data_read: %02x\n", einstein->keyboard_data);
204228
205229   return einstein->keyboard_data;
206230}
r10794r10795
212236
213237static WRITE8_DEVICE_HANDLER( einstein_drsel_w )
214238{
215   logerror("%s: einstein_drsel_w %02x\n", device->machine->describe_context(), data);
239   if(VERBOSE_DISK)
240      logerror("%s: einstein_drsel_w %02x\n", device->machine->describe_context(), data);
216241
217242   /* bit 0 to 3 select the drive */
218243   if (BIT(data, 0)) wd17xx_set_drive(device, 0);
r10794r10795
306331   /* bit 5 to 7: graph, control and shift key */
307332   data |= input_port_read(space->machine, "EXTRA");
308333
309   logerror("%s: einstein_kybintmsk_r %02x\n", space->machine->describe_context(), data);
334   if(VERBOSE_KEYBOARD)
335      logerror("%s: einstein_kybintmsk_r %02x\n", space->machine->describe_context(), data);
310336
311337   return data;
312338}
r10794r10795
707733   NULL,
708734   einstein_6845_update_row,
709735   NULL,
736   DEVCB_LINE(einstein_6845_de_changed),
710737   DEVCB_NULL,
711738   DEVCB_NULL,
712739   DEVCB_NULL,
713   DEVCB_NULL,
714740   NULL
715741};
716742
docs/messnew.txt
r10794r10795
44-----------------------------
55- Victor Wondermega M2 (not working) [Justin Kerk]
66- Ferguson Big Board [Miodrag Milanovic]
7- Sanyo MBC-550, MBC-555 (boots but no keyboard) [Phill Harvey-Smith]
7- Sanyo MBC-550, MBC-555 (boots but partial keyboard) [Phill Harvey-Smith]
88- Fujitsu FM-Towns II UX (not working) [bernhardh, Anna Wu, Barry Rodewald]
99- Fujitsu FM-Towns II HR (not working) [bernhardh, Anna Wu, Barry Rodewald]
1010- Mikrosha-86RK [Miodrag Milanovic]
r10794r10795
5555
5656- [BBC] Made the SAA505x implementation a device.  [Atari Ace]
5757
58- [Einstein] Fixed addressing of character ROM for 80 column mode, added
59  dump of 80 column rom, fixed bit 0 of status register to reflect 6845
60  DE line. 80 Column interface is now usable. [Phill Harvey-Smith]
61
5862- [GBA] Fixed EEPROM detection for "Banjo-Kazooie" and "Custom Robo GX".
5963  [Tim Schuerewegen]
6064
r10794r10795
9599- [PV1000] 4 new cartridge dumps for the software list.  [anondumper]
96100
97101- [QL]  Added support for Miracle Systems Trump Card disk and memory
98        interface [Phill Harvey-Smith]
102        interface
103   Added support for Sandy SuperDisk disk interface
104   Fixed up WD177x so disks can be formatted (single sided only)
105        [Phill Harvey-Smith]
99106
100107- [SNES] uPD96050 DSP (aka Seta ST-010) is now emulated instead of
101108         simulated. [R. Belmont, byuu, Dr. Decapitator]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team