notes:comporg
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:comporg [2020/02/11 09:28] – [Useful Links] hshare | notes:comporg [2022/04/18 11:33] (current) – [Mouse] mpronti2 | ||
---|---|---|---|
Line 12: | Line 12: | ||
* Questions you have that may deserve a more visual answer | * Questions you have that may deserve a more visual answer | ||
- | =====Helpful Things===== | + | =====Working with Memory in TIC80===== |
- | ---- | + | |
- | | + | ====Persistent Memory==== |
- | + | ||
- | ; | + | In order to change part of persistent memory, the process begins as normal for any other piece of memory |
- | + | ||
- | SEG - Segment, | + | In addition, one can utilize the pmem() function to retrieve |
- | + | ||
- | | + | For specific, upper-level questions (such as how to use peek() and/or poke()), it can be hard to find online resources. However, the "Code examples and snippets" |
- | + | ||
- | lda - Load Accumulator Register | + | It is currently understood that there is 1 kilobyte of persistent memory stored at offset 0x14004 (remember ' |
- | | + | |
- | - | + | ====Scanlines==== |
- | + | ||
- | sta - Takes value in accumulator and stores in some memory | + | TIC-80 renders the pixels on its screen using scanlines. The concept is straightforward, |
- | + | ||
- | | + | Using the 'SCN()' function, one can manipulate the memory in TIC-80 between each scanline render as such: |
- | + | <code lua> | |
- | jmp - Jump, unconditionally snaps to a point | + | function SCN(scanline) |
- | + | -- insert code here to manipulate pallete or other things | |
- | brX - A conditional jump (bz) branch if zero (beq) branch if equal | + | end |
- | + | </ | |
- | + | One simply has to put this function somewhere | |
- | + | ||
- | | + | =====TIC-80 Functions===== |
- | | + | |
- | + | ====Map==== | |
- | + | ||
- | =====Address Ranges===== | + | 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 |
- | ---- | + | |
- | $0000 - $007F : TIA Registers | + | ====Audio==== |
- | $0080 - $00FF : RAM | + | |
- | $0200 - $02FF : RIOT registers | + | 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===== | ||
+ | |||
+ | By using peek/poke, it is actually possible to make rather large global changes to both your program itself and the way it is run. Below are some examples. | ||
+ | |||
+ | 0x3FF9: DrawX 0 point. | ||
+ | By adjusting the data stored here, it is possible to change TIC80' | ||
+ | |||
+ | 0x3FFA: DrawY 0 point. | ||
+ | By adjusting the data stored here, it is possible to change TIC80' | ||
+ | |||
+ | =====Other===== | ||
+ | |||
+ | If you're working with JS, remember that when you go to grab a constant from a library (say, pi from Math), if you forget to capitalize `Math.PI` and instead write `Math.pi` or `Math.Pi`, it will read the non-existent field without any runtime error, and instead treat it as 0. This can produce some frustratingly low-flying bugs, especially when working with games that have vector physics. | ||
+ | | ||
=====Useful Links===== | =====Useful Links===== | ||
- | ---- | ||
- | Atari Programming | + | ====NES==== |
- | Stella' | + | |
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | ====TIC-80==== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | [[https://github.com/nesbox/TIC-80/wiki/SCN|SCN (Scanline Function)]] | ||
+ | |||
+ | ====Lua==== | ||
+ | [[https:// | ||
+ | ====Projects/ | ||
+ | |||
+ | [[https:// | ||
- | =====Cycle Ranges===== |
notes/comporg.1581431288.txt.gz · Last modified: 2020/02/11 09:28 by hshare