Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Draw Shape Opcode:
- ;
- ; Bits 7 & 6 - 00: Unknown
- ; 01: Draw sprite shape
- ; 1X: Draw background shape
- ;
- ; When drawing a background shape:
- ; Bits 6 - 0 - High 7 bits of the shape address
- ;
- ; When drawing a sprite shape:
- ; Bits 5 & 4 - 00: X coordinate is 16-bits immediate (BE)
- ; 01: Read X coordinate from memory indicated by 8-bit immediate
- ; 10: X coordinate is 8-bit immediate
- ; 11: X coordinate is 8-bit immediate + 256
- ;
- ; Bits 3 & 2 - 00: Y coordinate is 16-bits immediate (BE)
- ; 01: Read Y coordinate from memory indicated by 8-bit immediate
- ; 10: Y coordinate is 8-bit immediate
- ; 11: Unknown
- ;
- ; Bits 1 & 0 - 00: Zoom is 64
- ; 01: Read Zoom from memory indicated by 8-bit immediate
- ; 10: Zoom is 8-bit immediate
- ; 11: Shape to draw is from shared shapes. Zoom is 64
- ;
- ; Operand bytes:
- ; - u16 (offset >> 1)
- ; - u8 or u16 (x)
- ; - u8 or u16 (y)
- ; - u8 zoom (optional)
- ;
- ; Instruction Format:
- ; draw_sprite_shape from_shared (0 | 1), offset (u16), x (u8 | [u8] | u16 | u16 < 512), y (u8 | [u8] | u16), zoom (u8 | [u8] | 64)
- ;
- ; Examples:
- ; draw_sprite_shape 1, 0x0cba, [0x01], [0x02], 64
- ; draw_sprite_shape 0, 0xde5c, 0x104, [0x34], [0x04]
- draw_sprite_shape {from_shared}, {offset: u16}, [{x: u8}], [{y: u8}], {z: u8} => {
- assert(from_shared == 0)
- assert(z == 64)
- 0b01 @ 0b01 @ 0b01 @ 0b00 @ (offset >> 1)`16 @ x`8 @ y`8
- }
- draw_sprite_shape {from_shared}, {offset: u16}, [{x: u8}], [{y: u8}], [{z: u8}] => {
- assert(from_shared == 0)
- 0b01 @ 0b01 @ 0b01 @ 0b01 @ (offset >> 1)`16 @ x`8 @ y`8 @ z`8
- }
- draw_sprite_shape {from_shared}, {offset: u16}, [{x: u8}], [{y: u8}], {z: u8} => {
- assert(from_shared == 1)
- assert(z == 64)
- 0b01 @ 0b01 @ 0b01 @ 0b11 @ (offset >> 1)`16 @ x`8 @ y`8
- }
- draw_sprite_shape {from_shared}, {offset: u16}, [{x: u8}], {y: u8}, {z: u8} => {
- assert(from_shared == 0)
- assert(z == 64)
- 0b01 @ 0b01 @ 0b10 @ 0b00 @ (offset >> 1)`16 @ x`8 @ y`8
- }
- draw_sprite_shape {from_shared}, {offset: u16}, [{x: u8}], {y: u8}, [{z: u8}] => {
- assert(from_shared == 0)
- 0b01 @ 0b01 @ 0b10 @ 0b01 @ (offset >> 1)`16 @ x`8 @ y`8 @ z`8
- }
- etc....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement