Previous 199869 Revisions Next

r30993 Monday 16th June, 2014 at 15:12:29 UTC by Tafoid
(MESS) hprot1:  Felipe Sanches
* new derivative "CARD I PCB rev.08A"
* new derivative "CARD II PCB rev.6"
* fixed LCD rendering (now both lines are displayed properly)
* inverted logic of the inputs so that now we can navigate the menu
[src/mess]mess.lst
[src/mess/drivers]hprot1.c

trunk/src/mess/drivers/hprot1.c
r30992r30993
11/***************************************************************************
22
3  HENRY Prot I - brazilian document timestamp printer
3  HENRY Prot I/II - brazilian document timestamp printers
44  http://www.dataponto.com.br/protocoladores-prot1.html
55
66  Driver by Felipe Sanches
r30992r30993
1212
1313  Changelog:
1414
15    2014 JUN 13 [Felipe Sanches]:
16   * new derivative "CARD I PCB rev.08A"
17   * new derivative "CARD II PCB rev.6"
18   * fixed LCD rendering (now both lines are displayed properly)
19   * inverted logic of the inputs so that now we can navigate the menu
20 
1521   2014 JAN 03 [Felipe Sanches]:
1622   * Initial driver skeleton
1723   * Address lines bitswaping
r30992r30993
2026
2127TO-DO list:
2228
29======= hprotr8a ===========
30Loops during boot displaying an error message related to low power supply voltage.
31We need to emulate the ADM695AN chip (Microprocessor Supervisory Circuits) in order to properly boot the device.
32
33======= hprot2r6 ===========
34There are unhandled memory writes at 0xE000 and 0xA000
35
36LCD commands are sent, but nothing shows up on screen.
37The commands sent are supposed to display the message:
38
39"*Pouca  Energia*" (LCD cmds range: 80-8F)  (cmds logged but not displayed on screen)
40"*  no Sistema  *" (LCD cmds range: C0-CF)  (cmds logged but not displayed on screen)
41
42which means something like "too little energy for the system to operate".
43We need to emulate the ADM695AN chip (Microprocessor Supervisory Circuits) in order to properly boot the device.
44
45Infinite loop is reached at address 0x7699
46======= hprot1 ===========
47
2348  There seems to be an eeprom or a realtime clock placed at U2 (DIP8):
2449  pin1 -> 8031 pin 14 (T0: Timer 0 external input)
2550  pin2 -> crystal at X2 (labeled 32.768)
r30992r30993
3055  pin7 -> 8031 pin 4 (Port 1 bit 3)
3156  pin8 -> VCC
3257
33(no context): unmapped io memory write to 20003 = FF & FF
34(no context): unmapped io memory write to 20002 = FF & FF
35(no context): unmapped io memory write to 20001 = FF & FF
36(no context): unmapped io memory write to 20000 = FF & FF
37':maincpu' (01EB): unmapped io memory write to 20001 = 7F & FF
38':maincpu' (01EE): unmapped io memory write to 20003 = FF & FF
39':maincpu' (01F0): unmapped io memory write to 20001 = 77 & FF
40':maincpu' (3500): unmapped io memory write to 20003 = FF & FF
41':maincpu' (0208): unmapped io memory write to 20001 = 77 & FF
42':maincpu' (13F7): unmapped io memory write to 20001 = 77 & FF
43':maincpu' (13EF): unmapped io memory write to 20001 = 67 & FF
44':maincpu' (13F7): unmapped io memory write to 20001 = 77 & FF
45The last 2 lines repeat endlessly.
46
4758****************************************************************************/
4859
4960#include "emu.h"
5061#include "cpu/mcs51/mcs51.h"
5162#include "video/hd44780.h"
63#include "sound/speaker.h"
5264#include "rendlay.h"
5365
5466class hprot1_state : public driver_device
r30992r30993
100112//11?? 00?? ??11 ???? read command
101113//mirror=0x33cf
102114
103//write: 0xc400 => U12 (?)
104//write: 0xc800 => U11 (?)
115//write: 0xc400 => U12 (74373 - possibly for the dot matrix printhead ?)
116//write: 0xc800 => U11 (74373 - possibly for the dot matrix printhead ?)
105117//read:  0xc020 => display
106118//write: 0xc000 => display
107119//write: 0xc010 => display
r30992r30993
110122
111123static ADDRESS_MAP_START(i80c31_io, AS_IO, 8, hprot1_state)
112124   AM_RANGE(0x0000,0x7fff) AM_RAM
113   AM_RANGE(0xc000,0xc000) AM_MIRROR(0x33cf) AM_DEVWRITE("hd44780", hd44780_device, control_write)
114   AM_RANGE(0xc010,0xc010) AM_MIRROR(0x33cf) AM_DEVWRITE("hd44780", hd44780_device, data_write)
115   AM_RANGE(0xc020,0xc020) AM_MIRROR(0x33cf) AM_DEVREAD("hd44780", hd44780_device, control_read)
116   AM_RANGE(0xc030,0xc030) AM_MIRROR(0x33cf) AM_DEVREAD("hd44780", hd44780_device, data_read)
125/*TODO: verify the mirror mask value for the HD44780 device */
126   AM_RANGE(0xc000,0xc000) AM_MIRROR(0x13cf) AM_DEVWRITE("hd44780", hd44780_device, control_write)
127   AM_RANGE(0xc010,0xc010) AM_MIRROR(0x13cf) AM_DEVWRITE("hd44780", hd44780_device, data_write)
128   AM_RANGE(0xc020,0xc020) AM_MIRROR(0x13cf) AM_DEVREAD("hd44780", hd44780_device, control_read)
129   AM_RANGE(0xc030,0xc030) AM_MIRROR(0x13cf) AM_DEVREAD("hd44780", hd44780_device, data_read)
130/*TODO: attach the watchdog/brownout reset device:
131   AM_RANGE(0xe000,0xe0??) AM_MIRROR(?) AM_DEVREAD("adm965an", adm965an_device, data_read) */
132
117133   //AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(henry_io_r, henry_io_w)
118134   AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(henry_io_r)
119135ADDRESS_MAP_END
120136
121137static INPUT_PORTS_START( hprot1 )
138/* FIXME: I am still unsure whether all these inputs are Active High or Active Low: */
122139   PORT_START("inputs")
123   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Upper Black Button") PORT_CODE(KEYCODE_A)
124   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Lower Black Button") PORT_CODE(KEYCODE_B)
125   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Blue Button") PORT_CODE(KEYCODE_C)
140   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Upper Black Button") PORT_CODE(KEYCODE_A)
141   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Lower Black Button") PORT_CODE(KEYCODE_B)
142   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Blue Button") PORT_CODE(KEYCODE_C)
143   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
144   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
126145   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Paper Detector") PORT_CODE(KEYCODE_D)
127146   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("XMIN Endstop") PORT_CODE(KEYCODE_E)
147   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
128148INPUT_PORTS_END
129149
150static INPUT_PORTS_START( hprot_jumpers )
151/*
152There is a set of 3 jumpers that switch the communications circuitry between a
153RS232 chip (U8: MAX232AN) and a differential bus transceiver (U7: SN65176BP)
154
155It seems that all three jumpers must select the same configuration:
156eighter differential bus or RS232.
157And I don't see yet how this could affect the emulation of the device, so, for now, I'll
158simply leave this note here but not actually include this details in the driver code.
159
160   PORT_START("jumpers")
161   PORT_DIPNAME( 0x01, 0x01, "TX")
162   PORT_DIPSETTING(    0x01, "differential bus")
163   PORT_DIPSETTING(    0x00, "RS232")
164   PORT_DIPNAME( 0x02, 0x02, "RX")
165   PORT_DIPSETTING(    0x02, "differential bus")
166   PORT_DIPSETTING(    0x00, "RS232")
167   PORT_DIPNAME( 0x04, 0x04, "CPU-TX")
168   PORT_DIPSETTING(    0x04, "differential bus")
169   PORT_DIPSETTING(    0x00, "RS232")
170*/
171INPUT_PORTS_END
172
173/* TODO: meanings for the jumpers may be different among machines,
174 so we may have to have individual declarations for each board. */
175static INPUT_PORTS_START( hprot2r6 )
176   PORT_INCLUDE(hprot1)
177   PORT_INCLUDE(hprot_jumpers)
178INPUT_PORTS_END
179
180static INPUT_PORTS_START( hprotr8a )
181   PORT_INCLUDE(hprot1)
182   PORT_INCLUDE(hprot_jumpers)
183INPUT_PORTS_END
184
130185void hprot1_state::machine_start()
131186{
132187}
r30992r30993
141196   {
142197      case 0x01:
143198      {
144         UINT8 value = (ioport("inputs")->read()) & 0x67;
199         UINT8 value = ioport("inputs")->read();
145200#if LOG_IO_PORTS
146201         printf("value:%02X\n", value);
147202#endif
r30992r30993
231286   GFXDECODE_ENTRY( "hd44780:cgrom", 0x0000, henry_prot_charlayout, 0, 1 )
232287GFXDECODE_END
233288
289static HD44780_PIXEL_UPDATE(hprot1_pixel_update)
290{
291   if ( pos < 16 && line==0 )
292   {
293      bitmap.pix16(y, pos*6 + x) = state;
294   }
295
296   if ( pos >= 64 && pos < 80 && line==0 )
297   {
298      bitmap.pix16(y+9,(pos-64)*6 + x) = state;
299   }
300}
301
234302static MACHINE_CONFIG_START( hprot1, hprot1_state )
235303   /* basic machine hardware */
236304   MCFG_CPU_ADD("maincpu", I80C31, XTAL_10MHz)
r30992r30993
253321
254322   MCFG_HD44780_ADD("hd44780")
255323   MCFG_HD44780_LCD_SIZE(2, 16)
324   MCFG_HD44780_PIXEL_UPDATE_CB(hprot1_pixel_update)
325
326   /* TODO: figure out which RTC chip is in use. */
327
328   /* TODO: emulate the ADM695AN chip (watchdog/brownout reset)*/
256329MACHINE_CONFIG_END
257330
331static MACHINE_CONFIG_DERIVED( hprotr8a, hprot1 )
332   MCFG_CPU_REPLACE("maincpu", I80C31, 11059200) // value of X1 cristal on the PCB
333   MCFG_CPU_PROGRAM_MAP(i80c31_prg)
334   MCFG_CPU_IO_MAP(i80c31_io)
335
336   /* sound hardware */
337   MCFG_SPEAKER_STANDARD_MONO("mono")
338   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
339   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
340
341   /* TODO: add an RS232 interface (emulate MAX232N chip)
342 (the board has GND/VCC/RX/TX pins available in a connector) */
343
344   /* TODO: add an I2C interface (the board has GND/VCC/SDA/SCL pins available in a connector) */
345MACHINE_CONFIG_END
346
347static MACHINE_CONFIG_DERIVED( hprot2r6, hprot1 )
348   MCFG_CPU_REPLACE("maincpu", I80C31, 11059200) // value of X1 cristal on the PCB
349   MCFG_CPU_PROGRAM_MAP(i80c31_prg)
350   MCFG_CPU_IO_MAP(i80c31_io)
351
352   /* sound hardware */
353   MCFG_SPEAKER_STANDARD_MONO("mono")
354   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
355   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
356
357   /* TODO: add an RS232 interface (emulate MAX232N chip) */
358MACHINE_CONFIG_END
359
258360ROM_START( hprot1 )
259361   ROM_REGION( 0x10000, "maincpu", 0 )
260362   ROM_LOAD( "henry_prot1_rev1_v19.bin",  0x00000, 0x10000, CRC(dd7787fd) SHA1(61a37dd406b3440d568bd6da75a9fdc8a0f0e1e3) )
261363ROM_END
262364
263/*    YEAR  NAME    PARENT  COMPAT  MACHINE     INPUT   CLASS           INIT   COMPANY    FULLNAME                    FLAGS */
264COMP( 2004, hprot1, 0,      0,      hprot1,     hprot1, hprot1_state, hprot1, "HENRY", "Henry Prot I v19 (REV.1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND)
365ROM_START( hprotr8a )
366   ROM_REGION( 0x10000, "maincpu", 0 )
367   ROM_LOAD( "hprot_card1_rev08a.u2",  0x00000, 0x10000, CRC(e827480f) SHA1(bd53e6cce9a0832ca01f1a485ddaab43c0baa136) )
368ROM_END
369
370ROM_START( hprot2r6 )
371   ROM_REGION( 0x10000, "maincpu", 0 )
372   ROM_LOAD( "hprot_card2_rev6.u2",  0x00000, 0x10000, CRC(791f2425) SHA1(70af8911a27921cac6d98a5cd07602a7f59c2848) )
373ROM_END
374
375/*    YEAR  NAME      PARENT  COMPAT  MACHINE     INPUT     CLASS         INIT    COMPANY  FULLNAME                       FLAGS */
376COMP( 2002, hprot1,   0,      0,      hprot1,     hprot1,   hprot1_state, hprot1, "HENRY", "Henry Prot I v19 (REV.1)",    GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND)
377/* fw version: "R19"        Release date: February 1st, 2002.   */
378
379COMP( 2006, hprotr8a, hprot1, 0,      hprotr8a,   hprotr8a, hprot1_state, hprot1, "HENRY", "Henry Prot CARD I (REV.08A)", GAME_NOT_WORKING)
380/* fw version: "V6.5QI I"   Release date: September 18th, 2006. */
381
382COMP( 2003, hprot2r6, hprot1, 0,      hprot2r6,   hprot2r6, hprot1_state, hprot1, "HENRY", "Henry Prot CARD II (REV.6)", GAME_NOT_WORKING)
383/* fw version: "V5.8CF II"  Release date: June 23rd, 2003.      */
trunk/src/mess/mess.lst
r30992r30993
23802380ivg09
23812381pulsarlb
23822382hprot1
2383hprotr8a
2384hprot2r6
23832385compclr2
23842386m6805evs
23852387mx2178

Previous 199869 Revisions Next


© 1997-2024 The MAME Team