src/mess/drivers/pc98.c
| r5978 | r5979 | |
| 209 | 209 | #include "driver.h" |
| 210 | 210 | #include "cpu/i386/i386.h" |
| 211 | 211 | |
| 212 | static UINT32 *pc9801_vram; |
| 213 | |
| 214 | static VIDEO_START( pc9801 ) |
| 215 | { |
| 216 | } |
| 217 | |
| 218 | static VIDEO_UPDATE( pc9801 ) |
| 219 | { |
| 220 | const gfx_element *gfx = screen->machine->gfx[0]; |
| 221 | int count = 0x00000; |
| 222 | int y,x; |
| 223 | |
| 224 | |
| 225 | for (y=0;y<64;y++) |
| 226 | { |
| 227 | for (x=0;x<64;x+=2) |
| 228 | { |
| 229 | int tile; |
| 230 | |
| 231 | tile = (pc9801_vram[count] & 0x00ff0000)>>16; |
| 232 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,(x+1)*8,y*8); |
| 233 | |
| 234 | tile = pc9801_vram[count] & 0x000000ff; |
| 235 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,(x+0)*8,y*8); |
| 236 | |
| 237 | count++; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | return 0; |
| 242 | } |
| 243 | |
| 212 | 244 | static ADDRESS_MAP_START( pc9801_mem, ADDRESS_SPACE_PROGRAM, 32) |
| 213 | | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM |
| 245 | AM_RANGE(0x00000000, 0x0000ffff) AM_RAM |
| 246 | AM_RANGE(0x000a0000, 0x000bffff) AM_RAM AM_BASE(&pc9801_vram) |
| 247 | AM_RANGE(0x000e0000, 0x000fffff) AM_ROM AM_REGION("maincpu",0)//AM_REGION("memory",0xf8000) |
| 248 | AM_RANGE(0xfffe0000, 0xffffffff) AM_ROM AM_REGION("maincpu",0) |
| 214 | 249 | ADDRESS_MAP_END |
| 215 | 250 | |
| 251 | static READ32_HANDLER( test1_r ) |
| 252 | { |
| 253 | return 0x00008000; //avoid a pitfall, otherwise the code will execute a retf without anything in the stack! |
| 254 | } |
| 255 | |
| 256 | static READ32_HANDLER( test2_r ) |
| 257 | { |
| 258 | return mame_rand(space->machine); |
| 259 | } |
| 260 | |
| 261 | static ADDRESS_MAP_START( pc9801_io, ADDRESS_SPACE_IO, 32) |
| 262 | AM_RANGE(0x0034, 0x0037) AM_READ(test1_r) |
| 263 | AM_RANGE(0x0060, 0x0063) AM_READ(test2_r) |
| 264 | AM_RANGE(0x00a0, 0x00a3) AM_READ(test2_r) |
| 265 | ADDRESS_MAP_END |
| 266 | |
| 216 | 267 | static ADDRESS_MAP_START( pc9821_mem, ADDRESS_SPACE_PROGRAM, 32) |
| 217 | 268 | AM_RANGE(0x00000000, 0x0001ffff) AM_ROM |
| 218 | 269 | ADDRESS_MAP_END |
| r5978 | r5979 | |
| 230 | 281 | { |
| 231 | 282 | } |
| 232 | 283 | |
| 233 | | static VIDEO_START( pc9801 ) |
| 284 | static VIDEO_START( pc9821 ) |
| 234 | 285 | { |
| 235 | 286 | } |
| 236 | 287 | |
| 237 | | static VIDEO_UPDATE( pc9801 ) |
| 288 | static VIDEO_UPDATE( pc9821 ) |
| 238 | 289 | { |
| 239 | 290 | return 0; |
| 240 | 291 | } |
| 241 | 292 | |
| 242 | | static VIDEO_START( pc9821 ) |
| 293 | static const gfx_layout charset = |
| 243 | 294 | { |
| 244 | | } |
| 295 | 8,8, |
| 296 | RGN_FRAC(1,1), |
| 297 | 1, |
| 298 | { 0 }, |
| 299 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 300 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 301 | 8*8 |
| 302 | }; |
| 245 | 303 | |
| 246 | | static VIDEO_UPDATE( pc9821 ) |
| 247 | | { |
| 248 | | return 0; |
| 249 | | } |
| 304 | static GFXDECODE_START( pc9801 ) |
| 305 | GFXDECODE_ENTRY( "gfx1", 0x00000, charset, 0x000, 0x01 ) |
| 306 | GFXDECODE_END |
| 250 | 307 | |
| 251 | 308 | /* I suspect the dump for pc9801 comes from a i386 later model... the original machine would use a i8086 @ 5Mhz CPU (see notes at top) */ |
| 252 | 309 | /* More investigations are required, but in the meanwhile I set a I386 as main CPU */ |
| r5978 | r5979 | |
| 254 | 311 | /* basic machine hardware */ |
| 255 | 312 | MDRV_CPU_ADD("maincpu", I386, 16000000) |
| 256 | 313 | MDRV_CPU_PROGRAM_MAP(pc9801_mem) |
| 314 | MDRV_CPU_IO_MAP(pc9801_io) |
| 257 | 315 | |
| 258 | 316 | MDRV_MACHINE_RESET(pc9801) |
| 259 | 317 | |
| r5978 | r5979 | |
| 266 | 324 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 267 | 325 | MDRV_PALETTE_LENGTH(2) |
| 268 | 326 | MDRV_PALETTE_INIT(black_and_white) |
| 327 | MDRV_GFXDECODE(pc9801) |
| 269 | 328 | |
| 270 | 329 | MDRV_VIDEO_START(pc9801) |
| 271 | 330 | MDRV_VIDEO_UPDATE(pc9801) |
| r5978 | r5979 | |
| 300 | 359 | ROM_START( pc9801 ) |
| 301 | 360 | ROM_REGION( 0x20000, "maincpu", 0 ) |
| 302 | 361 | ROM_LOAD( "bios.rom", 0x00000, 0x18000, CRC(315d2703) SHA1(4f208d1dbb68373080d23bff5636bb6b71eb7565) ) |
| 303 | | ROM_LOAD( "itf.rom", 0x00000, 0x08000, CRC(c1815325) SHA1(a2fb11c000ed7c976520622cfb7940ed6ddc904e) ) |
| 362 | ROM_LOAD( "itf.rom", 0x18000, 0x08000, CRC(c1815325) SHA1(a2fb11c000ed7c976520622cfb7940ed6ddc904e) ) |
| 304 | 363 | |
| 305 | 364 | /* where shall we load this? */ |
| 306 | 365 | ROM_REGION( 0x100000, "memory", 0 ) |
| r5978 | r5979 | |
| 317 | 376 | ROM_LOAD( "sound.rom", 0x0000, 0x4000, CRC(80eabfde) SHA1(e09c54152c8093e1724842c711aed6417169db23) ) |
| 318 | 377 | |
| 319 | 378 | ROM_REGION( 0x50000, "gfx1", 0 ) |
| 320 | | ROM_LOAD( "font.rom", 0x00000, 0x46800, CRC(da370e7a) SHA1(584d0c7fde8c7eac1f76dc5e242102261a878c5e) ) |
| 379 | ROM_LOAD( "font.rom", 0x00000, 0x46800, BAD_DUMP CRC(da370e7a) SHA1(584d0c7fde8c7eac1f76dc5e242102261a878c5e) ) |
| 321 | 380 | ROM_END |
| 322 | 381 | |
| 323 | 382 | ROM_START( pc9821 ) |
| r5978 | r5979 | |
| 329 | 388 | ROM_LOAD( "sound.rom", 0x0000, 0x4000, CRC(a21ef796) SHA1(34137c287c39c44300b04ee97c1e6459bb826b60) ) |
| 330 | 389 | |
| 331 | 390 | ROM_REGION( 0x50000, "gfx1", 0 ) |
| 332 | | ROM_LOAD( "font.rom", 0x00000, 0x46800, CRC(a61c0649) SHA1(554b87377d176830d21bd03964dc71f8e98676b1) ) |
| 391 | ROM_LOAD( "font.rom", 0x00000, 0x46800, BAD_DUMP CRC(a61c0649) SHA1(554b87377d176830d21bd03964dc71f8e98676b1) ) |
| 333 | 392 | ROM_END |
| 334 | 393 | |
| 335 | 394 | |