- Christmas Tree project
- 18 Dec 2015 02:37:40 pm
- Last edited by Caleb_J on 14 Jan 2016 10:16:53 am; edited 5 times in total
Note: In ALL posts, if it's red, I have not started on it yet. If it's yellow, I'm working on it. If it's green, that means it's solved.
All right then. I was hoping that I could keep this a secret, and have a surprise for everyone for New years, but I can't hide it anymore.
It's a ASM program that simply draws a green Christmas tree on the screen and has color-changing lights. So far, I've worked out the colors that I want it to be(here they are), and I know how to make a specific pixel a specific color, as illustrated by Kerm here:
Code:
My problems are:
And a question: Does eZ80 need a loop like TI-Basic does? Because with basic, there has to be a Repeat or a While if you want the commands to execute more than once. Also, would it be better to have it in 16bpp mode, or 8bpp mode?
EDIT: Looking at the above code, I just realized that I would have to write each block of code HUNDREDS of times to get each light to be every color that I want it to be. Is there a simpler/shorter way to write the above code? This way, I wouldn't have to write hundreds of blocks of code. To be specific, I don't want to have to write a individual block of code for each pixel, for each color. Because if I have 100 pixels that change color, and 100 colors, that works out to 50,000 lines of code, which is not counting setup, or drawing a green tree, or anything else. I think there's a better way to do this, rather than writing... well, you know.
To do list (so far)
All right then. I was hoping that I could keep this a secret, and have a surprise for everyone for New years, but I can't hide it anymore.
It's a ASM program that simply draws a green Christmas tree on the screen and has color-changing lights. So far, I've worked out the colors that I want it to be(here they are), and I know how to make a specific pixel a specific color, as illustrated by Kerm here:
KermMartian wrote:
Code:
ld de,$ffff ; white
ld hl,VRAM + (0 * 320 ) + (0 * 2)
ld (hl),e
inc hl
ld (hl),d
ld de,$0000 ; black
ld hl,VRAM + (239 * 320) + (319 * 2)
ld (hl),e
inc hl
ld (hl),d
call _getkey
Ret
My problems are:
1. Getting a actual tree onto the screen.
2. Getting the program to exit on the press of any key
3. I might have to put a delay in here. Just to make sure that the lights on the tree aren't going so fast that you can barely tell what color each light is.
And a question: Does eZ80 need a loop like TI-Basic does? Because with basic, there has to be a Repeat or a While if you want the commands to execute more than once. Also, would it be better to have it in 16bpp mode, or 8bpp mode?
EDIT: Looking at the above code, I just realized that I would have to write each block of code HUNDREDS of times to get each light to be every color that I want it to be. Is there a simpler/shorter way to write the above code? This way, I wouldn't have to write hundreds of blocks of code. To be specific, I don't want to have to write a individual block of code for each pixel, for each color. Because if I have 100 pixels that change color, and 100 colors, that works out to 50,000 lines of code, which is not counting setup, or drawing a green tree, or anything else. I think there's a better way to do this, rather than writing... well, you know.
To do list (so far)
- 1. Figure out how to write a sprite routine.
2. Get a pixel onscreen.
3. Get that pixel to change color
4. Get a bunch of pixels to change color