234
234
subsino_state(const machine_config &mconfig, device_type type, const char *tag)
235
: driver_device(mconfig, type, tag) { }
235
: driver_device(mconfig, type, tag) ,
236
m_colorram(*this, "colorram"),
237
m_videoram(*this, "videoram"),
238
m_reel3_scroll(*this, "reel3_scroll"),
239
m_reel2_scroll(*this, "reel2_scroll"),
240
m_reel1_scroll(*this, "reel1_scroll"),
241
m_reel1_ram(*this, "reel1_ram"),
242
m_reel2_ram(*this, "reel2_ram"),
243
m_reel3_ram(*this, "reel3_ram"){ }
245
required_shared_ptr<UINT8> m_colorram;
246
required_shared_ptr<UINT8> m_videoram;
247
optional_shared_ptr<UINT8> m_reel3_scroll;
248
optional_shared_ptr<UINT8> m_reel2_scroll;
249
optional_shared_ptr<UINT8> m_reel1_scroll;
250
optional_shared_ptr<UINT8> m_reel1_ram;
251
optional_shared_ptr<UINT8> m_reel2_ram;
252
optional_shared_ptr<UINT8> m_reel3_ram;
239
254
tilemap_t *m_tmap;
240
255
tilemap_t *m_reel1_tilemap;
241
256
tilemap_t *m_reel2_tilemap;
242
257
tilemap_t *m_reel3_tilemap;
243
258
int m_tiles_offset;
247
UINT8* m_reel1_scroll;
248
UINT8* m_reel2_scroll;
249
UINT8* m_reel3_scroll;
251
260
UINT8* m_reel1_attr;
252
261
UINT8* m_reel2_attr;
257
266
int m_colordac_offs;
258
267
UINT8* m_stisub_colorram;
259
268
UINT8 m_stisub_outc;
269
DECLARE_WRITE8_MEMBER(subsino_tiles_offset_w);
270
DECLARE_WRITE8_MEMBER(subsino_videoram_w);
271
DECLARE_WRITE8_MEMBER(subsino_colorram_w);
272
DECLARE_WRITE8_MEMBER(subsino_reel1_ram_w);
273
DECLARE_WRITE8_MEMBER(subsino_reel2_ram_w);
274
DECLARE_WRITE8_MEMBER(subsino_reel3_ram_w);
275
DECLARE_WRITE8_MEMBER(subsino_out_a_w);
276
DECLARE_WRITE8_MEMBER(subsino_out_b_w);
277
DECLARE_READ8_MEMBER(flash_r);
278
DECLARE_WRITE8_MEMBER(flash_w);
279
DECLARE_READ8_MEMBER(hwcheck_r);
280
DECLARE_WRITE8_MEMBER(subsino_out_c_w);
281
DECLARE_WRITE8_MEMBER(colordac_w);
282
DECLARE_WRITE8_MEMBER(stisub_out_c_w);
283
DECLARE_WRITE8_MEMBER(reel_scrollattr_w);
284
DECLARE_READ8_MEMBER(reel_scrollattr_r);
266
291
***************************************************************************/
269
static WRITE8_HANDLER( subsino_tiles_offset_w )
294
WRITE8_MEMBER(subsino_state::subsino_tiles_offset_w)
271
subsino_state *state = space->machine().driver_data<subsino_state>();
272
state->m_tiles_offset = (data & 1) ? 0x1000: 0;
273
state->m_tmap->mark_tile_dirty(offset);
296
m_tiles_offset = (data & 1) ? 0x1000: 0;
297
m_tmap->mark_tile_dirty(offset);
274
298
// popmessage("gfx %02x",data);
277
static WRITE8_HANDLER( subsino_videoram_w )
301
WRITE8_MEMBER(subsino_state::subsino_videoram_w)
279
subsino_state *state = space->machine().driver_data<subsino_state>();
280
state->m_videoram[offset] = data;
281
state->m_tmap->mark_tile_dirty(offset);
303
m_videoram[offset] = data;
304
m_tmap->mark_tile_dirty(offset);
284
static WRITE8_HANDLER( subsino_colorram_w )
307
WRITE8_MEMBER(subsino_state::subsino_colorram_w)
286
subsino_state *state = space->machine().driver_data<subsino_state>();
287
state->m_colorram[offset] = data;
288
state->m_tmap->mark_tile_dirty(offset);
309
m_colorram[offset] = data;
310
m_tmap->mark_tile_dirty(offset);
291
313
static TILE_GET_INFO( get_tile_info )
625
645
output_set_lamp_value(14, (data >> 6) & 1); /* Lamp 14 */
626
646
output_set_lamp_value(15, (data >> 7) & 1); /* Lamp 15 */
628
coin_counter_w( space->machine(), 0, data & 0x01 ); /* coin / keyin */
629
coin_counter_w( space->machine(), 1, data & 0x02 ); /* keyin / coin */
630
coin_counter_w( space->machine(), 2, data & 0x10 ); /* keyout */
631
coin_counter_w( space->machine(), 3, data & 0x20 ); /* payout */
648
coin_counter_w( machine(), 0, data & 0x01 ); /* coin / keyin */
649
coin_counter_w( machine(), 1, data & 0x02 ); /* keyin / coin */
650
coin_counter_w( machine(), 2, data & 0x10 ); /* keyout */
651
coin_counter_w( machine(), 3, data & 0x20 ); /* payout */
633
653
// popmessage("Out A %02x",data);
637
static WRITE8_HANDLER( subsino_out_b_w )
657
WRITE8_MEMBER(subsino_state::subsino_out_b_w)
639
659
/***** LAMPS: *****
787
807
AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INA" )
788
808
AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INB" )
790
AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE( subsino_out_b_w )
791
AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE( subsino_out_a_w )
810
AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE(subsino_out_b_w )
811
AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE(subsino_out_a_w )
793
813
AM_RANGE( 0x0d00c, 0x0d00c ) AM_READ_PORT( "INC" )
795
AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
797
AM_RANGE( 0x0d018, 0x0d018 ) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
799
AM_RANGE( 0x0d01b, 0x0d01b ) AM_WRITE( subsino_tiles_offset_w )
801
AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
802
AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
815
AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w )
817
AM_RANGE( 0x0d018, 0x0d018 ) AM_DEVWRITE("oki", okim6295_device, write)
819
AM_RANGE( 0x0d01b, 0x0d01b ) AM_WRITE(subsino_tiles_offset_w )
821
AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
822
AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
806
static ADDRESS_MAP_START( sharkpy_map, AS_PROGRAM, 8 )
826
static ADDRESS_MAP_START( sharkpy_map, AS_PROGRAM, 8, subsino_state )
807
827
AM_RANGE( 0x09800, 0x09fff ) AM_RAM
809
829
AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" )
814
834
AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INA" )
815
835
AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" )
817
AM_RANGE( 0x09009, 0x09009 ) AM_WRITE( subsino_out_b_w )
818
AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE( subsino_out_a_w )
837
AM_RANGE( 0x09009, 0x09009 ) AM_WRITE(subsino_out_b_w )
838
AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE(subsino_out_a_w )
820
840
AM_RANGE( 0x0900c, 0x0900c ) AM_READ_PORT( "INC" )
822
AM_RANGE( 0x09016, 0x09017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
824
AM_RANGE( 0x09018, 0x09018 ) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
826
AM_RANGE( 0x0901b, 0x0901b ) AM_WRITE( subsino_tiles_offset_w )
842
AM_RANGE( 0x09016, 0x09017 ) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w )
844
AM_RANGE( 0x09018, 0x09018 ) AM_DEVWRITE("oki", okim6295_device, write)
846
AM_RANGE( 0x0901b, 0x0901b ) AM_WRITE(subsino_tiles_offset_w )
828
848
AM_RANGE( 0x07800, 0x07fff ) AM_RAM
829
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
830
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
849
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
850
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
832
852
AM_RANGE( 0x00000, 0x13fff ) AM_ROM //overlap unmapped regions
838
858
this event makes the game to reset without any money in the bank.
841
static ADDRESS_MAP_START( victor21_map, AS_PROGRAM, 8 )
861
static ADDRESS_MAP_START( victor21_map, AS_PROGRAM, 8, subsino_state )
842
862
AM_RANGE( 0x09800, 0x09fff ) AM_RAM
844
AM_RANGE( 0x09000, 0x09000 ) AM_WRITE( subsino_out_a_w )
845
AM_RANGE( 0x09001, 0x09001 ) AM_WRITE( subsino_out_b_w )
864
AM_RANGE( 0x09000, 0x09000 ) AM_WRITE(subsino_out_a_w )
865
AM_RANGE( 0x09001, 0x09001 ) AM_WRITE(subsino_out_b_w )
846
866
AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "INC" )
847
867
AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "INA" )
848
868
AM_RANGE( 0x09005, 0x09005 ) AM_READ_PORT( "INB" )
854
874
AM_RANGE( 0x0900b, 0x0900b ) AM_RAM //protection
856
// AM_RANGE( 0x0900c, 0x0900c ) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
858
AM_RANGE( 0x0900e, 0x0900f ) AM_DEVWRITE( "ymsnd", ym2413_w )
860
AM_RANGE( 0x0900d, 0x0900d ) AM_WRITE( subsino_tiles_offset_w )
876
// AM_RANGE( 0x0900c, 0x0900c ) AM_DEVWRITE("oki", okim6295_device, write)
878
AM_RANGE( 0x0900e, 0x0900f ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
880
AM_RANGE( 0x0900d, 0x0900d ) AM_WRITE(subsino_tiles_offset_w )
862
882
AM_RANGE( 0x07800, 0x07fff ) AM_RAM
863
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
864
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
883
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
884
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
866
886
AM_RANGE( 0x00000, 0x08fff ) AM_ROM //overlap unmapped regions
867
887
AM_RANGE( 0x10000, 0x13fff ) AM_ROM
889
static READ8_HANDLER( flash_r )
909
READ8_MEMBER(subsino_state::flash_r)
891
subsino_state *state = space->machine().driver_data<subsino_state>();
892
// printf("R %02x\n",state->m_flash_val);
911
// printf("R %02x\n",m_flash_val);
894
if(state->m_flash_val == 0xff)
913
if(m_flash_val == 0xff)
896
else if(state->m_flash_val <= 0xa)
897
return state->m_flash_val;
898
else if(state->m_flash_val == 0x92)
915
else if(m_flash_val <= 0xa)
917
else if(m_flash_val == 0x92)
899
918
return 0xeb; //protected GFXs in Cross Bingo
904
static WRITE8_HANDLER( flash_w )
923
WRITE8_MEMBER(subsino_state::flash_w)
906
subsino_state *state = space->machine().driver_data<subsino_state>();
907
switch(state->m_flash_packet_start)
925
switch(m_flash_packet_start)
910
state->m_flash_packet = data;
911
if((state->m_flash_packet & 0xf8) == 0xd0)
912
state->m_flash_packet_start = 1; //start of packet
928
m_flash_packet = data;
929
if((m_flash_packet & 0xf8) == 0xd0)
930
m_flash_packet_start = 1; //start of packet
915
state->m_flash_packet = data;
916
if((state->m_flash_packet & 0xf8) == 0xe0)
917
state->m_flash_packet_start = 0; //end of packet
933
m_flash_packet = data;
934
if((m_flash_packet & 0xf8) == 0xe0)
935
m_flash_packet_start = 0; //end of packet
919
state->m_flash_val = data;
924
static ADDRESS_MAP_START( victor5_map, AS_PROGRAM, 8 )
942
static ADDRESS_MAP_START( victor5_map, AS_PROGRAM, 8, subsino_state )
925
943
AM_IMPORT_FROM( victor21_map )
926
AM_RANGE( 0x0900a, 0x0900a ) AM_READWRITE( flash_r, flash_w )
944
AM_RANGE( 0x0900a, 0x0900a ) AM_READWRITE(flash_r, flash_w )
927
945
AM_RANGE( 0x0900b, 0x0900b ) AM_READNOP //"flash" status, bit 0
931
static READ8_HANDLER( hwcheck_r )
949
READ8_MEMBER(subsino_state::hwcheck_r)
933
951
/* Wants this at POST otherwise an "Hardware Error" occurs. */
937
static ADDRESS_MAP_START( crsbingo_map, AS_PROGRAM, 8 )
955
static ADDRESS_MAP_START( crsbingo_map, AS_PROGRAM, 8, subsino_state )
938
956
AM_RANGE( 0x09800, 0x09fff ) AM_RAM
940
958
AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" )
942
960
AM_RANGE( 0x09002, 0x09002 ) AM_READ_PORT( "INA" )
943
961
AM_RANGE( 0x09003, 0x09003 ) AM_READ_PORT( "INB" )
944
962
AM_RANGE( 0x09004, 0x09004 ) AM_READ_PORT( "INC" )
945
AM_RANGE( 0x09005, 0x09005 ) AM_WRITE( subsino_out_a_w )
963
AM_RANGE( 0x09005, 0x09005 ) AM_WRITE(subsino_out_a_w )
947
965
AM_RANGE( 0x09008, 0x09008 ) AM_READ_PORT( "SW4" )
948
AM_RANGE( 0x09009, 0x09009 ) AM_READ_PORT( "SW3" ) // AM_WRITE( subsino_out_a_w )
949
AM_RANGE( 0x0900a, 0x0900a ) AM_READWRITE( hwcheck_r, subsino_out_b_w )
966
AM_RANGE( 0x09009, 0x09009 ) AM_READ_PORT( "SW3" ) // AM_WRITE(subsino_out_a_w )
967
AM_RANGE( 0x0900a, 0x0900a ) AM_READWRITE(hwcheck_r, subsino_out_b_w )
951
AM_RANGE( 0x09010, 0x09010 ) AM_READWRITE( flash_r, flash_w )
969
AM_RANGE( 0x09010, 0x09010 ) AM_READWRITE(flash_r, flash_w )
952
970
// AM_RANGE( 0x09011, 0x09011 ) //"flash" status, bit 0
953
971
// AM_RANGE( 0x0900c, 0x0900c ) AM_READ_PORT( "INC" )
954
AM_RANGE( 0x0900c, 0x0900d ) AM_DEVWRITE( "ymsnd", ym2413_w )
956
// AM_RANGE( 0x09018, 0x09018 ) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
958
// AM_RANGE( 0x0900d, 0x0900d ) AM_WRITE( subsino_tiles_offset_w )
972
AM_RANGE( 0x0900c, 0x0900d ) AM_DEVWRITE_LEGACY("ymsnd", ym2413_w )
974
// AM_RANGE( 0x09018, 0x09018 ) AM_DEVWRITE("oki", okim6295_device, write)
976
// AM_RANGE( 0x0900d, 0x0900d ) AM_WRITE(subsino_tiles_offset_w )
960
978
AM_RANGE( 0x07800, 0x07fff ) AM_RAM
961
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
962
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
979
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
980
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
964
982
AM_RANGE( 0x00000, 0x8fff ) AM_ROM //overlap unmapped regions
970
static WRITE8_HANDLER( subsino_out_c_w )
988
WRITE8_MEMBER(subsino_state::subsino_out_c_w)
972
subsino_state *state = space->machine().driver_data<subsino_state>();
973
990
// not 100% sure on this
976
993
// e = enable reels?
977
994
// c = reel colour bank?
978
state->m_out_c = data;
980
state->m_reel1_tilemap->mark_all_dirty();
981
state->m_reel2_tilemap->mark_all_dirty();
982
state->m_reel3_tilemap->mark_all_dirty();
997
m_reel1_tilemap->mark_all_dirty();
998
m_reel2_tilemap->mark_all_dirty();
999
m_reel3_tilemap->mark_all_dirty();
983
1000
// popmessage("data %02x\n",data);
986
static ADDRESS_MAP_START( tisub_map, AS_PROGRAM, 8 )
1003
static ADDRESS_MAP_START( tisub_map, AS_PROGRAM, 8, subsino_state )
987
1004
AM_RANGE( 0x09800, 0x09fff ) AM_RAM
989
1006
AM_RANGE( 0x09000, 0x09000 ) AM_READ_PORT( "SW1" )
995
1012
AM_RANGE( 0x09006, 0x09006 ) AM_READ_PORT( "INB" )
997
1014
/* 0x09008: is marked as OUTPUT C in the test mode. */
998
AM_RANGE( 0x09008, 0x09008 ) AM_WRITE( subsino_out_c_w )
999
AM_RANGE( 0x09009, 0x09009 ) AM_WRITE( subsino_out_b_w )
1000
AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE( subsino_out_a_w )
1015
AM_RANGE( 0x09008, 0x09008 ) AM_WRITE(subsino_out_c_w )
1016
AM_RANGE( 0x09009, 0x09009 ) AM_WRITE(subsino_out_b_w )
1017
AM_RANGE( 0x0900a, 0x0900a ) AM_WRITE(subsino_out_a_w )
1002
1019
AM_RANGE( 0x0900c, 0x0900c ) AM_READ_PORT( "INC" )
1004
AM_RANGE( 0x09016, 0x09017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
1006
// AM_RANGE( 0x0900c, 0x0900c ) AM_DEVWRITE_MODERN("oki", okim6295_device, write)
1008
AM_RANGE( 0x0901b, 0x0901b ) AM_WRITE( subsino_tiles_offset_w )
1021
AM_RANGE( 0x09016, 0x09017 ) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w )
1023
// AM_RANGE( 0x0900c, 0x0900c ) AM_DEVWRITE("oki", okim6295_device, write)
1025
AM_RANGE( 0x0901b, 0x0901b ) AM_WRITE(subsino_tiles_offset_w )
1010
1027
AM_RANGE( 0x07800, 0x07fff ) AM_RAM
1011
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
1012
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
1028
AM_RANGE( 0x08800, 0x08fff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
1029
AM_RANGE( 0x08000, 0x087ff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
1014
1031
AM_RANGE( 0x00000, 0x0bfff ) AM_ROM // overlap unmapped regions
1015
1032
AM_RANGE( 0x10000, 0x13fff ) AM_ROM
1016
1033
AM_RANGE( 0x14000, 0x14fff ) AM_ROM // reads the card face data here (see rom copy in rom loading)
1018
AM_RANGE( 0x150c0, 0x150ff ) AM_RAM AM_BASE_MEMBER(subsino_state, m_reel3_scroll)
1019
AM_RANGE( 0x15140, 0x1517f ) AM_RAM AM_BASE_MEMBER(subsino_state, m_reel2_scroll)
1020
AM_RANGE( 0x15180, 0x151bf ) AM_RAM AM_BASE_MEMBER(subsino_state, m_reel1_scroll)
1035
AM_RANGE( 0x150c0, 0x150ff ) AM_RAM AM_SHARE("reel3_scroll")
1036
AM_RANGE( 0x15140, 0x1517f ) AM_RAM AM_SHARE("reel2_scroll")
1037
AM_RANGE( 0x15180, 0x151bf ) AM_RAM AM_SHARE("reel1_scroll")
1022
AM_RANGE( 0x15800, 0x159ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE_MEMBER(subsino_state, m_reel1_ram)
1023
AM_RANGE( 0x15a00, 0x15bff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE_MEMBER(subsino_state, m_reel2_ram)
1024
AM_RANGE( 0x15c00, 0x15dff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE_MEMBER(subsino_state, m_reel3_ram)
1039
AM_RANGE( 0x15800, 0x159ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_SHARE("reel1_ram")
1040
AM_RANGE( 0x15a00, 0x15bff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_SHARE("reel2_ram")
1041
AM_RANGE( 0x15c00, 0x15dff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_SHARE("reel3_ram")
1025
1042
ADDRESS_MAP_END
1028
static WRITE8_HANDLER(colordac_w)
1045
WRITE8_MEMBER(subsino_state::colordac_w)
1030
subsino_state *state = space->machine().driver_data<subsino_state>();
1031
1047
switch ( offset )
1034
state->m_colordac_offs = data * 3;
1050
m_colordac_offs = data * 3;
1038
state->m_stisub_colorram[state->m_colordac_offs] = data;
1039
palette_set_color_rgb(space->machine(), state->m_colordac_offs/3,
1040
pal6bit(state->m_stisub_colorram[(state->m_colordac_offs/3)*3+0]),
1041
pal6bit(state->m_stisub_colorram[(state->m_colordac_offs/3)*3+1]),
1042
pal6bit(state->m_stisub_colorram[(state->m_colordac_offs/3)*3+2])
1054
m_stisub_colorram[m_colordac_offs] = data;
1055
palette_set_color_rgb(machine(), m_colordac_offs/3,
1056
pal6bit(m_stisub_colorram[(m_colordac_offs/3)*3+0]),
1057
pal6bit(m_stisub_colorram[(m_colordac_offs/3)*3+1]),
1058
pal6bit(m_stisub_colorram[(m_colordac_offs/3)*3+2])
1044
state->m_colordac_offs = (state->m_colordac_offs+1) % (256*3);
1060
m_colordac_offs = (m_colordac_offs+1) % (256*3);
1057
static WRITE8_HANDLER( stisub_out_c_w )
1073
WRITE8_MEMBER(subsino_state::stisub_out_c_w)
1059
subsino_state *state = space->machine().driver_data<subsino_state>();
1060
state->m_stisub_outc = data;
1075
m_stisub_outc = data;
1064
1079
// this stuff is banked..
1065
1080
// not 100% sure on the bank bits.. other bits are also set
1066
static WRITE8_HANDLER( reel_scrollattr_w )
1081
WRITE8_MEMBER(subsino_state::reel_scrollattr_w)
1068
subsino_state *state = space->machine().driver_data<subsino_state>();
1069
if (state->m_stisub_outc&0x20)
1083
if (m_stisub_outc&0x20)
1071
1085
if (offset<0x200)
1073
state->m_reel1_attr[offset&0x1ff] = data;
1087
m_reel1_attr[offset&0x1ff] = data;
1075
1089
else if (offset<0x400)
1077
state->m_reel2_attr[offset&0x1ff] = data;
1091
m_reel2_attr[offset&0x1ff] = data;
1079
1093
else if (offset<0x600)
1081
state->m_reel3_attr[offset&0x1ff] = data;
1095
m_reel3_attr[offset&0x1ff] = data;
1096
1110
else if (offset<0x80)
1098
state->m_reel2_scroll[offset&0x3f] = data;
1112
m_reel2_scroll[offset&0x3f] = data;
1100
1114
else if (offset<0xc0)
1102
state->m_reel1_scroll[offset&0x3f] = data;
1116
m_reel1_scroll[offset&0x3f] = data;
1106
state->m_reel3_scroll[offset&0x3f] = data;
1120
m_reel3_scroll[offset&0x3f] = data;
1111
static READ8_HANDLER( reel_scrollattr_r )
1125
READ8_MEMBER(subsino_state::reel_scrollattr_r)
1113
subsino_state *state = space->machine().driver_data<subsino_state>();
1114
return state->m_reel1_attr[offset];
1127
return m_reel1_attr[offset];
1117
static ADDRESS_MAP_START( stisub_map, AS_PROGRAM, 8 )
1130
static ADDRESS_MAP_START( stisub_map, AS_PROGRAM, 8, subsino_state )
1118
1131
AM_RANGE( 0x00000, 0x0bfff ) AM_ROM
1120
1133
AM_RANGE( 0x0c000, 0x0cfff ) AM_RAM
1127
1140
AM_RANGE( 0x0d005, 0x0d005 ) AM_READ_PORT( "INB" )
1128
1141
AM_RANGE( 0x0d006, 0x0d006 ) AM_READ_PORT( "INA" )
1130
AM_RANGE( 0x0d008, 0x0d008 ) AM_WRITE( stisub_out_c_w )
1143
AM_RANGE( 0x0d008, 0x0d008 ) AM_WRITE(stisub_out_c_w )
1132
AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE( subsino_out_b_w )
1133
AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE( subsino_out_a_w )
1145
AM_RANGE( 0x0d009, 0x0d009 ) AM_WRITE(subsino_out_b_w )
1146
AM_RANGE( 0x0d00a, 0x0d00a ) AM_WRITE(subsino_out_a_w )
1135
1148
AM_RANGE( 0x0d00c, 0x0d00c ) AM_READ_PORT( "INC" )
1137
1150
AM_RANGE( 0x0d010, 0x0d013 ) AM_WRITE(colordac_w)
1139
AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
1141
// AM_RANGE( 0x0d01b, 0x0d01b ) AM_WRITE( subsino_tiles_offset_w )
1143
AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
1144
AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
1152
AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w )
1154
// AM_RANGE( 0x0d01b, 0x0d01b ) AM_WRITE(subsino_tiles_offset_w )
1156
AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
1157
AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
1146
1159
AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(reel_scrollattr_r, reel_scrollattr_w)
1148
AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE_MEMBER(subsino_state, m_reel1_ram)
1149
AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE_MEMBER(subsino_state, m_reel2_ram)
1150
AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE_MEMBER(subsino_state, m_reel3_ram)
1161
AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_SHARE("reel1_ram")
1162
AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_SHARE("reel2_ram")
1163
AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_SHARE("reel3_ram")
1151
1164
ADDRESS_MAP_END
1178
1191
// AM_RANGE( 0x0d012, 0x0d012 ) AM_WRITE
1180
AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE( "ymsnd", ym3812_w )
1182
// AM_RANGE( 0x0d018, 0x0d018 ) AM_DEVREADWRITE_MODERN("oki", okim6295_device, read, write)
1184
AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE( subsino_colorram_w ) AM_BASE_MEMBER(subsino_state, m_colorram )
1185
AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE( subsino_videoram_w ) AM_BASE_MEMBER(subsino_state, m_videoram )
1193
AM_RANGE( 0x0d016, 0x0d017 ) AM_DEVWRITE_LEGACY("ymsnd", ym3812_w )
1195
// AM_RANGE( 0x0d018, 0x0d018 ) AM_DEVREADWRITE("oki", okim6295_device, read, write)
1197
AM_RANGE( 0x0e000, 0x0e7ff ) AM_RAM_WRITE(subsino_colorram_w ) AM_SHARE("colorram")
1198
AM_RANGE( 0x0e800, 0x0efff ) AM_RAM_WRITE(subsino_videoram_w ) AM_SHARE("videoram")
1187
1200
AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(reel_scrollattr_r, reel_scrollattr_w)
1189
AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_BASE_MEMBER(subsino_state, m_reel1_ram)
1190
AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_BASE_MEMBER(subsino_state, m_reel2_ram)
1191
AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_BASE_MEMBER(subsino_state, m_reel3_ram)
1202
AM_RANGE( 0xf800, 0xf9ff ) AM_RAM_WRITE(subsino_reel1_ram_w) AM_SHARE("reel1_ram")
1203
AM_RANGE( 0xfa00, 0xfbff ) AM_RAM_WRITE(subsino_reel2_ram_w) AM_SHARE("reel2_ram")
1204
AM_RANGE( 0xfc00, 0xfdff ) AM_RAM_WRITE(subsino_reel3_ram_w) AM_SHARE("reel3_ram")
1192
1205
ADDRESS_MAP_END
1195
static ADDRESS_MAP_START( subsino_iomap, AS_IO, 8 )
1208
static ADDRESS_MAP_START( subsino_iomap, AS_IO, 8, subsino_state )
1196
1209
AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs
1197
1210
ADDRESS_MAP_END
3536
3549
static DRIVER_INIT( stisub )
3538
3551
subsino_state *state = machine.driver_data<subsino_state>();
3539
UINT8 *rom = machine.region( "maincpu" )->base();
3552
UINT8 *rom = state->memregion( "maincpu" )->base();
3540
3553
rom[0x1005] = 0x1d; //patch protection check
3541
3554
rom[0x7ab] = 0x18; //patch "winning protection" check
3542
3555
rom[0x957] = 0x18; //patch "losing protection" check
3543
3556
state->m_stisub_colorram = auto_alloc_array(machine, UINT8, 256*3);
3545
state->m_reel1_scroll = auto_alloc_array(machine, UINT8, 0x40);
3546
state->m_reel2_scroll = auto_alloc_array(machine, UINT8, 0x40);
3547
state->m_reel3_scroll = auto_alloc_array(machine, UINT8, 0x40);
3558
state->m_reel1_scroll.allocate(0x40);
3559
state->m_reel2_scroll.allocate(0x40);
3560
state->m_reel3_scroll.allocate(0x40);
3549
3562
state->m_reel1_attr = auto_alloc_array(machine, UINT8, 0x200);
3550
3563
state->m_reel2_attr = auto_alloc_array(machine, UINT8, 0x200);
3556
3569
subsino_state *state = machine.driver_data<subsino_state>();
3557
3570
state->m_stisub_colorram = auto_alloc_array(machine, UINT8, 256*3);
3559
state->m_reel1_scroll = auto_alloc_array(machine, UINT8, 0x40);
3560
state->m_reel2_scroll = auto_alloc_array(machine, UINT8, 0x40);
3561
state->m_reel3_scroll = auto_alloc_array(machine, UINT8, 0x40);
3572
state->m_reel1_scroll.allocate(0x40);
3573
state->m_reel2_scroll.allocate(0x40);
3574
state->m_reel3_scroll.allocate(0x40);
3563
3576
state->m_reel1_attr = auto_alloc_array(machine, UINT8, 0x200);
3564
3577
state->m_reel2_attr = auto_alloc_array(machine, UINT8, 0x200);