Initial Hector cleanup. In the future, please ensure your code comments are in English. nw

This commit is contained in:
mooglyguy 2018-06-03 03:21:11 +02:00
parent 89f5248eb5
commit 629b7fd63e
4 changed files with 441 additions and 466 deletions

View File

@ -113,15 +113,15 @@ public:
uint8_t m_hector_disc2_data_w_ready;
uint8_t m_hector_disc2_data_read;
uint8_t m_hector_disc2_data_write;
uint8_t m_hector_disc2_RNMI;
uint8_t m_hector_disc2_rnmi;
uint8_t m_state3000;
uint8_t m_write_cassette;
emu_timer *m_Cassette_timer;
uint8_t m_CK_signal ;
emu_timer *m_cassette_timer;
uint8_t m_ck_signal;
uint8_t m_flag_clk;
double m_Pin_Value[29][2];
int m_AU[17];
int m_ValMixer;
double m_pin_value[29][2];
int m_au[17];
int m_val_mixer;
int m_oldstate3000;
int m_oldstate1000;
uint8_t m_pot0;
@ -134,10 +134,10 @@ public:
uint8_t m_hector_port_cmd;
uint8_t m_cassette_bit;
uint8_t m_cassette_bit_mem;
uint8_t m_Data_K7;
uint8_t m_data_k7;
int m_counter_write;
int m_IRQ_current_state;
int m_NMI_current_state;
int m_irq_current_state;
int m_nmi_current_state;
int m_hector_cmd[10];
int m_hector_nb_cde;
int m_hector_flag_result;
@ -167,22 +167,22 @@ public:
DECLARE_MACHINE_START(hec2mdhrx);
DECLARE_MACHINE_RESET(hec2mdhrx);
uint32_t screen_update_hec2hrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(Callback_CK);
TIMER_CALLBACK_MEMBER(cassette_clock);
DECLARE_WRITE_LINE_MEMBER( disc2_fdc_interrupt );
DECLARE_WRITE_LINE_MEMBER( disc2_fdc_dma_irq );
int isHectorWithDisc2();
int isHectorWithMiniDisc();
int isHectorHR();
int isHectoreXtend();
void Mise_A_Jour_Etat(int Adresse, int Value );
void Init_Value_SN76477_Hector();
void Update_Sound(address_space &space, uint8_t data);
void hector_reset(int hr, int with_D2 );
int has_disc2();
int has_minidisc();
int is_hr();
int is_extended();
void update_state(int Adresse, int Value );
void init_sn76477();
void update_sound(address_space &space, uint8_t data);
void hector_reset(int hr, int with_d2);
void hector_init();
void Init_Hector_Palette();
void hector_80c(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram) ;
void hector_hr(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram) ;
void init_palette();
void hector_80c(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram);
void hector_hr(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram);
/*----------- defined in machine/hecdisk2.c -----------*/
// disc2 handling

File diff suppressed because it is too large Load Diff

View File

@ -115,9 +115,6 @@ void hp48_state::rs232_start_recv_byte(uint8_t data)
/* end of send event */
TIMER_CALLBACK_MEMBER(hp48_state::rs232_byte_sent_cb)
{
//device_image_interface *xmodem = dynamic_cast<device_image_interface *>(machine().device("rs232_x"));
//device_image_interface *kermit = dynamic_cast<device_image_interface *>(machine().device("rs232_k"));
LOG_SERIAL(("%f hp48_state::rs232_byte_sent_cb: end of send, data=%02x\n", machine().time().as_double(), param));
m_io[0x12] &= ~3; /* clear byte sending and buffer full */
@ -127,10 +124,6 @@ TIMER_CALLBACK_MEMBER(hp48_state::rs232_byte_sent_cb)
{
pulse_irq(SATURN_IRQ_LINE);
}
/* protocol action */
//if ( xmodem && xmodem->exists() ) xmodem_receive_byte( &xmodem->device(), param );
//else if ( kermit && kermit->exists() ) kermit_receive_byte( &kermit->device(), param );
}
/* CPU initiates a send event */
@ -445,17 +438,8 @@ READ8_MEMBER(hp48_state::io_r)
/* serial */
case 0x15:
{
/* second nibble of received data */
//device_image_interface *xmodem = dynamic_cast<device_image_interface *>(machine().device("rs232_x"));
//device_image_interface *kermit = dynamic_cast<device_image_interface *>(machine().device("rs232_k"));
m_io[0x11] &= ~1; /* clear byte received */
data = m_io[offset];
/* protocol action */
//if ( xmodem && xmodem->exists() ) xmodem_byte_transmitted( &xmodem->device() );
//else if ( kermit && kermit->exists() ) kermit_byte_transmitted( &kermit->device() );
break;
}

