Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; kanji rom downloader v0.01
- ; (C) JG1UAA/XnK 1995
- ;
- WBOOT equ 0000H
- BDOS equ 0005H
- sysfcb equ 005CH
- io_jis1 equ 0D8H
- io_jis2 equ 0DAH
- ORG 0100H
- start: ld sp,(BDOS+1)
- ld c,9
- ld de,title
- call BDOS
- chkopt: ld a,(sysfcb+1)
- and 11111100b
- cp 30h
- jr z,dlmain
- ld c,9
- ld de,usage
- call BDOS
- ld c,9
- ld de,msgj1
- call BDOS
- ld c,9
- ld de,msgj2
- call BDOS
- jp WBOOT
- dlmain:
- mk_fcb: ld a,(sysfcb)
- ld (fcb),a
- ld de,buf
- ld c,1ah ;set DTA
- call BDOS
- ld a,(sysfcb+1)
- cp '2'
- jr z,jis2
- ;JIS Class-1
- jis1: ld a,'1'
- ld (fcb+8),a
- ld de,fcb
- ld c,16h ;file create
- call BDOS
- ld hl,0001h
- ld (fcb+14),hl
- dec hl
- ld (fcb+33),hl
- ld (fcb+35),hl
- or a
- jr nz,abt
- ld c,9
- ld de,msgj1
- call BDOS
- ld c,io_jis1
- call kdmain
- ld de,fcb
- ld c,10h ;file close
- call BDOS
- ld a,(sysfcb+1)
- cp '1'
- jr z,fin
- ;JIS Class-2
- jis2: ld a,'2'
- ld (fcb+8),a
- ld de,fcb
- ld c,16h ;file create
- call BDOS
- ld hl,0001h
- ld (fcb+14),hl
- dec hl
- ld (fcb+33),hl
- ld (fcb+35),hl
- or a
- jr nz,abt
- ld c,9
- ld de,msgj2
- call BDOS
- ld c,io_jis2
- call kdmain
- ld de,fcb
- ld c,10h ;file close
- call BDOS
- fin: ld c,9
- ld de,endmsg
- call BDOS
- jp WBOOT
- abt: ld de,fcb
- ld c,10h ;file close
- call BDOS
- ld c,9
- ld de,errmsg
- call BDOS
- jp WBOOT
- kdmain: ; C:port_adr
- ld de,0000h
- ld b,16
- loop_1: push bc
- ld b,0 ;256
- ld hl,buf
- loop_r: push bc
- ld a,e ;l_6bit
- and 00111111b
- out (c),a
- inc c ;port#=port#+1
- ld a,e ;h_6bit
- and 11000000b
- ld b,a
- ld a,d
- and 00111111b
- or b
- rlca
- rlca
- out (c),a
- ld b,32
- inir
- dec c ;port#=port#(C)
- inc de ;kcode=kcode+1
- pop bc
- djnz loop_r
- push de
- dwrite: ld de,fcb
- ld hl,2000h
- ld c,26h
- call BDOS
- pop de
- pop bc
- or a
- jr nz,abret
- djnz loop_1
- ret
- abret:
- pop hl ;for stack
- jr abt
- title: DB 'Kanji-ROM downloader v0.01',0dh,0ah
- DB ' (C) JG1UAA/XnK 1995',0dh,0ah
- DB 0dh,0ah,'$'
- usage: DB 'Usage: KROMDL [d:][1|2|3]',0dh,0ah,0dh,0ah
- DB ' This will make Kanji-ROM image file:',0dh,0ah
- DB '$'
- msgj1: DB ' JIS Class 1 -> KROMJIS1.FNT',0dh,0ah
- DB '$'
- msgj2: DB ' JIS Class 2 -> KROMJIS2.FNT',0dh,0ah
- DB '$'
- errmsg: DB 0dh,0ah
- DB '### File open/write error',0dh,0ah,'$'
- endmsg: DB 0dh,0ah
- DB ' Finished.',0dh,0ah,'$'
- ;*** for file
- fcb: DB 00H,'KROMJIS1FNT',00H
- DS 24
- buf: DB '(^^)'
- DS 2000H-4
- END
Add Comment
Please, Sign In to add comment