;; #LAYOUT# STD * #TAKE ;; #LAYOUT# CRT BASIC_0 #TAKE ;; #LAYOUT# CRT BASIC_1 #TAKE-FLOAT ;; #LAYOUT# M65 BASIC_0 #TAKE ;; #LAYOUT# M65 BASIC_1 #TAKE-FLOAT ;; #LAYOUT# X16 BASIC_0 #TAKE-OFFSET 2000 ;; #LAYOUT# * * #IGNORE ; ; Well-known BASIC routine, described in: ; ; - [CM64] Computes Mapping the Commodore 64 - page 95 ; - https://www.lemon64.com/forum/viewtopic.php?t=64721&sid=bc400a5a6d404f8f092e4d32a92f5de7 ; LINKPRG: !ifdef SEGMENT_M65_BASIC_0 { jsr map_BASIC_1 jsr (VB1__LINKPRG) jmp map_NORMAL } else ifdef SEGMENT_CRT_BASIC_0 { jsr map_BASIC_1 jsr JB1__LINKPRG jmp map_NORMAL } else { ; Start by getting pointer to the first line jsr init_oldtxt linkprg_loop: ; Is the pointer to the end of the program ldy #1 !ifdef CONFIG_MB_M65 { jsr peek_via_OLDTXT } else ifdef ROM_LAYOUT_CRT { jsr peek_via_OLDTXT } else ifdef CONFIG_MEMORY_MODEL_60K { ldx #