ドラクエ風RPGファミコンプログラム講座 アセンブラ入門編

【第50回】

ドラクエ風日本語表示システム』 

 

1.str_pr:濁点処理の追加

⁂赤色のとこらが、追加変更された部分です。

 

2.濁点・半濁点処理

⁂濁点処理は、画像の様に平仮名の上に  ゜をつけます。

 

str_pr:
jsr Vram_add_set
lda mess00,y
iny
cmp #$ff                    ;エンドコード
beq exit
cmp #$34                 ;濁点 (゛)
beq dakuten
cmp #$35                 ;半濁点(゜)
beq dakuten
sta $2007
inc Vram_add_low     ;Vram インクリメント
jmp str_pr
exit:
jsr scroll_zero
rts


dakuten:
pha                                  ;文字コードの退避
lda Vram_add_hi             ;Vramアドレスの保存
sta <$6
lda Vram_add_low
sta <$7
sec
sbc #$20                       ;上段のVramアドレス計算
lda <$6

sta Vram_add_low
lda Vram_add_hi
sbc #0
sta Vram_add_hi
sta $2006
lda Vram_add_low
sta $2006
pla                                  ;文字コードの復帰
sta $2007
sta Vram_add_hi            ;Vramアドレスの取り出し
lda <$7
sta Vram_add_low
jmp str_pr

 

Vram_add_set:
lda Vram_add_hi
sta $2006
lda Vram_add_low
sta $2006
rts

f:id:chien1956:20200206041741p:plain

【画像】