FANCO-16 VERSION 3 PROGRAMS =========================== These programs and libraries are kept on the program server. Open any of them by ID on the developer page; the source comes with it. All of them are original work, released under the MIT license (see /LICENSE.txt). The font glyphs were drawn for this project. THE LIST ======== Games Blockfall 0x90871282 3,109 bytes Falling blocks. Uses font, text, box. Lantern Run 0x5203863b 5,246 bytes Maze chase. Uses font, text. Fridge Snake 0x110288de 3,985 bytes Climb the fridge door, eat the magnets, then bite the handle (LEFT+RIGHT) to open the fridge. Uses font, text. Demonstrations Lines demo 0x1ec659bb 237 bytes A bouncing line with a trail. Uses line. SID arpeggiator 0x9cff75a1 1,296 bytes Three-voice music with a piano roll. Benchmarks bench-fill 0xb6e79ce5 249 bytes Box fills and screen copies, about 98,000 pixels per frame. Measures the blitter. bench-lines 0xeca00f79 247 bytes 128 random lines per frame. bench-pixels 0xcec88aca 177 bytes Writes all 65,536 pixels with out. Measures the processor. The benchmarks do not wait between frames. They run as fast as virtual time allows, so the pace shown on the developer page measures how fast your browser is. Relocatable libraries font 0x16a2db29 766 bytes text 0xdabf60f3 98 bytes line 0x5bf20a98 153 bytes box 0xbecb00d8 119 bytes Sizes are of the uploaded image. A program's download is its own size plus that of its libraries. LOADING A LIBRARY ================= All four libraries are relocatable, so you choose where they go. This loads the line library at 3000: mov a, 0x0A98 ; ID, low word mov b, 0x5BF2 ; ID, high word mov p, 0x3000 ; where to load it sys load cmp a, 0 bnz failed If a library fails to load, the programs in this list fill the screen with red and halt. CALLING THE LIBRARIES ===================== In each description, "keeps" lists registers that are unchanged afterwards. All other registers and the flags may change. font ---- Data only, no code. The glyph for character c, from 32 to 126, is the 8 bytes at base + (c - 32) * 8 Each byte is one row, top row first. Bit 7 is the leftmost pixel. text ---- call base p Address of the text, ending in a zero byte. x, y Top left corner. a.lo Color. r Address of a font. Keeps x, y and r. Afterwards p points just past the zero byte. Each character is 8 pixels wide. Text is not clipped and has no line breaks, so keep it inside the screen. line ---- call [base] ; draw a line x, y Start point. a, b End point. All coordinates 0-255. p.lo Color. call [base+2] ; plot one pixel x, y The pixel. p.lo Color. Both keep x, y, p and r. box --- call [base] ; filled box call [base+2] ; outline only x, y Top left corner. a, b Width and height, 1-256. p.lo Color. Both keep every register, but change the blitter registers 62 to 6D. The box is clipped at the screen edge. text and font contain no addresses that need correcting, so they work at any address without relocation. Text and line keep their working values on the stack and use no other memory.