1 /* 2 3 A "hand crafted" V-Tech ROM that does not depend on stdlib 4 (You can remove the stdlib include and printf's and substitute them with put() ) 5 6 Mostly done via reverse-engineering 7 2017-01-08 Bernhard "HotKey" Slawik 8 9 */ 10 11 // Where should we keep the variables? You can #define this prior to including this header to overwrite its default 12 #define VAR_START 0xc000 13 14 #define VAR_START_VTECH VAR_START 15 #include "vtech.h" 16 #define VAR_START_USER (VAR_START_VTECH + VAR_SIZE_VTECH) 17 18 19 20 unsigned char buffer[100]; 21 unsigned char c; 22 unsigned char i; 23 pause()24void pause() { 25 beep(); 26 for(i=0; i<10; i++) { 27 delay_1fff(); 28 } 29 } 30 main(void)31void main(void) { 32 33 vtech_init(); // Checks for system architecture and sets up stuff 34 35 screen_reset(); // Especially when you compile in "rom_autorun" mode (where the screen is not yet properly initialized) 36 37 cursor_reset(); 38 //key_reset(); 39 40 screen_clear(); // Clear screen (contains garbage left in RAM). Cursor will NOT show if not done! 41 42 43 beep(); 44 for (c = 0; c < 160; c++) { 45 screen_put_char(0x40 + (c % 26)); 46 //MEMORY[0xdca0 + c] = 0x40 + (c % 26); 47 //screen_refresh_all(); 48 delay_1fff(); 49 } 50 51 put("STAND"); pause(); 52 put("ALONE"); pause(); 53 put("STAND"); pause(); 54 put("ALONE"); pause(); 55 put("STAND"); pause(); 56 put("ALONE"); pause(); 57 put("\n"); 58 pause(); 59 put("2017 B HotKey Slawik"); 60 pause(); 61 beep(); 62 key_get_char(); 63 put("\n"); 64 65 //sprintf(buffer, "%d", 123); printf(buffer); pause(); 66 //printf("New\nLine"); 67 //pause(); 68 69 //for (c=0; c<10; c++) { printf("ABC"); pause(); } 70 71 //key_peek_arm(); // Arm the system to detect next key 72 73 //gets(buffer); 74 //printf("\"%s\"", buffer); 75 c = 10; 76 77 while(1) { 78 79 put_char('>'); 80 81 82 //c = getc(stdin); // stdio (experimental) 83 //c = getchar(); // stdio (experimental) 84 c = key_get_char(); 85 86 //put_char(c); 87 //sprintf(buffer, "%d:\"%c\"\n", c, c); 88 //put(buffer); 89 put("0x"); put_hex8(c); 90 put(": \""); put_char(c); put("\"\n"); 91 } 92 93 94 //sprintf(buffer, "Hello World\n"); 95 } 96