Previous 199869 Revisions Next

r34195 Monday 5th January, 2015 at 18:05:03 UTC by David Haywood
caveman (pinball) - simple code to draw the video screen (nw)
[src/mame]mame.mak
[src/mame/drivers]gts80a.c
[src/mame/layout]gts80a_caveman.lay*

trunk/src/mame/drivers/gts80a.c
r242706r242707
1515#include "audio/gottlieb.h"
1616#include "cpu/i86/i86.h"
1717#include "gts80a.lh"
18#include "gts80a_caveman.lh"
1819
1920class gts80a_state : public genpin_class
2021{
r242706r242707
384385   caveman_state(const machine_config &mconfig, device_type type, const char *tag)
385386      : gts80a_state(mconfig, type, tag)
386387      , m_videocpu(*this, "video_cpu")
388      , m_vram(*this, "vram")
389
387390   { }
388391
392
393   UINT32 screen_update_caveman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
394
389395private:
390396   required_device<cpu_device> m_videocpu;
397   required_shared_ptr<UINT8> m_vram;
391398};
392399
400UINT32 caveman_state::screen_update_caveman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
401{
402   int count = 0;
403   for (int y = 0; y < 256; y++)
404   {
405      for (int x = 0; x < 256; x += 4)
406      {
407         UINT8 pix = m_vram[count];
408
409         bitmap.pix16(y, x+0) = (pix >> 6)&0x3;
410         bitmap.pix16(y, x+1) = (pix >> 4)&0x3;
411         bitmap.pix16(y, x+2) = (pix >> 2)&0x3;
412         bitmap.pix16(y, x+3) = (pix >> 0)&0x3;
413
414         count++;
415      }
416   }
417
418   return 0;
419}
420
421
393422static ADDRESS_MAP_START( video_map, AS_PROGRAM, 8, caveman_state )
394423   ADDRESS_MAP_GLOBAL_MASK(0xffff)
395   AM_RANGE(0x0000, 0x5fff) AM_RAM
424   AM_RANGE(0x0000, 0x07ff) AM_RAM
425   AM_RANGE(0x2000, 0x5fff) AM_RAM AM_SHARE("vram")
396426   AM_RANGE(0x8000, 0xffff) AM_ROM
397427ADDRESS_MAP_END
398428
399429static ADDRESS_MAP_START( video_io_map, AS_IO, 8, caveman_state )
430//   AM_RANGE(0x000, 0x002) AM_READWRITE() // 8259 irq controller
431//   AM_RANGE(0x100, 0x102) AM_READWRITE() // HD46505
432//   AM_RANGE(0x200, 0x200) AM_READWRITE() // 8212 in, ?? out
433//   AM_RANGE(0x300, 0x300) AM_READWRITE() // soundlatch (command?) in, ?? out
434
435//   AM_RANGE(0x400, 0x400) AM_READ() // joystick inputs
436//   AM_RANGE(0x500, 0x506) AM_WRITE() // palette
437
400438ADDRESS_MAP_END
401439
402static MACHINE_CONFIG_DERIVED( caveman, gts80a_ss )
440static MACHINE_CONFIG_DERIVED_CLASS( caveman, gts80a_ss, caveman_state )
403441   MCFG_CPU_ADD("video_cpu", I8088, 5000000)
404442   MCFG_CPU_PROGRAM_MAP(video_map)
405443   MCFG_CPU_IO_MAP(video_io_map)
444
445   MCFG_SCREEN_ADD("screen", RASTER)
446   MCFG_SCREEN_REFRESH_RATE(60)
447   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
448   MCFG_SCREEN_SIZE(256, 256)
449   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 248-1)
450   MCFG_SCREEN_UPDATE_DRIVER(caveman_state, screen_update_caveman)
451   MCFG_SCREEN_PALETTE("palette")
452
453   MCFG_PALETTE_ADD("palette", 16)
454
455   MCFG_DEFAULT_LAYOUT(layout_gts80a_caveman)
456
406457MACHINE_CONFIG_END
407458
408459static INPUT_PORTS_START( caveman )
trunk/src/mame/layout/gts80a_caveman.lay
r0r242707
1<!-- GTS80A copied from gts80.lay -->
2
3<!-- 2014-10-10: Initial version.  [Robbbert] -->
4
5<mamelayout version="2">
6
7   <element name="digit" defstate="0">
8      <led14seg>
9         <color red="0.0" green="0.75" blue="1.0" />
10      </led14seg>
11   </element>
12   <element name="digit7" defstate="0">
13      <led7seg>
14         <color red="0.0" green="0.75" blue="1.0" />
15      </led7seg>
16   </element>
17   <element name="red_led">
18      <disk><color red="1.0" green="0.0" blue="0.0" /></disk>
19   </element>
20   <element name="background">
21      <rect>
22         <bounds left="0" top="0" right="1" bottom="1" />
23         <color red="0.0" green="0.0" blue="0.0" />
24      </rect>
25   </element>
26   <element name="P0"><text string="Ball / Match"><color red="1.0" green="1.0" blue="1.0" /></text></element>
27   <element name="P1"><text string="Credits"><color red="1.0" green="1.0" blue="1.0" /></text></element>
28   <element name="P3"><text string="Player 1"><color red="1.0" green="1.0" blue="1.0" /></text></element>
29   <element name="P4"><text string="Player 2"><color red="1.0" green="1.0" blue="1.0" /></text></element>
30   <element name="P5"><text string="Player 3"><color red="1.0" green="1.0" blue="1.0" /></text></element>
31   <element name="P6"><text string="Player 4"><color red="1.0" green="1.0" blue="1.0" /></text></element>
32
33   <view name="Default Layout">
34
35      <!-- Background -->
36      <backdrop element="background">
37         <bounds left="0" top="20" right="318" bottom="394" />
38      </backdrop>
39
40      <!-- LEDs -->
41
42      <!-- Player 1 Score -->
43
44      <bezel name="digit15" element="digit">
45         <bounds left="10" top="45" right="44" bottom="84" />
46      </bezel>
47      <bezel name="digit5" element="digit">
48         <bounds left="54" top="45" right="88" bottom="84" />
49      </bezel>
50      <bezel name="digit4" element="digit">
51         <bounds left="98" top="45" right="132" bottom="84" />
52      </bezel>
53      <bezel name="digit3" element="digit">
54         <bounds left="142" top="45" right="176" bottom="84" />
55      </bezel>
56      <bezel name="digit2" element="digit">
57         <bounds left="186" top="45" right="220" bottom="84" />
58      </bezel>
59      <bezel name="digit1" element="digit">
60         <bounds left="230" top="45" right="264" bottom="84" />
61      </bezel>
62      <bezel name="digit0" element="digit">
63         <bounds left="274" top="45" right="308" bottom="84" />
64      </bezel>
65
66      <!-- Player 2 Score -->
67      <bezel name="digit12" element="digit">
68         <bounds left="10" top="105" right="44" bottom="144" />
69      </bezel>
70      <bezel name="digit11" element="digit">
71         <bounds left="54" top="105" right="88" bottom="144" />
72      </bezel>
73      <bezel name="digit10" element="digit">
74         <bounds left="98" top="105" right="132" bottom="144" />
75      </bezel>
76      <bezel name="digit9" element="digit">
77         <bounds left="142" top="105" right="176" bottom="144" />
78      </bezel>
79      <bezel name="digit8" element="digit">
80         <bounds left="186" top="105" right="220" bottom="144" />
81      </bezel>
82      <bezel name="digit7" element="digit">
83         <bounds left="230" top="105" right="264" bottom="144" />
84      </bezel>
85      <bezel name="digit6" element="digit">
86         <bounds left="274" top="105" right="308" bottom="144" />
87      </bezel>
88
89      <!-- Player 3 Score -->
90      <bezel name="digit35" element="digit">
91         <bounds left="10" top="165" right="44" bottom="204" />
92      </bezel>
93      <bezel name="digit25" element="digit">
94         <bounds left="54" top="165" right="88" bottom="204" />
95      </bezel>
96      <bezel name="digit24" element="digit">
97         <bounds left="98" top="165" right="132" bottom="204" />
98      </bezel>
99      <bezel name="digit23" element="digit">
100         <bounds left="142" top="165" right="176" bottom="204" />
101      </bezel>
102      <bezel name="digit22" element="digit">
103         <bounds left="186" top="165" right="220" bottom="204" />
104      </bezel>
105      <bezel name="digit21" element="digit">
106         <bounds left="230" top="165" right="264" bottom="204" />
107      </bezel>
108      <bezel name="digit20" element="digit">
109         <bounds left="274" top="165" right="308" bottom="204" />
110      </bezel>
111
112      <!-- Player 4 Score -->
113      <bezel name="digit32" element="digit">
114         <bounds left="10" top="225" right="44" bottom="264" />
115      </bezel>
116      <bezel name="digit31" element="digit">
117         <bounds left="54" top="225" right="88" bottom="264" />
118      </bezel>
119      <bezel name="digit30" element="digit">
120         <bounds left="98" top="225" right="132" bottom="264" />
121      </bezel>
122      <bezel name="digit29" element="digit">
123         <bounds left="142" top="225" right="176" bottom="264" />
124      </bezel>
125      <bezel name="digit28" element="digit">
126         <bounds left="186" top="225" right="220" bottom="264" />
127      </bezel>
128      <bezel name="digit27" element="digit">
129         <bounds left="230" top="225" right="264" bottom="264" />
130      </bezel>
131      <bezel name="digit26" element="digit">
132         <bounds left="274" top="225" right="308" bottom="264" />
133      </bezel>
134
135      <!-- Credits and Balls -->
136      <bezel name="digit55" element="digit7">
137         <bounds left="30" top="345" right="64" bottom="384" />
138      </bezel>
139      <bezel name="digit54" element="digit7">
140         <bounds left="69" top="345" right="103" bottom="384" />
141      </bezel>
142      <bezel name="digit53" element="digit7">
143         <bounds left="171" top="345" right="205" bottom="384" />
144      </bezel>
145      <bezel name="digit52" element="digit7">
146         <bounds left="210" top="345" right="244" bottom="384" />
147      </bezel>
148      <bezel element="P0"><bounds left="200" right="258" top="330" bottom="342" /></bezel>
149      <bezel element="P1"><bounds left="50" right="108" top="330" bottom="342" /></bezel>
150      <bezel name="text3" element="P3"><bounds left="100" right="180" top="30" bottom="42" /></bezel>
151      <bezel name="text2" element="P4"><bounds left="100" right="180" top="90" bottom="102" /></bezel>
152      <bezel name="text1" element="P5"><bounds left="100" right="180" top="150" bottom="162" /></bezel>
153      <bezel name="text0" element="P6"><bounds left="100" right="180" top="210" bottom="222" /></bezel>
154   
155      <screen index="0">
156         <bounds x="320" y="0" width="320" height="240" />
157      </screen>
158    </view>
159</mamelayout>
trunk/src/mame/mame.mak
r242706r242707
26612661$(DRIVERS)/gts1.o:      $(LAYOUT)/gts1.lh
26622662$(DRIVERS)/gts3.o:      $(LAYOUT)/gts3.lh
26632663$(DRIVERS)/gts80.o:     $(LAYOUT)/gts80.lh
2664$(DRIVERS)/gts80a.o:    $(LAYOUT)/gts80a.lh
2664$(DRIVERS)/gts80a.o:    $(LAYOUT)/gts80a.lh \
2665         $(LAYOUT)/gts80a_caveman.lh
26652666$(DRIVERS)/gts80b.o:    $(LAYOUT)/gts80b.lh
26662667
26672668$(DRIVERS)/lbeach.o:    $(LAYOUT)/lbeach.lh


Previous 199869 Revisions Next


© 1997-2024 The MAME Team