Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PutFS:
- ; read the font from flash to RAM
- ; need to add 3*A to the fontpointer
- ld hl,(FontPointer)
- ld b,0
- ld c,a
- add hl,bc
- add hl,bc
- adc hl,bc ;add hl,bc won't set the right flags, so use adc
- ld a,(font_ptr_page)
- jp p,+_
- or a
- jr z,+_
- set 6,h
- res 7,h
- inc a
- _:
- ld c,3
- ld de,$8005
- call readarc
- ; get the text position and update it
- ld hl,(textRow)
- ; ld b,0 ;B is already 0 from the ReadArc routine
- ld a,h
- cp 24
- ld a,l
- jr c,+_
- ld h,b
- add a,6
- _:
- cp 3Bh
- jr c,+_
- sub 3Ch
- jr nc,+_
- add a,6
- _:
- ld l,a
- ; need to advance the x-coord by 1
- inc h
- ld (textRow),hl
- dec h
- ;want A*12+H/2+(gbuf_temp), and we know A < 64
- add a,a
- add a,a
- ;now A*3+(gbuf_temp)+H/2
- ld c,a
- ld a,h
- ld hl,(gbuf_temp)
- add hl,bc
- add hl,bc
- add hl,bc
- ld c,a
- srl c
- add hl,bc
- rra
- ld e,4 ; now DE points to the byte before the char data
- jr nc,put_left
- put_right:
- ld c,$0F
- call put_right2
- call put_right2
- put_right2:
- ; read in the byte
- inc de
- ld a,(de)
- ; check if it needs to be inverted
- bit InvertTextFlag,(iy+UserFlags)
- jr z,$+3
- cpl
- ld b,a ; back up the byte
- call shift_put_lr
- ld a,b ;restore the byte
- jr put_lr
- put_left:
- ld c,$F0
- call put_left2
- call put_left2
- put_left2:
- ; read in the byte
- inc de
- ld a,(de)
- ; check if it needs to be inverted
- bit InvertTextFlag,(iy+UserFlags)
- jr z,$+3
- cpl
- ld b,a ; back up the byte
- call put_lr
- ld a,b ;restore the byte
- shift_put_lr:
- ; rotate the nibbles
- rrca
- rrca
- rrca
- rrca
- put_lr:
- ; mask the byte
- and c
- ; OR it to the screen
- or (hl)
- ld (hl),a
- ; advance the gbuf ptr
- ld a,l
- add a,12
- ld l,a
- ret nc
- inc h
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement