Previous 15994 Revisions Next

r5331 Friday 31st July, 2009 at 16:42:37 UTC by Jonathan Gevaryahu
[socrates] added i/o readback of 0xf3 for unmapped i/o; found keyboard ports but haven't hooked them to anything yet; changed palette gamma to 1.3 which is closer to real thing, needs further tweaking.
[src/mess/drivers]socrates.c

src/mess/drivers/socrates.c
r5330r5331
137137READ8_HANDLER( socrates_ram_bank_r )
138138{
139139 UINT8 data = 0xFF;
140 data = socrates.ram_bank | 0xF0;
140 data = socrates.ram_bank;
141141 return data;
142142}
143143
144144WRITE8_HANDLER( socrates_ram_bank_w )
145145{
146 socrates.ram_bank = data;
146 socrates.ram_bank = data&0xF;
147147 socrates_set_ram_bank( space->machine );
148148}
149149
150READ8_HANDLER( read_f3 ) // used for read-only i/o ports as mame/mess doesn't have a way to set the unmapped area to read as 0xF3
151{
152 return 0xF3;
153}
154
155WRITE8_HANDLER( unknownlatch_30 ) // writes to i/o 0x3x do SOMETHING, probably reset a latch, but I don't know yet
156{
157//popmessage("write to i/o 0x30");
158}
159
160READ8_HANDLER( socrates_keyboard_50_r ) // keyboard code low
161{
162 return 0x00; // write me!
163}
164
165READ8_HANDLER( socrates_keyboard_51_r ) // keyboard code high
166{
167 return 0x01; // write me!
168}
169
170WRITE8_HANDLER( socrates_keyboard_reset ) // keyboard latch reset
171{
172//popmessage("kb latch reset!");
173}
174
175WRITE8_HANDLER( unknown_6x ) // writes to i/o 0x6x happens on startup once, with 0x01. no idea what it does.
176{
177//popmessage("write to i/o 0x60");
178}
179
150180/* stuff below belongs in video/socrates.c */
151181
152182WRITE8_HANDLER( socrates_scroll_w )
r5330r5331
174204#define CHROMA_COL_2 0.125125, 0.27525, 0.230225, 0.384875, 0.125125, 0.27525, 0.230225, 0.384875, 0.125125, 0.27525, 0.230225, 0.384875, 0.125125, 0.27525, 0.230225, 0.384875,
175205#define CHROMA_COL_5 0.1235, 0.2695, 0.22625, 0.378, 0.1235, 0.2695, 0.22625, 0.378, 0.1235, 0.2695, 0.22625, 0.378, 0.1235, 0.2695, 0.22625, 0.378,
176206// gamma: this needs to be messed with... may differ on different systems... attach to slider somehow?
177#define GAMMA 2.0
207#define GAMMA 1.3
178208
179209static rgb_t socrates_create_color(UINT8 color)
180210{
r5330r5331
342372   ADDRESS_MAP_GLOBAL_MASK(0xff)
343373   AM_RANGE(0x00, 0x00) AM_READWRITE(socrates_rom_bank_r, socrates_rom_bank_w) AM_MIRROR(0x7) /* rom bank select - RW - 8 bits */
344374   AM_RANGE(0x08, 0x08) AM_READWRITE(socrates_ram_bank_r, socrates_ram_bank_w) AM_MIRROR(0x7) /* ram banks select - RW - 4 low bits; Format: 0b****HHLL where LL controls whether window 0 points at ram area: 0b00: 0x0000-0x3fff; 0b01: 0x4000-0x7fff; 0b10: 0x8000-0xbfff; 0b11: 0xc000-0xffff. HH controls the same thing for window 1 */
345   AM_RANGE(0x10, 0x17) AM_WRITE(socrates_sound_w) AM_MIRROR (0x8) /* sound section:
375   AM_RANGE(0x10, 0x17) AM_READWRITE(read_f3, socrates_sound_w) AM_MIRROR (0x8) /* sound section:
346376        0x10 - W - frequency control for channel 1 (louder channel) - 01=high pitch, ff=low; time between 1->0/0->1 transitions = (XTAL_21_4772MHz/(512+256) / (freq_reg+1)) (note that this is double the actual frequency since each full low and high squarewave pulse is two transitions)
347377   0x11 - W - frequency control for channel 2 (softer channel) - 01=high pitch, ff=low; same equation as above
348378   0x12 - W - 0b****VVVV volume control for channel 1
349379   0x13 - W - 0b****VVVV volume control for channel 2
350380   0x14-0x17 - ?DAC? related? makes noise when written to... code implies 0x16 and 0x17 are mirrors of 0x14 and 0x15 respectively.
351381   */
352   AM_RANGE(0x20, 0x21) AM_WRITE(socrates_scroll_w) AM_MIRROR (0xe) /* graphics section:
382   AM_RANGE(0x20, 0x21) AM_READWRITE(read_f3, socrates_scroll_w) AM_MIRROR (0xe) /* graphics section:
353383   0x20 - W - lsb offset of screen display
354384   0x21 - W - msb offset of screen display
355385   resulting screen line is one of 512 total offsets on 128-byte boundaries in the whole 64k ram
356386   */
357   AM_RANGE(0x30, 0x30) AM_NOP /* unknown, write only */
358   AM_RANGE(0x40, 0x40) AM_RAM AM_MIRROR(0xF)/* unknown, read and write low 4 bits plus bit 5, bit 7 seems to be fixed at 0, bit 6 and 4 are fixed at 1? is this some sort of control register for timers perhaps? gets a slew of data written to it a few times during startup, may be IR related? */
359   AM_RANGE(0x50, 0x50) AM_RAM AM_MIRROR(0xE) /* unknown, read and write (bits?) reads serially shift 1 bit somewhere? */
360   AM_RANGE(0x51, 0x51) AM_RAM AM_MIRROR(0xE) /* unknown, read and write (bits?) reads serially shift 1 bit somewhere? */
361   AM_RANGE(0x60, 0x60) AM_NOP AM_MIRROR(0xF) /* unknown, write only  */
387   AM_RANGE(0x30, 0x30) AM_READWRITE(read_f3, unknownlatch_30) AM_MIRROR (0xf) /* unknown, write only */
388   //AM_RANGE(0x40, 0x40) AM_RAM AM_MIRROR(0xF)/* unknown, read and write low 4 bits plus bit 5, bit 7 seems to be fixed at 0, bit 6 and 4 are fixed at 1? is this some sort of control register for timers perhaps? gets a slew of data written to it a few times during startup, may be IR or timer related? */
389   AM_RANGE(0x50, 0x50) AM_READWRITE(socrates_keyboard_50_r, socrates_keyboard_reset) AM_MIRROR(0xE) /* Keyboard keycode low, latched on keypress, can only be unlatched by writing 00 here */
390   AM_RANGE(0x51, 0x51) AM_READ(socrates_keyboard_51_r) AM_MIRROR(0xE) /* Keyboard keycode high, latched as above */
391   AM_RANGE(0x60, 0x60) AM_READWRITE(read_f3, unknown_6x) AM_MIRROR(0xF) /* unknown, write only  */
392   AM_RANGE(0x70, 0xFF) AM_READ(read_f3) // nothing mapped here afaik
362393ADDRESS_MAP_END
363394
364395

Previous 15994 Revisions Next


© 1998-2018 The MESS Team