@@ -2950,26 +2950,6 @@ gfx_SetFontHeight:
2950
2950
; Previous font height
2951
2951
setSmcBytes _TextHeight
2952
2952
2953
- ;-------------------------------------------------------------------------------
2954
- _PrintStringXY_Clip:
2955
- ; Places a string at the given coordinates
2956
- ; Arguments:
2957
- ; arg0 : Pointer to string
2958
- ; arg1 : Text X Pos
2959
- ; arg2 : Text Y Pos
2960
- ; Returns:
2961
- ; None
2962
- ld iy , 3
2963
- lea bc , iy
2964
- add iy , sp
2965
- lea hl , iy + 3
2966
- ld de , _TextXPos
2967
- ldir ; copy in the y location
2968
- ld hl , (hl)
2969
- ld (_TextYPos) , hl ; set new y pos
2970
- ld hl , (iy)
2971
- jr _DrawCharacters ; jump to the main string handler
2972
-
2973
2953
;-------------------------------------------------------------------------------
2974
2954
gfx_PrintStringXY:
2975
2955
; Places a string at the given coordinates
@@ -2979,21 +2959,12 @@ gfx_PrintStringXY:
2979
2959
; arg2 : Text Y Pos
2980
2960
; Returns:
2981
2961
; None
2982
- jp _PrintStringXY
2983
- __PrintStringXY = $ - 3
2984
- _PrintStringXY:
2985
- ld hl , 9
2986
- add hl , sp
2987
- ld a , (hl)
2988
- ld (_TextYPos) , a
2989
- dec hl
2990
- dec hl
2991
- ld de , _TextXPos + 1
2992
- ldd
2993
- ldd
2994
- dec hl
2995
- dec hl
2996
- ld hl , (hl)
2962
+ pop iy ; iy = return vector
2963
+ pop bc ; bc = str
2964
+ call gfx_SetTextXY
2965
+ push bc
2966
+ ex ( sp ) , hl ; hl = str
2967
+ push iy
2997
2968
; jr _DrawCharacters ; emulated by dummifying next instructions:
2998
2969
db $ 01 ; pop de \ ex (sp),hl \ push de -> ld bc,*
2999
2970
@@ -3064,35 +3035,18 @@ gfx_SetTextConfig:
3064
3035
; arg0 : Configuration numbers
3065
3036
; Returns:
3066
3037
; None
3067
- pop hl
3068
3038
pop de
3039
+ ex ( sp ) , hl ; hl = config
3069
3040
push de
3070
- push hl
3071
- ld a , e ; a = argument
3072
- dec a ; 1 = TEXT_CLIP
3073
- jr z , .setcliptext
3074
- dec a ; 2 = TEXT_NOCLIP
3075
- ret nz
3076
- ld de , _PrintChar
3077
- ld bc , _PrintStringXY
3078
- jr .setunclippedtext ; set unclipped character routine
3079
- .setcliptext:
3080
- ld de , _PrintChar_Clip
3081
- ld bc , _PrintStringXY_Clip
3082
- .setunclippedtext:
3083
- ld hl , PrintChar_0
3084
- ld (hl) , de ; holy crap what a hack
3085
- ld hl , PrintChar_1
3086
- ld (hl) , de
3087
- ld hl , PrintChar_2
3088
- ld (hl) , de ; modify all the interal routines to use the clipped text routine
3089
- push bc
3090
- pop hl
3091
- ld (__PrintStringXY) , hl ; change which text routines we want to use
3092
- xor a , a
3093
- sbc hl , hl
3094
- ld (_TextYPos) , hl
3095
- ld (_TextXPos) , hl ; reset the current posistions
3041
+ dec l ; l = config - 1
3042
+ ld hl , _PrintChar_Clip
3043
+ jr z , .writesmc ; z ==> config == gfx_text_clip
3044
+ ; config == gfx_text_noclip
3045
+ ld hl , _PrintChar
3046
+ .writesmc: ; hl = PrintChar routine
3047
+ ld (PrintChar_0) , hl
3048
+ ld (PrintChar_1) , hl
3049
+ ld (PrintChar_2) , hl
3096
3050
ret
3097
3051
3098
3052
;-------------------------------------------------------------------------------
0 commit comments