|
3 | 3 |
|
4 | 4 | .libraryAppVar "GRAPHX" ; Name of library on the calc |
5 | 5 | .libraryName "graphx" ; Name of library |
6 | | - .libraryVersion 7 ; Version information (1-255) |
| 6 | + .libraryVersion 8 ; Version information (1-255) |
7 | 7 |
|
8 | 8 | ;------------------------------------------------------------------------------- |
9 | 9 | ; v1 functions - Can no longer move/delete |
|
118 | 118 | .function "gfx_RotateScaleSprite",_RotateScaleSprite |
119 | 119 | .function "gfx_RotatedScaledTransparentSprite_NoClip",_RotatedScaledTransparentSprite_NoClip |
120 | 120 | .function "gfx_RotatedScaledSprite_NoClip",_RotatedScaledSprite_NoClip |
121 | | - |
| 121 | +;------------------------------------------------------------------------------- |
| 122 | +; v8 functions |
| 123 | +;------------------------------------------------------------------------------- |
| 124 | + .function "gfx_SetCharData",_SetCharData |
| 125 | + |
122 | 126 | .beginDependencies |
123 | 127 | .endDependencies |
124 | 128 |
|
@@ -3335,17 +3339,47 @@ _SetFontData: |
3335 | 3339 | ; arg0 : Pointer to font data |
3336 | 3340 | ; Set Pointer to NULL to use default font |
3337 | 3341 | ; Returns: |
3338 | | -; None |
| 3342 | +; Pointer to previous font data |
3339 | 3343 | pop de |
3340 | 3344 | pop hl |
3341 | 3345 | push hl ; hl -> custom font data |
3342 | 3346 | push de |
3343 | 3347 | add hl,de |
3344 | 3348 | or a,a |
3345 | 3349 | sbc hl,de |
| 3350 | + ld de,(TextData_ASM) \.r |
3346 | 3351 | jr nz,+_ ; if null make default font |
3347 | 3352 | ld hl,Char000 \.r |
3348 | 3353 | _: ld (TextData_ASM),hl \.r ; save pointer to custom font |
| 3354 | + ex de,hl |
| 3355 | + ret |
| 3356 | + |
| 3357 | +;------------------------------------------------------------------------------- |
| 3358 | +_SetCharData: |
| 3359 | +; Sets a custom font for a specific character |
| 3360 | +; Arguments: |
| 3361 | +; arg1 : Character index to change (0-127 or 0-255) |
| 3362 | +; arg0 : Pointer to character data; if null returns current data |
| 3363 | +; Returns: |
| 3364 | +; Pointer to character data if null, otherwise pointer to next character |
| 3365 | + ld iy,0 |
| 3366 | + add iy,sp |
| 3367 | + ld hl,(iy+6) ; de -> custom character data |
| 3368 | + add hl,de |
| 3369 | + or a,a |
| 3370 | + sbc hl,de ; sets z flag if null |
| 3371 | + ex de,hl |
| 3372 | + or a,a |
| 3373 | + sbc hl,hl |
| 3374 | + ld l,(iy+3) ; hl = index |
| 3375 | + add hl,hl |
| 3376 | + add hl,hl |
| 3377 | + add hl,hl |
| 3378 | + ld bc,(TextData_ASM) |
| 3379 | + add hl,bc |
| 3380 | + ret z |
| 3381 | + ld bc,8 |
| 3382 | + ldir |
3349 | 3383 | ret |
3350 | 3384 |
|
3351 | 3385 | ;------------------------------------------------------------------------------- |
|
0 commit comments