Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blog:x68_devcode [2020/07/12 15:06] – [TVRAM Operations] john | blog:x68_devcode [2020/08/07 21:22] (current) – [X68000 C Code Examples] john | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== X68000 C Code Examples ====== | + | ====== |
Here are some example code listings to compile and run on the Sharp X68000. They demonstrate how to use some of the built-in system calls. | Here are some example code listings to compile and run on the Sharp X68000. They demonstrate how to use some of the built-in system calls. | ||
Line 1520: | Line 1520: | ||
Writing a 16bit value to // | Writing a 16bit value to // | ||
+ | |||
+ | For example; suppose you write the 16bit value 0xFFFF (bits: 1111111111111111), | ||
+ | |||
+ | {{: | ||
+ | |||
+ | If you write the value 0xAAAA (a pattern of: 1010101010101010) to 0xE00000 you instead get an alternating pattern of pixels on and off: | ||
+ | |||
+ | {{: | ||
Writing another 16bit value to 0xE20000, 0xE40000 and 0xE60000 will result in the bit patterns being overlaid and generating a different colour for those first 16 pixels. | Writing another 16bit value to 0xE20000, 0xE40000 and 0xE60000 will result in the bit patterns being overlaid and generating a different colour for those first 16 pixels. | ||
+ | |||
+ | Using this planar arrangement means you only need to write 64 x 16bit words to set every pixel in a row to be on or off... of course if you want them to be different colours you then need to write other patterns to the other text planes. It's swings and roundabouts to trade off. | ||
TO-DO - further explanation of how the colour of the pixels is determined (palette lookup). | TO-DO - further explanation of how the colour of the pixels is determined (palette lookup). |