Previous 15994 Revisions Next

r3743 Saturday 6th December, 2008 at 17:15:05 UTC by Miodrag Milanović
[VECTOR06] Added floppy support
[src/mess/drivers]vector06.c
[src/mess/includes]vector06.h
[src/mess/machine]vector06.c
[src/mess/video]vector06.c

src/mess/video/vector06.c
r3742r3743
1717VIDEO_UPDATE( vector06 )
1818{
1919    UINT8 code1,code2,code3,code4;
20    UINT8 col;//,col1,col2;
21   int y, x, b;
20    UINT8 col;
21   int y, x, b,draw_y;
2222
2323   int width = (vector_video_mode==0x00) ? 256 : 512;     
2424   rectangle screen_area = {0,width+64-1,0,256+64-1};
r3742r3743
3030   {
3131      for (y = 0; y < 256; y++)
3232      {
33         // port A form 8255 also used as scroll
34         draw_y = ((255-y-vector06_keyboard_mask) & 0xff) +32;
3335         code1 = mess_ram[0x8000 + x*256 + y];
3436         code2 = mess_ram[0xa000 + x*256 + y];
3537         code3 = mess_ram[0xc000 + x*256 + y];
r3742r3743
3840         {
3941            col = ((code1 >> b) & 0x01) * 8 + ((code2 >> b) & 0x01) * 4 + ((code3 >> b) & 0x01)* 2+ ((code4 >> b) & 0x01);
4042            if (vector_video_mode==0x00) {
41               *BITMAP_ADDR16(bitmap, 255-y+32, x*8+(7-b)+32) =  col;
43               *BITMAP_ADDR16(bitmap, draw_y, x*8+(7-b)+32) =  col;
4244            } else {
43               *BITMAP_ADDR16(bitmap, 255-y+32, x*16+(7-b)*2+1+32) =  ((code2 >> b) & 0x01) * 2;
44               *BITMAP_ADDR16(bitmap, 255-y+32, x*16+(7-b)*2+32)   =  ((code3 >> b) & 0x01) * 2;
45               *BITMAP_ADDR16(bitmap, draw_y, x*16+(7-b)*2+1+32) =  ((code2 >> b) & 0x01) * 2;
46               *BITMAP_ADDR16(bitmap, draw_y, x*16+(7-b)*2+32)   =  ((code3 >> b) & 0x01) * 2;
4547            }
4648         }
4749      }
src/mess/includes/vector06.h
r3742r3743
1515extern const ppi8255_interface vector06_ppi8255_2_interface;
1616
1717extern DRIVER_INIT( vector06 );
18extern MACHINE_START( vector06 );
1819extern MACHINE_RESET( vector06 );
1920
2021extern INTERRUPT_GEN( vector06_interrupt );
r3742r3743
2526extern WRITE8_HANDLER(vector_8255_2_w);
2627
2728extern WRITE8_HANDLER(vector06_color_set);
29extern WRITE8_HANDLER(vector_disc_w);
30
31extern UINT8 vector06_keyboard_mask;
2832extern UINT8 vector_color_index;
2933extern UINT8 vector_video_mode;
34
35extern DEVICE_IMAGE_LOAD( vector_floppy );
36
3037/*----------- defined in video/vector06.c -----------*/
3138
3239extern PALETTE_INIT( vector06 );
src/mess/machine/vector06.c
r3742r3743
99
1010#include "driver.h"
1111#include "cpu/i8085/i8085.h"
12#include "machine/8255ppi.h"
13#include "machine/wd17xx.h"
1214#include "devices/cassette.h"
13#include "machine/8255ppi.h"
15#include "devices/basicdsk.h"
1416#include "includes/vector06.h"
1517
16static int vector06_keyboard_mask;
18UINT8 vector06_keyboard_mask;
1719UINT8 vector_color_index;
1820UINT8 vector_video_mode;
1921
r3742r3743
167169   }
168170}
169171
172WRITE8_HANDLER(vector_disc_w)
173{
174   wd17xx_set_side (((data & 4) >> 2) ^ 1);
175    wd17xx_set_drive(data & 1);               
176}
177
178DEVICE_IMAGE_LOAD( vector_floppy )
179{
180   int size;
181
182   if (! image_has_been_created(image))
183      {
184      size = image_length(image);
185
186      switch (size)
187         {
188         case 820*1024:
189            break;
190         default:
191            return INIT_FAIL;
192         }
193      }
194   else
195      return INIT_FAIL;
196
197   if (device_load_basicdsk_floppy (image) != INIT_PASS)
198      return INIT_FAIL;
199
200   basicdsk_set_geometry (image, 82, 2, 5, 1024, 1, 0, FALSE);   
201   return INIT_PASS;
202}
203
204
205MACHINE_START( vector06 )
206{
207   wd17xx_init(machine, WD_TYPE_1793, NULL , NULL);
208   wd17xx_set_density (DEN_FM_HI);
209}
210
170211MACHINE_RESET( vector06 )
171212{
172213   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
r3742r3743
185226   vector06_keyboard_mask = 0;
186227   vector_color_index = 0;
187228   vector_video_mode = 0;
188   timer_pulse(ATTOTIME_IN_HZ(10), NULL, 0, reset_check_callback);
189
229   timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, reset_check_callback);
230   
231   wd17xx_reset(machine);
232   wd17xx_set_pause_time(0);
190233}
src/mess/drivers/vector06.c
r3742r3743
1010#include "driver.h"
1111#include "cpu/i8085/i8085.h"
1212#include "machine/8255ppi.h"
13#include "machine/wd17xx.h"
1314#include "devices/cassette.h"
1415#include "devices/cartslot.h"
16#include "devices/basicdsk.h"
1517#include "includes/vector06.h"
1618
1719/* Address maps */
r3742r3743
2628   AM_RANGE( 0x00, 0x03) AM_READWRITE(vector_8255_1_r, vector_8255_1_w )
2729   AM_RANGE( 0x04, 0x07) AM_READWRITE(vector_8255_2_r, vector_8255_2_w )
2830   AM_RANGE( 0x0C, 0x0C) AM_WRITE ( vector06_color_set )
31   AM_RANGE( 0x18, 0x18) AM_READWRITE(wd17xx_data_r,wd17xx_data_w)       
32   AM_RANGE( 0x19, 0x19) AM_READWRITE(wd17xx_sector_r,wd17xx_sector_w)
33   AM_RANGE( 0x1A, 0x1A) AM_READWRITE(wd17xx_track_r,wd17xx_track_w)
34     AM_RANGE( 0x1B, 0x1B) AM_READWRITE(wd17xx_status_r,wd17xx_command_w)
35     AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector_disc_w)
2936ADDRESS_MAP_END
3037
3138/* Input ports */
r3742r3743
125132   CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED
126133};
127134
135static void vector_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
136{
137   /* floppy */
138   switch(state)
139   {
140      /* --- the following bits of info are returned as 64-bit signed integers --- */
141      case MESS_DEVINFO_INT_COUNT:               info->i = 2; break;
128142
143      /* --- the following bits of info are returned as pointers to data or functions --- */
144      case MESS_DEVINFO_PTR_LOAD:                  info->load = device_load_vector_floppy; break;
145
146      /* --- the following bits of info are returned as NULL-terminated strings --- */
147      case MESS_DEVINFO_STR_FILE_EXTENSIONS:         strcpy(info->s = device_temp_str(), "fdd"); break;
148
149      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
150   }   
151}
152
153
129154/* Machine driver */
130155static MACHINE_DRIVER_START( vector06 )
131156  /* basic machine hardware */
r3742r3743
135160     MDRV_CPU_IO_MAP(vector06_io, 0)
136161     MDRV_CPU_VBLANK_INT("main", vector06_interrupt)
137162
163   MDRV_MACHINE_START( vector06 )
138164     MDRV_MACHINE_RESET( vector06 )
139165
140166   MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
r3742r3743
186212static SYSTEM_CONFIG_START(vector06)
187213    CONFIG_RAM_DEFAULT(64 * 1024)
188214    CONFIG_DEVICE(cartslot_device_getinfo)
215    CONFIG_DEVICE(vector_floppy_getinfo);
189216SYSTEM_CONFIG_END
190217
191218/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team