![]() |
Routines |
| Prev: A115 | Up: Map | Next: A170 |
|
Used by the routines at place_flicker_beam, dissolve_play_area, clear_play_area, print_string, set_direct_new, record_screen_address, draw_sprite_pair, copy_box_in, load_ore, toggle_carried_part, draw_carried_piece, draw_ship_image, draw_trail, side_jet, lift_jet, draw_bitmap, update_fuel_gauge, step_screen_address, fill_behind_moving_piece and fly_in_step.
The standard Spectrum screen-address calculation from a pixel position: L is x (0-255, its low three bits dropped) and H is y (0-191 from the top). Everything in the game that draws on the screen uses this.
|
||||||||||||||
| pixel_to_screen | A149 | LD A,L | The column, x divided by 8 | |||||||||||
| A14A | RRC A | |||||||||||||
| A14C | RRC A | |||||||||||||
| A14E | RRC A | |||||||||||||
| A150 | AND $1F | |||||||||||||
| A152 | LD L,A | |||||||||||||
| A153 | LD A,H | Bits 3-5 of y become bits 5-7 of the low byte | ||||||||||||
| A154 | RLC A | |||||||||||||
| A156 | RLC A | |||||||||||||
| A158 | AND $E0 | |||||||||||||
| A15A | OR L | |||||||||||||
| A15B | LD L,A | |||||||||||||
| A15C | LD A,H | Bits 0-2 of y are the pixel line within the cell | ||||||||||||
| A15D | AND $07 | |||||||||||||
| A15F | EX AF,AF' | |||||||||||||
| A160 | LD A,H | Bits 6-7 of y pick the third of the screen; combine with the pixel line | ||||||||||||
| A161 | RRC A | |||||||||||||
| A163 | RRC A | |||||||||||||
| A165 | RRC A | |||||||||||||
| A167 | AND $18 | |||||||||||||
| A169 | OR $40 | |||||||||||||
| A16B | LD H,A | |||||||||||||
| A16C | EX AF,AF' | |||||||||||||
| A16D | OR H | |||||||||||||
| A16E | LD H,A | |||||||||||||
| A16F | RET | |||||||||||||
| Prev: A115 | Up: Map | Next: A170 |