src/mess/machine/zx.c
| r4049 | r4050 | |
| 21 | 21 | #define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", video_screen_get_vpos(space->machine->primary_screen)); } while (0) |
| 22 | 22 | |
| 23 | 23 | static UINT8 zx_tape_bit = 0x80; |
| 24 | | static UINT16 zx_address = 0xc029; |
| 25 | 24 | |
| 26 | 25 | static WRITE8_HANDLER( zx_ram_w ) |
| 27 | 26 | { |
| r4049 | r4050 | |
| 43 | 42 | } |
| 44 | 43 | } |
| 45 | 44 | |
| 45 | /* I know this looks really pointless... but it has to be here */ |
| 46 | 46 | READ8_HANDLER( zx_ram_r ) |
| 47 | 47 | { |
| 48 | 48 | UINT8 *RAM = memory_region(space->machine, "main"); |
| 49 | | zx_address = offset | 0xc000; |
| 50 | | return RAM[zx_address]; |
| 49 | return RAM[offset | 0xc000]; |
| 51 | 50 | } |
| 52 | 51 | |
| 53 | 52 | DRIVER_INIT ( zx ) |
| r4049 | r4050 | |
| 59 | 58 | memory_set_bankptr(machine, 1, memory_region(machine, "main") + 0x4000); |
| 60 | 59 | } |
| 61 | 60 | |
| 62 | | #if 0 |
| 63 | 61 | static DIRECT_UPDATE_HANDLER ( zx_setdirect ) |
| 64 | 62 | { |
| 65 | | if ((address > 0xc029) && (address < 0xc300)) |
| 66 | | { |
| 67 | | int byte = program_read_byte( address & 0x7fff ); |
| 68 | | |
| 69 | | if (byte & 0x40) |
| 70 | | program_write_byte( address, byte ); |
| 71 | | else |
| 72 | | program_write_byte( address, 0 ); |
| 73 | | |
| 74 | | zx_ula_r(machine, address, "main"); |
| 75 | | } |
| 76 | | return address; |
| 77 | | } |
| 78 | | |
| 79 | | #endif |
| 80 | | static DIRECT_UPDATE_HANDLER ( zx_setdirect ) |
| 81 | | { |
| 82 | 63 | if (address & 0x8000) |
| 83 | 64 | zx_ula_r(space->machine, address, "main"); |
| 84 | 65 | return address; |