more downloader

master
Astoria 2 years ago
parent bb0aec649a
commit 1437f1a6cc

@ -10,9 +10,8 @@
#define redbus 0x0300 #define redbus 0x0300
void download_file(char* file) { void download_file() {
unsigned int i; unsigned int i;
unsigned int x;
con->cursor_mode = 0; con->cursor_mode = 0;
conprint("Downloading file, please wait warmly.", 0, 6); conprint("Downloading file, please wait warmly.", 0, 6);
rb_map_device(0x05); rb_map_device(0x05);
@ -53,8 +52,8 @@ void main() {
conprint("Internet Disk Retrieval System V1.3", 0, 0); conprint("Internet Disk Retrieval System V1.3", 0, 0);
conprint("Please remove disk now", 0, 1); conprint("Please remove disk now", 0, 1);
conprint("Enter a URL to download from: ", 0, 2); conprint("Enter a URL to download from: ", 0, 2);
con->cursor_y = 3; con->cursor_y = 3;
strcpy(buffer, read_keyboard()); strcpy(buffer, read_keyboard());
conprint("You are trying to download a file from: ", 0, 3); conprint("You are trying to download a file from: ", 0, 3);
conprint(buffer, 0, 4); conprint(buffer, 0, 4);
con->cursor_x = 23; con->cursor_x = 23;
@ -63,7 +62,7 @@ void main() {
memset(ynbuf, 0, 50); memset(ynbuf, 0, 50);
strcpy(ynbuf, read_keyboard()); strcpy(ynbuf, read_keyboard());
if(ynbuf[0] == 'Y' || ynbuf[0] == 'y') { if(ynbuf[0] == 'Y' || ynbuf[0] == 'y') {
download_file(buffer); download_file();
} else{ } else{
conprint("Download cancelled", 0, 6); conprint("Download cancelled", 0, 6);
} }

@ -0,0 +1,20 @@
#ifndef EXTENSIONS_H
#define EXTENSIONS_H
extern void wait();
extern void stop();
void sleep_ticks(int n){
unsigned int i;
for(i = 0; i < n; ++i){
wait();
}
}
void sleep_seconds(int n){
unsigned int i;
for(i = 0; i < n * 20; ++i){
wait();
}
}
#endif
Loading…
Cancel
Save