📄 ui_getjapenese.msa
字号:
/********************************************************************************** ACTOS* ui dirver show picture** (c) Copyright 2002-2003, Actions Co,Ld.* All Right Reserved** File : UI_GetFontPoint.msa* By : Chliang* Version: 1> v1.00 first version 12/03/2003 10:46PM*********************************************************************************///#include "UI_S0724.h"#include "display.h" module UI_GetFontPoint public sUI_GetFontPoint extern AsciiSelect extern AsciiFontLibAddr extern FontLibAddr extern CharPointBuffer extern SD_RWStruct rseg UI_RCODE//********************************************************//*** FUNCTION: GetCharPoint**** PURPOSE: Get Char Point Info by dma2**** PARAMETERS:** input** de=区位码** bc=输出数据的存放地址** output** none** DESCRIPTION://********************************************************/sUI_GetFontPoint: push bc push de ld (SD_RWStruct+5),bc ld a,0x08 bit 6,b //bc是否大于4000h jr z,_buffer_in_zram in a,(05h) and 0fh_buffer_in_zram: ld (SD_RWStruct+7),aGetChineseCharPoint: ld a,e //区码 cp 81h //日文字库开始的位置 jr nc,_not_ascii_is_ascii: ld a,(AsciiSelect) cp 04h jr c,lsUse0608Type jr lsUse0816TypelsUse0608Type: xor a ld h,a ld l,e ld b,03h // ahl=e*8 call AHL_LeftShift //输入参数:b,hl jr MoveAsciiPointToBufferlsUse0816Type: xor a ld h,a ld l,e ld b,04h // ahl=e*16 call AHL_LeftShift //输入参数:b,hl ld bc,800h //0816Type ASCII起始地址=800h add hl,bc jr MoveAsciiPointToBuffer_not_ascii: cp 0x87 jr nc,Jump_Japenese_87 //++++++++++ 0x81~~~~~~0x84 +++++++++++++++ sub 0x81 call AddCountQuma //算出字个数HL==((e-0x81h)*0c0h+(d-040h))*32 call AddCountWeima xor a ld b,05h // ahl=a*32 call AHL_LeftShift //输入参数:b,hl jp MoveFontPointToBuffer Jump_Japenese_87: cp 0xa0 jr nc,JP_Japenese_A0 //+++++++++ 0x87---0x9f ++++++++++++++++ sub 0x81 // call AddCountQuma //算出字个数HL==((e-0x81h)*0c0h+(d-40h))*32 call AddCountWeima //ld bc,34eh //全角符号个数=34eh // add hl,bc xor a ld b,05h // ahl=a*32 call AHL_LeftShift //输入参数:b,hl jp MoveFontPointToBuffer JP_Japenese_A0: cp 0xe0 jr nc,JP_Japenese_ED //++++++++ 0xa0---0xdf +++++++++++++++++++//++++++++ 该区没有位码 ++++++++++++++++++ jp MovePointBufferEndJP_Japenese_ED: cp 0xed jr nc,JP_Japenese_FA //+++++++++ 0xe0~~~~~~0xea ++++++++++++++++++ sub 0x81+0X40 call AddCountQuma call AddCountWeima xor a ld b,5 call AHL_LeftShift jp MoveFontPointToBuffer JP_Japenese_FA: cp 0xfa jr nc,Is_Japenese_FA //++++++++ 0xed~~~~~~~0xee ++++++++++++++++++ sub 0x81+4+0X40-2 call AddCountQuma call AddCountWeima xor a ld b,5 call AHL_LeftShift jp MoveFontPointToBuffer Is_Japenese_FA: sub 0x81+15+0X40-2 call AddCountQuma call AddCountWeima xor a ld b,5 call AHL_LeftShift jp MoveFontPointToBuffer //--------------------------------------------------MoveAsciiPointToBuffer: ld de,(AsciiFontLibAddr) add hl,de ld (SD_RWStruct),hl ld l,a ld h,0 ld de,(AsciiFontLibAddr+2) adc hl,de ld (SD_RWStruct+2),hl jr MovePointToBufferMoveFontPointToBuffer: ld de,(FontLibAddr) add hl,de ld (SD_RWStruct),hl ld l,a ld h,0 ld de,(FontLibAddr+2) adc hl,de ld (SD_RWStruct+2),hlMovePointToBuffer: ld de,SD_RWStruct ld bc,32 mSD_ReadMovePointBufferEnd: pop de pop bc ret//---------------------------------------------------AddCountASCII: //算ICON地址,输入:hl 输出:hla ret//---------------------------------------------------AddCountQuma: push bc push de //hl*0xc0=hl*(0x40+0x80) ld l,a ld h,0 ld b,6Loop6: sla l rl h djnz Loop6 ld e,l ld d,h xor a add hl,de ;hl*2 add hl,de ;hl*3 pop de pop bc retAddCountWeima: push bc ld a,d sub 0X40 ld c,a ld b,0 add hl,bc pop bc retAHL_LeftShift: //输入参数:b,hl sla l rl h rla djnz AHL_LeftShift ret/********************************************************************************** the end of file*********************************************************************************/ end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -