11// //////////////////////////////////////////////////////////////////////////////
22// Copyright 2015 by Joseph Forgione
33// This file is part of VCC (Virtual Color Computer).
4- //
4+ //
55// VCC (Virtual Color Computer) is free software: you can redistribute itand/or
66// modify it under the terms of the GNU General Public License as published by
77// the Free Software Foundation, either version 3 of the License, or (at your
88// option) any later version.
9- //
9+ //
1010// VCC (Virtual Color Computer) is distributed in the hope that it will be
1111// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
1212// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1313// Public License for more details.
14- //
14+ //
1515// You should have received a copy of the GNU General Public License along with
1616// VCC (Virtual Color Computer). If not, see <http://www.gnu.org/licenses/>.
1717// //////////////////////////////////////////////////////////////////////////////
2121#include < vcc/utils/configuration_serializer.h>
2222#include " ../CartridgeMenu.h"
2323
24+ // Contains Becker cart exports
2425
2526becker_cartridge::becker_cartridge (std::unique_ptr<context_type> context, HINSTANCE module_instance)
2627 :
@@ -48,13 +49,16 @@ becker_cartridge::description_type becker_cartridge::description() const
4849
4950void becker_cartridge::start ()
5051{
52+
53+ // Load becker config
5154 ::vcc::utils::configuration_serializer serializer (context_->configuration_path ());
5255
5356 gBecker .sethost (
5457 serializer.read (configuration_section_id_, " DWServerAddr" , " 127.0.0.1" ).c_str (),
5558 serializer.read (configuration_section_id_, " DWServerPort" , " 65504" ).c_str ());
5659 gBecker .enable (true );
5760
61+ // Create dynamic menu
5862 build_menu ();
5963}
6064
@@ -80,7 +84,7 @@ unsigned char becker_cartridge::read_port(unsigned char port_id)
8084 {
8185 case 0x41 : // read status
8286 return gBecker .read (port_id) != 0 ? 2 : 0 ;
83-
87+
8488 case 0x42 : // read data
8589 return gBecker .read (port_id);
8690 }
@@ -122,6 +126,7 @@ becker_cartridge::string_type becker_cartridge::server_port() const
122126 return gBecker .server_port ();
123127}
124128
129+ // Save becker config
125130void becker_cartridge::configure_server (string_type server_address, string_type server_port)
126131{
127132 gBecker .sethost (server_address.c_str (), server_port.c_str ());
0 commit comments