Previous 15994 Revisions Next

r3856 Tuesday 16th December, 2008 at 21:46:36 UTC by Antoine Mine
Fixed kermit and xmodem device names
[src/mess/devices]kermit.h xmodem.h
[src/mess/drivers]hp48.c
[src/mess/machine]hp48.c
[src/mess/video]hp48.c

src/mess/video/hp48.c
r3855r3856
131131   data >>= 1
132132
133133#define draw_quart               \
134   UINT8 data = memory_read_byte(cputag_get_address_space(screen->machine,"main",ADDRESS_SPACE_PROGRAM), addr );   \
134   UINT8 data = memory_read_byte( space, addr );   \
135135   draw_pixel; draw_pixel; draw_pixel; draw_pixel;
136136
137137
138138VIDEO_UPDATE ( hp48 )
139139{
140   const address_space *space = cpu_get_address_space( cputag_get_cpu(screen->machine, "main"), ADDRESS_SPACE_PROGRAM );
140141   int x, y, xp, i, addr;
141142   int display       = HP48_IO_4(0) >> 3;           /* 1=on, 0=off */
142143   int left_margin   = HP48_IO_4(0) & 7;            /* 0..7 pixels for main bitmap */
r3855r3856
146147   int right_margin  = HP48_IO_12(0x25) & ~1;       /* -2048..2046 nibbles for main bitmap */
147148   int last_line     = HP48_IO_8(0x28) & 0x3f;      /* 2..63 lines of main bitmap before menu */
148149   int menu_start    = HP48_IO_20(0x30) & ~1;       /* menu bitmap address */
149
150150   int fg = contrast + 1;
151151
152152   LOG(( "%f hp48 video_update called: ", attotime_to_double(timer_get_time(screen->machine)) ));
src/mess/machine/hp48.c
r3855r3856
88
99#include "driver.h"
1010#include "timer.h"
11#include "state.h"
11#include "state.h"
1212#include "device.h"
1313#include "sound/dac.h"
1414#include "cpu/saturn/saturn.h"
r3855r3856
186186/* end of send event */
187187static TIMER_CALLBACK( hp48_rs232_byte_sent_cb )
188188{   
189   const device_config *xmodem = device_list_find_by_tag( machine->config->devicelist, XMODEM, "rs232-x" );
190   const device_config *kermit = device_list_find_by_tag( machine->config->devicelist, KERMIT, "rs232-k" );
189   const device_config *xmodem = device_list_find_by_tag( machine->config->devicelist, XMODEM, "rs232_x" );
190   const device_config *kermit = device_list_find_by_tag( machine->config->devicelist, KERMIT, "rs232_k" );
191191
192192   LOG_SERIAL(( "%f hp48_rs232_byte_sent_cb: end of send, data=%02x\n",
193193           attotime_to_double(timer_get_time(machine)), param ));
r3855r3856
211211/* CPU initiates a send event */
212212static void hp48_rs232_send_byte( running_machine *machine )
213213{
214   const device_config *xmodem = device_list_find_by_tag( machine->config->devicelist, XMODEM, "rs232-x" );
215   const device_config *kermit = device_list_find_by_tag( machine->config->devicelist, KERMIT, "rs232-k" );
216   
214   const device_config *xmodem = device_list_find_by_tag( machine->config->devicelist, XMODEM, "rs232_x" );
215   const device_config *kermit = device_list_find_by_tag( machine->config->devicelist, KERMIT, "rs232_k" );   
217216   UINT8 data = HP48_IO_8(0x16); /* byte to send */
218217
219//   LOG_SERIAL(( "%05x %f hp48_rs232_send_byte: start sending, data=%02x\n",
220//           activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)), data ));
218   LOG_SERIAL(( "%05x %f hp48_rs232_send_byte: start sending, data=%02x\n",
219           cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)), data ));
221220
222221   hp48_io[0x12] |= 3;           /* set byte sending and send buffer full */
223222
r3855r3856
272271   }
273272
274273   /* schedule end of reception */
275   timer_set( RS232_DELAY, NULL, 0, hp48_chardev_byte_recv_cb );
274   timer_set( machine, RS232_DELAY, NULL, 0, hp48_chardev_byte_recv_cb );
276275}
277276
278277static void hp48_chardev_ready_to_send( running_machine *machine )
r3855r3856
298297/* CPU sets OUT register (keyboard + beeper) */
299298void hp48_reg_out( running_machine* machine, int out )
300299{
301//   LOG(( "%05x %f hp48_reg_out: %03x\n",
302//         activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)), out ));
300   LOG(( "%05x %f hp48_reg_out: %03x\n",
301         cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)), out ));
303302
304303   /* bits 0-8: keyboard lines */
305304   hp48_out = out & 0x1ff;
r3855r3856
335334int hp48_reg_in( running_machine* machine )
336335{
337336   int in = hp48_get_in( machine );
338//   LOG(( "%05x %f hp48_reg_in: %04x\n",
339//         activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)), in ));
337   LOG(( "%05x %f hp48_reg_in: %04x\n",
338         cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)), in ));
340339   return in;
341340}
342341
r3855r3856
378377/* RSI opcode */
379378void hp48_rsi( running_machine *machine )
380379{
381//   LOG(( "%05x %f hp48_rsi\n", activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)) ));
380   LOG(( "%05x %f hp48_rsi\n", cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)) ));
382381
383382   /* enables interrupts on key repeat
384383      (normally, there is only one interrupt, when the key is pressed)
r3855r3856
464463   /* cards */
465464   case 0x0e:
466465      LOG(( "%05x: card control write %02x\n", cpu_get_previouspc(space->cpu), data ));
466
467467      /* bit 0: software interrupt */
468468      if ( data & 1 )
469469      {
r3855r3856
596596   {
597597                /* second nibble of received data */
598598
599      const device_config *xmodem = device_list_find_by_tag( space->machine->config->devicelist, XMODEM, "rs232-x" );
600      const device_config *kermit = device_list_find_by_tag( space->machine->config->devicelist, KERMIT, "rs232-k" );
599      const device_config *xmodem = device_list_find_by_tag( space->machine->config->devicelist, XMODEM, "rs232_x" );
600      const device_config *kermit = device_list_find_by_tag( space->machine->config->devicelist, KERMIT, "rs232_k" );   
601601
602602      hp48_io[0x11] &= ~1;  /* clear byte received */
603603      data = hp48_io[offset];
r3855r3856
714714/* --------- memory controller ----------- */
715715
716716/*
717   Clark (S series) and York (G series) CPUs have 6 daisy-chainedmodules
717   Clark (S series) and York (G series) CPUs have 6 daisy-chained modules
718718
719719
720720   <-- highest --------- priority ------------- lowest -->
r3855r3856
754754{
755755   int i;
756756   int nce2_enable = 1;
757   const address_space* space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
757758
758759   hp48_io_addr = 0x100000;
759760
r3855r3856
812813              select_mask, hp48_module_names[i] );
813814         continue;
814815      }
815      memory_install_read8_handler( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), base, end, 0, mirror, hp48_modules[i].read );
816      memory_install_write8_handler( cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), base, end, 0, mirror, hp48_modules[i].write );
816      memory_install_read8_handler( space, base, end, 0, mirror, hp48_modules[i].read );
817      memory_install_write8_handler( space, base, end, 0, mirror, hp48_modules[i].write );
817818
818819      LOG(( "hp48_mem_config: module %s configured at %05x-%05x, mirror %05x\n",
819820            hp48_module_names[i], base, end, mirror ));
820821
821822      if ( hp48_modules[i].data )
822823      {
823         memory_set_bankptr( machine, i, hp48_modules[i].data );
824         memory_set_bankptr( space->machine, i, hp48_modules[i].data );
824825      }
825826
826827      if ( i == 0 )
r3855r3856
856857/* RESET opcode */
857858void hp48_mem_reset( running_machine* machine )
858859{
859//   LOG(( "%05x %f hp48_mem_reset\n", activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)) ));
860   LOG(( "%05x %f hp48_mem_reset\n", cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)) ));
860861   hp48_reset_modules( machine );
861862}
862863
r3855r3856
866867{   
867868   int i;
868869
869//   LOG(( "%05x %f hp48_mem_config: %05x\n", activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)), v ));
870   LOG(( "%05x %f hp48_mem_config: %05x\n", cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)), v ));
870871
871872   /* find the highest priority unconfigured module (except non-configurable NCE1)... */
872873   for ( i = 0; i < 5; i++ )
r3855r3856
897898void hp48_mem_unconfig( running_machine* machine, int v )
898899{   
899900   int i;
900//   LOG(( "%05x %f hp48_mem_unconfig: %05x\n", activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)), v ));
901   LOG(( "%05x %f hp48_mem_unconfig: %05x\n", cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)), v ));
901902
902903   /* find the highest priority fully configured module at address v (except NCE1)... */
903904   for ( i = 0; i < 5; i++ )
r3855r3856
939940      }
940941   }
941942
942//   LOG(( "%05x %f hp48_mem_id = %02x\n",
943//         activecpu_get_previouspc(), attotime_to_double(timer_get_time(machine)), data ));
943   LOG(( "%05x %f hp48_mem_id = %02x\n",
944         cpu_get_previouspc(machine->cpu[0]), attotime_to_double(timer_get_time(machine)), data ));
944945
945946   return data; /* everything is configured */
946947}
r3855r3856
11511152   generic_nvram_size = 2 * ram_size;
11521153   generic_nvram = auto_malloc( generic_nvram_size );
11531154   ram = (UINT8*) generic_nvram;
1154   memset( generic_nvram, 0, generic_nvram_size );
11551155
11561156   /* ROM load */
11571157   rom_size = HP48_S_SERIES ? (256 * 1024) : (512 * 1024);
r3855r3856
11861186                /* bank switcher */
11871187      hp48_modules[2].off_mask = 0x00fff;  /* 2 KB */
11881188      hp48_modules[2].read     = hp48_bank_r;
1189      hp48_modules[2].write    = SMH_NOP;
11891190   }
11901191
11911192   /* ROM */
11921193   hp48_modules[5].off_mask = 2 * rom_size - 1;
11931194   hp48_modules[5].read     = SMH_BANK5;
1195   hp48_modules[5].write    = SMH_NOP;
11941196   hp48_modules[5].data     = rom;
11951197
11961198   /* timers */
src/mess/devices/xmodem.h
r3855r3856
2323} xmodem_config;
2424
2525
26#define MDRV_XMODEM_ADD(_tag, _intrf) \
27  MDRV_DEVICE_ADD(_tag, XMODEM)         \
28  MDRV_DEVICE_CONFIG(_intrf)
2629
30#define MDRV_XMODEM_REMOVE(_tag)      \
31  MDRV_DEVICE_REMOVE(_tag, XMODEM)
32
33
2734extern DEVICE_GET_INFO( xmodem );
2835
2936
src/mess/devices/kermit.h
r3855r3856
2323} kermit_config;
2424
2525
26#define MDRV_KERMIT_ADD(_tag, _intrf) \
27  MDRV_DEVICE_ADD(_tag, KERMIT)         \
28  MDRV_DEVICE_CONFIG(_intrf)
2629
30#define MDRV_KERMIT_REMOVE(_tag)      \
31  MDRV_DEVICE_REMOVE(_tag, KERMIT)
32
33
2734extern DEVICE_GET_INFO( kermit );
2835
2936
src/mess/drivers/hp48.c
r3855r3856
984984   MDRV_DEVICE_CONFIG  ( hp48gx_port2_config )
985985     
986986   /* serial I/O */
987   MDRV_DEVICE_ADD( "rs232_x", XMODEM )
988   MDRV_DEVICE_CONFIG( hp48_xmodem_rs232_conf )
989   MDRV_DEVICE_ADD( "rs232_k", KERMIT )
990   MDRV_DEVICE_CONFIG( hp48_kermit_rs232_conf )
987   MDRV_XMODEM_ADD( "rs232_x", hp48_xmodem_rs232_conf )
988   MDRV_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
991989MACHINE_DRIVER_END
992990
993991static MACHINE_DRIVER_START ( hp48g )
r3855r3856
996994   MDRV_DEFAULT_LAYOUT ( layout_hp48g )
997995
998996   /* serial I/O */
999   MDRV_DEVICE_ADD( "rs232_x", XMODEM )
1000   MDRV_DEVICE_CONFIG( hp48_xmodem_rs232_conf )
1001   MDRV_DEVICE_ADD( "rs232_k", KERMIT )
1002   MDRV_DEVICE_CONFIG( hp48_kermit_rs232_conf )
997   MDRV_XMODEM_ADD( "rs232_x", hp48_xmodem_rs232_conf )
998   MDRV_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
1003999MACHINE_DRIVER_END
10041000
10051001
r3855r3856
10161012   MDRV_DEVICE_CONFIG  ( hp48sx_port2_config )
10171013
10181014   /* serial I/O */
1019   MDRV_DEVICE_ADD( "rs232_k", KERMIT )
1020   MDRV_DEVICE_CONFIG( hp48_kermit_rs232_conf )
1015   MDRV_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
10211016MACHINE_DRIVER_END
10221017
10231018static MACHINE_DRIVER_START ( hp48s )
r3855r3856
10271022   MDRV_DEFAULT_LAYOUT ( layout_hp48s )
10281023
10291024   /* serial I/O */
1030   MDRV_DEVICE_ADD( "rs232_k", KERMIT )
1031   MDRV_DEVICE_CONFIG( hp48_kermit_rs232_conf )
1025   MDRV_KERMIT_ADD( "rs232_k", hp48_kermit_rs232_conf )
10321026MACHINE_DRIVER_END
10331027
10341028

Previous 15994 Revisions Next


© 1998-2018 The MESS Team