src/mess/video/zx.c
| r1807 | r1808 | |
| 46 | 46 | { |
| 47 | 47 | int y, new_x, new_y; |
| 48 | 48 | rectangle r; |
| 49 | | mame_bitmap *bitmap = tmpbitmap; |
| 49 | bitmap_t *bitmap = tmpbitmap; |
| 50 | 50 | |
| 51 | 51 | new_y = video_screen_get_vpos(0); |
| 52 | 52 | new_x = video_screen_get_hpos(0); |
| r1807 | r1808 | |
| 98 | 98 | * scanlines at the top and bottom of the display. |
| 99 | 99 | */ |
| 100 | 100 | rectangle r = machine->screen[0].visarea; |
| 101 | | mame_bitmap *bitmap = tmpbitmap; |
| 101 | bitmap_t *bitmap = tmpbitmap; |
| 102 | 102 | |
| 103 | 103 | r.min_y = r.max_y = video_screen_get_vpos(0); |
| 104 | 104 | fillbitmap(bitmap, machine->pens[1], &r); |
| r1807 | r1808 | |
| 130 | 130 | |
| 131 | 131 | int zx_ula_r(int offs, int region) |
| 132 | 132 | { |
| 133 | | mame_bitmap *bitmap = tmpbitmap; |
| 133 | bitmap_t *bitmap = tmpbitmap; |
| 134 | 134 | int x, y, chr, data, ireg, rreg, cycles, offs0 = offs, halted = 0; |
| 135 | 135 | UINT8 *chrgen, *rom = memory_region(REGION_CPU1); |
| 136 | 136 | UINT16 *scanline; |
src/mess/video/dgn_beta.c
| r1807 | r1808 | |
| 141 | 141 | static void SetClkMax(int ref, int params, const char *param[]); |
| 142 | 142 | #endif /* ENABLE_DEBUGGER */ |
| 143 | 143 | |
| 144 | | static mame_bitmap *bit; |
| 144 | static bitmap_t *bit; |
| 145 | 145 | static int MinAddr = 0xFFFF; |
| 146 | 146 | static int MaxAddr = 0x0000; |
| 147 | 147 | static int MinX = 0xFFFF; |
| r1807 | r1808 | |
| 358 | 358 | /**************************/ |
| 359 | 359 | |
| 360 | 360 | /* Plot a pixel on beta text screen, takes care of doubling height and width where needed */ |
| 361 | | static void plot_text_pixel(int x, int y,int Dot,int Colour, int CharsPerLine, mame_bitmap *bitmap) |
| 361 | static void plot_text_pixel(int x, int y,int Dot,int Colour, int CharsPerLine, bitmap_t *bitmap) |
| 362 | 362 | { |
| 363 | 363 | int PlotX; |
| 364 | 364 | int PlotY; |
| r1807 | r1808 | |
| 399 | 399 | } |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | | static void beta_plot_char_line(int x,int y, mame_bitmap *bitmap) |
| 402 | static void beta_plot_char_line(int x,int y, bitmap_t *bitmap) |
| 403 | 403 | { |
| 404 | 404 | int CharsPerLine = m6845_get_register(H_DISPLAYED); // Get chars per line. |
| 405 | 405 | unsigned char *data = memory_region(REGION_GFX1); // ptr to char rom |
| r1807 | r1808 | |
| 495 | 495 | |
| 496 | 496 | /* Plot a pixel on the graphics screen, similar to character plotter above */ |
| 497 | 497 | /* May merge at some point in the future, if they turn out to be sufficiently similar ! */ |
| 498 | | static void plot_gfx_pixel(int x, int y, int Dot, int Colour, mame_bitmap *bitmap) |
| 498 | static void plot_gfx_pixel(int x, int y, int Dot, int Colour, bitmap_t *bitmap) |
| 499 | 499 | { |
| 500 | 500 | int DoubleX = (~GCtrl & GCtrlHiLo) ? 1 : 0; |
| 501 | 501 | int DoubleY = (~m6845_get_register(INTERLACE) & 0x03) ? 1 : 0; |
| r1807 | r1808 | |
| 546 | 546 | |
| 547 | 547 | /* Get and plot a graphics bixel block */ |
| 548 | 548 | |
| 549 | | static void beta_plot_gfx_line(int x,int y, mame_bitmap *bitmap) |
| 549 | static void beta_plot_gfx_line(int x,int y, bitmap_t *bitmap) |
| 550 | 550 | { |
| 551 | 551 | int crtcAddr; |
| 552 | 552 | int Addr; |
src/mess/video/pdp1.c
| r1807 | r1808 | |
| 25 | 25 | #include "video/crt.h" |
| 26 | 26 | |
| 27 | 27 | |
| 28 | | static mame_bitmap *panel_bitmap; |
| 29 | | static mame_bitmap *typewriter_bitmap; |
| 28 | static bitmap_t *panel_bitmap; |
| 29 | static bitmap_t *typewriter_bitmap; |
| 30 | 30 | |
| 31 | 31 | static const rectangle typewriter_bitmap_bounds = |
| 32 | 32 | { |
| r1807 | r1808 | |
| 40 | 40 | 0, panel_window_height-1, /* min_y, max_y */ |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | | static void pdp1_draw_panel_backdrop(mame_bitmap *bitmap); |
| 44 | | static void pdp1_draw_panel(mame_bitmap *bitmap); |
| 43 | static void pdp1_draw_panel_backdrop(bitmap_t *bitmap); |
| 44 | static void pdp1_draw_panel(bitmap_t *bitmap); |
| 45 | 45 | |
| 46 | 46 | static lightpen_t lightpen_state, previous_lightpen_state; |
| 47 | | static void pdp1_erase_lightpen(mame_bitmap *bitmap); |
| 48 | | static void pdp1_draw_lightpen(mame_bitmap *bitmap); |
| 47 | static void pdp1_erase_lightpen(bitmap_t *bitmap); |
| 48 | static void pdp1_draw_lightpen(bitmap_t *bitmap); |
| 49 | 49 | |
| 50 | 50 | INLINE void pdp1_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color) |
| 51 | 51 | { |
| r1807 | r1808 | |
| 150 | 150 | }; |
| 151 | 151 | |
| 152 | 152 | /* draw a small 8*8 LED (or is this a lamp? ) */ |
| 153 | | static void pdp1_draw_led(mame_bitmap *bitmap, int x, int y, int state) |
| 153 | static void pdp1_draw_led(bitmap_t *bitmap, int x, int y, int state) |
| 154 | 154 | { |
| 155 | 155 | int xx, yy; |
| 156 | 156 | |
| r1807 | r1808 | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /* draw nb_bits leds which represent nb_bits bits in value */ |
| 163 | | static void pdp1_draw_multipleled(mame_bitmap *bitmap, int x, int y, int value, int nb_bits) |
| 163 | static void pdp1_draw_multipleled(bitmap_t *bitmap, int x, int y, int value, int nb_bits) |
| 164 | 164 | { |
| 165 | 165 | while (nb_bits) |
| 166 | 166 | { |
| r1807 | r1808 | |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | /* draw a small 8*8 switch */ |
| 177 | | static void pdp1_draw_switch(mame_bitmap *bitmap, int x, int y, int state) |
| 177 | static void pdp1_draw_switch(bitmap_t *bitmap, int x, int y, int state) |
| 178 | 178 | { |
| 179 | 179 | int xx, yy; |
| 180 | 180 | int i; |
| r1807 | r1808 | |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | /* draw nb_bits switches which represent nb_bits bits in value */ |
| 218 | | static void pdp1_draw_multipleswitch(mame_bitmap *bitmap, int x, int y, int value, int nb_bits) |
| 218 | static void pdp1_draw_multipleswitch(bitmap_t *bitmap, int x, int y, int value, int nb_bits) |
| 219 | 219 | { |
| 220 | 220 | while (nb_bits) |
| 221 | 221 | { |
| r1807 | r1808 | |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | /* write a single char on screen */ |
| 232 | | static void pdp1_draw_char(mame_bitmap *bitmap, char character, int x, int y, int color) |
| 232 | static void pdp1_draw_char(bitmap_t *bitmap, char character, int x, int y, int color) |
| 233 | 233 | { |
| 234 | 234 | drawgfx(bitmap, Machine->gfx[0], character-32, color, 0, 0, |
| 235 | 235 | x+1, y, &Machine->screen[0].visarea, TRANSPARENCY_PEN, 0); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /* write a string on screen */ |
| 239 | | static void pdp1_draw_string(mame_bitmap *bitmap, const char *buf, int x, int y, int color) |
| 239 | static void pdp1_draw_string(bitmap_t *bitmap, const char *buf, int x, int y, int color) |
| 240 | 240 | { |
| 241 | 241 | while (* buf) |
| 242 | 242 | { |
| r1807 | r1808 | |
| 251 | 251 | /* |
| 252 | 252 | draw the operator control panel (fixed backdrop) |
| 253 | 253 | */ |
| 254 | | static void pdp1_draw_panel_backdrop(mame_bitmap *bitmap) |
| 254 | static void pdp1_draw_panel_backdrop(bitmap_t *bitmap) |
| 255 | 255 | { |
| 256 | 256 | /* fill with black */ |
| 257 | 257 | fillbitmap(panel_bitmap, Machine->pens[pen_panel_bg], &panel_bitmap_bounds); |
| r1807 | r1808 | |
| 302 | 302 | /* |
| 303 | 303 | draw the operator control panel (dynamic elements) |
| 304 | 304 | */ |
| 305 | | static void pdp1_draw_panel(mame_bitmap *bitmap) |
| 305 | static void pdp1_draw_panel(bitmap_t *bitmap) |
| 306 | 306 | { |
| 307 | 307 | /* column 1: registers, test word, test address */ |
| 308 | 308 | pdp1_draw_multipleled(bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpunum_get_reg(0, PDP1_PC), 16); |
| r1807 | r1808 | |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | #if 1 |
| 507 | | static void pdp1_draw_circle(mame_bitmap *bitmap, int x, int y, int radius, int color_) |
| 507 | static void pdp1_draw_circle(bitmap_t *bitmap, int x, int y, int radius, int color_) |
| 508 | 508 | { |
| 509 | 509 | int interval; |
| 510 | 510 | int a; |
| r1807 | r1808 | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | #else |
| 542 | | static void pdp1_draw_circle(mame_bitmap *bitmap, int x, int y, int radius, int color) |
| 542 | static void pdp1_draw_circle(bitmap_t *bitmap, int x, int y, int radius, int color) |
| 543 | 543 | { |
| 544 | 544 | float fx, fy; |
| 545 | 545 | float interval; |
| r1807 | r1808 | |
| 571 | 571 | } |
| 572 | 572 | #endif |
| 573 | 573 | |
| 574 | | static void pdp1_erase_lightpen(mame_bitmap *bitmap) |
| 574 | static void pdp1_erase_lightpen(bitmap_t *bitmap) |
| 575 | 575 | { |
| 576 | 576 | if (previous_lightpen_state.active) |
| 577 | 577 | { |
| r1807 | r1808 | |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | | static void pdp1_draw_lightpen(mame_bitmap *bitmap) |
| 590 | static void pdp1_draw_lightpen(bitmap_t *bitmap) |
| 591 | 591 | { |
| 592 | 592 | if (lightpen_state.active) |
| 593 | 593 | { |
src/mess/video/gb.c
| r1807 | r1808 | |
| 244 | 244 | |
| 245 | 245 | INLINE void gb_update_sprites (void) |
| 246 | 246 | { |
| 247 | | mame_bitmap *bitmap = tmpbitmap; |
| 247 | bitmap_t *bitmap = tmpbitmap; |
| 248 | 248 | UINT8 height, tilemask, line, *oam, *vram; |
| 249 | 249 | int i, yindex; |
| 250 | 250 | |
| r1807 | r1808 | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | static void gb_update_scanline (void) { |
| 333 | | mame_bitmap *bitmap = tmpbitmap; |
| 333 | bitmap_t *bitmap = tmpbitmap; |
| 334 | 334 | |
| 335 | 335 | profiler_mark(PROFILER_VIDEO); |
| 336 | 336 | |
| r1807 | r1808 | |
| 463 | 463 | |
| 464 | 464 | INLINE void sgb_update_sprites (void) |
| 465 | 465 | { |
| 466 | | mame_bitmap *bitmap = tmpbitmap; |
| 466 | bitmap_t *bitmap = tmpbitmap; |
| 467 | 467 | UINT8 height, tilemask, line, *oam, *vram, pal; |
| 468 | 468 | INT16 i, yindex; |
| 469 | 469 | |
| r1807 | r1808 | |
| 561 | 561 | UINT16 yidx, xidx, xindex; |
| 562 | 562 | UINT8 *map, *tiles, *tiles2; |
| 563 | 563 | UINT8 pal, i; |
| 564 | | mame_bitmap *bitmap = tmpbitmap; |
| 564 | bitmap_t *bitmap = tmpbitmap; |
| 565 | 565 | |
| 566 | 566 | map = sgb_tile_map - 64; |
| 567 | 567 | |
| r1807 | r1808 | |
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | static void sgb_update_scanline (void) { |
| 622 | | mame_bitmap *bitmap = tmpbitmap; |
| 622 | bitmap_t *bitmap = tmpbitmap; |
| 623 | 623 | |
| 624 | 624 | profiler_mark(PROFILER_VIDEO); |
| 625 | 625 | |
| r1807 | r1808 | |
| 791 | 791 | /* --- Gameboy Color Specific --- */ |
| 792 | 792 | |
| 793 | 793 | INLINE void cgb_update_sprites (void) { |
| 794 | | mame_bitmap *bitmap = tmpbitmap; |
| 794 | bitmap_t *bitmap = tmpbitmap; |
| 795 | 795 | UINT8 height, tilemask, line, *oam; |
| 796 | 796 | int i, xindex, yindex; |
| 797 | 797 | |
| r1807 | r1808 | |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | 888 | static void cgb_update_scanline (void) { |
| 889 | | mame_bitmap *bitmap = tmpbitmap; |
| 889 | bitmap_t *bitmap = tmpbitmap; |
| 890 | 890 | |
| 891 | 891 | profiler_mark(PROFILER_VIDEO); |
| 892 | 892 | |
src/mess/video/z88.c
| r1807 | r1808 | |
| 46 | 46 | |
| 47 | 47 | /* temp - change to gfxelement structure */ |
| 48 | 48 | |
| 49 | | static void z88_vh_render_8x8(mame_bitmap *bitmap, int x, int y, int pen0, int pen1, unsigned char *pData) |
| 49 | static void z88_vh_render_8x8(bitmap_t *bitmap, int x, int y, int pen0, int pen1, unsigned char *pData) |
| 50 | 50 | { |
| 51 | 51 | int h,b; |
| 52 | 52 | |
| r1807 | r1808 | |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | | static void z88_vh_render_6x8(mame_bitmap *bitmap, int x, int y, int pen0, int pen1, unsigned char *pData) |
| 78 | static void z88_vh_render_6x8(bitmap_t *bitmap, int x, int y, int pen0, int pen1, unsigned char *pData) |
| 79 | 79 | { |
| 80 | 80 | int h,b; |
| 81 | 81 | |
| r1807 | r1808 | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | | static void z88_vh_render_line(mame_bitmap *bitmap, int x, int y,int pen) |
| 110 | static void z88_vh_render_line(bitmap_t *bitmap, int x, int y,int pen) |
| 111 | 111 | { |
| 112 | 112 | z88_plot_pixel(bitmap, x, y+7, pen); |
| 113 | 113 | z88_plot_pixel(bitmap, x+1, y+7, pen); |
| r1807 | r1808 | |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | /*************************************************************************** |
| 154 | | Draw the game screen in the given mame_bitmap. |
| 154 | Draw the game screen in the given bitmap_t. |
| 155 | 155 | Do NOT call osd_update_display() from this fuz88tion, |
| 156 | 156 | it will be called by the main emulation engine. |
| 157 | 157 | ***************************************************************************/ |
src/mess/video/pcw16.c
| r1807 | r1808 | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /* 640, 1 bit per pixel */ |
| 69 | | static void pcw16_vh_decode_mode0(mame_bitmap *bitmap, int x, int y, unsigned char byte) |
| 69 | static void pcw16_vh_decode_mode0(bitmap_t *bitmap, int x, int y, unsigned char byte) |
| 70 | 70 | { |
| 71 | 71 | int b; |
| 72 | 72 | int local_byte; |
| r1807 | r1808 | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /* 320, 2 bits per pixel */ |
| 92 | | static void pcw16_vh_decode_mode1(mame_bitmap *bitmap, int x, int y, unsigned char byte) |
| 92 | static void pcw16_vh_decode_mode1(bitmap_t *bitmap, int x, int y, unsigned char byte) |
| 93 | 93 | { |
| 94 | 94 | int b; |
| 95 | 95 | int px; |
| r1807 | r1808 | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /* 160, 4 bits per pixel */ |
| 123 | | static void pcw16_vh_decode_mode2(mame_bitmap *bitmap, int x, int y, unsigned char byte) |
| 123 | static void pcw16_vh_decode_mode2(bitmap_t *bitmap, int x, int y, unsigned char byte) |
| 124 | 124 | { |
| 125 | 125 | int px; |
| 126 | 126 | int b; |
| r1807 | r1808 | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /*************************************************************************** |
| 155 | | Draw the game screen in the given mame_bitmap. |
| 155 | Draw the game screen in the given bitmap_t. |
| 156 | 156 | Do NOT call osd_update_display() from this function, |
| 157 | 157 | it will be called by the main emulation engine. |
| 158 | 158 | ***************************************************************************/ |
src/mess/video/cgenie.c
| r1807 | r1808 | |
| 14 | 14 | |
| 15 | 15 | static CRTC6845 crt; |
| 16 | 16 | static int graphics = 0; |
| 17 | | static mame_bitmap *dlybitmap = NULL; |
| 17 | static bitmap_t *dlybitmap = NULL; |
| 18 | 18 | static int off_x = 0; |
| 19 | 19 | static int off_y = 0; |
| 20 | 20 | |
| r1807 | r1808 | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| 240 | | static void cgenie_refresh_monitor(running_machine *machine, mame_bitmap * bitmap, const rectangle *cliprect) |
| 240 | static void cgenie_refresh_monitor(running_machine *machine, bitmap_t * bitmap, const rectangle *cliprect) |
| 241 | 241 | { |
| 242 | 242 | int i, address, offset, cursor, size, code, x, y; |
| 243 | 243 | rectangle r; |
| r1807 | r1808 | |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | | static void cgenie_refresh_tv_set(running_machine *machine, mame_bitmap * bitmap, const rectangle *cliprect) |
| 318 | static void cgenie_refresh_tv_set(running_machine *machine, bitmap_t * bitmap, const rectangle *cliprect) |
| 319 | 319 | { |
| 320 | 320 | int i, address, offset, cursor, size, code, x, y; |
| 321 | 321 | rectangle r; |
| r1807 | r1808 | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | /*************************************************************************** |
| 408 | | Draw the game screen in the given mame_bitmap. |
| 408 | Draw the game screen in the given bitmap_t. |
| 409 | 409 | ***************************************************************************/ |
| 410 | 410 | VIDEO_UPDATE( cgenie ) |
| 411 | 411 | { |
src/mess/video/x68k.c
| r1807 | r1808 | |
| 41 | 41 | UINT16* x68k_spriteram; // sprite/background RAM |
| 42 | 42 | UINT16* x68k_spritereg; // sprite/background registers |
| 43 | 43 | |
| 44 | | static mame_bitmap* x68k_text_bitmap; // 1024x1024 4x1bpp planes text |
| 45 | | static mame_bitmap* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages |
| 46 | | static mame_bitmap* x68k_gfx_1_bitmap_16; |
| 47 | | static mame_bitmap* x68k_gfx_2_bitmap_16; |
| 48 | | static mame_bitmap* x68k_gfx_3_bitmap_16; |
| 49 | | static mame_bitmap* x68k_gfx_0_bitmap_256; // 256 colour, 512x512, 2 pages |
| 50 | | static mame_bitmap* x68k_gfx_1_bitmap_256; |
| 51 | | static mame_bitmap* x68k_gfx_0_bitmap_65536; // 65536 colour, 512x512, 1 page |
| 44 | static bitmap_t* x68k_text_bitmap; // 1024x1024 4x1bpp planes text |
| 45 | static bitmap_t* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages |
| 46 | static bitmap_t* x68k_gfx_1_bitmap_16; |
| 47 | static bitmap_t* x68k_gfx_2_bitmap_16; |
| 48 | static bitmap_t* x68k_gfx_3_bitmap_16; |
| 49 | static bitmap_t* x68k_gfx_0_bitmap_256; // 256 colour, 512x512, 2 pages |
| 50 | static bitmap_t* x68k_gfx_1_bitmap_256; |
| 51 | static bitmap_t* x68k_gfx_0_bitmap_65536; // 65536 colour, 512x512, 1 page |
| 52 | 52 | |
| 53 | 53 | static tilemap* x68k_bg0_8; // two 64x64 tilemaps, 8x8 characters |
| 54 | 54 | static tilemap* x68k_bg1_8; |
| r1807 | r1808 | |
| 67 | 67 | *BITMAP_ADDR16(bitmap, y, x) = (UINT16)color; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | | static mame_bitmap* x68k_get_gfx_pri(int pri,int type) |
| 70 | static bitmap_t* x68k_get_gfx_pri(int pri,int type) |
| 71 | 71 | { |
| 72 | 72 | if(type == GFX16) |
| 73 | 73 | { |
| r1807 | r1808 | |
| 700 | 700 | return x68k_spriteram[offset]; |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | | static void x68k_draw_gfx(mame_bitmap* bitmap,rectangle cliprect) |
| 703 | static void x68k_draw_gfx(bitmap_t* bitmap,rectangle cliprect) |
| 704 | 704 | { |
| 705 | 705 | int priority; |
| 706 | 706 | rectangle rect; |
| r1807 | r1808 | |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | // Sprite controller "Cynthia" at 0xeb0000 |
| 804 | | static void x68k_draw_sprites(mame_bitmap* bitmap, int priority, rectangle cliprect) |
| 804 | static void x68k_draw_sprites(bitmap_t* bitmap, int priority, rectangle cliprect) |
| 805 | 805 | { |
| 806 | 806 | /* |
| 807 | 807 | 0xeb0000 - 0xeb07ff - Sprite registers (up to 128) |
src/mess/video/spectrum.c
| r1807 | r1808 | |
| 342 | 342 | *******************************************************************/ |
| 343 | 343 | |
| 344 | 344 | /* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */ |
| 345 | | static void ts2068_hires_scanline(mame_bitmap *bitmap, int y, int borderlines) |
| 345 | static void ts2068_hires_scanline(bitmap_t *bitmap, int y, int borderlines) |
| 346 | 346 | { |
| 347 | 347 | int x,b,scrx,scry; |
| 348 | 348 | unsigned short ink,pap; |
| r1807 | r1808 | |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | 389 | /* Draw a scanline in TS2068/TC2048 64-column mode */ |
| 390 | | static void ts2068_64col_scanline(mame_bitmap *bitmap, int y, int borderlines, unsigned short inkcolor) |
| 390 | static void ts2068_64col_scanline(bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor) |
| 391 | 391 | { |
| 392 | 392 | int x,b,scrx,scry; |
| 393 | 393 | unsigned char *scr1, *scr2; |
| r1807 | r1808 | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | /* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */ |
| 424 | | static void ts2068_lores_scanline(mame_bitmap *bitmap, int y, int borderlines, int screen) |
| 424 | static void ts2068_lores_scanline(bitmap_t *bitmap, int y, int borderlines, int screen) |
| 425 | 425 | { |
| 426 | 426 | int x,b,scrx,scry; |
| 427 | 427 | unsigned short ink,pap; |
src/mess/video/tx0.c
| r1807 | r1808 | |
| 12 | 12 | #include "video/crt.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | | static mame_bitmap *panel_bitmap; |
| 16 | | static mame_bitmap *typewriter_bitmap; |
| 15 | static bitmap_t *panel_bitmap; |
| 16 | static bitmap_t *typewriter_bitmap; |
| 17 | 17 | |
| 18 | 18 | INLINE void tx0_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color) |
| 19 | 19 | { |
| r1807 | r1808 | |
| 32 | 32 | 0, typewriter_window_height-1, /* min_y, max_y */ |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | | static void tx0_draw_panel_backdrop(mame_bitmap *bitmap); |
| 36 | | static void tx0_draw_panel(mame_bitmap *bitmap); |
| 35 | static void tx0_draw_panel_backdrop(bitmap_t *bitmap); |
| 36 | static void tx0_draw_panel(bitmap_t *bitmap); |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | |
| r1807 | r1808 | |
| 123 | 123 | }; |
| 124 | 124 | |
| 125 | 125 | /* draw a small 8*8 LED (or is this a lamp? ) */ |
| 126 | | static void tx0_draw_led(mame_bitmap *bitmap, int x, int y, int state) |
| 126 | static void tx0_draw_led(bitmap_t *bitmap, int x, int y, int state) |
| 127 | 127 | { |
| 128 | 128 | int xx, yy; |
| 129 | 129 | |
| r1807 | r1808 | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /* draw nb_bits leds which represent nb_bits bits in value */ |
| 136 | | static void tx0_draw_multipleled(mame_bitmap *bitmap, int x, int y, int value, int nb_bits) |
| 136 | static void tx0_draw_multipleled(bitmap_t *bitmap, int x, int y, int value, int nb_bits) |
| 137 | 137 | { |
| 138 | 138 | while (nb_bits) |
| 139 | 139 | { |
| r1807 | r1808 | |
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | /* draw a small 8*8 switch */ |
| 150 | | static void tx0_draw_switch(mame_bitmap *bitmap, int x, int y, int state) |
| 150 | static void tx0_draw_switch(bitmap_t *bitmap, int x, int y, int state) |
| 151 | 151 | { |
| 152 | 152 | int xx, yy; |
| 153 | 153 | int i; |
| r1807 | r1808 | |
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | /* draw nb_bits switches which represent nb_bits bits in value */ |
| 191 | | static void tx0_draw_multipleswitch(mame_bitmap *bitmap, int x, int y, int value, int nb_bits) |
| 191 | static void tx0_draw_multipleswitch(bitmap_t *bitmap, int x, int y, int value, int nb_bits) |
| 192 | 192 | { |
| 193 | 193 | while (nb_bits) |
| 194 | 194 | { |
| r1807 | r1808 | |
| 202 | 202 | |
| 203 | 203 | |
| 204 | 204 | /* write a single char on screen */ |
| 205 | | static void tx0_draw_char(mame_bitmap *bitmap, char character, int x, int y, int color) |
| 205 | static void tx0_draw_char(bitmap_t *bitmap, char character, int x, int y, int color) |
| 206 | 206 | { |
| 207 | 207 | drawgfx(bitmap, Machine->gfx[0], character-32, color, 0, 0, |
| 208 | 208 | x+1, y, &Machine->screen[0].visarea, TRANSPARENCY_PEN, 0); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /* write a string on screen */ |
| 212 | | static void tx0_draw_string(mame_bitmap *bitmap, const char *buf, int x, int y, int color) |
| 212 | static void tx0_draw_string(bitmap_t *bitmap, const char *buf, int x, int y, int color) |
| 213 | 213 | { |
| 214 | 214 | while (* buf) |
| 215 | 215 | { |
| r1807 | r1808 | |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | /* draw a vertical line */ |
| 225 | | static void tx0_draw_vline(mame_bitmap *bitmap, int x, int y, int height, int color) |
| 225 | static void tx0_draw_vline(bitmap_t *bitmap, int x, int y, int height, int color) |
| 226 | 226 | { |
| 227 | 227 | while (height--) |
| 228 | 228 | tx0_plot_pixel(bitmap, x, y++, color); |
| r1807 | r1808 | |
| 230 | 230 | |
| 231 | 231 | #ifdef UNUSED_FUNCTION |
| 232 | 232 | /* draw a horizontal line */ |
| 233 | | static void tx0_draw_hline(mame_bitmap *bitmap, int x, int y, int width, int color) |
| 233 | static void tx0_draw_hline(bitmap_t *bitmap, int x, int y, int width, int color) |
| 234 | 234 | { |
| 235 | 235 | while (width--) |
| 236 | 236 | tx0_plot_pixel(bitmap, x++, y, color); |
| r1807 | r1808 | |
| 240 | 240 | /* |
| 241 | 241 | draw the operator control panel (fixed backdrop) |
| 242 | 242 | */ |
| 243 | | static void tx0_draw_panel_backdrop(mame_bitmap *bitmap) |
| 243 | static void tx0_draw_panel_backdrop(bitmap_t *bitmap) |
| 244 | 244 | { |
| 245 | 245 | int i; |
| 246 | 246 | char buf[3]; |
| r1807 | r1808 | |
| 287 | 287 | /* |
| 288 | 288 | draw the operator control panel (dynamic elements) |
| 289 | 289 | */ |
| 290 | | static void tx0_draw_panel(mame_bitmap *bitmap) |
| 290 | static void tx0_draw_panel(bitmap_t *bitmap) |
| 291 | 291 | { |
| 292 | 292 | int cm_sel, lr_sel; |
| 293 | 293 | int i; |
src/mess/video/pc_video.h
| r1807 | r1808 | |
| 12 | 12 | #include "includes/crtc6845.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | | typedef void (*pc_video_update_proc)(mame_bitmap *bitmap, |
| 15 | typedef void (*pc_video_update_proc)(bitmap_t *bitmap, |
| 16 | 16 | struct mscrtc6845 *crtc); |
| 17 | 17 | |
| 18 | 18 | struct mscrtc6845 *pc_video_start(const struct mscrtc6845_config *config, |
| r1807 | r1808 | |
| 26 | 26 | WRITE32_HANDLER( pc_video_videoram32_w ); |
| 27 | 27 | |
| 28 | 28 | /* renderers */ |
| 29 | | void pc_render_gfx_1bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc, |
| 29 | void pc_render_gfx_1bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc, |
| 30 | 30 | const UINT8 *vram, const UINT16 *palette, int interlace); |
| 31 | | void pc_render_gfx_2bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc, |
| 31 | void pc_render_gfx_2bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc, |
| 32 | 32 | const UINT8 *vram, const UINT16 *palette, int interlace); |
| 33 | | void pc_render_gfx_4bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc, |
| 33 | void pc_render_gfx_4bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc, |
| 34 | 34 | const UINT8 *vram, const UINT16 *palette, int interlace); |
| 35 | 35 | |
| 36 | 36 | |
src/mess/video/pc_mda.c
| r1807 | r1808 | |
| 276 | 276 | The character cell size is 9x15. Column 9 is column 8 repeated for |
| 277 | 277 | character codes 176 to 223. |
| 278 | 278 | ***************************************************************************/ |
| 279 | | static void mda_text_inten(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 279 | static void mda_text_inten(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 280 | 280 | { |
| 281 | 281 | int sx, sy; |
| 282 | 282 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 327 | 327 | The character cell size is 9x15. Column 9 is column 8 repeated for |
| 328 | 328 | character codes 176 to 223. |
| 329 | 329 | ***************************************************************************/ |
| 330 | | static void mda_text_blink(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 330 | static void mda_text_blink(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 331 | 331 | { |
| 332 | 332 | int sx, sy; |
| 333 | 333 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 384 | 384 | bit 7 being the leftmost. |
| 385 | 385 | ***************************************************************************/ |
| 386 | 386 | |
| 387 | | static void hercules_gfx(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 387 | static void hercules_gfx(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 388 | 388 | { |
| 389 | 389 | const UINT8 *vram = videoram; |
| 390 | 390 | static const UINT16 palette[2] = {0, 10}; |
src/mess/video/pc_t1t.c
| r1807 | r1808 | |
| 492 | 492 | Plot single text character |
| 493 | 493 | ***************************************************************************/ |
| 494 | 494 | |
| 495 | | static void t1t_plot_char(mame_bitmap *bitmap, const rectangle *r, UINT8 ch, UINT8 attr) |
| 495 | static void t1t_plot_char(bitmap_t *bitmap, const rectangle *r, UINT8 ch, UINT8 attr) |
| 496 | 496 | { |
| 497 | 497 | int width; |
| 498 | 498 | int height; |
| r1807 | r1808 | |
| 519 | 519 | Draw text mode with 40x25 characters (default) with high intensity bg. |
| 520 | 520 | ***************************************************************************/ |
| 521 | 521 | |
| 522 | | static void t1t_text_inten(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 522 | static void t1t_text_inten(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 523 | 523 | { |
| 524 | 524 | int sx, sy; |
| 525 | 525 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 571 | 571 | Draw text mode with 40x25 characters (default) and blinking colors. |
| 572 | 572 | ***************************************************************************/ |
| 573 | 573 | |
| 574 | | static void t1t_text_blink(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 574 | static void t1t_text_blink(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 575 | 575 | { |
| 576 | 576 | int sx, sy; |
| 577 | 577 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 635 | 635 | Even scanlines are from T1T_base + 0x0000, odd from T1T_base + 0x2000 |
| 636 | 636 | ***************************************************************************/ |
| 637 | 637 | |
| 638 | | static void t1t_gfx_2bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 638 | static void t1t_gfx_2bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 639 | 639 | { |
| 640 | 640 | static const UINT16 palette[] = |
| 641 | 641 | { |
| r1807 | r1808 | |
| 653 | 653 | The cell size is 1x1 (1 scanline is the real default) |
| 654 | 654 | Even scanlines are from T1T_base + 0x0000, odd from T1T_base + 0x2000 |
| 655 | 655 | ***************************************************************************/ |
| 656 | | static void t1t_gfx_1bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 656 | static void t1t_gfx_1bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 657 | 657 | { |
| 658 | 658 | int i, sx, sy, sh; |
| 659 | 659 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 695 | 695 | CGA_base + 0x2000 |
| 696 | 696 | ***************************************************************************/ |
| 697 | 697 | |
| 698 | | static void t1t_gfx_4bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 698 | static void t1t_gfx_4bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 699 | 699 | { |
| 700 | 700 | pc_render_gfx_4bpp(bitmap, crtc, pcjr.displayram, NULL, 4); |
| 701 | 701 | } |
src/mess/video/pc_cga.c
| r1807 | r1808 | |
| 497 | 497 | The character cell size is 16x8 |
| 498 | 498 | ***************************************************************************/ |
| 499 | 499 | |
| 500 | | static void cga_text_inten(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 500 | static void cga_text_inten(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 501 | 501 | { |
| 502 | 502 | int sx, sy; |
| 503 | 503 | int offs = mscrtc6845_get_start(crtc) * 2; |
| r1807 | r1808 | |
| 551 | 551 | The character cell size is 16x8 |
| 552 | 552 | ***************************************************************************/ |
| 553 | 553 | |
| 554 | | static void cga_text_inten_alt(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 554 | static void cga_text_inten_alt(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 555 | 555 | { |
| 556 | 556 | int sx, sy; |
| 557 | 557 | int offs = mscrtc6845_get_start(crtc) * 2; |
| r1807 | r1808 | |
| 600 | 600 | Draw text mode with 40x25 characters (default) and blinking colors. |
| 601 | 601 | The character cell size is 16x8 |
| 602 | 602 | ***************************************************************************/ |
| 603 | | static void cga_text_blink(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 603 | static void cga_text_blink(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 604 | 604 | { |
| 605 | 605 | int sx, sy; |
| 606 | 606 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 665 | 665 | The character cell size is 16x8 |
| 666 | 666 | ***************************************************************************/ |
| 667 | 667 | |
| 668 | | static void cga_text_blink_alt(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 668 | static void cga_text_blink_alt(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 669 | 669 | { |
| 670 | 670 | int sx, sy; |
| 671 | 671 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 727 | 727 | cga fetches 2 byte per mscrtc6845 access (not modeled here)! |
| 728 | 728 | ***************************************************************************/ |
| 729 | 729 | |
| 730 | | static void cga_gfx_2bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 730 | static void cga_gfx_2bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 731 | 731 | { |
| 732 | 732 | const UINT16 *palette; |
| 733 | 733 | int colorset = cga.color_select & 0x3F; |
| r1807 | r1808 | |
| 769 | 769 | Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 |
| 770 | 770 | ***************************************************************************/ |
| 771 | 771 | |
| 772 | | static void cga_gfx_1bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 772 | static void cga_gfx_1bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 773 | 773 | { |
| 774 | 774 | const UINT16 *palette; |
| 775 | 775 | |
| r1807 | r1808 | |
| 785 | 785 | |
| 786 | 786 | |
| 787 | 787 | |
| 788 | | INLINE void cga_plot_unit_4bpp(mame_bitmap *bitmap, |
| 788 | INLINE void cga_plot_unit_4bpp(bitmap_t *bitmap, |
| 789 | 789 | int x, int y, int offs, int scale) |
| 790 | 790 | { |
| 791 | 791 | int color; |
| r1807 | r1808 | |
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | |
| 801 | | static void cga_gfx_4bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc, int scale) |
| 801 | static void cga_gfx_4bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc, int scale) |
| 802 | 802 | { |
| 803 | 803 | int i, sx, sy, sh; |
| 804 | 804 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 837 | 837 | * The different scaling factors mean that the '160x200' versions of screens |
| 838 | 838 | * are the same size as the normal colour ones. |
| 839 | 839 | */ |
| 840 | | static void cga_gfx_4bpph(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 840 | static void cga_gfx_4bpph(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 841 | 841 | { |
| 842 | 842 | pc_cga_check_palette(); |
| 843 | 843 | cga_gfx_4bpp(bitmap, crtc, 8); |
| r1807 | r1808 | |
| 845 | 845 | |
| 846 | 846 | |
| 847 | 847 | /* The lo-res graphics mode on a colour composite monitor */ |
| 848 | | static void cga_gfx_4bppl(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 848 | static void cga_gfx_4bppl(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 849 | 849 | { |
| 850 | 850 | pc_cga_check_palette(); |
| 851 | 851 | cga_gfx_4bpp(bitmap, crtc, 4); |
| r1807 | r1808 | |
| 854 | 854 | |
| 855 | 855 | |
| 856 | 856 | |
| 857 | | INLINE void pgfx_plot_unit_4bpp(mame_bitmap *bitmap, |
| 857 | INLINE void pgfx_plot_unit_4bpp(bitmap_t *bitmap, |
| 858 | 858 | int x, int y, int offs) |
| 859 | 859 | { |
| 860 | 860 | int color, values[2]; |
| r1807 | r1808 | |
| 889 | 889 | Second plane at CGA_base + 0x4000 / 0x6000 |
| 890 | 890 | ***************************************************************************/ |
| 891 | 891 | |
| 892 | | static void cga_pgfx_4bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 892 | static void cga_pgfx_4bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 893 | 893 | { |
| 894 | 894 | int i, sx, sy, sh; |
| 895 | 895 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 922 | 922 | |
| 923 | 923 | |
| 924 | 924 | |
| 925 | | INLINE void pgfx_plot_unit_2bpp(mame_bitmap *bitmap, |
| 925 | INLINE void pgfx_plot_unit_2bpp(bitmap_t *bitmap, |
| 926 | 926 | int x, int y, const UINT16 *palette, int offs) |
| 927 | 927 | { |
| 928 | 928 | int i; |
| r1807 | r1808 | |
| 969 | 969 | cga fetches 2 byte per mscrtc6845 access (not modeled here)! |
| 970 | 970 | ***************************************************************************/ |
| 971 | 971 | |
| 972 | | static void cga_pgfx_2bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 972 | static void cga_pgfx_2bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 973 | 973 | { |
| 974 | 974 | int i, sx, sy, sh; |
| 975 | 975 | int offs = mscrtc6845_get_start(crtc)*2; |
| r1807 | r1808 | |
| 1033 | 1033 | // mapping of the 4 planes into videoram |
| 1034 | 1034 | // (text data should be readable at videoram+0) |
| 1035 | 1035 | static const int videoram_offset[4]= { 0xc000, 0x8000, 0x4000, 0 }; |
| 1036 | | INLINE void pc1512_plot_unit(mame_bitmap *bitmap, |
| 1036 | INLINE void pc1512_plot_unit(bitmap_t *bitmap, |
| 1037 | 1037 | int x, int y, int offs) |
| 1038 | 1038 | { |
| 1039 | 1039 | int color, values[4]; |
| r1807 | r1808 | |
| 1065 | 1065 | Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 |
| 1066 | 1066 | ***************************************************************************/ |
| 1067 | 1067 | |
| 1068 | | static void pc1512_gfx_4bpp(mame_bitmap *bitmap, struct mscrtc6845 *crtc) |
| 1068 | static void pc1512_gfx_4bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 1069 | 1069 | { |
| 1070 | 1070 | int i, sx, sy, sh; |
| 1071 | 1071 | int offs = mscrtc6845_get_start(crtc)*2; |
src/mess/video/intv.c
| r1807 | r1808 | |
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | | static void render_line(running_machine *machine, mame_bitmap *bitmap, |
| 207 | static void render_line(running_machine *machine, bitmap_t *bitmap, |
| 208 | 208 | UINT8 nextByte, UINT16 x, UINT16 y, UINT8 fgcolor, UINT8 bgcolor) |
| 209 | 209 | { |
| 210 | 210 | UINT32 color = (nextByte & 0x80 ? machine->pens[fgcolor] |
| r1807 | r1808 | |
| 264 | 264 | intv_plot_pixel(bitmap, x+15, y+1, color); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | | static void render_colored_squares(running_machine *machine, mame_bitmap *bitmap, |
| 267 | static void render_colored_squares(running_machine *machine, bitmap_t *bitmap, |
| 268 | 268 | UINT16 x, UINT16 y, UINT8 color0, UINT8 color1, UINT8 color2, UINT8 color3) |
| 269 | 269 | { |
| 270 | 270 | plot_box(bitmap, x, y, 8, 8, machine->pens[color0]); |
| r1807 | r1808 | |
| 273 | 273 | plot_box(bitmap, x+8, y+8, 8, 8, machine->pens[color3]); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | | static void render_color_stack_mode(running_machine *machine, mame_bitmap *bitmap) |
| 276 | static void render_color_stack_mode(running_machine *machine, bitmap_t *bitmap) |
| 277 | 277 | { |
| 278 | 278 | UINT8 h, csPtr = 0, nexty = 0; |
| 279 | 279 | UINT16 nextCard, nextx = 0; |
| r1807 | r1808 | |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | | static void render_fg_bg_mode(running_machine *machine, mame_bitmap *bitmap) |
| 335 | static void render_fg_bg_mode(running_machine *machine, bitmap_t *bitmap) |
| 336 | 336 | { |
| 337 | 337 | UINT8 i, j, isGrom, fgcolor, bgcolor, nexty = 0; |
| 338 | 338 | UINT16 nextCard, memoryLocation, nextx = 0; |
| r1807 | r1808 | |
| 368 | 368 | } |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | | static void copy_sprites_to_background(running_machine *machine, mame_bitmap *bitmap) |
| 371 | static void copy_sprites_to_background(running_machine *machine, bitmap_t *bitmap) |
| 372 | 372 | { |
| 373 | 373 | UINT8 width, currentPixel; |
| 374 | 374 | UINT8 borderCollision, foregroundCollision; |
| r1807 | r1808 | |
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | | static void render_background(running_machine *machine, mame_bitmap *bitmap) |
| 440 | static void render_background(running_machine *machine, bitmap_t *bitmap) |
| 441 | 441 | { |
| 442 | 442 | if (intv_color_stack_mode) |
| 443 | 443 | render_color_stack_mode(machine, bitmap); |
| r1807 | r1808 | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /* |
| 449 | | static void draw_background(mame_bitmap *bitmap, int transparency) |
| 449 | static void draw_background(bitmap_t *bitmap, int transparency) |
| 450 | 450 | { |
| 451 | 451 | // First, draw the background |
| 452 | 452 | int offs = 0; |
| r1807 | r1808 | |
| 598 | 598 | |
| 599 | 599 | /* TBD: need to handle sprites behind foreground? */ |
| 600 | 600 | /* |
| 601 | | static void draw_sprites(mame_bitmap *bitmap, int behind_foreground) |
| 601 | static void draw_sprites(bitmap_t *bitmap, int behind_foreground) |
| 602 | 602 | { |
| 603 | 603 | int i; |
| 604 | 604 | int code; |
| r1807 | r1808 | |
| 699 | 699 | } |
| 700 | 700 | */ |
| 701 | 701 | |
| 702 | | static void draw_borders(running_machine *machine, mame_bitmap *bm) |
| 702 | static void draw_borders(running_machine *machine, bitmap_t *bm) |
| 703 | 703 | { |
| 704 | 704 | if (intv_left_edge_inhibit) |
| 705 | 705 | { |
src/mess/video/amstrad.c
| r1807 | r1808 | |
| 87 | 87 | /* 2 HSYNCS after the VSYNC Counter */ |
| 88 | 88 | static int amstrad_CRTC_HS_After_VS_Counter; |
| 89 | 89 | |
| 90 | | static mame_bitmap *amstrad_bitmap; |
| 90 | static bitmap_t *amstrad_bitmap; |
| 91 | 91 | |
| 92 | 92 | static int amstrad_scanline; |
| 93 | 93 | static int border_counter; // counts length of the soft scroll border extend |
| r1807 | r1808 | |
| 391 | 391 | /* mode 0 - low resolution - 16 colours */ |
| 392 | 392 | static void amstrad_plus_draw_screen_enabled_mode_0(void) |
| 393 | 393 | { |
| 394 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 394 | bitmap_t *bitmap = amstrad_bitmap; |
| 395 | 395 | |
| 396 | 396 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 397 | 397 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 449 | 449 | /* mode 1 - medium resolution - 4 colours */ |
| 450 | 450 | static void amstrad_plus_draw_screen_enabled_mode_1(void) |
| 451 | 451 | { |
| 452 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 452 | bitmap_t *bitmap = amstrad_bitmap; |
| 453 | 453 | |
| 454 | 454 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 455 | 455 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 500 | 500 | /* mode 2: high resolution - 2 colours */ |
| 501 | 501 | static void amstrad_plus_draw_screen_enabled_mode_2(void) |
| 502 | 502 | { |
| 503 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 503 | bitmap_t *bitmap = amstrad_bitmap; |
| 504 | 504 | |
| 505 | 505 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 506 | 506 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 540 | 540 | /* undocumented mode. low resolution - 4 colours */ |
| 541 | 541 | static void amstrad_plus_draw_screen_enabled_mode_3(void) |
| 542 | 542 | { |
| 543 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 543 | bitmap_t *bitmap = amstrad_bitmap; |
| 544 | 544 | |
| 545 | 545 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 546 | 546 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 598 | 598 | /* mode 0 - low resolution - 16 colours */ |
| 599 | 599 | static void amstrad_draw_screen_enabled_mode_0(void) |
| 600 | 600 | { |
| 601 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 601 | bitmap_t *bitmap = amstrad_bitmap; |
| 602 | 602 | |
| 603 | 603 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 604 | 604 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 645 | 645 | /* mode 1 - medium resolution - 4 colours */ |
| 646 | 646 | static void amstrad_draw_screen_enabled_mode_1(void) |
| 647 | 647 | { |
| 648 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 648 | bitmap_t *bitmap = amstrad_bitmap; |
| 649 | 649 | |
| 650 | 650 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 651 | 651 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 694 | 694 | /* mode 2: high resolution - 2 colours */ |
| 695 | 695 | static void amstrad_draw_screen_enabled_mode_2(void) |
| 696 | 696 | { |
| 697 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 697 | bitmap_t *bitmap = amstrad_bitmap; |
| 698 | 698 | |
| 699 | 699 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 700 | 700 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 737 | 737 | /* undocumented mode. low resolution - 4 colours */ |
| 738 | 738 | static void amstrad_draw_screen_enabled_mode_3(void) |
| 739 | 739 | { |
| 740 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 740 | bitmap_t *bitmap = amstrad_bitmap; |
| 741 | 741 | |
| 742 | 742 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 743 | 743 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 783 | 783 | /* Aleste mode 2: high resolution - 4 colours */ |
| 784 | 784 | static void aleste_draw_screen_enabled_mode_2(void) |
| 785 | 785 | { |
| 786 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 786 | bitmap_t *bitmap = amstrad_bitmap; |
| 787 | 787 | |
| 788 | 788 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 789 | 789 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 827 | 827 | /* Aleste mode 3 - medium resolution, 16 colours */ |
| 828 | 828 | static void aleste_draw_screen_enabled_mode_3(void) |
| 829 | 829 | { |
| 830 | | mame_bitmap *bitmap = amstrad_bitmap; |
| 830 | bitmap_t *bitmap = amstrad_bitmap; |
| 831 | 831 | |
| 832 | 832 | int ma = amstrad_CRTC_MA; // m6845_memory_address_r(0); |
| 833 | 833 | int ra = amstrad_CRTC_RA; // m6845_row_address_r(0); |
| r1807 | r1808 | |
| 920 | 920 | |
| 921 | 921 | &6422 - &643f Sprite palette, 12-bit, xxxxGGGGRRRRBBBB, sprite pens 1-15 (0 is always transparent) |
| 922 | 922 | */ |
| 923 | | static void amstrad_plus_sprite_draw(mame_bitmap* scr_bitmap) |
| 923 | static void amstrad_plus_sprite_draw(bitmap_t* scr_bitmap) |
| 924 | 924 | { |
| 925 | 925 | int spr; // sprite number |
| 926 | 926 | int xloc,yloc; |
src/mess/video/odyssey2.c
| r1807 | r1808 | |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | | INLINE void odyssey2_draw(mame_bitmap *bitmap, UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id, UINT32 col) |
| 342 | INLINE void odyssey2_draw(bitmap_t *bitmap, UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id, UINT32 col) |
| 343 | 343 | { |
| 344 | 344 | int m,x1,y1; |
| 345 | 345 | for (m=0x80; m>0; m>>=1, x+=scale_x) |
| r1807 | r1808 | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | // different bit ordering, maybe I should change rom |
| 362 | | INLINE void odyssey2_draw_sprite(mame_bitmap *bitmap, UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id, UINT32 col) |
| 362 | INLINE void odyssey2_draw_sprite(bitmap_t *bitmap, UINT8 bg[][320], UINT8 code, int x, int y, int scale_x, int scale_y, UINT8 collision_id, UINT32 col) |
| 363 | 363 | { |
| 364 | 364 | int m,x1,y1; |
| 365 | 365 | |
| r1807 | r1808 | |
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | | INLINE void odyssey2_draw_grid( mame_bitmap* bitmap, UINT8 bg[][320] ) |
| 382 | INLINE void odyssey2_draw_grid( bitmap_t* bitmap, UINT8 bg[][320] ) |
| 383 | 383 | { |
| 384 | 384 | int width = 16; |
| 385 | 385 | int height = 24; |
| r1807 | r1808 | |
| 421 | 421 | } |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | | INLINE void odyssey2_draw_char(mame_bitmap *bitmap, UINT8 bg[][320], int x, int y, int ptr, int color) |
| 424 | INLINE void odyssey2_draw_char(bitmap_t *bitmap, UINT8 bg[][320], int x, int y, int ptr, int color) |
| 425 | 425 | { |
| 426 | 426 | int n, i; |
| 427 | 427 | int offset = ptr | ((color & 1) << 8); |
src/mess/video/apple2.c
| r1807 | r1808 | |
| 95 | 95 | textual character |
| 96 | 96 | -------------------------------------------------*/ |
| 97 | 97 | |
| 98 | | INLINE void apple2_plot_text_character(mame_bitmap *bitmap, int xpos, int ypos, int xscale, UINT32 code, |
| 98 | INLINE void apple2_plot_text_character(bitmap_t *bitmap, int xpos, int ypos, int xscale, UINT32 code, |
| 99 | 99 | const UINT8 *textgfx_data, UINT32 textgfx_datalen, UINT32 my_a2) |
| 100 | 100 | { |
| 101 | 101 | int x, y, i; |
| r1807 | r1808 | |
| 142 | 142 | column or 80 column) |
| 143 | 143 | -------------------------------------------------*/ |
| 144 | 144 | |
| 145 | | static void apple2_text_draw(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| 145 | static void apple2_text_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| 146 | 146 | { |
| 147 | 147 | int row, col; |
| 148 | 148 | UINT32 start_address = (page ? 0x0800 : 0x0400); |
| r1807 | r1808 | |
| 182 | 182 | apple2_lores_draw - renders lo-res text |
| 183 | 183 | -------------------------------------------------*/ |
| 184 | 184 | |
| 185 | | static void apple2_lores_draw(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| 185 | static void apple2_lores_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| 186 | 186 | { |
| 187 | 187 | int row, col, y, x; |
| 188 | 188 | UINT8 code; |
| r1807 | r1808 | |
| 265 | 265 | |
| 266 | 266 | struct drawtask_params |
| 267 | 267 | { |
| 268 | | mame_bitmap *bitmap; |
| 268 | bitmap_t *bitmap; |
| 269 | 269 | const UINT8 *vram; |
| 270 | 270 | int beginrow; |
| 271 | 271 | int rowcount; |
| r1807 | r1808 | |
| 274 | 274 | |
| 275 | 275 | static void apple2_hires_draw_task(struct drawtask_params *dtparams) |
| 276 | 276 | { |
| 277 | | mame_bitmap *bitmap; |
| 277 | bitmap_t *bitmap; |
| 278 | 278 | const UINT8 *vram; |
| 279 | 279 | int beginrow; |
| 280 | 280 | int endrow; |
| r1807 | r1808 | |
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | | static void apple2_hires_draw(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| 355 | static void apple2_hires_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int page, int beginrow, int endrow) |
| 356 | 356 | { |
| 357 | 357 | struct drawtask_params dtparams; |
| 358 | 358 | |
src/mess/video/kc.c
| r1807 | r1808 | |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | /* draw 8 pixels */ |
| 117 | | static void kc85_draw_8_pixels(mame_bitmap *bitmap,int x,int y, unsigned char colour_byte, unsigned char gfx_byte) |
| 117 | static void kc85_draw_8_pixels(bitmap_t *bitmap,int x,int y, unsigned char colour_byte, unsigned char gfx_byte) |
| 118 | 118 | { |
| 119 | 119 | int a; |
| 120 | 120 | int background_pen; |
| r1807 | r1808 | |
| 270 | 270 | struct video_update_state |
| 271 | 271 | { |
| 272 | 272 | /* bitmap to render to */ |
| 273 | | mame_bitmap *bitmap; |
| 273 | bitmap_t *bitmap; |
| 274 | 274 | /* grab colour and pixel information for 8-pixels referenced by x,y coordinate */ |
| 275 | 275 | void (*pixel_grab_callback)(struct grab_info *,int x,int y, unsigned char *colour_ptr, unsigned char *pixel_ptr); |
| 276 | 276 | /* current coords */ |
| r1807 | r1808 | |
| 490 | 490 | |
| 491 | 491 | /* the kc85 screen is 320 pixels wide and 256 pixels tall */ |
| 492 | 492 | /* if we assume a 50hz display, there are 312 lines for the complete frame, leaving 56 lines not visible */ |
| 493 | | static void kc85_common_process_frame(mame_bitmap *bitmap, void (*pixel_grab_callback)(struct grab_info *,int x,int y,unsigned char *, unsigned char *),struct grab_info *grab_data) |
| 493 | static void kc85_common_process_frame(bitmap_t *bitmap, void (*pixel_grab_callback)(struct grab_info *,int x,int y,unsigned char *, unsigned char *),struct grab_info *grab_data) |
| 494 | 494 | { |
| 495 | 495 | int cycles_remaining_in_frame = KC85_CYCLES_PER_FRAME; |
| 496 | 496 | |
| r1807 | r1808 | |
| 647 | 647 | |
| 648 | 648 | |
| 649 | 649 | /*************************************************************************** |
| 650 | | Draw the game screen in the given mame_bitmap. |
| 650 | Draw the game screen in the given bitmap_t. |
| 651 | 651 | Do NOT call osd_update_display() from this function, |
| 652 | 652 | it will be called by the main emulation engine. |
| 653 | 653 | ***************************************************************************/ |
| r1807 | r1808 | |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | /*************************************************************************** |
| 729 | | Draw the game screen in the given mame_bitmap. |
| 729 | Draw the game screen in the given bitmap_t. |
| 730 | 730 | Do NOT call osd_update_display() from this function, |
| 731 | 731 | it will be called by the main emulation engine. |
| 732 | 732 | ***************************************************************************/ |
src/mess/drivers/apexc.c
| r1807 | r1808 | |
| 445 | 445 | #define APEXC_PALETTE_SIZE ARRAY_LENGTH(apexc_palette) |
| 446 | 446 | #define APEXC_COLORTABLE_SIZE sizeof(apexc_colortable)/2 |
| 447 | 447 | |
| 448 | | static mame_bitmap *apexc_bitmap; |
| 448 | static bitmap_t *apexc_bitmap; |
| 449 | 449 | |
| 450 | 450 | enum |
| 451 | 451 | { |
| r1807 | r1808 | |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | /* draw a small 8*8 LED (well, there were no LEDs at the time, so let's call this a lamp ;-) ) */ |
| 497 | | static void apexc_draw_led(mame_bitmap *bitmap, int x, int y, int state) |
| 497 | static void apexc_draw_led(bitmap_t *bitmap, int x, int y, int state) |
| 498 | 498 | { |
| 499 | 499 | int xx, yy; |
| 500 | 500 | |
| r1807 | r1808 | |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | /* write a single char on screen */ |
| 507 | | static void apexc_draw_char(mame_bitmap *bitmap, char character, int x, int y, int color) |
| 507 | static void apexc_draw_char(bitmap_t *bitmap, char character, int x, int y, int color) |
| 508 | 508 | { |
| 509 | 509 | drawgfx(bitmap, Machine->gfx[0], character-32, color, 0, 0, |
| 510 | 510 | x+1, y, &Machine->screen[0].visarea, TRANSPARENCY_PEN, 0); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | /* write a string on screen */ |
| 514 | | static void apexc_draw_string(mame_bitmap *bitmap, const char *buf, int x, int y, int color) |
| 514 | static void apexc_draw_string(bitmap_t *bitmap, const char *buf, int x, int y, int color) |
| 515 | 515 | { |
| 516 | 516 | while (* buf) |
| 517 | 517 | { |
src/mess/drivers/x68k.c
| r1807 | r1808 | |
| 154 | 154 | |
| 155 | 155 | static UINT8 mfp_key; |
| 156 | 156 | |
| 157 | | extern mame_bitmap* x68k_text_bitmap; // 1024x1024 4x1bpp planes text |
| 158 | | extern mame_bitmap* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages |
| 159 | | extern mame_bitmap* x68k_gfx_1_bitmap_16; |
| 160 | | extern mame_bitmap* x68k_gfx_2_bitmap_16; |
| 161 | | extern mame_bitmap* x68k_gfx_3_bitmap_16; |
| 162 | | extern mame_bitmap* x68k_gfx_0_bitmap_256; // 256 colour, 512x512, 2 pages |
| 163 | | extern mame_bitmap* x68k_gfx_1_bitmap_256; |
| 164 | | extern mame_bitmap* x68k_gfx_0_bitmap_65536; // 65536 colour, 512x512, 1 page |
| 157 | extern bitmap_t* x68k_text_bitmap; // 1024x1024 4x1bpp planes text |
| 158 | extern bitmap_t* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages |
| 159 | extern bitmap_t* x68k_gfx_1_bitmap_16; |
| 160 | extern bitmap_t* x68k_gfx_2_bitmap_16; |
| 161 | extern bitmap_t* x68k_gfx_3_bitmap_16; |
| 162 | extern bitmap_t* x68k_gfx_0_bitmap_256; // 256 colour, 512x512, 2 pages |
| 163 | extern bitmap_t* x68k_gfx_1_bitmap_256; |
| 164 | extern bitmap_t* x68k_gfx_0_bitmap_65536; // 65536 colour, 512x512, 1 page |
| 165 | 165 | |
| 166 | 166 | extern tilemap* x68k_bg0_8; // two 64x64 tilemaps, 8x8 characters |
| 167 | 167 | extern tilemap* x68k_bg1_8; |
src/mess/mscommon.h
| r1807 | r1808 | |
| 28 | 28 | int (*getcursorcode)(int original_code), |
| 29 | 29 | int num_cols, int num_rows); |
| 30 | 30 | |
| 31 | | void terminal_draw(mame_bitmap *dest, const rectangle *cliprect, |
| 31 | void terminal_draw(bitmap_t *dest, const rectangle *cliprect, |
| 32 | 32 | struct terminal *terminal); |
| 33 | 33 | void terminal_putchar(struct terminal *terminal, int x, int y, int ch); |
| 34 | 34 | int terminal_getchar(struct terminal *terminal, int x, int y); |
| r1807 | r1808 | |
| 52 | 52 | * the value of 'valueorcolor' is a mask when lowercase letters are in the led |
| 53 | 53 | * string or is a color when '1' characters are in the led string |
| 54 | 54 | */ |
| 55 | | void draw_led(mame_bitmap *bitmap, const char *led, int valueorcolor, int x, int y); |
| 55 | void draw_led(bitmap_t *bitmap, const char *led, int valueorcolor, int x, int y); |
| 56 | 56 | |
| 57 | 57 | /* a radius two led: |
| 58 | 58 | * |