Lab - 1: Modifications and Experiments
Modifications and Experiments
Changing color to Light Blue
To change the color, I replaced lda #$07 (yellow) with lda #$06 (light blue). The emulator provides a full-color reference table, making this an easy modification.
Different Color for each page
To add variety, I used different colors for each quarter of the screen:
Randomizing Pixel Colors
By integrating a pseudo-random number generator (PRNG) from the 6502 Emulator page, I assigned a random color to each pixel, creating a vibrant, chaotic display.
Advanced Experiments
Adding TYA Before STA ($40), Y
Effect
- The screen will show a gradient instead of a single color.
- Since
TYAloadsYintoA, the stored value changes asYincrements. - This results in 256 different colors across a page, depending on how the emulator maps colors.
Adding LSR after TYA
Effect
- The screen still shows a gradient but with fewer unique colors.
LSR reduces the range of stored values, making colors repeat more frequently.- The total number of colors is reduced to 128, since
LSR halves each value.
Using Multiple LSR Instructions
- The screen still shows a gradient but with fewer unique colors.
LSRreduces the range of stored values, making colors repeat more frequently.- The total number of colors is reduced to 128, since
LSRhalves each value.
Try 2, 3, 4, or 5 LSR in a row.
LSR in a row.Effect
- With 3
LSR, the color range is now 32 unique colors. - More shifts (e.g., 5
LSR) would reduce to 8 colors or even fewer.
Using ASL Instead of LSR
- With 3
LSR, the color range is now 32 unique colors. - More shifts (e.g., 5
LSR) would reduce to 8 colors or even fewer.
Effect
ASL increases the brightness range instead of reducing it.- The values overflow quickly, creating sharp transitions between colors.
- This can result in more rapid color changes compared to
LSR.
Testing Multiple INY Instructions
ASLincreases the brightness range instead of reducing it.- The values overflow quickly, creating sharp transitions between colors.
- This can result in more rapid color changes compared to
LSR.
Try replacing
INY with two, three, or five consecutive INY commands.Effect
- The pattern becomes less detailed, as pixels get skipped.
- 3
INYresults in every third pixel being colored, creating vertical stripes. - 5
INYmakes the gaps even larger.
We pushed the boundaries of our 6502 assembly knowledge, tweaking code, testing new instructions, and seeing the magic happen in real-time. But are you ready for a challenge? In the next post, we’ll take things up a notch with a tricky but fun assembly problem to solve. Think you can crack it? Let’s find out!
Comments
Post a Comment