src/mess/drivers/jupiter.c
| r9687 | r9688 | |
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | static READ8_HANDLER( jupiter_io_r ); |
| 44 | | static WRITE8_HANDLER( jupiter_port_fe_w ); |
| 44 | static WRITE8_HANDLER( jupiter_io_w ); |
| 45 | 45 | static WRITE8_HANDLER( jupiter_expram_w ); |
| 46 | | static WRITE8_HANDLER( jupiter_vh_charram_w ); |
| 47 | 46 | |
| 48 | 47 | |
| 49 | 48 | /* memory w/r functions */ |
| 50 | 49 | static ADDRESS_MAP_START( jupiter_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 51 | 50 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 52 | 51 | AM_RANGE(0x2400, 0x27ff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(jupiter_state, videoram) |
| 53 | | AM_RANGE(0x2c00, 0x2fff) AM_MIRROR(0x0400) AM_WRITE(jupiter_vh_charram_w) AM_BASE_MEMBER(jupiter_state, charram) |
| 52 | AM_RANGE(0x2c00, 0x2fff) AM_MIRROR(0x0400) AM_RAM AM_BASE_MEMBER(jupiter_state, charram) AM_REGION("maincpu", 0x2c00) |
| 54 | 53 | AM_RANGE(0x3c00, 0x3fff) AM_MIRROR(0x0c00) AM_RAM |
| 55 | 54 | AM_RANGE(0x4800, 0xffff) AM_RAM_WRITE( jupiter_expram_w ) AM_BASE_MEMBER(jupiter_state, expram) /* Expansion RAM */ |
| 56 | 55 | ADDRESS_MAP_END |
| 57 | 56 | |
| 58 | 57 | /* port i/o functions */ |
| 59 | 58 | static ADDRESS_MAP_START( jupiter_io , ADDRESS_SPACE_IO, 8) |
| 60 | | AM_RANGE( 0x0000, 0xffff ) AM_READWRITE( jupiter_io_r, jupiter_port_fe_w ) |
| 59 | AM_RANGE( 0x0000, 0xffff ) AM_READWRITE( jupiter_io_r, jupiter_io_w ) |
| 61 | 60 | ADDRESS_MAP_END |
| 62 | 61 | |
| 63 | 62 | |
| r9687 | r9688 | |
| 178 | 177 | } |
| 179 | 178 | |
| 180 | 179 | |
| 181 | | static WRITE8_HANDLER( jupiter_port_fe_w ) |
| 180 | static WRITE8_HANDLER( jupiter_io_w ) |
| 182 | 181 | { |
| 183 | 182 | running_device *speaker = space->machine->device("speaker"); |
| 184 | | // cassette_output( machine->device("cassette"), 1 ); |
| 183 | // cassette_output( space->machine->device("cassette"), 1 ); |
| 185 | 184 | speaker_level_w(speaker,1); |
| 186 | 185 | } |
| 187 | 186 | |
| r9687 | r9688 | |
| 204 | 203 | |
| 205 | 204 | /* graphics output */ |
| 206 | 205 | |
| 207 | | static PALETTE_INIT( jupiter ) |
| 208 | | { |
| 209 | | palette_set_color(machine,0,RGB_BLACK); /* black */ |
| 210 | | palette_set_color(machine,1,RGB_WHITE); /* white */ |
| 211 | | palette_set_color(machine,2,RGB_WHITE); /* white */ |
| 212 | | palette_set_color(machine,3,RGB_BLACK); /* black */ |
| 213 | | } |
| 214 | 206 | |
| 215 | | |
| 216 | 207 | static const gfx_layout jupiter_charlayout = |
| 217 | 208 | { |
| 218 | 209 | 8, 8, /* 8x8 characters */ |
| r9687 | r9688 | |
| 227 | 218 | |
| 228 | 219 | static GFXDECODE_START( jupiter ) |
| 229 | 220 | GFXDECODE_ENTRY( "maincpu", 0x2c00, jupiter_charlayout, 0, 1 ) |
| 230 | | GFXDECODE_ENTRY( "maincpu", 0x2c00, jupiter_charlayout, 2, 1 ) |
| 231 | 221 | GFXDECODE_END |
| 232 | 222 | |
| 233 | 223 | |
| 234 | | static WRITE8_HANDLER( jupiter_vh_charram_w ) |
| 235 | | { |
| 236 | | jupiter_state *state = space->machine->driver_data<jupiter_state>(); |
| 237 | | if(data == state->charram[offset]) |
| 238 | | return; /* no change */ |
| 239 | | |
| 240 | | state->charram[offset] = data; |
| 241 | | |
| 242 | | /* decode character graphics again */ |
| 243 | | offset >>= 3; |
| 244 | | gfx_element_mark_dirty(space->machine->gfx[0], offset); |
| 245 | | gfx_element_mark_dirty(space->machine->gfx[1], offset); |
| 246 | | } |
| 247 | | |
| 248 | | |
| 249 | 224 | static TIMER_CALLBACK( jupiter_set_irq_callback ) |
| 250 | 225 | { |
| 251 | 226 | cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); |
| r9687 | r9688 | |
| 277 | 252 | static VIDEO_UPDATE( jupiter ) |
| 278 | 253 | { |
| 279 | 254 | jupiter_state *state = screen->machine->driver_data<jupiter_state>(); |
| 255 | UINT8 *charram = state->charram; |
| 280 | 256 | UINT8 *videoram = state->videoram; |
| 281 | | int offs; |
| 257 | UINT8 y,ra,chr,gfx; |
| 258 | UINT16 sy=0,ma=0,x; |
| 282 | 259 | |
| 283 | | for(offs = 0; offs < 768; offs++) |
| 260 | for (y = 0; y < 24; y++) |
| 284 | 261 | { |
| 285 | | int code = videoram[offs]; |
| 286 | | int sx, sy; |
| 262 | for (ra = 0; ra < 8; ra++) |
| 263 | { |
| 264 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 287 | 265 | |
| 288 | | sy = (offs / 32) << 3; |
| 289 | | sx = (offs % 32) << 3; |
| 266 | for (x = ma; x < ma+32; x++) |
| 267 | { |
| 268 | chr = videoram[x]; |
| 290 | 269 | |
| 291 | | drawgfx_opaque(bitmap, NULL, ( code & 0x80 ) ? screen->machine->gfx[1] : screen->machine->gfx[0], |
| 292 | | code & 0x7f, 0, 0,0, sx,sy); |
| 293 | | } |
| 270 | /* get pattern of pixels for that character scanline */ |
| 271 | gfx = charram[((chr&0x7f)<<3) | ra] ^ ((chr&0x80) ? 0xff : 0); |
| 294 | 272 | |
| 273 | /* Display a scanline of a character (8 pixels) */ |
| 274 | *p++ = ( gfx & 0x80 ) ? 1 : 0; |
| 275 | *p++ = ( gfx & 0x40 ) ? 1 : 0; |
| 276 | *p++ = ( gfx & 0x20 ) ? 1 : 0; |
| 277 | *p++ = ( gfx & 0x10 ) ? 1 : 0; |
| 278 | *p++ = ( gfx & 0x08 ) ? 1 : 0; |
| 279 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 280 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 281 | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 282 | } |
| 283 | } |
| 284 | ma+=32; |
| 285 | } |
| 295 | 286 | return 0; |
| 296 | 287 | } |
| 297 | 288 | |
| 298 | | static DRIVER_INIT( jupiter ) |
| 299 | | { |
| 300 | | jupiter_state *state = machine->driver_data<jupiter_state>(); |
| 301 | | state->charram = memory_region(machine, "maincpu")+0x2c00; |
| 302 | | } |
| 303 | 289 | |
| 304 | 290 | static const cassette_config jupiter_cassette_config = |
| 305 | 291 | { |
| r9687 | r9688 | |
| 325 | 311 | MDRV_SCREEN_RAW_PARAMS( XTAL_6_5MHz, 416, 0, 256, 264, 0, 192 ) |
| 326 | 312 | |
| 327 | 313 | MDRV_GFXDECODE( jupiter ) |
| 328 | | MDRV_PALETTE_LENGTH(4) |
| 329 | | MDRV_PALETTE_INIT(jupiter) |
| 314 | MDRV_PALETTE_LENGTH(2) |
| 315 | MDRV_PALETTE_INIT(black_and_white) |
| 330 | 316 | |
| 331 | 317 | MDRV_VIDEO_START( jupiter ) |
| 332 | 318 | MDRV_VIDEO_UPDATE( jupiter ) |
| r9687 | r9688 | |
| 352 | 338 | ROM_END |
| 353 | 339 | |
| 354 | 340 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 355 | | COMP( 1981, jupiter, 0, 0, jupiter, jupiter, jupiter, "Jupiter Cantab", "Jupiter Ace" , 0 ) |
| 341 | COMP( 1981, jupiter, 0, 0, jupiter, jupiter, 0, "Jupiter Cantab", "Jupiter Ace" , 0 ) |