~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/video/tx1.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
}
40
40
 
41
41
 
42
 
READ16_HANDLER( tx1_crtc_r )
 
42
READ16_MEMBER(tx1_state::tx1_crtc_r)
43
43
{
44
44
        return 0xffff;
45
45
}
46
46
 
47
 
WRITE16_HANDLER( tx1_crtc_w )
 
47
WRITE16_MEMBER(tx1_state::tx1_crtc_w)
48
48
{
49
49
if (PRINT_CRTC_DATA)
50
50
{
112
112
 
113
113
PALETTE_INIT( tx1 )
114
114
{
 
115
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
115
116
        int i;
116
117
 
117
118
        static const res_net_info tx1_net_info =
143
144
 *
144
145
 *************************************/
145
146
 
146
 
WRITE16_HANDLER( tx1_bankcs_w )
 
147
WRITE16_MEMBER(tx1_state::tx1_bankcs_w)
147
148
{
148
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
149
 
        vregs_t &tx1_vregs = state->m_vregs;
 
149
        vregs_t &tx1_vregs = m_vregs;
150
150
 
151
151
        // AAB2 = /BASET0
152
152
        // AAB3 = /BASET
197
197
        }
198
198
}
199
199
 
200
 
WRITE16_HANDLER( tx1_slincs_w )
 
200
WRITE16_MEMBER(tx1_state::tx1_slincs_w)
201
201
{
202
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
203
202
        if (offset == 1)
204
 
                state->m_vregs.slin_inc = data;
 
203
                m_vregs.slin_inc = data;
205
204
        else
206
 
                state->m_vregs.slin_inc = state->m_vregs.slin_val = 0;
207
 
}
208
 
 
209
 
WRITE16_HANDLER( tx1_slock_w )
210
 
{
211
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
212
 
        state->m_vregs.slock = data & 1;
213
 
}
214
 
 
215
 
WRITE16_HANDLER( tx1_scolst_w )
216
 
{
217
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
218
 
        state->m_vregs.scol = data & 0x0707;
219
 
}
220
 
 
221
 
WRITE16_HANDLER( tx1_flgcs_w )
222
 
{
223
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
224
 
        state->m_vregs.flags = data & 0xff;
 
205
                m_vregs.slin_inc = m_vregs.slin_val = 0;
 
206
}
 
207
 
 
208
WRITE16_MEMBER(tx1_state::tx1_slock_w)
 
209
{
 
210
        m_vregs.slock = data & 1;
 
211
}
 
212
 
 
213
WRITE16_MEMBER(tx1_state::tx1_scolst_w)
 
214
{
 
215
        m_vregs.scol = data & 0x0707;
 
216
}
 
217
 
 
218
WRITE16_MEMBER(tx1_state::tx1_flgcs_w)
 
219
{
 
220
        m_vregs.flags = data & 0xff;
225
221
}
226
222
 
227
223
 
240
236
        UINT8 *chars, *gfx2;
241
237
 
242
238
        /* 2bpp characters */
243
 
        chars = machine.region("char_tiles")->base();
 
239
        chars = state->memregion("char_tiles")->base();
244
240
        gfx2 = chars + 0x4000;
245
241
 
246
242
        /* X scroll value is the last word in char RAM */
420
416
        UINT8   pix[2][4][3];
421
417
 
422
418
        /* Road slice map ROMs */
423
 
        const UINT8 *const gfx3 = machine.region("gfx3")->base();
 
419
        const UINT8 *const gfx3 = state->memregion("gfx3")->base();
424
420
        const UINT8 *const rom_a = gfx3;
425
421
        const UINT8 *const rom_b = gfx3 + 0x2000;
426
422
        const UINT8 *const rom_c = gfx3 + 0x4000;
427
423
 
428
424
        /* Pixel data */
429
 
        const UINT8 *const proms = machine.region("proms")->base();
 
425
        const UINT8 *const proms = state->memregion("proms")->base();
430
426
        const UINT8 *const prom_a = proms + 0x1100;
431
427
        const UINT8 *const prom_b = proms + 0x1300;
432
428
        const UINT8 *const prom_c = proms + 0x1500;
863
859
        UINT32 offs;
864
860
 
865
861
        /* The many lookup table ROMs */
866
 
        const UINT8 *const ic48 = machine.region("user3")->base();
 
862
        const UINT8 *const ic48 = state->memregion("user3")->base();
867
863
        const UINT8 *const ic281 = ic48 + 0x2000;
868
864
 
869
 
        const UINT8 *const proms = machine.region("proms")->base();
 
865
        const UINT8 *const proms = state->memregion("proms")->base();
870
866
        const UINT8 *const ic190 = proms + 0xc00;
871
867
        const UINT8 *const ic162 = proms + 0xe00;
872
868
        const UINT8 *const ic25  = proms + 0x1000;
873
869
 
874
 
        const UINT8 *const ic106 = machine.region("obj_map")->base();
 
870
        const UINT8 *const ic106 = state->memregion("obj_map")->base();
875
871
        const UINT8 *const ic73  = ic106 + 0x4000;
876
872
 
877
 
        const UINT8 *const pixdata_rgn = machine.region("obj_tiles")->base();
 
873
        const UINT8 *const pixdata_rgn = state->memregion("obj_tiles")->base();
878
874
 
879
875
        for (offs = 0x0; offs <= 0x300; offs += 8)
880
876
        {
1140
1136
{
1141
1137
        tx1_state *state = machine.driver_data<tx1_state>();
1142
1138
        int x, y;
1143
 
        UINT8 *chr_pal = machine.region("proms")->base() + 0x900;
 
1139
        UINT8 *chr_pal = state->memregion("proms")->base() + 0x900;
1144
1140
 
1145
1141
        int x_offset = screen * 256;
1146
1142
 
1253
1249
 
1254
1250
PALETTE_INIT( buggyboy )
1255
1251
{
 
1252
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
1256
1253
        int i;
1257
1254
 
1258
1255
        for (i = 0; i < 0x100; i++)
1303
1300
        UINT32 x_mask;
1304
1301
 
1305
1302
        /* 2bpp characters */
1306
 
        chars = machine.region("char_tiles")->base();
1307
 
        gfx2 = machine.region("char_tiles")->base() + 0x4000;
 
1303
        chars = state->memregion("char_tiles")->base();
 
1304
        gfx2 = state->memregion("char_tiles")->base() + 0x4000;
1308
1305
 
1309
1306
        /* X/Y scroll values are the last word in char RAM */
1310
1307
        if (wide)
1538
1535
        UINT32 rva20_6;
1539
1536
 
1540
1537
        /* ROM/PROM lookup tables */
1541
 
        const UINT8 *rcols = (UINT8*)(machine.region("proms")->base() + 0x1500);
1542
 
        const UINT8 *rom   = machine.region("road")->base();
 
1538
        const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
 
1539
        const UINT8 *rom   = state->memregion("road")->base();
1543
1540
        const UINT8 *prom0 = rom + 0x4000;
1544
1541
        const UINT8 *prom1 = rom + 0x4200;
1545
1542
        const UINT8 *prom2 = rom + 0x4400;
2170
2167
        UINT32 rva20_6;
2171
2168
 
2172
2169
        /* ROM/PROM lookup tables */
2173
 
        const UINT8 *rcols = (UINT8*)(machine.region("proms")->base() + 0x1500);
2174
 
        const UINT8 *rom   = machine.region("road")->base();
 
2170
        const UINT8 *rcols = (UINT8*)(state->memregion("proms")->base() + 0x1500);
 
2171
        const UINT8 *rom   = state->memregion("road")->base();
2175
2172
        const UINT8 *prom0 = rom + 0x4000;
2176
2173
        const UINT8 *prom1 = rom + 0x4200;
2177
2174
        const UINT8 *prom2 = rom + 0x4400;
2583
2580
        UINT32 x_stride;
2584
2581
 
2585
2582
        /* The many lookup table ROMs */
2586
 
        const UINT8 *const bug13  = (UINT8*)machine.region("obj_luts")->base();
 
2583
        const UINT8 *const bug13  = (UINT8*)state->memregion("obj_luts")->base();
2587
2584
        const UINT8 *const bug18s = bug13 + 0x2000;
2588
 
        const UINT8 *const bb8    = (UINT8*)machine.region("proms")->base() + 0x1600;
 
2585
        const UINT8 *const bb8    = (UINT8*)state->memregion("proms")->base() + 0x1600;
2589
2586
 
2590
 
        const UINT8 *const bug16s = (UINT8*)machine.region("obj_map")->base();
 
2587
        const UINT8 *const bug16s = (UINT8*)state->memregion("obj_map")->base();
2591
2588
        const UINT8 *const bug17s = bug16s + 0x8000;
2592
2589
 
2593
 
        const UINT8 *const bb9o = (UINT8*)machine.region("proms")->base() + 0x500;
 
2590
        const UINT8 *const bb9o = (UINT8*)state->memregion("proms")->base() + 0x500;
2594
2591
        const UINT8 *const bb9e = bb9o + 0x800;
2595
2592
 
2596
 
        const UINT8 *const pixdata_rgn = (UINT8*)machine.region("obj_tiles")->base();
 
2593
        const UINT8 *const pixdata_rgn = (UINT8*)state->memregion("obj_tiles")->base();
2597
2594
 
2598
2595
        if (wide)
2599
2596
        {
2841
2838
    /WASET  = 24A0-F, 24B0-F
2842
2839
    /FLAGS  = 24E0-F, 24F0-F
2843
2840
*/
2844
 
WRITE16_HANDLER( buggyboy_gas_w )
 
2841
WRITE16_MEMBER(tx1_state::buggyboy_gas_w)
2845
2842
{
2846
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
2847
 
        vregs_t &vregs = state->m_vregs;
 
2843
        vregs_t &vregs = m_vregs;
2848
2844
        offset <<= 1;
2849
2845
 
2850
2846
        switch (offset & 0xe0)
2905
2901
                }
2906
2902
                case 0xe0:
2907
2903
                {
2908
 
                        cputag_set_input_line(space->machine(), "math_cpu", INPUT_LINE_TEST, CLEAR_LINE);
 
2904
                        cputag_set_input_line(machine(), "math_cpu", INPUT_LINE_TEST, CLEAR_LINE);
2909
2905
                        vregs.flags = data;
2910
2906
                        break;
2911
2907
                }
2915
2911
        vregs.gas = data;
2916
2912
}
2917
2913
 
2918
 
WRITE16_HANDLER( buggyboy_sky_w )
 
2914
WRITE16_MEMBER(tx1_state::buggyboy_sky_w)
2919
2915
{
2920
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
2921
 
        state->m_vregs.sky = data;
 
2916
        m_vregs.sky = data;
2922
2917
}
2923
2918
 
2924
 
WRITE16_HANDLER( buggyboy_scolst_w )
 
2919
WRITE16_MEMBER(tx1_state::buggyboy_scolst_w)
2925
2920
{
2926
 
        tx1_state *state = space->machine().driver_data<tx1_state>();
2927
 
        state->m_vregs.scol = data;
 
2921
        m_vregs.scol = data;
2928
2922
}
2929
2923
 
2930
2924
 
2937
2931
static void bb_combine_layers(running_machine &machine, bitmap_ind16 &bitmap, int screen)
2938
2932
{
2939
2933
        tx1_state *state = machine.driver_data<tx1_state>();
2940
 
        UINT8 *chr_pal = machine.region("proms")->base() + 0x400;
 
2934
        UINT8 *chr_pal = state->memregion("proms")->base() + 0x400;
2941
2935
        UINT32 bmp_stride;
2942
2936
        UINT32 x_offset;
2943
2937
        UINT32 y;