Dave Van Wagner / Mbed OS c-simple-emu6502-cbm
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // c-simple-emu-cbm.cs - main()
00002 //
00003 ////////////////////////////////////////////////////////////////////////////////
00004 //
00005 // c-simple-emu-cbm (C Portable Version)
00006 // C64/6502 Emulator for Terminal Console
00007 //
00008 // MIT License
00009 //
00010 // Copyright(c) 2020 by David R. Van Wagner
00011 // davevw.com
00012 //
00013 // Permission is hereby granted, free of charge, to any person obtaining a copy
00014 // of this software and associated documentation files (the "Software"), to deal
00015 // in the Software without restriction, including without limitation the rights
00016 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00017 // copies of the Software, and to permit persons to whom the Software is
00018 // furnished to do so, subject to the following conditions:
00019 //
00020 // The above copyright notice and this permission notice shall be included in all
00021 // copies or substantial portions of the Software.
00022 //
00023 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00024 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00025 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
00026 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00027 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00028 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00029 // SOFTWARE.
00030 //
00031 ////////////////////////////////////////////////////////////////////////////////
00032 
00033 #include <mbed.h>
00034 #include "cbmconsole.h"
00035 #include "emuc64.h"
00036 #include "emu6502.h"
00037 
00038 #ifdef LOCAL_LOAD
00039 #include <LocalFileSystem.h>
00040 LocalFileSystem local("local");
00041 #endif
00042 
00043 Serial pc(USBTX, USBRX, 115200);
00044 //Serial pc(p9, p10, 115200);
00045 
00046 int main(/*int argc, char* argv[]*/)
00047 {
00048     pc.printf("\n");
00049     pc.printf("c-simple-emu-cbm version 1.7 for Mbed\n");
00050     pc.printf("Copyright (c) 2020 by David R. Van Wagner\n");
00051     pc.printf("Open Source - MIT License\n");
00052     pc.printf("github.com/davervw\n");
00053     pc.printf("\n");
00054     pc.printf("Contains other licensed software\n");
00055     pc.printf("   ARM MBED OS\n");
00056     pc.printf("\n");
00057     pc.printf("Commodore ROMs not licensed\n");
00058     pc.printf("\n");
00059 
00060 #ifdef LOCAL_LOAD
00061     // note: requires a file system implementation (SD, Mbed MSD, etc.)
00062     StartupPRG = "/local/startup.prg";
00063 #endif  
00064     
00065     C64_Init("/local/basic", "/local/chargen", "/local/kernal");
00066     ResetRun(ExecutePatch);
00067     return 0;
00068 }