File tree Expand file tree Collapse file tree 1 file changed +14
-27
lines changed Expand file tree Collapse file tree 1 file changed +14
-27
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,7 @@ gfx_GetPixel:
528
528
inc hl
529
529
inc hl ; hl = &y
530
530
ld e , (hl) ; e = y
531
+ _GetPixel:
531
532
ld d , LcdWidth/ 2
532
533
mlt de ; de = y * (lcdWidth / 2)
533
534
ld hl , (CurrentBuffer) ; hl = buffer
@@ -560,8 +561,18 @@ gfx_SetPixel:
560
561
add hl , de ; move to next argument
561
562
ld e , (hl) ; e = y coordinate
562
563
_SetPixel:
563
- call _PixelPtr
564
- ret c ; return if out of bounds
564
+ ld hl ,- LcdWidth
565
+ add hl , bc
566
+ ret c ; return if out of bounds
567
+ ld hl ,- LcdHeight
568
+ add hl , de
569
+ ret c ; return if out of bounds
570
+ ld hl , (CurrentBuffer)
571
+ add hl , bc
572
+ ld d , LcdWidth/ 2
573
+ mlt de
574
+ add hl , de
575
+ add hl , de
565
576
ld (hl) , 0 ; get the actual pixel
566
577
Color_1 = $ - 1
567
578
ret
@@ -4796,8 +4807,7 @@ gfx_FloodFill:
4796
4807
4797
4808
ld e , (ix + 9 )
4798
4809
ld bc , (ix + 6 )
4799
- call _PixelPtrNoChecks ; ov = p(x, y);
4800
- ld a , (hl)
4810
+ call _GetPixel ; ov = p(x, y);
4801
4811
4802
4812
ld (.oldcolor0) , a
4803
4813
ld (.oldcolor1) , a
@@ -5689,29 +5699,6 @@ _LZ_ReadVarSize:
5689
5699
pop ix
5690
5700
ret
5691
5701
5692
- ;-------------------------------------------------------------------------------
5693
- _PixelPtr:
5694
- ; Gets the address of a pixel
5695
- ; Inputs:
5696
- ; BC=X
5697
- ; E=Y
5698
- ; Outputs:
5699
- ; HL->address of pixel
5700
- ld hl ,- LcdWidth
5701
- add hl , bc
5702
- ret c
5703
- ld hl ,- LcdHeight
5704
- add hl , de
5705
- ret c
5706
- _PixelPtrNoChecks:
5707
- ld hl , (CurrentBuffer)
5708
- add hl , bc
5709
- ld d , LcdWidth/ 2
5710
- mlt de
5711
- add hl , de
5712
- add hl , de
5713
- ret
5714
-
5715
5702
;-------------------------------------------------------------------------------
5716
5703
_Maximum:
5717
5704
; Calculate the resut of a signed comparison
You can’t perform that action at this time.
0 commit comments