# Shinobi Library

English

### Ver 1.00

1998/10/4

# BootROM僼僅儞僩娭悢

栚師

## 0. 奣梫

> 杮娭悢偼BootROM撪偵奿擺偝傟偰偄傞僼僅儞僩僨乕僞傪BIOS傪捠偟偰傾僋僙僗偡傞傕偺偱偡丅
> BootROM撪偵偼塸悢丄擔杮岅偺僼僅儞僩偑奿擺偝傟偰偄傑偡丅慡妏24亊24pixel丄敿妏12亊24pixe丄僙僈摿惢奜帤丄VM僨僼僅儖僩儔儀儖傾僀僐儞偑梡堄偝傟偰偄傑偡丅l
> BIOS偵偼僼僅儞僩僨乕僞偺愭摢傾僪儗僗傪庢摼偡傞娭悢丄僙儅僼僅偵娭偡傞娭悢偑擖偭偰偄傑偡丅

### 0.1僼僅儞僩偺峔憿

僼僅儞僩偼丄僪僢僩僀儊乕僕傪0偲1偺價僢僩楍偵曄姺偟埑弅偟偰丄埲壓偺傛偆側宍懺偱BOOT ROM撪偵廂傔傜傟偰偄傑偡丅
仩 | 仩 | 仩 | 仩 | 仩 | 仭 | 仭 | 仩 | 仩 | 仩 | 仩 | 仩
仩 | 仩 | 仩 | 仩 | 仭 | 仩 | 仩 | 仭 | 仩 | 仩 | 仩 | 仩
仩 | 仩 | 仩 | 仭 | 仩 | 仩 | 仩 | 仩 | 仭 | 仩 | 仩 | 仩
仩 | 仩 | 仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭 | 仩 | 仩
仩 | 仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭 | 仩
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仭 | 仭 | 仭 | 仭 | 仭 | 仭 | 仭 | 仭 | 仭 | 仭 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仭 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仭
仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩
仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩
仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩
仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩
仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩 | 仩

= 0000 0110 0000 0000 1001 0000 0001 0000 1000 0010 0000 0100 0100 0000 0010 10000 0000 0001 1000 0000 0001 1000 0000 0001 1000 0000 0001 1000 0000 0001 1111 1111 1111 1000 0000 0001 10000 0000 0001 1000 0000 0001 1000 0000 0001 1000 0000 0001 1000 0000 0001 10000 0000 0001 1000 0000 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
= 0x06, 0x00, 0x90, 0x10, 0x82, 0x04, 0x40, 0x28, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0x80, 0x1f, 0xff, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0x80, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

## 1. 僨乕僞巇條

### 1.1 掕悢

僙僋僔儑儞偺愭摢僨乕僞傊偺僆僼僙僢僩丅幚嵺偵偼syBtFntGet()偱庢摼偟偨僼僅儞僩僨乕僞偺愭摢傾僪儗僗傪偙傟偵壛偊傑偡丅

SYD_BT_FNT_ASCII_24_OFS | ASCII 傾僗僉乕
SYD_BT_FNT_WEST_24_OFS | ISO 8859-1 奀奜梡8價僢僩僐乕僪屻敿
SYD_BT_FNT_JISX_24_OFS | JIS X 0201 擔杮梡8價僢僩僐乕僪屻敿
SYD_BT_FNT_KANA_24_OFS | Shift JIS part1 慡妏擔杮岅旕娍帤晹暘
SYD_BT_FNT_LVL1_24_OFS | Shift JIS part2 擔杮岅娍帤戞堦悈弨晹暘
SYD_BT_FNT_LVL2_24_OFS | Shift JIS part3 擔杮岅娍帤戞擇悈弨晹暘
SYD_BT_FNT_ASCII_12_OFS | ASCII 傾僗僉乕12pixel亊12pixel
SYD_BT_FNT_GAIJ_24_OFS | GAIJI 摿惢奜帤
SYD_BT_FNT_VMSICON_OFS | VM僨僼僅儖僩儔儀儖傾僀僐儞

JR5偱丄傾僫僂儞僗偟偰偄傑偟偨丄12x12偺傾僗僉乕暥帤偺採嫙偼柍偔側傝丄VM偺僨僼僅儖僩儔儀儖傾僀僐儞偵嵎偟懼偊偲側傝傑偟偨丅
偛拲堄偔偩偝偄丅

