Skip to content

Commit

Permalink
Fix indents
Browse files Browse the repository at this point in the history
  • Loading branch information
s-macke committed Jul 26, 2020
1 parent 5581b59 commit 3401218
Show file tree
Hide file tree
Showing 17 changed files with 2,124 additions and 2,124 deletions.
50 changes: 25 additions & 25 deletions src/devices/bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@
#include "../utils/exit_strategy.h"

void HandleBios() {
uint16_t ah = regs.byteregs[regah];
uint16_t al = regs.byteregs[regal];
//printf("bios ah: 0x%02x, al: 0x%02x\n", ah, al);
uint16_t ah = regs.byteregs[regah];
uint16_t al = regs.byteregs[regal];
//printf("bios ah: 0x%02x, al: 0x%02x\n", ah, al);

switch (ah) {
case 0xc0: // return system configuration parameters (PS/2 only)
printf("bios return system configuration parameters\n");
ClearCFInInterrupt();
switch (ah) {
case 0xc0: // return system configuration parameters (PS/2 only)
printf("bios return system configuration parameters\n");
ClearCFInInterrupt();
segregs[reges] = 0xc8c2; // compatibility with dosbox
regs.wordregs[regbx] = 0x0;
regs.byteregs[regah] = 0x0;

//http://stanislavs.org/helppc/int_15-c0.html
Write8Long(segregs[reges], 0, 0x08); // length
Write8Long(segregs[reges], 1, 0x00);
Write8Long(segregs[reges], 2, 0xfc); // model byte
Write8Long(segregs[reges], 3, 0x00); // secondary model byte
Write8Long(segregs[reges], 4, 0x01); // BIOS revision level
Write8Long(segregs[reges], 5, 0x70); // feature information
Write8Long(segregs[reges], 6, 0x40); // reserved
Write8Long(segregs[reges], 7, 0x00); // reserved
Write8Long(segregs[reges], 8, 0x00); // reserved
Write8Long(segregs[reges], 9, 0x00); // reserved
ClearCFInInterrupt();
break;
//http://stanislavs.org/helppc/int_15-c0.html
Write8Long(segregs[reges], 0, 0x08); // length
Write8Long(segregs[reges], 1, 0x00);
Write8Long(segregs[reges], 2, 0xfc); // model byte
Write8Long(segregs[reges], 3, 0x00); // secondary model byte
Write8Long(segregs[reges], 4, 0x01); // BIOS revision level
Write8Long(segregs[reges], 5, 0x70); // feature information
Write8Long(segregs[reges], 6, 0x40); // reserved
Write8Long(segregs[reges], 7, 0x00); // reserved
Write8Long(segregs[reges], 8, 0x00); // reserved
Write8Long(segregs[reges], 9, 0x00); // reserved
ClearCFInInterrupt();
break;

default:
printf("Error: Unknown bios function\n");
exit_or_restart(1);
break;
}
default:
printf("Error: Unknown bios function\n");
exit_or_restart(1);
break;
}

}
48 changes: 24 additions & 24 deletions src/devices/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
// http://stanislavs.org/helppc/int_1a.html

void Clock_Bios() {
uint16_t ah = regs.byteregs[regah];
uint16_t al = regs.byteregs[regal];
uint16_t ah = regs.byteregs[regah];
uint16_t al = regs.byteregs[regal];

switch (ah) {
switch (ah) {

case 0x0: // read system clock counter
regs.byteregs[regal] = 0;
Expand All @@ -21,25 +21,25 @@ void Clock_Bios() {
break;

case 0x2: // read real time clock time
regs.byteregs[regch] = 1; // hours in BCD
regs.byteregs[regcl] = 1; // minutes in BCD
regs.byteregs[regdh] = 1; // seconds in BCD
regs.byteregs[regdl] = 1; // daylight savings
ClearZFInInterrupt();
break;

case 0x04: // read real time clock date
regs.byteregs[regch] = (2<<4) | 0; // century in BCD
regs.byteregs[regcl] = (2<<4) | 0; // year in BCD
regs.byteregs[regdh] = 1; // month in BCD
regs.byteregs[regdl] = 1; // day in BCD
ClearZFInInterrupt();
break;

default:
printf("Error: Unknown clock function ah=0x%02x\n", ah);
exit_or_restart(1);
break;

}
regs.byteregs[regch] = 1; // hours in BCD
regs.byteregs[regcl] = 1; // minutes in BCD
regs.byteregs[regdh] = 1; // seconds in BCD
regs.byteregs[regdl] = 1; // daylight savings
ClearZFInInterrupt();
break;

case 0x04: // read real time clock date
regs.byteregs[regch] = (2<<4) | 0; // century in BCD
regs.byteregs[regcl] = (2<<4) | 0; // year in BCD
regs.byteregs[regdh] = 1; // month in BCD
regs.byteregs[regdl] = 1; // day in BCD
ClearZFInInterrupt();
break;

default:
printf("Error: Unknown clock function ah=0x%02x\n", ah);
exit_or_restart(1);
break;

}
}
Loading

0 comments on commit 3401218

Please sign in to comment.