Skip to content

Commit

Permalink
fix #113
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoconlechuga committed Jun 8, 2019
1 parent 4503ace commit 82c5efa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/edit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ error_offset := $-3
.goto_new_line:
ld hl,(ti.editCursor)
ld a,(hl)
cp a,$3f
cp a,ti.tEnter
jr z,.goto_new_line_back
.loop:
ld a,(hl)
Expand All @@ -170,7 +170,7 @@ error_offset := $-3
pop de
jr z,.goto_new_line_back
ld a,d
cp a,$3f
cp a,ti.tEnter
jr z,.goto_new_line_next
.goto_new_line_back:
call ti.BufLeft
Expand Down
46 changes: 41 additions & 5 deletions src/hooks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ hook_show_labels:
or a,a
jr nz,.backup
ld a,e
cp a,$3f
cp a,ti.tEnter
jr nz,.backup
call ti.BufRight
.done:
Expand Down Expand Up @@ -301,8 +301,8 @@ hook_show_labels:
pop hl
ret z
ld a,d
cp a,ti.t2ByteTok
jr z,.parse_labels
or a,a
jr nz,.parse_labels
ld a,e
cp a,ti.tLbl
jr nz,.parse_labels
Expand All @@ -316,8 +316,14 @@ hook_show_labels:
jr z,.added_label
cp a,ti.tEnter
jr z,.added_label
ld a,d
or a,a
jr z,.single
ld (hl),a
inc hl
.single:
ld (hl),e
inc hl
jr .add_label
.added_label:
xor a,a
Expand All @@ -330,14 +336,44 @@ hook_show_labels:
call ti.PutC
ld hl,label_name
push hl
call ti.PutS
.displayline:
ld a,(hl)
or a,a
jr z,.leftedge
inc hl
call ti.Isa2ByteTok
ld d,0
jr nz,.singlebyte
.multibyte:
ld d,a
ld e,(hl)
inc hl
jr .getstring
.singlebyte:
ld e,a
.getstring:
push hl
call ti.GetTokString
ld b,(hl)
inc hl
.loopdisplay:
ld a,(ti.curCol)
cp a,$19
jr z,.leftedge
ld a,(hl)
inc hl
call ti.PutC
djnz .loopdisplay
pop hl
jr .displayline
.leftedge:
ld a,(ti.curRow)
inc a
ld (ti.curRow),a
cp a,10
pop hl
ret z
jr .parse_labels
jp .parse_labels

.computepageoffsethl:
push bc
Expand Down

0 comments on commit 82c5efa

Please sign in to comment.