src/mess/video/vdc.c
| r904 | r905 | |
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "video/vdc.h" |
| 3 | 3 | |
| 4 | | /* Our VDP context */ |
| 4 | /* todo: replace this with the PAIR structure from 'osd_cpu.h' */ |
| 5 | typedef union |
| 6 | { |
| 7 | #ifdef LSB_FIRST |
| 8 | struct { unsigned char l,h; } b; |
| 9 | #else |
| 10 | struct { unsigned char h,l; } b; |
| 11 | #endif |
| 12 | unsigned short int w; |
| 13 | }pair; |
| 5 | 14 | |
| 6 | | VDC vdc; |
| 15 | /* the VDC context */ |
| 7 | 16 | |
| 17 | typedef struct |
| 18 | { |
| 19 | int dvssr_write; /* Set when the DVSSR register has been written to */ |
| 20 | int physical_width; /* Width of the display */ |
| 21 | int physical_height; /* Height of the display */ |
| 22 | pair vce_address; /* Current address in the palette */ |
| 23 | pair vce_data[512]; /* Palette data */ |
| 24 | UINT16 sprite_ram[64*4]; /* Sprite RAM */ |
| 25 | int curline; /* the current scanline we're on */ |
| 26 | UINT8 *vram; |
| 27 | UINT8 inc; |
| 28 | UINT8 vdc_register; |
| 29 | UINT8 vdc_latch; |
| 30 | pair vdc_data[32]; |
| 31 | int status; |
| 32 | mame_bitmap *bmp; |
| 33 | int y_scroll; |
| 34 | int top_blanking; |
| 35 | int top_overscan; |
| 36 | int active_lines; |
| 37 | int bottomfill; |
| 38 | }VDC; |
| 39 | |
| 40 | static VDC vdc; |
| 41 | |
| 8 | 42 | /* Function prototypes */ |
| 9 | 43 | |
| 44 | void draw_black_line(int line); |
| 45 | void draw_overscan_line(int line); |
| 46 | void pce_refresh_line(int bitmap_line, int line); |
| 10 | 47 | void pce_refresh_sprites(int bitmap_line, int line); |
| 11 | 48 | void vdc_do_dma(void); |
| 12 | 49 | |
src/mess/video/vdc.h
| r904 | r905 | |
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "video/generic.h" |
| 4 | 4 | |
| 5 | VIDEO_START( pce ); |
| 6 | VIDEO_UPDATE( pce ); |
| 5 | 7 | WRITE8_HANDLER ( vdc_w ); |
| 6 | 8 | READ8_HANDLER ( vdc_r ); |
| 7 | 9 | READ8_HANDLER ( vce_r ); |
| r904 | r905 | |
| 43 | 45 | /* just to keep things simple... */ |
| 44 | 46 | enum vdc_regs {MAWR = 0, MARR, VxR, reg3, reg4, CR, RCR, BXR, BYR, MWR, HSR, HDR, VPR, VDW, VCR, DCR, SOUR, DESR, LENR, DVSSR }; |
| 45 | 47 | |
| 46 | | /* todo: replace this with the PAIR structure from 'osd_cpu.h' */ |
| 47 | | typedef union |
| 48 | | { |
| 49 | | #ifdef LSB_FIRST |
| 50 | | struct { unsigned char l,h; } b; |
| 51 | | #else |
| 52 | | struct { unsigned char h,l; } b; |
| 53 | | #endif |
| 54 | | unsigned short int w; |
| 55 | | }pair; |
| 56 | | |
| 57 | | void pce_refresh_line(int bitmap_line, int line); |
| 58 | | void vdc_write(int offset, int data); |
| 59 | | int vdc_read(int offset); |
| 60 | | void draw_black_line(int line); |
| 61 | | void draw_overscan_line(int line); |
| 62 | | void vdc_delayed_irq(int unused); |
| 63 | | |
| 64 | | /* the VDC context */ |
| 65 | | |
| 66 | | typedef struct |
| 67 | | { |
| 68 | | int dvssr_write; /* Set when the DVSSR register has been written to */ |
| 69 | | int physical_width; /* Width of the display */ |
| 70 | | int physical_height; /* Height of the display */ |
| 71 | | pair vce_address; /* Current address in the palette */ |
| 72 | | pair vce_data[512]; /* Palette data */ |
| 73 | | UINT16 sprite_ram[64*4]; /* Sprite RAM */ |
| 74 | | int curline; /* the current scanline we're on */ |
| 75 | | UINT8 *vram; |
| 76 | | UINT8 inc; |
| 77 | | UINT8 vdc_register; |
| 78 | | UINT8 vdc_latch; |
| 79 | | pair vdc_data[32]; |
| 80 | | int status; |
| 81 | | mame_bitmap *bmp; |
| 82 | | int y_scroll; |
| 83 | | int top_blanking; |
| 84 | | int top_overscan; |
| 85 | | int active_lines; |
| 86 | | int bottomfill; |
| 87 | | }VDC; |
| 88 | | |
| 89 | | |
| 90 | | /* from video/vdc.c */ |
| 91 | | |
| 92 | | extern VDC vdc; |
| 93 | | extern VIDEO_START( pce ); |
| 94 | | extern VIDEO_UPDATE( pce ); |
| 95 | | extern WRITE8_HANDLER ( vdc_w ); |
| 96 | | extern READ8_HANDLER ( vdc_r ); |
| 97 | | extern WRITE8_HANDLER ( vce_w ); |
| 98 | | extern READ8_HANDLER ( vce_r ); |