src/mess/video/orion.c
| r2325 | r2326 | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | extern UINT8 orion128_video_mode; |
| 18 | | extern UINT8 orion128_video_page; |
| 18 | extern UINT8 orion128_video_page; |
| 19 | extern UINT8 orion128_video_width; |
| 19 | 20 | |
| 20 | 21 | VIDEO_UPDATE( orion128 ) |
| 21 | 22 | { |
| r2325 | r2326 | |
| 24 | 25 | |
| 25 | 26 | int part1addr = (3-orion128_video_page) * 0x4000; |
| 26 | 27 | int part2addr = (3-orion128_video_page) * 0x4000 + 0x10000; |
| 27 | | for (x = 0; x < 48; x++) |
| 28 | for (x = 0; x < orion128_video_width; x++) |
| 28 | 29 | { |
| 29 | 30 | for (y = 0; y < 256; y++) |
| 30 | 31 | { |
| r2325 | r2326 | |
| 75 | 76 | palette_set_colors(machine, 0, orion128_palette, ARRAY_LENGTH(orion128_palette)); |
| 76 | 77 | } |
| 77 | 78 | |
| 79 | |
src/mess/machine/orion.c
| r2325 | r2326 | |
| 14 | 14 | #include "machine/8255ppi.h" |
| 15 | 15 | #include "machine/wd17xx.h" |
| 16 | 16 | |
| 17 | #define SCREEN_WIDTH_384 48 |
| 18 | #define SCREEN_WIDTH_480 60 |
| 19 | #define SCREEN_WIDTH_512 64 |
| 20 | |
| 17 | 21 | UINT8 romdisk_lsb,romdisk_msb; |
| 18 | 22 | UINT8 orion_keyboard_line; |
| 19 | 23 | UINT8 orion128_video_mode; |
| 20 | 24 | UINT8 orion128_video_page; |
| 21 | 25 | UINT8 orion128_memory_page; |
| 22 | 26 | |
| 27 | UINT8 orion128_video_width; |
| 28 | |
| 23 | 29 | UINT8 orionz80_memory_page; |
| 24 | 30 | UINT8 orionz80_dispatcher; |
| 25 | 31 | |
| r2325 | r2326 | |
| 111 | 117 | ppi8255_0_w(machine, offset & 3, data); |
| 112 | 118 | } |
| 113 | 119 | |
| 120 | void orion_set_video_mode(running_machine *machine, int width) { |
| 121 | rectangle visarea; |
| 122 | |
| 123 | visarea.min_x = 0; |
| 124 | visarea.min_y = 0; |
| 125 | visarea.max_x = width-1; |
| 126 | visarea.max_y = 255; |
| 127 | video_screen_configure(machine->primary_screen, width, 256, &visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds); |
| 128 | } |
| 129 | |
| 114 | 130 | WRITE8_HANDLER ( orion128_video_mode_w ) |
| 115 | | { |
| 116 | | orion128_video_mode = data; |
| 131 | { |
| 132 | orion128_video_mode = data & 7; |
| 117 | 133 | } |
| 118 | 134 | |
| 119 | 135 | WRITE8_HANDLER ( orion128_video_page_w ) |
| 120 | 136 | { |
| 121 | | //logerror("orion128_video_page_w %02x\n",data); |
| 137 | if ((data & 0x80)==0x80) { |
| 138 | if (orion128_video_width != SCREEN_WIDTH_480) { |
| 139 | orion128_video_width = SCREEN_WIDTH_480; |
| 140 | orion_set_video_mode(machine,480); |
| 141 | } |
| 142 | } else { |
| 143 | if (orion128_video_width != SCREEN_WIDTH_384) { |
| 144 | orion128_video_width = SCREEN_WIDTH_384; |
| 145 | orion_set_video_mode(machine,384); |
| 146 | } |
| 147 | } |
| 122 | 148 | orion128_video_page = data & 3; |
| 123 | 149 | } |
| 124 | 150 | |
| r2325 | r2326 | |
| 141 | 167 | orion128_memory_page = -1; |
| 142 | 168 | memory_set_bankptr(1, memory_region(REGION_CPU1) + 0xf800); |
| 143 | 169 | memory_set_bankptr(2, mess_ram + 0xf000); |
| 170 | orion128_video_width = SCREEN_WIDTH_384; |
| 171 | orion_set_video_mode(machine,384); |
| 144 | 172 | } |
| 145 | 173 | |
| 146 | 174 | |
| r2325 | r2326 | |
| 211 | 239 | |
| 212 | 240 | DRIVER_INIT( orionz80 ) |
| 213 | 241 | { |
| 214 | | memset(mess_ram,0,512*1024); |
| 242 | memset(mess_ram,0,512*1024); |
| 215 | 243 | } |
| 216 | 244 | |
| 217 | 245 | |
| r2325 | r2326 | |
| 268 | 296 | |
| 269 | 297 | WRITE8_HANDLER ( orionz80_memory_page_w ) |
| 270 | 298 | { |
| 271 | | orionz80_memory_page = data; |
| 299 | orionz80_memory_page = data & 7; |
| 272 | 300 | orionz80_switch_bank(); |
| 273 | 301 | } |
| 274 | 302 | |
| r2325 | r2326 | |
| 315 | 343 | orion128_video_mode = 0; |
| 316 | 344 | orionz80_memory_page = 0; |
| 317 | 345 | orionz80_dispatcher = 0; |
| 346 | orion128_video_width = SCREEN_WIDTH_384; |
| 347 | orion_set_video_mode(machine,384); |
| 318 | 348 | } |
| 319 | 349 | |