📄 vfd_hl0056.h
字号:
#ifndef __VFD_R_H
#define __VFD_R_H
/*
** 777777
** 5 6
** 5 6
** 444444
** 2 3
** 2 3
** 111111
*/
#define VFD_7SEG_SG (1<<4)
#define VFD_7SEG_SF (1<<5)
#define VFD_7SEG_SE (1<<2)
#define VFD_7SEG_SD (1<<1)
#define VFD_7SEG_SC (1<<3)
#define VFD_7SEG_SB (1<<6)
#define VFD_7SEG_SA (1<<7)
#include "vfd_7seg.h"
#include "macro.h"
#define VFD_DOT_MIC1 (16)
#define VFD_DOT_MIC2 (17)
#define VFD_DOT_MP3 (56)
#define VFD_DOT_SVCD (24)
#define VFD_DOT_VCD (31)
#define VFD_DOT_CD (30)
#define VFD_DOT_MINUS (19)
#define VFD_DOT_PAL (29)
#define VFD_DOT_NTSC (16)
#define VFD_DOT_MEM (26)
#define VFD_DOT_PLAYB (27)
#define VFD_DOT_PLAYA (28)
#define VFD_DOT_REPALL (29)
#define VFD_DOT_REP1 (30)
#define VFD_DOT_REPEAT (31)
#define VFD_DOT_MINSEC (32)
#define VFD_DOT_MIN (40)
#define VFD_DOT_SEC (56)
#define VFD_DOT_COLON (48)
#define VFD_DOT_DASH (27)
#define VFD_DOT_RESUME (64)
#define VFD_DOT_REMAIN (65)
#define VFD_DOT_PAUSE (67)
#define VFD_DOT_PLAY (68)
#define VFD_DOT_PBC (40)
#define VFD_DOT_RAN (70)
#define VFD_DOT_PGM (71)
#define VFD_DOT_VCD20 (72)
#define VFD_DOT_OVER (73)
#define VFD_DOT_2R (25)
#define VFD_DOT_1L (26)
#define VFD_DOT_TIME (76)
#define VFD_DOT_SPACE (77)
#define VFD_DOT_INTRO (79)
#define VFD_DOT_PGM01 (92)
#define VFD_DOT_PGM02 (93)
#define VFD_DOT_PGM03 (94)
#define VFD_DOT_PGM04 (95)
#define VFD_DOT_PGM05 (88)
#define VFD_DOT_PGM06 (89)
#define VFD_DOT_PGM07 (90)
#define VFD_DOT_PGM08 (91)
#define VFD_DOT_PGM09 (84)
#define VFD_DOT_PGM10 (85)
#define VFD_DOT_PGM11 (86)
#define VFD_DOT_PGM12 (87)
#define VFD_DOT_PGM13 (80)
#define VFD_DOT_PGM14 (81)
#define VFD_DOT_PGM15 (82)
#define VFD_DOT_PGM16 (83)
#define VFDA_P0 1
#define VFDA_P1 0
#define VFDA_M0 5
#define VFDA_M1 4
#define VFDA_S0 7
#define VFDA_S1 6
const BYTE vfd_addr[6] = { 0, 2, 5, 4, 7, 6, };
void print_vfd_digital(BYTE no, BYTE data)
{
if(no < 6)
{
vfd_mem[vfd_addr[no]] &= (~0xfe);
vfd_mem[vfd_addr[no]] |= (vfd_digit[data]);
}
}
void vfd_disc_turn(BYTE mode)
{
static BYTE i = 7;
if(i < 2)
i = 7;
if(mode == 2)
{
vfd_mem[1] = 0xfe;
vfd_mem[1] &= (~(1 << (i % 8)));
i--;
switch (i)
{
case 1:
vfd_dot(VFD_DOT_ON, VFD_DOT_COLON);
break;
case 4:
vfd_dot(VFD_DOT_OFF, VFD_DOT_COLON);
default:
break;
}
}
else if(mode == 1)
{
vfd_mem[1] = 0xfe;
vfd_dot(VFD_DOT_ON, VFD_DOT_COLON);
}
else if(mode == 0)
{
vfd_mem[1] = 0xfe;
vfd_dot(VFD_DOT_OFF, VFD_DOT_COLON);
}
}
void vfd_cdtype(BYTE cd_types)
{
switch (cd_types)
{
case CDCVD:
case CDSVCD:
vfd_dot(VFD_DOT_ON, VFD_DOT_SVCD);
case CDVCD10:
case CDVCD11:
case CDVCD20:
vfd_dot(VFD_DOT_ON, VFD_DOT_VCD);
case CDDA:
vfd_dot(VFD_DOT_ON, VFD_DOT_CD);
break;
case CDVCD30:
break;
case CDROM:
vfd_dot(VFD_DOT_ON, VFD_DOT_MP3);
break;
}
}
void vfd_close(void)
{
print_vfd_digital(1, 12);
print_vfd_digital(2, 21);
print_vfd_digital(3, 24);
print_vfd_digital(4, 28);
print_vfd_digital(5, 14);
}
void vfd_readtoc(void)
{
int i;
init_vfd_clear(0);
vfd_disc_turn(0);
for(i = 0; i < 6; i++)
vfd_mem[vfd_addr[i]] |= VFD_7SEG_SG;
}
void vfd_nodisc(void)
{
print_vfd_digital(0, 23);
print_vfd_digital(1, 24);
print_vfd_digital(2, 13);
print_vfd_digital(3, 18);
print_vfd_digital(4, 28);
print_vfd_digital(5, 12);
}
void vfd_open(void)
{
print_vfd_digital(2, 24);
print_vfd_digital(3, 25);
print_vfd_digital(4, 14);
print_vfd_digital(5, 23);
}
void vfd_show_time(void)
{
static BYTE cd_time_ss = 0xff; //0; wyf 2-4-1 15:57
if(cd_disp_ss != cd_time_ss)
{
cd_time_ss = cd_disp_ss;
print_vfd_digital(0, cd_disp_trk / 10);
print_vfd_digital(1, cd_disp_trk % 10);
print_vfd_digital(2, cd_disp_mm / 10);
print_vfd_digital(3, cd_disp_mm % 10);
print_vfd_digital(4, cd_disp_ss / 10);
print_vfd_digital(5, cd_disp_ss % 10);
}
}
void vfd_pause(void)
{
vfd_dot(VFD_DOT_ON, VFD_DOT_PAUSE);
vfd_dot(VFD_DOT_OFF, VFD_DOT_PLAY);
}
void vfd_audio(void)
{
switch (audio_channel)
{
case CH_LR:
vfd_dot(VFD_DOT_ON, VFD_DOT_1L);
vfd_dot(VFD_DOT_ON, VFD_DOT_2R);
break;
#ifdef VOCAL_CANCEL
case CH_AUTO_L:
#endif
case CH_LL:
vfd_dot(VFD_DOT_ON, VFD_DOT_1L);
vfd_dot(VFD_DOT_OFF, VFD_DOT_2R);
break;
#ifdef VOCAL_CANCEL
case CH_AUTO_R:
#endif
case CH_RR:
vfd_dot(VFD_DOT_OFF, VFD_DOT_1L);
vfd_dot(VFD_DOT_ON, VFD_DOT_2R);
break;
#ifdef VOCAL_CANCEL
case CH_AUTO_LR:
vfd_dot(VFD_DOT_ON, VFD_DOT_1L);
vfd_dot(VFD_DOT_ON, VFD_DOT_2R);
break;
#endif
}
}
void vfd_format(void)
{
if(tv_format == TV_NTSC)
{
vfd_dot(VFD_DOT_ON, VFD_DOT_NTSC);
vfd_dot(VFD_DOT_OFF, VFD_DOT_PAL);
}
else if(tv_format == TV_PAL)
{
vfd_dot(VFD_DOT_ON, VFD_DOT_PAL);
vfd_dot(VFD_DOT_OFF, VFD_DOT_NTSC);
}
}
void vfd_playmode(void)
{
if(cd_type_loaded == CDROM || cd_type_loaded == CDDA) //wyf 2-6-25 9:02.
{
vfd_dot(VFD_DOT_OFF, VFD_DOT_PBC);
return;
}
else
{
if(IsPBCOn())
vfd_dot(VFD_DOT_ON, VFD_DOT_PBC);
else
vfd_dot(VFD_DOT_OFF, VFD_DOT_PBC);
}
}
void vfd_repeat(void)
{
}
void vfd_refresh(void)
{
vfd_playmode();
vfd_format();
vfd_cdtype(cd_type_loaded);
vfd_audio();
}
void vfd_game(void)
{
print_vfd_digital(0, GetCmdSrc(sys_cmd) / 10);
print_vfd_digital(1, GetCmdSrc(sys_cmd) % 10);
print_vfd_digital(2, 0);
print_vfd_digital(3, 0);
print_vfd_digital(4, 0);
print_vfd_digital(5, 0);
}
void vfd_game_clear(void)
{
print_vfd_digital(0, 0);
print_vfd_digital(1, 0);
}
void vfd_jpeg_disp(void)
{//ok!
init_vfd_clear(0);
print_vfd_digital(2,cd_disp_trk/1000);
print_vfd_digital(3,(cd_disp_trk / 100) % 10);
print_vfd_digital(4,(cd_disp_trk / 10) % 10);
print_vfd_digital(5,cd_disp_trk % 10);
vfd_dot(VFD_DOT_ON,VFD_DOT_PLAY);
vfd_dot(VFD_DOT_OFF,VFD_DOT_PAUSE);
}
#endif/*__VFD_R_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -