Previous 15994 Revisions Next

r2199 Tuesday 1st April, 2008 at 16:44:11 UTC by Firewave
Machine -> machine cleanups
[src/mess]mscommon.c mscommon.h
[src/mess/devices]appldriv.c coco_fdc.c cococart.c cococart.h thomflop.c thomflop.h
[src/mess/machine]coco.c thomson.c
[src/mess/video]apple1.c kaypro.c

src/mess/devices/cococart.h
r2198r2199
9898cococart_line_value cococart_get_line(coco_cartridge *cartridge, cococart_line line);
9999void cococart_map_memory(coco_cartridge *cartridge, UINT32 offset, UINT32 mask);
100100
101coco_cartridge *cococart_init(const char *carttype, const coco_cartridge_config *callbacks);
101coco_cartridge *cococart_init(running_machine *machine, const char *carttype, const coco_cartridge_config *callbacks);
102102UINT8 cococart_read(coco_cartridge *cartridge, UINT16 address);
103103void cococart_write(coco_cartridge *cartridge, UINT16 address, UINT8 data);
104104void cococart_enable_sound(coco_cartridge *cartridge, int enable);
src/mess/devices/coco_fdc.c
r2198r2199
142142    fdc_init - general function to initialize FDC
143143-------------------------------------------------*/
144144
145static void fdc_init(coco_cartridge *cartridge,
145static void fdc_init(running_machine *machine,
146   coco_cartridge *cartridge,
146147   wd17xx_type_t type,
147148   void (*update_lines)(coco_cartridge *cartridge),
148149   int initial_drq)
r2198r2199
155156   info->drq = initial_drq ? 1 : 0;
156157
157158   /* initialize FDC */
158   wd17xx_init(Machine, type, fdc_callback, (void *) cartridge);
159   wd17xx_init(machine, type, fdc_callback, (void *) cartridge);
159160}
160161
161162
r2198r2199
213214
214215static void fdc_coco_init(coco_cartridge *cartridge)
215216{
216   fdc_init(cartridge, WD_TYPE_1773, fdc_coco_update_lines, 1);
217   fdc_init(Machine, cartridge, WD_TYPE_1773, fdc_coco_update_lines, 1);
217218}
218219
219220
r2198r2199
522523
523524static void fdc_dragon_init(coco_cartridge *cartridge)
524525{
525   fdc_init(cartridge, WD_TYPE_179X, fdc_dragon_update_lines, 0);
526   fdc_init(Machine, cartridge, WD_TYPE_179X, fdc_dragon_update_lines, 0);
526527}
527528
528529
src/mess/devices/appldriv.c
r2198r2199
218218
219219
220220
221static const device_config *apple525_selected_image(void)
221static const device_config *apple525_selected_image(running_machine *machine)
222222{
223223   int i, count;
224224
225   count = device_count_tag_from_machine(Machine, APPLE525TAG);
225   count = device_count_tag_from_machine(machine, APPLE525TAG);
226226
227227   for (i = 0; i < count; i++)
228228   {
r2198r2199
237237UINT8 apple525_read_data(void)
238238{
239239   const device_config *image;
240   image = apple525_selected_image();
240   image = apple525_selected_image(Machine);
241241   return image ? apple525_process_byte(image, -1) : 0xFF;
242242}
243243
r2198r2199
246246void apple525_write_data(UINT8 data)
247247{
248248   const device_config *image;
249   image = apple525_selected_image();
249   image = apple525_selected_image(Machine);
250250   if (image)
251251      apple525_process_byte(image, data);
252252}
src/mess/devices/thomflop.c
r2198r2199
77**********************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "includes/thomson.h"
1211#include "machine/wd17xx.h"
1312#include "devices/flopdrv.h"
r2198r2199
333332
334333
335334
336static void to7_5p14_reset( void )
335static void to7_5p14_reset( running_machine *machine )
337336{
338337   int i;
339338   LOG(( "to7_5p14_reset: CD 90-640 controller\n" ));
340339   thom_floppy_set_density( DEN_MFM_LO );
341340   wd17xx_reset();
342   for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ )
341   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
343342   {
344343      const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i );
345344      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
r2198r2199
434433
435434
436435
437static void to7_5p14sd_reset( void )
436static void to7_5p14sd_reset( running_machine *machine )
438437{
439438   int i;
440439   LOG(( "to7_5p14sd_reset: CD 90-015 controller\n" ));
441440   thom_floppy_set_density( DEN_FM_LO );
442441   mc6843_reset();
443   for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ )
442   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
444443   {
445444      const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i );
446445      floppy_drive_set_ready_state( img, FLOPPY_DRIVE_READY, 0 );
r2198r2199
839838
840839
841840
842static void to7_qdd_reset( void )
841static void to7_qdd_reset( running_machine *machine )
843842{
844843   int i;
845844   LOG(( "to7_qdd_reset: CQ 90-028 controller\n" ));
846845
847846   thom_floppy_set_density( DEN_MFM_LO );
848847
849   for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ )
848   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
850849   {
851850      const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i );
852851      floppy_drive_set_index_pulse_callback( img, to7_qdd_index_pulse_cb );
r2198r2199
15221521
15231522
15241523
1525void thmfc_floppy_reset( void )
1524void thmfc_floppy_reset( running_machine *machine )
15261525{
15271526   int i;
15281527   LOG(( "thmfc_floppy_reset: THMFC1 controller\n" ));
15291528
1530   for ( i = 0; i < device_count( Machine, IO_FLOPPY ); i++ )
1529   for ( i = 0; i < device_count( machine, IO_FLOPPY ); i++ )
15311530   {
15321531      const device_config * img = image_from_devtype_and_index( IO_FLOPPY, i );
15331532      floppy_drive_set_index_pulse_callback( img, thmfc_floppy_index_pulse_cb );
r2198r2199
17731772
17741773
17751774
1776void to7_floppy_reset ( void )
1775void to7_floppy_reset ( running_machine *machine )
17771776{
17781777   to7_controller_type = (readinputport( THOM_INPUT_FCONFIG ) ) & 7;
17791778
r2198r2199
17821781
17831782   case 1:
17841783      to7_floppy_bank = 1;
1785      to7_5p14sd_reset();
1784      to7_5p14sd_reset(machine);
17861785      break;
17871786
17881787   case 2:
17891788      to7_floppy_bank = 2;
1790      to7_5p14_reset();
1789      to7_5p14_reset(machine);
17911790      break;
17921791
17931792   case 3:
17941793      to7_floppy_bank = 3;
1795      thmfc_floppy_reset();
1794      thmfc_floppy_reset(machine);
17961795      break;
17971796
17981797   case 4:
17991798      to7_floppy_bank = 7;
1800      to7_qdd_reset();
1799      to7_qdd_reset(machine);
18011800      break;
18021801
18031802   case 5:
r2198r2199
18931892
18941893
18951894
1896void to9_floppy_reset( void )
1895void to9_floppy_reset( running_machine *machine )
18971896{
1898   to7_floppy_reset();
1897   to7_floppy_reset(machine);
18991898   if ( THOM_FLOPPY_EXT )
19001899   {
19011900      LOG(( "to9_floppy_reset: external controller\n" ));
r2198r2199
19031902   else
19041903   {
19051904      LOG(( "to9_floppy_reset: internal controller\n" ));
1906      to7_5p14_reset();
1905      to7_5p14_reset(machine);
19071906      memory_set_bank( THOM_FLOP_BANK, TO7_NB_FLOP_BANK );
19081907   }
19091908}
src/mess/devices/cococart.c
r2198r2199
88
99#include "driver.h"
1010#include "cococart.h"
11#include "deprecat.h"
1211
1312
1413struct _coco_cartridge
r2198r2199
5857    cococart_init
5958-------------------------------------------------*/
6059
61coco_cartridge *cococart_init(const char *carttype, const coco_cartridge_config *callbacks)
60coco_cartridge *cococart_init(running_machine *machine, const char *carttype, const coco_cartridge_config *callbacks)
6261{
6362   coco_cartridge *cartridge;
6463   cococart_getinfo cart_proc;
r2198r2199
6665   void (*init)(coco_cartridge *cartridge);
6766
6867   /* sanity check */
69   assert_always(mame_get_phase(Machine) == MAME_PHASE_INIT, "Can only call cococart_init at init time!");
68   assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call cococart_init at init time!");
7069
7170   /* identify the cartridge type */
7271   cart_proc = find_cart(carttype);
src/mess/devices/thomflop.h
r2198r2199
2828
2929/* external controllers */
3030extern void to7_floppy_init  ( running_machine *machine, void* base );
31extern void to7_floppy_reset ( void );
31extern void to7_floppy_reset ( running_machine *machine );
3232extern READ8_HANDLER  ( to7_floppy_r );
3333extern WRITE8_HANDLER ( to7_floppy_w );
3434
3535/* TO9 internal (WD2793) & external controllers */
3636extern void to9_floppy_init  ( running_machine *machine, void* int_base, void* ext_base );
37extern void to9_floppy_reset ( void );
37extern void to9_floppy_reset ( running_machine *machine );
3838extern READ8_HANDLER  ( to9_floppy_r );
3939extern WRITE8_HANDLER ( to9_floppy_w );
4040
4141/* TO8 internal (THMFC1) controller */
4242extern void thmfc_floppy_init  ( void );
43extern void thmfc_floppy_reset ( void );
43extern void thmfc_floppy_reset ( running_machine *machine );
4444extern READ8_HANDLER  ( thmfc_floppy_r );
4545extern WRITE8_HANDLER ( thmfc_floppy_w );
4646
src/mess/video/kaypro.c
r2198r2199
139139   scroll_lines = KAYPRO_SCREEN_H;
140140   videoram_size = KAYPRO_SCREEN_W * KAYPRO_SCREEN_H;
141141
142   kaypro_terminal = terminal_create(0, ' ', 10, kaypro_getcursorcode, KAYPRO_SCREEN_W, KAYPRO_SCREEN_H);
142   kaypro_terminal = terminal_create(machine, 0, ' ', 10, kaypro_getcursorcode, KAYPRO_SCREEN_W, KAYPRO_SCREEN_H);
143143
144144   kaypro_putstr(machine,
145145   /* a test of GB1/GB2 video mode graphics */ \
src/mess/video/apple1.c
r2198r2199
8686VIDEO_START( apple1 )
8787{
8888   apple1_terminal = terminal_create(
89      machine,
8990      0,         /* graphics font 0 (the only one we have) */
9091      32,         /* Blank character is symbol 32 in the ROM */
9192      8,         /* use 8 bits for the character code */
src/mess/machine/coco.c
r2198r2199
925925#ifdef UNUSED_FUNCTION
926926void coco_set_halt_line(running_machine *machine, int halt_line)
927927{
928   cpunum_set_input_line(Machine, 0, INPUT_LINE_HALT, halt_line);
928   cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, halt_line);
929929   if (halt_line == CLEAR_LINE)
930930      timer_set(ATTOTIME_IN_CYCLES(1,0), NULL, 0, recalc_interrupts);
931931}
r2198r2199
10571057   return attotime_add(timer_get_time(), attotime_mul(COCO_CPU_SPEED, val));
10581058}
10591059
1060static void coco_hiresjoy_w(int data)
1060static void coco_hiresjoy_w(running_machine *machine, int data)
10611061{
10621062   if (!data && coco_hiresjoy_ca)
10631063   {
r2198r2199
10721072      coco_hiresjoy_ytransitiontime = attotime_zero;
10731073   }
10741074   coco_hiresjoy_ca = data;
1075   (*update_keyboard)(Machine);
1075   (*update_keyboard)(machine);
10761076}
10771077
10781078static int coco_hiresjoy_readone(attotime transitiontime)
r2198r2199
14021402static WRITE8_HANDLER ( d_pia0_pa_w )
14031403{
14041404   if (get_input_device(INPUTPORT_RIGHT_JOYSTICK) == INPUTDEVICE_HIRES_CC3MAX_INTERFACE)
1405      coco_hiresjoy_w(data & 0x04);
1405      coco_hiresjoy_w(machine, data & 0x04);
14061406}
14071407
14081408
r2198r2199
15141514   (*update_keyboard)(machine);
15151515
15161516   if (get_input_device(INPUTPORT_RIGHT_JOYSTICK) == INPUTDEVICE_HIRES_INTERFACE)
1517      coco_hiresjoy_w(dac >= 0x80);
1517      coco_hiresjoy_w(machine, dac >= 0x80);
15181518
15191519   /* Handle printer output, serial for CoCos, Paralell for Dragons */
15201520
r2198r2199
28652865   memset(&cart_config, 0, sizeof(cart_config));
28662866   cart_config.set_line = coco_setcartline;
28672867   cart_config.map_memory = init->map_memory;
2868   coco_cart = cococart_init(cart_hardware, &cart_config);
2868   coco_cart = cococart_init(machine, cart_hardware, &cart_config);
28692869
28702870#ifdef MAME_DEBUG
28712871   cpuintrf_set_dasm_override(0, coco_dasm_override);
src/mess/machine/thomson.c
r2198r2199
12541254   pia_reset();
12551255   mc6846_reset();
12561256   to7_game_reset();
1257   to7_floppy_reset();
1257   to7_floppy_reset(machine);
12581258   to7_io_reset();
12591259   to7_modem_reset();
12601260   to7_midi_reset();
r2198r2199
14861486   pia_reset();
14871487   mc6846_reset();
14881488   to7_game_reset();
1489   to7_floppy_reset();
1489   to7_floppy_reset(machine);
14901490   to7_io_reset();
14911491   to7_modem_reset();
14921492   to7_midi_reset();
r2198r2199
18341834   pia_reset();
18351835   pia_set_port_a_z_mask( THOM_PIA_SYS, 0x5f );
18361836   to7_game_reset();
1837   to7_floppy_reset();
1837   to7_floppy_reset(machine);
18381838   to7_io_reset();
18391839   to7_modem_reset();
18401840   to7_midi_reset();
r2198r2199
27722772   pia_set_port_a_z_mask( THOM_PIA_SYS, 0xfe );
27732773   mc6846_reset();
27742774   to7_game_reset();
2775   to9_floppy_reset();
2775   to9_floppy_reset(machine);
27762776   to9_kbd_reset();
27772777   thom_centronics_reset();
27782778   to7_modem_reset();
r2198r2199
33483348
33493349
33503350
3351static void to8_floppy_reset( void )
3351static void to8_floppy_reset( running_machine *machine )
33523352{
33533353   UINT8* mem = memory_region(REGION_CPU1);
3354   to7_floppy_reset();
3354   to7_floppy_reset(machine);
33553355   if ( THOM_FLOPPY_INT )
3356      thmfc_floppy_reset();
3356      thmfc_floppy_reset(machine);
33573357   memory_configure_bank( THOM_FLOP_BANK, TO7_NB_FLOP_BANK, 2, mem + 0x30000, 0x2000 );
33583358}
33593359
r2198r2199
36973697   pia_set_port_a_z_mask( THOM_PIA_SYS, 0xfe );
36983698   mc6846_reset();
36993699   to7_game_reset();
3700   to8_floppy_reset();
3700   to8_floppy_reset(machine);
37013701   to8_kbd_reset();
37023702   thom_centronics_reset();
37033703   to7_modem_reset();
r2198r2199
38593859   pia_set_port_a_z_mask( THOM_PIA_SYS, 0xfe );
38603860   mc6846_reset();
38613861   to7_game_reset();
3862   to8_floppy_reset();
3862   to8_floppy_reset(machine);
38633863   to9_kbd_reset();
38643864   thom_centronics_reset();
38653865   to7_modem_reset();
r2198r2199
44314431   pia_reset();
44324432   pia_set_port_a_z_mask( THOM_PIA_SYS, 0x75 );
44334433   mo6_game_reset();
4434   to7_floppy_reset();
4434   to7_floppy_reset(machine);
44354435   thom_centronics_reset();
44364436   to7_modem_reset();
44374437   to7_midi_reset();
r2198r2199
46984698   pia_reset();
46994699   pia_set_port_a_z_mask( THOM_PIA_SYS, 0x65 );
47004700   mo5nr_game_reset();
4701   to7_floppy_reset();
4701   to7_floppy_reset(machine);
47024702   thom_centronics_reset();
47034703   to7_modem_reset();
47044704   to7_midi_reset();
src/mess/mscommon.c
r2198r2199
88
99#include <assert.h>
1010#include "driver.h"
11#include "deprecat.h"
1211#include "mscommon.h"
1312
1413/***************************************************************************
r2198r2199
5554}
5655
5756struct terminal *terminal_create(
57   running_machine *machine,
5858   int gfx, int blank_char, int char_bits,
5959   int (*getcursorcode)(int original_code),
6060   int num_cols, int num_rows)
r2198r2199
6262   struct terminal *term;
6363   int char_width, char_height;
6464
65   char_width = Machine->gfx[gfx]->width;
66   char_height = Machine->gfx[gfx]->height;
65   char_width = machine->gfx[gfx]->width;
66   char_height = machine->gfx[gfx]->height;
6767
6868   term = (struct terminal *) auto_malloc(sizeof(struct terminal) - sizeof(term->mem)
6969      + (num_cols * num_rows * sizeof(termchar_t)));
src/mess/mscommon.h
r2198r2199
2424struct terminal;
2525
2626struct terminal *terminal_create(
27   running_machine *machine,
2728   int gfx, int blank_char, int char_bits,
2829   int (*getcursorcode)(int original_code),
2930   int num_cols, int num_rows);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team