僙僋僔儑儞偺僨乕僞僒僀僘丅

SYD_BT_FNT_ASCII_24_SIZE | ASCII 傾僗僉乕
SYD_BT_FNT_WEST_24_SIZE | ISO 8859-1 奀奜梡8價僢僩僐乕僪屻敿
SYD_BT_FNT_JISX_24_SIZE | JIS X 0201 擔杮梡8價僢僩僐乕僪屻敿
SYD_BT_FNT_KANA_24_SIZE | Shift JIS part1 慡妏擔杮岅旕娍帤晹暘
SYD_BT_FNT_LVL1_24_SIZE | Shift JIS part2 擔杮岅娍帤戞堦悈弨晹暘
SYD_BT_FNT_LVL2_24_SIZE | Shift JIS part3 擔杮岅娍帤戞擇悈弨晹暘
SYD_BT_FNT_ASCII_12_SIZE | ASCII 傾僗僉乕12pixel亊12pixel
SYD_BT_FNT_GAIJ_24_SIZE | GAIJI 摿惢奜帤
SYD_BT_FNT_VMSICON_SIZE | VM僨僼僅儖僩儔儀儖傾僀僐儞

JR5偱丄傾僫僂儞僗偟偰偄傑偟偨丄12x12偺傾僗僉乕暥帤偺採嫙偼柍偔側傝丄VMS偺僨僼僅儖僩儔儀儖傾僀僐儞偵嵎偟懼偊偲側傝傑偟偨丅
偛拲堄偔偩偝偄丅

奺僙僋僔儑儞偱偺戙昞揑側暥帤僐乕僪丅2byte擔杮岅偵娭偟偰偼僔僼僩俰俬俽僐乕僪傪柧婰偟偰偁傝傑偡丅

SYD_BT_FNT_CODE_ASCII_MIN | 傾僗僉乕偺弶傔偺僐乕僪
SYD_BT_FNT_CODE_ASCII_MAX | 傾僗僉乕偺嵟屻偺僐乕僪
SYD_BT_FNT_CODE_8BIT_MIN | 8價僢僩僐乕僪偺弶傔偺僐乕僪
SYD_BT_FNT_CODE_8BIT_MAX | 8價僢僩僐乕僪偺嵟屻偺僐乕僪
SYD_BT_FNT_CODE_KANA_MIN | 2byte僐乕僪偺嵟弶偺僐乕僪
SYD_BT_FNT_CODE_KANA_MAX | 擔杮岅旕娍帤晹暘偺嵟屻偺僐乕僪
SYD_BT_FNT_CODE_LVL1_MIN | 娍帤戞堦悈弨偺嵟弶偺僐乕僪
SYD_BT_FNT_CODE_LVL1_MAX | 娍帤戞堦悈弨偺嵟屻偺僐乕僪
SYD_BT_FNT_CODE_LVL2_MIN | 娍帤戞擇悈弨偺嵟弶偺僐乕僪
SYD_BT_FNT_CODE_LVL2_MAX | 娍帤戞擇悈弨偺嵟屻偺僐乕僪
SYD_BT_FNT_GAIJ_MIN | 奜帤偺嵟弶偺僐乕僪
SYD_BT_FNT_GAIJ_MAX | 奜帤偺嵟屻偺僐乕僪
SYD_BT_FNT_ICON_MIN | 倁俵俽傾僀僐儞偺嵟弶偺僐乕僪
SYD_BT_FNT_ICON_MAX | 倁俵俽傾僀僐儞偺嵟屻偺僐乕僪

僼僅儞僩僙儅僼僅偺惉岟丄幐攕傪帵偡丅syBtFntChkSmph()偺娭悢抣偲偟偰棙梡偝傟傑偡丅

SYD_BT_FNT_SMPH_SUCCESS | 僽乕僩儘儉傊偺傾僋僙僗壜擻
SYD_BT_FNT_SMPH_FAILURE | 僽乕僩儘儉傊偺傾僋僙僗晄嫋壜

