Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import "std.zh"
- const int SFX_KEYPRESS = 58;
- const int LINKTILEOFFSET = -261; const int KEY_DELAY = 65; //Trying this as 6.5 and timer changes as 1.0, using 65 and 10
- const int LINE_LENGTH = 54; const int BUFFER_LENGTH = 55;
- //int b1[55]; int b2[55]; int b3[55]; int b4[55]; int b5[55];
- //int b6[55]; int b7[55]; int b8[55]; int b9[55]; int b10[55];
- //int bufptr;
- const int CHAR_WIDTH = 4;
- const int CURSOR_WIDTH = 4;
- const int CURSOR_POINT_CHAR = 62;
- const int CURSOR_Y_OFFSET = 4;
- const int CURSOR_X_OFFSET = 4;
- const int BUFFER_OUTPUT_X = 0;
- const int BUFFER_OUTPUT_Y = 0;
- const int CURSOR_BLINK_DUR = 70;
- const int CURSOR_Y_OFS = 1;
- int ram[64]; const int RAM_q = 0;
- int buffer[214747]; //={CURSOR_POINT_CHAR, CHAR_SPACE};
- int bufferoverlay[214747]; //handles the cursor.
- bool ShiftKey;
- //int curbuffer = 0;
- int q; int timer = KEY_DELAY; bool cantype = true;
- int temp_q; int cursorblink = 0;
- //CursorAdv(RAM_q);
- void CursorAdv(int n){
- bufferoverlay[ram[n]] = CHAR_SPACE;
- ram[n]++;
- bufferoverlay[ram[n]] = '_'; //Cursor.
- }
- //CursorRev(RAM_q);
- void CursorRev(int n){
- bufferoverlay[ram[n]] = 0;
- ram[n]--;
- bufferoverlay[ram[n]] = '_'; //Cursor.
- }
- global script a{
- void run(){
- //int buffers[]={b1, b2, b3, b4, b5, b6, b7, b8, b9, b10};
- //bufptr = buffers;
- //int curbuffer = bufptr[q];
- Link->Y = 90;
- //Game->Cheat = 4;
- while(true){
- //Link->PressMap = false;
- Link->InputMap = false;
- if ( timer ) cantype = false;
- if ( !timer ) cantype = true;
- if ( Game->KeyPress[115] || Game->KeyPress[116] ) ShiftKey = true;
- else ShiftKey = false;
- if ( timer > 0 ) timer -10;
- if ( timer <= 0 ) timer = 0;
- if ( cursorblink > 0 ) cursorblink--;
- if ( cursorblink <= 0 ) cursorblink = 100;
- if ( cantype ) {
- //NoAction(); //Link->PressMap = false; Link->InputMap = false;
- for ( int qq = 1; qq <= 26; qq++ ) {
- if ( Game->KeyPress[qq] ){
- NoAction();
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- {
- buffer[q] = CHAR_A-1+qq; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- break;
- }
- else {
- buffer[q] = CHAR_a-1+qq; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- break;
- }
- }
- }
- }
- if ( Game->KeyPress[27] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = ')'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '0'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[28] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '!'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '1'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[29] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '"'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '2'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[30] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '#'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '3'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[31] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '$'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '4'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[32] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '%'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '5'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[33] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '^'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '6'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[34] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '&'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '7'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[35] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '*'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '8'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[36] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '('; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '9'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[37] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '0'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[38] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '1'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[39] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '2'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[40] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '3'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[41] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '4'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[42] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '5'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[43] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '6'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[44] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '7'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[45] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '8'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[46] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '9'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[60] ){ //tilde -- this might have issues unless we can set uncap false.
- if ( q < 214746 ) {
- buffer[q] = '~'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[61] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '_'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '-'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[62] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '+'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '='; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[63] ){ //Delete key
- if ( q < 214746 ) {
- CursorRev(RAM_q); temp_q--; buffer[q] = 0;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[64] ){ //tab
- if ( q < 214746 ) {
- for ( int w = 0; w < 4; w++ ) { buffer[q] = CHAR_SPACE; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[65] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '{'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '['; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[66] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '}'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = ']'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[68] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = ':'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = ';'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[69] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = CHAR_DQUOTE; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = CHAR_QUOTE; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[70] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '|'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = CHAR_BSLASH; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[71] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '|'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = CHAR_BSLASH; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[72] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '<'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = ','; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[73] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '>'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '.'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[74] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '?'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '/'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[75] ){
- if ( q < 214746 ) {
- buffer[q] = CHAR_SPACE; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[77] ){ //delete
- if ( q < 214746 ) {
- for ( int w = q; w >= 0; w-- ) buffer[w] = 0;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- q = 0; temp_q = 0;
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[78] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '~'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = '`'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[82] ){ //leftarrow
- Link->PressLeft = false; Link->InputLeft = false;
- if ( q < 214746 ) {
- ram[RAM_q}--;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);//temp_q--;
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[83] ){ //leftarrow
- Link->PressRight = false; Link->InputRight = false;
- if ( q < 214746 ) {
- ram[RAM_q]++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);//temp_q--; //needs to operate on temp_q so that the highest position is recorded.
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[84] ){ //up
- Link->PressUp = false; Link->InputUp = false;
- //find the previous command in the list
- /* if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '|'; q++; temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = CHAR_BSLASH; q++; temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- */
- }
- if ( Game->KeyPress[85] ){ //up
- Link->PressDown = false; Link->InputDown = false;
- //find the next command in the list, clear if none
- /* if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = '|'; q++; temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = CHAR_BSLASH; q++; temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- */
- }
- if ( Game->KeyPress[86] ){
- if ( q < 214746 ) {
- buffer[q] = '/'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[87] ){
- if ( q < 214746 ) {
- buffer[q] = '*'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[88] ){
- if ( q < 214746 ) {
- buffer[q] = '-'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[89] ){
- if ( q < 214746 ) {
- buffer[q] = '+'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[90] ){ //delete key, num pad
- if ( q < 214746 ) {
- buffer[q] = '/'; CursorAdv(RAM_q); temp_q++;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[91] ){
- if ( q < 214746 ) {
- for ( int w = q; w >= 0; w-- ) buffer[w] = 0;
- if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);
- q = 0; temp_q = 0;
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[101] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = ':'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = ';'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- if ( Game->KeyPress[105] ){
- if ( q < 214746 ) {
- if ( (Game->KeyPress[115] || Game->KeyPress[116]))
- { buffer[q] = ':'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- else { buffer[q] = ';'; CursorAdv(RAM_q); temp_q++; if ( SFX_KEYPRESS > 0 ) Game->PlaySound(SFX_KEYPRESS);}
- timer = KEY_DELAY;
- }
- }
- //for ( int qqq = 0; qqq < SizeOfArray(bufferoverlay); qqq++ ) bufferoverlay[q] = CHAR_SPACE;
- //bufferoverlay[q] = '_'; //Cursor.
- }
- Screen->DrawString(6,0,0,2, 0x01, -1, 0, GetBuffer(),128);
- if ( cursorblink > CURSOR_BLINK_DUR ) {
- Screen->DrawString(6,0,0+CURSOR_Y_OFS,2, 0x01, -1, 0, GetCursorOverlay(),128); //cursor
- /*
- Screen->Line(6,
- 0+0+(q*CHAR_WIDTH),
- //BUFFER_OUTPUT_X+CURSOR_X_OFFSET+(q*CHAR_WIDTH),
- //BUFFER_OUTPUT_Y+CURSOR_Y_OFFSET,
- 6,
- 0+0+(q*CHAR_WIDTH)+4,
- //BUFFER_OUTPUT_X+CURSOR_X_OFFSET+(q*CHAR_WIDTH) + CURSOR_WIDTH,
- 6,
- //BUFFER_OUTPUT_Y+CURSOR_Y_OFFSET,
- 0x01, 1, 0, 0, 0, 128);
- */
- }
- Waitdraw(); Waitframe();
- }
- }
- }
- int GetBuffer(){
- //int ptr = bufptr;
- //return bufptr[buffer];
- return buffer;
- }
- int GetCursorOverlay(){
- return bufferoverlay;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement