Posts

Showing posts from February, 2025

Lab - 2: Optional Challenges

  Exploring 6502 Assembly: Mob Programming & Bouncing Ball Experiment Introduction I used 6502 Assembly Language to create a bouncing ball simulation for Lab 2 in SPO600. Mob programming, a cooperative method where several people work together on a single coding task, was introduced in this lab. Understanding low-level programming, working with registers and memory, and adding additional features to an already-existing bouncing ball simulation were the objectives. I'll describe the following in this blog: ✅ The bouncing ball's basic implementation; ✅ The code's operation and output. ✅ Difficulties and Improvements (e.g., randomized bounces, fractional movements). ✅ My thoughts and experiences with Assembly programming. Base Implementation: The 6502 Assembly's Bouncing Ball The objective was to construct a simulation of a bouncing ball that moves predictably and reverses course when it strikes the corners of the screen. The code that carries out this behaviour is sho...

Lab - 2 In-Class: Mob Programming

Introduction Here, I learned a code in this lab that draws an O picture on a bitmap that is now moving diagonally. The assignment is to make the O picture bounce off a wall permanently. Students are given the code below: ; ; draw-image-subroutine.6502 ; ; This is a routine that can place an arbitrary ; rectangular image on to the screen at given ; coordinates. ; ; Chris Tyler 2024-09-17 ; Licensed under GPLv2+ ; ; ; The subroutine is below starting at the ; label "DRAW:" ; ; Test code for our subroutine ; Moves an image diagonally across the screen ; Zero-page variables define XPOS $20 define YPOS $21 ; Set up the data structure ; The syntax #<LABEL returns the low byte of LABEL ; The syntax #>LABEL returns the high byte of LABEL LDA #<G_X ; POINTER TO GRAPHIC STA $10 LDA #>G_X STA $11 LDA #$05 STA $12 ; IMAGE WIDTH STA $13 ; IMAGE HEIGHT ; Set initial position X=Y=0 LDA #$00 STA XPOS STA YPOS ; Main loop for diagonal animation MAINLOOP: ...

Lab - 1: Optional Challenge

Image
  Optional Challenge: Drawing Border I went further and attempted the  border-drawing challenge : Red line (Top):   lda #$02  and writing to the first row of memory. Green line (Bottom):  Writing to the last row. Blue line (Right):  Iterating through column memory. Purple line (Left):  Adjusting X and Y registers accordingly. This exercise reinforced structured bitmap manipulation.

Lab - 1: Modifications and Experiments

Image
  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 .