im looking for a zoom in routine
im looking for a zoom in routine
nothing on google. so you can select an area of the screen and zoom into it. or something that could expand a udg. any ideas?
i started programming the spectrum when i was 8 :-
1 plot rnd*255,rnd*175
2 goto 1
http://zxspeccy.great-site.net/
1 plot rnd*255,rnd*175
2 goto 1
http://zxspeccy.great-site.net/
- Cheez26
- Microbot
- Posts: 124
- Joined: Sat May 04, 2024 2:36 am
- Location: Midwestern United States
- Contact:
Re: im looking for a zoom in routine
Can you repeat that question with a bit more detail? Because I'm confused by what you mean by "zoom-in routine". Which software are you even using? Forgive me if I'm being blunt.
Chelsea E., a Speccy fan from the U.S.
Also a musician and a beginning games developer.
p r i d e
Also a musician and a beginning games developer.
p r i d e
- ParadigmShifter
- Dynamite Dan
- Posts: 1086
- Joined: Sat Sep 09, 2023 4:55 am
Re: im looking for a zoom in routine
If you only have a few size possibilities use a lookup table mapping bits to double/triple/quadruple bits. Then if that also needs shifting, shift each row into a temp buffer. Then draw each line of the buffer for zoom amount of rows.
Slower way is shifting the data out of A register and building the graphics depending on which bit is shifted out into carry flag.
Slower way is shifting the data out of A register and building the graphics depending on which bit is shifted out into carry flag.
Re: im looking for a zoom in routine
i mean an assembly language routine
i started programming the spectrum when i was 8 :-
1 plot rnd*255,rnd*175
2 goto 1
http://zxspeccy.great-site.net/
1 plot rnd*255,rnd*175
2 goto 1
http://zxspeccy.great-site.net/
- Cheez26
- Microbot
- Posts: 124
- Joined: Sat May 04, 2024 2:36 am
- Location: Midwestern United States
- Contact:
Re: im looking for a zoom in routine
Ah. I get it.
Unfortunately, Z80 assembly is not my strong suit unless if we're talking in-line of Boriel BASIC; even then, I'm still a noob at Boriel BASIC too. So, maybe take ParadigmShifter's advice instead.
Chelsea E., a Speccy fan from the U.S.
Also a musician and a beginning games developer.
p r i d e
Also a musician and a beginning games developer.
p r i d e
Re: im looking for a zoom in routine
You could use the Plot routine to do that (mentioned a bit earlier here).
You just need to derive from it a new routine that checks the bit at position in DE.
Then you can do this:
You just need to derive from it a new routine that checks the bit at position in DE.
Then you can do this:
Code: Select all
ld de, 0x0000 ; pixel pos where to check: (0,0) = top-left corner
ld hl, 0x0080 ; pixel pos where to draw: (0,128)
ld c, 15 ; #rows
NextRow:
ld b, 11 ; #bits per row
ld a, e
add b ; advance DE to end of row
ld e, a
ld a, l
add b
add b ; advance HL to end of row
ld l, a
NextBit:
dec e ; go 1 pixel to the left
dec l
dec l ; set Draw pos 2 pixels to the left
push hl
call CheckBitAtDE
pop hl ; restore Draw position
call nz PlotSquareAtHL ; plot a 2x2 square if the bit was set
djnz NextBit ; for all bits in row
inc d ; advance DE to next row
inc h
inc h ; advance HL to next row
dec c ; decrease the row counter
jr nz NextRow ; for all rows
Code: Select all
PlotSquareAtHL:
push de
ex de hl
inc e
call PlotAtDE ; plot at (y,x+1)
inc d
call PlotAtDE ; plot at (y+1,x+1)
dec e
call PlotAtDE ; plot at (y+1,x)
dec d
call PlotAtDE ; plot at (y,x)
ex de hl
pop de ; restore DE
ret
POKE 23614,10: STOP 1..0 hold, SS/m/n colors, b/spc toggle