trunk/src/mess/machine/sat_bram.h
r21968 | r21969 | |
13 | 13 | public: |
14 | 14 | // construction/destruction |
15 | 15 | saturn_bram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 size); |
16 | | |
| 16 | |
17 | 17 | // device-level overrides |
18 | 18 | virtual void device_start(); |
19 | 19 | virtual void device_reset(); |
r21968 | r21969 | |
23 | 23 | virtual void nvram_default() { } |
24 | 24 | virtual void nvram_read(emu_file &file) { if (m_ext_bram != NULL) { file.read(m_ext_bram, m_ext_bram_size); } } |
25 | 25 | virtual void nvram_write(emu_file &file) { if (m_ext_bram != NULL) { file.write(m_ext_bram, m_ext_bram_size); } } |
26 | | |
| 26 | |
27 | 27 | // reading and writing |
28 | 28 | virtual DECLARE_READ32_MEMBER(read_ext_bram); |
29 | 29 | virtual DECLARE_WRITE32_MEMBER(write_ext_bram); |
r21968 | r21969 | |
32 | 32 | virtual DECLARE_WRITE8_MEMBER(write_ext_bram); |
33 | 33 | #endif |
34 | 34 | |
35 | | UINT32 m_size; // this is the size of Battery RAM in bytes |
| 35 | UINT32 m_size; // this is the size of Battery RAM in bytes |
36 | 36 | }; |
37 | 37 | |
38 | 38 | class saturn_bram4mb_device : public saturn_bram_device |
r21968 | r21969 | |
40 | 40 | public: |
41 | 41 | // construction/destruction |
42 | 42 | saturn_bram4mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
43 | | |
| 43 | |
44 | 44 | // device-level overrides |
45 | 45 | virtual void device_config_complete() { m_shortname = "sat_bram_4mb"; } |
46 | 46 | }; |
r21968 | r21969 | |
50 | 50 | public: |
51 | 51 | // construction/destruction |
52 | 52 | saturn_bram8mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
53 | | |
| 53 | |
54 | 54 | // device-level overrides |
55 | 55 | virtual void device_config_complete() { m_shortname = "sat_bram_8mb"; } |
56 | 56 | }; |
r21968 | r21969 | |
60 | 60 | public: |
61 | 61 | // construction/destruction |
62 | 62 | saturn_bram16mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
63 | | |
| 63 | |
64 | 64 | // device-level overrides |
65 | 65 | virtual void device_config_complete() { m_shortname = "sat_bram_16mb"; } |
66 | 66 | }; |
r21968 | r21969 | |
70 | 70 | public: |
71 | 71 | // construction/destruction |
72 | 72 | saturn_bram32mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
73 | | |
| 73 | |
74 | 74 | // device-level overrides |
75 | 75 | virtual void device_config_complete() { m_shortname = "sat_bram_32mb"; } |
76 | 76 | }; |
trunk/src/mess/machine/sat_slot.c
r21968 | r21969 | |
7 | 7 | Despite the system having a single cart slot, 3 different kinds of cart can be inserted and |
8 | 8 | different memory areas are exposed to each of them |
9 | 9 | * ROM carts are accessed in range 0x02000000-0x023fffff and 0x22000000-0x24ffffff of both CPUs |
10 | | * Data RAM carts are accessed in range 0x02400000-0x027fffff of both CPUs (each DRAM chip is |
11 | | mapped independently, the 1st at 0x2400000, the second at 0x2600000) |
| 10 | * Data RAM carts are accessed in range 0x02400000-0x027fffff of both CPUs (each DRAM chip is |
| 11 | mapped independently, the 1st at 0x2400000, the second at 0x2600000) |
12 | 12 | * Battery RAM carts are accessed in range 0x04000000-0x047fffff of both CPUs |
13 | | |
14 | | It is not clear what happens to accesses beyond the cart size (open bus? mirror of cart data?), |
| 13 | |
| 14 | It is not clear what happens to accesses beyond the cart size (open bus? mirror of cart data?), |
15 | 15 | e.g. if you have a 16Mbit battery cart inserted and the system tries to read/write above 0x04400000, |
16 | | so for the moment the whole range is mapped and an error message is printed for out-of-bounds |
| 16 | so for the moment the whole range is mapped and an error message is printed for out-of-bounds |
17 | 17 | accesses |
18 | | |
19 | | |
| 18 | |
| 19 | |
20 | 20 | ***********************************************************************************************************/ |
21 | 21 | |
22 | 22 | |
r21968 | r21969 | |
128 | 128 | { |
129 | 129 | UINT32 *ROM; |
130 | 130 | UINT32 len; |
131 | | |
| 131 | |
132 | 132 | if (software_entry() != NULL) |
133 | 133 | len = get_software_region_length("cart"); |
134 | 134 | else |
r21968 | r21969 | |
143 | 143 | fread(ROM, len); |
144 | 144 | |
145 | 145 | // fix endianness.... |
146 | | // for (int i = 0; i < len; i += 4) |
147 | | // { |
148 | | // UINT8 tempa = ROM[i+0]; |
149 | | // UINT8 tempb = ROM[i+1]; |
150 | | // ROM[i+1] = ROM[i+2]; |
151 | | // ROM[i+0] = ROM[i+3]; |
152 | | // ROM[i+3] = tempa; |
153 | | // ROM[i+2] = tempb; |
154 | | // } |
| 146 | // for (int i = 0; i < len; i += 4) |
| 147 | // { |
| 148 | // UINT8 tempa = ROM[i+0]; |
| 149 | // UINT8 tempb = ROM[i+1]; |
| 150 | // ROM[i+1] = ROM[i+2]; |
| 151 | // ROM[i+0] = ROM[i+3]; |
| 152 | // ROM[i+3] = tempa; |
| 153 | // ROM[i+2] = tempb; |
| 154 | // } |
155 | 155 | return IMAGE_INIT_PASS; |
156 | 156 | } |
157 | 157 | |
r21968 | r21969 | |
242 | 242 | { |
243 | 243 | if (m_cart) |
244 | 244 | { |
245 | | return (m_cart->read_ext_bram(space, offset * 2) << 16) |
| 245 | return (m_cart->read_ext_bram(space, offset * 2) << 16) |
246 | 246 | | m_cart->read_ext_bram(space, offset * 2 + 1); |
247 | 247 | } |
248 | 248 | else |
trunk/src/mess/machine/sat_slot.h
r21968 | r21969 | |
29 | 29 | virtual DECLARE_READ8_MEMBER(read_ext_bram) { return 0xff; } |
30 | 30 | virtual DECLARE_WRITE8_MEMBER(write_ext_bram) {} |
31 | 31 | #endif |
32 | | |
| 32 | |
33 | 33 | virtual int get_cart_type() { return m_cart_type; }; |
34 | | |
35 | | |
| 34 | |
| 35 | |
36 | 36 | void rom_alloc(running_machine &machine, UINT32 size); |
37 | 37 | UINT32* get_rom_base() { return m_rom; } |
38 | 38 | UINT32* get_ext_dram0_base() { return m_ext_dram0; } |
r21968 | r21969 | |
61 | 61 | // ======================> sat_cart_slot_device |
62 | 62 | |
63 | 63 | class sat_cart_slot_device : public device_t, |
64 | | public device_image_interface, |
65 | | public device_slot_interface |
| 64 | public device_image_interface, |
| 65 | public device_slot_interface |
66 | 66 | { |
67 | 67 | public: |
68 | 68 | // construction/destruction |
r21968 | r21969 | |
101 | 101 | virtual DECLARE_WRITE32_MEMBER(write_ext_dram1); |
102 | 102 | virtual DECLARE_READ32_MEMBER(read_ext_bram); |
103 | 103 | virtual DECLARE_WRITE32_MEMBER(write_ext_bram); |
104 | | |
| 104 | |
105 | 105 | //protected: |
106 | 106 | device_sat_cart_interface* m_cart; |
107 | 107 | }; |
r21968 | r21969 | |
116 | 116 | ***************************************************************************/ |
117 | 117 | |
118 | 118 | #define MCFG_SATURN_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot,_def_inp) \ |
119 | | MCFG_DEVICE_ADD(_tag, SATURN_CART_SLOT, 0) \ |
| 119 | MCFG_DEVICE_ADD(_tag, SATURN_CART_SLOT, 0) \ |
120 | 120 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false) |
121 | 121 | |
122 | 122 | |
trunk/src/mess/drivers/saturn.c
r21968 | r21969 | |
82 | 82 | : saturn_state(mconfig, type, tag) |
83 | 83 | , m_exp(*this, "exp") |
84 | 84 | { } |
85 | | |
| 85 | |
86 | 86 | DECLARE_INPUT_CHANGED_MEMBER(key_stroke); |
87 | 87 | DECLARE_INPUT_CHANGED_MEMBER(nmi_reset); |
88 | 88 | DECLARE_INPUT_CHANGED_MEMBER(tray_open); |
r21968 | r21969 | |
90 | 90 | |
91 | 91 | DECLARE_MACHINE_START(saturn); |
92 | 92 | DECLARE_MACHINE_RESET(saturn); |
93 | | |
| 93 | |
94 | 94 | DECLARE_READ8_MEMBER(saturn_cart_type_r); |
95 | 95 | DECLARE_READ32_MEMBER( abus_dummy_r ); |
96 | | |
| 96 | |
97 | 97 | DECLARE_READ32_MEMBER(saturn_null_ram_r); |
98 | 98 | DECLARE_WRITE32_MEMBER(saturn_null_ram_w); |
99 | 99 | |
r21968 | r21969 | |
101 | 101 | DECLARE_DRIVER_INIT(saturnus); |
102 | 102 | DECLARE_DRIVER_INIT(saturneu); |
103 | 103 | DECLARE_DRIVER_INIT(saturnjp); |
104 | | |
| 104 | |
105 | 105 | required_device<sat_cart_slot_device> m_exp; |
106 | 106 | }; |
107 | 107 | |
r21968 | r21969 | |
174 | 174 | AM_RANGE(0x00200000, 0x002fffff) AM_RAM AM_MIRROR(0x20100000) AM_SHARE("workram_l") |
175 | 175 | AM_RANGE(0x01000000, 0x017fffff) AM_WRITE(saturn_minit_w) |
176 | 176 | AM_RANGE(0x01800000, 0x01ffffff) AM_WRITE(saturn_sinit_w) |
177 | | // AM_RANGE(0x02000000, 0x023fffff) AM_ROM // Cartridge area |
| 177 | // AM_RANGE(0x02000000, 0x023fffff) AM_ROM // Cartridge area |
178 | 178 | // AM_RANGE(0x02400000, 0x027fffff) AM_RAM // External Data RAM area |
179 | 179 | // AM_RANGE(0x04000000, 0x047fffff) AM_RAM // External Battery RAM area |
180 | 180 | AM_RANGE(0x04fffffc, 0x04ffffff) AM_READ8(saturn_cart_type_r,0x000000ff) |
r21968 | r21969 | |
193 | 193 | AM_RANGE(0x05fe0000, 0x05fe00cf) AM_READWRITE(saturn_scu_r, saturn_scu_w) |
194 | 194 | AM_RANGE(0x06000000, 0x060fffff) AM_RAM AM_MIRROR(0x21f00000) AM_SHARE("workram_h") |
195 | 195 | AM_RANGE(0x20000000, 0x2007ffff) AM_ROM AM_SHARE("share6") // bios mirror |
196 | | // AM_RANGE(0x22000000, 0x24ffffff) AM_ROM // Cartridge area mirror |
| 196 | // AM_RANGE(0x22000000, 0x24ffffff) AM_ROM // Cartridge area mirror |
197 | 197 | AM_RANGE(0x45000000, 0x46ffffff) AM_WRITENOP |
198 | 198 | AM_RANGE(0x60000000, 0x600003ff) AM_WRITENOP // cache address array |
199 | 199 | AM_RANGE(0xc0000000, 0xc00007ff) AM_RAM // cache data array, Dragon Ball Z sprites relies on this |
r21968 | r21969 | |
617 | 617 | m_audiocpu = downcast<legacy_cpu_device*>( machine().device<cpu_device>("audiocpu") ); |
618 | 618 | |
619 | 619 | scsp_set_ram_base(machine().device("scsp"), m_sound_ram); |
620 | | |
| 620 | |
621 | 621 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_readwrite_handler(0x02400000, 0x027fffff, read32_delegate(FUNC(sat_console_state::saturn_null_ram_r),this), write32_delegate(FUNC(sat_console_state::saturn_null_ram_w),this)); |
622 | 622 | machine().device("slave")->memory().space(AS_PROGRAM).install_readwrite_handler(0x02400000, 0x027fffff, read32_delegate(FUNC(sat_console_state::saturn_null_ram_r),this), write32_delegate(FUNC(sat_console_state::saturn_null_ram_w),this)); |
623 | | |
| 623 | |
624 | 624 | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x04000000, 0x047fffff); |
625 | 625 | machine().device("slave")->memory().space(AS_PROGRAM).nop_readwrite(0x04000000, 0x047fffff); |
626 | | |
| 626 | |
627 | 627 | if (m_exp) |
628 | 628 | { |
629 | 629 | switch (m_exp->get_cart_type()) |
630 | 630 | { |
631 | | case 0x21: // Battery RAM cart |
| 631 | case 0x21: // Battery RAM cart |
632 | 632 | case 0x22: |
633 | 633 | case 0x23: |
634 | 634 | case 0x24: |
r21968 | r21969 | |
637 | 637 | machine().device("slave")->memory().space(AS_PROGRAM).install_read_handler(0x04000000, 0x047fffff, read32_delegate(FUNC(device_sat_cart_interface::read_ext_bram), m_exp->m_cart)); |
638 | 638 | machine().device("slave")->memory().space(AS_PROGRAM).install_write_handler(0x04000000, 0x047fffff, write32_delegate(FUNC(device_sat_cart_interface::write_ext_bram), m_exp->m_cart)); |
639 | 639 | break; |
640 | | case 0x5a: // Data RAM cart |
| 640 | case 0x5a: // Data RAM cart |
641 | 641 | case 0x5c: |
642 | 642 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x02400000, 0x025fffff, read32_delegate(FUNC(device_sat_cart_interface::read_ext_dram0), m_exp->m_cart)); |
643 | 643 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x02400000, 0x025fffff, write32_delegate(FUNC(device_sat_cart_interface::write_ext_dram0), m_exp->m_cart)); |
r21968 | r21969 | |
648 | 648 | machine().device("slave")->memory().space(AS_PROGRAM).install_read_handler(0x02600000, 0x027fffff, read32_delegate(FUNC(device_sat_cart_interface::read_ext_dram1), m_exp->m_cart)); |
649 | 649 | machine().device("slave")->memory().space(AS_PROGRAM).install_write_handler(0x02600000, 0x027fffff, write32_delegate(FUNC(device_sat_cart_interface::write_ext_dram1), m_exp->m_cart)); |
650 | 650 | break; |
651 | | case 0: // ROM cart + mirror |
| 651 | case 0: // ROM cart + mirror |
652 | 652 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x02000000, 0x023fffff, read32_delegate(FUNC(device_sat_cart_interface::read_rom), m_exp->m_cart)); |
653 | 653 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x22000000, 0x24ffffff, read32_delegate(FUNC(device_sat_cart_interface::read_rom), m_exp->m_cart)); |
654 | 654 | machine().device("slave")->memory().space(AS_PROGRAM).install_read_handler(0x02000000, 0x023fffff, read32_delegate(FUNC(device_sat_cart_interface::read_rom), m_exp->m_cart)); |
r21968 | r21969 | |
656 | 656 | break; |
657 | 657 | } |
658 | 658 | } |
659 | | |
| 659 | |
660 | 660 | // save states |
661 | 661 | state_save_register_global_pointer(machine(), m_scu_regs, 0x100/4); |
662 | 662 | state_save_register_global_pointer(machine(), m_scsp_regs, 0x1000/2); |
trunk/src/mame/video/toaplan1.c
r21968 | r21969 | |
208 | 208 | |
209 | 209 | void toaplan1_state::toaplan1_create_tilemaps() |
210 | 210 | { |
211 | | |
212 | 211 | m_pf1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toaplan1_state::get_pf1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
213 | 212 | m_pf2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toaplan1_state::get_pf2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
214 | 213 | m_pf3_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(toaplan1_state::get_pf3_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
r21968 | r21969 | |
225 | 224 | |
226 | 225 | void toaplan1_state::toaplan1_paletteram_alloc() |
227 | 226 | { |
228 | | |
229 | 227 | UINT32 bytes = (m_colorram1.bytes() + m_colorram2.bytes())/2; |
230 | 228 | m_generic_paletteram_16.allocate(bytes); |
231 | 229 | } |
232 | 230 | |
233 | 231 | void toaplan1_state::toaplan1_vram_alloc() |
234 | 232 | { |
235 | | |
236 | 233 | m_pf1_tilevram16 = auto_alloc_array_clear(machine(), UINT16, TOAPLAN1_TILEVRAM_SIZE/2); |
237 | 234 | m_pf2_tilevram16 = auto_alloc_array_clear(machine(), UINT16, TOAPLAN1_TILEVRAM_SIZE/2); |
238 | 235 | m_pf3_tilevram16 = auto_alloc_array_clear(machine(), UINT16, TOAPLAN1_TILEVRAM_SIZE/2); |
r21968 | r21969 | |
254 | 251 | |
255 | 252 | void toaplan1_state::toaplan1_spritevram_alloc() |
256 | 253 | { |
257 | | |
258 | 254 | m_spriteram.allocate(TOAPLAN1_SPRITERAM_SIZE/2); |
259 | 255 | m_buffered_spriteram = auto_alloc_array_clear(machine(), UINT16, TOAPLAN1_SPRITERAM_SIZE/2); |
260 | 256 | m_spritesizeram16 = auto_alloc_array_clear(machine(), UINT16, TOAPLAN1_SPRITESIZERAM_SIZE/2); |
r21968 | r21969 | |
267 | 263 | |
268 | 264 | void toaplan1_state::toaplan1_set_scrolls() |
269 | 265 | { |
270 | | |
271 | 266 | m_pf1_tilemap->set_scrollx(0, (m_pf1_scrollx >> 7) - (m_tiles_offsetx - m_scrollx_offs1)); |
272 | 267 | m_pf2_tilemap->set_scrollx(0, (m_pf2_scrollx >> 7) - (m_tiles_offsetx - m_scrollx_offs2)); |
273 | 268 | m_pf3_tilemap->set_scrollx(0, (m_pf3_scrollx >> 7) - (m_tiles_offsetx - m_scrollx_offs3)); |
r21968 | r21969 | |
294 | 289 | |
295 | 290 | void toaplan1_state::register_common() |
296 | 291 | { |
297 | | |
298 | 292 | save_item(NAME(m_scrollx_offs1)); |
299 | 293 | save_item(NAME(m_scrollx_offs2)); |
300 | 294 | save_item(NAME(m_scrollx_offs3)); |
trunk/src/mame/drivers/coolridr.c
r21968 | r21969 | |
319 | 319 | m_io_an7(*this, "AN7"), |
320 | 320 | m_io_config(*this, "CONFIG") |
321 | 321 | { |
322 | | |
323 | 322 | } |
324 | 323 | |
325 | 324 | // Blitter state |
r21968 | r21969 | |
521 | 520 | }; |
522 | 521 | |
523 | 522 | #define PRINT_BLIT_STUFF \ |
524 | | printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x(%06x) %08x(%08x, %d, %d, %d) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", blit0, blit1_unused,b1mode,b1colorNumber, blit2_unused,b2tpen,b2colorNumber, blit3_unused,b3romoffset, blit4_unused, blit4blendlevel, blit_flipy,blit_rotate, blit_flipx, blit5_unused, indirect_tile_enable, indirect_zoom_enable, vCellCount, hCellCount, vZoom, hZoom, blit10, textlookup, vPosition, hPosition); \ |
| 523 | printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x(%06x) %08x(%08x, %d, %d, %d) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", blit0, blit1_unused,b1mode,b1colorNumber, blit2_unused,b2tpen,b2colorNumber, blit3_unused,b3romoffset, blit4_unused, blit4blendlevel, blit_flipy,blit_rotate, blit_flipx, blit5_unused, indirect_tile_enable, indirect_zoom_enable, vCellCount, hCellCount, vZoom, hZoom, blit10, textlookup, vPosition, hPosition); |
525 | 524 | |
526 | 525 | |
527 | | |
528 | 526 | /* video */ |
529 | 527 | |
530 | 528 | #define VRAM_SIZE 0x100000 |
r21968 | r21969 | |
1014 | 1012 | /* if (object->screen==0) printf("marking offset %04x as decoded (sprite number %08x ptr %08x)\n", v*used_hCellCount + h, spriteNumber, ((UINT64)(void*)tempshape)&0xffffffff);*/ \ |
1015 | 1013 | } \ |
1016 | 1014 | } \ |
1017 | | } \ |
| 1015 | } |
1018 | 1016 | |
1019 | 1017 | |
1020 | | |
1021 | 1018 | #define CHECK_DECODE \ |
1022 | 1019 | if (used_flipy) \ |
1023 | 1020 | { \ |
r21968 | r21969 | |
1046 | 1043 | continue; \ |
1047 | 1044 | } \ |
1048 | 1045 | else \ |
1049 | | if (blankcount==0) continue; \ |
| 1046 | if (blankcount==0) continue; |
1050 | 1047 | |
1051 | 1048 | |
1052 | | |
1053 | 1049 | #define GET_SPRITE_NUMBER \ |
1054 | 1050 | int lookupnum; \ |
1055 | 1051 | /* with this bit enabled the tile numbers gets looked up using 'data' (which would be blit11) (eg 03f40000 for startup text) */ \ |
r21968 | r21969 | |
1096 | 1092 | } \ |
1097 | 1093 | } \ |
1098 | 1094 | } \ |
1099 | | UINT32 spriteNumber = (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) +0 ] << 10) | (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) + 1 ]); \ |
| 1095 | UINT32 spriteNumber = (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) +0 ] << 10) | (expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) + 1 ]); |
1100 | 1096 | |
1101 | | |
1102 | 1097 | #define DO_XCLIP_REAL \ |
1103 | 1098 | if (drawx>clipmaxX) { break; } \ |
1104 | | if (drawx<clipminX) { drawx++; continue; } \ |
| 1099 | if (drawx<clipminX) { drawx++; continue; } |
| 1100 | #define DO_XCLIP_NONE |
1105 | 1101 | |
1106 | | #define DO_XCLIP_NONE \ |
1107 | | |
1108 | | |
1109 | 1102 | #define GET_CURRENT_LINESCROLLZOOM \ |
1110 | 1103 | UINT32 dword = object->indirect_zoom[v*16+realy]; \ |
1111 | 1104 | UINT16 hZoomTable = hZoom + (dword>>16); \ |
r21968 | r21969 | |
1132 | 1125 | case 3: \ |
1133 | 1126 | /* invalid? */ \ |
1134 | 1127 | break; \ |
1135 | | } \ |
| 1128 | } |
1136 | 1129 | |
1137 | 1130 | |
1138 | 1131 | |
1139 | | |
1140 | 1132 | #define YXLOOP \ |
1141 | 1133 | int drawy = pixelOffsetY; \ |
1142 | 1134 | for (int y = 0; y < blockhigh; y++) \ |
r21968 | r21969 | |
1179 | 1171 | } \ |
1180 | 1172 | } \ |
1181 | 1173 | drawy++; \ |
1182 | | } \ |
| 1174 | } |
1183 | 1175 | |
1184 | | |
1185 | 1176 | #define YXLOOP_NO_LINEZOOM \ |
1186 | 1177 | for (int y = 0; y < blockhigh; y++) \ |
1187 | 1178 | { \ |
r21968 | r21969 | |
1198 | 1189 | GET_PIX; \ |
1199 | 1190 | DRAW_PIX \ |
1200 | 1191 | } \ |
1201 | | } \ |
| 1192 | } |
1202 | 1193 | |
1203 | 1194 | |
1204 | | |
1205 | 1195 | #define YXLOOP_NO_ZOOM \ |
1206 | 1196 | for (int realy = 0; realy < 16; realy++) \ |
1207 | 1197 | { \ |
r21968 | r21969 | |
1216 | 1206 | GET_PIX; \ |
1217 | 1207 | DRAW_PIX \ |
1218 | 1208 | } \ |
1219 | | } \ |
| 1209 | } |
1220 | 1210 | |
1221 | 1211 | |
1222 | | |
1223 | 1212 | /* the two tables that the patent claims are located at: |
1224 | 1213 | 0x1ec800 |
1225 | 1214 | 0x1f0000 |
r21968 | r21969 | |
1271 | 1260 | } \ |
1272 | 1261 | } \ |
1273 | 1262 | } \ |
1274 | | drawx++; \ |
| 1263 | drawx++; |
1275 | 1264 | |
1276 | 1265 | |
1277 | | |
1278 | 1266 | //object->rearranged_16bit_gfx |
1279 | 1267 | //object->expanded_10bit_gfx |
1280 | 1268 | |
1281 | 1269 | #define GET_PIX_ROTATED \ |
1282 | | UINT16 pix = tempshape[realx*16+realy]; \ |
1283 | | |
| 1270 | UINT16 pix = tempshape[realx*16+realy]; |
1284 | 1271 | #define GET_PIX_NORMAL \ |
1285 | | UINT16 pix = tempshape[realy*16+realx]; \ |
| 1272 | UINT16 pix = tempshape[realy*16+realx]; |
1286 | 1273 | |
1287 | | |
1288 | 1274 | void *coolridr_state::draw_object_threaded(void *param, int threadid) |
1289 | 1275 | { |
1290 | 1276 | cool_render_object *object = reinterpret_cast<cool_render_object *>(param); |
r21968 | r21969 | |
1892 | 1878 | // Splat some sprites |
1893 | 1879 | for (int v = 0; v < used_vCellCount; v++) |
1894 | 1880 | { |
1895 | | |
1896 | | |
1897 | 1881 | const int pixelOffsetY = ((vPosition) + (v* 16 * vZoom)) / 0x40; |
1898 | 1882 | const int pixelOffsetnextY = ((vPosition) + ((v+1)* 16 * vZoom)) / 0x40; |
1899 | 1883 | |
r21968 | r21969 | |
1921 | 1905 | |
1922 | 1906 | if (!indirect_zoom_enable) |
1923 | 1907 | { |
1924 | | |
1925 | 1908 | int sizex = used_hCellCount * 16 * hZoom; |
1926 | 1909 | |
1927 | 1910 | hPosition = hPositionx * 0x40; |
r21968 | r21969 | |
1948 | 1931 | UINT32 lastSpriteNumber = 0xffffffff; |
1949 | 1932 | UINT16 blankcount = 0; |
1950 | 1933 | int color_offs = (0x7b20 + (b1colorNumber & 0x7ff))*0x40 * 5; /* yes, * 5 */ \ |
1951 | | int color_offs2 = (0x7b20 + (b2colorNumber & 0x7ff))*0x40 * 5; \ |
1952 | | |
| 1934 | int color_offs2 = (0x7b20 + (b2colorNumber & 0x7ff))*0x40 * 5; |
1953 | 1935 | for (int h = 0; h < used_hCellCount; h++) |
1954 | 1936 | { |
1955 | | |
1956 | 1937 | int current_decoded = false; |
1957 | 1938 | |
1958 | 1939 | if (!indirect_tile_enable && size < DECODECACHE_NUMSPRITETILES) |
r21968 | r21969 | |
2187 | 2168 | } |
2188 | 2169 | else if (blit0==1) |
2189 | 2170 | { |
2190 | | |
2191 | | |
2192 | | |
2193 | 2171 | if (m_blitterMode&0x80) |
2194 | 2172 | { |
2195 | 2173 | // HACK... |
r21968 | r21969 | |
2710 | 2688 | |
2711 | 2689 | case 0x02: |
2712 | 2690 | { |
2713 | | |
2714 | 2691 | // writes 3d0dxxxx / 3d0exxxx before a level start.. offset for a transfer read at 0x400000c, stored in work RAM H |
2715 | 2692 | |
2716 | 2693 | //printf("sysh1_unk_blit_w unhandled offset %04x %08x %08x\n", offset, data, mem_mask); |
r21968 | r21969 | |
3430 | 3407 | |
3431 | 3408 | |
3432 | 3409 | #define READ_COMPRESSED_ROM(chip) \ |
3433 | | m_compressedgfx[(chip)*0x400000 + romoffset] << 8 | m_compressedgfx[(chip)*0x0400000 + romoffset +1]; \ |
3434 | | |
| 3410 | m_compressedgfx[(chip)*0x400000 + romoffset] << 8 | m_compressedgfx[(chip)*0x0400000 + romoffset +1]; |
3435 | 3411 | // this helps you feth the 20bit words from an address in the compressed data |
3436 | 3412 | UINT32 coolridr_state::get_20bit_data(UINT32 romoffset, int _20bitwordnum) |
3437 | 3413 | { |