Skip to content

Commit

Permalink
Port font.ms assembly module to compatible assembly format
Browse files Browse the repository at this point in the history
The font.ms module was written in some assembly (modula-3?) that could not be assembled with current sdcc. Fortunetely the only incompatible feature of this assembly was some macros that could be easily expanded manually.
  • Loading branch information
andreasjhkarlsson committed Aug 31, 2015
1 parent 2b27630 commit da61fac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build:
$(CA) $(OBJDIR)/f_ibm_sh.rel $(SRCDIR)/f_ibm_sh.s
$(CA) $(OBJDIR)/f_italic.rel $(SRCDIR)/f_italic.s
$(CA) $(OBJDIR)/f_min.rel $(SRCDIR)/f_min.s
$(CA) $(OBJDIR)/font.rel $(SRCDIR)/font.s
$(CA) $(OBJDIR)/f_spect.rel $(SRCDIR)/f_spect.s
$(CA) $(OBJDIR)/get_bk_t.rel $(SRCDIR)/get_bk_t.s
$(CA) $(OBJDIR)/get_data.rel $(SRCDIR)/get_data.s
Expand Down
26 changes: 19 additions & 7 deletions libc/font.ms → libc/font.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
; Distrubuted under the Artistic License - see www.opensource.org
;
.include "global.s"
INCLUDE "wait_hbl.mh"

.globl .cr_curs
.globl .adv_curs
Expand Down Expand Up @@ -73,12 +72,16 @@ font_copy_uncompressed::
jr nz,1$
dec d
1$:
WAIT_HBL
ldh a,(.STAT)
bit 1,a
jr nz,#.-4
ld a,(bc)
ld (hl+),a
inc bc

WAIT_HBL
ldh a,(.STAT)
bit 1,a
jr nz,#.-4
ld a,(bc)
ld (hl),a
inc bc
Expand Down Expand Up @@ -151,10 +154,14 @@ font_copy_compressed_grey1:
xor c
ld c,a
font_copy_compressed_grey2:
WAIT_HBL
ldh a,(.STAT)
bit 1,a
jr nz,#.-4
ld (hl),b
inc hl
WAIT_HBL
ldh a,(.STAT)
bit 1,a
jr nz,#.-4
ld (hl),c
inc hl
ld a,h ; Take care of the 97FFF -> 8800 wrap around
Expand Down Expand Up @@ -402,7 +409,10 @@ set_char_no_encoding:
LD BC,#0x9800
ADD HL,BC

WAIT_HBL
ldh a,(.STAT)
bit 1,a
jr nz,#.-4

LD (HL),E
POP HL
POP DE
Expand Down Expand Up @@ -487,7 +497,9 @@ _cls::
1$:
LD D,#0x20 ; D = width
2$:
WAIT_HBL
ldh a,(.STAT)
bit 1,a
jr nz,#.-4

LD (HL),#.SPACE ; Always clear
INC HL
Expand Down
5 changes: 0 additions & 5 deletions libc/wait_hbl.mh

This file was deleted.

0 comments on commit da61fac

Please sign in to comment.