notes:comporg
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:comporg [2022/03/13 13:17] – Added new section about scanlines and memory. smalik3 | notes:comporg [2022/04/18 11:33] (current) – [Mouse] mpronti2 | ||
---|---|---|---|
Line 14: | Line 14: | ||
=====Working with Memory in TIC80===== | =====Working with Memory in TIC80===== | ||
- | ===Persistent Memory=== | + | ====Persistent Memory==== |
In order to change part of persistent memory, the process begins as normal for any other piece of memory - `poke(addr, data, size)`. However, making persistent changes to the cart is a special case - since the cart is loaded into RAM (virtually and in reality) when it is run, changes made to its memory will only apply as long as it is being run, meaning something else needs to happen in order to, say, make a visual change to the editor. After making a change to the cart, the `sync()` function must be called, specifically `sync(0, 0, true)`, which breaks down into: sync(sector bitmask, bank, tocart) - in our case, sync all (0) sectors to bank zero (0), and apply the changes to the cart (true). | In order to change part of persistent memory, the process begins as normal for any other piece of memory - `poke(addr, data, size)`. However, making persistent changes to the cart is a special case - since the cart is loaded into RAM (virtually and in reality) when it is run, changes made to its memory will only apply as long as it is being run, meaning something else needs to happen in order to, say, make a visual change to the editor. After making a change to the cart, the `sync()` function must be called, specifically `sync(0, 0, true)`, which breaks down into: sync(sector bitmask, bank, tocart) - in our case, sync all (0) sectors to bank zero (0), and apply the changes to the cart (true). | ||
Line 24: | Line 24: | ||
It is currently understood that there is 1 kilobyte of persistent memory stored at offset 0x14004 (remember ' | It is currently understood that there is 1 kilobyte of persistent memory stored at offset 0x14004 (remember ' | ||
- | ===Scanlines=== | + | ====Scanlines==== |
TIC-80 renders the pixels on its screen using scanlines. The concept is straightforward, | TIC-80 renders the pixels on its screen using scanlines. The concept is straightforward, | ||
Line 36: | Line 36: | ||
One simply has to put this function somewhere in their script, it is similar to the main function ' | One simply has to put this function somewhere in their script, it is similar to the main function ' | ||
+ | =====TIC-80 Functions===== | ||
+ | |||
+ | ====Map==== | ||
+ | |||
+ | If you choose to go the TIC-80 route from week 8 onwards, you may find it beneficial to play with the map. mset(), mget(), and map() are important tools for such an endeavor. You can use combinations of these functions to, for example, manage player collisions with environment(s). You can also use map() in addition to SCN() to display a colorful, fulfilling background without the need to manually display a bunch of sprites. | ||
+ | |||
+ | ====Audio==== | ||
+ | |||
+ | The sfx() function within TIC-80 can be used to play audio from the SFX Editor. It can adjust the note, duration, volume, etc. | ||
+ | |||
+ | ====Mouse==== | ||
+ | |||
+ | mouse() returns, among others, 3 important things: the x-coordinate of the pointer, the y-coordinate of the pointer, and whether or not the mouse is being clicked. Thus, | ||
+ | < | ||
+ | x,y,z = mouse() | ||
+ | </ | ||
+ | will allow you to check where you are currently clicking. This allows for the implementation of buttons for the player. | ||
=====TIC80 System Variables===== | =====TIC80 System Variables===== | ||
Line 52: | Line 69: | ||
=====Useful Links===== | =====Useful Links===== | ||
+ | ====NES==== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
====TIC-80==== | ====TIC-80==== | ||
Line 62: | Line 92: | ||
[[https:// | [[https:// | ||
- | [[https:// | + | [[https:// |
+ | |||
+ | [[https:// | ||
+ | ====Lua==== | ||
+ | [[https:// | ||
====Projects/ | ====Projects/ | ||
notes/comporg.1647191856.txt.gz · Last modified: 2022/03/13 13:17 by smalik3