src/mess/drivers/supracan.c
| r6848 | r6849 | |
| 25 | 25 | static UINT16 *supracan_soundram_16; |
| 26 | 26 | static UINT16 supracan_video_regs[256]; |
| 27 | 27 | static emu_timer *supracan_video_timer; |
| 28 | static UINT16 *supracan_charram, *supracan_vram; |
| 28 | 29 | |
| 29 | | |
| 30 | 30 | static READ16_HANDLER( supracan_unk1_r ); |
| 31 | 31 | static WRITE16_HANDLER( supracan_soundram_w ); |
| 32 | 32 | static WRITE16_HANDLER( supracan_sound_w ); |
| 33 | 33 | static READ16_HANDLER( supracan_video_r ); |
| 34 | 34 | static WRITE16_HANDLER( supracan_video_w ); |
| 35 | static WRITE16_HANDLER( supracan_char_w ); |
| 35 | 36 | |
| 37 | static VIDEO_START( supracan ) |
| 38 | { |
| 36 | 39 | |
| 40 | } |
| 41 | |
| 42 | static VIDEO_UPDATE( supracan ) |
| 43 | { |
| 44 | int x,y,count; |
| 45 | const gfx_element *gfx = screen->machine->gfx[0]; |
| 46 | |
| 47 | count = 0; |
| 48 | |
| 49 | for (y=0;y<16;y++) |
| 50 | { |
| 51 | for (x=0;x<16;x++) |
| 52 | { |
| 53 | int tile; |
| 54 | |
| 55 | tile = (supracan_vram[count] & 0x00ff); |
| 56 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8); |
| 57 | count++; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | return 0; |
| 62 | } |
| 63 | |
| 37 | 64 | static ADDRESS_MAP_START( supracan_mem, ADDRESS_SPACE_PROGRAM, 16 ) |
| 38 | 65 | AM_RANGE( 0x000000, 0x07ffff ) AM_ROM AM_REGION( "cart", 0 ) |
| 39 | 66 | AM_RANGE( 0xe80300, 0xe80301 ) AM_READ( supracan_unk1_r ) |
| r6848 | r6849 | |
| 41 | 68 | AM_RANGE( 0xe8f000, 0xe8ffff ) AM_RAM_WRITE( supracan_soundram_w ) AM_BASE( &supracan_soundram_16 ) |
| 42 | 69 | AM_RANGE( 0xe90000, 0xe9001f ) AM_WRITE( supracan_sound_w ) |
| 43 | 70 | AM_RANGE( 0xf00000, 0xf001ff ) AM_READWRITE( supracan_video_r, supracan_video_w ) |
| 44 | | AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM /* Unknown, some data gets copied here during boot */ |
| 45 | | AM_RANGE( 0xf40000, 0xf43fff ) AM_RAM /* Unknown, some data gets copied here during boot */ |
| 71 | AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 72 | AM_RANGE( 0xf40000, 0xf43fff ) AM_RAM_WRITE(supracan_char_w) AM_BASE(&supracan_charram) /* Unknown, some data gets copied here during boot */ |
| 46 | 73 | AM_RANGE( 0xf44000, 0xf441ff ) AM_RAM /* Unknown */ |
| 47 | | AM_RANGE( 0xf44200, 0xf443ff ) AM_RAM /* Unknown, some data gets copied here during boot. Possibly a tilemap?? */ |
| 74 | AM_RANGE( 0xf44200, 0xf443ff ) AM_RAM AM_BASE(&supracan_vram) /* Unknown, some data gets copied here during boot. Possibly a tilemap?? */ |
| 48 | 75 | AM_RANGE( 0xf44400, 0xf445ff ) AM_RAM /* Unknown, some data gets copied here during boot. Looks like the Functech logo is here */ |
| 49 | 76 | AM_RANGE( 0xf44600, 0xf44fff ) AM_RAM /* Unknown, stuff gets written here. Zoom table?? */ |
| 50 | 77 | AM_RANGE( 0xfc0000, 0xfcffff ) AM_RAM /* System work ram */ |
| r6848 | r6849 | |
| 57 | 84 | AM_RANGE( 0xf000, 0xffff ) AM_RAM AM_BASE( &supracan_soundram ) |
| 58 | 85 | ADDRESS_MAP_END |
| 59 | 86 | |
| 87 | static WRITE16_HANDLER( supracan_char_w ) |
| 88 | { |
| 89 | COMBINE_DATA(&supracan_charram[offset]); |
| 60 | 90 | |
| 91 | { |
| 92 | UINT8 *gfx = memory_region(space->machine, "ram_gfx"); |
| 93 | |
| 94 | gfx[offset*2+0] = (supracan_charram[offset] & 0xff00) >> 8; |
| 95 | gfx[offset*2+1] = (supracan_charram[offset] & 0x00ff) >> 0; |
| 96 | |
| 97 | gfx_element_mark_dirty(space->machine->gfx[0], offset/64); |
| 98 | } |
| 99 | } |
| 100 | |
| 61 | 101 | static INPUT_PORTS_START( supracan ) |
| 62 | 102 | INPUT_PORTS_END |
| 63 | 103 | |
| 64 | 104 | |
| 65 | 105 | static PALETTE_INIT( supracan ) |
| 66 | 106 | { |
| 107 | #if 0 |
| 67 | 108 | int i, r, g, b; |
| 68 | 109 | |
| 69 | 110 | for( i = 0; i < 32768; i++ ) |
| r6848 | r6849 | |
| 74 | 115 | b = ((i >> 10) & 0x1f) << 3; |
| 75 | 116 | palette_set_color_rgb( machine, i, r, g, b ); |
| 76 | 117 | } |
| 118 | #endif |
| 77 | 119 | } |
| 78 | 120 | |
| 79 | 121 | |
| r6848 | r6849 | |
| 186 | 228 | timer_adjust_oneshot( supracan_video_timer, video_screen_get_time_until_pos( machine->primary_screen, 0, 0 ), 0 ); |
| 187 | 229 | } |
| 188 | 230 | |
| 231 | static const gfx_layout supracan_gfxlayout = |
| 232 | { |
| 233 | 8,8, |
| 234 | RGN_FRAC(1,1), |
| 235 | 8, |
| 236 | { STEP8(0,1) }, |
| 237 | { STEP8(0,8) }, |
| 238 | { STEP8(0,8*8) }, |
| 239 | 8*8*8 |
| 240 | }; |
| 189 | 241 | |
| 242 | |
| 243 | static GFXDECODE_START( supracan ) |
| 244 | GFXDECODE_ENTRY( "ram_gfx", 0, supracan_gfxlayout, 0, 1 ) |
| 245 | GFXDECODE_END |
| 246 | |
| 247 | |
| 190 | 248 | static MACHINE_DRIVER_START( supracan ) |
| 191 | 249 | MDRV_CPU_ADD( "maincpu", M68000, XTAL_10_738635MHz ) /* Correct frequency unknown */ |
| 192 | 250 | MDRV_CPU_PROGRAM_MAP( supracan_mem ) |
| r6848 | r6849 | |
| 203 | 261 | |
| 204 | 262 | MDRV_PALETTE_LENGTH( 32768 ) |
| 205 | 263 | MDRV_PALETTE_INIT( supracan ) |
| 264 | MDRV_GFXDECODE( supracan ) |
| 206 | 265 | |
| 207 | 266 | MDRV_CARTSLOT_ADD( "cart" ) |
| 208 | 267 | MDRV_CARTSLOT_EXTENSION_LIST( "bin" ) |
| 209 | 268 | MDRV_CARTSLOT_MANDATORY |
| 210 | 269 | MDRV_CARTSLOT_LOAD( supracan_cart ) |
| 270 | |
| 271 | MDRV_VIDEO_START( supracan ) |
| 272 | MDRV_VIDEO_UPDATE( supracan ) |
| 211 | 273 | MACHINE_DRIVER_END |
| 212 | 274 | |
| 213 | 275 | |
| 214 | 276 | ROM_START( supracan ) |
| 215 | 277 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASEFF ) |
| 278 | |
| 279 | ROM_REGION( 0x4000, "ram_gfx", ROMREGION_ERASEFF ) |
| 216 | 280 | ROM_END |
| 217 | 281 | |
| 218 | 282 | |