Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
secret.h
webpages.h
out
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/deployment.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/esp8266-C64.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 58 additions & 38 deletions INIT.ino
Original file line number Diff line number Diff line change
@@ -1,54 +1,74 @@

void initWifi(){
void initWifi() {
APsetup();
}
void initWifi_client(){ // not used with captive
// Start Wifi
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.print(" ip-address: ");
Serial.println(WiFi.localIP());
}

void initServer(){
// set comm. pages
server.on ( "/",[]() {
Serial.println("Root page called");
//server.setContentLength(CONTENT_LENGTH_UNKNOWN);
server.send_P ( 200, "text/html", gui);
});
server.on ( "/VICII.js",[]() {
Serial.println("Javascript loaded");
//server.setContentLength(CONTENT_LENGTH_UNKNOWN);
server.send_P ( 200, "text/plain", vicii);
});
server.on ( "/VICIIRefresh", VICIIRefresh);

// server.onNotFound(handleNotFound);
// Start the server
void initServer() {
// set comm. pages
server.on ( "/", []() {
Serial.println("Root page called");
//server.setContentLength(CONTENT_LENGTH_UNKNOWN);
server.send_P ( 200, "text/html", gui);
});
server.on ( "/VICII.js", []() {
Serial.println("Javascript loaded");
//server.setContentLength(CONTENT_LENGTH_UNKNOWN);
server.send_P ( 200, "text/plain", vicii);
});
//server.on ( "/VICIIRefresh", VICIIRefresh);

// server.onNotFound(handleNotFound);

// Start the server
server.begin();

// start webSocket server
webSocket.begin();
webSocket.onEvent(webSocketEvent);

if (MDNS.begin("esp8266")) {
Serial.println("MDNS responder started");
}



// Add service to MDNS
MDNS.addService("http", "tcp", 80);
MDNS.addService("ws", "tcp", 81);

}

/*
void checkFreeSpace(){
void checkFreeSpace(){
//uint32_t freeSpace=system_get_free_heap_size();
Serial.print (system_get_free_heap_size());
Serial.println (" free space.");
}
}
*/

int fase=0;
void init_fase(){
if (fase!=4) {Serial.print ("Start boot fase ");Serial.println(fase);}
if (fase==0) {initWifi();}
if (fase==1) {initServer();}
int fase = 0;
void init_fase() {
if (fase != 4) {
Serial.print ("Start boot fase ");
Serial.println(fase);
}
if (fase == 0) {
initWifi();
}
if (fase == 1) {
initServer();
}
//if (fase==2) {checkFreeSpace();}
if (fase==3) {reset6502();}
if (fase!=4) {Serial.print ("..finished boot fase ");Serial.println(fase);}
if (fase!=4) {fase++;return;}
if (fase == 3) {
reset6502();
}
if (fase != 4) {
Serial.print ("..finished boot fase ");
Serial.println(fase);
}
if (fase != 4) {
fase++;
return;
}
}
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ The code was based upon [http://forum.arduino.cc/index.php?topic=193216.msg17930

### Installation
1. Extract the files in the zip
2. Start Arduino editor and open the ino file
3. Upload the ino file to the esp8266
4. This sketch will create a free WiFi-AP named Commodore 64
5. Tap on it
6. Enjoy...
2. Run generate.sh
3. Start Arduino editor and open the ino file
4. Setup above settings in editor
5. Set WIFI_MODE in line 37 to use host/client mode
6. Create secret.sh file with two lines: #define STASSID "Your SSID" #define STAPSK "Your password"
7. Upload the ino file to the esp8266
8. This sketch will create a free WiFi-AP named STASSID or connect to your wifi router, the IP will be on the serial monitor
10. Enjoy...

### Have fun
You should now see the startup screen of de C64!
Expand All @@ -45,7 +48,7 @@ Of course you can also enter simple programs like:
```

### Tetris BASIC code example
But such a pity, clipboard does not work...
Clipboard does work, use CTRL+V (dont paste too much text)...
```basic
1 a$="efijefijefijefijbfjnhijkbfjnhijkijfgaefjijfgaefjefjkiefbefjkiefbbfjidefj"
2 a$=a$+"abeieijkaeijijkgabfjiefgehijebfj@abe@dhe":o=207:dime(o):forx=0to111
Expand All @@ -70,4 +73,4 @@ https://github.com/matgoebl/esp8266-ntsc-c64-emulator/tree/master/prg
https://gkanold.wixsite.com/homeputerium/kopie-von-games-list-2019-2

### Remarks regarding speed:
The emulation speed within the esp8266 is higher than the update speed of the browser. The maximum speed of the browser implementation is 5 frames per second, possibly due to the use of the XMLHTTP protocol! Any ideas/code suggestions how to solve this are most welcome!
The emulation speed within the esp8266 is close to the update speed of the browser.
Loading