8-bit

Converting 8 bit color into RGB value

我与影子孤独终老i 提交于 2019-11-30 07:38:00
问题 I'm implementing global illumination in my game engine with "reflective shadow maps". RSM has i.a. color texture. To save memory. I'm packing 24 bit value into 8 bit value. Ok. I know how to pack it. But how do I unpack it? I had idea to create a 1D texture with 8 bit palette, with 255 different colors. My 8 bit color would be index of pixel in that texture. I'm not sure how to generate this kind of texture. Are there any mathematical ways to convert 8 bit value into rgb? @edit The color is

tinyAVR: best known multiplication routines for 8-bit and 16-bit factors? [closed]

大城市里の小女人 提交于 2019-11-29 08:20:44
"Faster than avr200b.asm"? The mpy8u -routine from avr200b.asm for those processors of Atmel's AVR family that do not implement any of the MUL instructions seems pretty generic, but mpy16u looks sloppy for rotating both lower result bytes 16 times instead of 8. Antonio presented a fast 16×16→16 unsigned multiplication using 64 cycles worst case excluding call/return overhead. I arbitrarily suggest as optimisation goals worst case cycle count , word count (RAM and flash), register usage , and expected cycle count in order of decreasing priority. (There are reduced core AVRs ("single digit"

Converting 8 bit color into RGB value

∥☆過路亽.° 提交于 2019-11-29 04:38:27
I'm implementing global illumination in my game engine with "reflective shadow maps". RSM has i.a. color texture. To save memory. I'm packing 24 bit value into 8 bit value. Ok. I know how to pack it. But how do I unpack it? I had idea to create a 1D texture with 8 bit palette, with 255 different colors. My 8 bit color would be index of pixel in that texture. I'm not sure how to generate this kind of texture. Are there any mathematical ways to convert 8 bit value into rgb? @edit The color is in this format: RRR GGG BB @edit2: And I'm packing my colour like this: int packed = (red / 32 << 5) +

How do 8-bit and 16-bit processors access more RAM with two registers?

依然范特西╮ 提交于 2019-11-27 07:57:49
问题 Something that has always confused me is how 8-bit computers access more than 256 bytes of RAM. I know that it must use two registers, but can any one show me an example of what this would look like in assembly code? Like: mov a, [x] ??? 回答1: Let's imagine we have LOWER and HIGHER 8bit half of the address in registers L and H. For example, we want to read byte from address 32770 dec = 8002 hex. mov l, 02h ;lower byte of address mov h, 80h ;higher byte of address mov a, [hl] ;a <-- [h*256 + l]