Skip to content

Commit ef9f38c

Browse files
committed
Bump fn-lib version. Capture screen to ascii
1 parent 707df7a commit ef9f38c

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

makefiles/custom-atari.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ DISKZ_FILE := $(DIST_DIR)/$(PROGRAM)-z.atr
6060
# At the current time, ATARI800 does not have any integration with fujinet
6161

6262
ALTIRRA ?= $(ALTIRRA_HOME)/Altirra64.exe \
63-
$(XS)/portable $(XS)/portablealt:altirra-debug.ini \
63+
$(XS)/portable $(XS)/portablealt:altirra-basic.ini \
6464
$(XS)/debug \
6565
$(XS)/debugcmd: ".loadsym build\$(PROGRAM_TGT).lbl" \
6666

makefiles/fujinet-lib.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FUJINET_LIB_VERSION := 4.5.0
1+
FUJINET_LIB_VERSION := 4.7.2
22

33
FUJINET_LIB = _libs
44
# is target correct, or platform? eg. atarixl vs atari, pet vs c64 vs commodore

src/atari/common/screen/ascii_to_code.s

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.export ascii_to_code
2+
.export _code_to_ascii
23

34
; common routine to convert ascii code in A into internal code for screen
45
; from cc65/libsrc/atari/cputc.s
@@ -11,4 +12,40 @@ codeok: lsr a ; undo the shift
1112
bcc :+
1213
eor #$80 ; restore the inverse bit
1314
: rts
14-
.endproc
15+
.endproc
16+
17+
;;; char code_to_ascii(char c)
18+
;;;
19+
;;; Convert a screen code to an ASCII character.
20+
;;;
21+
;;; Input: A - Screen code
22+
;;; Output: A - ASCII character
23+
24+
; I wrote this with pencil and paper to check the bits.
25+
; logically: A between 0-63 add 32, between 64-95 sub 64, 96-127 do nothing.
26+
; Same for 127+ bit, just preserve inverse bit.
27+
28+
.proc _code_to_ascii
29+
asl a ; capture inverse bit in c
30+
adc #$00 ; move inverse bit into bit 0 while we test top bits
31+
32+
clc
33+
bpl under_64
34+
35+
; for range 64-95, subtract 64.
36+
; for range 96-127, do nothing.
37+
adc #$c0 ; manipluate the top bits to check what range we are in
38+
eor #$40 ; wrt original A: range 64-95 it flips bit 6 to 0, 96-127 it flips bit 6 to 1
39+
40+
reset_inverse_bit:
41+
lsr a
42+
bcc :+
43+
eor #$80 ; restore the inverse bit
44+
: rts
45+
46+
under_64:
47+
; add 32 to the original A, the value will be shifted so we add 64 pre-shift
48+
adc #$40
49+
bcc reset_inverse_bit
50+
51+
.endproc

src/atari/full/screen/mod_screen_data.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ mx_pref_edit_help:
204204

205205
NORMAL_CHARMAP
206206
mx_k_app_name: .byte "Config-NG", 0
207-
mx_v_app_name: .byte "(c) 2024 Fenrock", 0
207+
mx_v_app_name: .byte "(c) 2025 Fenrock", 0
208208

209209
mx_k_version: .byte "Version", 0
210210

0 commit comments

Comments
 (0)