src/mess/video/vector06.c
| r3742 | r3743 | |
| 17 | 17 | VIDEO_UPDATE( vector06 ) |
| 18 | 18 | { |
| 19 | 19 | 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; |
| 22 | 22 | |
| 23 | 23 | int width = (vector_video_mode==0x00) ? 256 : 512; |
| 24 | 24 | rectangle screen_area = {0,width+64-1,0,256+64-1}; |
| r3742 | r3743 | |
| 30 | 30 | { |
| 31 | 31 | for (y = 0; y < 256; y++) |
| 32 | 32 | { |
| 33 | // port A form 8255 also used as scroll |
| 34 | draw_y = ((255-y-vector06_keyboard_mask) & 0xff) +32; |
| 33 | 35 | code1 = mess_ram[0x8000 + x*256 + y]; |
| 34 | 36 | code2 = mess_ram[0xa000 + x*256 + y]; |
| 35 | 37 | code3 = mess_ram[0xc000 + x*256 + y]; |
| r3742 | r3743 | |
| 38 | 40 | { |
| 39 | 41 | col = ((code1 >> b) & 0x01) * 8 + ((code2 >> b) & 0x01) * 4 + ((code3 >> b) & 0x01)* 2+ ((code4 >> b) & 0x01); |
| 40 | 42 | 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; |
| 42 | 44 | } 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; |
| 45 | 47 | } |
| 46 | 48 | } |
| 47 | 49 | } |
src/mess/includes/vector06.h
| r3742 | r3743 | |
| 15 | 15 | extern const ppi8255_interface vector06_ppi8255_2_interface; |
| 16 | 16 | |
| 17 | 17 | extern DRIVER_INIT( vector06 ); |
| 18 | extern MACHINE_START( vector06 ); |
| 18 | 19 | extern MACHINE_RESET( vector06 ); |
| 19 | 20 | |
| 20 | 21 | extern INTERRUPT_GEN( vector06_interrupt ); |
| r3742 | r3743 | |
| 25 | 26 | extern WRITE8_HANDLER(vector_8255_2_w); |
| 26 | 27 | |
| 27 | 28 | extern WRITE8_HANDLER(vector06_color_set); |
| 29 | extern WRITE8_HANDLER(vector_disc_w); |
| 30 | |
| 31 | extern UINT8 vector06_keyboard_mask; |
| 28 | 32 | extern UINT8 vector_color_index; |
| 29 | 33 | extern UINT8 vector_video_mode; |
| 34 | |
| 35 | extern DEVICE_IMAGE_LOAD( vector_floppy ); |
| 36 | |
| 30 | 37 | /*----------- defined in video/vector06.c -----------*/ |
| 31 | 38 | |
| 32 | 39 | extern PALETTE_INIT( vector06 ); |
src/mess/machine/vector06.c
| r3742 | r3743 | |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "cpu/i8085/i8085.h" |
| 12 | #include "machine/8255ppi.h" |
| 13 | #include "machine/wd17xx.h" |
| 12 | 14 | #include "devices/cassette.h" |
| 13 | | #include "machine/8255ppi.h" |
| 15 | #include "devices/basicdsk.h" |
| 14 | 16 | #include "includes/vector06.h" |
| 15 | 17 | |
| 16 | | static int vector06_keyboard_mask; |
| 18 | UINT8 vector06_keyboard_mask; |
| 17 | 19 | UINT8 vector_color_index; |
| 18 | 20 | UINT8 vector_video_mode; |
| 19 | 21 | |
| r3742 | r3743 | |
| 167 | 169 | } |
| 168 | 170 | } |
| 169 | 171 | |
| 172 | WRITE8_HANDLER(vector_disc_w) |
| 173 | { |
| 174 | wd17xx_set_side (((data & 4) >> 2) ^ 1); |
| 175 | wd17xx_set_drive(data & 1); |
| 176 | } |
| 177 | |
| 178 | DEVICE_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 | |
| 205 | MACHINE_START( vector06 ) |
| 206 | { |
| 207 | wd17xx_init(machine, WD_TYPE_1793, NULL , NULL); |
| 208 | wd17xx_set_density (DEN_FM_HI); |
| 209 | } |
| 210 | |
| 170 | 211 | MACHINE_RESET( vector06 ) |
| 171 | 212 | { |
| 172 | 213 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| r3742 | r3743 | |
| 185 | 226 | vector06_keyboard_mask = 0; |
| 186 | 227 | vector_color_index = 0; |
| 187 | 228 | 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); |
| 190 | 233 | } |
src/mess/drivers/vector06.c
| r3742 | r3743 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "cpu/i8085/i8085.h" |
| 12 | 12 | #include "machine/8255ppi.h" |
| 13 | #include "machine/wd17xx.h" |
| 13 | 14 | #include "devices/cassette.h" |
| 14 | 15 | #include "devices/cartslot.h" |
| 16 | #include "devices/basicdsk.h" |
| 15 | 17 | #include "includes/vector06.h" |
| 16 | 18 | |
| 17 | 19 | /* Address maps */ |
| r3742 | r3743 | |
| 26 | 28 | AM_RANGE( 0x00, 0x03) AM_READWRITE(vector_8255_1_r, vector_8255_1_w ) |
| 27 | 29 | AM_RANGE( 0x04, 0x07) AM_READWRITE(vector_8255_2_r, vector_8255_2_w ) |
| 28 | 30 | 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) |
| 29 | 36 | ADDRESS_MAP_END |
| 30 | 37 | |
| 31 | 38 | /* Input ports */ |
| r3742 | r3743 | |
| 125 | 132 | CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED |
| 126 | 133 | }; |
| 127 | 134 | |
| 135 | static 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; |
| 128 | 142 | |
| 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 | |
| 129 | 154 | /* Machine driver */ |
| 130 | 155 | static MACHINE_DRIVER_START( vector06 ) |
| 131 | 156 | /* basic machine hardware */ |
| r3742 | r3743 | |
| 135 | 160 | MDRV_CPU_IO_MAP(vector06_io, 0) |
| 136 | 161 | MDRV_CPU_VBLANK_INT("main", vector06_interrupt) |
| 137 | 162 | |
| 163 | MDRV_MACHINE_START( vector06 ) |
| 138 | 164 | MDRV_MACHINE_RESET( vector06 ) |
| 139 | 165 | |
| 140 | 166 | MDRV_DEVICE_ADD( "ppi8255", PPI8255 ) |
| r3742 | r3743 | |
| 186 | 212 | static SYSTEM_CONFIG_START(vector06) |
| 187 | 213 | CONFIG_RAM_DEFAULT(64 * 1024) |
| 188 | 214 | CONFIG_DEVICE(cartslot_device_getinfo) |
| 215 | CONFIG_DEVICE(vector_floppy_getinfo); |
| 189 | 216 | SYSTEM_CONFIG_END |
| 190 | 217 | |
| 191 | 218 | /* Driver */ |