Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mode flags such as M_NO_SCROLL being discarded when setting M_TEXT_OUT #630

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gbdk-lib/libc/targets/mos6502/font.s
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ _posy::
.tmode_out::
;; Clear screen
jsr .cls_no_reset_pos
lda #.T_MODE
lda .mode
AND #.S_M_MASK
ORA #.T_MODE
sta .mode
rts
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/mos6502/nes/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Table of routines for modes
.MODE_TABLE = 0xFFE0
Expand Down
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/sm83/ap/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Status codes for IO
.IO_IDLE = 0x00
Expand Down
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/sm83/duck/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Status codes for IO
.IO_IDLE = 0x00
Expand Down
4 changes: 3 additions & 1 deletion gbdk-lib/libc/targets/sm83/font.s
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ _posy::
;; Clear screen
CALL .cls_no_reset_pos

LD A,#.T_MODE
LD A,(.mode)
AND #.S_M_MASK
OR #.T_MODE
LD (.mode),A

RET
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/sm83/gb/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Status codes for IO
.IO_IDLE = 0x00
Expand Down
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/z80/gg/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Screen dimentions in tiles

Expand Down
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/z80/msxdos/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Screen dimentions in tiles

Expand Down
2 changes: 2 additions & 0 deletions gbdk-lib/libc/targets/z80/sms/global.s
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@
.T_MODE = 0x02 ; Text mode (bit 2)
.T_MODE_OUT = 0x02 ; Text mode output only
.T_MODE_INOUT = 0x03 ; Text mode with input
.S_MODE_MASK = 0x03 ; Mask screen modes above
.M_NO_SCROLL = 0x04 ; Disables scrolling of the screen in text mode
.M_NO_INTERP = 0x08 ; Disables special character interpretation
.S_M_MASK = 0x0C ; Mask special modes above

;; Screen dimentions in tiles

Expand Down