mz-700
差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| mz-700 [2023/12/06 13:00] – [MZ-800の初期化処理について] araki | mz-700 [2023/12/07 07:07] (現在) – [概要] araki | ||
|---|---|---|---|
| 行 2: | 行 2: | ||
| ===== 概要 ===== | ===== 概要 ===== | ||
| + | |||
| + | {{: | ||
| ===== MZ-800エミュレータでMZ-700のIPLを使う ===== | ===== MZ-800エミュレータでMZ-700のIPLを使う ===== | ||
| 行 131: | 行 133: | ||
| 幸い、1Z-009Aの8253/ | 幸い、1Z-009Aの8253/ | ||
| + | ==== 初期化コード ==== | ||
| + | |||
| + | 上記の処理を以下のように実装した。 | ||
| + | |||
| + | < | ||
| + | ; | ||
| + | ; MZ-800 to MZ-700 | ||
| + | ; | ||
| + | .z80 | ||
| + | org | ||
| + | mz700 | ||
| + | stack | ||
| + | cgrom | ||
| + | pcgram | ||
| + | mset53 | ||
| + | |||
| + | entry: | ||
| + | di | ||
| + | im 1 ; set interrupt mode to 1 | ||
| + | |||
| + | ld a,8 ; set MZ-700 mode | ||
| + | out | ||
| + | ld a,1 ; set CRTC to MZ-700 mode | ||
| + | out | ||
| + | out | ||
| + | out | ||
| + | ld sp, | ||
| + | ; init 8255 | ||
| + | ld a,08ah | ||
| + | ld (0e003h), | ||
| + | ld a,1 | ||
| + | ld (0e003h), | ||
| + | ld a,5 | ||
| + | ld (0e003h), | ||
| + | ; init 8253 | ||
| + | ld de,0 | ||
| + | call mset53 | ||
| + | ; init PIO | ||
| + | ld bc,04fch | ||
| + | ld hl,piodat | ||
| + | otir | ||
| + | ld bc,04fdh | ||
| + | otir | ||
| + | ; init SIO | ||
| + | ld a,1 | ||
| + | out | ||
| + | xor a | ||
| + | out | ||
| + | ; init PSG (SN76489AN) | ||
| + | ld b,4 | ||
| + | ld a,09fh | ||
| + | psgset: | ||
| + | out | ||
| + | add | ||
| + | djnz psgset | ||
| + | ; init screen | ||
| + | ld hl,0d800h | ||
| + | ld de,0d000h | ||
| + | ld bc,0400h | ||
| + | cls_loop: | ||
| + | ld (hl), | ||
| + | inc hl | ||
| + | xor a | ||
| + | ld (de), | ||
| + | inc de | ||
| + | |||
| + | dec bc | ||
| + | ld a,b | ||
| + | or c | ||
| + | jr nz,cls_loop | ||
| + | |||
| + | ; copy CGROM to PCG | ||
| + | in a,(0e0h) | ||
| + | ld de,pcgram | ||
| + | ld hl,cgrom | ||
| + | ld bc,1000h | ||
| + | ldir | ||
| + | in a,(0e1h) | ||
| + | |||
| + | jp mz700 | ||
| + | |||
| + | org | ||
| + | piodat | ||
| + | |||
| + | end | ||
| + | </ | ||
mz-700.1701867619.txt.gz · 最終更新: by araki
