File size: 17,124 Bytes
00e6582
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
/*
Copyright (c) 2026 Ethan Mortonson.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef EMULATOR_H_INCLUDED
#define EMULATOR_H_INCLUDED
#include "../engine.h"
#include "../graphics/image.h"
#include "opcodes.h"

#define VIDEO_MODE_MONOCHROME 0x01 //7-bit color with 1 transparency bit.
#define VIDEO_MODE_COLOR 0x02 //6-bit color with 2 transparency bits

#define HARDWARE_OFFSET_VIDEO_RAM 0x0001
#define HARDWARE_OFFSET_HDD 0x0002
#define HARDWARE_OFFSET_REMOVABLE_DISK 0x0003
#define HARDWARE_OFFSET_SENSOR 0x0004
#define HARDWARE_OFFSET_PERIPHERAL 0x0005
#define HARDWARE_OFFSET_KEYBOARD 0x0006
#define HARDWARE_OFFSET_LEFT_KEYBOARD 0x0007
#define HARDWARE_OFFSET_RIGHT_KEYBOARD 0x0008
#define HARDWARE_OFFSET_HEAD_INDICATORS 0x0009

#define HARDWARE_OFFSET_MOUSE 0x000A
#define HARDWARE_OFFSET_CONTROLLER 0x000B

#define HARDWARE_OFFSET_POWER_SUPPLY 0x000C
#define HARDWARE_OFFSET_FANS 0x000D
#define HARDWARE_OFFSET_NETWORK 0x000E

#define FILE_TYPE_EXECUTABLE 1
#define FILE_TYPE_FOLDER 1
#define FILE_TYPE_FILE 1


//Filename	8 bytes	Name of the file (padded with spaces if shorter)
//Extension	3 bytes	File extension (e.g., TXT, DOC)
//Attributes	1 byte	Flags like read-only, hidden, system, volume label, subdirectory, archive
//Reserved	10 bytes	Reserved for system use or timestamps
//Time	2 bytes	Creation/modification time
//Date	2 bytes	Creation/modification date
//Starting Cluster	2 bytes	Number of the first cluster of the file in the data area
//File Size	4 bytes	Size of the file in bytes



struct _Standard_File_System_File_Or_Directory
{
    unsigned short Name[4*16];
    unsigned short Extension_Name[4*16];
    unsigned char Type; //Executable File, Folder, or File
    unsigned char On_This_Bank;
    unsigned short At_This_Offset;
    unsigned short Size;
    unsigned short Year_Created;
    unsigned char Month_Created;
    unsigned char Day_Created;
    unsigned short Time_Created_In_Seconds;
};


struct _Standard_File_System_Root_Directory
{
    unsigned char Number_Of_Files;
    struct _Standard_File_System_File_Or_Directory Files[256];
};

struct _SixtyFourK_Bank
{
    unsigned char Bank[65536];
};

struct _Memory_Cartridge
{
    unsigned char Number_Of_Banks; //Maximum Cart Size: 16MB.
    unsigned char Offset_To_Banks;
};

struct _x80_Processor
{
    uint16_t Register_Zero;
    uint16_t Register_One;

    uint16_t Stack_Pointer;
    uint16_t Base_Pointer;

    uint16_t Old_Stack_Pointer;
    uint16_t Old_Base_Pointer;

    uint16_t Instruction_Pointer;
    bool Zero_Flag;
    bool Carry_Flag;
    bool Sign_Flag;
    bool Overflow_Flag;
    bool Parity_Flag;
    bool Auxiliary_Carry_Flag;
    bool Direction_Flag;
    bool Maskable_Interrupt_Flag;
    bool Trap_Flag;

    bool Equals_Flag;
    bool Less_Flag;
    bool Greater_Flag;
};

struct _Computer
{
    float Red_Level;
    float Blue_Level;
    float Green_Level;
    struct _x80_Processor Processor;
    struct _SixtyFourK_Bank RAM[256];

    unsigned char Video_RAM_Front_Buffer[65536];
    unsigned char Video_RAM_Back_Buffer[65536];

    unsigned char True_Video_Screen[256*256*4];

    unsigned char HDD_Slot_Status;
    unsigned char Removable_Slot_Status;

    unsigned char Sensor_Link_Port_Status;
    unsigned char Peripheral_Link_Port_Status;
    unsigned char Network_Link_Port_Status;

    unsigned char Monitor_Link_Port_Status;

    unsigned char Keyboard_Link_Port_Status;
    unsigned char Mouse_Link_Port_Status;
    unsigned char Controller_Link_Port_Status;

    unsigned char Power_Status;
    unsigned char Power_Supply_Status;
    unsigned char Fan_Status;

    unsigned char Controller_RAM[5]; //X and Y hats, 4 bytes. 1 byte for 4 buttons and a DPAD.
    unsigned char Keyboard_RAM[32]; //256 keys, 1 bit per key

    unsigned char Left_Keyboard_RAM[32]; //256 keys, 1 bit per key
    unsigned char Right_Keyboard_RAM[32]; //256 keys, 1 bit per key

    unsigned char External_Lights_RAM[32];
    unsigned char External_Inputs_RAM[32];

    unsigned char Mouse_RAM[3];



    unsigned char Sensor_Link_Port_RAM[1536]; //256 chars, 6 bytes per char
    unsigned char Peripheral_Link_Port_RAM[1536];
    unsigned char Network_Link_Port_RAM[1536];

    unsigned char CPU_Is_Running;

    unsigned char Color_Mode;
    unsigned char Background_Color;
    unsigned char Current_RAM_Bank;

    GLuint Texture_ID;
        int RGBA_Image_Size;
        unsigned char Texture_Made;
        int x;
        int y;
        int Width;
        int Height;
        unsigned char* RGB_Canvas;
        unsigned char* RGBA_Canvas;
        float* Vertices;
        float* Texture_Vertices;
};

struct _Computer* Create_Computer();
void Initialize_Computer(struct _Computer* Computer);

void Turn_On_Computer(struct _Computer* Computer);
void Turn_Off_Computer(struct _Computer* Computer);
void Load_Program_Into_RAM_And_Start(struct _Computer* Computer, const char* Filename);
void Load_BIOS_Into_RAM_And_Start(struct _Computer* Computer, const char* Filename);



void Process_Computer(struct _Computer* Computer, int Maximum_Cycles, struct _Keypad Keypad);
void Run_A_Processing_Cycle(struct _Computer* Computer, struct _Keypad Keypad);
void Update_Computer_Inputs(struct _Computer* Computer, struct _Keypad Keypad);
void Update_Computer_Video_Card(struct _Computer* Computer);
void Render_Computer(struct _Computer* Computer, float x, float y);

void Render_Computer_Vertices(struct _Computer* Computer, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4);

void Create_Cartridge(unsigned char Number_Of_Banks, const char* Output_Filename);
void Convert_Code_To_Cartridge_Data(struct _Memory_Cartridge* Cartridge, unsigned char Bank_ID, unsigned short Bank_Offset, const char* Filename);
void Convert_BMP_To_Cartridge_Data(struct _Memory_Cartridge* Cartridge, unsigned char Bank_ID, unsigned short Bank_Offset, const char* Filename);
void Convert_Data_To_Cartridge_Data(struct _Memory_Cartridge* Cartridge, unsigned char Bank_ID, unsigned short Bank_Offset, const char* Filename);


void Insert_Standard_Filesytem(struct _Memory_Cartridge* Cartridge, unsigned char Bank_ID, unsigned short Bank_Offset);
void Write_Filesystem_Entry(unsigned short Name[64],unsigned short Extension_Name[64],unsigned char Type,unsigned char On_This_Bank,unsigned short At_This_Offset,unsigned short Size,unsigned short Year_Created,unsigned char Month_Created,unsigned char Day_Created,unsigned short Time_Created_In_Seconds);





void RUN_NOP(struct _Computer* Computer);

void RUN_MOV_REG_IMM(struct _Computer* Computer);

void RUN_MOV_REG_DIR(struct _Computer* Computer);

void RUN_MOV_REG_IND(struct _Computer* Computer);

void RUN_PUSH(struct _Computer* Computer);

void RUN_POP(struct _Computer* Computer);

void RUN_CALL(struct _Computer* Computer);

void RUN_RET(struct _Computer* Computer);

void RUN_CMP_IMM(struct _Computer* Computer);

void RUN_JZ(struct _Computer* Computer);

void RUN_JNZ(struct _Computer* Computer);

void RUN_HALT(struct _Computer* Computer);


void RUN_JE(struct _Computer* Computer);

void RUN_JNE(struct _Computer* Computer);

void RUN_JGE(struct _Computer* Computer);

void RUN_JLE(struct _Computer* Computer);

void RUN_JG(struct _Computer* Computer);

void RUN_JL(struct _Computer* Computer);


void RUN_JC(struct _Computer* Computer);


void RUN_LODSB(struct _Computer* Computer);

void RUN_LODSW(struct _Computer* Computer);

void RUN_STOSB(struct _Computer* Computer);

void RUN_STOSW(struct _Computer* Computer);


void RUN_JMP(struct _Computer* Computer);


void RUN_AND(struct _Computer* Computer);

void RUN_OR(struct _Computer* Computer);

void RUN_XOR(struct _Computer* Computer);

void RUN_NAND(struct _Computer* Computer);

void RUN_NOR(struct _Computer* Computer);

void RUN_XNOR(struct _Computer* Computer);


void RUN_ADD_REG_IMM(struct _Computer* Computer);

void RUN_ADD_REG_DIR(struct _Computer* Computer);

void RUN_ADD_REG_IND(struct _Computer* Computer);


void RUN_SUB_REG_IMM(struct _Computer* Computer);

void RUN_SUB_REG_DIR(struct _Computer* Computer);

void RUN_SUB_REG_IND(struct _Computer* Computer);


void RUN_MUL_REG_IMM(struct _Computer* Computer);

void RUN_MUL_REG_DIR(struct _Computer* Computer);

void RUN_MUL_REG_IND(struct _Computer* Computer);


void RUN_DIV_REG_IMM(struct _Computer* Computer);

void RUN_DIV_REG_DIR(struct _Computer* Computer);

void RUN_DIV_REG_IND(struct _Computer* Computer);








void RUN_PWR_REG_IMM(struct _Computer* Computer);

void RUN_PWR_REG_DIR(struct _Computer* Computer);

void RUN_PWR_REG_IND(struct _Computer* Computer);


void RUN_SQR_REG_IMM(struct _Computer* Computer);

void RUN_SQR_REG_DIR(struct _Computer* Computer);

void RUN_SQR_REG_IND(struct _Computer* Computer);


void RUN_IN(struct _Computer* Computer);

void RUN_OUT(struct _Computer* Computer);


void RUN_REP(struct _Computer* Computer);


//FLAGS
void RUN_SET_ZERO_FLAG(struct _Computer* Computer);

void RUN_SET_CARRY_FLAG(struct _Computer* Computer);

void RUN_SET_SIGN_FLAG(struct _Computer* Computer);

void RUN_SET_OVERFLOW_FLAG(struct _Computer* Computer);

void RUN_SET_PARITY_FLAG(struct _Computer* Computer);

void RUN_SET_AUXILIARY_CARRY_FLAG(struct _Computer* Computer);


void RUN_SET_DIRECTION_FLAG(struct _Computer* Computer);

void RUN_SET_MASKABLE_INTERRUPT_FLAG(struct _Computer* Computer);

void RUN_SET_TRAP_FLAG(struct _Computer* Computer);




void RUN_FUNCTION_ERROR_HANDLER(struct _Computer* Computer);


void RUN_FUNCTION_GRAPHICS_RENDER_POINT(struct _Computer* Computer);

void RUN_FUNCTION_GRAPHICS_RENDER_LINE(struct _Computer* Computer);

void RUN_FUNCTION_GRAPHICS_RENDER_TRIANGLE(struct _Computer* Computer);


void RUN_FUNCTION_GRAPHICS_RENDER_SPRITE(struct _Computer* Computer);

void RUN_FUNCTION_GRAPHICS_RENDER_ANIMATED_SPRITE(struct _Computer* Computer);


void RUN_FUNCTION_SET_TIMER(struct _Computer* Computer);

void RUN_FUNCTION_PAUSE_TIMER(struct _Computer* Computer);

void RUN_FUNCTION_CLEAR_TIMER(struct _Computer* Computer);


void RUN_FUNCTION_SET_CYCLICAL_TIMER(struct _Computer* Computer);

void RUN_FUNCTION_PAUSE_CYCLICAL_TIMER(struct _Computer* Computer);

void RUN_FUNCTION_CLEAR_CYCLICAL_TIMER(struct _Computer* Computer);



void RUN_FUNCTION_READ_TIME(struct _Computer* Computer);

void RUN_FUNCTION_READ_DATE(struct _Computer* Computer);


void RUN_FUNCTION_SET_TIME(struct _Computer* Computer);

void RUN_FUNCTION_SET_DATE(struct _Computer* Computer);


void RUN_FUNCTION_RENDER_TEXT(struct _Computer* Computer);

void RUN_FUNCTION_RENDER_VALUE(struct _Computer* Computer);


void RUN_FUNCTION_INPUT_TEXT(struct _Computer* Computer);

void RUN_FUNCTION_INPUT_VALUE(struct _Computer* Computer);


void RUN_FUNCTION_PLAY_BEEP(struct _Computer* Computer);

void RUN_FUNCTION_PLAY_AUDIO(struct _Computer* Computer);


void RUN_FUNCTION_TEST_AABB_AABB_COLLISION(struct _Computer* Computer);

void RUN_FUNCTION_TEST_AABB_CIRCLE_COLLISION(struct _Computer* Computer);

void RUN_FUNCTION_TEST_AABB_RAY_COLLISION(struct _Computer* Computer);

void RUN_FUNCTION_TEST_AABB_TRIANGLE_COLLISION(struct _Computer* Computer);


void RUN_FUNCTION_TEST_CIRCLE_CIRCLE_COLLISION(struct _Computer* Computer);

void RUN_FUNCTION_TEST_CIRCLE_RAY_COLLISION(struct _Computer* Computer);

void RUN_FUNCTION_TEST_CIRCLE_TRIANGLE_COLLISION(struct _Computer* Computer);


void RUN_FUNCTION_TEST_RAY_RAY_COLLISION(struct _Computer* Computer);

void RUN_FUNCTION_TEST_RAY_TRIANGLE_COLLISION(struct _Computer* Computer);


void RUN_FUNCTION_TEST_TRIANGLE_TRIANGLE_COLLISION(struct _Computer* Computer);


void RUN_FUNCTION_TEST_IF_OFF_SCREEN(struct _Computer* Computer);



void RUN_FUNCTION_SET_SCREEN_MODE(struct _Computer* Computer);

void RUN_FUNCTION_SET_CURSOR_SHAPE(struct _Computer* Computer);

void RUN_FUNCTION_SET_CURSOR_POSITION(struct _Computer* Computer);


void RUN_FUNCTION_SCROLL_SCREEN(struct _Computer* Computer);

void RUN_FUNCTION_CLEAR_SCREEN(struct _Computer* Computer);


void RUN_FUNCTION_READ_CHARACTER_AT_CURSOR(struct _Computer* Computer);

void RUN_FUNCTION_WRITE_CHARACTER_AT_CURSOR(struct _Computer* Computer);


void RUN_FUNCTION_GET_VIDEO_MODE(struct _Computer* Computer);


void RUN_FUNCTION_GET_EQUIPMENT_LIST(struct _Computer* Computer);


void RUN_FUNCTION_GET_RAM_SIZE(struct _Computer* Computer);


void RUN_FUNCTION_SET_BACKGROUND_COLOR(struct _Computer* Computer);





void RUN_FUNCTION_RESET_DISK_DRIVE(struct _Computer* Computer);

void RUN_FUNCTION_CHECK_DISK_DRIVE_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_READ_FROM_DISK_DRIVE(struct _Computer* Computer);

void RUN_FUNCTION_WRITE_TO_DISK_DRIVE(struct _Computer* Computer);

void RUN_FUNCTION_CHECK_DISK_DRIVE_FOR_ERRORS(struct _Computer* Computer);

void RUN_FUNCTION_FORMAT_DISK_DRIVE(struct _Computer* Computer);

void RUN_FUNCTION_GET_DISK_DRIVE_INFORMATION(struct _Computer* Computer);




void RUN_FUNCTION_SEEK_TO_SPECIFIED_TRACK(struct _Computer* Computer);

void RUN_FUNCTION_GET_DRIVE_TYPE(struct _Computer* Computer);

void RUN_FUNCTION_GET_FLOPPY_DRIVE_MEDIA_CHANGE_STATUS(struct _Computer* Computer);


void RUN_FUNCTION_LOCK_DRIVE(struct _Computer* Computer);

void RUN_FUNCTION_EJECT_DRIVE(struct _Computer* Computer);




void RUN_FUNCTION_INITALIZE_SERIAL_PORT(struct _Computer* Computer);

void RUN_FUNCTION_SERIAL_TX(struct _Computer* Computer);

void RUN_FUNCTION_SERIAL_RX(struct _Computer* Computer);

void RUN_FUNCTION_SERIAL_STATUS(struct _Computer* Computer);




void RUN_FUNCTION_KEYBOARD_INTERCEPT(struct _Computer* Computer);

void RUN_FUNCTION_EVENT_WAIT(struct _Computer* Computer);

void RUN_FUNCTION_SYSREQ_KEY_CALLOUT(struct _Computer* Computer);

void RUN_FUNCTION_WAIT(struct _Computer* Computer);





void RUN_FUNCTION_READ_KEYBOARD_CHARACTER(struct _Computer* Computer);

void RUN_FUNCTION_READ_KEYBOARD_INPUT_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_READ_KEYBOARD_SHIFT_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_STORE_KEYSTROKE(struct _Computer* Computer);



void RUN_FUNCTION_READ_MOUSE_CHARACTER(struct _Computer* Computer);

void RUN_FUNCTION_READ_MOUSE_INPUT_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_READ_MOUSE_SHIFT_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_STORE_MOUSESTROKE(struct _Computer* Computer);


void RUN_FUNCTION_READ_CONTROLLER_CHARACTER(struct _Computer* Computer);

void RUN_FUNCTION_READ_CONTROLLER_INPUT_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_READ_CONTROLLER_SHIFT_STATUS(struct _Computer* Computer);

void RUN_FUNCTION_STORE_CONTROLLERSTROKE(struct _Computer* Computer);




void RUN_FUNCTION_PRINT_CHARACTER_ONTO_PRINTER(struct _Computer* Computer);

void RUN_FUNCTION_INITIALIZE_PRINTER(struct _Computer* Computer);

void RUN_FUNCTION_CHECK_PRINTER_STATUS(struct _Computer* Computer);


void RUN_SHIFT_LEFT(struct _Computer* Computer);

void RUN_SHIFT_RIGHT(struct _Computer* Computer);



void RUN_LOG(struct _Computer* Computer);

void RUN_LN(struct _Computer* Computer);


void RUN_SIN(struct _Computer* Computer);

void RUN_COS(struct _Computer* Computer);

void RUN_TAN(struct _Computer* Computer);


void RUN_INVSIN(struct _Computer* Computer);

void RUN_INVCOS(struct _Computer* Computer);

void RUN_INVTAN(struct _Computer* Computer);


void RUN_SET_DECIMAL_FLAG(struct _Computer* Computer);

void RUN_CLEAR_DECIMAL_FLAG(struct _Computer* Computer);


void RUN_CLEAR_ZERO_FLAG(struct _Computer* Computer);

void RUN_CLEAR_CARRY_FLAG(struct _Computer* Computer);

void RUN_CLEAR_SIGN_FLAG(struct _Computer* Computer);

void RUN_CLEAR_OVERFLOW_FLAG(struct _Computer* Computer);

void RUN_CLEAR_PARITY_FLAG(struct _Computer* Computer);

void RUN_CLEAR_AUXILIARY_CARRY_FLAG(struct _Computer* Computer);


void RUN_CLEAR_DIRECTION_FLAG(struct _Computer* Computer);

void RUN_CLEAR_MASKABLE_INTERRUPT_FLAG(struct _Computer* Computer);

void RUN_CLEAR_TRAP_FLAG(struct _Computer* Computer);


void RUN_FUNCTION_REBOOT(struct _Computer* Computer);

void RUN_FUNCTION_SHUTDOWN(struct _Computer* Computer);

void Handle_Computer_Inputs(struct _Computer* Computer, struct _Keypad Keypad);

#endif // EMULATOR_H_INCLUDED