Previous 15994 Revisions Next

r1933 Tuesday 11th March, 2008 at 21:23:46 UTC by Wilbert Pol
Removed deprecat.h dependency from video/pdp1.c
[src/mess/includes]pdp1.h
[src/mess/machine]pdp1.c
[src/mess/video]pdp1.c

src/mess/includes/pdp1.h
r1932r1933
181181
182182void pdp1_plot(int x, int y);
183183
184void pdp1_typewriter_drawchar(int character);
184void pdp1_typewriter_drawchar(running_machine *machine, int character);
185185
186186void pdp1_update_lightpen_state(const lightpen_t *new_state);
187187
src/mess/video/pdp1.c
r1932r1933
1818#include <math.h>
1919
2020#include "driver.h"
21#include "deprecat.h"
22
2321#include "cpu/pdp1/pdp1.h"
2422#include "includes/pdp1.h"
2523#include "video/crt.h"
r1932r1933
4038   0,   panel_window_height-1,   /* min_y, max_y */
4139};
4240
43static void pdp1_draw_panel_backdrop(bitmap_t *bitmap);
44static void pdp1_draw_panel(bitmap_t *bitmap);
41static void pdp1_draw_panel_backdrop(running_machine *machine, bitmap_t *bitmap);
42static void pdp1_draw_panel(running_machine *machine, bitmap_t *bitmap);
4543
4644static lightpen_t lightpen_state, previous_lightpen_state;
4745static void pdp1_erase_lightpen(bitmap_t *bitmap);
r1932r1933
6260   typewriter_bitmap = auto_bitmap_alloc(typewriter_window_width, typewriter_window_height, BITMAP_FORMAT_INDEXED16);
6361
6462   /* set up out bitmaps */
65   pdp1_draw_panel_backdrop(panel_bitmap);
63   pdp1_draw_panel_backdrop(machine, panel_bitmap);
6664
6765   fillbitmap(typewriter_bitmap, machine->pens[pen_typewriter_bg], &typewriter_bitmap_bounds);
6866
r1932r1933
9290   VIDEO_UPDATE_CALL(crt);
9391   pdp1_draw_lightpen(bitmap);
9492
95   pdp1_draw_panel(panel_bitmap);
93   pdp1_draw_panel(machine, panel_bitmap);
9694   copybitmap(bitmap, panel_bitmap, 0, 0, panel_window_offset_x, panel_window_offset_y, cliprect);
9795
9896   copybitmap(bitmap, typewriter_bitmap, 0, 0, typewriter_window_offset_x, typewriter_window_offset_y, cliprect);
r1932r1933
150148};
151149
152150/* draw a small 8*8 LED (or is this a lamp? ) */
153static void pdp1_draw_led(bitmap_t *bitmap, int x, int y, int state)
151static void pdp1_draw_led(running_machine *machine, bitmap_t *bitmap, int x, int y, int state)
154152{
155153   int xx, yy;
156154
157155   for (yy=1; yy<7; yy++)
158156      for (xx=1; xx<7; xx++)
159         pdp1_plot_pixel(bitmap, x+xx, y+yy, Machine->pens[state ? pen_lit_lamp : pen_unlit_lamp]);
157         pdp1_plot_pixel(bitmap, x+xx, y+yy, machine->pens[state ? pen_lit_lamp : pen_unlit_lamp]);
160158}
161159
162160/* draw nb_bits leds which represent nb_bits bits in value */
163static void pdp1_draw_multipleled(bitmap_t *bitmap, int x, int y, int value, int nb_bits)
161static void pdp1_draw_multipleled(running_machine *machine, bitmap_t *bitmap, int x, int y, int value, int nb_bits)
164162{
165163   while (nb_bits)
166164   {
167165      nb_bits--;
168166
169      pdp1_draw_led(bitmap, x, y, (value >> nb_bits) & 1);
167      pdp1_draw_led(machine, bitmap, x, y, (value >> nb_bits) & 1);
170168
171169      x += 8;
172170   }
r1932r1933
174172
175173
176174/* draw a small 8*8 switch */
177static void pdp1_draw_switch(bitmap_t *bitmap, int x, int y, int state)
175static void pdp1_draw_switch(running_machine *machine, bitmap_t *bitmap, int x, int y, int state)
178176{
179177   int xx, yy;
180178   int i;
r1932r1933
182180   /* erase area */
183181   for (yy=0; yy<8; yy++)
184182      for (xx=0; xx<8; xx++)
185         pdp1_plot_pixel(bitmap, x+xx, y+yy, Machine->pens[pen_panel_bg]);
183         pdp1_plot_pixel(bitmap, x+xx, y+yy, machine->pens[pen_panel_bg]);
186184
187185
188186   /* draw nut (-> circle) */
189187   for (i=0; i<4;i++)
190188   {
191      pdp1_plot_pixel(bitmap, x+2+i, y+1, Machine->pens[pen_switch_nut]);
192      pdp1_plot_pixel(bitmap, x+2+i, y+6, Machine->pens[pen_switch_nut]);
193      pdp1_plot_pixel(bitmap, x+1, y+2+i, Machine->pens[pen_switch_nut]);
194      pdp1_plot_pixel(bitmap, x+6, y+2+i, Machine->pens[pen_switch_nut]);
189      pdp1_plot_pixel(bitmap, x+2+i, y+1, machine->pens[pen_switch_nut]);
190      pdp1_plot_pixel(bitmap, x+2+i, y+6, machine->pens[pen_switch_nut]);
191      pdp1_plot_pixel(bitmap, x+1, y+2+i, machine->pens[pen_switch_nut]);
192      pdp1_plot_pixel(bitmap, x+6, y+2+i, machine->pens[pen_switch_nut]);
195193   }
196   pdp1_plot_pixel(bitmap, x+2, y+2, Machine->pens[pen_switch_nut]);
197   pdp1_plot_pixel(bitmap, x+5, y+2, Machine->pens[pen_switch_nut]);
198   pdp1_plot_pixel(bitmap, x+2, y+5, Machine->pens[pen_switch_nut]);
199   pdp1_plot_pixel(bitmap, x+5, y+5, Machine->pens[pen_switch_nut]);
194   pdp1_plot_pixel(bitmap, x+2, y+2, machine->pens[pen_switch_nut]);
195   pdp1_plot_pixel(bitmap, x+5, y+2, machine->pens[pen_switch_nut]);
196   pdp1_plot_pixel(bitmap, x+2, y+5, machine->pens[pen_switch_nut]);
197   pdp1_plot_pixel(bitmap, x+5, y+5, machine->pens[pen_switch_nut]);
200198
201199   /* draw button (->disc) */
202200   if (! state)
203201      y += 4;
204202   for (i=0; i<2;i++)
205203   {
206      pdp1_plot_pixel(bitmap, x+3+i, y, Machine->pens[pen_switch_button]);
207      pdp1_plot_pixel(bitmap, x+3+i, y+3, Machine->pens[pen_switch_button]);
204      pdp1_plot_pixel(bitmap, x+3+i, y, machine->pens[pen_switch_button]);
205      pdp1_plot_pixel(bitmap, x+3+i, y+3, machine->pens[pen_switch_button]);
208206   }
209207   for (i=0; i<4;i++)
210208   {
211      pdp1_plot_pixel(bitmap, x+2+i, y+1, Machine->pens[pen_switch_button]);
212      pdp1_plot_pixel(bitmap, x+2+i, y+2, Machine->pens[pen_switch_button]);
209      pdp1_plot_pixel(bitmap, x+2+i, y+1, machine->pens[pen_switch_button]);
210      pdp1_plot_pixel(bitmap, x+2+i, y+2, machine->pens[pen_switch_button]);
213211   }
214212}
215213
216214
217215/* draw nb_bits switches which represent nb_bits bits in value */
218static void pdp1_draw_multipleswitch(bitmap_t *bitmap, int x, int y, int value, int nb_bits)
216static void pdp1_draw_multipleswitch(running_machine *machine, bitmap_t *bitmap, int x, int y, int value, int nb_bits)
219217{
220218   while (nb_bits)
221219   {
222220      nb_bits--;
223221
224      pdp1_draw_switch(bitmap, x, y, (value >> nb_bits) & 1);
222      pdp1_draw_switch(machine, bitmap, x, y, (value >> nb_bits) & 1);
225223
226224      x += 8;
227225   }
r1932r1933
229227
230228
231229/* write a single char on screen */
232static void pdp1_draw_char(bitmap_t *bitmap, char character, int x, int y, int color)
230static void pdp1_draw_char(running_machine *machine, bitmap_t *bitmap, char character, int x, int y, int color)
233231{
234   drawgfx(bitmap, Machine->gfx[0], character-32, color, 0, 0,
235            x+1, y, &Machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
232   drawgfx(bitmap, machine->gfx[0], character-32, color, 0, 0,
233            x+1, y, &machine->screen[0].visarea, TRANSPARENCY_PEN, 0);
236234}
237235
238236/* write a string on screen */
239static void pdp1_draw_string(bitmap_t *bitmap, const char *buf, int x, int y, int color)
237static void pdp1_draw_string(running_machine *machine, bitmap_t *bitmap, const char *buf, int x, int y, int color)
240238{
241239   while (* buf)
242240   {
243      pdp1_draw_char(bitmap, *buf, x, y, color);
241      pdp1_draw_char(machine, bitmap, *buf, x, y, color);
244242
245243      x += 8;
246244      buf++;
r1932r1933
251249/*
252250   draw the operator control panel (fixed backdrop)
253251*/
254static void pdp1_draw_panel_backdrop(bitmap_t *bitmap)
252static void pdp1_draw_panel_backdrop(running_machine *machine, bitmap_t *bitmap)
255253{
256254   /* fill with black */
257   fillbitmap(panel_bitmap, Machine->pens[pen_panel_bg], &panel_bitmap_bounds);
255   fillbitmap(panel_bitmap, machine->pens[pen_panel_bg], &panel_bitmap_bounds);
258256
259257   /* column 1: registers, test word, test address */
260   pdp1_draw_string(bitmap, "program counter", x_panel_col1_offset, y_panel_pc_offset, color_panel_caption);
261   pdp1_draw_string(bitmap, "memory address", x_panel_col1_offset, y_panel_ma_offset, color_panel_caption);
262   pdp1_draw_string(bitmap, "memory buffer", x_panel_col1_offset, y_panel_mb_offset, color_panel_caption);
263   pdp1_draw_string(bitmap, "accumulator", x_panel_col1_offset, y_panel_ac_offset, color_panel_caption);
264   pdp1_draw_string(bitmap, "in-out", x_panel_col1_offset, y_panel_io_offset, color_panel_caption);
265   pdp1_draw_string(bitmap, "extend  address", x_panel_col1_offset-8, y_panel_ta_offset, color_panel_caption);
266   pdp1_draw_string(bitmap, "test word", x_panel_col1_offset, y_panel_tw_offset, color_panel_caption);
258   pdp1_draw_string(machine, bitmap, "program counter", x_panel_col1_offset, y_panel_pc_offset, color_panel_caption);
259   pdp1_draw_string(machine, bitmap, "memory address", x_panel_col1_offset, y_panel_ma_offset, color_panel_caption);
260   pdp1_draw_string(machine, bitmap, "memory buffer", x_panel_col1_offset, y_panel_mb_offset, color_panel_caption);
261   pdp1_draw_string(machine, bitmap, "accumulator", x_panel_col1_offset, y_panel_ac_offset, color_panel_caption);
262   pdp1_draw_string(machine, bitmap, "in-out", x_panel_col1_offset, y_panel_io_offset, color_panel_caption);
263   pdp1_draw_string(machine, bitmap, "extend  address", x_panel_col1_offset-8, y_panel_ta_offset, color_panel_caption);
264   pdp1_draw_string(machine, bitmap, "test word", x_panel_col1_offset, y_panel_tw_offset, color_panel_caption);
267265
268266   /* column separator */
269267   plot_box(bitmap, x_panel_col2_offset-4, panel_window_offset_y+8, 1, 96, pen_panel_caption);
270268
271269   /* column 2: 1-bit indicators */
272   pdp1_draw_string(bitmap, "run", x_panel_col2_offset+8, y_panel_run_offset, color_panel_caption);
273   pdp1_draw_string(bitmap, "cycle", x_panel_col2_offset+8, y_panel_cyc_offset, color_panel_caption);
274   pdp1_draw_string(bitmap, "defer", x_panel_col2_offset+8, y_panel_defer_offset, color_panel_caption);
275   pdp1_draw_string(bitmap, "h. s. cycle", x_panel_col2_offset+8, y_panel_hs_cyc_offset, color_panel_caption);
276   pdp1_draw_string(bitmap, "brk. ctr. 1", x_panel_col2_offset+8, y_panel_brk_ctr_1_offset, color_panel_caption);
277   pdp1_draw_string(bitmap, "brk. ctr. 2", x_panel_col2_offset+8, y_panel_brk_ctr_2_offset, color_panel_caption);
278   pdp1_draw_string(bitmap, "overflow", x_panel_col2_offset+8, y_panel_ov_offset, color_panel_caption);
279   pdp1_draw_string(bitmap, "read in", x_panel_col2_offset+8, y_panel_rim_offset, color_panel_caption);
280   pdp1_draw_string(bitmap, "seq. break", x_panel_col2_offset+8, y_panel_sbm_offset, color_panel_caption);
281   pdp1_draw_string(bitmap, "extend", x_panel_col2_offset+8, y_panel_exd_offset, color_panel_caption);
282   pdp1_draw_string(bitmap, "i-o halt", x_panel_col2_offset+8, y_panel_ioh_offset, color_panel_caption);
283   pdp1_draw_string(bitmap, "i-o com'ds", x_panel_col2_offset+8, y_panel_ioc_offset, color_panel_caption);
284   pdp1_draw_string(bitmap, "i-o sync", x_panel_col2_offset+8, y_panel_ios_offset, color_panel_caption);
270   pdp1_draw_string(machine, bitmap, "run", x_panel_col2_offset+8, y_panel_run_offset, color_panel_caption);
271   pdp1_draw_string(machine, bitmap, "cycle", x_panel_col2_offset+8, y_panel_cyc_offset, color_panel_caption);
272   pdp1_draw_string(machine, bitmap, "defer", x_panel_col2_offset+8, y_panel_defer_offset, color_panel_caption);
273   pdp1_draw_string(machine, bitmap, "h. s. cycle", x_panel_col2_offset+8, y_panel_hs_cyc_offset, color_panel_caption);
274   pdp1_draw_string(machine, bitmap, "brk. ctr. 1", x_panel_col2_offset+8, y_panel_brk_ctr_1_offset, color_panel_caption);
275   pdp1_draw_string(machine, bitmap, "brk. ctr. 2", x_panel_col2_offset+8, y_panel_brk_ctr_2_offset, color_panel_caption);
276   pdp1_draw_string(machine, bitmap, "overflow", x_panel_col2_offset+8, y_panel_ov_offset, color_panel_caption);
277   pdp1_draw_string(machine, bitmap, "read in", x_panel_col2_offset+8, y_panel_rim_offset, color_panel_caption);
278   pdp1_draw_string(machine, bitmap, "seq. break", x_panel_col2_offset+8, y_panel_sbm_offset, color_panel_caption);
279   pdp1_draw_string(machine, bitmap, "extend", x_panel_col2_offset+8, y_panel_exd_offset, color_panel_caption);
280   pdp1_draw_string(machine, bitmap, "i-o halt", x_panel_col2_offset+8, y_panel_ioh_offset, color_panel_caption);
281   pdp1_draw_string(machine, bitmap, "i-o com'ds", x_panel_col2_offset+8, y_panel_ioc_offset, color_panel_caption);
282   pdp1_draw_string(machine, bitmap, "i-o sync", x_panel_col2_offset+8, y_panel_ios_offset, color_panel_caption);
285283
286284   /* column separator */
287285   plot_box(bitmap, x_panel_col3_offset-4, panel_window_offset_y+8, 1, 96, pen_panel_caption);
288286
289287   /* column 3: power, single step, single inst, sense, flags, instr... */
290   pdp1_draw_string(bitmap, "power", x_panel_col3_offset+16, y_panel_power_offset, color_panel_caption);
291   pdp1_draw_string(bitmap, "single step", x_panel_col3_offset+16, y_panel_sngl_step_offset, color_panel_caption);
292   pdp1_draw_string(bitmap, "single inst.", x_panel_col3_offset+16, y_panel_sngl_inst_offset, color_panel_caption);
288   pdp1_draw_string(machine, bitmap, "power", x_panel_col3_offset+16, y_panel_power_offset, color_panel_caption);
289   pdp1_draw_string(machine, bitmap, "single step", x_panel_col3_offset+16, y_panel_sngl_step_offset, color_panel_caption);
290   pdp1_draw_string(machine, bitmap, "single inst.", x_panel_col3_offset+16, y_panel_sngl_inst_offset, color_panel_caption);
293291   /* separator */
294292   plot_box(bitmap, x_panel_col3_offset+8, y_panel_sep1_offset+4, 96, 1, pen_panel_caption);
295   pdp1_draw_string(bitmap, "sense switches", x_panel_col3_offset, y_panel_ss_offset, color_panel_caption);
293   pdp1_draw_string(machine, bitmap, "sense switches", x_panel_col3_offset, y_panel_ss_offset, color_panel_caption);
296294   /* separator */
297295   plot_box(bitmap, x_panel_col3_offset+8, y_panel_sep2_offset+4, 96, 1, pen_panel_caption);
298   pdp1_draw_string(bitmap, "program flags", x_panel_col3_offset, y_panel_pf_offset, color_panel_caption);
299   pdp1_draw_string(bitmap, "instruction", x_panel_col3_offset, y_panel_ir_offset, color_panel_caption);
296   pdp1_draw_string(machine, bitmap, "program flags", x_panel_col3_offset, y_panel_pf_offset, color_panel_caption);
297   pdp1_draw_string(machine, bitmap, "instruction", x_panel_col3_offset, y_panel_ir_offset, color_panel_caption);
300298}
301299
302300/*
303301   draw the operator control panel (dynamic elements)
304302*/
305static void pdp1_draw_panel(bitmap_t *bitmap)
303static void pdp1_draw_panel(running_machine *machine, bitmap_t *bitmap)
306304{
307305   /* column 1: registers, test word, test address */
308   pdp1_draw_multipleled(bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpunum_get_reg(0, PDP1_PC), 16);
309   pdp1_draw_multipleled(bitmap, x_panel_col1_offset+2*8, y_panel_ma_offset+8, cpunum_get_reg(0, PDP1_MA), 16);
310   pdp1_draw_multipleled(bitmap, x_panel_col1_offset, y_panel_mb_offset+8, cpunum_get_reg(0, PDP1_MB), 18);
311   pdp1_draw_multipleled(bitmap, x_panel_col1_offset, y_panel_ac_offset+8, cpunum_get_reg(0, PDP1_AC), 18);
312   pdp1_draw_multipleled(bitmap, x_panel_col1_offset, y_panel_io_offset+8, cpunum_get_reg(0, PDP1_IO), 18);
313   pdp1_draw_switch(bitmap, x_panel_col1_offset, y_panel_ta_offset+8, cpunum_get_reg(0, PDP1_EXTEND_SW));
314   pdp1_draw_multipleswitch(bitmap, x_panel_col1_offset+2*8, y_panel_ta_offset+8, cpunum_get_reg(0, PDP1_TA), 16);
315   pdp1_draw_multipleswitch(bitmap, x_panel_col1_offset, y_panel_tw_offset+8, cpunum_get_reg(0, PDP1_TW), 18);
306   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_pc_offset+8, cpunum_get_reg(0, PDP1_PC), 16);
307   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ma_offset+8, cpunum_get_reg(0, PDP1_MA), 16);
308   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_mb_offset+8, cpunum_get_reg(0, PDP1_MB), 18);
309   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_ac_offset+8, cpunum_get_reg(0, PDP1_AC), 18);
310   pdp1_draw_multipleled(machine, bitmap, x_panel_col1_offset, y_panel_io_offset+8, cpunum_get_reg(0, PDP1_IO), 18);
311   pdp1_draw_switch(machine, bitmap, x_panel_col1_offset, y_panel_ta_offset+8, cpunum_get_reg(0, PDP1_EXTEND_SW));
312   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset+2*8, y_panel_ta_offset+8, cpunum_get_reg(0, PDP1_TA), 16);
313   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col1_offset, y_panel_tw_offset+8, cpunum_get_reg(0, PDP1_TW), 18);
316314
317315   /* column 2: 1-bit indicators */
318   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_run_offset, cpunum_get_reg(0, PDP1_RUN));
319   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_cyc_offset, cpunum_get_reg(0, PDP1_CYC));
320   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_defer_offset, cpunum_get_reg(0, PDP1_DEFER));
321   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_hs_cyc_offset, 0);   /* not emulated */
322   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_brk_ctr_1_offset, cpunum_get_reg(0, PDP1_BRK_CTR) & 1);
323   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_brk_ctr_2_offset, cpunum_get_reg(0, PDP1_BRK_CTR) & 2);
324   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_ov_offset, cpunum_get_reg(0, PDP1_OV));
325   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_rim_offset, cpunum_get_reg(0, PDP1_RIM));
326   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_sbm_offset, cpunum_get_reg(0, PDP1_SBM));
327   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_exd_offset, cpunum_get_reg(0, PDP1_EXD));
328   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpunum_get_reg(0, PDP1_IOH));
329   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_ioc_offset, cpunum_get_reg(0, PDP1_IOC));
330   pdp1_draw_led(bitmap, x_panel_col2_offset, y_panel_ios_offset, cpunum_get_reg(0, PDP1_IOS));
316   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_run_offset, cpunum_get_reg(0, PDP1_RUN));
317   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_cyc_offset, cpunum_get_reg(0, PDP1_CYC));
318   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_defer_offset, cpunum_get_reg(0, PDP1_DEFER));
319   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_hs_cyc_offset, 0);   /* not emulated */
320   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_1_offset, cpunum_get_reg(0, PDP1_BRK_CTR) & 1);
321   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_brk_ctr_2_offset, cpunum_get_reg(0, PDP1_BRK_CTR) & 2);
322   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ov_offset, cpunum_get_reg(0, PDP1_OV));
323   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_rim_offset, cpunum_get_reg(0, PDP1_RIM));
324   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_sbm_offset, cpunum_get_reg(0, PDP1_SBM));
325   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_exd_offset, cpunum_get_reg(0, PDP1_EXD));
326   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioh_offset, cpunum_get_reg(0, PDP1_IOH));
327   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ioc_offset, cpunum_get_reg(0, PDP1_IOC));
328   pdp1_draw_led(machine, bitmap, x_panel_col2_offset, y_panel_ios_offset, cpunum_get_reg(0, PDP1_IOS));
331329
332330   /* column 3: power, single step, single inst, sense, flags, instr... */
333   pdp1_draw_led(bitmap, x_panel_col3_offset, y_panel_power_offset, 1);   /* always on */
334   pdp1_draw_switch(bitmap, x_panel_col3_offset+8, y_panel_power_offset, 1);   /* always on */
335   pdp1_draw_led(bitmap, x_panel_col3_offset, y_panel_sngl_step_offset, cpunum_get_reg(0, PDP1_SNGL_STEP));
336   pdp1_draw_switch(bitmap, x_panel_col3_offset+8, y_panel_sngl_step_offset, cpunum_get_reg(0, PDP1_SNGL_STEP));
337   pdp1_draw_led(bitmap, x_panel_col3_offset, y_panel_sngl_inst_offset, cpunum_get_reg(0, PDP1_SNGL_INST));
338   pdp1_draw_switch(bitmap, x_panel_col3_offset+8, y_panel_sngl_inst_offset, cpunum_get_reg(0, PDP1_SNGL_INST));
339   pdp1_draw_multipleled(bitmap, x_panel_col3_offset, y_panel_ss_offset+8, cpunum_get_reg(0, PDP1_SS), 6);
340   pdp1_draw_multipleswitch(bitmap, x_panel_col3_offset, y_panel_ss_offset+2*8, cpunum_get_reg(0, PDP1_SS), 6);
341   pdp1_draw_multipleled(bitmap, x_panel_col3_offset, y_panel_pf_offset+8, cpunum_get_reg(0, PDP1_PF), 6);
342   pdp1_draw_multipleled(bitmap, x_panel_col3_offset, y_panel_ir_offset+8, cpunum_get_reg(0, PDP1_IR), 5);
331   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_power_offset, 1);   /* always on */
332   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_power_offset, 1);   /* always on */
333   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_step_offset, cpunum_get_reg(0, PDP1_SNGL_STEP));
334   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_step_offset, cpunum_get_reg(0, PDP1_SNGL_STEP));
335   pdp1_draw_led(machine, bitmap, x_panel_col3_offset, y_panel_sngl_inst_offset, cpunum_get_reg(0, PDP1_SNGL_INST));
336   pdp1_draw_switch(machine, bitmap, x_panel_col3_offset+8, y_panel_sngl_inst_offset, cpunum_get_reg(0, PDP1_SNGL_INST));
337   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+8, cpunum_get_reg(0, PDP1_SS), 6);
338   pdp1_draw_multipleswitch(machine, bitmap, x_panel_col3_offset, y_panel_ss_offset+2*8, cpunum_get_reg(0, PDP1_SS), 6);
339   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_pf_offset+8, cpunum_get_reg(0, PDP1_PF), 6);
340   pdp1_draw_multipleled(machine, bitmap, x_panel_col3_offset, y_panel_ir_offset+8, cpunum_get_reg(0, PDP1_IR), 5);
343341}
344342
345343
r1932r1933
372370};
373371
374372
375static void pdp1_typewriter_linefeed(void)
373static void pdp1_typewriter_linefeed(running_machine *machine)
376374{
377375   UINT8 buf[typewriter_window_width];
378376   int y;
r1932r1933
380378   for (y=0; y<typewriter_window_height-typewriter_scroll_step; y++)
381379   {
382380      extract_scanline8(typewriter_bitmap, 0, y+typewriter_scroll_step, typewriter_window_width, buf);
383      draw_scanline8(typewriter_bitmap, 0, y, typewriter_window_width, buf, Machine->pens, -1);
381      draw_scanline8(typewriter_bitmap, 0, y, typewriter_window_width, buf, machine->pens, -1);
384382   }
385383
386   fillbitmap(typewriter_bitmap, Machine->pens[pen_typewriter_bg], &typewriter_scroll_clear_window);
384   fillbitmap(typewriter_bitmap, machine->pens[pen_typewriter_bg], &typewriter_scroll_clear_window);
387385}
388386
389void pdp1_typewriter_drawchar(int character)
387void pdp1_typewriter_drawchar(running_machine *machine, int character)
390388{
391389   static const char ascii_table[2][64] =
392390   {   /* n-s = non-spacing */
r1932r1933
468466   case 077:
469467      /* Carriage Return */
470468      pos = 0;
471      pdp1_typewriter_linefeed();
469      pdp1_typewriter_linefeed(machine);
472470      break;
473471
474472   default:
r1932r1933
476474
477475      if (pos >= 80)
478476      {   /* if past right border, wrap around. (Right???) */
479         pdp1_typewriter_linefeed();   /* next line */
477         pdp1_typewriter_linefeed(machine);   /* next line */
480478         pos = 0;               /* return to start of line */
481479      }
482480
483481      /* print character (lookup ASCII equivalent in table) */
484      pdp1_draw_char(typewriter_bitmap, ascii_table[case_shift][character],
482      pdp1_draw_char(machine, typewriter_bitmap, ascii_table[case_shift][character],
485483                  8*pos, typewriter_write_offset_y,
486484                  color);   /* print char */
487485
src/mess/machine/pdp1.c
r1932r1933
743743   if (LOG_IOT_EXTRA)
744744      logerror("typewriter output %o\n", data);
745745
746   pdp1_typewriter_drawchar(data);
746   pdp1_typewriter_drawchar(Machine, data);
747747   if (typewriter.fd)
748748#if 1
749749      image_fwrite(typewriter.fd, & data, 1);
r1932r1933
12771277            cpunum_set_input_line_and_vector(Machine, 0, 0, ASSERT_LINE, 0);   /* interrupt it, baby */
12781278         #endif
12791279         cpunum_set_reg(0, PDP1_PF1, 1);
1280         pdp1_typewriter_drawchar(typewriter.tb);   /* we want to echo input */
1280         pdp1_typewriter_drawchar(Machine, typewriter.tb);   /* we want to echo input */
12811281         break;
12821282      }
12831283   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team