├── Circuit ├── PCB │ └── FIGnitionPCBRevE.txt └── Stripes │ ├── FignitionCircuitRev_a.stripes │ ├── FignitionCircuitRev_b.stripes │ ├── FignitionCircuitRev_c.stripes │ ├── FignitionCircuitRev_d.png │ ├── FignitionCircuitRev_d.stripes │ ├── FignitionCircuitRev_dBack.png │ ├── FignitionCircuitRev_e.stripes │ ├── FignitionCircuitRev_f.png │ ├── FignitionCircuitRev_f.stripes │ ├── FignitionCircuitRev_f2.png │ ├── FignitionCircuitRev_g.stripes │ ├── FignitionCircuitRev_h.stripes │ ├── FignitionCircuitRev_i.stripes │ ├── FignitionCircuitRev_j.stripes │ ├── FignitionCircuitRev_jMod.stripes │ └── FignitionCircuitRev_jModb.stripes ├── Firmware ├── COPYING.txt ├── Debug │ ├── BlitFirm.c │ ├── Blitter │ │ ├── BitFirm.lst │ │ ├── BlitFirm.lst │ │ ├── BlitTest.elf │ │ ├── Blitter.o │ │ ├── Makefile │ │ ├── main.c │ │ └── main.o │ ├── FPAvrTest.c │ ├── FpRep.c │ ├── JString.c │ ├── JString.h │ ├── PurgeTest.fth │ ├── PurgeTest00.hex │ ├── PurgeTest2.fth │ ├── PurgeTestB00.hex │ ├── PurgeTestC00.hex │ ├── PurgeTesting │ │ ├── PurgeTest2.fth │ │ └── PurgeTestC00.hex │ ├── ScanCheck.c │ ├── VFlashTest.c │ ├── VFlashTester │ │ ├── VFlashTester.1 │ │ ├── VFlashTester.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── user.mode1v3 │ │ │ └── user.pbxuser │ │ └── main.c │ ├── VideoCycleTest.class │ └── VideoCycleTest.java ├── FIGnitionNTSC16.elf ├── FIGnitionNTSC16.hex ├── FIGnitionNTSC32.elf ├── FIGnitionNTSC32Tmp.hex ├── FIGnitionNTSCTmp.hex ├── FIGnitionPAL16.elf ├── FIGnitionPAL16.hex ├── FIGnitionPAL16.lst ├── FIGnitionPAL32.elf ├── FIGnitionPAL32.lst ├── FIGnitionPAL32Tmp.hex ├── FIGnitionPALTmp.hex ├── FigNative.log ├── FigRom.log ├── FigRom.rel ├── FiggyPadDrvIntWrap.log ├── Makefile ├── SwapHex.log ├── Tools │ ├── .gdb_history │ ├── BlockGrapher.class │ ├── BlockGrapher.java │ ├── FFC │ ├── FigFlash.fth │ ├── FignitionChrSetConv.c │ ├── FloydSteinberg.class │ ├── FloydSteinberg.java │ ├── HexOrg │ ├── HexOrg.c │ ├── IntWrap │ ├── IntWrap.c │ ├── QREvent.png │ ├── QREventShrunk.png │ ├── SwapHex │ ├── SwapHex.c │ ├── SwapHx │ ├── T2E2 │ ├── T2E2.c │ ├── TestEEPromGen.c │ ├── more │ └── oldFFC ├── avr4.ld ├── avr4Hi.ld ├── avr4_328.ld ├── bin │ ├── FIGnition0Rev0_9_4.hex │ ├── FirmwareDevBuild20110623a.hex │ ├── FirmwareRev0_0_7.hex │ ├── FirmwareRev0_1_0.hex │ ├── FirmwareRev0_2_0.hex │ ├── FirmwareRev0_3_0.hex │ ├── FirmwareRev0_5_0.hex │ ├── FirmwareRev0_5_1.hex │ ├── FirmwareRev0_5_2.hex │ ├── FirmwareRev0_6_0.hex │ ├── FirmwareRev0_6_1.hex │ ├── FirmwareRev0_6_2.hex │ ├── FirmwareRev0_7_0.hex │ ├── FirmwareRev0_8_1.hex │ ├── FirmwareRev0_9_0.hex │ ├── FirmwareRev0_9_1.hex │ ├── FirmwareRev0_9_2.hex │ ├── FirmwareRev0_9_3.hex │ ├── FirmwareRev0_9_4.hex │ ├── FirmwareRev0_9_5.hex │ ├── FirmwareRev0_9_6NTSCfix.hex │ ├── FirmwareRev0_9_6PAL.hex │ ├── FirmwareRev0_9_6PALfix.hex │ ├── FirmwareRev0_9_7.zip │ ├── FirmwareRev0_9_7NTSC.hex │ ├── FirmwareRev0_9_7PAL.hex │ ├── FirmwareRev0_9_7PAL32.hex │ ├── FirmwareRev0_9_7PalLcd.hex │ ├── FirmwareRev0_9_7PalLcd.zip │ ├── FirmwareRev0_9_7PalLcd32.hex │ ├── FirmwareRev0_9_7aNTSC32.hex │ ├── FirmwareRev0_9_8.zip │ ├── FirmwareRev0_9_8NTSC.hex │ ├── FirmwareRev0_9_8NTSC32.hex │ ├── FirmwareRev0_9_8PAL.hex │ ├── FirmwareRev0_9_8PAL32.hex │ ├── FirmwareRev0_9_9.zip │ ├── FirmwareRev0_9_9NTSC.hex │ ├── FirmwareRev0_9_9NTSC32.hex │ ├── FirmwareRev0_9_9PAL.hex │ ├── FirmwareRev0_9_9PAL32.hex │ ├── FirmwareRev1_0_1NTSC16.bin │ ├── FirmwareRev1_0_1NTSC32.hex │ ├── FirmwareRev1_0_1PAL16.bin │ └── FirmwareRev1_0_1PAL32.hex ├── inc │ ├── AmicFlashSpi.h │ ├── AsmSramMacros.h │ ├── Blitter.h │ ├── BootLoader.h │ ├── CoreDefs.h │ ├── FIGnitionMem.h │ ├── FiggyPadDrv.h │ ├── FigletRegDefs.h │ ├── FignitionChrSet.h │ ├── ForthDebug.h │ ├── ForthOps.h │ ├── GraphIO.h │ ├── InternalFlash.h │ ├── LLDebug.h │ ├── MicrochipSramSpi.h │ ├── Spi.h │ ├── StartScreen.h │ ├── VM.h │ ├── VMTest.h │ ├── Video.h │ ├── asmdef.h │ └── fp32def.h ├── obj │ ├── AmicFlashSpi.o │ ├── Blitter.o │ ├── BootLoader.o │ ├── FIGnition.o │ ├── FIGnitionMem.o │ ├── FigRom.o │ ├── FiggyPadDrv.o │ ├── ForthDebug.o │ ├── GraphIO.o │ ├── Interrupt.o │ ├── LLDebug.o │ ├── MicrochipSramSpi.o │ ├── Spi.o │ ├── StartScreen.o │ ├── Unclassified.o │ ├── Upgrader.o │ ├── VM.o │ ├── VMFast.o │ ├── VMTest.o │ ├── Video.o │ ├── VideoScan.o │ └── zzVideoBuff.o ├── objNTSC │ ├── FigRom.o │ └── Video.o ├── src │ ├── *.S │ ├── AmicFlashSpi.c │ ├── Blitter.s │ ├── BootLoader.c │ ├── Bootload.fth │ ├── FIGnition.c │ ├── FIGnitionMem.c │ ├── FigRom.fth │ ├── FigRom.s │ ├── FigVFlash.fth │ ├── FigVFlash_h.fth │ ├── FiggyPadDrv.s │ ├── ForthDebug.c │ ├── FpDict.fth │ ├── GraphIO.c │ ├── Interrupt.s │ ├── LLDebug.c │ ├── MicrochipSramSpi.c │ ├── Spi.c │ ├── StartScreen.c │ ├── Unclassified.s │ ├── Upgrader.s │ ├── VM.c │ ├── VMFast.s │ ├── VMTest.c │ ├── Video.c │ ├── VideoScan.s │ └── zzVideoBuff.c └── srcIntFix │ ├── FiggyPadDrv.c │ └── FiggyPadDrv.s ├── FirmwareArt ├── VisualFirmware.class └── VisualFirmware.java ├── README.md └── Samples ├── Banner ├── Banner.fth ├── Banner.zip ├── Banner00.hex ├── Banner01.hex └── ExampleScreenshot.jpg ├── Benchmarks ├── Benchmarks.fth ├── Benchmarks00.hex ├── Benchmarks01.hex └── Benchmarks02.hex ├── BlitDemo ├── BlitDemo.fth ├── BlitDemo00.hex ├── BlitDemo01.hex ├── BlitDemo02.hex ├── BlitDemo03.hex ├── BlitDemo04.hex ├── BlitDemo05.hex ├── BlitDemo06.hex ├── BlitDemo07.hex ├── BlitDemo08.hex ├── NyanRace.fth ├── NyanRace.jpg ├── NyanRace.zip ├── NyanRace00.hex ├── NyanRace01.hex ├── NyanRace02.hex ├── NyanRace03.hex ├── NyanRace04.hex ├── NyansUnclipped.jpg ├── T2E2 └── T2E2.log ├── Debugger ├── Debugger.fth ├── Debugger.zip ├── Debugger00.hex ├── Debugger01.hex ├── Debugger02.hex ├── Debugger03.hex ├── Debugger04.hex ├── Debugger05.hex ├── Debugger06.hex ├── Debugger07.hex ├── Debugger08.hex ├── Debugger09.hex ├── Debugger10.hex ├── Debugger11.hex └── ExampleScreenshots │ ├── 300920112025.jpg │ ├── 300920112026.jpg │ ├── 300920112027.jpg │ ├── 300920112028.jpg │ ├── 300920112029.jpg │ ├── 300920112030.jpg │ └── 300920112031.jpg ├── GDemo ├── GDemo.fth └── GDemo.hex.zip ├── HiRes ├── Figgy.gif ├── Figgy00.hex ├── Figgy01.hex ├── Figgy02.hex ├── Figgy03.hex ├── Figgy04.hex ├── Figgy05.hex ├── Figgy06.hex ├── Figgy07.hex ├── HiresDemo.fth ├── HiresDemo00.hex ├── HiresDemo01.hex ├── HiresDemo02.hex ├── HiresDemo03.hex ├── HiresDemo04.hex ├── HiresDemo05.hex ├── HiresDemo06.hex └── MiniImg1.gif ├── Life ├── Life.fth ├── LifeImg.jpg ├── LifeImg02.jpg └── Life_Hex.zip ├── Oxo ├── Small │ ├── 090820112001.jpg │ ├── 090820112003.jpg │ ├── 090820112004.jpg │ └── OxoBitmaps.png ├── mini_oxo.fth └── oxo.fth └── TJoy ├── TJoy.fth ├── TJoy00.hex └── TJoyOld00.hex /Circuit/Stripes/FignitionCircuitRev_a.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_a.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_b.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_b.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_c.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_c.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_d.png -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_d.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_d.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_dBack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_dBack.png -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_e.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_e.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_f.png -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_f.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_f.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_f2.png -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_g.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_g.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_h.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_h.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_i.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_i.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_j.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_j.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_jMod.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_jMod.stripes -------------------------------------------------------------------------------- /Circuit/Stripes/FignitionCircuitRev_jModb.stripes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Circuit/Stripes/FignitionCircuitRev_jModb.stripes -------------------------------------------------------------------------------- /Firmware/Debug/BlitFirm.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Blitter Test Code 3 | **/ 4 | 5 | #include "CoreDefs.h" 6 | #include "Blitter.h" 7 | 8 | byte GPIOR0; 9 | 10 | #define kDebugY0 0 11 | 12 | tSysVars gSysVars; 13 | 14 | //extern byte gCurY; 15 | #define VideoAddr(x,y) &gVideoBuff[(y)*kVideoBuffWidth+(x)] 16 | 17 | byte gVideoBuff[kVideoBuffWidth*kVideoBuffHeight+kUdgChrs*kChrSetBytesPerChar]; 18 | 19 | 20 | void PrintAt(byte x, byte y) 21 | { 22 | if(gSysFlags&1) 23 | *(byte*)&gSysVars.gCur=y; // in hires mode we just store the y coordinate. 24 | else // in text mode we convert the y coordinate to the print address. 25 | gSysVars.gCur=VideoAddr(0,y+kDebugY0); 26 | gSysVars.gCurX=x; 27 | //gCurY=y; 28 | } 29 | 30 | int main(void) 31 | { 32 | byte x,y; 33 | GPIOR0=1; 34 | for(y=24;y<32;y++) { 35 | for(x=16;x<24;x++) { 36 | BlitClip(160,160); 37 | PrintAt(x,y); 38 | BlitBlt(1,0x303); 39 | } 40 | } 41 | return 0; 42 | } -------------------------------------------------------------------------------- /Firmware/Debug/Blitter/BlitTest.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Debug/Blitter/BlitTest.elf -------------------------------------------------------------------------------- /Firmware/Debug/Blitter/Blitter.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Debug/Blitter/Blitter.o -------------------------------------------------------------------------------- /Firmware/Debug/Blitter/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Debug/Blitter/main.o -------------------------------------------------------------------------------- /Firmware/Debug/JString.c: -------------------------------------------------------------------------------- 1 | /** 2 | * String Funcs 3 | **/ 4 | extern void PutCh(char ch); 5 | 6 | #include "JString.h" 7 | 8 | void PutStr(char *str) 9 | { 10 | while(*str) 11 | PutCh(*str++); // just display the whole string. 12 | } 13 | 14 | char* StrEnd(char *src) 15 | { 16 | while(*src) 17 | src++; // scan to end of string. 18 | return src; 19 | } 20 | 21 | void StrCpy(char *dst, char *src) 22 | { 23 | do{ 24 | *dst++=*src; // copy the string 25 | }while(*src++); // until we get to '\0' & include '\0'. 26 | } 27 | 28 | void StrCat(char *dst, char *src) 29 | { 30 | StrCpy(StrEnd(dst),src); // go to end of string and copy. 31 | } 32 | 33 | void StrCatPgm(char *dst, PGM_P src) 34 | { 35 | char ch; 36 | dst=StrEnd(dst); 37 | do { 38 | ch=GetPgmByte(*src++); 39 | *dst++ = ch; 40 | }while(ch); 41 | } 42 | 43 | char kHexDigits[] PROGMEM ="0123456789ABCDEF"; 44 | 45 | /** 46 | * 47 | **/ 48 | void CatNumPad(char *dst, ushort num, byte base, char digs) 49 | { 50 | static char buff[kNumBuffSize]; 51 | char *buffP; 52 | buffP=&buff[kNumBuffSize]; // start at end of buffer. 53 | *--buffP='\0'; // terminate. 54 | do { 55 | *--buffP=GetPgmByte(kHexDigits[num%base]); 56 | num/=base; 57 | }while(num>0 || (--digs) > 0); 58 | StrCat(dst,buffP); 59 | } 60 | 61 | void CatNum(char *dst, ushort num, byte base) 62 | { 63 | CatNumPad(dst,num,base,1); // at least 1 digit. 64 | } 65 | 66 | char kHexPrep[] PROGMEM = "0x"; 67 | 68 | void CatHexPad(char *dst,ushort num,char digs) 69 | { 70 | StrCatPgm(dst,kHexPrep); 71 | CatNumPad(dst,num,16,digs); 72 | } 73 | 74 | void CatHex(char *dst,ushort num) 75 | { 76 | CatHexPad(dst,num,1); // at least 1 digit. 77 | } 78 | 79 | void CatDec(char *dst,ushort num) 80 | { 81 | CatNum(dst,num,10); 82 | } 83 | 84 | -------------------------------------------------------------------------------- /Firmware/Debug/JString.h: -------------------------------------------------------------------------------- 1 | /** 2 | * String Funcs 3 | **/ 4 | #ifndef _JString_H 5 | #define _JString_H 6 | 7 | extern void PutStr(char *str); 8 | 9 | extern char* StrEnd(char *src); 10 | 11 | extern void StrCpy(char *dst, char *src); 12 | 13 | extern void StrCat(char *dst, char *src); 14 | extern void StrCatPgm(char *dst, PGM_P src); 15 | /** 16 | * 17 | **/ 18 | #define kNumBuffSize 8 // 65536 requires 6 bytes in dec, 4 in hex, 177777. 19 | extern void CatNumPad(char *dst, ushort num, byte base, char digs); 20 | extern void CatNum(char *dst, ushort num, byte base); 21 | 22 | extern void CatHexPad(char *dst,ushort num,char digs); 23 | extern void CatHex(char *dst,ushort num); 24 | extern void CatDec(char *dst,ushort num); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTest.fth: -------------------------------------------------------------------------------- 1 | 5 var seed 50 var ps 2 | : rnd seed @ 1+ 75 * dup 3 | seed ! u* swap drop ; 4 | 0 var brefs 766 allot 5 | : pz key drop ; 6 | : gpurge 0 do 7 | 0 rnd drop seed @ 8 | 0 384 u/ ( r d ) 9 | over blk> ( r d phys ) 10 | pz rot rot ( prd) 11 | 2dup swap brefs + ! 12 | dup vram i! 0 1 at . 13 | pz >blk pz loop ; 14 | : tpurge 0 do 15 | i blk> drop 16 | i brefs + @ . 17 | vram i@ . cr more 18 | loop ; -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTest00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000035207661722073656564202020202020D1 3 | :100010002020202020202020203A20726E6420738F 4 | :10002000656564204020312B203735202A206475F7 5 | :100030007020202073656564202120752A20737745 6 | :1000400061702064726F70203B20203020766172D6 7 | :100050002062726566732033383620616C6C6F7471 8 | :10006000202020203A20707A206B65792064726FFE 9 | :1000700070203B202020202020202020203A2067B4 10 | :100080007075726765203020646F2020202020204A 11 | :1000900020202020202020203020726E64206472D6 12 | :1000A0006F70207365656420402020202020202070 13 | :1000B00020302033383420752F20282072206420EF 14 | :1000C000292020202020202020206F7665722062A9 15 | :1000D0006C6B3E2028207220642070687973202980 16 | :1000E000202020707A20726F7420726F7420282074 17 | :1000F0007072642920202020202020203264757016 18 | :100100002073776170206272656673202B20212036 19 | :100110002020202020647570207672616D20692176 20 | :1001200020302031206174202E2020202020707A61 21 | :10013000203E626C6B20707A206C6F6F70203B20C9 22 | :1001400020202020203A20747075726765203020AE 23 | :10015000646F20202020202020202020202020200C 24 | :1001600020206920626C6B3E2064726F702020201A 25 | :10017000202020202020202020202069206272655D 26 | :100180006673202B2040202E20202020202020209D 27 | :10019000202020207672616D206940202E2063721D 28 | :1001A000206D6F72652020202020206C6F6F7020E2 29 | :1001B0003B20202020202020202020202020202024 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTest2.fth: -------------------------------------------------------------------------------- 1 | 5 var seed 50 var delay 2 | 0 var brefs dsk allot 3 | : rblk seed @ 1+ 75 * dup 4 | seed ! 0 dsk u/ 1+ 5 | 2dup swap brefs + c! ; 6 | : pz delay @ clock i@ + 7 | begin dup clock i@ - 8 | 0< until drop ; 9 | : gpurj 0 do rblk ( r d) 10 | over blk> ( r d phys) 11 | pz rot rot ( prd) 12 | dup vram i! 0 1 at . 13 | pz >blk pz loop ; 14 | : tpurj 0 do i blk> drop 15 | vram ic@ i brefs + c@ 16 | 2dup 0 9 at . . = 0= if 17 | key drop then loop ; 18 | : ap 0 do 0 23 at i . dsk 19 | gpurj dsk tpurj loop ; -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTestB00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003520766172207365656420353020766115 3 | :10001000722064656C6179202039353220636F6EFF 4 | :1000200073742064736B2020202020202020202047 5 | :1000300020203020766172206272656673206473BE 6 | :100040006B20616C6C6F74202020203A2072626CEF 7 | :100050006B2073656564204020312B203735202AC2 8 | :100060002064757020207365656420212030206431 9 | :10007000736B20752F20312B203264757020207314 10 | :10008000776170206272656673202B206321203BAC 11 | :100090002020202020203A20707A2064656C61792D 12 | :1000A000204020636C6F636B206940202B20202050 13 | :1000B00020626567696E2064757020636C6F636B86 14 | :1000C000206940202D2020202020303C20756E7497 15 | :1000D000696C2064726F70203B202020202020203B 16 | :1000E000203A20677075726765203020646F207237 17 | :1000F000626C6B2028207220642920206F76657244 18 | :1001000020626C6B3E202820722064207068797316 19 | :100110002920202020707A20726F7420726F742042 20 | :10012000282070726429202020202020202064753F 21 | :1001300070207672616D2069212030203120617439 22 | :10014000202E2020202020707A203E626C6B2070B0 23 | :100150007A206C6F6F70203B2020202020203A20D6 24 | :10016000747075726765203020646F206920626C3E 25 | :100170006B3E2064726F7020207672616D2069631F 26 | :10018000402069206272656673202B206340202026 27 | :1001900020203264757020302039206174202E2098 28 | :1001A0002E203D20303D20696620206B657920643B 29 | :1001B000726F70207468656E206C6F6F70203B20CA 30 | :1001C00020203A20737075726A203020646F20728C 31 | :1001D000626C6B206C6F6F70203B202020202020F1 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTestC00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003520766172207365656420353020766115 3 | :10001000722064656C6179202030207661722062E4 4 | :10002000726566732064736B20616C6C6F74202042 5 | :1000300020203A2072626C6B20736565642040203A 6 | :10004000312B203735202A20647570202073656598 7 | :1000500064202120302064736B20752F20312B20E9 8 | :10006000202020202020326475702073776170205A 9 | :100070006272656673202B206321203B203A20703A 10 | :100080007A2064656C6179204020636C6F636B201B 11 | :100090006940202B20202020626567696E206475EE 12 | :1000A0007020636C6F636B206940202D202020201E 13 | :1000B00020303C20756E74696C2064726F70203B38 14 | :1000C00020202020202020203A20677075726A208E 15 | :1000D0003020646F2072626C6B20282072206429AB 16 | :1000E0002020206F76657220626C6B3E2028207283 17 | :1000F000206420706879732920202020707A207273 18 | :100100006F7420726F742028207072642920202060 19 | :100110002020202020647570207672616D20692176 20 | :1001200020302031206174202E2020202020707A61 21 | :10013000203E626C6B20707A206C6F6F70203B20C9 22 | :1001400020202020203A20747075726A20302064AC 23 | :100150006F206920626C6B3E2064726F70202020DB 24 | :100160007672616D206963402069206272656673F2 25 | :10017000202B206340202020203264757020302006 26 | :1001800039206174202E202E203D20303D206966CC 27 | :1001900020206B65792064726F70207468656E2012 28 | :1001A0006C6F6F70203B2020203A2061702030203F 29 | :1001B000646F20302032332061742069202E206447 30 | :1001C000736B2020677075726A2064736B20747083 31 | :1001D00075726A206C6F6F70203B202020202020D9 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTesting/PurgeTest2.fth: -------------------------------------------------------------------------------- 1 | 5 var seed 50 var delay 2 | 0 var brefs dsk allot 3 | : rblk seed @ 1+ 75 * dup 4 | seed ! 0 dsk u/ 1+ 5 | 2dup swap brefs + c! ; 6 | : pz delay @ clock i@ + 7 | begin dup clock i@ - 8 | 0< until drop ; 9 | : gpurj 0 do rblk ( r d) 10 | over blk> ( r d phys) 11 | pz rot rot ( prd) 12 | dup vram i! 0 1 at . 13 | pz >blk pz loop ; 14 | : tpurj 0 do i blk> drop 15 | vram ic@ i brefs + c@ 16 | 2dup 0 9 at . . = 0= if 17 | key drop then loop ; 18 | : ap 0 do 0 23 at i . dsk 19 | gpurj dsk tpurj loop ; -------------------------------------------------------------------------------- /Firmware/Debug/PurgeTesting/PurgeTestC00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003520766172207365656420353020766115 3 | :10001000722064656C6179202030207661722062E4 4 | :10002000726566732064736B20616C6C6F74202042 5 | :1000300020203A2072626C6B20736565642040203A 6 | :10004000312B203735202A20647570202073656598 7 | :1000500064202120302064736B20752F20312B20E9 8 | :10006000202020202020326475702073776170205A 9 | :100070006272656673202B206321203B203A20703A 10 | :100080007A2064656C6179204020636C6F636B201B 11 | :100090006940202B20202020626567696E206475EE 12 | :1000A0007020636C6F636B206940202D202020201E 13 | :1000B00020303C20756E74696C2064726F70203B38 14 | :1000C00020202020202020203A20677075726A208E 15 | :1000D0003020646F2072626C6B20282072206429AB 16 | :1000E0002020206F76657220626C6B3E2028207283 17 | :1000F000206420706879732920202020707A207273 18 | :100100006F7420726F742028207072642920202060 19 | :100110002020202020647570207672616D20692176 20 | :1001200020302031206174202E2020202020707A61 21 | :10013000203E626C6B20707A206C6F6F70203B20C9 22 | :1001400020202020203A20747075726A20302064AC 23 | :100150006F206920626C6B3E2064726F70202020DB 24 | :100160007672616D206963402069206272656673F2 25 | :10017000202B206340202020203264757020302006 26 | :1001800039206174202E202E203D20303D206966CC 27 | :1001900020206B65792064726F70207468656E2012 28 | :1001A0006C6F6F70203B2020203A2061702030203F 29 | :1001B000646F20302032332061742069202E206447 30 | :1001C000736B2020677075726A2064736B20747083 31 | :1001D00075726A206C6F6F70203B202020202020D9 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Firmware/Debug/ScanCheck.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define F_CPU 16000000 4 | // HSync Init. 5 | #if F_CPU == 16000000 6 | #define kHSyncScan (128-1) 7 | #define kHSyncPulse4us (8-1) 8 | #define kHSyncScanShort (64-1) 9 | #define kHSyncPulse2us (4-1) 10 | #define kFrameVideoMarginLeft (18-1) 11 | #endif 12 | 13 | #if F_CPU == 20000000 14 | #define kHSyncScan (160-1) 15 | #define kHSyncPulse4us (10-1) 16 | #define kHSyncScanShort (80-1) 17 | #define kHSyncPulse2us (5-1) 18 | #define kFrameVideoMarginLeft (23-1) // actually about 4c later or .2us or 2 pixels. 19 | #endif 20 | 21 | #define kFrameSyncPreEqual ((kHSyncScanShort+1)*6) 22 | #define kFrameSyncEqual ((kHSyncScanShort+1)*5) 23 | #define kFrameSyncPostEqual ((kHSyncScanShort+1)*5) 24 | #define kFrameVideoScans 192 25 | #define kFrameVideoScanperiod ((kHSyncScan+1)*kFrameVideoScans) 26 | #define kFrameVideoMarginTopScans ((304-kFrameVideoScans)/2) 27 | #define kFrameVideoMarginTopScansPeriod (kFrameVideoMarginTopScans*(kHSyncScan+1)) 28 | #define kFrameVideoMarginBottomScans (304-kFrameVideoScans-kFrameVideoMarginTopScans) 29 | #define kFrameVideoMarginBottomScansPeriod (kFrameVideoMarginBottomScans*(kHSyncScan+1)) 30 | 31 | int main(void) 32 | { 33 | printf("%d %d %d ",kFrameSyncPreEqual, kFrameSyncEqual, kFrameSyncPostEqual); 34 | printf("%d %d %d ",kFrameVideoMarginTopScansPeriod, kFrameVideoScanperiod, kFrameVideoMarginBottomScansPeriod); 35 | printf("%d \n",kFrameSyncPreEqual+ kFrameSyncEqual+ kFrameSyncPostEqual+ 36 | kFrameVideoMarginTopScansPeriod+ kFrameVideoScanperiod+ kFrameVideoMarginBottomScansPeriod); 37 | } -------------------------------------------------------------------------------- /Firmware/Debug/VFlashTester/VFlashTester.1: -------------------------------------------------------------------------------- 1 | .\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. 2 | .\"See Also: 3 | .\"man mdoc.samples for a complete listing of options 4 | .\"man mdoc for the short list of editing options 5 | .\"/usr/share/misc/mdoc.template 6 | .Dd 21/06/2011 \" DATE 7 | .Dt VFlashTester 1 \" Program name and manual section number 8 | .Os Darwin 9 | .Sh NAME \" Section Header - required - don't modify 10 | .Nm VFlashTester, 11 | .\" The following lines are read in generating the apropos(man -k) database. Use only key 12 | .\" words here as the database is built based on the words here and in the .ND line. 13 | .Nm Other_name_for_same_program(), 14 | .Nm Yet another name for the same program. 15 | .\" Use .Nm macro to designate other names for the documented program. 16 | .Nd This line parsed for whatis database. 17 | .Sh SYNOPSIS \" Section Header - required - don't modify 18 | .Nm 19 | .Op Fl abcd \" [-abcd] 20 | .Op Fl a Ar path \" [-a path] 21 | .Op Ar file \" [file] 22 | .Op Ar \" [file ...] 23 | .Ar arg0 \" Underlined argument - use .Ar anywhere to underline 24 | arg2 ... \" Arguments 25 | .Sh DESCRIPTION \" Section Header - required - don't modify 26 | Use the .Nm macro to refer to your program throughout the man page like such: 27 | .Nm 28 | Underlining is accomplished with the .Ar macro like this: 29 | .Ar underlined text . 30 | .Pp \" Inserts a space 31 | A list of items with descriptions: 32 | .Bl -tag -width -indent \" Begins a tagged list 33 | .It item a \" Each item preceded by .It macro 34 | Description of item a 35 | .It item b 36 | Description of item b 37 | .El \" Ends the list 38 | .Pp 39 | A list of flags and their descriptions: 40 | .Bl -tag -width -indent \" Differs from above in tag removed 41 | .It Fl a \"-a flag as a list item 42 | Description of -a flag 43 | .It Fl b 44 | Description of -b flag 45 | .El \" Ends the list 46 | .Pp 47 | .\" .Sh ENVIRONMENT \" May not be needed 48 | .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 49 | .\" .It Ev ENV_VAR_1 50 | .\" Description of ENV_VAR_1 51 | .\" .It Ev ENV_VAR_2 52 | .\" Description of ENV_VAR_2 53 | .\" .El 54 | .Sh FILES \" File used or created by the topic of the man page 55 | .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact 56 | .It Pa /usr/share/file_name 57 | FILE_1 description 58 | .It Pa /Users/joeuser/Library/really_long_file_name 59 | FILE_2 description 60 | .El \" Ends the list 61 | .\" .Sh DIAGNOSTICS \" May not be needed 62 | .\" .Bl -diag 63 | .\" .It Diagnostic Tag 64 | .\" Diagnostic informtion here. 65 | .\" .It Diagnostic Tag 66 | .\" Diagnostic informtion here. 67 | .\" .El 68 | .Sh SEE ALSO 69 | .\" List links in ascending order by section, alphabetically within a section. 70 | .\" Please do not reference files that do not exist without filing a bug report 71 | .Xr a 1 , 72 | .Xr b 1 , 73 | .Xr c 1 , 74 | .Xr a 2 , 75 | .Xr b 2 , 76 | .Xr a 3 , 77 | .Xr b 3 78 | .\" .Sh BUGS \" Document known, unremedied bugs 79 | .\" .Sh HISTORY \" Document history if command behaves in a unique manner -------------------------------------------------------------------------------- /Firmware/Debug/VideoCycleTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Debug/VideoCycleTest.class -------------------------------------------------------------------------------- /Firmware/Debug/VideoCycleTest.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class VideoCycleTest { 4 | public static void VidCyclesCountPrefetch() { 5 | int cycle=0; 6 | int spiReady=18; 7 | int spiWrites=0; 8 | int vidReady=-32; 9 | int vidWrites=0; 10 | while(vidWrites<20) { 11 | if(vidReady<=cycle) { 12 | cycle+=6; 13 | vidWrites++; 14 | System.out.println("Video Write #"+vidWrites+" @"+cycle); 15 | cycle+=4; 16 | vidReady+=32; 17 | } 18 | else 19 | cycle+=5; 20 | if(spiReady<=cycle) { 21 | cycle+=4; 22 | spiReady=cycle+18; 23 | spiWrites++; 24 | System.out.println("SPI Write #"+spiWrites+" @"+cycle); 25 | cycle+=6; 26 | } 27 | else 28 | cycle+=4; 29 | } 30 | } 31 | 32 | public static void VidCyclesCountScanBytes() { 33 | int cycle=0; 34 | int spiReady=18; 35 | int spiWrites=0; 36 | int vidReady=-32; 37 | int vidWrites=0; 38 | while(vidWrites<20) { 39 | if(vidReady<=cycle) { 40 | cycle+=6; 41 | vidWrites++; 42 | System.out.println("Video Write #"+vidWrites+" @"+cycle); 43 | cycle+=4; 44 | vidReady+=32; 45 | } 46 | else 47 | cycle+=5; 48 | if(spiReady<=cycle) { 49 | cycle+=4; 50 | spiReady=cycle+18; 51 | spiWrites++; 52 | System.out.println("SPI Write #"+spiWrites+" @"+cycle); 53 | cycle+=6; 54 | } 55 | else 56 | cycle+=4; 57 | } 58 | } 59 | 60 | public static void main(String[] args) { 61 | if(args[1].equals("scanBytes") 62 | VidCyclesCountScanBytes(); 63 | else 64 | VidCyclesCountPrefetch(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Firmware/FIGnitionNTSC16.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/FIGnitionNTSC16.elf -------------------------------------------------------------------------------- /Firmware/FIGnitionNTSC32.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/FIGnitionNTSC32.elf -------------------------------------------------------------------------------- /Firmware/FIGnitionPAL16.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/FIGnitionPAL16.elf -------------------------------------------------------------------------------- /Firmware/FIGnitionPAL32.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/FIGnitionPAL32.elf -------------------------------------------------------------------------------- /Firmware/FigNative.log: -------------------------------------------------------------------------------- 1 | _FigRomKern 34 2 | _FigRomInkey 644 3 | _FigRomITick 725 4 | _FigRomOpenecStoreClose 1413 5 | _FigRomScrollToInputRow 1450 6 | _FigRomVDskFindEntryUpdate 5963 7 | _FigRomFPlus 6820 8 | _FigRomFSlash 6860 9 | _FigRomFStar 6940 10 | _FigRomFneg 7016 11 | _FigRom2over 7094 12 | _FigRom2swap 7094 13 | _FigRomFint 7124 14 | _FigRomFloat 7153 15 | _FigRomPlustapexFrom 7424 16 | _FigRomTapeFrom 7439 17 | _FigRomCrc 7520 18 | _FigRomAmpCount 7630 19 | -------------------------------------------------------------------------------- /Firmware/Tools/.gdb_history: -------------------------------------------------------------------------------- 1 | quit 2 | -------------------------------------------------------------------------------- /Firmware/Tools/BlockGrapher.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/BlockGrapher.class -------------------------------------------------------------------------------- /Firmware/Tools/FFC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/FFC -------------------------------------------------------------------------------- /Firmware/Tools/FigFlash.fth: -------------------------------------------------------------------------------- 1 | ( Flash Driver written in 2 | FIGnition Forth. 3 | SpiDrv expects internal 4 | Ram to be filled with 5 | PortCS(byte) 6 | PortCSMask (byte) 7 | Src (byte pointer) 8 | SrcLen (ushort) 9 | Dst (byte pointer) 10 | DstLen (ushort) 11 | FlashCS is on PortB:2 12 | 13 | SrcStream is: 14 | 3 c, block , 0 c, 15 | DstStream is: 16 | Vram 17 | 18 | Structure is: 19 | 37 c, 4 c, 20 | srcStream , 4 , 21 | dstStream , 256 , 22 | ) 23 | 24 | : bswap 25 | dup 8 << 26 | swap 8 >> or 27 | ; 28 | 29 | vram 16 - const amicMsg 30 | 31 | 0 var[] amicRdBlkMsg 32 | 37 c, 4 c, 33 | amicMsg 10 + bswap , 34 | 4 bswap , 35 | vram bswap , 36 | 256 bswap , 37 | 3 c, 0 , 0 c, 38 | 39 | : amicRdBlk 40 | amicRdBlkMsg 11 + ! 41 | amicRdBlkMsg spi 42 | ; 43 | -------------------------------------------------------------------------------- /Firmware/Tools/FloydSteinberg.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/FloydSteinberg.class -------------------------------------------------------------------------------- /Firmware/Tools/HexOrg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/HexOrg -------------------------------------------------------------------------------- /Firmware/Tools/HexOrg.c: -------------------------------------------------------------------------------- 1 | /** 2 | * HexOrg 3 | * A small command-line tool to modify Hex file addresses 4 | * in a particular range and adjust the checksums. 5 | * 6 | * Copyright (C) 2012 Julian Skidmore. 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | * Versions 22 | * ******** 23 | * 24 | * 0.1.0 08/06/2011 Initial Release. 25 | * 26 | * Contact 27 | * ******* 28 | * TheOriginalSnial@Gmail.com 29 | * 30 | * Usage: 31 | * ****** 32 | * HexOrg loAddr hiAddr srcFile dstFile. 33 | * Reads srcFile, writing out dstFile modifying the addresses in question 34 | * and the associated checksums. 35 | * The dstFile can then be loaded into FIGnition using: 36 | * avrdude -c usbasp -p m168 -u -U flash:w:dstFile.hex 37 | * 38 | * 39 | **/ 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | FILE *gSrcFile,*gDstFile; 46 | int gAddrStart,gAddrEnd,gAddrNewOrg; 47 | #define kMaxHexLine 80 48 | char gHexLine[kMaxHexLine],gHexConvLine[kMaxHexLine]; 49 | 50 | //#define __DEBUGMSG__ 51 | 52 | #ifdef __DEBUGMSG__ 53 | 54 | #define __DEBUG1(str) printf(str) 55 | #define __DEBUG2(str,param) printf(str,param) 56 | 57 | #else 58 | 59 | #define __DEBUG1(str) 60 | #define __DEBUG2(str,param) 61 | 62 | #endif 63 | 64 | int HexVal(char *val,int len) 65 | { 66 | int n=0,dig=0; 67 | do{ 68 | dig=(*val++)-'0'; 69 | if(dig>9) 70 | dig+='0'-'A'+10; 71 | if(dig>15) 72 | dig+='A'-'a'; 73 | n=n*16+dig; 74 | }while(--len); 75 | return n; 76 | } 77 | 78 | void HexOrgLine(int minAddr, int maxAddr,int orgOffset, char *srcLine,FILE *dstFile) 79 | { 80 | int addr=HexVal(srcLine+3,4); 81 | if(addr>=minAddr && addr>8)&255)+(addr&255); 84 | addr+=orgOffset; 85 | sum=sum-((addr>>8)&255)-(addr&255); 86 | srcLine[3]='\0'; 87 | srcLine[len-3]='\0'; 88 | sprintf(gHexConvLine,"%s%04X%s%02X\n",srcLine,addr,srcLine+7,sum&255); 89 | srcLine=gHexConvLine; 90 | } 91 | fprintf(dstFile,"%s",srcLine); 92 | } 93 | 94 | void HexOrg(int minAddr, int maxAddr,int newOrg, FILE *srcFile,char *dstFileName) 95 | { 96 | int fileNum=0; 97 | char dstFName[256]; // 256 char limit here! 98 | gDstFile=fopen(dstFileName,"w"); 99 | newOrg-=minAddr; 100 | while(!feof(srcFile)) { 101 | fgets(gHexLine,kMaxHexLine,srcFile); 102 | printf("%s",gHexLine); 103 | HexOrgLine(minAddr,maxAddr,newOrg,gHexLine,gDstFile); 104 | } 105 | fclose(gDstFile); 106 | } 107 | 108 | void Usage(void) 109 | { 110 | printf("\nHexOrg loAddr hiAddr newOrg srcFile dstFile."); 111 | printf("\nReads srcFile, writing out dstFile modifying the addresses in question"); 112 | printf("\nand the associated checksums."); 113 | printf("\nThe dstFile can then be loaded into FIGnition using:"); 114 | printf("\n avrdude -c usbasp -p m168 -u -U flash:w:dstFile.hex "); 115 | printf("\n"); 116 | exit(0); 117 | } 118 | 119 | int main(int argc, char *argv[]) 120 | { 121 | if(argc!=6) { 122 | printf("%d\n",argc); 123 | Usage(); 124 | } 125 | // argc1 is the srcfile, argc2 the destination root. 126 | gAddrStart=atoi(argv[1]); 127 | gAddrEnd=atoi(argv[2]); 128 | gAddrNewOrg=atoi(argv[3]); 129 | gSrcFile=fopen(argv[4],"r"); 130 | if(gSrcFile!=NULL) { 131 | printf("main1\n"); 132 | HexOrg(gAddrStart,gAddrEnd,gAddrNewOrg,gSrcFile,argv[5]); 133 | fclose(gSrcFile); 134 | } 135 | return 0; 136 | } 137 | -------------------------------------------------------------------------------- /Firmware/Tools/IntWrap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/IntWrap -------------------------------------------------------------------------------- /Firmware/Tools/QREvent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/QREvent.png -------------------------------------------------------------------------------- /Firmware/Tools/QREventShrunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/QREventShrunk.png -------------------------------------------------------------------------------- /Firmware/Tools/SwapHex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/SwapHex -------------------------------------------------------------------------------- /Firmware/Tools/SwapHx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/SwapHx -------------------------------------------------------------------------------- /Firmware/Tools/T2E2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/T2E2 -------------------------------------------------------------------------------- /Firmware/Tools/TestEEPromGen.c: -------------------------------------------------------------------------------- 1 | /** 2 | * EEProm test. 3 | **/ 4 | 5 | #include 6 | 7 | typedef unsigned char byte; 8 | 9 | byte EEPromLoadTestString[] EEMEM= { 10 | ": landing " 11 | " y @ 25 * x @ + vram + " 12 | " ( current vram loc ) " 13 | " ic@ dup 47 = over 95 = " 14 | " or over 92 = or if " 15 | " drop 1 gameover ! " 16 | " else " 17 | " 42 = if " 18 | " 2 gameover ! ( win)" 19 | " then " 20 | " then " 21 | "; " 22 | }; 23 | 24 | int main(void) 25 | { 26 | short sum=0,pos=0; 27 | byte ch=1; 28 | do { 29 | ch=eeprom_read_byte(&EEPromLoadTestString[pos++]); 30 | sum+=ch; 31 | }while(ch!=0); 32 | return sum; 33 | } 34 | -------------------------------------------------------------------------------- /Firmware/Tools/oldFFC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/Tools/oldFFC -------------------------------------------------------------------------------- /Firmware/bin/FirmwareRev0_9_7.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/bin/FirmwareRev0_9_7.zip -------------------------------------------------------------------------------- /Firmware/bin/FirmwareRev0_9_7PalLcd.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/bin/FirmwareRev0_9_7PalLcd.zip -------------------------------------------------------------------------------- /Firmware/bin/FirmwareRev0_9_8.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/bin/FirmwareRev0_9_8.zip -------------------------------------------------------------------------------- /Firmware/bin/FirmwareRev0_9_9.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/bin/FirmwareRev0_9_9.zip -------------------------------------------------------------------------------- /Firmware/bin/FirmwareRev1_0_1NTSC16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/bin/FirmwareRev1_0_1NTSC16.bin -------------------------------------------------------------------------------- /Firmware/bin/FirmwareRev1_0_1PAL16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/bin/FirmwareRev1_0_1PAL16.bin -------------------------------------------------------------------------------- /Firmware/inc/AmicFlashSpi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * AmicFlashSpi.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * 36 | */ 37 | 38 | #ifndef _AmicFlashSpi_H 39 | #define _AmicFlashSpi_H 40 | 41 | #include "CoreDefs.h" 42 | 43 | //#define __TestSerialFlash__ 44 | 45 | #define kFlashManuIDAmic 0x37 46 | 47 | #define kFlashCS 2 48 | 49 | #define SerialFlashEnableCS() PORTB&=~(1<captureHead) 78 | 79 | // gPktInfo, by definition is at the end of RAM, 0x3fe on an AtMega168, 80 | // but 0x7fe on an AtMega328. 81 | #define gIntPktInfo ((tAudioPkt**)(0x100+0x3fe)) 82 | 83 | /** 84 | * The AudioISR Picks up a transition and converts it to some data. 85 | * A marker is always at the beginning of every byte. 86 | **/ 87 | extern void Vector5(void); 88 | 89 | extern void Vector12(void); 90 | 91 | /** 92 | * FlashSpm performs a basic Flash operation. 93 | * Precondition: It must not be called during interrupts. FlashSpm sets up 94 | * registers r1:r0 and z and performs the appropriate flash command by 95 | * writing to the SPMC(S)R register and then performing an SPM command within 96 | * 4 cycles. FlashSpm is blocking, and will wait for a pagewrite or erase command 97 | * to complete before returning.. 98 | * 99 | * Flash programming proceeds as follows. The Flash should be ready. 100 | * 1. Fill the page buffer with data. 101 | * 2. Initiate a kFlashSpmErase command to erase the Flash. 102 | * 3. When the Flash is ready initiate a kFlashSpmWritePage to write the page. 103 | * 4. When the Flash is ready we can resume programming the next page. 104 | * 105 | * Flash writing takes approximately 4.5ms per page (about 28Kb/s on AtMega32 106 | * or 14Kb/s on Atmega88), during this time the audio buffer will fill up 107 | * with about 40 bytes of data. 108 | * 109 | * Inputs: addr = The byte address for the flash operation within a flash page. 110 | * value = The data to be written to address if writing to the page 111 | * buffer. N/A for other commands. 112 | * spmCmd= The Spm command to be written. This should be either: 113 | * kFlashSpmEn to write to the page buffer. 114 | * kFlashSpmErase to initiate an erase operation. 115 | * kFlashSpmWritePage to initiate a page write. 116 | **/ 117 | extern void FlashSpmData(ushort addr, byte spmCmd, ushort optValue); 118 | 119 | /** 120 | * 121 | **/ 122 | 123 | extern void AudSync(void); 124 | 125 | /** 126 | * On initialization, we set the 127 | * rx State to kCaptureLead. GetByte can 128 | * block everything else, because receiving bytes 129 | * is the only real-time process. Before receiving each 130 | * byte we need to prime the next state. 131 | **/ 132 | typedef const byte *tFlashMem; 133 | 134 | #define gFlash ((tFlashMem)0) 135 | 136 | extern const tAudioPkt gInitPkt __attribute__((section(".roData2"))); 137 | 138 | extern void CopyPacket(ushort flashAddr, ushort *buff, byte len, byte misMatch); 139 | 140 | extern ushort CrcCCIT16(ushort crc, byte data) __attribute__((section(".bootloaderasm"))); // written in assembler. 141 | 142 | #define kLedBit 4 143 | #define kAddrToggleBit (9-8) 144 | 145 | /** 146 | * JitterUI is a minimal UI that returns the clk div 147 | * for the jitter. 148 | **/ 149 | extern byte *TapeIn(byte blk) __attribute__((section(".bootloaderasm"))); 150 | 151 | #endif -------------------------------------------------------------------------------- /Firmware/inc/FIGnitionMem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * FIGnitionMem.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * FIGnitionMem covers the Forth Memory Subsystem. 36 | * ForthROM and Ram are mapped to the VM's address space so that 37 | * RAM appears from 0x8000 and ROM is from 0x4000 (or 0x6000 if we allow 8Kb). 38 | * RAM uses a prefetching technique, so that when one RAM location has 39 | * been read, the SRAM is then set to read the next location. 40 | * A ram cache variable is used to handle the prefetching. 41 | */ 42 | 43 | #ifndef _FIGnitionMem_H 44 | #define _FIGnitionMem_H 45 | 46 | #include "CoreDefs.h" 47 | 48 | //#define __MACROMEM__ 49 | 50 | #ifndef __MACROMEM__ 51 | 52 | #if 0 53 | 54 | extern ushort gRamCache; 55 | #define SramFlush() gRamCache=0; // can't read from ROM. 56 | 57 | #else 58 | 59 | #define SramFlush() 60 | 61 | #endif 62 | 63 | //#define __LOGFNREADMEM__ 64 | 65 | #ifdef __LOGFNREADMEM__ 66 | 67 | extern byte gReadMemLogging=0; // disabled by default. 68 | 69 | #define LogReadMem(n) gReadMemLogging=n 70 | 71 | #else 72 | 73 | #define LogReadMem(n) 74 | 75 | #endif 76 | 77 | extern void InterruptSpi(); 78 | 79 | //extern byte _FnReadMem(ushort addr); 80 | 81 | //#define ReadMem(data,addr) data=_FnReadMem(addr) 82 | 83 | #else // MACROMEM routines. 84 | 85 | #define _MReadMem(data,addr, ramAddrCache) \ 86 | { \ 87 | if((short)addr>=0) { \ // it's in ROM. 88 | data= GetPgmByte(gForthRom[addr&kMaxForthRomAddr]); \ // 8Kb ROM Max. 89 | } \ 90 | else { \ // it's in SRAM. 91 | ushort oldCache=*ramAddrCache; \ 92 | *ramAddrCache=addr+1; \ // set up next cache addr. 93 | if(addr==oldCache) { \ // it's sequential. 94 | while(!(SPSR & (1<=0) \ 103 | ; \ // wait for CS to have an effect. 104 | data=SramAbsOpenRd(addr&0x7fff); 105 | } \ 106 | SPDR=0; \ // set off the next read. 107 | } \ 108 | } 109 | 110 | #define ReadMem(data,addr,cacheAddr) _MReadMem(data,addr,&cacheAddr) 111 | 112 | #endif 113 | 114 | /** 115 | * Can't write to ROM. 116 | * PostCond: need to invalidate gRamCache to restart reads. 117 | **/ 118 | extern void WriteMem(ushort addr, byte *data, ushort len); 119 | 120 | /** 121 | * A macro for pushing a var to the stack. 122 | **/ 123 | 124 | #define _ToR(var) \ 125 | asm volatile( \ 126 | "push %A0\n\t" \ 127 | "push %B0\n\t" \ 128 | : : "r" (var) ) 129 | 130 | #define _RFrom(var) \ 131 | asm volatile( \ 132 | "pop %B0\n\t" \ 133 | "pop %A0\n\t" \ 134 | : "=r" (var) : ) 135 | 136 | 137 | #define DpPush(x) *(++dp)=x 138 | 139 | #define DpPop(x) x=*dp--; 140 | 141 | #if 0 142 | 143 | typedef union { 144 | ushort w[1]; 145 | byte b[2]; 146 | }tMemXFerBuff; 147 | 148 | //extern tMemXFerBuff gMemXFerBuff; 149 | extern tMemXFerBuff gMemXFerBuff2; 150 | 151 | 152 | //#define gMemXFerBuff (*(tMemXFerBuff*)6) 153 | #define gMemXFerBuff gMemXFerBuff2 154 | #endif 155 | 156 | //#define __TESTFULLRAM__ 157 | 158 | #ifdef __TESTFULLRAM__ 159 | 160 | extern void TestFullRAM(void); 161 | 162 | #else 163 | 164 | #define TestFullRAM() 165 | 166 | #endif 167 | 168 | #endif 169 | -------------------------------------------------------------------------------- /Firmware/inc/FiggyPadDrv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * FigKeyDrv.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 15/09/2011. Released as part of the FIGnition General Release. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * Introduction: 33 | * ************* 34 | * The FigKeyDrv implements the entire 8-key keypad driver. 35 | * 36 | * It contains a keypad mapping from Switch codes to KeyCodes for both 37 | * unshifted and shifted keys. 38 | * 39 | * An interrupt entry point for scanning the keypad and a KeyInt key 40 | * processor for when key entry changes occur. The KeyInt key processor 41 | * handles key code conversion and key repeat. 42 | * 43 | * An inkey routine called KeyP and a Key routine for returning user codes. 44 | * 45 | **/ 46 | 47 | #ifndef _FIGKEYDRV_H 48 | 49 | #define _FIGKEYDRV_H 50 | 51 | #include "CoreDefs.h" 52 | 53 | typedef enum { 54 | kKeyStateReleased=0, 55 | kKeyStateDouble=0x1, 56 | kKeyStateSingle=0x2, 57 | kKeyStateSingleAfterDouble=0x3 58 | }tKeyState; 59 | 60 | 61 | #define kKeyStateKeyHit 4 62 | #define kKeyStateMask 0x3 63 | 64 | //extern byte gKey; 65 | extern byte gKeyGroup; // used for scanrow too. 66 | //extern char gKeyHelpCount; 67 | 68 | #define kKeyShiftMask 0x8 69 | 70 | #define gKeyHelpReset 16 71 | #define kScanRowMask 32 72 | 73 | 74 | /** 75 | * Bit positions for keys: 76 | * erui 7654 [left ][up ][right][del] 77 | * dfjk 3210 [shift][down][space][cr] 78 | * Valid key bit values: 79 | * 1, 2, 3, 4, 5, 6, 8, 9, 10, 80 | * 12, 16, 17, 18, 20, 24, 81 | */ 82 | 83 | extern const byte gKeyCode[16][9] PROGMEM; 84 | 85 | /** 86 | * 87 | **/ 88 | 89 | #define kCueXOffset 11 90 | #define kCueYOffset 22 91 | 92 | #if 0 93 | 94 | extern byte gKbdCueBuffer[8]; 95 | 96 | extern void KbdCue(); 97 | 98 | extern void KbdRestore(); 99 | 100 | #endif 101 | 102 | extern byte Log2(byte key); 103 | 104 | extern byte gKeyState; 105 | 106 | #define KeyHit(ch) gSysVars.key=ch; 107 | 108 | extern void HandleKeyHelp(); 109 | 110 | extern void IntKey(byte key); 111 | 112 | /** 113 | * Keyboard handling. 114 | * erui 7654 115 | * dfjk 3210 (corresponding bit positions from raw scans). 116 | * KeyScans 117 | * On a Real Fignition, 118 | * PORTC<3:0> are the column inputs and 119 | * PORTD<7> and PORTD<0> are the row outputs. 120 | * 121 | * Columns can be scanned by setting one row output 122 | * to 0 and the other to input with pullup. 123 | * Pressed keys will be read as 0, so we need to invert. 124 | * but also bit 0 is the LHS, not RHS. 125 | **/ 126 | #define kKeyRow0 (1<<7) 127 | #define kKeyRow1 (1<<0) 128 | extern byte gOldKScan; 129 | 130 | void KeyInit(void); 131 | 132 | //#define __REVCOLUMNS_ 133 | 134 | #ifdef __REVCOLUMNS_ 135 | 136 | extern const byte kKeyRevInv[16] PROGMEM; 137 | #define ConvertScan(portBits) GetPgmByte(kKeyRevInv[portBits]) 138 | 139 | #else 140 | 141 | #define ConvertScan(portBits) ((~(portBits))&15) 142 | 143 | #endif 144 | 145 | //#define ConvertScan(portBits) portBits 146 | 147 | extern byte gScanRowState; 148 | extern byte gKScanUnbounced; 149 | 150 | extern byte KeyScanRaw(void); 151 | 152 | #define KSInfo (&gVideoBuff[kVideoBuffWidth*(kVideoBuffHeight-1)]) 153 | 154 | extern void KeyScan(void); 155 | 156 | /** 157 | * KeyP is actually an Inkey function. 158 | **/ 159 | extern byte KeyP(void); 160 | 161 | //#define __TESTKEY__ 162 | 163 | //extern byte Key(void); 164 | 165 | //#define __TESTKEYPAD__ 166 | 167 | #ifdef __TESTKEYPAD__ 168 | 169 | // Call TestKeyPad(1); to test by polling the keyboard 170 | // TestKeyPad(0); to test using interrupts. 171 | extern void TestKeyPad(byte poll); 172 | 173 | extern void ReportScan(byte a, byte b, byte c, byte d, byte e, byte f); 174 | 175 | #define kRawPollPeriod 1 176 | 177 | extern void TestKeyPadRaw(void); 178 | 179 | #else 180 | 181 | #define ReportScan(a,b,c,d,e,f) 182 | 183 | #define TestKeyPad(poll) 184 | #define TestKeyPadRaw() 185 | 186 | #endif 187 | 188 | 189 | #endif -------------------------------------------------------------------------------- /Firmware/inc/FigletRegDefs.h: -------------------------------------------------------------------------------- 1 | ;Avr regs! 2 | 3 | __SREG__ = 0x3f 4 | __SP_H__ = 0x3e 5 | __SP_L__ = 0x3d 6 | __CCP__ = 0x34 7 | __tmp_reg__ = 0 8 | __zero_reg__ = 1 9 | 10 | ;Calling Convention in GCC. 11 | ;Call-used registers (Caller-saved): 12 | ; r18-r27, r30-r31. 13 | ;Call-saved registers (callee-saved): 14 | ; r2-r17,r28-r29. 15 | ; 16 | ;Register Usage: 17 | 18 | z = 30 19 | zl = 30 20 | zh = 31 21 | y = 28 22 | yl = 28 23 | yh = 29 24 | x = 26 25 | xl = 26 26 | xh = 27 27 | param0 = 24 28 | param1 = 22 29 | param2 = 20 30 | param3 = 18 31 | param4 = 16 32 | param5 = 14 33 | param6 = 12 34 | shortRet = 24 35 | longRet = 22 36 | 37 | tmp0 = 24 38 | tmp1 = 22 39 | tmp2 = 20 40 | tmp3 = 18 41 | 42 | ;Z is r30 43 | ;Y=r28 = gIP. 44 | gIP = 28 45 | ;X is r26, now used for gDP. 46 | gTos = 16 47 | gTosHi = 17 48 | gDPSave = 14 49 | gDPSaveHi = 15 50 | gDP = 26 51 | gDPHi = 27 52 | 53 | gILoop = 12 54 | gILoopHi=13 55 | gLoopLim = 10 56 | gLoopLimHi=11 57 | gIns=8 58 | gVecBase=6 59 | gCacheIP=4 60 | gCacheIPHi=5 61 | gCacheIns=3 62 | ; gIPHi = 3 63 | 64 | ;Timer defs 65 | OCR1AL = 0x88 66 | OCR1AH = 0x89 67 | 68 | OCR0B = 0x28 69 | OCR0A = 0x27 70 | TCNT0 = 0x26 71 | TCCR0A = 0x24 72 | TCCR0B = 0x25 73 | TIMSK0 = 0x6e 74 | OCIE0A = (1<<1) 75 | TCCR0Amem = (TCCR0A+0x20) 76 | TCCR0Bmem = (TCCR0B+0x20) 77 | OCR0Amem= (OCR0A+0x20) 78 | OCR0Bmem= (OCR0B+0x20) 79 | TCNT0mem= (TCNT0+0x20) 80 | 81 | TCCR1A = 0x80 82 | TCCR1B = 0x81 83 | TCNT1L = 0x84 84 | TCNT1H = 0x85 85 | 86 | OCR1AL = 0x88 87 | OCR1AH = 0x89 88 | TIMSK1 = 0x6f 89 | GTCCR = 0x43 90 | 91 | TCCR2A = 0xb0 92 | TCCR2B = 0xb1 93 | TCNT2 = 0xb2 94 | OCR2A = 0xb3 95 | OCR2B = 0xb4 96 | 97 | 98 | PORTD = 0xb 99 | DDRD = 0xa 100 | PIND = 0x9 101 | PORTC = 0x8 102 | DDRC = 0x7 103 | PINC = 0x6 104 | PORTB = 0x5 105 | DDRB = 0x4 106 | PINB = 0x3 107 | UDR0 = 0xc6 108 | UDRE0Bit = 5 109 | UDRE0 = (1<. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * 36 | */ 37 | 38 | #ifndef _ForthDebug_H 39 | #define _ForthDebug_H 40 | 41 | #include "CoreDefs.h" 42 | 43 | //#define __TESTDEBUGFORTH__ 44 | 45 | #ifdef __TESTDEBUGFORTH__ 46 | 47 | #define ForthLog(ch) \ 48 | { \ 49 | ushort *stackRef=(ushort*)gDpStack; \ 50 | Emit(ch); \ 51 | DotHex(ip); \ 52 | Emit(' '); \ 53 | Dot(ins); \ 54 | Emit(' '); \ 55 | DotHex(tos); \ 56 | Emit(' '); \ 57 | DotHex(iLoop); \ 58 | Emit(' '); \ 59 | DotHex(loopLim); \ 60 | Emit(' '); \ 61 | DotHex((ushort)dp); \ 62 | Emit(kKeyEnter); \ 63 | while(stackRef<=dp) { \ 64 | DotHex(*stackRef++); \ 65 | Emit(' '); \ 66 | } \ 67 | Emit(kKeyEnter); \ 68 | } 69 | 70 | extern void ForthDebugStep(void); 71 | 72 | #else 73 | 74 | #define ForthLog(ch) 75 | #define ForthDebugStep() 76 | 77 | #endif 78 | 79 | //#define __DEDBUGTRACEFORTH__ 80 | 81 | #ifdef __DEDBUGTRACEFORTH__ 82 | 83 | extern byte gTrace; 84 | 85 | #define StartTrace() gTrace=1; 86 | 87 | extern void ForthTracer(ushort ip); 88 | 89 | #define ForthTrace() if(gTrace) ForthTracer(ip); 90 | 91 | extern void ForthDumpDict(ushort latest); 92 | 93 | #else 94 | 95 | #define StartTrace() 96 | #define ForthTrace() 97 | #define ForthDumpDict(n) 98 | 99 | #endif 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /Firmware/inc/ForthOps.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FORTHOPS_H 3 | #define _FORTHOPS_H 1 4 | 5 | #ifndef _FFCDef 6 | 7 | #define _FFCDef(label,byteCode,text) .set label , byteCode 8 | 9 | #endif 10 | 11 | /** 12 | * 13 | **/ 14 | 15 | // 0..5 ****** 16 | _FFCDef(kFigNext,0,"(nop)") 17 | _FFCDef(kFigLit,1,"(lit16)") 18 | _FFCDef(kFigExecute,2,"exec") 19 | _FFCDef(kFigDrop,3,"drop") 20 | _FFCDef(kFigOBranch,4,"(0branch)") 21 | _FFCDef(kFigBranch,5,"(branch)") 22 | 23 | // 6..11 ****x* 24 | _FFCDef(kFigLoop, 6,"(loop)") 25 | _FFCDef(kFigPlusLoop, 7,"(+loop)") 26 | _FFCDef(kFigDo, 8,"(do)") 27 | _FFCDef(kFigUMult, 9,"u*") 28 | _FFCDef(kFigPortMod, 10,">port>") 29 | _FFCDef(kFigUDivMod, 11,"u/") 30 | 31 | // 12..17 ****** 32 | _FFCDef(kFigOpAnd, 12,"and") 33 | _FFCDef(kFigOpOr, 13,"or") 34 | _FFCDef(kFigOpXor, 14,"xor") 35 | _FFCDef(kFigLeave, 15,"leave") 36 | _FFCDef(kFigDoes, 16,"(does)") 37 | _FFCDef(kFigRFrom, 17,"r>") 38 | 39 | // 18..23 ****** 40 | _FFCDef(kFigRFetch, 18,"r") 41 | _FFCDef(kFigToR, 19,">r") 42 | _FFCDef(kFigZeroEq, 20,"0=") 43 | _FFCDef(kFigZeroLt, 21,"0<") 44 | _FFCDef(kFigPlus, 22,"+") 45 | _FFCDef(kFigDPlus, 23,"d+") 46 | 47 | // 24..29 ****** 48 | _FFCDef(kFigMinus, 24,"neg") 49 | _FFCDef(kFigDMinus, 25,"dneg") 50 | _FFCDef(kFigOver, 26,"over") 51 | _FFCDef(kFigSwap, 27,"swap") 52 | _FFCDef(kFigDup, 28,"dup") 53 | _FFCDef(kFigFetch, 29,"@") 54 | 55 | // 30..35 ****** 56 | _FFCDef(kFigCFetch, 30,"c@") 57 | _FFCDef(kFigCPling, 31,"c!") 58 | _FFCDef(kFigPling, 32,"!") 59 | _FFCDef(kFigGetI, 33,"i") 60 | _FFCDef(kFigInc, 34,"1+") 61 | _FFCDef(kFigNative, 35,"(native)") 62 | 63 | // Special words for our version of Forth. 64 | _FFCDef(kFigIntCFetch, 36,"ic@") 65 | _FFCDef(kFigIntCStore, 37,"ic!") 66 | _FFCDef(kFigIntFetch, 38,"i@") 67 | _FFCDef(kFigIntStore, 39,"i!") 68 | _FFCDef(kFigEmit, 40 ,"emit") 69 | // There is an official word definition for this. 70 | _FFCDef(kFigSFGet, 41,"l>") 71 | _FFCDef(kFigDotHex, 42,".hex") 72 | _FFCDef(kFigZero, 43,"0") 73 | _FFCDef(kFigLitC, 44,"(lit8)") 74 | _FFCDef(kFigAt, 45,"at") 75 | _FFCDef(kFigExit, 46 ,";s") 76 | _FFCDef(kFigDec, 47,"1-") 77 | _FFCDef(kFigFill, 48 ,"fill") 78 | _FFCDef(kFigSFPut, 49 ,">l") 79 | _FFCDef(kFigLsr, 50,">>") 80 | _FFCDef(kFigLsl, 51,"<<") 81 | /* _FFCDef(kFigEdit, 52,"edit") */ 82 | _FFCDef(kFigSerialFlashReadBlock, 52,"SerFlashRdBlk") 83 | _FFCDef(kFigSerialFlashWriteBlock, 53,"SerFlashWrBlk") 84 | _FFCDef(kFigCMove, 54,"cmove") 85 | _FFCDef(kFigPlot, 55,"plot") 86 | _FFCDef(kFigSpi, 56,"spi") 87 | _FFCDef(kFigTrace, 57,"(trace)") 88 | _FFCDef(kFigDumpDict, 58,"(ddump)") 89 | _FFCDef(kFigVarDoes, 59,"(vardoes)") 90 | _FFCDef(kFigConstDoes, 60,"(constdoes)") 91 | _FFCDef(kFigTile, 61,"tile") 92 | _FFCDef(kFigBlt, 62,"blt") 93 | _FFCDef(kFig2Blt, 63,"2blt") 94 | _FFCDef(kFigBlts, 64,"blts") 95 | _FFCDef(kFigClip, 65,"clip") 96 | _FFCDef(kFigOpSub, 66,"-") 97 | _FFCDef(kFigSerialFlashEraseSector, 67,"SerFlashErSec") 98 | _FFCDef(kFigSerialFlashID, 68,"SerFlashID") 99 | _FFCDef(kFigDFetch, 69,"d@") 100 | _FFCDef(kFigDStore, 70,"d!") 101 | _FFCDef(kFigDConstDoes, 71,"(dconstdoes)") 102 | _FFCDef(kFig2Over, 72,"2over") 103 | _FFCDef(kFig2Swap, 73,"2swap") 104 | 105 | #define kFigByteCodes 74 106 | 107 | /** 108 | * For ROM testing. 109 | **/ 110 | #define kFigLblDef 128 // label definition. 111 | #define kFigLblRef 129 // label reference. 112 | #define kFigLblFRef 130 // forward relative reference. 113 | #define kFigLitWord 131 // Forces a literal. 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /Firmware/inc/GraphIO.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * GraphIO.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * GraphIO provides higher-level display routines for controlling the screen 36 | * location; scrolling the screen down one line, 37 | */ 38 | 39 | #ifndef _GraphIO_H 40 | #define _GraphIO_H 41 | 42 | #include "CoreDefs.h" 43 | 44 | //extern byte gCurY; 45 | #define VideoAddr(x,y) &gVideoBuff[(y)*kVideoBuffWidth+(x)] 46 | 47 | extern void PrintAt(byte x, byte y); 48 | 49 | extern void Scroll(char dy); 50 | 51 | extern void Emit(char ch); 52 | extern void EmitW(short ch); 53 | 54 | // @TODO Should be only for debugging. 55 | //#define __USE_DOTQUOTE__ 56 | #ifdef __USE_DOTQUOTE__ 57 | 58 | extern void DotQuote(char* str); 59 | 60 | #else 61 | 62 | #define DotQuote(str) 63 | 64 | #endif 65 | 66 | extern void DotHex(ushort x); 67 | 68 | 69 | #ifdef __USEJSTRING__ 70 | 71 | extern char gDotNumBasePad[8]; 72 | 73 | extern void Dot(ushort x); 74 | 75 | #else 76 | 77 | #define Dot(x) DotHex(x) 78 | 79 | #endif 80 | 81 | //extern void Cls(void); 82 | 83 | /** 84 | * The graphics system has a global pen. 85 | * It defines the pen mode. The pen mode supports a subset 86 | * of the complete bitblt modes and is limited to: 87 | * 88 | * leave, copy, clear and change. 89 | * 90 | * Diagrammatically it's: 91 | * 92 | * Here, p is the paper, s is the source data. 93 | * c12\ps 00 01 10 11 94 | * 00 0 0 1 1 95 | * 01 0 1 0 1 96 | * 10 0 0 1 0 97 | * 11 0 1 1 0 98 | * 99 | * The overall transformation is: 100 | * 101 | * src = -1; - in xone it was &= pat. 102 | * res = (~p.s.c2) | (p.~s.c1) | ( ~c1.~c2.p) | (~c1.c2.s) 103 | * 104 | * Leave is: c1 = 0, c2 = 0 105 | * Copy is: c1 = 0, c2 = 1 106 | * Clear is: c1 = 1, c2 = 0 107 | * Change is: c1 = 1, c2 = 1. 108 | * 109 | * : pen 62 ic! ; 110 | * In FIGnition Forth, the pattern is always 1, so then we get: 111 | * c12\s 0 1 112 | * 00 1 1 113 | * 01 0 1 114 | * 10 1 0 115 | * 11 1 0 116 | * 117 | * 118 | * Bits 0 and 1 define the pen mode. 119 | * Bits 6 and 7 define the graphics mode: 120 | * 00 = Normal Text mode with UDGs. 121 | * 01 = Bitmapped 160x160. 122 | **/ 123 | #define gPenMode GPIOR1 124 | #define kMaxXCoord (kVideoBuffWidth*2) 125 | #define kMaxYCoord (kVideoBuffHeight*2) 126 | // Pixel character codes occupy bits 0..2 and bit 7. 127 | #define kPixCharMask 0x87 128 | #define kPixCharBase 16 129 | // Inverse pixels also have inverted codes in bits 0..7 130 | #define kPixBitsReInvert 0x8f 131 | 132 | #define kMaxHiResX 159 133 | #define kMaxHiResY 159 134 | #define kVideoHiResBase 0xF380 135 | 136 | extern void Plot(byte x, byte y); 137 | 138 | //#define __TESTVIDEO__ 139 | 140 | #ifdef __TESTVIDEO__ 141 | 142 | extern void TestVideo(void); 143 | 144 | #else 145 | 146 | #define TestVideo() 147 | 148 | #endif 149 | 150 | #endif 151 | -------------------------------------------------------------------------------- /Firmware/inc/InternalFlash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Flash Memory handler. 3 | **/ 4 | 5 | #ifndef _Flash_H 6 | #define _Flash_H 1 7 | 8 | #if defined(__AVR_ATmega32__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega168__) 9 | #define kFlashPageSizeBits 7 10 | #endif 11 | 12 | #if defined(__AVR_ATmega88__) || defined(__AVR_ATmega8535__) 13 | #define kFlashPageSizeBits 6 14 | #endif 15 | 16 | #if defined(__AVR_ATmega32__) || defined(__AVR_ATmega88__) || \ 17 | defined(__AVR_ATmega328__) || defined(__AVR_ATmega8535__) || defined(__AVR_ATmega168__) 18 | #define kSpmCr 0x37 19 | #endif 20 | 21 | #if defined(__AVR_ATmega8535__) || defined(__AVR_ATmega32__) 22 | #define kSpmCsr SPMCR 23 | #endif 24 | 25 | #if defined(__AVR_ATmega88__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega168__) 26 | #define kSpmCsr SPMCSR 27 | #endif 28 | 29 | #ifdef _DebugSimTest_ 30 | #define kFlashPageSizeBits 6 31 | 32 | #endif 33 | 34 | // Note: No definition if not these devices. 35 | 36 | #define kFlashPageSize (1<. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * LLDebug contains routines to support low-level debugging. 36 | * This includes the LED and the bitbang serial code on PORTD<6> (which has 37 | * fallen into disuse since the Video was enabled). 38 | * 39 | */ 40 | 41 | #ifndef _LLDebug_H 42 | #define _LLDebug_H 43 | 44 | #include "CoreDefs.h" 45 | 46 | #define kLedCtrlPort DDRC 47 | #define kLedPort PORTC 48 | #define kLedPin (1<<4) 49 | 50 | extern void SetLed(byte state); 51 | 52 | /* 53 | byte EepromGetB(const byte* addr) 54 | { 55 | EEARL=(byte)((ushort)addr&0xff); 56 | EEARH=(byte)((ushort)addr>>8); 57 | EECR |= (1< 98 | 99 | #define StrCatCh(str,ch) *str++ = ch 100 | extern char kSpAppend[] PROGMEM; 101 | 102 | extern void PutN(int n); 103 | 104 | extern void PutHex(int n); 105 | 106 | #endif 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /Firmware/inc/MicrochipSramSpi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * MicrochipSramSpi.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * The SRAM driver provides access to a Microchip 8Kb Spi Ram IC. 36 | * Methods to support direct access at any address and 'open' access, 37 | * where /CS is left low so that the next byte can be fetched are defined. 38 | * 39 | * Routines for testing the SRAM are defined. 40 | */ 41 | 42 | #ifndef _MicrochipSramSpi_H 43 | #define _MicrochipSramSpi_H 44 | 45 | #include "CoreDefs.h" 46 | 47 | // SRAM expects MSB to LSB. 48 | // I'm running it at 4.95V, an issue? 49 | // Setup time = 32ns, = 33MHz. 50 | // CPHA=0 and CPOL=0 for SRAM. 51 | // CS for SRAM is PB1, CS for Flash is PB2. 52 | 53 | #define kSramCS 1 54 | #define SramInsRead 3 55 | #define SramInsWrite 2 56 | #define SramInsRdSr 5 57 | #define SramInsWrSr 1 58 | 59 | #define SramEnableCS() PORTB&=~(1<. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * 36 | */ 37 | 38 | #ifndef _SPI_H 39 | #define _SPI_H 40 | 41 | #include "CoreDefs.h" 42 | 43 | //#define __TESTSPIDEBUG__ 44 | //#define __TESTRNDGEN__ 45 | 46 | #ifdef __TESTRNDGEN__ 47 | 48 | extern ushort gSeed; 49 | extern ushort Rnd(ushort max); 50 | 51 | #endif 52 | 53 | #ifdef __TESTSPIDEBUG__ 54 | 55 | extern void _SpiDebug(byte data); 56 | 57 | #else 58 | 59 | #define _SpiDebug(data) 60 | 61 | #endif 62 | 63 | #define kSpiMosiBit 3 64 | #define kSpiMosi (1<>4)&1); \ 85 | if(timeout-gClock<0) { /* bad! */ \ 86 | Emit('@'); \ 87 | DotHex(SPCR); \ 88 | Emit(' '); \ 89 | DotHex(SPSR); \ 90 | Emit(' '); \ 91 | DotHex(DDRB); \ 92 | Emit(' '); \ 93 | DotHex(PORTB); \ 94 | timeout=gClock+50; \ 95 | } 96 | #else 97 | #define _SpiTransmitMonitor 98 | #endif 99 | 100 | #define _SpiNullTask 101 | 102 | #define _SpiMasterTransmit(cData,task) \ 103 | { \ 104 | SPDR = cData; \ 105 | while(!(SPSR & (1<. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * The StartScreen provides an initial startup screen image. 36 | */ 37 | 38 | #ifndef _StartScreen_H 39 | #define _StartScreen_H 40 | 41 | #include "CoreDefs.h" 42 | #include 43 | 44 | #define _ShowStartScreen_ 45 | 46 | #ifdef _ShowStartScreen_ 47 | 48 | #define kStartupImageWidth 25 49 | #define kStartupImageHeight 7 50 | 51 | extern const byte kStartupImage[] PROGMEM; 52 | 53 | extern void StartupScreen(void); 54 | 55 | #else 56 | 57 | #define StartupScreen() 58 | 59 | #endif 60 | 61 | #endif -------------------------------------------------------------------------------- /Firmware/inc/VM.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * VM.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * VM defines the Virtual Machine. 36 | */ 37 | 38 | #ifndef _VM_H 39 | #define _VM_H 40 | 41 | #include "CoreDefs.h" 42 | 43 | //#define __DEBUGCMOVE2__ 44 | 45 | /** 46 | * CMove works for internal to external RAM 47 | * and also ROM to RAM. 48 | * ReadMem handles sources for external RAM and ROM, 49 | * so cmove supports it explicitly. 50 | * WriteMem handles RAM only. 51 | **/ 52 | 53 | extern void __cmove(ushort src, ushort dst, short len); 54 | 55 | //#define __TESTCMOVE__ 56 | 57 | #ifndef __TESTCMOVE__ 58 | 59 | #define _cmove __cmove 60 | 61 | #else 62 | 63 | /** 64 | * Cmove test routine. 65 | * Repeat 30000 time, pick random len (up to 256), start, inc. 66 | **/ 67 | extern void _cmove(ushort src, ushort dst, ushort len); 68 | 69 | #endif 70 | 71 | 72 | /** 73 | * The Spi struct is as follows: 74 | * 75 | * byte CSPort 76 | * byte CSPortBit 77 | * byte *srcBuff ;note, big-endian pointer, needs to be in internal memory. 78 | * ushort srcLen ;srcBuff len. 79 | * byte *dstBuff 80 | * ushort dstLen ;dstBuff and len. Needs to be in internal memory. 81 | * 82 | * The SPI Driver takes CSPort:CSPortBit down, then outputs 83 | * the srcBuff for srcLen bytes, then inputs the *dstBuff for dstLen bytes 84 | * then finally raises CSPort and the port bit. We implement SPI in this 85 | * way, because SRAM execution uses the SPI anyway. 86 | **/ 87 | 88 | extern void _VM(void); 89 | 90 | #define VM() \ 91 | asm volatile( \ 92 | "ldi r24,0xff\n\t"\ 93 | "out 0x3d,r24\n\t"\ 94 | "jmp _VM\n\t" \ 95 | : : ) 96 | 97 | 98 | #endif 99 | 100 | 101 | -------------------------------------------------------------------------------- /Firmware/inc/VMTest.h: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * VMTest.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * 36 | */ 37 | 38 | #ifndef _VMTest_H 39 | #define _VMTest_H 40 | 41 | #include 42 | #include "CoreDefs.h" 43 | 44 | //#define __TESTHELLOWORLD__ 45 | 46 | #ifdef __TESTHELLOWORLD__ 47 | 48 | // Note: surely it should be in PROGMEM? 49 | extern char HelloWorld[]; 50 | #endif 51 | 52 | //#define __TESTFIGFORTH__ 53 | 54 | extern short __bss_end; 55 | 56 | #define gDpStack (&__bss_end) 57 | 58 | #ifdef __TESTFIGFORTH__ 59 | 60 | #define wordDef(val) kFigLitWord,val/256,val%256 61 | #define romWordDef(val) val/256,val%256 62 | 63 | extern const byte gTestProg[]; 64 | 65 | extern const byte gTestProgEnd PROGMEM; 66 | 67 | #endif 68 | 69 | // 8Kb ROM max. 70 | 71 | #define kMaxForthRomAddr 0x1fff 72 | 73 | //#define __TESTROM__ 74 | 75 | #ifdef __TESTROM__ 76 | 77 | extern const byte gForthRom[] PROGMEM; 78 | 79 | extern void ForthCopyBootStrap(void); 80 | 81 | #define ForthBoot() 0x8000; // start reading from SRAM. 82 | 83 | extern void TestForth(void); 84 | 85 | #else 86 | 87 | extern byte _etext; // was _fthROM 88 | extern byte _fthROM; 89 | //#define gForthRom (&_etext) 90 | 91 | #define gForthRom ((byte*)0) 92 | #define gForthBootAddr (&_fthROM) 93 | 94 | // If there's no test rom, then there's no need to copy the bootstrap. 95 | #define ForthCopyBootStrap() 96 | 97 | //#define _DEBUGBOOTROMADDR__ 98 | 99 | extern ushort ForthBoot(void); 100 | #define TestForth() 101 | 102 | #endif 103 | 104 | #endif -------------------------------------------------------------------------------- /Firmware/inc/fp32def.h: -------------------------------------------------------------------------------- 1 | /* Interprocedure convensions. In separate file: for math library 2 | developers. */ 3 | #ifndef _FP32DEF_H 4 | #define _FP32DEF_H 5 | 6 | #define rA0 r30 7 | 8 | #define rA1 r18 9 | #define rA2 r19 10 | #define rA3 r16 11 | #define rAE0 r17 12 | 13 | #define rB0 gDPSave 14 | 15 | #define rB1 r22 16 | #define rB2 r23 17 | #define rB3 r20 18 | #define rBE0 r21 19 | 20 | #define rFpSign r31 21 | #define rFPTmp1 r24 22 | #define rFPTmp0 gDPSave+1 23 | #define rAE1 r25 24 | 25 | #endif /* !_FP32DEF_H */ 26 | -------------------------------------------------------------------------------- /Firmware/obj/AmicFlashSpi.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/AmicFlashSpi.o -------------------------------------------------------------------------------- /Firmware/obj/Blitter.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/Blitter.o -------------------------------------------------------------------------------- /Firmware/obj/BootLoader.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/BootLoader.o -------------------------------------------------------------------------------- /Firmware/obj/FIGnition.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/FIGnition.o -------------------------------------------------------------------------------- /Firmware/obj/FIGnitionMem.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/FIGnitionMem.o -------------------------------------------------------------------------------- /Firmware/obj/FigRom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/FigRom.o -------------------------------------------------------------------------------- /Firmware/obj/FiggyPadDrv.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/FiggyPadDrv.o -------------------------------------------------------------------------------- /Firmware/obj/ForthDebug.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/ForthDebug.o -------------------------------------------------------------------------------- /Firmware/obj/GraphIO.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/GraphIO.o -------------------------------------------------------------------------------- /Firmware/obj/Interrupt.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/Interrupt.o -------------------------------------------------------------------------------- /Firmware/obj/LLDebug.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/LLDebug.o -------------------------------------------------------------------------------- /Firmware/obj/MicrochipSramSpi.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/MicrochipSramSpi.o -------------------------------------------------------------------------------- /Firmware/obj/Spi.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/Spi.o -------------------------------------------------------------------------------- /Firmware/obj/StartScreen.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/StartScreen.o -------------------------------------------------------------------------------- /Firmware/obj/Unclassified.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/Unclassified.o -------------------------------------------------------------------------------- /Firmware/obj/Upgrader.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/Upgrader.o -------------------------------------------------------------------------------- /Firmware/obj/VM.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/VM.o -------------------------------------------------------------------------------- /Firmware/obj/VMFast.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/VMFast.o -------------------------------------------------------------------------------- /Firmware/obj/VMTest.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/VMTest.o -------------------------------------------------------------------------------- /Firmware/obj/Video.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/Video.o -------------------------------------------------------------------------------- /Firmware/obj/VideoScan.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/VideoScan.o -------------------------------------------------------------------------------- /Firmware/obj/zzVideoBuff.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/obj/zzVideoBuff.o -------------------------------------------------------------------------------- /Firmware/objNTSC/FigRom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/objNTSC/FigRom.o -------------------------------------------------------------------------------- /Firmware/objNTSC/Video.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/objNTSC/Video.o -------------------------------------------------------------------------------- /Firmware/src/*.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Firmware/src/*.S -------------------------------------------------------------------------------- /Firmware/src/FIGnition.c: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * FIGnition.c is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 15/09/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * The SRAM driver provides access to a Microchip 8Kb Spi Ram IC. 36 | * Methods to support direct access at any address and 'open' access, 37 | * where /CS is left low so that the next byte can be fetched are defined. 38 | * 39 | * Routines for testing the SRAM are defined. 40 | */ 41 | 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include "CoreDefs.h" 49 | 50 | tSysVars gSysVars; 51 | 52 | #define __KEYPAD8KEY__ 53 | 54 | #ifdef __KEYPAD8KEY__ 55 | 56 | #include "FiggyPadDrv.h" 57 | 58 | #endif 59 | 60 | #include "LLDebug.h" 61 | 62 | #include "Video.h" 63 | 64 | #include "GraphIO.h" 65 | 66 | //#define __TESTINDCCALL_ 67 | 68 | #ifdef __TESTINDCCALL_ 69 | 70 | extern ushort gIndCCallRet,gIndCCallVec; 71 | 72 | #endif 73 | 74 | #if 0 75 | 76 | byte KeyHeart() 77 | { 78 | byte ch; 79 | while((ch=KeyP())==0) 80 | SetLed((gClock>>4)&1); 81 | return ch; 82 | } 83 | #endif 84 | 85 | #include "Spi.h" 86 | 87 | #include "MicrochipSramSpi.h" 88 | 89 | #include "AmicFlashSpi.h" 90 | 91 | #include "VMTest.h" 92 | 93 | #include "FIGnitionMem.h" 94 | 95 | #include "ForthDebug.h" 96 | 97 | #define __TESTHSCANVARS__ 98 | 99 | void FignitionInit(void) 100 | { 101 | // byte ledPattern = kLedPattern; // Used in early hardware testing. 102 | //byte ix; 103 | SMCR|=(1<=(char)127) { 143 | ch='!'; 144 | } 145 | //PutN(nOut++); 146 | //_delay_ms(20); 147 | //PutCh(' '); 148 | SwUartPutCh(ch); 149 | } 150 | #endif 151 | TestCompositeOutput(); 152 | //SwUartPutCh('r'); 153 | //PutHex(ASSR); 154 | 155 | //SwUartPutCh('U'); 156 | //VideoCopyUDGs(); // Generate UDGs. 157 | //SwUartPutCh('v'); 158 | VideoTestInit(32,0); // Create video image. 159 | //SwUartPutCh('S'); 160 | 161 | KeyInit(); // init the keyboard. 162 | SpiMasterInit(); 163 | SramInit(); 164 | PCMSK0=0; 165 | PCICR=0; 166 | //SyncInit(); // Start the video. 167 | //Cls(); 168 | TestVideo(); 169 | 170 | //TestSram(); 171 | //SerialFlashTest(); 172 | //TestSpiSignals(); 173 | //TestKeyPad(0); // poll test of keypad. 174 | //TestKeyPadRaw(); // polling test of keypad. 175 | 176 | TestFullRAM(); 177 | //StartupScreen(); 178 | 179 | #if __TESTROM__ 180 | TestForth(); 181 | 182 | for(;;) 183 | ; 184 | return 0; /* never reached */ 185 | #endif 186 | } 187 | 188 | #include "VM.h" 189 | 190 | void main(void) 191 | { 192 | FignitionInit(); 193 | //Cls(); 194 | VM(); 195 | } 196 | -------------------------------------------------------------------------------- /Firmware/src/FigVFlash_h.fth: -------------------------------------------------------------------------------- 1 | ( ** 2 | * 3 | * FigVFlash.h is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright [C] 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * [at your option] any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date [DD/MM/YYY] 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * 36 | * The FigVFlash.h provides a rudimentary, but compact wear-levelling 37 | * reclaimable block flash driver. It is currently compatible with the 38 | * Amic A25L40, A25L040 and A25L080 serial Flash, but can be easily 39 | * adapted to different devices. 40 | * 41 | * FigVFlash compiles [with -Os] to about 1.6Kb of code and requires 42 | * 0.5Kb of RAM for its basic operation. 43 | * 44 | * VDskErase Erases an entire chip. 45 | * VDskFind Finds the physical page for the given block using buff as 46 | * a workspace. 47 | * VDskRead Copies a virtual block to RAM returning its physical page. 48 | * VDskWrite Copies a virtual block in RAM at buff to the Flash chip 49 | * with the given physical page and prepares the Flash 50 | * chip so that at least one more block can be written. 51 | * buff needs to be >=512b and is used as a workspace. 52 | * 53 | * The correct procedure for writing a block is therefore: 54 | * 55 | * // Find a spare block. 56 | * destinationPhysicalPage=VDskFind[kVDskEmptyBlk,buff]; 57 | * VDskWrite[virtualBlockId,destinationPhysicalPage,buff]; 58 | * 59 | * 60 | * ) 61 | 62 | #ifndef _FIGVFLASH_H 63 | 64 | #inline #define _FIGVFLASH_H 65 | 66 | #inline #define kAmicFlashID4MbBot 0x2013 67 | #inline #define kAmicFlashID4MbSym 0x3013 68 | #inline #define kAmicFlashID8MbSym 0x3014 69 | 70 | ( Every VDskBlk entry takes 2 bytes. ) 71 | #inline #define kSerFlBaseBlock (0x100) 72 | // 64kb blocks. 73 | #inline #define kSerFlSectorBlocks (0x100) 74 | #inline #define kSerFlTestBlocks 16 75 | #inline #define kSerialFlashBlockSize 256 76 | #inline #define kSerialFlashBlockSizeBits 8 77 | 78 | #inline #define kVDskVTableSize 4096 79 | #inline #define kVDskEntriesPerBlk (kSerialFlashBlockSize/2) 80 | #inline #define kSerialFlashBlockEntriesBits (kSerialFlashBlockSizeBits-1) 81 | #inline #define kVDskVTableEntries (kVDskVTableSize/2) 82 | #inline #define kVDskAltTable 0x4000 83 | #inline #define kVDskTableWrapMask 0xc000 84 | #inline #define kVDskWrapIncrement 0x4000 85 | #inline #define kVDskWrapMax 0x8000 86 | 87 | #inline #define kVDskEmptyBlk 0xffff 88 | #inline #define kVDskPurgeNeeded 0xfffe 89 | #inline #define kVDskFull 0xfffd 90 | #inline #define kVDskVTable1 0 91 | // VTable2 is at 4Kb. 92 | #inline #define kVDskVTable0 16 93 | 94 | ( #deflag __TESTVTABLE__ ) 95 | 96 | #endif -------------------------------------------------------------------------------- /Firmware/src/ForthDebug.c: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * ForthDebug.c is part of the FIGnition firmware. 4 | * 5 | * The FIGnition firmware is the built-in software for the 6 | * FIGnition DIY 8-bit computer and compatible computers. 7 | * 8 | * Copyright (C) 2011 Julian Skidmore. 9 | * 10 | * The FIGnition firmware is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * 36 | */ 37 | 38 | #include "CoreDefs.h" 39 | #include "FIGnitionMem.h" 40 | #include "GraphIO.h" 41 | #include "VMTest.h" 42 | 43 | #include "ForthDebug.h" 44 | 45 | #ifdef __TESTDEBUGFORTH__ 46 | 47 | extern KeyHeart(void); // @TODO, Factorize correctly. 48 | 49 | void ForthDebugStep(void) 50 | { 51 | switch(KeyHeart()) { // debug facilities. 52 | case 'm': // log memory. 53 | LogReadMem(1); 54 | break; 55 | case 'u': // don't log memory. 56 | LogReadMem(0); 57 | break; 58 | } 59 | } 60 | 61 | #endif 62 | 63 | #ifdef __DEDBUGTRACEFORTH__ 64 | 65 | byte gTrace=0; 66 | 67 | void ForthTracer(ushort ip) 68 | { 69 | Emit(','); 70 | DotHex(ip); 71 | // slow to 50 ips. 72 | short timeout=gClock+5; 73 | while(timeout-gClock>=0) 74 | ; // wait. 75 | } 76 | 77 | void ForthDumpDict(ushort latest) 78 | { 79 | ushort dictEnd=latest+64; 80 | // The format is: flags, name (not zero terminated), previous NFA, 81 | // currentNFA. 82 | Emit('>'); 83 | while(latest. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 01/07/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * LLDebug contains routines to support low-level debugging. 36 | * This includes the LED and the bitbang serial code on PORTD<6> (which has 37 | * fallen into disuse since the Video was enabled). 38 | * 39 | */ 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | #include "CoreDefs.h" 46 | 47 | #include "LLDebug.h" 48 | 49 | #if 0 50 | 51 | void SetLed(byte state) 52 | { 53 | kLedPort = (kLedPort&~kLedPin) | (state? kLedPin:0); 54 | } 55 | 56 | #endif 57 | 58 | /* 59 | byte EepromGetB(const byte* addr) 60 | { 61 | EEARL=(byte)((ushort)addr&0xff); 62 | EEARH=(byte)((ushort)addr>>8); 63 | EECR |= (1<. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 15/09/2011. Released as part of the FIGnition General Release. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * The StartScreen provides an initial startup screen image. 36 | */ 37 | 38 | #include "CoreDefs.h" 39 | #include "GraphIO.h" 40 | #include "StartScreen.h" 41 | 42 | #ifdef _ShowStartScreen_ 43 | 44 | // Startup screen for FIGNition 45 | // 0 Top-left curve with block, 46 | // 1 top-right curve with block. 47 | // 2 bottom-left curve with block. 48 | // 3 bottom-right curve with block. 49 | // 4. stripes (only its inverse is used). 50 | // 5. Block with bottom stripe. 51 | // 6 half block left with stripe. 52 | // 7 half block right with stripe. 53 | // 16. Top-Left curve with block and stripe. 54 | // 21. half block right. 55 | // 149 = half block left. 56 | // Full set of codes: 57 | // 0, 1, 2, 3, 5, 6, 7, 16, 21, 32, 132, 149, 160 58 | // We could compress the startup screen by encoding the image as an array 59 | // of nybbles which index a graphic character array and by using RLE for 60 | // space characters. The image would then take <87.5b + a 16b array + 61 | // Spaces: 11n=>2n, 10n=>2n, 7n=>2n, 23n=>4n, 17n=>3n. Saving: 9+8+19+14, 25b. 62 | #if 0 63 | #define kStartupImageWidth 25 64 | #define kStartupImageHeight 7 65 | const byte kStartupImage[kStartupImageHeight][kStartupImageWidth] __attribute__((section(".roData2"))) = { 66 | 67 | { 16, 5, 5, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 5, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32 }, 68 | { 132, 132, 132, 6, 7, 132, 132, 132, 132, 132, 132, 132, 6, 132, 132, 132, 132, 7, 132, 132, 132, 132, 132, 132, 132 }, 69 | { 160, 32, 32, 21, 149, 0, 160, 1, 21, 160, 160, 1, 21, 149, 160, 32, 21, 149, 0, 160, 1, 21, 160, 160, 1}, 70 | { 160, 32, 32, 21, 149, 160, 32, 160, 21, 149, 32, 160, 21, 149, 160, 32, 21, 149, 160, 32, 160, 21, 149, 32, 160}, 71 | { 160, 32, 32, 21, 149, 2, 160, 160, 21, 149, 32, 160, 21, 149, 2, 160, 21, 149, 2, 160, 3, 21, 149, 32, 160 }, 72 | { 32, 32, 32, 32, 32, 32, 32, 160, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}, 73 | { 32, 32, 32, 32, 32, 32, 160, 3, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32} 74 | 75 | }; 76 | #else 77 | 78 | const byte kStartupImage[] __attribute__((section(".roData2"))) = { 79 | 80 | 81 | 3, 16, 5, 5, 82 | 14, 1, 5, 83 | 11, 4*25, 84 | 132, 132, 132, 6, 7, 132, 132, 132, 132, 132, 132, 132, 6, 132, 132, 132, 132, 7, 132, 132, 132, 132, 132, 132, 132 , 85 | 160, 32, 32, 21, 149, 0, 160, 1, 21, 160, 160, 1, 21, 149, 160, 32, 21, 149, 0, 160, 1, 21, 160, 160, 1, 86 | 160, 32, 32, 21, 149, 160, 32, 160, 21, 149, 32, 160, 21, 149, 160, 32, 21, 149, 160, 32, 160, 21, 149, 32, 160, 87 | 160, 32, 32, 21, 149, 2, 160, 160, 21, 149, 32, 160, 21, 149, 2, 160, 21, 149, 2, 160, 3, 21, 149, 32, 160 , 88 | 4*25+7 , 1, 160 , 89 | 24 , 2, 160, 3 , 90 | 0 , 91 | }; 92 | 93 | #endif 94 | 95 | /* 96 | void StartupScreen(void) 97 | { 98 | //byte ox=(kVideoBuffWidth-kStartupImageWidth)/2; 99 | //byte oy=(kVideoBuffHeight-kStartupImageHeight)/2; 100 | byte row,col; 101 | byte *img=(byte*)kStartupImage; 102 | byte *dst=VideoAddr((kVideoBuffWidth-kStartupImageWidth)/2, 103 | (kVideoBuffHeight-kStartupImageHeight)/2); 104 | Cls(); 105 | for(row=0;row0) 115 | ; 116 | } 117 | */ 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /Firmware/src/Upgrader.s: -------------------------------------------------------------------------------- 1 | ; ** 2 | ; * Upgrader. 3 | ; * Preconditions: 4 | ; * Forth is set up. Interrupts are off ( can be done in Forth). 5 | ; * Parameters are on the stack (x) including gTos. 6 | ; * i and i' can also be set up, e.g. for comparisons. 7 | ; * Spi is set to read from External Flash. 8 | ; * We'll have a length and start address. 9 | ; * Total length: 10 | ; * InitKeypad: 10 11 | ; * BootKeys: 5 12 | ; * InitSpi : 11 13 | ; * PrepProg: 2 14 | ; * MainLoop: 20 15 | ; * GetSpi: 6 16 | ; * RWWSpm: 7 17 | ; ================= 18 | ; Total: 61, 3 words spare :-) 19 | ; **/ 20 | 21 | .section ".microboot","a" 22 | 23 | #include "FigletRegDefs.h" 24 | #include "AsmSramMacros.h" 25 | 26 | #define kFlashPageSize (1<. 22 | * 23 | * Version. Date (DD/MM/YYY) 24 | * ************************ 25 | * 26 | * 1.0.0. 15/09/2011. Released as part of the FIGnition VDsk Flash Driver. 27 | * 28 | * Contact 29 | * ******* 30 | * TheOriginalSnial@Gmail.com 31 | * 32 | * 33 | * Introduction: 34 | * ************* 35 | * This file exists soley to force the video ram to be at the end of bss. 36 | * 37 | * Routines for testing the SRAM are defined. 38 | */ 39 | 40 | #include "CoreDefs.h" 41 | 42 | byte gVideoBuff[kVideoBuffWidth*kVideoBuffHeight+kUdgChrs*kChrSetBytesPerChar]; 43 | 44 | -------------------------------------------------------------------------------- /FirmwareArt/VisualFirmware.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/FirmwareArt/VisualFirmware.class -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FIGnition Read Me 2 | ================= 3 | 4 | Introduction 5 | ------------ 6 | 7 | This GitHub repository contains a release for FIGnition's open-sourced content. 8 | 9 | FIGnition is released under GPLv3 and you should find COPYING.txt in the Firmware 10 | directory. 11 | 12 | The primary development environment is Intel Mac OS X, and no attempt has 13 | yet been made to build FIGnition binaries on any other system. The FIGnition 14 | build environment uses tools written in 'C' and in Java as well as the avrdude 15 | tool for uploading firmware upgrades. 16 | 17 | From Version 0.9.7, Building FIGnition is now a simpler, primarily automatic 18 | process. Now all you need to do is: 19 | 20 | $make FIGVER=0x097 Distro 21 | 22 | This builds the .s source files from .fth source files; then both variants of 23 | the FIGnition.hex files will be built: 24 | 25 | FIGnitionPAL.hex 26 | FIGnitionNTSC.hex 27 | 28 | The build process uses the new FIGnitionFirmwareCompiler: FFC to generate a 29 | suitable assembler file from a .fth file and SwapHex is used to combine relocation 30 | information from FFC with a .hex file to create the final .hex file where the 31 | ForthROM component is big-endian. 32 | 33 | From version 0.9.7 the source for the PCB is included in Circuit/PCB. It's 34 | in Osmond format, a Mac OS X PCB Cad Package, but since I do actually edit the 35 | source to create parts and modify the PCB I consider it human-readable and 36 | therefore a valid OSH file format. 37 | 38 | -------------------------------------------------------------------------------- /Samples/Banner/Banner.fth: -------------------------------------------------------------------------------- 1 | 0 kern const chrset 2 | 0 var xp 0 var yp 3 | : banByte ( byte x y --) 4 | swap 7 + swap 8 0 do 5 | rot dup 1 and 1+ pen 6 | 1 >> rot rot 2dup plot 7 | swap 1- swap loop 8 | drop drop drop ; 9 | : banCh ( ch -- ) 10 | 8 * chrset + 8 0 do 11 | dup c@ xp @ yp @ 12 | banByte 1 yp +! 1+ 13 | loop xp @ 8 + dup 42 < 14 | if -8 yp +! else drop 0 15 | then xp ! drop ; 16 | : banStr ( str -- ) 17 | 0 xp ! 0 yp ! count 18 | 0 do dup c@ banCh 1+ 19 | loop drop ; 20 | 21 | : ," 34 word here c@ 1+ 22 | allot ; 23 | : cdata ; 24 | cdata bigHi 25 | ," Hello World!" 26 | -------------------------------------------------------------------------------- /Samples/Banner/Banner.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Banner/Banner.zip -------------------------------------------------------------------------------- /Samples/Banner/Banner00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000030206B65726E20636F6E7374206368724C 3 | :1000100073657420202020202030207661722078A3 4 | :1000200070203020766172207970202020202020DE 5 | :1000300020203A2062616E4279746520282062791E 6 | :10004000746520782079202D2D2920202073776158 7 | :10005000702037202B207377617020382030206487 8 | :100060006F202020202020726F7420647570203152 9 | :1000700020616E6420312B2070656E2020202020AE 10 | :1000800031203E3E20726F7420726F74203264758E 11 | :100090007020706C6F7420207377617020312D2078 12 | :1000A00073776170206C6F6F7020202020202020DB 13 | :1000B0002064726F702064726F702064726F7020A1 14 | :1000C0003B202020202020203A2062616E436820BF 15 | :1000D00028206368202D2D2029202020202020206A 16 | :1000E00020202038202A20636872736574202B201A 17 | :1000F00038203020646F20202020202020206475AC 18 | :1001000070206340207870204020797020402020AB 19 | :100110002020202020202062616E427974652031E9 20 | :10012000207970202B2120312B202020206C6F6F14 21 | :100130007020787020402038202B20647570203487 22 | :1001400032203C2020206966202D38207970202B19 23 | :100150002120656C73652064726F702030202074DC 24 | :1001600068656E20787020212064726F70203B20BB 25 | :10017000202020202020203A2062616E53747220BB 26 | :100180002820737472202D2D20292020202020204B 27 | :1001900020203020787020212030207970202120EC 28 | :1001A000636F756E742020202020203020646F2023 29 | :1001B0006475702063402062616E436820312B209B 30 | :1001C000202020206C6F6F702064726F70203B20A5 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Banner/Banner01.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A202C2220333420776F72642068657286 3 | :100010006520634020312B20202020616C6C6F74A0 4 | :10002000203B2020202020202020202020202020B5 5 | :1000300020203A206364617461203C6275696C64BD 6 | :100040007320646F65733E203B202063646174619C 7 | :10005000206269674869202020202020202020205D 8 | :100060002020202020202C222048656C6C6F2057F7 9 | :100070006F726C642122202020202020202020204C 10 | :100080002020202020202020202020202020202070 11 | :100090002020202020202020202020202020202060 12 | :1000A0002020202020202020202020202020202050 13 | :1000B0002020202020202020202020202020202040 14 | :1000C0002020202020202020202020202020202030 15 | :1000D0002020202020202020202020202020202020 16 | :1000E0002020202020202020202020202020202010 17 | :1000F0002020202020202020202020202020202000 18 | :1001000020202020202020202020202020202020EF 19 | :1001100020202020202020202020202020202020DF 20 | :1001200020202020202020202020202020202020CF 21 | :1001300020202020202020202020202020202020BF 22 | :1001400020202020202020202020202020202020AF 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Banner/ExampleScreenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Banner/ExampleScreenshot.jpg -------------------------------------------------------------------------------- /Samples/Benchmarks/Benchmarks.fth: -------------------------------------------------------------------------------- 1 | ( usage time-bm bmx 2 | except bm1g which is: 3 | 3 pen cls time-bm bm1g 4 | ) 5 | 6 | : time-bm 7 | find lfa>cfa 8 | clock i@ swap exec 9 | clock i@ swap - . 10 | ; 11 | 12 | : bm1 ( needs 100K now) 13 | cr ." S" 14 | 10 0 do 15 | 10000 0 do loop 16 | loop 17 | ." E" 18 | ; 19 | 20 | : bm2 21 | cr ." S" 22 | 0 begin 23 | 1+ dup 9999 > 24 | until drop 25 | ." E" 26 | ; 27 | 28 | : bm3 29 | cr ." S" 30 | 0 begin 31 | 1+ dup dup / over 32 | * over + over - 33 | drop dup 9999 > 34 | until ." E" 35 | drop 36 | ; 37 | 38 | : bm4 39 | cr ." S" 40 | 0 begin 41 | 1+ dup 2 / 3 42 | * 4 + 5 - drop dup 43 | 9999 > until 44 | ." E" drop 45 | ; 46 | 47 | : bm5sub ; 48 | : bm5 49 | cr ." S" 0 begin 50 | 1+ dup 2 / 3 51 | * 4 + 5 - drop bm5sub 52 | dup 9999 > until 53 | ." E" drop 54 | ; 55 | 56 | : bm6 57 | cr ." S" 0 begin 58 | 1+ dup 2 / 3 * 4 + 5 - 59 | drop bm5sub 60 | 5 0 do loop 61 | dup 9999 > until 62 | ." E" drop 63 | ; 64 | 65 | : var[] 66 | over + + ; 68 | 69 | 5 var[] m 70 | 71 | : bm7 72 | cr ." S" 0 begin 73 | 1+ dup 2 / 3 * 4 + 5 - 74 | drop bm5sub 75 | 5 0 do dup i m ! loop 76 | dup 9999 > until 77 | ." E" drop 78 | ; 79 | 80 | : bm3l 81 | 0 10000 0 do 82 | i + minus i and 83 | i or i xor 84 | loop drop ; 85 | 86 | : bm1g 87 | 10 0 do 88 | 48 0 do i 89 | 50 0 do 90 | i over plot 91 | loop drop 92 | loop 93 | loop 94 | ; 95 | -------------------------------------------------------------------------------- /Samples/Benchmarks/Benchmarks00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :10000000282075736167652074696D652D626D20A8 3 | :10001000626D7820202065786365707420626D3190 4 | :10002000672077686963682069733A20202033204D 5 | :1000300070656E20636C732074696D652D626D2030 6 | :10004000626D3167202020290D0D3A2074696D659D 7 | :100050002D626D0D202066696E64206C66613E63C2 8 | :1000600066610D2020636C6F636B2069402073779D 9 | :10007000617020657865637574650D2020636C6F11 10 | :10008000636B2069402073776170202D202E0D3B1B 11 | :100090000D0D3A20626D31202028206E6565647355 12 | :1000A000203130304B206E6F77290D202063722075 13 | :1000B0002E222053220D20203130203020646F0D5D 14 | :1000C00020203130303030203020646F206C6F6F52 15 | :1000D000700D20206C6F6F700D20202E2220452285 16 | :1000E0000D3B0D0D3A20626D320D20206372202EE3 17 | :1000F000222053220D20203020626567696E0D207A 18 | :10010000202020312B206475702039393939203E68 19 | :100110000D2020756E74696C0D20202E2220452242 20 | :100120000D3B0D0D3A20626D330D20206372202EA1 21 | :10013000222053220D20203020626567696E0D2039 22 | :10014000202020312B2064757020647570202F20B2 23 | :100150006F7665720D202020202A206F7665722030 24 | :100160002B206F766572202D0D2020202064726F69 25 | :1001700070206475702039393939203E0D20207582 26 | :100180006E74696C202E222045220D202064726F2F 27 | :10019000700D3B0D0D3A20626D340D2020637220EE 28 | :1001A0002E222053220D20203020626567696E0DBB 29 | :1001B00020202020312B206475702032202F203306 30 | :1001C0000D202020202A2034202B2035202D2064B3 31 | :1001D000726F70206475700D202039393939203ED6 32 | :1001E00020756E74696C0D20202E2220452220641B 33 | :0601F000726F700D3B0070 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Benchmarks/Benchmarks01.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20626D35737562203B0D3A20626D3582 3 | :100010000D20206372202E22205322203020626582 4 | :1000200067696E0D20202020312B206475702032EE 5 | :10003000202F20330D202020202A2034202B203573 6 | :10004000202D2064726F7020626D357375620D20F3 7 | :10005000206475702039393939203E20756E7469F5 8 | :100060006C0D20202E222045222064726F700D3BE3 9 | :100070000D0D3A20626D360D20206372202E222055 10 | :100080005322203020626567696E0D202020312BBD 11 | :10009000206475702032202F2033202A2034202B1A 12 | :1000A0002035202D0D20202064726F7020626D3568 13 | :1000B0007375620D20202035203020646F206C6F16 14 | :1000C0006F700D20206475702039393939203E2039 15 | :1000D000756E74696C0D20202E22204522206472DA 16 | :1000E0006F700D3B0D0D3A207661725B5D0D202027 17 | :1000F0003C6275696C64732032202A20616C6C6FDD 18 | :10010000740D2020646F65733E206F766572202B1E 19 | :10011000202B203B0D0D35207661725B5D206D0D2F 20 | :100120000D3A20626D370D20206372202E2220535D 21 | :1001300022203020626567696E0D202020312B203F 22 | :100140006475702032202F2033202A2034202B2069 23 | :1001500035202D0D20202064726F7020626D357364 24 | :1001600075620D20202035203020646F206475706A 25 | :100170002069206D2021206C6F6F700D2020647528 26 | :10018000702039393939203E20756E74696C0D2024 27 | :10019000202E222045222064726F700D3B0D0D3AF7 28 | :1001A00020626D336C0D2020302031303030302013 29 | :1001B0003020646F0D2020202069202B206D696E77 30 | :1001C0007573206920616E640D2020202069206FE6 31 | :1001D00072206920786F720D20206C6F6F70206420 32 | :0601E000726F70203B006D 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/Benchmarks/Benchmarks02.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20626D31670D20203130203020646F3E 3 | :100010000D202020203438203020646F20690D20EE 4 | :1000200020202020203530203020646F0D2020201B 5 | :10003000202020202069206F76657220706C6F74FC 6 | :100040000D2020202020206C6F6F702064726F7054 7 | :100050000D202020206C6F6F700D20206C6F6F7052 8 | :030060000D3B0055 9 | :00000001FF 10 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000006865782063726561746520636174202877 3 | :1000100020347833290D202030303031202C20300E 4 | :10002000323032202C0D202030323032202C203043 5 | :10003000323732202C0D202046463030202C203004 6 | :10004000303031202C0D202032303030202C203028 7 | :10005000303031202C0D20203046463030202C20EE 8 | :1000600030303230202C0D202030303332202C2004 9 | :1000700034383434202C0D202038303430202C20DB 10 | :1000800032303230202C0D202032303243202C20D0 11 | :1000900033323232202C0D202039454336202C209B 12 | :1000A00033413045202C0D202030323032202C209E 13 | :1000B00030363046202C0D202030383030202C2097 14 | :1000C00030323430202C0D202030303030202C20A5 15 | :1000D00031303030202C0D202034333430202C208F 16 | :1000E00038343843202C0D202038303834202C2050 17 | :1000F00034373230202C0D202043323032202C2057 18 | :1001000030393539202C0D202030313931202C2048 19 | :1001100046323034202C0D202031313132202C2039 20 | :1001200031433030202C0D202030303030202C2036 21 | :1001300030303030202C0D202046463438202C2002 22 | :1001400033383030202C0D202030303030202C201F 23 | :1001500030303030202C0D202046463235202C20E7 24 | :1001600031433030202C0D202030303030202C20F6 25 | :1001700030303030202C0D202046383230202C20DA 26 | :1001800045303030202C0D202030303030202C20D5 27 | :1001900030303030202C0D20200D646563696D6196 28 | :1001A0006C0D0D3A203E75646720282061646472EE 29 | :1001B00020756467202D2D290D202038202A2076D7 30 | :1001C00072616D202B20363030202B20380D2020FE 31 | :0801D000636D6F7665203B00B2 32 | :00000001FF 33 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo01.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000006865782063726561746520747261696CDB 3 | :100010000D202030343441202C2030413434302025 4 | :100020002C0D202030343441202C20304134343009 5 | :10003000202C0D313820616C6C6F740D7472616905 6 | :100040006C206865726520636D6F7665200D0D63A9 7 | :100050007265617465206772657962670D2020356D 8 | :10006000354141202C203041413535202C0D2020B8 9 | :1000700035354141202C203041413535202C0D0DA6 10 | :10008000637265617465207477696E6B6C65300DA1 11 | :10009000202030383038202C2030304436202C0DB1 12 | :1000A000202030303038202C2030383030202C0DBB 13 | :1000B0000D637265617465207477696E6B6C653170 14 | :1000C0000D202038323434202C2030303130202C98 15 | :1000D0000D202030303434202C2038323030202C89 16 | :1000E0000D0D637265617465207477696E6B6C6564 17 | :1000F000320D202030303030202C2031303238206A 18 | :100100002C0D202031303030202C20303030302069 19 | :100110002C0D0D637265617465207477696E6B6C6C 20 | :1001200065330D202031303434202C2030303832EB 21 | :10013000202C0D202030303434202C203130303031 22 | :10014000202C0D0D646563696D616C0D0D3A2062A4 23 | :100150006C7474310D2020637220323536203320C8 24 | :100160003020646F2034203020646F0D2020202048 25 | :1001700064757020656D697420312B0D20206C6FC3 26 | :100180006F70206372206C6F6F702064726F700DDF 27 | :100190002020747261696C2030203E7564670D20E8 28 | :1001A000206772657962672031203E7564670D2093 29 | :1001B000207477696E6B6C65302032203E75646701 30 | :1001C0000D20207477696E6B6C65312033203E758D 31 | :1001D00064670D20207477696E6B6C653220342063 32 | :1001E0003E7564670D20207477696E6B6C653320F3 33 | :0901F00035203E7564670D3B00EB 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo02.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20636C670D20202D333230302033329C 3 | :10001000303020302066696C6C0D3B0D0D3A20634A 4 | :100020006C506174202820706174202D2D290D20C2 5 | :100030002030202D3332303020646F0D20202020DE 6 | :10004000647570206920210D202032202B6C6F6F89 7 | :10005000702064726F700D3B0D0D3A206761742043 8 | :100060002820782079202D2D2061646472290D20AC 9 | :10007000203230202A202B2038202A202D333230E5 10 | :1000800030202B0D3B0D0D3A2067656D69742028DB 11 | :100090002064737420626D202D2D290D20206F7631 12 | :1000A0006572203820636D6F76652038202B0D3BFC 13 | :1000B0002028206164647227290D0D3A20626C7437 14 | :1000C00074320D20203120766D6F646520636C677B 15 | :1000D0000D20203020302067617420747261696CBB 16 | :1000E0002067656D69740D202067726579626720ED 17 | :1000F00067656D69740D20207477696E6B6C65306F 18 | :100100002067656D69740D20207477696E6B6C656E 19 | :10011000312067656D69740D20207477696E6B6C92 20 | :1001200065322067656D69740D20207477696E6B88 21 | :100130006C65332067656D69740D20206361740DF3 22 | :10014000202038203520646F0D20202020313220DF 23 | :100150003820646F0D202020202020692072206725 24 | :100160006174206F7665720D202020202020676545 25 | :100170006D69742064726F702038202B0D20202050 26 | :10018000206C6F6F700D20206C6F6F702064726F29 27 | :10019000700D20206B65792064726F70203020769E 28 | :1001A0006D6F64650D3B0D0D2820746573742074AC 29 | :1001B000696C65290D3A20747261696C730D202099 30 | :1001C000747261696C2033203020646F0D20202010 31 | :1001D00020647570206F7665722038202B203820BF 32 | :1001E000636D6F76650D2020202038202B0D202098 33 | :0C01F0006C6F6F702064726F700D3B002C 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo03.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20626C7474330D2020747261696C73D1 3 | :100010000D20203120766D6F646520636C670D20A4 4 | :10002000207477696E6B6C65302032353720302054 5 | :1000300074696C650D20207477696E6B6C65312076 6 | :1000400032353720312074696C650D202074776952 7 | :100050006E6B6C65322032353720322074696C65E6 8 | :100060000D20207477696E6B6C6533203235372034 9 | :10007000332074696C650D2020747261696C2035C1 10 | :10008000313420342074696C650D202067726579E5 11 | :1000900062672032353720342074696C650D20206A 12 | :1000A0006361740D20203132203820646F0D2020D0 13 | :1000B0002020647570203130323720692074696CDB 14 | :1000C000652038202B0D20206C6F6F702064726FBC 15 | :1000D000700D20207672616D20333230202B202865 16 | :1000E0002074696C6530290D202039203420646F1C 17 | :1000F0000D202020203132203820646F0D20202058 18 | :1001000020202069207220676174206F7665720D4F 19 | :1001100020202020202067656D69742064726F7034 20 | :1001200020382B0D202020206C6F6F700D20206C4C 21 | :100130006F6F702064726F7020200D20206B6579C6 22 | :100140002064726F70203020766D6F64650D3B0DFA 23 | :100150000D28207465737420626C74290D3A206236 24 | :100160006C747434620D2020636C67203120766DCE 25 | :100170006F64650D202061742061740D202064750A 26 | :1001800070203E7220302074696C650D2020302074 27 | :10019000723E20326475702032626C740D20206BC8 28 | :1001A00065792064726F70203020766D6F64650D04 29 | :0201B0003B0012 30 | :00000001FF 31 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo04.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20626C747434730D20203920302064DF 3 | :100010006F0D2020202039203020646F0D202020FB 4 | :100020002020207477696E6B6C6530203235372064 5 | :100030006920720D202020202020626C74743462AC 6 | :10004000206B65792064726F700D202020206C6F0A 7 | :100050006F700D20206C6F6F700D3B0D0D3A20629C 8 | :100060006C747434202820626D2064696D290D2021 9 | :1000700020636C67203120766D6F64650D2020321F 10 | :1000800064757020302074696C650D202073776171 11 | :10009000702064726F70203020737761700D2020A3 12 | :1000A00030203020617420313630203136302063EA 13 | :1000B0006C69700D2020313630206F7665722038E3 14 | :1000C000203E3E202D203020646F0D202020203146 15 | :1000D0003630206F7665722032353520616E6420AF 16 | :1000E0002D0D202020203020646F0D202020202086 17 | :1000F00020692072206174203264757020626C74F3 18 | :100100000D2020202020202D3130303020706175CE 19 | :1001100073650D202020202020692072206174202A 20 | :100120003264757020626C740D202020206C6F6F1B 21 | :10013000700D20206C6F6F702064726F702064727D 22 | :100140006F700D2020383020383020617420626CB0 23 | :10015000740D20206B65792064726F7020302076DA 24 | :100160006D6F64650D3B0D0D3A202E726567730D42 25 | :100170002020302032342061740D20207672616D91 26 | :1001800020363332202B20647570203330202D2010 27 | :10019000646F0D2020202069206940203020342009 28 | :1001A000642E720D202032202B6C6F6F700D3B007F 29 | :00000001FF 30 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo05.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20626C747435202820626D2064696D1A 3 | :10001000290D2020636C6F636B206940203E720DB8 4 | :1000200020203120766D6F646520636C732032640C 5 | :1000300075700D2020302074696C650D2020737759 6 | :1000400061702064726F70203020737761700D20B2 7 | :10005000203020302061742031363020313630207D 8 | :10006000636C69700D202030203020617420326470 9 | :10007000757020626C74203020302061740D202057 10 | :10008000313630206F7665722038203E3E202D209C 11 | :100090003020646F0D20202020313630206F7665AF 12 | :1000A000722032353520616E64202D0D20202020F5 13 | :1000B0003020646F0D2020202020206920722061D4 14 | :1000C000740D202020202020326475702032647549 15 | :1000D000702032626C740D20202020202069207254 16 | :1000E0002061742028206F6C6478206F6C647929FB 17 | :1000F0000D202020206C6F6F700D20206C6F6F70B2 18 | :100100000D202064726F702064726F700D20206368 19 | :100110006C6F636B20694020723E202D20302030B0 20 | :10012000206174202E0D20206B65792064726F7021 21 | :10013000203020766D6F64650D3B0D0D3A203276D0 22 | :100140006172203C6275696C647320737761702002 23 | :100150002C202C0D2020646F65733E203B0D0D304C 24 | :1001600064203276617220636C6970546F704C65E4 25 | :1001700066740D313630203136302032766172208F 26 | :10018000636C6970426F7452696768740D306420E3 27 | :100190003276617220626D58590D0D2820613D2024 28 | :1001A000636C6970746C2C20623D20636C697062B2 29 | :1001B000722C20633D20626D58592E2075206420DA 30 | :1001C0006C207220312070697820737465702C2047 31 | :1001D00073686966742C20752064206C2072203846 32 | :0B01E00020706978207374657029009E 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo06.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20646F4B65792028207661725E202942 3 | :100010000D20206B6579203E722072203937203DFB 4 | :100020002069660D20202020202064726F702063DC 5 | :100030006C6970546F704C6566740D20207468652F 6 | :100040006E0D202072203938203D2069660D202059 7 | :100050002020202064726F7020636C6970426F747E 8 | :1000600052696768740D20207468656E0D202072D7 9 | :10007000203939203D2069660D2020202020206471 10 | :10008000726F7020626D58590D20207468656E0D76 11 | :100090002020312072203133203E20722031382040 12 | :1000A0003C20616E642069660D2020202020207293 13 | :1000B0003E2036202D203E722064726F7020380D55 14 | :1000C00020207468656E0D202072202D3220616E14 15 | :1000D00064203130203D2069662028207564290D78 16 | :1000E00020202020722031312073776170202D2054 17 | :1000F00031203C3C20312D0D202020202A2032644C 18 | :100100007570207377617020322B202B210D2020F9 19 | :100110007468656E0D202072202D3220616E64207F 20 | :1001200038203D2069662028206D76290D2020206A 21 | :1001300020722038202D2031203C3C20312D202AD7 22 | :100140000D20202020326475702073776170202B81 23 | :10015000210D20207468656E0D202064726F702060 24 | :10016000723E0D3B2028207661725E206B657929F6 25 | :100170000D0D3A2064402064757020402073776133 26 | :100180007020322B2040203B0D0D3A2073797320D4 27 | :1001900073797376617273202B20696340203B0072 28 | :00000001FF 29 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo07.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A2064756D70626C740D20203E72203E43 3 | :10001000720D2020313620737973203135207379A9 4 | :10002000732031207379730D20203134207379735C 5 | :1000300020313820737973203137207379730D2084 6 | :100040002030207379732032207379730D20203093 7 | :10005000203020617420723E202E20723E202E0D12 8 | :1000600020207370206940202E0D20203020382061 9 | :100070006174202E202E202E202E200D20203020B6 10 | :100080003136206174202E202E202E202E200D3B74 11 | :100090000D0D3A207365747570626C7474360D20A2 12 | :1000A00020636C6970546F704C65667420644020E6 13 | :1000B00061740D2020636C6970426F7452696768C7 14 | :1000C000742064400D2020636C697020626D585963 15 | :1000D0002064402061740D3B0D0D3A20626C7474F5 16 | :1000E0003620636C5061740D20203120766D6F6472 17 | :1000F00065203264757020300D202074696C652095 18 | :10010000737761702064726F702030207377617034 19 | :100110000D202030203020617420313630203136DF 20 | :100120003020636C69700D2020636C6970546F70AF 21 | :100130004C6566740D2020626567696E0D20202075 22 | :1001400020646F4B657920647570203E72203133D6 23 | :10015000203D2069660D20202020202073657475C5 24 | :1001600070626C7474360D2020202020203E722096 25 | :100170003264757020626C7420723E0D2020202045 26 | :1001800020202E7265677320723E0D20202020747F 27 | :1001900068656E207365747570626C7474360D20BA 28 | :1001A0002020203E7220326475702064756D70626C 29 | :1001B0006C7420723E0D2020723E203237203D208C 30 | :1001C000756E74696C0D202064726F702064726F9C 31 | :1001D000702064726F700D20203020766D6F646522 32 | :1001E0000D3B0D0D31203120327661722072657029 33 | :0201F00073009A 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/BlitDemo/BlitDemo08.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20646F4B6579370D2020646F4B65791A 3 | :10001000203E72207220313030203D2069660D2054 4 | :1000200020202064726F7020726570730D20207420 5 | :1000300068656E0D2020723E0D3B0D0D3A206475F3 6 | :100040006D70626C74730D202064756D70626C74D9 7 | :100050000D20203132382030206174207265707399 8 | :100060002064400D202073776170202E202E0D3BE0 9 | :100070000D0D28207465737420626C7473290D3A19 10 | :1000800020626C747437202820626D2064696D29A9 11 | :100090000D2020636C506174203120766D6F646593 12 | :1000A00020326475702033310D202074696C652016 13 | :1000B000737761702064726F7020333120737761C1 14 | :1000C000700D2020323020323020617420313430E5 15 | :1000D0002031343020636C69700D2020636C6970AE 16 | :1000E000546F704C6566740D2020626567696E0DF3 17 | :1000F00020202020646F4B65793720647570203E86 18 | :1001000072203133203D0D2020202069660D2020F3 19 | :10011000202020207365747570626C7474360D2015 20 | :1001200020202020203E722032647570207265707D 21 | :10013000732064400D202020202020626C747320E6 22 | :100140002E7265677320723E0D2020202074686532 23 | :100150006E207365747570626C7474360D20202087 24 | :10016000203E7220326475702064756D70626C740C 25 | :100170007320723E0D2020723E203237203D2075C4 26 | :100180006E74696C0D202064726F702064726F70E1 27 | :100190002064726F700D20203020766D6F64650DC5 28 | :0201A0003B0022 29 | :00000001FF 30 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace.fth: -------------------------------------------------------------------------------- 1 | create cat ( 4x3) 2 | $0001 , $0202 , 3 | $0202 , $0272 , 4 | $FF00 , $0001 , 5 | $2000 , $0001 , 6 | $0FF00 , $0020 , 7 | $0032 , $4844 , 8 | $8040 , $2020 , 9 | $202C , $3222 , 10 | $9EC6 , $3A0E , 11 | $0202 , $060F , 12 | $0800 , $0240 , 13 | $0000 , $1000 , 14 | $4340 , $848C , 15 | $8084 , $4720 , 16 | $C202 , $0959 , 17 | $0191 , $F204 , 18 | $1112 , $1C00 , 19 | $0000 , $0000 , 20 | $FF48 , $3800 , 21 | $0000 , $0000 , 22 | $FF25 , $1C00 , 23 | $0000 , $0000 , 24 | $F820 , $E000 , 25 | $0000 , $0000 , 26 | 27 | 50 const maxCats 28 | : arr3b 29 | over + over + + 32 | ; 33 | 34 | 0 var numCats 35 | maxCats arr3b catList 36 | 37 | 0 var seed 38 | : rnd ( range -- rnd) 39 | seed dup >r @ 1+ 75 * 40 | dup r> ! u* swap drop 41 | ; 42 | 43 | : catKill 44 | numCats @ dup 1 > if 45 | 1- dup catList 46 | dup c@ swap 1+ c@ at 47 | 0 6176 blt ( del cat) 48 | numCats ! 49 | then ; 50 | 51 | : catInit ( nuCats --) 52 | maxCats numCats @ - 53 | min 54 | begin 55 | ?dup while 56 | numCats @ catList 57 | 128 rnd swap 58 | 2dup c! 1+ 59 | 136 rnd swap 60 | 2dup c! 1+ 61 | 16 rnd 1+ swap c! 62 | at 0 6176 blt 63 | 1 numCats +! 1- 64 | repeat ; 65 | 66 | : catMv ( y x dx -- y x) 67 | + dup 159 > if 68 | 160 - swap 24 + 69 | dup 159 > if 70 | drop 0 71 | then 72 | swap 73 | then 74 | ; 75 | 76 | : catsBlit ( --) 77 | 0 catList 78 | numCats @ 0 do >r 79 | r c@ r 1+ c@ 2dup at 80 | swap r 2+ c@ catMv 81 | over r 1+ c! ( nu x) 82 | dup r c! ( new y!) 83 | swap at 84 | 0 6176 0 6176 2blt 85 | r> 3 + ( next cat) 86 | loop drop 87 | ; 88 | 89 | : fps ( frames clock' -f) 90 | swap 1+ swap 91 | dup clock i@ - 92 | 0< if 93 | 50 + 0 0 at over 94 | numCats @ . . 95 | swap drop 0 swap 96 | then 97 | ; 98 | 99 | : doKey ( --) 100 | inkey dup 9 = if 101 | 1 catInit 102 | then 103 | dup 8 = if 104 | catKill 105 | then 106 | ; 107 | 108 | : nyans 109 | 1 vmode cls 110 | cat 6176 0 tile 111 | 10 catInit clock i@ 0 112 | begin 113 | catsBlit fps doKey 114 | 13 = until 115 | 0 vmode 116 | ; 117 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/BlitDemo/NyanRace.jpg -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/BlitDemo/NyanRace.zip -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000063726561746520636174202820347833DD 3 | :10001000290D20202430303031202C202430323063 4 | :1000200032202C0D20202430323032202C2024305D 5 | :10003000323732202C0D20202446463030202C2010 6 | :100040002430303031202C0D20202432303030202C 7 | :100050002C202430303031202C0D202024304646F6 8 | :100060003030202C202430303230202C0D20202421 9 | :1000700030303332202C202434383434202C0D20DE 10 | :10008000202438303430202C202432303230202CC0 11 | :100090000D20202432303243202C202433323232BF 12 | :1000A000202C0D20202439454336202C2024334198 13 | :1000B0003045202C0D20202430323032202C2024BA 14 | :1000C00030363046202C0D20202430383030202C83 15 | :1000D000202430323430202C0D2020243030303099 16 | :1000E000202C202431303030202C0D20202434339B 17 | :1000F0003430202C202438343843202C0D20202468 18 | :1001000038303834202C202434373230202C0D2045 19 | :10011000202443323032202C202430393539202C11 20 | :100120000D20202430313931202C20244632303427 21 | :10013000202C0D20202431313132202C2024314339 22 | :100140003030202C0D20202430303030202C202442 23 | :1001500030303030202C0D20202446463438202CDE 24 | :10016000202433383030202C0D2020243030303003 25 | :10017000202C202430303030202C0D2020244646E6 26 | :100180003235202C202431433030202C0D202024E7 27 | :1001900030303030202C202430303030202C0D20D6 28 | :1001A000202446383230202C202445303030202C7A 29 | :1001B0000D20202430303030202C202430303030BE 30 | :1001C000202C0D0D353020636F6E7374206D6178B7 31 | :0501D00043617473009F 32 | :00000001FF 33 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace01.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A2061727233620D20203C6275696C6423 3 | :10001000730D2020202033202A20616C6C6F740D1A 4 | :100020002020646F65733E206F766572202B206FF1 5 | :10003000766572202B202B0D3B0D0D3020766172E2 6 | :10004000206E756D436174730D6D617843617473D7 7 | :10005000206172723362206361744C6973740D0D98 8 | :10006000302076617220736565640D3A20726E648B 9 | :1000700020282072616E6765202D2D20726E642904 10 | :100080000D20207365656420647570203E722040E9 11 | :1000900020312B203735202A0D20206475702072E6 12 | :1000A0003E202120752A20737761702064726F7062 13 | :1000B0000D3B0D0D3A206361744B696C6C0D202073 14 | :1000C0006E756D436174732040206475702031201B 15 | :1000D0003E2069660D20202020312D20647570207F 16 | :1000E0006361744C6973740D202020206475702046 17 | :1000F0006340207377617020312B2063402061744E 18 | :100100000D2020202030203631373620626C7420BC 19 | :10011000282064656C20636174290D202020206EE6 20 | :10012000756D4361747320210D20207468656E2005 21 | :020130003B0092 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace02.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20636174496E69742028206E754361DB 3 | :100010007473202D2D290D20206D61784361747338 4 | :10002000206E756D436174732040202D0D20206D6E 5 | :10003000696E0D2020626567696E0D20203F647532 6 | :1000400070207768696C650D202020206E756D43E7 7 | :100050006174732040206361744C6973740D2020B7 8 | :10006000202031323820726E642073776170200D49 9 | :10007000202020203264757020632120312B0D2038 10 | :1000800020202031333620726E6420737761702017 11 | :100090000D202020203264757020632120312B0D2B 12 | :1000A00020202020313620726E6420312B2073777F 13 | :1000B00061702063210D20202020617420302036C3 14 | :1000C00031373620626C740D2020202031206E756F 15 | :1000D0006D43617473202B2120312D0D202072651A 16 | :1000E00070656174203B0D0D3A206361744D76207C 17 | :1000F0002820792078206478202D2D2079207829D7 18 | :100100000D20202B2064757020313539203E206968 19 | :10011000660D202020202020313630202D207377BE 20 | :100120006170203234202B0D202020202020647587 21 | :100130007020313539203E2069660D202020202096 22 | :1001400020202064726F7020300D2020202020207D 23 | :100150007468656E0D202020202020737761700D5B 24 | :0901600020207468656E0D3B005F 25 | :00000001FF 26 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace03.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A2063617473426C69742028202D2D2975 3 | :100010000D202030206361744C6973740D20206EB4 4 | :10002000756D436174732040203020646F203E72F0 5 | :100030000D2020202072206340207220312B20636D 6 | :100040004020326475702061740D20202020737769 7 | :100050006170207220322B206340206361744D76E2 8 | :100060000D202020206F766572207220312B2063B6 9 | :10007000212028206E752078290D202020206475ED 10 | :100080007020722063212028206E65772079212935 11 | :100090000D20202020737761702061740D202020B6 12 | :1000A0002030203631373620302036313736203276 13 | :1000B000626C740D20202020723E2033202B2028DB 14 | :1000C000206E65787420636174290D20206C6F6F39 15 | :1000D000702064726F700D3B0D0D3A2066707320B6 16 | :1000E00028206672616D657320636C6F636B2720D7 17 | :1000F0002D66290D20207377617020312B207377B6 18 | :1001000061700D202064757020636C6F636B2069D3 19 | :1001100040202D0D2020303C2069660D202020201D 20 | :100120003530202B20302030206174206F766572AE 21 | :100130000D202020206E756D436174732040202EA9 22 | :10014000202E0D20202020737761702064726F7044 23 | :10015000203020737761700D20207468656E0D3B30 24 | :100160000D0D3A20646F4B65792028202D2D290D27 25 | :100170002020696E6B6579206475702039203D20E0 26 | :1001800069660D202020203120636174496E6974F6 27 | :100190000D20207468656E0D202064757020382055 28 | :1001A0003D2069660D202020206361744B696C6CD2 29 | :0A01B0000D20207468656E0D3B0001 30 | :00000001FF 31 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyanRace04.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A206E79616E730D20203120766D6F6419 3 | :100010006520636C730D20206361742036313736A0 4 | :1000200020302074696C650D2020313020636174AC 5 | :10003000496E697420636C6F636B20694020300DDA 6 | :100040002020626567696E0D2020202020206361DA 7 | :100050007473426C69742066707320646F4B6579A9 8 | :100060000D20203133203D20756E74696C0D2020E9 9 | :0A0070003020766D6F64650D3B00D3 10 | :00000001FF 11 | -------------------------------------------------------------------------------- /Samples/BlitDemo/NyansUnclipped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/BlitDemo/NyansUnclipped.jpg -------------------------------------------------------------------------------- /Samples/BlitDemo/T2E2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/BlitDemo/T2E2 -------------------------------------------------------------------------------- /Samples/Debugger/Debugger.fth: -------------------------------------------------------------------------------- 1 | ( relative loader. 2 | loader block =blk# ) 3 | blk# @ 1 + load 4 | blk# @ 2 + load 5 | blk# @ 3 + load 6 | blk# @ 4 + load 7 | blk# @ 5 + load 8 | blk# @ 6 + load 9 | blk# @ 7 + load 10 | blk# @ 8 + load 11 | blk# @ 9 + load 12 | blk# @ 10 + load 13 | ( doesn't load test blk ) 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | : var[] 22 | over + + ; 24 | 25 | 8 const traceDepth 26 | traceDepth var[] trace[] 27 | 0 var traceSp 28 | 29 | : >trace ( cfa -- f ) 30 | traceSp @ traceDepth < 31 | dup if 32 | swap traceSp @ 33 | trace[] ! ( push cfa) 34 | 1 traceSp +! then ; 35 | 36 | : trace> ( bp -- cfa f|f) 37 | traceSp @ 0 > dup if 38 | -1 traceSp +! 39 | traceSp @ trace[] @ 40 | swap then ; 41 | : u. 0 d. ; 42 | : .trace dup 43 | 16384 < if ." Native" 44 | else dup pfa>nfa id. 45 | then space ." @0x" u. ; 46 | 47 | 0 var oldBase 48 | 49 | : >hex base @ oldBase ! 50 | hex ; 51 | 52 | : base> oldBase @ base ! 53 | ; 54 | 55 | : .trace[] ( index--valu) 56 | ." CFAs:" >hex 57 | traceSp @ 0 do 58 | i trace[] @ .trace 59 | cr 6 spaces 60 | loop .trace base> ; 61 | : p@ dup 0< if @ else 62 | i@ then ; 63 | : .mem 64 | >hex do i p@ ." 0x" u. 65 | 2 +loop base> ; 66 | 67 | : .ds ." Data:" 68 | sp i@ sp0 .mem ; 69 | 70 | : .rs ." Ret :" 71 | 1280 rp i@ 1+ .mem ; 72 | 0 var gMemS 0 var gMemL 73 | 8192 32768 + 600 - const 74 | vback 75 | : xchVram 76 | vram vback 600 0 do 77 | dup c@ >r over ic@ 78 | over c! over r> swap 79 | ic! 1+ swap 1+ swap 80 | loop drop drop ; 81 | 64 const kFigByteCodes 82 | 1 const kFigLit 83 | 4 const kFigOBranch 84 | 5 const kFigBranch 85 | 6 const kFigLoop 86 | 7 const kFigPlusLoop 87 | 46 const kFigExit 88 | 89 | : find 90 | -find drop drop pfa>cfa 91 | ; 92 | 93 | find abort var @bp 94 | 95 | : bpSet ( bp --) 96 | @bp @ swap ! ; 97 | 98 | : >bp ( cfa -- ) 99 | dup @ >trace if 100 | bpSet then ; 101 | 0 var condTrace 102 | 0 var condRef 103 | 0 var fallThru 104 | find abort var @condBp 105 | 106 | : dbCondStep ( bp -- bp) 107 | dup 1+ @ dup condRef ! 108 | dup @ condTrace ! 109 | @condBp @ swap ! 110 | dup 3 + fallThru ! ; 111 | 112 | : db(.")Step ( bp -- bp) 113 | 2+ count 114 | ; 115 | 116 | 117 | 118 | 119 | 120 | 121 | : ovc@ over c@ ; 122 | : dbOStep ( bp -- bp ) 123 | dup c@ kFigExit = if 124 | ;s 125 | then 126 | 2 ( default step) 127 | ovc@ kFigByteCodes < if 128 | drop 1 then 129 | ovc@ dup kFigOBranch < 130 | swap kFigPlusLoop > 131 | or 0= if 132 | drop dbCondStep 3 133 | then 134 | ovc@ kFigLit = if 135 | drop 3 then 136 | over @ [ find (.") ] 137 | literal = if 138 | drop db(.")Step then 139 | over + >bp ; 140 | 141 | ( block 6) 142 | : dbIn 143 | dup 0< if ( ram only) 144 | dup >bp 145 | then ; 146 | 147 | : dbIStep ( bp key --bp ) 148 | dbOStep @ dbIn ; 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 0 var oldSys1 allot 162 | : bpUI ( bp -- bp key ) 163 | key dup 8 = if 164 | xchVram key drop 165 | xchVram then 166 | dup 9 = if drop dbOStep 167 | 13 then 168 | dup 10 = if drop 169 | dbIStep 13 then ; 170 | : doBp ( bp exeCfa -- ) 171 | xchVram 172 | sysvars oldSys1 3 cmove 173 | cls .trace[] cr .ds cr 174 | .rs cr ." Mem:" gMemL @ 175 | gMemS @ .mem cr begin 176 | bpUI 177 | 13 = until drop 178 | xchVram oldSys1 179 | sysvars 3 cmove ; 180 | 181 | ( block 8: 54) 182 | : patchBp ( patch --p bp) 183 | r> r> 2 - dup >r swap 184 | >r 2dup ! ; 185 | : patchRef ( p r--) 186 | dup @ if swap over @ ! 187 | 0 swap ! 188 | else drop drop then ; 189 | : condBp 190 | trace> if fallThru 191 | patchRef then 192 | condTrace @ patchBp 193 | 0 condRef ! 194 | swap doBp 195 | ; 196 | 197 | find condBp @condBp ! 198 | 199 | 200 | 201 | ( block 9: 46) 202 | : bp ( breakpoint entry) 203 | condTrace @ condRef 204 | patchRef 205 | trace> if ( cfaToExe ) 206 | patchBp swap doBp 207 | else 208 | abort ( underflow) 209 | then ; 210 | 211 | find bp @bp ! 212 | 213 | : >mem over + gMemL ! 214 | gMemS ! ; 215 | 216 | : dbug ( cfa -- ) 217 | dbIn r> drop >r ; 218 | 219 | : debug find dbug ; 220 | 221 | ( Example definition to 222 | debug ) 223 | 224 | : u . ; 225 | : t 5 0 do i 1 and 226 | if ." hi " 227 | else i u then loop 228 | ; 229 | 230 | find t 32 >mem 231 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/Debugger.zip -------------------------------------------------------------------------------- /Samples/Debugger/Debugger00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :10000000282072656C6174697665206C6F61646527 3 | :10001000722E2020202020202020206C6F6164651B 4 | :100020007220626C6F636B203D626C6B2320292011 5 | :1000300020202020626C6B2320402031202B206C5C 6 | :100040006F616420202020202020202020626C6B03 7 | :100050002320402032202B206C6F61642020202040 8 | :10006000202020202020626C6B2320402033202B76 9 | :10007000206C6F616420202020202020202020621E 10 | :100080006C6B2320402034202B206C6F6164202077 11 | :100090002020202020202020626C6B23204020354F 12 | :1000A000202B206C6F616420202020202020202025 13 | :1000B00020626C6B2320402036202B206C6F616403 14 | :1000C00020202020202020202020626C6B23204034 15 | :1000D0002037202B206C6F616420202020202020DE 16 | :1000E000202020626C6B2320402038202B206C6F56 17 | :1000F000616420202020202020202020626C6B239F 18 | :1001000020402039202B206C6F616420202020208B 19 | :100110002020202020626C6B232040203130202BB7 20 | :10012000206C6F6164202020202020202820646F14 21 | :1001300065736E2774206C6F61642074657374201E 22 | :10014000626C6B20292020202020202020202020CD 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger01.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A207661725B5D20202020202020202075 3 | :1000100020202020202020202020203C6275696C98 4 | :10002000647320647570202B20616C6C6F742020C9 5 | :1000300020202020646F65733E206F766572202B30 6 | :10004000202B203B2020202020202020202020208A 7 | :1000500020202020202020202020202020202020A0 8 | :10006000202020203820636F6E73742074726163C7 9 | :1000700065446570746820202020202020747261FF 10 | :1000800063654465707468207661725B5D2074728C 11 | :100090006163655B5D2030207661722074726163FC 12 | :1000A0006553702020202020202020202020202088 13 | :1000B0002020202020202020202020202020202040 14 | :1000C00020202020202020203A203E747261636589 15 | :1000D000202820636661202D2D20662029202020E5 16 | :1000E0002020207472616365537020402074726117 17 | :1000F00063654465707468203C202020647570201E 18 | :100100006966202020202020202020202020202060 19 | :10011000202020202020207377617020747261637A 20 | :1001200065537020402020202020202020202020E7 21 | :1001300074726163655B5D2021202820707573688F 22 | :1001400020636661292020312074726163655370D9 23 | :10015000202B21207468656E203B20202020202049 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020203A2074726163653E20D8 26 | :1001800028206270202D2D2063666120667C662900 27 | :1001900020207472616365537020402030203E201F 28 | :1001A000647570206966202020202020202D3120B9 29 | :1001B00074726163655370202B2120202020202041 30 | :1001C000202020202020747261636553702040201D 31 | :1001D00074726163655B5D2040202020207377612D 32 | :1001E00070207468656E203B202020202020202075 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger02.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20752E203020642E203B2020202020F6 3 | :100010002020202020202020203A202E747261638E 4 | :1000200065206475702020202020202020202020A2 5 | :10003000202020203136333834203C206966202EA1 6 | :1000400022204E61746976652220202020656C7321 7 | :100050006520647570207066613E6E66612069641B 8 | :100060002E20202020207468656E207370616365E7 9 | :10007000202E22204030782220752E203B20202068 10 | :100080002020202020202020202020202020202070 11 | :100090002020202020203020766172206F6C644266 12 | :1000A0006173652020202020202020202020202077 13 | :1000B0002020202020202020202020202020202040 14 | :1000C00020202020202020203A203E6865782062D1 15 | :1000D0006173652040206F6C64426173652021204C 16 | :1000E000202020686578203B202020202020202010 17 | :1000F0002020202020202020202020202020202000 18 | :1001000020202020202020202020202020202020EF 19 | :100110002020203A20626173653E206F6C6442614A 20 | :1001200073652040206261736520212020203B20E0 21 | :1001300020202020202020202020202020202020BF 22 | :1001400020202020202020202020202020202020AF 23 | :1001500020202020202020202020202020203A2085 24 | :100160002E74726163655B5D202820696E6465781A 25 | :100170002D2D76616C752920202E22204346417357 26 | :100180003A22203E68657820202020202020202050 27 | :1001900020202074726163655370204020302064F9 28 | :1001A0006F202020202020202020202020202069B7 29 | :1001B0002074726163655B5D2040202E7472616300 30 | :1001C000652020202020202063722036207370615B 31 | :1001D00063657320202020202020202020206C6FA9 32 | :1001E0006F70202E747261636520626173653E20BA 33 | :0401F0003B20202070 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger03.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A2070402064757020303C2069662040A2 3 | :1000100020656C73652020202020206940207468B2 4 | :10002000656E203B20202020202020202020202022 5 | :1000300020203A202E6D656D2020202020202020B9 6 | :10004000202020202020202020202020203E686505 7 | :100050007820646F2069207040202E222030782282 8 | :1000600020752E20202032202B6C6F6F7020626153 9 | :1000700073653E203B2020202020202020202020AF 10 | :100080002020202020202020202020202020202070 11 | :100090002020202020203A202E6473202E2220446D 12 | :1000A0006174613A2220202020202020202020205E 13 | :1000B00020737020694020737030202E6D656D2094 14 | :1000C0003B20202020202020202020202020202015 15 | :1000D0002020202020202020202020202020202020 16 | :1000E000203A202E7273202E2220526574203A224C 17 | :1000F00020202020202020202020202031323830B5 18 | :1001000020727020694020312B202E6D656D203BC0 19 | :10011000202020302076617220674D656D5320309D 20 | :100120002076617220674D656D4C20203831393260 21 | :10013000203332373638202B20363030202D2063C4 22 | :100140006F6E7374202020766261636B2020202004 23 | :1001500020202020202020202020202020203A2085 24 | :100160007863685672616D20202020202020202096 25 | :100170002020202020202020207672616D207662B1 26 | :1001800061636B20363030203020646F20202020C7 27 | :1001900020202020647570206340203E72206F76FE 28 | :1001A000657220696340202020202020206F766522 29 | :1001B00072206321206F76657220723E2073776112 30 | :1001C00070202020202069632120312B207377614B 31 | :1001D0007020312B2073776170202020206C6F6F8E 32 | :1001E000702064726F702064726F70203B2020203A 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger04.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :10000000363420636F6E7374206B4669674279746F 3 | :1000100065436F6465732020203120636F6E7374B5 4 | :10002000206B4669674C6974202020202020202006 5 | :1000300020203420636F6E7374206B4669674F42D3 6 | :1000400072616E63682020202020203520636F6E4F 7 | :100050007374206B4669674272616E63682020206A 8 | :10006000202020203620636F6E7374206B466967F2 9 | :100070004C6F6F702020202020202020203720630C 10 | :100080006F6E7374206B466967506C75734C6F6F3D 11 | :10009000702020202020343620636F6E7374206B14 12 | :1000A0004669674578697420202020202020202080 13 | :1000B0002020202020202020202020202020202040 14 | :1000C00020202020202020203A2066696E642020F5 15 | :1000D0002020202020202020202020202020202020 16 | :1000E0002020202D66696E642064726F7020647217 17 | :1000F0006F70207066613E63666120203B20202087 18 | :1001000020202020202020202020202020202020EF 19 | :1001100020202020202020202020202020202020DF 20 | :1001200020202020202020202020202066696E64AE 21 | :100130002061626F727420766172204062702020AC 22 | :1001400020202020202020202020202020202020AF 23 | :1001500020202020202020202020202020203A2085 24 | :1001600062705365742028206270202D2D29202074 25 | :10017000202020202020202020406270204020735A 26 | :100180007761702021203B2020202020202020206B 27 | :10019000202020202020202020202020202020205F 28 | :1001A0002020202020202020203A203E627020287D 29 | :1001B00020636661202D2D20292020202020202052 30 | :1001C000202020206475702040203E747261636599 31 | :1001D000206966202020202020202020202020624E 32 | :1001E00070536574207468656E203B2020202020A9 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger05.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :10000000302076617220636F6E6454726163652084 3 | :1000100020202020202020202030207661722063A4 4 | :100020006F6E645265662020202020202020202032 5 | :10003000202030207661722066616C6C5468727585 6 | :10004000202020202020202020202066696E64208F 7 | :1000500061626F7274207661722040636F6E6442D9 8 | :100060007020202020202020202020202020202040 9 | :10007000202020202020202020202020203A206422 10 | :1000800062436F6E64537465702028206270202D67 11 | :100090002D2062702920202064757020312B204093 12 | :1000A0002064757020636F6E645265662021202085 13 | :1000B0002064757020402020636F6E645472616309 14 | :1000C0006520212020202020202040636F6E644284 15 | :1000D0007020402073776170202120202020202074 16 | :1000E0002020206475702033202B2066616C6C54B6 17 | :1000F0006872752021203B202020202020202020F5 18 | :1001000020202020202020202020202020202020EF 19 | :100110002020203A206462282E2229537465702002 20 | :1001200028206270202D2D20627029202020322B63 21 | :1001300020636F756E742020202020202020202036 22 | :1001400020202020203B2020202020202020202094 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger06.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A206F766340206F766572206340203B14 3 | :100010002020202020202020203A2064624F53748A 4 | :1000200065702028206270202D2D206270202920EC 5 | :1000300020202020647570206340206B466967454E 6 | :10004000786974203D206966202020202020203BF4 7 | :10005000732020202020202020202020202020204D 8 | :100060002020202020207468656E20202020202061 9 | :10007000202020202020202020202020202020326E 10 | :1000800020282064656661756C742073746570291E 11 | :1000900020202020202020206F766340206B46699E 12 | :1000A0006742797465436F646573203C20696620FC 13 | :1000B00020202064726F702031207468656E2020CB 14 | :1000C000202020202020202020206F7663402064E4 15 | :1000D0007570206B4669674F4272616E6368203CA1 16 | :1000E00020202073776170206B466967506C7573B0 17 | :1000F0004C6F6F70203E2020202020206F72203017 18 | :100100003D20696620202020202020202020202043 19 | :100110002020202020202064726F70206462436FB2 20 | :100120006E64537465702033202020202020746872 21 | :10013000656E20202020202020202020202020202C 22 | :10014000202020202020206F766340206B466967A6 23 | :100150004C6974203D20696620202020202020202A 24 | :10016000202064726F702033207468656E20202018 25 | :100170002020202020202020206F76657220402023 26 | :100180005B2066696E6420282E2229205D202020B5 27 | :1001900020206C69746572616C203D2069662020A6 28 | :1001A0002020202020202020202020202064726F6A 29 | :1001B00070206462282E222953746570207468654B 30 | :1001C0006E2020206F766572202B203E6270203BCF 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger07.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000002820626C6F636B2036292020202020205E 3 | :100010002020202020202020203A206462496E20C9 4 | :1000200020202020202020202020202020202020D0 5 | :100030002020202064757020303C20696620282014 6 | :1000400072616D206F6E6C79292020202020206441 7 | :100050007570203E6270202020202020202020204B 8 | :100060002020202020207468656E203B2020202046 9 | :100070002020202020202020202020202020202080 10 | :100080002020202020202020202020202020202070 11 | :100090002020202020203A2064624953746570207B 12 | :1000A00028206270206B6579202D2D627020202918 13 | :1000B0002020202020202020202020202020202040 14 | :1000C0002020202020202020202064624F537465AF 15 | :1000D000702040206462496E203B20202020202098 16 | :1000E0002020202020202020202020202020202010 17 | :1000F0002020202020202020202020202020202000 18 | :1001000020202020202020202020202020202020EF 19 | :1001100020202020202020202020202020202020DF 20 | :1001200020202020202020202020202020202020CF 21 | :1001300020202020202020202020202020202020BF 22 | :1001400020202020202020202020202020202020AF 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger08.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003020766172206F6C645379733120616C9B 3 | :100010006C6F742020202020203A206270554920E7 4 | :1000200028206270202D2D206270206B6579202998 5 | :10003000202020206B6579206475702038203D20B9 6 | :1000400069662020202020202020202020202078C9 7 | :1000500063685672616D206B65792064726F7020E1 8 | :1000600020202020202020207863685672616D2097 9 | :100070007468656E2020202020202020202020640D 10 | :1000800075702039203D2069662064726F7020648D 11 | :10009000624F5374657020202020313320746865CE 12 | :1000A0006E20202020202020202020202020202002 13 | :1000B00020647570203130203D2069662064726FA5 14 | :1000C0007020202020202020202064624953746565 15 | :1000D00070203133207468656E203B202020202062 16 | :1000E000203A20646F427020282062702065786575 17 | :1000F000436661202D2D202920202020786368561A 18 | :1001000072616D202020202020202020202020200F 19 | :10011000202020202073797376617273206F6C64C5 20 | :1001200053797331203320636D6F76652020636CC3 21 | :1001300073202E74726163655B5D206372202E6490 22 | :10014000732063722020202E7273206372202E226F 23 | :10015000204D656D3A2220674D656D4C2040202072 24 | :10016000674D656D532040202E6D656D20637220B4 25 | :10017000626567696E202020202020202062705553 26 | :100180004920202020202020202020202020202046 27 | :1001900020203133203D20756E74696C2064726FAD 28 | :1001A0007020202020202020202020786368567294 29 | :1001B000616D206F6C6453797331202020202020E2 30 | :1001C0002020202073797376617273203320636D51 31 | :1001D0006F7665203B20202020202020202020201A 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger09.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000002820626C6F636B20383A20353429202019 3 | :100010002020202020202020203A20706174636856 4 | :1000200042702028207061746368202D2D7020623A 5 | :1000300070292020723E20723E2032202D206475CF 6 | :1000400070203E722073776170202020203E722045 7 | :10005000326475702021203B202020202020202089 8 | :10006000202020203A207061746368526566202841 9 | :10007000207020722D2D2920202020202020206477 10 | :10008000757020402069662073776170206F7665F7 11 | :1000900072204020212020202020302073776170A2 12 | :1000A000202120202020202020202020202020204F 13 | :1000B00020656C73652064726F702064726F7020AD 14 | :1000C0007468656E203B20203A20636F6E64427036 15 | :1000D0002020202020202020202020202020202020 16 | :1000E00020202074726163653E2069662066616C21 17 | :1000F0006C54687275202020202020202020207041 18 | :1001000061746368526566207468656E20202020E3 19 | :100110002020202020636F6E64547261636520404C 20 | :1001200020706174636842702020202020203020DD 21 | :10013000636F6E64526566202120202020202020DD 22 | :10014000202020202020207377617020646F42706F 23 | :1001500020202020202020202020202020203B2084 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :1001900066696E6420636F6E6442702040636F6EA8 28 | :1001A0006442702021202020202020202020202098 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger10.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000002820626C6F636B20393A20343629202017 3 | :100010002020202020202020203A2062702028202C 4 | :10002000627265616B706F696E7420656E7472794F 5 | :1000300029202020636F6E64547261636520402024 6 | :10004000636F6E64526566202020202020706174EA 7 | :100050006368526566202020202020202020202058 8 | :1000600020202020202074726163653E2069662074 9 | :100070002820636661546F45786520292020202060 10 | :100080002070617463684270207377617020646FC0 11 | :100090004270202020202020656C736520202020C5 12 | :1000A0002020202020202020202020202020202050 13 | :1000B00020202061626F7274202820756E64657242 14 | :1000C000666C6F772920202020207468656E203BA5 15 | :1000D0002020202020202020202020202020202020 16 | :1000E0002020202020202020202020202020202010 17 | :1000F0002020202020202020202066696E6420629D 18 | :1001000070204062702021202020202020202020EC 19 | :1001100020202020202020202020202020202020DF 20 | :100120002020202020202020202020203A203E6D4A 21 | :10013000656D206F766572202B20674D656D4C20B4 22 | :1001400021202020202020674D656D532021203B59 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020203A20646275672028203B 26 | :10018000636661202D2D2029202020202020202082 27 | :1001900020206462496E20723E2064726F70203E9F 28 | :1001A00072203B20202020202020202020202020E2 29 | :1001B000202020202020202020202020202020203F 30 | :1001C00020203A2064656275672066696E64206449 31 | :1001D000627567203B202020202020202020202026 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/Debugger11.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000028204578616D706C6520646566696E694D 3 | :1000100074696F6E20746F2020202064656275679C 4 | :1000200020292020202020202020202020202020C7 5 | :1000300020202020202020202020202020202020C0 6 | :1000400020202020202020202020203A2075202E33 7 | :10005000203B202020202020202020202020202085 8 | :10006000202020203A20742035203020646F206921 9 | :10007000203120616E642020202020202020206953 10 | :1000800066202E2220686920222020202020202087 11 | :100090002020202020202020656C73652069207599 12 | :1000A000207468656E206C6F6F7020202020203BCC 13 | :1000B0002020202020202020202020202020202040 14 | :1000C0002020202020202020202020202020202030 15 | :1000D0002020202020202020202020202020202020 16 | :1000E0002066696E642074203332203E6D656D2079 17 | :1000F0002020202020202020202020202020202000 18 | :1001000020202020202020202020202020202020EF 19 | :1001100020202020202020202020202020202020DF 20 | :1001200020202020202020202020202020202020CF 21 | :1001300020202020202020202020202020202020BF 22 | :1001400020202020202020202020202020202020AF 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112025.jpg -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112026.jpg -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112027.jpg -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112028.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112028.jpg -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112029.jpg -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112030.jpg -------------------------------------------------------------------------------- /Samples/Debugger/ExampleScreenshots/300920112031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Debugger/ExampleScreenshots/300920112031.jpg -------------------------------------------------------------------------------- /Samples/GDemo/GDemo.fth: -------------------------------------------------------------------------------- 1 | ( Block 1) 2 | 5 var seed 3 | : rnd ( range -- random ) 4 | seed @ 1+ 75 * dup seed 5 | ! u* swap drop 6 | ; 7 | 8 | ( graphic demo 9 | UDGs: Invader, mini 10 | pacman, mini-ghost, 11 | man, dog, quaver, 12 | Invader2, 8. ) 13 | 14 | : cdata ; 15 | 16 | : var[] over + + ; 18 | 19 | 20 | 21 | 2 base ! 22 | cdata udgs 23 | 00101000 c, 24 | 01111110 c, 25 | 11011011 c, 26 | 11111111 c, 27 | 10011001 c, 28 | 10100101 c, 29 | 00000000 c, 30 | 00000000 c, 31 | 32 | 00111100 c, 33 | 01111110 c, 34 | 11111110 c, 35 | 11111000 c, 36 | 11110000 c, 37 | 11111110 c, 38 | 01111110 c, 39 | 00111100 c, 40 | 41 | 00111100 c, 42 | 11111111 c, 43 | 10010011 c, 44 | 10110111 c, 45 | 11111111 c, 46 | 11111111 c, 47 | 11011011 c, 48 | 01001001 c, 49 | 50 | 00111000 c, 51 | 00111000 c, 52 | 00010010 c, 53 | 11111110 c, 54 | 10010000 c, 55 | 00101000 c, 56 | 00101000 c, 57 | 00101000 c, 58 | 59 | 60 | 61 | 00000000 c, 62 | 00000000 c, 63 | 00000111 c, 64 | 10000111 c, 65 | 01111100 c, 66 | 01111000 c, 67 | 10000100 c, 68 | 01000100 c, 69 | 70 | 00000011 c, 71 | 00011111 c, 72 | 01111101 c, 73 | 01100001 c, 74 | 01000011 c, 75 | 01000011 c, 76 | 11000000 c, 77 | 11000000 c, 78 | 79 | 80 | 81 | 00011000 c, 82 | 00111100 c, 83 | 00011000 c, 84 | 00111100 c, 85 | 01111110 c, 86 | 11011011 c, 87 | 11111111 c, 88 | 00011000 c, 89 | 90 | 10000000 c, 91 | 11100000 c, 92 | 11110000 c, 93 | 11111100 c, 94 | 10110000 c, 95 | 00011000 c, 96 | 00001100 c, 97 | 00000110 c, 98 | 99 | 100 | 101 | decimal 102 | 103 | : udg 104 | 8 * vram + 600 + 105 | ; 106 | 107 | : initudg ( src dst num ) 108 | 8 * 0 do 109 | over c@ over ic! 110 | swap 1+ swap 1+ 111 | loop 112 | drop drop 113 | ; 114 | 115 | : tudgs ( addr -- ) 116 | 8 0 do 117 | i over ic! 118 | 2 + 119 | loop 120 | ; 121 | : scraddr ( x y ) 122 | 25 * + vram + 123 | ; ( 6 w ) 124 | 125 | 100 const maxAnim 126 | maxAnim var[] poz 127 | 128 | : initpos ( lim ) 129 | 0 do 130 | vram 600 rnd + i poz 131 | ! loop ; 132 | 133 | : range ( vramaddr -- ) 134 | dup vram < if 135 | 600 + 136 | then 137 | dup vram 599 + > if 138 | 600 - 139 | then ; 140 | 141 | : vcalc ( vramaddr -- ) 142 | 3 rnd 1 - 25 * + 3 rnd 143 | 1 - + range ; 144 | 145 | : udgmove ( lim -- ) 146 | 0 do 147 | i poz @ dup 148 | vcalc ( old new ) 149 | swap 32 swap ic! 150 | i 7 and over ic! 151 | i poz ! 152 | loop ; 153 | 154 | : fps ( frms timo lim) 155 | >r swap 1+ swap 156 | dup clock i@ - 0< if 157 | 0 0 at ." fps " drop 158 | . 0 ." #" r . 159 | clock i@ 49 + 160 | then r> ; 161 | : doKey 162 | dup 9 = if 163 | drop 1+ maxAnim min 0 164 | then dup 8 = if 165 | drop 1 - 1 max 0 166 | then 32 = ; 167 | 168 | : gdem ( initialUdgs ) 169 | udgs 0 udg 8 initudg 170 | maxAnim initpos 171 | 0 clock i@ 49 + rot 172 | begin 173 | dup udgmove fps 174 | inkey doKey until 175 | drop drop drop ; 176 | -------------------------------------------------------------------------------- /Samples/GDemo/GDemo.hex.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/GDemo/GDemo.hex.zip -------------------------------------------------------------------------------- /Samples/HiRes/Figgy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/HiRes/Figgy.gif -------------------------------------------------------------------------------- /Samples/HiRes/Figgy00.hex: -------------------------------------------------------------------------------- 1 | :10000000636461746120666967677920202020201d 2 | :100010002020202020202020202c696d6720849d16 3 | :100020004e8784214e8783428e6783429067834147 4 | :1000300061873341618833416070435960704499ee 5 | :10004000607038216c7038228c70389c9076389ca7 6 | :100050009186389c8e883b9c8e88439c8e87849d9d 7 | :100060004e8784214e8783428e6783429067834107 8 | :1000700061873341618833416070435960704499ae 9 | :10008000607038216c7038228c70389c9076389c67 10 | :100090009186389c8e883b9c8e88439c8e87849d5d 11 | :1000a0004e8784214e8783428e67834290678341c7 12 | :1000b000618733416188334160704359607044996e 13 | :1000c000607038216c7038228c70389c9076389c27 14 | :1000d0009186389c8e557f555f75575d7f2d367f95 15 | :1000e0007b3f7d5b7e5b7f366f7f573f7f3b7f76bd 16 | :1000f0006e6f7e7f767f766f7f3d5f7f7e6d7f77d1 17 | :100100003f765b377f3d7b777f673f7e6d7f3b7fb1 18 | :10011000553f7f2f7d5b7f773f7d3b777e202c692e 19 | :100120006d67206b6d5f7f7e6d7d776f5f5d6f7d2f 20 | :100130006f7f6e7f6f7f3f377e7f6d7f7f4d7f5fed 21 | :100140005b7f3d7b775f7f7d5f3b7f5d7f7b7f3b21 22 | :100150007f7b6e5f7f7f377f3b7f7b767f7f567fa6 23 | :100160007b776f7f2e7f7f755f7f6d7f76766f7f6a 24 | :100170006f5f3f7f7e777e6f7e7d7b7f5b7f7f6d56 25 | :10018000577f5b7f7b4f3e7f7e6d7f3f3b7f3d7721 26 | :100190007d767f7b977f367f753f75577e5b7736a1 27 | :1001a0007f766f7e7f5b3f766f7e6d7f6d7b7b5f43 28 | :1001b0007f2a7e776e5f7f757f6d3f7b2f7d2b7ee5 29 | :1001c000777f6f5d7f5b7f357d5f7f5e7d7f7b6f40 30 | :1001d0003e7b7d3f7b7f5b7f5e7b6f7f7d6f7d6f37 31 | :1001e0005d7f565f776f5f3e7d7b6f7f2d777f6b87 32 | :0401f0003f7d7720b8 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy01.hex: -------------------------------------------------------------------------------- 1 | :100000002c696d67205f3e7d7f6d3f7f7d5b7f5bf1 2 | :10001000377f3f7f3b7f7b7f5d7f7f3e7f7f3d6f75 3 | :100020007d6f5d7f3b7f7b5f7f3e7f7f7b7f7f3a06 4 | :100030007f7f755f7e7b7b577f5f3e7b7f6d7f5bc6 5 | :100040007f5b3f7c6f7e7f757d7b6f7d6f7e6d7f7d 6 | :10005000766f7f3d777e5d7f7b6f5d3f763f766f0e 7 | :100060006d3b765f377e6d7b2e7d77766f7e6d7f05 8 | :100070007d6f5e7d776e772e7f7d6f5d3f7b6f3d01 9 | :100080005f733f6d2f7e5b7f3e577e6f7d577f6e28 10 | :100090006d7f3f766e7d6b7f5d5f79775f7b2f7eb7 11 | :1000a0005b7f5b3f763e7b7e6b5f367d6f7f775fee 12 | :1000b0003a7f7d557f5b3f7b5f7b2f7d377f377f2f 13 | :1000c0006b3f7b377f567f7d3b5f7f5b7f7b6f5dc9 14 | :1000d000775e7b775f7e6d7f4e426b3f7d5b7f4db2 15 | :1000e0007b7a6c7e7e6f7e7d7f7b377f367b6f7dfc 16 | :1000f000675f7e7b6f7f3f3e7b7f775f3f7b377f96 17 | :100100007f765f7e202c696d67205f7e7f7e767fa5 18 | :100110007d7b377f573f7f3b766e5d7f4a5f7b37c6 19 | :100120007f7d6f7d377d2b7f2d7f3f7a6b7f6a5e72 20 | :100130005f7b777f6d5d7b6f3c777f7f766f7b2bff 21 | :100140003f767f7f7f7f555f7d377d377e6d7e5f1a 22 | :100150007b577f2d7f5d7f2b7a5f7b377d2b7f6f7a 23 | :100160003a5b7f367f7b3f6a4e427f753f752f7ebd 24 | :100170004b57453d577e5b772f3a357b5f7a6f5ef5 25 | :100180007b522488548d7f512a4a90618294802129 26 | :10019000808a8088498081876c7b8b63633072742e 27 | :1001a000557f7d776f34785c9c9f5d7f6d7f7b6f23 28 | :1001b0005d7f6d7f2d7f7b5f3d7f5d7b7f777f36b2 29 | :1001c0007f776e7d6f6f5b3f7b6f3f377e6f7b2ae4 30 | :1001d0007f6b3e6b6f3e7b7b3a777e557f567f6aa7 31 | :1001e0005f3f7f5f7f7b7e7f6e5b7f7f7f7f7f7fd9 32 | :0401f0007f7f7f404e 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy02.hex: -------------------------------------------------------------------------------- 1 | :10000000202c696d67207f7f7f7f7f7f7f7f7f7e52 2 | :100010005f7f2f7f7d7f7f7f777d337f553f6b9f16 3 | :100020003a4e9583917158338162282680248094ba 4 | :1000300040844889258195a0225488a0457528a030 5 | :1000400052429052445c3c843061308082488082cd 6 | :10005000248090238141988480802a882884808409 7 | :100060008082829480a04288822481342e438460de 8 | :1000700064702c2b7d3f756f5f765d3a6f7f5d7b83 9 | :100080007f6b3f765e966d5f7e5f7d5b7f2b7f76bd 10 | :100090006f6e7d573f7e3d777b377d2929232f4b20 11 | :1000a0006b7f2d2aa04f7f7f7f7f7d2c5b5f7f7fc3 12 | :1000b0007f7f7f777f7f7f7e552d2b292b7f7a5502 13 | :1000c000352a529654242e552a5a525591973f5a02 14 | :1000d00075272649344d55904090488284a080a0d1 15 | :1000e0005489848940309523a06098822881528267 16 | :1000f0009a2a826a684b89529041828a9180409004 17 | :100100005081848052202c696d67204ea0808180b0 18 | :100110008080829081929282924488498184a0a0ba 19 | :1001200080808948524588885049908294a08028d0 20 | :10013000803a4c8840498091809027878563742855 21 | :100140004e84236b3f7b377f5b3f7d5b3d5b775fff 22 | :10015000772f7e5d7f6b757a5a59302d358d2f7ec6 23 | :100160004294a0809042882292a081822881228499 24 | :10017000292855958535992a522b95292a48525276 25 | :10018000524a553c2840844c89a085a062222c8488 26 | :100190008490a0a0289a8b82888080828428924ca8 27 | :1001a000808080292888822553376d9a4729613cb1 28 | :1001b0008c408428212c8a4e836a344544404580f3 29 | :1001c0008448804488912a2249732d85622a2c49cb 30 | :1001d00092549125492a522222a02487a02292a03b 31 | :1001e0008192809280919c848080819422818288f7 32 | :0401f0008094852052 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy03.hex: -------------------------------------------------------------------------------- 1 | :100000002c696d67209480328280892178684880cd 2 | :1000100025808055802d4f4d37766c7e4d8b9e55bb 3 | :1000200026555571573d6b2a2a4a90532a3a758aac 4 | :100030004280498088a089908193286b529595854c 5 | :10004000958182284a2868808580802b9421842489 6 | :100050004195277e7e604088498280808050404064 7 | :100060008028a088922440488080488184953e5a08 8 | :10007000512280924488918284958082508c26807f 9 | :100080002a988d9280924290819082922a84502266 10 | :1000900088288048804892458532625625454090a0 11 | :1000a0005080408180a08190834060559381408042 12 | :1000b0004849808089a08080408090a08222888bdf 13 | :1000c0008328648b908080802c4035882f9e656dbe 14 | :1000d0005d302d4a923b364a55225555342d2a54cf 15 | :1000e00084544455902529918490258491409522eb 16 | :1000f000818290252b54292a292c292b5f3e7a595d 17 | :100100009b787772202c696d672076342b9a6b551b 18 | :100110002e5d802284387b7f3e7f7b476f7f7f7f91 19 | :100120007f7f7f7f7f2f2f775d7b7f3d7f698288f9 20 | :1001300051a02d34955d9080918080818280808156 21 | :100140008072308491603028404881928480a04041 22 | :10015000814284885080a046868781288089825188 23 | :100160007252242448808090a08080608a518c88bc 24 | :10017000849022449187887182945c44599252857c 25 | :1001800024882992444592285329452a4a585d35a6 26 | :100190002c5b75952f2a52555f3a3664459a553532 27 | :1001a0002a6d5b2535252d5b2a5b36754f353189e8 28 | :1001b000329565893a5595565446779648234d6a47 29 | :1001c0006f7f6e7d777b726c5f3f7f7d7b7f6f7f04 30 | :1001d0007f6e7f7f7f7f7f7f7f7f7f7f7f6f5f7f70 31 | :1001e0007f7f7f7f7d9b27376b5e7d7f5d748089fe 32 | :0401f000a080548017 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy04.hex: -------------------------------------------------------------------------------- 1 | :10000000202c696d6720222e5c98889080818088e2 2 | :1000100080a086809080808880a080a048818b21ed 3 | :1000200063a041462a392a35408a429638588428a6 4 | :10003000425871a02a429698519852464a94519536 5 | :10004000355182292488332465242d2c2b5b573687 6 | :100050006e5a7b367c57766e5b766f5a546f2a7772 7 | :100060004d372e755f5b3b2b3e7555356f2d567d9d 8 | :100070004a5b5e77565d5b6a3d2a4b326a5a775d12 9 | :10008000299a5256525495952250782d8e83444089 10 | :1000900082a0837f7f7f777f7f773d7f7f7f3f7fda 11 | :1000a0007f677f7f7f7f7f7f7f7f775769885f7fd5 12 | :1000b0009e5d8428419524929122805694578528ec 13 | :1000c00030844284404a909254448895282948912b 14 | :1000d00055918a48912595234a604b965552345440 15 | :1000e000419e502929212a425694544991228499ab 16 | :1000f00084245454552f5a6b366a5d7e555f3a6b93 17 | :100100005f2a7b2a7e202c696d6720759f3a5e7579 18 | :100110006f3d356d6b5f256f596b2d3b966d253aa5 19 | :100120006b5a76557f6a5e7a6b5b3676567d555b89 20 | :100130003b6b2e6a6a4b3e6a6f5b366f5a59252db0 21 | :10014000892b286a5d9a40418a8182a08830458245 22 | :100150007c7f9f938542445027757668653444546c 23 | :1001600044492a2992244a4c9044944990824488d4 24 | :100170004294a04245322122487592244a4d2d8d49 25 | :1001800095353c4a54552a52284b90565452552c7a 26 | :100190005252554a5195224a5124492a88529a2846 27 | :1001a000292a4985955535533e55372b3e755b3e7b 28 | :1001b00075555f3a7d2b6b2b3b2b3b2a6d573d6d65 29 | :1001c0005f346f545d73255f396b3e6a5b4e7a6bab 30 | :1001d0005d3735372e6d2a6a55372d3b367d6b5f7f 31 | :1001e000352a6f5a77752b6b2d6d2f5e5a766d5ba6 32 | :0401f000366d5b20ed 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy05.hex: -------------------------------------------------------------------------------- 1 | :100000002c696d6720366a5a5a5356595a352a4216 2 | :100010008440924588425434412a9094812a82a097 3 | :100020004a4a26a08528824a224a29842a88658449 4 | :1000300034605d4592459a2447944755255255258d 5 | :100040002992552b2a958a4a5a2c552a55552a55b4 6 | :100050002522552a549470926a9445948a2a4a7ba0 7 | :100060002a6a59372a6d5b2a5f3257366e5a776c87 8 | :10007000455f352d3e6a5b565d732d2b3e6d2a7ea6 9 | :1000800055772e7b565d7b266d5d372c7b56555ef6 10 | :100090006a6d55356e2a6d5b252a695e553f2a6a61 11 | :1000a0006b5d6b2a7f6a366d5b366f2a7b567a4ea4 12 | :1000b0006956545736366d573d356f2a5b546d3a45 13 | :1000c000555659326a2b9489258d2a52245a7248e2 14 | :1000d00085a0484095424a484a885a2a6b4a4b3183 15 | :1000e00086342724645591258a5c4c244955496bf4 16 | :1000f0007b6b572b2a3a7a4a552a552851559595a4 17 | :100100008491282a202c696d67202a55219a6d2a0e 18 | :10011000572d2a6b2a653557366d559d553d6d2ee9 19 | :100120006a5e726d5b353335772d5b3675277d2ab8 20 | :100130006f553b2b3e6a5b366d2a6a6f552e695ba5 21 | :10014000372d7b3d353f6a5f5a5a76564d2b6a599b 22 | :100150005735552d5a5532752c7b2d2b2d3b2d5750 23 | :100160003d35367d55372a6a6d2b265676675d37c5 24 | :100170002d6d2a6d4a5d5b366b5a356f35272d2df7 25 | :100180002b36555a4a5d53292a556d5531229526ed 26 | :1001900048522a9a552995252b2b246a4a525a5996 27 | :1001a0003c7b572f5d5b2f2a55556a2a342449948e 28 | :1001b0002b8429824a553255346b552a765a765506 29 | :1001c0005b372d3a6b562d5b2a6e5b6b2d255b36ac 30 | :1001d0006f5a565d565b366d2c7b6e6a5e7d566936 31 | :1001e0005b762d2a5b267d2677555e75352d2b7621 32 | :0401f0004c555d40cd 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy06.hex: -------------------------------------------------------------------------------- 1 | :10000000202c696d6720267a52572c575b36356a4b 2 | :1000100035552d592a5657952f25352b346a565567 3 | :100020006b266a5a766d2b9b365e555f34576e6d24 4 | :100030003a675e7555376d9a452d3b9a552b2a6b5d 5 | :10004000365d52566b552d5b2a5a5e552a6d2a55e0 6 | :100050005655572c6b5a2a6d352b3d29366d5a55fe 7 | :10006000427c522a4254212e358a842d822d4955b4 8 | :100070002a5a525594552b964d255d352b2d5b35bf 9 | :10008000356d5b2a546d5b352d6b2a6f5b7655772a 10 | :10009000365d5b366a566f9a767555356d2b5e7a8e 11 | :1000a0004b6a5e695f342d5b5a6b5336575d557de5 12 | :1000b000532b5659372a352d953f6d572a5b552ab4 13 | :1000c000655a532d966d2a752b2a5e692b362a7632 14 | :1000d0004a6a4a5b542a2d9b2a659b312a6a5a6eca 15 | :1000e0007a555596565d5b352e552d376c55566da8 16 | :1000f0004a566a5a7755372a5555355b346b566ad6 17 | :1001000056756e4a5a202c696d67206b9a6b5b326c 18 | :1001100069552a6b2e6a5d552b2d2d6a694e592f14 19 | :100120002a5b376d9675352a6a5a6a5b352b266dc0 20 | :100130002a5a55552a4b3a555a565a566d5a555db4 21 | :100140002a565d752b36652a5b2a6a55772d5b2dfd 22 | :100150002a6e596a553655372e5a552d6d2a5e55d9 23 | :100160007594772a565a552d2b6d953a553a552d3b 24 | :100170002a6f592b952a5255372c5b366d3a6555a7 25 | :100180002d35562d2a6d5a55352b54556a4d552d02 26 | :100190002955352a526b552a5934552a554d2a6a04 27 | :1001a0005e69562a5a7e5953366b5556552d5b5efd 28 | :1001b00055352d352a4a5652692d2a5a6a555535d4 29 | :1001c0006b2d2a6d5a552a6d56553a5655552d2b7d 30 | :1001d0003a6b2e5676765a6e5675366d9a5655523d 31 | :1001e0005655355535565b565d552a2a6b5a5b2d4b 32 | :0401f000292d552040 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/Figgy07.hex: -------------------------------------------------------------------------------- 1 | :100000002c696d6720546d3525526e55572d9525f9 2 | :100010002b36572c555a2b2a6b5e566d552b2a576b 3 | :100020005d332e6b5b556b3a667d552a562d9b943e 4 | :100030005b2a566a55566d35252d292a4a35952a4b 5 | :100040005b2a5a545b566a4a566d5655552b9a751b 6 | :10005000552a692b2a352a2d2a526a55883b9c8eaf 7 | :1000600088439c8e87449d4e8784214e8783628e71 8 | :100070006783429067834171873341618833416070 9 | :100080007843596070449960703c216c7038228cc0 10 | :1000900070389e9076389c9186389c8f883b9c8ed9 11 | :1000a00088439c8e87449d4e8784214e8783628e31 12 | :1000b0006783429067834171873341618833416030 13 | :1000c0007843596070449960703c216c7038228c80 14 | :1000d00070389e9076389c9186389c8f883b9c8e99 15 | :1000e00088439c8e87449d4e8784214e8783628ef1 16 | :1000f00067834290678341718733416188334160f0 17 | :1001000078435960202c696d672038228c70389ea6 18 | :100110009076389c9186389c8e20202020202020ac 19 | :1001200020202020202020202020202020202020cf 20 | :1001300020202020202020202020202020202020bf 21 | :1001400020202020202020202020202020202020af 22 | :10015000202020202020202020202020202020209f 23 | :10016000202020202020202020202020202020208f 24 | :10017000202020202020202020202020202020207f 25 | :10018000202020202020202020202020202020206f 26 | :10019000202020202020202020202020202020205f 27 | :1001a000202020202020202020202020202020204f 28 | :1001b000202020202020202020202020202020203f 29 | :1001c000202020202020202020202020202020202f 30 | :1001d000202020202020202020202020202020201f 31 | :1001e000202020202020202020202020202020200f 32 | :0401f000202020208b 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo.fth: -------------------------------------------------------------------------------- 1 | ( bitmap decompressor) 2 | : ,img 3 | 32 word ( space to end) 4 | 0 here 1+ here c@ 0 do 5 | dup i + c@ 127 and 6 | rot 7 << or ( hr dst) 7 | i 7 and if ( so writ) 8 | dup 7 i 7 and - 9 | >> c, 10 | then swap 11 | loop 12 | ; 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ( banner test code) 22 | 0 var xp 0 var yp 23 | : banByte ( byte x y --) 24 | swap 7 + swap 8 0 do 25 | rot dup 1 and 1+ pen 26 | 1 >> rot rot 2dup plot 27 | swap 1- swap loop 28 | drop drop drop ; 29 | : banTile ( addr -- ) 30 | 8 0 do 31 | dup c@ xp @ yp @ 32 | banByte 1 yp +! 1+ 33 | loop xp @ 8 + dup 42 < 34 | if -8 yp +! else drop 0 35 | then xp ! drop ; 36 | 37 | 38 | 39 | 40 | 41 | : banBM ( w ptr ) 42 | 0 yp ! 0 xp ! 43 | over 48 - over 44 | 6 0 do 6 0 do dup 45 | banTile 8 + loop over + 46 | loop drop drop 47 | ; 48 | 49 | : bmUI ( w ptr) 50 | key dup 10 = if 51 | >r over + r> then 52 | dup 11 = if 53 | >r over - r> then 54 | dup 9 = if 55 | >r 8 + r> then 56 | dup 8 = if 57 | >r 8 - r> then 58 | ; 59 | 60 | 61 | : vuBM ( addr w -- ) 62 | swap 63 | begin 64 | banBM 65 | bmUI 66 | 32 = until 67 | ; 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | ( some graphics tests 82 | Load figgy image first 83 | and rnd generator ) 84 | 0 kern const chrset 85 | 37760 const gscreen 86 | 3200 const gsize 87 | 160 const gwidth 88 | 89 | : clg 90 | gscreen gsize 0 fill ; 91 | 92 | : tblt ( bm h w ) 93 | 3 << rot rot ( 8w bm h) 94 | gwidth * 95 | 0 do ( w bm ) 96 | 2dup gscreen i + 97 | rot cmove 98 | over + 99 | gwidth +loop drop ; 100 | 101 | : gTest0 ( chrs) 102 | chrset gscreen 103 | gsize 0 do 104 | over i 1023 and + c@ 105 | i 1024 and 0= 0= xor 106 | over i + c! 107 | loop drop drop 108 | ; 109 | 110 | : gTest1 ( circles) 111 | 0 do 112 | 2dup i circ 113 | 2 +loop drop drop ; 114 | 115 | : hires 1 vmode begin 116 | key 32 = until 117 | 0 vmode ; 118 | 119 | 120 | 121 | : gTestFiggy 122 | figgy 20 20 tblt hires 123 | ; 124 | 125 | : twinkle 3 pen 1 vmode 126 | 0 do 160 rnd 160 rnd 127 | plot loop 128 | key 0 vmode ; 129 | 130 | : gCircs 1 vmode 0 do 131 | i 1 and 1+ pen 132 | 79 79 79 gTest1 133 | loop key drop 0 vmode ; -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000028206269746D6170206465636F6D707221 3 | :100010006573736F72292020203A202C696D672048 4 | :1000200020202020202020202020202020202020D0 5 | :1000300020202020333220776F72642028207370B4 6 | :1000400061636520746F20656E642920203020680C 7 | :1000500065726520312B2068657265206340203011 8 | :1000600020646F20202020206475702069202B20C0 9 | :1000700063402031323720616E6420202020202010 10 | :1000800020726F742037203C3C206F72202820683B 11 | :100090007220647374292020202069203720616E2B 12 | :1000A00064206966202820736F2077726974292084 13 | :1000B000202020202064757020372069203720619F 14 | :1000C0006E64202D202020202020202020203E3E55 15 | :1000D00020632C20202020202020202020202020D1 16 | :1000E00020202020207468656E20737761702020A6 17 | :1000F0002020202020202020202020206C6F6F70C6 18 | :1001000020202020202020202020202020202020EF 19 | :100110002020203B202020202020202020202020C4 20 | :1001200020202020202020202020202020202020CF 21 | :1001300020202020202020202020202020202020BF 22 | :1001400020202020202020202020202020202020AF 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo01.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :10000000282062616E6E6572207465737420636F60 3 | :1000100064652920202020202030207661722078FD 4 | :1000200070203020766172207970202020202020DE 5 | :1000300020203A2062616E4279746520282062791E 6 | :10004000746520782079202D2D2920202073776158 7 | :10005000702037202B207377617020382030206487 8 | :100060006F202020202020726F7420647570203152 9 | :1000700020616E6420312B2070656E2020202020AE 10 | :1000800031203E3E20726F7420726F74203264758E 11 | :100090007020706C6F7420207377617020312D2078 12 | :1000A00073776170206C6F6F7020202020202020DB 13 | :1000B0002064726F702064726F702064726F7020A1 14 | :1000C0003B202020202020203A2062616E54696C61 15 | :1000D0006520282061646472202D2D202920202095 16 | :1000E00020202038203020646F2020202020202055 17 | :1000F0002020202020202020202020202020647567 18 | :1001000070206340207870204020797020402020AB 19 | :100110002020202020202062616E427974652031E9 20 | :10012000207970202B2120312B202020206C6F6F14 21 | :100130007020787020402038202B20647570203487 22 | :1001400032203C2020206966202D38207970202B19 23 | :100150002120656C73652064726F702030202074DC 24 | :1001600068656E20787020212064726F70203B20BB 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo02.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A2062616E424D20282077207074722061 3 | :10001000292020202020202020202030207970201E 4 | :100020002120302078702021202020202020202016 5 | :10003000202020206F766572203438202D206F76A6 6 | :1000400065722020202020202020202020362030F3 7 | :1000500020646F2036203020646F2064757020206B 8 | :1000600020202020202062616E54696C6520382099 9 | :100070002B206C6F6F70206F766572202B20206CA8 10 | :100080006F6F702064726F702064726F7020202018 11 | :100090002020202020203B20202020202020202045 12 | :1000A0002020202020202020202020202020202050 13 | :1000B0002020202020202020202020202020202040 14 | :1000C00020202020202020203A20626D5549202821 15 | :1000D00020772070747229202020202020202020CA 16 | :1000E0002020206B657920647570203130203D2000 17 | :1000F00069662020202020202020202020203E7201 18 | :10010000206F766572202B20723E207468656E2009 19 | :100110002020202020647570203131203D20696628 20 | :1001200020202020202020202020202020202020CF 21 | :100130003E72206F766572202D20723E20746865B5 22 | :100140006E2020202020206475702039203D2069F9 23 | :100150006620202020202020202020202020202059 24 | :1001600020203E722038202B20723E207468656E5D 25 | :100170002020202020202020206475702038203D61 26 | :1001800020696620202020202020202020202020E0 27 | :10019000202020203E722038202D20723E207468BE 28 | :1001A000656E202020202020203B202020202020A1 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo03.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A207675424D2028206164647220772062 3 | :100010002D2D202920202020202020737761702082 4 | :1000200020202020202020202020202020202020D0 5 | :1000300020202020626567696E202020202020205B 6 | :10004000202020202020202020202020202020626E 7 | :10005000616E424D202020202020202020202020C2 8 | :100060002020202020202020626D554920202020A3 9 | :10007000202020202020202020202020202020336D 10 | :1000800032203D20756E74696C20202020202020B5 11 | :100090002020202020203B20202020202020202045 12 | :1000A0002020202020202020202020202020202050 13 | :1000B0002020202020202020202020202020202040 14 | :1000C0002020202020202020202020202020202030 15 | :1000D0002020202020202020202020202020202020 16 | :1000E0002020202020202020202020202020202010 17 | :1000F0002020202020202020202020202020202000 18 | :1001000020202020202020202020202020202020EF 19 | :1001100020202020202020202020202020202020DF 20 | :1001200020202020202020202020202020202020CF 21 | :1001300020202020202020202020202020202020BF 22 | :1001400020202020202020202020202020202020AF 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo04.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000002820736F6D652067726170686963732063 3 | :1000100074657374732020202020204C6F6164204D 4 | :10002000666967677920696D6167652066697273C3 5 | :1000300074202020616E6420726E642067656E6596 6 | :100040007261746F7220292020202030206B65722D 7 | :100050006E20636F6E737420636872736574202002 8 | :1000600020202020333737363020636F6E737420A2 9 | :100070006773637265656E20202020202033323044 10 | :100080003020636F6E7374206773697A6520202057 11 | :1000900020202020202031363020636F6E737420A2 12 | :1000A0006777696474682020202020202020202089 13 | :1000B0002020202020202020202020202020202040 14 | :1000C00020202020202020203A20636C6720202040 15 | :1000D0002020202020202020202020202020202020 16 | :1000E0002020206773637265656E206773697A6587 17 | :1000F00020302066696C6C203B20202020202020AE 18 | :1001000020202020202020202020202020202020EF 19 | :100110002020203A2074626C74202820626D2068B0 20 | :10012000207720292020202020202020202033205C 21 | :100130003C3C20726F7420726F7420282038772026 22 | :10014000626D2068292020677769647468202A20FE 23 | :10015000202020202020202020202020202020209F 24 | :100160003020646F2028207720626D2029202020F5 25 | :100170002020202020202020202020326475702084 26 | :100180006773637265656E2069202B202020202014 27 | :1001900020202020726F7420636D6F7665202020F0 28 | :1001A000202020202020202020202020206F766565 29 | :1001B00072202B20202020202020202020202020E2 30 | :1001C00020202020677769647468202B6C6F6F7023 31 | :1001D0002064726F70203B202020202020202020CF 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo05.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A2067546573743020282063687273291E 3 | :10001000202020202020202020202063687273656B 4 | :1000200074206773637265656E2020202020202075 5 | :10003000202020206773697A65203020646F20209B 6 | :100040002020202020202020202020202020206F61 7 | :100050007665722069203130323320616E64202B46 8 | :10006000206340202020202069203130323420615C 9 | :100070006E6420303D20303D20786F72202020209B 10 | :10008000206F7665722069202B206321202020209C 11 | :1000900020202020202020206C6F6F702064726F41 12 | :1000A000702064726F702020202020202020203BB0 13 | :1000B0002020202020202020202020202020202040 14 | :1000C0002020202020202020202020202020202030 15 | :1000D0002020202020202020202020202020202020 16 | :1000E000203A206754657374312028206369726355 17 | :1000F0006C65732920202020202020203020646F70 18 | :1001000020202020202020202020202020202020EF 19 | :10011000202020202020203264757020692063690F 20 | :100120007263202020202020202020202020322028 21 | :100130002B6C6F6F702064726F702064726F702010 22 | :100140003B20202020202020202020202020202094 23 | :1001500020202020202020202020202020203A2085 24 | :100160006869726573203120766D6F646520626501 25 | :1001700067696E20202020096B6579203332203D8D 26 | :1001800020756E74696C20202020202020202020E3 27 | :1001900020203020766D6F6465203B2020202020B9 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/HiresDemo06.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :100000003A20675465737446696767792020202019 3 | :10001000202020202020202020202066696767796A 4 | :100020002032302032302074626C7420686972652E 5 | :1000300073203B2020202020202020202020202052 6 | :1000400020202020202020202020202020202020B0 7 | :1000500020202020202020202020202020202020A0 8 | :10006000202020203A207477696E6B6C6520332045 9 | :1000700070656E203120766D6F6465202020203001 10 | :1000800020646F2031363020726E6420313630208B 11 | :10009000726E6420202020202020706C6F74206CF1 12 | :1000A0006F6F702020202020202020202020202062 13 | :1000B000206B6579203020766D6F6465203B2020B1 14 | :1000C0002020202020202020202020202020202030 15 | :1000D0002020202020202020202020202020202020 16 | :1000E000203A20674369726373203120766D6F6414 17 | :1000F00065203020646F20202020202020206920CF 18 | :100100003120616E6420312B2070656E202020200C 19 | :10011000202020202020203739203739203739204F 20 | :1001200067546573743120202020202020206C6FBC 21 | :100130006F70206B65792064726F70203020766D4F 22 | :100140006F6465203B2020202020202020202020BC 23 | :10015000202020202020202020202020202020209F 24 | :10016000202020202020202020202020202020208F 25 | :10017000202020202020202020202020202020207F 26 | :10018000202020202020202020202020202020206F 27 | :10019000202020202020202020202020202020205F 28 | :1001A000202020202020202020202020202020204F 29 | :1001B000202020202020202020202020202020203F 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | -------------------------------------------------------------------------------- /Samples/HiRes/MiniImg1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/HiRes/MiniImg1.gif -------------------------------------------------------------------------------- /Samples/Life/LifeImg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Life/LifeImg.jpg -------------------------------------------------------------------------------- /Samples/Life/LifeImg02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Life/LifeImg02.jpg -------------------------------------------------------------------------------- /Samples/Life/Life_Hex.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Life/Life_Hex.zip -------------------------------------------------------------------------------- /Samples/Oxo/Small/090820112001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Oxo/Small/090820112001.jpg -------------------------------------------------------------------------------- /Samples/Oxo/Small/090820112003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Oxo/Small/090820112003.jpg -------------------------------------------------------------------------------- /Samples/Oxo/Small/090820112004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Oxo/Small/090820112004.jpg -------------------------------------------------------------------------------- /Samples/Oxo/Small/OxoBitmaps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Snial/FIGnition/d1e21de7210a8a0196aa61cb14c386b2517d46c6/Samples/Oxo/Small/OxoBitmaps.png -------------------------------------------------------------------------------- /Samples/Oxo/mini_oxo.fth: -------------------------------------------------------------------------------- 1 | ( Simple oxo ) 2 | : 2drop drop drop ; 3 | 4 | : .brdLine 5 | cr ." -+-+-" cr ; 6 | 7 | : . Board 8 | ." 1|2|3" .brdLine 9 | ." 8|X|4" .brdLine 10 | ." 7|6|5" ; 11 | 12 | 4 const opp 13 | 64 15 + const (o) 14 | 64 24 + const (x) 15 | 16 | : cdata ; 17 | 18 | 0 var board 19 | 20 | 21 | cdata posConv 22 | 0 c, 0 c, 1 c, 2 c, 23 | 5 c, 8 c, 7 c, 6 c, 24 | 3 c, 25 | 26 | : pos2xy posConv + c@ 27 | 3 /mod 1 << swap 28 | 1 << swap ; 29 | 30 | : place ( pos ch -- f ) 31 | over 1 swap << board @ 32 | swap over or 33 | 2dup = if ( pc old nu ) 34 | 2drop 2drop 0 35 | else 36 | swap drop board ! 37 | swap pos2xy at emit 38 | 1 39 | then ; 40 | 41 | : range? (val lo hi -- 42 | val | 0 ) 43 | rot swap over < 44 | >r swap over > r> or 45 | if 46 | drop 0 47 | then 48 | ; 49 | 50 | : humPlay 51 | 0 begin drop 52 | begin 53 | key 49 57 range? 54 | dup until 55 | 48 - dup (o) place 56 | until 57 | ; 58 | 59 | 60 | 61 | : brdRange 1 - 7 and 1+ ; 62 | 63 | cdata compMoves 64 | 1 c, 2 c, 7 c, 0 c, 65 | 1 c, 2 c, 3 c, 6 c, 66 | 67 | : compPlay ( mv c h ..) 68 | 2dup opp + brdRange = 69 | >r over = r> or if 70 | over compMoves + 71 | c@ dup >r + brdRange 72 | r> 7 = 73 | else 74 | opp + 1 75 | then 76 | over (x) place drop 77 | ; ( .. -- mv c f ) 78 | 79 | 80 | 81 | : init 0 board ! cls .brd 82 | ; 83 | : win? 5 0 at 84 | ?dup if 85 | ." I WIN!" key drop 1 86 | else 87 | over compMoves + c@ 6 = 88 | ?dup if 89 | ." DRAW!" key drop 1 90 | else 0 then then ; 91 | 92 | : oxo 93 | init humPlay dup 1 and 94 | 4 * swap dup 95 | begin 96 | compPlay win? 97 | 0= while 98 | swap 1+ swap humPlay 99 | repeat 100 | 2drop ; -------------------------------------------------------------------------------- /Samples/TJoy/TJoy.fth: -------------------------------------------------------------------------------- 1 | sysvars 11 + const joy 2 | sysvars const cur 3 | 4 | : xyWrap swap 25 mod 5 | swap 20 mod 6 | ; 7 | 8 | : doJoy 9 | >r r 1 and if 10 | swap 24 + swap 11 | then 12 | r 2 and if 13 | 19 + 14 | then 15 | r 4 and if 16 | swap 1+ swap 17 | then 18 | r> 32 and if 19 | 1+ 20 | then 21 | ; 22 | 23 | : mv 24 | >r >r at 25 | cur ic@ 160 26 | = 0= if 27 | 32 emit 28 | then 29 | r> r> 30 | 2dup at 160 emit 31 | ; 32 | 33 | : tJoy 34 | 0 0 35 | begin 36 | 2dup 37 | joy ic@ doJoy 38 | xyWrap mv 39 | over 24 = over 19 = 40 | and until 41 | drop 42 | ; 43 | -------------------------------------------------------------------------------- /Samples/TJoy/TJoy00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000073797376617273203131202B20636F6EA8 3 | :100010007374206A6F790D737973766172732063DC 4 | :100020006F6E7374206375720D0D3A207879577274 5 | :1000300061702073776170203235206D6F640D2000 6 | :100040002073776170203230206D6F640D3B0D0D91 7 | :100050003A20646F4A6F790D20203E722072203161 8 | :1000600020616E642069660D202020207377617006 9 | :10007000203234202B20737761700D202074686546 10 | :100080006E0D202072203220616E642069660D2082 11 | :100090002020203139202B0D20207468656E0D2022 12 | :1000A0002072203420616E642069660D202020209B 13 | :1000B0007377617020312B20737761700D2020746D 14 | :1000C00068656E0D2020723E20333220616E642000 15 | :1000D00069660D20202020312B0D20207468656E6C 16 | :1000E0000D3B0D0D3A206D760D20203E72203E72A4 17 | :1000F0002061740D202063757220696340203136C1 18 | :10010000300D20203D20303D2069660D202020202C 19 | :10011000333220656D69740D20207468656E0D2082 20 | :1001200020723E20723E0D20203264757020617472 21 | :100130002031363020656D69740D3B0D0D3A207409 22 | :100140004A6F790D20203020300D202062656769CC 23 | :100150006E0D20202020326475700D202020206A32 24 | :100160006F792069634020646F4A6F790D202020E9 25 | :1001700020787957726170206D760D206F766572E8 26 | :10018000203234203D206F766572203139203D0DBC 27 | :1001900020616E6420756E74696C0D2064726F70DE 28 | :0301A0000D3B0014 29 | :00000001FF 30 | -------------------------------------------------------------------------------- /Samples/TJoy/TJoyOld00.hex: -------------------------------------------------------------------------------- 1 | :02000004008179 2 | :1000000073797376617273203131202B20636F6EA8 3 | :100010007374206A6F79202020737973766172730C 4 | :1000200020636F6E7374206375722020202020205F 5 | :1000300020203A20787957726170207377617020A0 6 | :100040003235206D6F6420202020202020737761BE 7 | :1000500070203230206D6F64203B20202020202033 8 | :10006000202020203A20646F4A6F79206475702028 9 | :100070003120616E6420696620726F742020202018 10 | :10008000203234202B20726F7420726F74207468B9 11 | :10009000656E202020202020647570203220616E43 12 | :1000A000642069662020202020202020202020207D 13 | :1000B00020202073776170203139202B20737761E5 14 | :1000C00070207468656E20202020647570203420B4 15 | :1000D000616E6420696620726F74202020202020C9 16 | :1000E0002020202020312B20726F7420726F74200A 17 | :1000F0007468656E2020202020202020333220616B 18 | :100100006E6420696620312B207468656E203B2068 19 | :100110002020203A206D76203E72203E72206174AD 20 | :1001200020637572206963402031363020203D20E5 21 | :10013000303D20696620333220656D697420746813 22 | :10014000656E20723E2020723E2032647570206100 23 | :10015000742031363020656D6974203B20203A20B0 24 | :10016000744A6F792030203020626567696E2032D2 25 | :1001700064757020202020206A6F792069634020F8 26 | :10018000646F4A6F7920787957726170206D76209C 27 | :10019000206F766572203234203D206F76657220A4 28 | :1001A0003139203D202020202020616E6420756E92 29 | :1001B00074696C2064726F70203B20202020202006 30 | :1001C000202020202020202020202020202020202F 31 | :1001D000202020202020202020202020202020201F 32 | :1001E000202020202020202020202020202020200F 33 | :0401F000202020208B 34 | :00000001FF 35 | --------------------------------------------------------------------------------