View File

@ -26,9 +26,9 @@
=> add BR/HR switching
=> add bank switch for HRX
=> add device MX80c and bank switching for the ROM
Importante note : the keyboard function add been piked from
Important note : the keyboard function has been taken from the
DChector project : http://dchector.free.fr/ made by DanielCoulom
(thank's Daniel)
(thanks Daniel)
TODO : Add the cartridge function,
Adjust the one shot and A/D timing (sn76477)
*/
@ -39,50 +39,49 @@
#include "screen.h"
void hec2hrp_state::Init_Hector_Palette()
void hec2hrp_state::init_palette()
{
uint8_t *hector_color = m_hector_color;
// basic colors !
hector_color[0] = 0; // fond (noir)
hector_color[1] = 1; // HECTOR HRX (rouge)
hector_color[2] = 7; // Point interrogation (Blanc)
hector_color[3] = 3; // Ecriture de choix (jaune)
m_hector_color[0] = 0; // black
m_hector_color[1] = 1; // red
m_hector_color[2] = 7; // white
m_hector_color[3] = 3; // yellow
// Color initialisation : full lightning
m_palette->set_pen_color( 0,rgb_t(000,000,000));//Noir
m_palette->set_pen_color( 1,rgb_t(255,000,000));//Rouge
m_palette->set_pen_color( 2,rgb_t(000,255,000));//Vert
m_palette->set_pen_color( 3,rgb_t(255,255,000));//Jaune
m_palette->set_pen_color( 4,rgb_t(000,000,255));//Bleu
m_palette->set_pen_color( 5,rgb_t(255,000,255));//Magneta
m_palette->set_pen_color( 6,rgb_t(000,255,255));//Cyan
m_palette->set_pen_color( 7,rgb_t(255,255,255));//Blanc
// 1/2 lightning
// Full brightness
m_palette->set_pen_color( 0,rgb_t(000,000,000)); // black
m_palette->set_pen_color( 1,rgb_t(255,000,000)); // red
m_palette->set_pen_color( 2,rgb_t(000,255,000)); // green
m_palette->set_pen_color( 3,rgb_t(255,255,000)); // yellow
m_palette->set_pen_color( 4,rgb_t(000,000,255)); // blue
m_palette->set_pen_color( 5,rgb_t(255,000,255)); // magenta
m_palette->set_pen_color( 6,rgb_t(000,255,255)); // cyan
m_palette->set_pen_color( 7,rgb_t(255,255,255)); // white
m_palette->set_pen_color( 8,rgb_t(000,000,000));//Noir
m_palette->set_pen_color( 9,rgb_t(128,000,000));//Rouge
m_palette->set_pen_color( 10,rgb_t(000,128,000));//Vert
m_palette->set_pen_color( 11,rgb_t(128,128,000));//Jaune
m_palette->set_pen_color( 12,rgb_t(000,000,128));//Bleu
m_palette->set_pen_color( 13,rgb_t(128,000,128));//Magneta
m_palette->set_pen_color( 14,rgb_t(000,128,128));//Cyan
m_palette->set_pen_color( 15,rgb_t(128,128,128));//Blanc
// Half brightness
m_palette->set_pen_color( 8,rgb_t(000,000,000)); // black
m_palette->set_pen_color( 9,rgb_t(128,000,000)); // red
m_palette->set_pen_color( 10,rgb_t(000,128,000)); // green
m_palette->set_pen_color( 11,rgb_t(128,128,000)); // yellow
m_palette->set_pen_color( 12,rgb_t(000,000,128)); // blue
m_palette->set_pen_color( 13,rgb_t(128,000,128)); // magenta
m_palette->set_pen_color( 14,rgb_t(000,128,128)); // cyan
m_palette->set_pen_color( 15,rgb_t(128,128,128)); // white
}
void hec2hrp_state::hector_hr(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram)
{
uint8_t *hector_color = m_hector_color;
uint8_t gfx,y;
uint16_t sy=0,ma=0,x;
for (y = 0; y <= ymax; y++) { //224
uint16_t *p = &bitmap.pix16(sy++);
for (x = ma; x < ma + yram; x++) { // 64
gfx = *(page+x);
/* Display a scanline of a character (4 pixels !) */
*p++ = hector_color[(gfx >> 0) & 0x03];
*p++ = hector_color[(gfx >> 2) & 0x03];
*p++ = hector_color[(gfx >> 4) & 0x03];
*p++ = hector_color[(gfx >> 6) & 0x03];
int sy = 0;
int ma = 0;
for (int y = 0; y <= ymax; y++)
{
uint16_t *pix = &bitmap.pix16(sy++);
for (int x = ma; x < ma + yram; x++)
{
uint8_t gfx = *(page + x);
*pix++ = hector_color[(gfx >> 0) & 0x03];
*pix++ = hector_color[(gfx >> 2) & 0x03];
*pix++ = hector_color[(gfx >> 4) & 0x03];
*pix++ = hector_color[(gfx >> 6) & 0x03];
}
ma+=yram;
}
@ -90,30 +89,31 @@ void hec2hrp_state::hector_hr(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int
void hec2hrp_state::hector_80c(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram)
{
uint8_t gfx,y;
uint16_t sy=0,ma=0,x;
for (y = 0; y <= ymax; y++) { //224
uint16_t *p = &bitmap.pix16(sy++);
for (x = ma; x < ma + yram; x++) { // 64
gfx = *(page+x);
/* Display a scanline of a character (8 pixels !) */
*p++ = (gfx & 0x01) ? 7 : 0;
*p++ = (gfx & 0x02) ? 7 : 0;
*p++ = (gfx & 0x04) ? 7 : 0;
*p++ = (gfx & 0x08) ? 7 : 0;
*p++ = (gfx & 0x10) ? 7 : 0;
*p++ = (gfx & 0x20) ? 7 : 0;
*p++ = (gfx & 0x40) ? 7 : 0;
*p++ = (gfx & 0x80) ? 7 : 0;
int sy = 0;
int ma = 0;
for (int y = 0; y <= ymax; y++)
{
uint16_t *pix = &bitmap.pix16(sy++);
for (int x = ma; x < ma + yram; x++)
{
uint8_t gfx = *(page + x);
*pix++ = (gfx & 0x01) ? 7 : 0;
*pix++ = (gfx & 0x02) ? 7 : 0;
*pix++ = (gfx & 0x04) ? 7 : 0;
*pix++ = (gfx & 0x08) ? 7 : 0;
*pix++ = (gfx & 0x10) ? 7 : 0;
*pix++ = (gfx & 0x20) ? 7 : 0;
*pix++ = (gfx & 0x40) ? 7 : 0;
*pix++ = (gfx & 0x80) ? 7 : 0;
}
ma+=yram;
ma += yram;
}
}
VIDEO_START_MEMBER(hec2hrp_state,hec2hrp)
{
Init_Hector_Palette();
init_palette();
}
uint32_t hec2hrp_state::screen_update_hec2hrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@ -121,22 +121,22 @@ uint32_t hec2hrp_state::screen_update_hec2hrp(screen_device &screen, bitmap_ind1
uint8_t *videoram = m_videoram;
uint8_t *videoram_HR = m_hector_videoram;
if (m_hector_flag_hr==1)
{
{
if (m_hector_flag_80c==0)
{
screen.set_visible_area(0, 243, 0, 227);
hector_hr(bitmap , &videoram_HR[0], 227, 64);
}
else
{
screen.set_visible_area(0, 243*2, 0, 227);
hector_80c(bitmap , &videoram_HR[0], 227, 64);
}
}
else
{
screen.set_visible_area(0, 113, 0, 75);
hector_hr(bitmap, videoram, 77, 32);
screen.set_visible_area(0, 243, 0, 227);
hector_hr(bitmap , &videoram_HR[0], 227, 64);
}
else
{
screen.set_visible_area(0, 243*2, 0, 227);
hector_80c(bitmap , &videoram_HR[0], 227, 64);
}
}
else
{
screen.set_visible_area(0, 113, 0, 75);
hector_hr(bitmap, videoram, 77, 32);
}
return 0;
}