僼僅儞僩僙僢僩堦棗(syBtFntGetAddr(), syBtFntGetInfo()巊梡帪偵昁梫)

SYE_BT_FNT_FONTSET_WESTERN_24 | ISO 8859-1
SYE_BT_FNT_FONTSET_JP_JIS_24 | JIS X 0201
SYE_BT_FNT_FONTSET_JP_KANA_24 | Shift JIS 傂傜偑側傑偱
SYE_BT_FNT_FONTSET_JP_LVL1_24 | Shift JIS 戞堦悈弨傑偱
SYE_BT_FNT_FONTSET_JP_LVL2_24 | Shift JIS 戞擇悈弨傑偱
SYE_BT_FNT_FONTSET_JP_GAIJ_24 | 僙僈摿惢奜帤
SYE_BT_FNT_FONTSET_VMSICON | VM僨僼僅儖僩儔儀儖傾僀僐儞

ISO 8859-1偲JIS X 0201偺堘偄偼丄僐乕僪0x5c丄0x7e丄媦傃0xa0埲崀偱偡丅

### 1.2 峔憿懱巇條

SYS_BT_FNT_INFO峔憿懱

掕媊

      typedef struct {
        Uint8  width;
        Uint8  height;
      } SYS_BT_FNT_INFO;

愢柧
  僼僅儞僩偵娭偡傞忣曬

儊儞僶

  width | 僼僅儞僩偺暆(扨埵:Pixel)
  height | 僼僅儞僩偺崅偝(扨埵:Pixel)

嶲徠
  syBtFntGetInfo()

## 2. 娭悢巇條

## 2.1 娭悢堦棗

娭悢 | 婡擻
--- | ---
| syBtFntGet | 僽乕僩儘儉忋偺僼僅儞僩僨乕僞偺愭摢傾僪儗僗偺庢摼
syBtFntChkSmph | 僼僅儞僩僙儅僼僅偺僠僃僢僋
syBtFntClrSmph | 僼僅儞僩僙儅僼僅偺僋儕傾
syBtFntGetAddr亙怴婯亜 | Shift JIS僐乕僪偐傜懳徾僼僅儞僩僨乕僞傊偺僆僼僙僢僩抣傪庢摼
syBtFntGetInfo亙怴婯亜 | Shift JIS僐乕僪偐傜懳徾僼僅儞僩僨乕僞偺僒僀僘忣曬傪庢摼
syBtFntSjis2Jis亙怴婯亜 | Shift JIS僐乕僪偐傜JIS僐乕僪傊曄姺

## 2.2 娭悢API

## syBtFntGet

乵娭悢乶
  void *syBtFntGet(Uint32 num)
乵擖椡乶
  num
    惂屼梡斣崋
乵弌椡乶
  側偟
乵栠傝抣乶
  BootROM撪偺僼僅儞僩僨乕僞偺愭摢傾僪儗僗
乵婡擻乶
  僽乕僩儘儉撪僼僅儞僩僨乕僞偺奿擺傾僪儗僗傪庢摼偟傑偡丅
乵拲堄乶
  惂屼梡斣崋偵偼尰嵼SYD_BT_FNTINI傪擖傟偰抲偔帠丅
  僙儅僼僅傪妉摼偣偢偵丄僼僅儞僩僨乕僞偺庢摼傪峴偭偨応崌偵偼丄晄掕偺抣偑曉傞壜擻惈偑偁傝傑偡丅
  杮娭悢偼丄傾僪儗僗傪庢摼偡傞傕偺偱偁偭偰丄僼僅儞僩僨乕僞傪傾僾儕働乕僔儑儞撪偵庢傝崬傓傕偺偱偼偁傝傑偣傫丅僼僅儞僩僨乕僞偺傾僾儕働亅僔儑儞傊偺僐僺乕偼丄傾僾儕働乕僔儑儞帺恎偑峴偆傛偆偵偟偰偔偩偝偄丅
