Previous 15994 Revisions Next

r13205 Thursday 10th November, 2011 at 16:01:20 UTC by Miodrag Milanović
lynx - Fixed rotating views (no whatsnew)
[src/mess]mess.mak
[src/mess/drivers]lynx.c
[src/mess/includes]lynx.h
[src/mess/layout]lynx.lay*
[src/mess/machine]lynx.c

src/mess/machine/lynx.c
r13204r13205
88#include "hashfile.h"
99#include "imagedev/cartslot.h"
1010#include "hash.h"
11#include "rendutil.h"
1211
1312
1413
r13204r13205
18161815   machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(lynx_reset),&machine));
18171816
18181817   for (i = 0; i < NR_LYNX_TIMERS; i++)
1819      lynx_timer_init(machine, i);
1818      lynx_timer_init(machine, i);   
1819}
18201820
1821MACHINE_RESET( lynx )
1822{
1823   lynx_state *state = machine.driver_data<lynx_state>();
1824   render_target *target = machine.render().first_target();
1825   target->set_view(state->m_rotate0);
18211826}
18221827
1823
18241828/****************************************
18251829
18261830    Image handling
r13204r13205
18661870
18671871void lynx_crc_keyword(device_image_interface &image)
18681872{
1873   lynx_state *state = image.device().machine().driver_data<lynx_state>();
18691874   const char *info = NULL;
18701875
18711876   info = hashfile_extrainfo(image);
18721877   
1873   render_target *target = image.device().machine().render().first_target();
1874   target->set_orientation(ROT0);
1878   state->m_rotate0 = 0;
18751879   if (info)
18761880   {
18771881      if(strcmp(info, "ROTATE90DEGREE") == 0)
1878         target->set_orientation(ROT90);
1882         state->m_rotate0 = 1;
18791883      else if (strcmp(info, "ROTATE270DEGREE") == 0)
1880         target->set_orientation(ROT270);
1884         state->m_rotate0 = 2;
18811885   }
18821886}
18831887
r13204r13205
19541958      memcpy(rom, image.get_software_region("rom"), size);
19551959     
19561960      const char *rotate = image.get_feature("rotation");
1957      render_target *target = image.device().machine().render().first_target();     
1958      int tmpint = ROT0;
1961      state->m_rotate0 = 0;
19591962      if (rotate)
19601963      {
19611964         if(strcmp(rotate, "RIGHT") == 0) {
1962            tmpint = ROT90;
1965            state->m_rotate0 = 1;
19631966         }
19641967         else if (strcmp(rotate, "LEFT") == 0) {
1965            tmpint = ROT270;
1968            state->m_rotate0 = 2;
19661969         }
19671970      }
1968      target->set_orientation(tmpint);
19691971
1970      // apply the opposite orientation to the UI
1971      if (target->is_ui_target())
1972      {
1973         render_container::user_settings settings;
1974         render_container &ui_container = image.device().machine().render().ui_container();
1975
1976         ui_container.get_user_settings(settings);
1977         settings.m_orientation = orientation_add(orientation_reverse(tmpint), settings.m_orientation);
1978         ui_container.set_user_settings(settings);
1979      }
1980
19811972   }
19821973
19831974   return IMAGE_INIT_PASS;
19841975}
19851976
1986static DEVICE_IMAGE_UNLOAD( lynx_cart )
1987{
1988   render_target *target = image.device().machine().render().first_target();
1989   target->set_orientation(ROT0);
1990}
1991
19921977MACHINE_CONFIG_FRAGMENT(lynx_cartslot)
19931978   MCFG_CARTSLOT_ADD("cart")
19941979   MCFG_CARTSLOT_EXTENSION_LIST("lnx,lyx")
19951980   MCFG_CARTSLOT_NOT_MANDATORY
19961981   MCFG_CARTSLOT_INTERFACE("lynx_cart")
19971982   MCFG_CARTSLOT_LOAD(lynx_cart)
1998   MCFG_CARTSLOT_UNLOAD(lynx_cart)
19991983   MCFG_CARTSLOT_PARTIALHASH(lynx_partialhash)
20001984
20011985   /* Software lists */
src/mess/includes/lynx.h
r13204r13205
9292   int m_sign_AB;
9393   int m_sign_CD;
9494   UINT32 m_palette[0x10];
95   int m_rotate0;
9596   int m_rotate;
9697   device_t *m_audio;
9798   SUZY m_suzy;
r13204r13205
109110/*----------- defined in machine/lynx.c -----------*/
110111
111112MACHINE_START( lynx );
113MACHINE_RESET( lynx );
112114
113
114115READ8_HANDLER( lynx_memory_config_r );
115116WRITE8_HANDLER( lynx_memory_config_w );
116117void lynx_timer_count_down(running_machine &machine, int nr);
src/mess/layout/lynx.lay
r0r13205
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <view name="Standard">
4      <screen index="0">
5         <bounds left="0" top="0" right="4" bottom="3" />
6      </screen>
7   </view>
8   <view name="Rotated Right">
9      <screen index="0">
10         <bounds left="0" top="0" right="3" bottom="4" />
11         <orientation rotate="90" />
12      </screen>
13   </view>
14   <view name="Rotated Left">
15      <screen index="0">
16         <bounds left="0" top="0" right="3" bottom="4" />
17         <orientation rotate="270" />
18      </screen>
19   </view>
20</mamelayout>
src/mess/mess.mak
r13204r13205
19071907$(MESS_DRIVERS)/kim1.o:      $(MESS_LAYOUT)/kim1.lh
19081908$(MESS_DRIVERS)/junior.o:   $(MESS_LAYOUT)/junior.lh
19091909$(MESS_DRIVERS)/lc80.o:      $(MESS_LAYOUT)/lc80.lh
1910$(MESS_DRIVERS)/lynx.o:      $(MESS_LAYOUT)/lynx.lh
19101911$(MESS_DRIVERS)/lx800.o:   $(MESS_LAYOUT)/lx800.lh
19111912$(MESS_DRIVERS)/mekd2.o:   $(MESS_LAYOUT)/mekd2.lh
19121913$(MESS_DRIVERS)/mephisto.o:   $(MESS_LAYOUT)/mephisto.lh
src/mess/drivers/lynx.c
r13204r13205
1111#include "includes/lynx.h"
1212
1313#include "imagedev/snapquik.h"
14#include "lynx.lh"
1415
1516static QUICKLOAD_LOAD( lynx );
1617
r13204r13205
6162   MCFG_QUANTUM_TIME(attotime::from_hz(60))
6263
6364   MCFG_MACHINE_START( lynx )
65   MCFG_MACHINE_RESET( lynx )
6466
6567    /* video hardware */
6668   MCFG_SCREEN_ADD("screen", LCD)
r13204r13205
7173   MCFG_SCREEN_SIZE(160, 160)
7274   MCFG_SCREEN_VISIBLE_AREA(0, 160-1, 0, 102-1)
7375   MCFG_SCREEN_UPDATE( generic_bitmapped )
76   MCFG_DEFAULT_LAYOUT(layout_lynx)
7477
7578   MCFG_PALETTE_LENGTH(0x1000)
7679   MCFG_PALETTE_INIT( lynx )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team