Slordax 0.8A RELEASED
Moderator: MaxCoderz Staff
Scrolling backgrounds...I like the sound of that. There's a little-known TI-82 game called Alpha-10 that made some really nice use of scrolling backdrops. Okay--so it got a bad review from Sam Heald, but I really liked the parallex illusion; it created a good sense of altitude and speed.
If you wanted to go one further, you could try doing just a little side-scrolling as the player manuvers left and right. Just implement it using bit shift and rotate instructions. Then sit back and watch those beta-testers pivot in their chairs against those imaginary G-forces.
If you wanted to go one further, you could try doing just a little side-scrolling as the player manuvers left and right. Just implement it using bit shift and rotate instructions. Then sit back and watch those beta-testers pivot in their chairs against those imaginary G-forces.
My diet consists of nails, code-stealers, and HP fans.
Projects:
Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
Projects:
Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
bit shift?DigiTan wrote: If you wanted to go one further, you could try doing just a little side-scrolling as the player manuvers left and right. Just implement it using bit shift and rotate instructions. Then sit back and watch those beta-testers pivot in their chairs against those imaginary G-forces.
rotate?
i still cant do a _PointOn =(
Life is getting better.
Mainly, it's just a useful way to side-scroll without a tilemap. In Alpha-10, the programmer used a bitmapped background and added ldi commands to scroll the "terrian" image down. What I'm saying is you can do a similar horizontal effect by rotating the bitmap left and right with the shop--as well as vertically like Alpha-10 does.
The (unoptimised) code below will do this. If you declare HL as a pointer to part of your display mem, it will rotate every pixel on that row left 1 pixel--giving the illusion of strafing to the right. Of course, the same thing can be done for right-scrolling.
Also, if used in the context below, the ROTATE code will move the entire screen. And unlike the hardware scroll, it won't leave a white gap at the edge of the screen. It's in 82 ASM, but the concept pretty much applies across the board...
The (unoptimised) code below will do this. If you declare HL as a pointer to part of your display mem, it will rotate every pixel on that row left 1 pixel--giving the illusion of strafing to the right. Of course, the same thing can be done for right-scrolling.
Code: Select all
RIGHT_ROTATE: ; Special thanks to CrASH_Man
push hl
SLA (HL) ; 96-bit shift left
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
RL (HL)
DEC HL
pop hl
ret nc
ld a,(hl)
or %00000001
ld (hl),a
ret
Code: Select all
scroller_loop1:
ld b,64 ; Picture is 64 pixels high
ld hl,GRAPH_MEM+767 ; Start at end of picture and move backwards
scroller_loop0:
call RIGHT_ROTATE ; Rotate the row by 1 pixel
dec hl ; Move up one row...
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
djnz scroller_loop0 ; Loop until all 16 row are rotated
call CR_GRBCopy ; Refresh the picture
...
jr scroller_loop1
My diet consists of nails, code-stealers, and HP fans.
Projects:
Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
Projects:
Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
I cant do that yet.DigiTan wrote:Mainly, it's just a useful way to side-scroll without a tilemap. In Alpha-10, the programmer used a bitmapped background and added ldi commands to scroll the "terrian" image down. What I'm saying is you can do a similar horizontal effect by rotating the bitmap left and right with the shop--as well as vertically like Alpha-10 does.
The (unoptimised) code below will do this. If you declare HL as a pointer to part of your display mem, it will rotate every pixel on that row left 1 pixel--giving the illusion of strafing to the right. Of course, the same thing can be done for right-scrolling.
gimme some time
i am still fighting with loops
Life is getting better.
Well, I guess it's not too important to add that now. If you decide to, just use the code above.
My diet consists of nails, code-stealers, and HP fans.
Projects:
Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
Projects:
Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.
- Shadow Phoenix
- Calc Guru
- Posts: 835
- Joined: Mon 03 Jan, 2005 7:54 pm
- Location: out there. seriosly.