乵巊梡椺乶

        #define SMD_WRK_ADDR  (0x0c020000)

        main()
        {
          void *smFntAddr, *smTheFntAddr;
          void *smWrkAddr;
          Uint8 smTheCode;

          smFntAddr = syBtFntGet();
          smWrkAddr = (void *)SMD_WRK_ADDR;
          smTheCode = '?';

          /* evaluate the font address in Boot ROM */
          smTheFntAddr = (void *)((Uint8)smFntAddr + SYD_BT_FNT_WORK_ASCII_24_OFS
            + (smTheCode - SYD_BT_FNT_CODE_ASCII_MIN) * SYD_BT_FNT_24_SIZE_HAN );

          /* font semaphore check */
          if( syBtFntChkSmph() == SYD_BT_FNT_SMPH_SUCCESS ) {
            /* copy 1 letter to work RAM from Boot ROM */
            memcpy( smTheFntAddr, smWrkAddr, SYD_BT_FNT_24_SIZE_HAN );
            /* font semaphore clear */
            syBtFntClrSmph();
          }
        }

## syBtFntChkSmph

乵娭悢乶
  Sint32 syBtFntChkSmph( void )
乵擖椡乶
  側偟
乵弌椡乶
  側偟
乵栠傝抣乶
  僼僅儞僩僙儅僼僅偺僠僃僢僋寢壥 SYD_BT_FNT_SMPH_***
乵婡擻乶
  僼僅儞僩僙儅僼僅傪僠僃僢僋偟丄棫偭偰偄側偗傟偽棫偰丄惉岟傪曉偟傑偡丅僼僅儞僩僙儅僼僅偐懠偺僾儘僙僗(GD僪儔僀僶)偵傛傞僙儅僼僅偑棫偭偰偄傟偽幐攕傪曉偟傑偡丅
乵拲堄乶
  僙儅僼僅傪妉摼偣偢偵丄僼僅儞僩僨乕僞偺庢摼傪峴偭偨応崌偵偼丄晄掕偺抣偑曉傞壜擻惈偑偁傝傑偡丅

## syBtFntClrSmph

乵娭悢乶
  Sint32 syBtFntClrSmph( void )
乵擖椡乶
  側偟
乵弌椡乶
  側偟
乵栠傝抣乶
  側偟
乵婡擻乶
  僼僅儞僩僙儅僼僅傪僋儕傾偟傑偡丅

## syBtFntGetAddr

乵娭悢乶
  Uint32 syBtFntGetAddr( SYE_BT_FNT_FONTSET set, Sint16 code )
乵擖椡乶
  set
    僼僅儞僩僙僢僩
  code
    Shift JIS僐乕僪丅8byte僐乕僪偼忋埵8byte偵0x00傪晅壛偡傞
乵弌椡乶
  側偟
乵栠傝抣乶
  僼僅儞僩僨乕僞愭摢傾僪儗僗偐傜偺僆僼僙僢僩(byte悢)
乵婡擻乶
  Shift JIS僐乕僪偐傜僼僅儞僩僨乕僞愭摢傾僪儗僗偐傜偺僆僼僙僢僩傪寁嶼偟傑偡丅寁嶼偝傟偨抣偼byte悢偱偡丅
乵拲堄乶
  側偟

## syBtFntGetInfo

乵娭悢乶
  void syBtFntGetInfo( SYE_BT_FNT_FONTSET set, Sint16 code, SYS_BT_FNT_INFO *info )
乵擖椡乶
  set
    僼僅儞僩僙僢僩
  code
    Shift JIS僐乕僪丅8byte僐乕僪偼忋埵8byte偵0x00傪晅壛偡傞
乵弌椡乶
  info
    僼僅儞僩僙僢僩偲code偱巜掕偝傟偨僼僅儞僩僨乕僞偺僒僀僘忣曬
乵栠傝抣乶
  側偟
乵婡擻乶
  僼僅儞僩僨乕僞偺廲丄墶偺pixel悢傪庢摼偟傑偡丅
乵拲堄乶
  側偟

## syBtFntSjis2Jis

乵娭悢乶
  Sint16 syBtFntSjis2Jis( Sint16 sjis )
乵擖椡乶
  sjis
    Shift JIS僐乕僪
乵弌椡乶
  側偟
乵栠傝抣乶
  JIS 僐乕僪
乵婡擻乶
  Shift JIS僐乕僪偐傜JIS僐乕僪傊曄姺
乵拲堄乶
  側偟

僆乕僶乕價儏乕偵栠傞