Version 2.4

Added SMB support
This commit is contained in:
fabio.olimpieri 2011-08-08 11:21:52 +00:00
parent bee0dea293
commit 285d304f01
19 changed files with 568 additions and 293 deletions

View File

@ -1,240 +1,275 @@
TODO: Add ability to select files to load from disks in
a menu c64-network.org, v2.4:
c64-network.org, v2: * Added SMB support
* Fix sound when paused
-- Oibaf, fabio.olimpieri@tin.it,
* Fix nunchuk/classic controller joystick controls
c64-network.org, v2.3:
* Auto pause on menu enter * Added usb fat support
* Automatically save game info on screenshot timeout * Added wiimote rumble support
* Fix multiple bindings to the same key -- Oibaf, fabio.olimpieri@tin.it,
* Fix joystick input on the virtual keyboard c64-network.org,v2.2:
* Several bug fixes
c64-network.org, v1:
* Sound is transferred in network play now * Window zooming
* Joystick support is now SDL-based * General preferences saved manually
* Fix all warnings * Added items in info menu
* Run/Stop handled * Option to emulate joystick with arrows keys
* Redesign the GUI completely
-- Oibaf, fabio.olimpieri@tin.it,
* Only one type of network connections now - no need
to specify client or master c64-network.org, v2.1:
* Compiled with libogc 1.8.6
* Fix handling of network disconnects (also display a
helpful message!) * Fix option menu
* Don't display the network traffic string when connections close -- Oibaf, fabio.olimpieri@tin.it,
* Fix handling of packets > 4096 bytes
c64-network.org, v2:
* New SDL with GX graphics (although the impact for Frodo is * Fix sound when paused
quite minimal!)
* Fix nunchuk/classic controller joystick controls
* Disable SAM (no need for it on the Wii!)
* Auto pause on menu enter
-- Simon Kagstrom <simon.kagstrom@gmail.com>,
* Automatically save game info on screenshot timeout
version 10: * Fix multiple bindings to the same key
* Link against Tantrics new SDL build. Improves sound quite a bit.
* Fix joystick input on the virtual keyboard
* Quit to the homebrew menu unless networking has been enabled ("hard"
quit fixes a networking issue) -- Simon Kagstrom simon.kagstrom@gmail.com,
* Added ability to recurse into directories (partly by Holger Eilts) c64-network.org, v1:
* Sound is transferred in network play now
* Large redesign of menu layout and colors (Holger Eilts)
* Joystick support is now SDL-based
* Implemented sending text messages over the network to "taunt"
the other player (obviously a very important feature). Pressing * Fix all warnings
F10 enables this.
* Run/Stop handled
* Rearranged menus (networking is more promptly displayed)
* Redesign the GUI completely
* Sound transfer for network play has been implemented, but is not
active * Only one type of network connections now - no need
to specify client or master
* Use 32KHz sound samplerate. This improves the cracking sound
problems from v9 a bit. It also allows sound to be transferred via * Fix handling of network disconnects (also display a
the network to both Linux/Wii (sharing the same sample rate) and helpful message!)
lowering the network transfer rate.
* Don't display the network traffic string when connections close
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sun Apr 26 10:28:32 CEST 2009
* Fix handling of packets > 4096 bytes
version 9:
* Fix a buffer overflow in the network status string... * New SDL with GX graphics (although the impact for Frodo is
quite minimal!)
* Add network version field and display an error message if
an un-matching network version is connected * Disable SAM (no need for it on the Wii!)
* Select with zero timeout when waiting for peer addresses -- Simon Kagstrom <simon.kagstrom@gmail.com>,
* Don't block the server when connecting and instead draw a status
string to indicate that we're waiting for a connection version 10:
* Link against Tantrics new SDL build. Improves sound quite a bit.
* Networking support now works (but without sound being transferred). A
broker is installed on c64-network.game-host.org. * Quit to the homebrew menu unless networking has been enabled ("hard"
quit fixes a networking issue)
* Link with Yohanes port of SDL, modified by Danny Milo to get USB
keyboards working while still having the Home key do what it * Added ability to recurse into directories (partly by Holger Eilts)
should
* Large redesign of menu layout and colors (Holger Eilts)
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sat Apr 4 15:02:05 CEST 2009
* Implemented sending text messages over the network to "taunt"
the other player (obviously a very important feature). Pressing
version 8: F10 enables this.
* Lots of networking code which will not work yet
* Rearranged menus (networking is more promptly displayed)
* Also add the analog part of the classic controller
* Sound transfer for network play has been implemented, but is not
* Make it possible to control the game with the Nunchuk (Aaron Morris) active
* Correct binding of shifted keys (thanks to Bob Forgan) * Use 32KHz sound samplerate. This improves the cracking sound
problems from v9 a bit. It also allows sound to be transferred via
* Fix binding keys without the classic controller (plus etc were missing) the network to both Linux/Wii (sharing the same sample rate) and
lowering the network transfer rate.
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Wed Mar 11 19:46:11 CET 2009
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sun Apr 26 10:28:32 CEST 2009
version 7:
* Exit with SYS_RETURNTOMENU to make WAD's work version 9:
* Fix a buffer overflow in the network status string...
* Fix bug when multiple buttons are bound to the same keys, we now
simply skip one of the bindings. * Add network version field and display an error message if
an un-matching network version is connected
* Wiimote direction keys and "fire" can now be bound to keyboard
keys * Select with zero timeout when waiting for peer addresses
* Allow binding 1 and other extra buttons to joystick directions * Don't block the server when connecting and instead draw a status
and fire string to indicate that we're waiting for a connection
* Simplify menu code even more * Networking support now works (but without sound being transferred). A
broker is installed on c64-network.game-host.org.
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Mon Feb 23 19:30:09 CET 2009
* Link with Yohanes port of SDL, modified by Danny Milo to get USB
version 6: keyboards working while still having the Home key do what it
* Handle reset button (back to menu) should
* General code cleanup, e.g., simplified menu system and reduced the -- Simon Kagstrom <simon.kagstrom@gmail.com>, Sat Apr 4 15:02:05 CEST 2009
amount of code for that and some other things
* Increase key delay (should hopefully avoid the LOQD problem) version 8:
* Lots of networking code which will not work yet
* Implemented a virtual keyboard which is used to select key bindings and
also to type in strings * Also add the analog part of the classic controller
* Don't load files with zero-size (allows .d64 files where the first file * Make it possible to control the game with the Nunchuk (Aaron Morris)
is not a PRG to load correctly). Thanks to Dominik Reichardt for pointing
this out * Correct binding of shifted keys (thanks to Bob Forgan)
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sat Jan 24 11:48:01 CET 2009 * Fix binding keys without the classic controller (plus etc were missing)
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Wed Mar 11 19:46:11 CET 2009
version 5:
* Some wiimote sanity checks version 7:
* Exit with SYS_RETURNTOMENU to make WAD's work
* (Binary only) don't link with Yohanes SDL version anymore. It causes the
home button in the menu to quit the emulator. I'll investigate why it happens, * Fix bug when multiple buttons are bound to the same keys, we now
not sure right now. simply skip one of the bindings.
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Fri Jan 16 20:26:12 CET 2009 * Wiimote direction keys and "fire" can now be bound to keyboard
keys
version 4:
* (Binary only) link with Yohanes version of SDL (http://wiiapple.googlecode.com). * Allow binding 1 and other extra buttons to joystick directions
This might bring USB keyboard support, but that's untested. and fire
* Fixed + and - bindings on the wiimote and a keybinding bug which caused * Simplify menu code even more
keypresses to go unnoticed.
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Mon Feb 23 19:30:09 CET 2009
* Build the SC version of frodo, which makes some more games work or
some work better. For example, I *think* that the sound in Exploding version 6:
fist is now correct * Handle reset button (back to menu)
* Added arrow up/down/left/right and some other keys as bindable * General code cleanup, e.g., simplified menu system and reduced the
amount of code for that and some other things
* Some more "auto load" options, and rearranged the top menu order to help
with this * Increase key delay (should hopefully avoid the LOQD problem)
* Store preferences together with save games and reload those when the * Implemented a virtual keyboard which is used to select key bindings and
saved state is restored again also to type in strings
* Corrected file extension matching * Don't load files with zero-size (allows .d64 files where the first file
is not a PRG to load correctly). Thanks to Dominik Reichardt for pointing
* Show current key binding in the menu this out
* Added ability to turn on 1541 CPU emulation in the "other options" menu -- Simon Kagstrom <simon.kagstrom@gmail.com>, Sat Jan 24 11:48:01 CET 2009
(hint from Vermeylen Schoonakker)
* Make menu delay a bit shorter (looks better with the classic controller) version 5:
* Some wiimote sanity checks
* Merged with the Frodo CVS trunk. This changes a number of things, most
visibly the palette * (Binary only) don't link with Yohanes SDL version anymore. It causes the
home button in the menu to quit the emulator. I'll investigate why it happens,
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Fri Jan 16 17:58:51 CET 2009 not sure right now.
version 3: -- Simon Kagstrom <simon.kagstrom@gmail.com>, Fri Jan 16 20:26:12 CET 2009
* Various cleanup of the code
version 4:
* Fixed a bug in the menu code which was triggered when there * (Binary only) link with Yohanes version of SDL (http://wiiapple.googlecode.com).
is more than one submenu This might bring USB keyboard support, but that's untested.
* Make speed configurable (basically fast/normal/slow) and * Fixed + and - bindings on the wiimote and a keybinding bug which caused
change the menus a bit keypresses to go unnoticed.
* Skip SDL_Delay and SDL_GetTicks() which seem to give strange * Build the SC version of frodo, which makes some more games work or
results. Use gettime and usleep instead. some work better. For example, I *think* that the sound in Exploding
fist is now correct
* Improve performance a bit more by doing a custom
blit-to-double-size implementation * Added arrow up/down/left/right and some other keys as bindable
* Fixed changelog format * Some more "auto load" options, and rearranged the top menu order to help
with this
* Bought a Classic controller and fixed so that it actually works...
* Store preferences together with save games and reload those when the
* Allow controlling the joystick via the keyboard for the host (basically saved state is restored again
to ease debugging)
* Corrected file extension matching
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sun Jan 11 19:46:01 CET 2009
* Show current key binding in the menu
version 2:
* Also support the .prg and p00, s00 formats. Only .prg has been tested. * Added ability to turn on 1541 CPU emulation in the "other options" menu
(hint from Vermeylen Schoonakker)
* Added support for classic controllers. NOTE: This is untested since I don't
have a classic controller! * Make menu delay a bit shorter (looks better with the classic controller)
* Fixed some corner-cases in the prefs setting to avoid loosing key bindings etc * Merged with the Frodo CVS trunk. This changes a number of things, most
visibly the palette
* Improve keyboard bindings to handle press and release correctly and also
both controllers at the same time (key is released when the last controller releases -- Simon Kagstrom <simon.kagstrom@gmail.com>, Fri Jan 16 17:58:51 CET 2009
it)
version 3:
* Handle keycode 0 and therefore make del work * Various cleanup of the code
* Remove the 1-1 graphics option and make stretched the default. Should avoid * Fixed a bug in the menu code which was triggered when there
"helpful and constructive" messages such as is more than one submenu
http://wiinewz.com/forums/nintendo-news/91829-frodo-v1-0-a.html#post580580
* Make speed configurable (basically fast/normal/slow) and
* Improved speed just a bit (by enabling compiler optimization!) change the menus a bit
* Only save prefs on exit * Skip SDL_Delay and SDL_GetTicks() which seem to give strange
results. Use gettime and usleep instead.
* Pause sound in the menu
* Improve performance a bit more by doing a custom
* Handle very long filenames better (thanks Corey89 for pointing this out) blit-to-double-size implementation
* Corrected file sorting * Fixed changelog format
* Better Makefile * Bought a Classic controller and fixed so that it actually works...
* More keycodes added (C= etc) * Allow controlling the joystick via the keyboard for the host (basically
to ease debugging)
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sat Jan 10 17:26:32 CET 2009
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sun Jan 11 19:46:01 CET 2009
version 1:
* Initial release version 2:
* Also support the .prg and p00, s00 formats. Only .prg has been tested.
* Added support for classic controllers. NOTE: This is untested since I don't
have a classic controller!
* Fixed some corner-cases in the prefs setting to avoid loosing key bindings etc
* Improve keyboard bindings to handle press and release correctly and also
both controllers at the same time (key is released when the last controller releases
it)
* Handle keycode 0 and therefore make del work
* Remove the 1-1 graphics option and make stretched the default. Should avoid
"helpful and constructive" messages such as
http://wiinewz.com/forums/nintendo-news/91829-frodo-v1-0-a.html#post580580
* Improved speed just a bit (by enabling compiler optimization!)
* Only save prefs on exit
* Pause sound in the menu
* Handle very long filenames better (thanks Corey89 for pointing this out)
* Corrected file sorting
* Better Makefile
* More keycodes added (C= etc)
-- Simon Kagstrom <simon.kagstrom@gmail.com>, Sat Jan 10 17:26:32 CET 2009
version 1:
* Initial release

View File

@ -35,7 +35,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project # any extra libraries we wish to link with the project
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
LIBS := -lSDL_ttf -lSDL_image -lpng -ljpeg -lz -lSDL -lfreetype -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard LIBS := -lSDL_ttf -lSDL_image -lpng -ljpeg -lz -lSDL -lfreetype -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard -ltinysmb
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing # list of directories containing libraries, this must be the top level containing
@ -95,6 +95,7 @@ export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
-I$(LIBOGC_INC) \ -I$(LIBOGC_INC) \
-I$(CURDIR)/Src \ -I$(CURDIR)/Src \
-I$(PORTLIBS)/include -I$(PORTLIBS)/include
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
# build a list of library paths # build a list of library paths

View File

@ -1009,14 +1009,14 @@ uint8 C64::poll_joystick_buttons(int port, uint8 *table, bool *has_event)
fire_pressed[port]=false; fire_pressed[port]=false;
} }
if (((cur_ticks - last_ticks[port] > 150) && rumble_on[port] && !fire_pressed[port]) ||(!cur && (kc == 0x50) && !rumble_on[port] && fire_pressed[port])) if (((cur_ticks - last_ticks[port] > 120) && rumble_on[port] && !fire_pressed[port]) ||(!cur && (kc == 0x50) && !rumble_on[port] && fire_pressed[port]))
{ {
WPAD_Rumble(port, false); WPAD_Rumble(port, false);
rumble_on[port]=false; rumble_on[port]=false;
fire_pressed[port]=false; fire_pressed[port]=false;
joystickbutton_fire[port]=-1; joystickbutton_fire[port]=-1;
} }
if ((cur_ticks - last_ticks[port] > 150) && rumble_on[port] && fire_pressed[port]) if ((cur_ticks - last_ticks[port] > 120) && rumble_on[port] && fire_pressed[port])
{ {
WPAD_Rumble(port, false); WPAD_Rumble(port, false);
rumble_on[port]=false; rumble_on[port]=false;

View File

@ -114,8 +114,6 @@ Network::Network(const char *remote_host, int port)
{ {
const size_t size = NETWORK_UPDATE_SIZE; const size_t size = NETWORK_UPDATE_SIZE;
this->InitNetwork();
this->is_master = true; /* Assume true */ this->is_master = true; /* Assume true */
this->connected = false; this->connected = false;
@ -1247,7 +1245,7 @@ void Network::Disconnect()
/* Add a stop at the end of the update */ /* Add a stop at the end of the update */
this->AddNetworkUpdate(disconnect); this->AddNetworkUpdate(disconnect);
this->SendPeerUpdate(); if (!&this->peer_addr) this->SendPeerUpdate();
this->SendServerUpdate(); this->SendServerUpdate();
} }

View File

@ -298,7 +298,6 @@ public:
bool is_master; /* Some peers are more equal than others */ bool is_master; /* Some peers are more equal than others */
void InitNetwork();
void ShutdownNetwork(); void ShutdownNetwork();
@ -310,7 +309,7 @@ public:
bool WaitForPeerReply(); bool WaitForPeerReply();
bool SendBandWidthTest(); bool SendBandWidthTest();
network_connection_error_t WaitForBandWidthReply(); network_connection_error_t WaitForBandWidthReply();
network_connection_error_t WaitForPeerList(); network_connection_error_t WaitForPeerList();

View File

@ -90,11 +90,7 @@ void Network::CloseSocket()
close(this->sock); close(this->sock);
} }
void Network::InitNetwork()
{
/* Do nothing */
}
void Network::ShutdownNetwork() void Network::ShutdownNetwork()
{ {
} }

View File

@ -86,19 +86,6 @@ void Network::CloseSocket()
net_close(this->sock); net_close(this->sock);
} }
void Network::InitNetwork()
{
char myIP[16];
memset(myIP, 0, sizeof(myIP));
Gui::gui->status_bar->queueMessage("Getting IP address via DHCP...");
if (if_config(myIP, NULL, NULL, true) < 0) {
Gui::gui->status_bar->queueMessage("No DHCP reply");
return;
}
Gui::gui->status_bar->queueMessage("Got an address");
}
void Network::ShutdownNetwork() void Network::ShutdownNetwork()
{ {

View File

@ -108,7 +108,7 @@ Prefs::Prefs()
AlwaysCopy = false; AlwaysCopy = false;
SystemKeys = true; SystemKeys = true;
ShowLEDs = true; ShowLEDs = true;
Usbport = false; Port = PORT_SD;
Rumble = false; Rumble = false;
this->SetupJoystickDefaults(); this->SetupJoystickDefaults();
@ -123,6 +123,11 @@ Prefs::Prefs()
this->CursorKeysForJoystick = true; this->CursorKeysForJoystick = true;
strcpy(this->Theme, "DEFAULT"); strcpy(this->Theme, "DEFAULT");
strcpy(SmbUser, "User");
strcpy(SmbPwd, "Password");
strcpy(SmbShare, "Share");
strcpy(SmbIp,"192.168.0.1");
} }
@ -314,6 +319,8 @@ bool Prefs::operator==(const Prefs &rhs) const
&& AlwaysCopy == rhs.AlwaysCopy && AlwaysCopy == rhs.AlwaysCopy
&& SystemKeys == rhs.SystemKeys && SystemKeys == rhs.SystemKeys
&& ShowLEDs == rhs.ShowLEDs && ShowLEDs == rhs.ShowLEDs
&& Port == rhs.Port
&& Rumble == rhs.Rumble
&& this->MsPerFrame == rhs.MsPerFrame && this->MsPerFrame == rhs.MsPerFrame
&& this->NetworkKey == rhs.NetworkKey && this->NetworkKey == rhs.NetworkKey
&& this->NetworkPort == rhs.NetworkPort && this->NetworkPort == rhs.NetworkPort
@ -323,6 +330,10 @@ bool Prefs::operator==(const Prefs &rhs) const
&& strcmp(this->Theme, rhs.Theme) == 0 && strcmp(this->Theme, rhs.Theme) == 0
&& this->NetworkAvatar == rhs.NetworkAvatar && this->NetworkAvatar == rhs.NetworkAvatar
&& this->CursorKeysForJoystick == rhs.CursorKeysForJoystick && this->CursorKeysForJoystick == rhs.CursorKeysForJoystick
&& strcmp(this->SmbUser, rhs.SmbUser) == 0
&& strcmp(this->SmbPwd, rhs.SmbPwd) == 0
&& strcmp(this->SmbShare, rhs.SmbShare) == 0
&& strcmp(this->SmbIp, rhs.SmbIp) == 0
); );
} }
@ -529,10 +540,20 @@ void Prefs::Load(const char *filename)
strcpy(Theme, value); strcpy(Theme, value);
else if (!strcmp(keyword, "CursorKeysForJoystick")) else if (!strcmp(keyword, "CursorKeysForJoystick"))
CursorKeysForJoystick = !strcmp(value, "TRUE"); CursorKeysForJoystick = !strcmp(value, "TRUE");
else if (!strcmp(keyword, "Usbport")) else if (!strcmp(keyword, "Port")) {
Usbport = !strcmp(value, "TRUE"); if (!strcmp(value, "USB")) Port = PORT_USB;
else if (!strcmp(value, "SMB")) Port = PORT_SMB;
else Port = PORT_SD; }
else if (!strcmp(keyword, "Rumble")) else if (!strcmp(keyword, "Rumble"))
Rumble = !strcmp(value, "TRUE"); Rumble = !strcmp(value, "TRUE");
else if (!strcmp(keyword, "SmbUser"))
strcpy(SmbUser, value);
else if (!strcmp(keyword, "SmbPwd"))
strcpy(SmbPwd, value);
else if (!strcmp(keyword, "SmbShare"))
strcpy(SmbShare, value);
else if (!strcmp(keyword, "SmbIp"))
strcpy(SmbIp, value);
} }
} }
fclose(file); fclose(file);
@ -646,8 +667,28 @@ bool Prefs::Save(const char *filename)
maybe_write(file, NetworkRegion != TheDefaultPrefs.NetworkRegion, "NetworkRegion = %d\n", NetworkRegion); maybe_write(file, NetworkRegion != TheDefaultPrefs.NetworkRegion, "NetworkRegion = %d\n", NetworkRegion);
maybe_write(file, strcmp(Theme, TheDefaultPrefs.Theme) != 0, "Theme = %s\n", Theme); maybe_write(file, strcmp(Theme, TheDefaultPrefs.Theme) != 0, "Theme = %s\n", Theme);
maybe_write(file, CursorKeysForJoystick != TheDefaultPrefs.CursorKeysForJoystick, "CursorKeysForJoystick = %s\n", CursorKeysForJoystick ? "TRUE" : "FALSE"); maybe_write(file, CursorKeysForJoystick != TheDefaultPrefs.CursorKeysForJoystick, "CursorKeysForJoystick = %s\n", CursorKeysForJoystick ? "TRUE" : "FALSE");
maybe_write(file, Usbport != TheDefaultPrefs.Usbport, "Usbport = %s\n", Usbport ? "TRUE" : "FALSE");
if (Port != TheDefaultPrefs.Port)
{
fprintf(file, "Port = ");
switch (Port) {
case PORT_SD:
fprintf(file, "SD\n");
break;
case PORT_USB:
fprintf(file, "USB\n");
break;
case PORT_SMB:
fprintf(file, "SMB\n");
break;
}
}
maybe_write(file, Rumble != TheDefaultPrefs.Rumble, "Rumble = %s\n", Rumble ? "TRUE" : "FALSE"); maybe_write(file, Rumble != TheDefaultPrefs.Rumble, "Rumble = %s\n", Rumble ? "TRUE" : "FALSE");
maybe_write(file, strcmp(SmbUser, TheDefaultPrefs.SmbUser) != 0, "SmbUser = %s\n", SmbUser);
maybe_write(file, strcmp(SmbPwd, TheDefaultPrefs.SmbPwd) != 0, "SmbPwd = %s\n", SmbPwd);
maybe_write(file, strcmp(SmbShare, TheDefaultPrefs.SmbShare) != 0, "SmbShare = %s\n", SmbShare);
maybe_write(file, strcmp(SmbIp, TheDefaultPrefs.SmbIp) != 0, "SmbIp = %s\n", SmbIp);
fclose(file); fclose(file);
ThePrefsOnDisk = *this; ThePrefsOnDisk = *this;
return true; return true;

View File

@ -94,7 +94,12 @@ enum {
N_WIIMOTE_BINDINGS N_WIIMOTE_BINDINGS
}; };
// Device Port
enum {
PORT_SD, // Load from SD card
PORT_USB, // Load from USB port
PORT_SMB //Load from network
};
// Preferences data // Preferences data
class Prefs { class Prefs {
@ -155,7 +160,6 @@ public:
bool AlwaysCopy; // Always use a work surface (Win32) bool AlwaysCopy; // Always use a work surface (Win32)
bool SystemKeys; // Enable system keys and menu keys (Win32) bool SystemKeys; // Enable system keys and menu keys (Win32)
bool ShowLEDs; // Show LEDs (Win32) bool ShowLEDs; // Show LEDs (Win32)
bool Usbport; // Load from usb port
bool Rumble; // Enable Rumble for WII bool Rumble; // Enable Rumble for WII
uint32 MsPerFrame; uint32 MsPerFrame;
@ -177,6 +181,12 @@ public:
char Theme[128]; char Theme[128];
bool CursorKeysForJoystick; bool CursorKeysForJoystick;
int Port; //SD, USB or SMB
char SmbUser[32];
char SmbPwd[32];
char SmbShare[32];
char SmbIp[32];
}; };

View File

@ -25,6 +25,7 @@ extern SDL_Surface *screen;
#define METADATA_ROOT_PATH "/frodo/metadata" #define METADATA_ROOT_PATH "/frodo/metadata"
#define GAME_ROOT_PATH "/frodo/images" #define GAME_ROOT_PATH "/frodo/images"
#define GAME_ROOT_PATH_USB "usb:/" #define GAME_ROOT_PATH_USB "usb:/"
#define GAME_ROOT_PATH_SMB "smb:/"
#define TMP_ROOT_PATH "/frodo/tmp" #define TMP_ROOT_PATH "/frodo/tmp"
#define SAVE_GAME_ROOT_PATH "/frodo/saves" #define SAVE_GAME_ROOT_PATH "/frodo/saves"
#else #else
@ -109,6 +110,7 @@ Gui::Gui()
this->metadata_base_path = METADATA_ROOT_PATH; this->metadata_base_path = METADATA_ROOT_PATH;
this->game_base_path = GAME_ROOT_PATH; this->game_base_path = GAME_ROOT_PATH;
this->game_base_path_usb = GAME_ROOT_PATH_USB; this->game_base_path_usb = GAME_ROOT_PATH_USB;
this->game_base_path_smb = GAME_ROOT_PATH_SMB;
this->tmp_path = TMP_ROOT_PATH; this->tmp_path = TMP_ROOT_PATH;
this->save_game_path = SAVE_GAME_ROOT_PATH; this->save_game_path = SAVE_GAME_ROOT_PATH;

View File

@ -130,6 +130,7 @@ public:
const char *theme_base_path; const char *theme_base_path;
const char *game_base_path; const char *game_base_path;
const char *game_base_path_usb; const char *game_base_path_usb;
const char *game_base_path_smb;
const char *tmp_path; const char *tmp_path;
const char *save_game_path; const char *save_game_path;

View File

@ -2,6 +2,7 @@
#include "dialogue_box.hh" #include "dialogue_box.hh"
extern bool usbismount; extern bool usbismount;
extern bool smbismount;
class KeyboardTypingListener : public KeyboardListener, TimeoutHandler class KeyboardTypingListener : public KeyboardListener, TimeoutHandler
{ {
@ -70,7 +71,8 @@ public:
switch (which) switch (which)
{ {
case 0: /* Insert disc */ case 0: /* Insert disc */
if (Gui::gui->np->Usbport && usbismount) Gui::gui->dv->setDirectory(Gui::gui->game_base_path_usb); if (Gui::gui->np->Port == PORT_USB && usbismount) Gui::gui->dv->setDirectory(Gui::gui->game_base_path_usb);
else if (Gui::gui->np->Port == PORT_SMB && smbismount) Gui::gui->dv->setDirectory(Gui::gui->game_base_path_smb);
else Gui::gui->dv->setDirectory(Gui::gui->game_base_path); else Gui::gui->dv->setDirectory(Gui::gui->game_base_path);
Gui::gui->pushView(Gui::gui->dv); Gui::gui->pushView(Gui::gui->dv);

View File

@ -123,6 +123,28 @@ const char *select_analogue_dlg[8] = {
NULL NULL
}; };
const char *network_is_not_init_dlg[8] = {
/*00*/ "Network not initialized!",
/*01*/ "Enable a DHCP and",
/*02*/ "restart Frodo",
/*03*/ "#",
/*04*/ "#",
/*05*/ "#",
/*06*/ "^|OK",
NULL
};
const char *network_bad_ip_dlg[8] = {
/*00*/ "Please enter a valid IP!",
/*01*/ "#",
/*02*/ "#", /* Empty line */
/*03*/ "#",
/*04*/ "#",
/*05*/ "#",
/*06*/ "^|OK",
NULL
};
const char *frodo_help[11] = { const char *frodo_help[11] = {
/*00*/ "Welcome to the C64 network!", /*00*/ "Welcome to the C64 network!",
/*01*/ "#", /*01*/ "#",
@ -225,8 +247,8 @@ const char *options_menu_messages[15] = {
/*05*/ "^|window|fullscreen", /*05*/ "^|window|fullscreen",
/*06*/ "Speed (approx. %)", /*06*/ "Speed (approx. %)",
/*07*/ "^|95|100|110", /*07*/ "^|95|100|110",
/*08*/ "Usb port", /*08*/ "Port",
/*09*/ "^|ON|OFF", /*09*/ "^|SD|USB|SMB",
/*10*/ "Rumble", /*10*/ "Rumble",
/*11*/ "^|ON|OFF", /*11*/ "^|ON|OFF",
/*12*/ " ", /*12*/ " ",
@ -280,8 +302,8 @@ const char **options_menu_help[15] = {
}, },
NULL, NULL,
(const char*[]){ (const char*[]){
"Load games from usb port", "Load games from SD card,",
"instead of SD card", "USB port or network",
NULL, NULL,
}, },
NULL, NULL,
@ -299,7 +321,7 @@ const char **options_menu_help[15] = {
NULL, NULL,
}; };
const char **network_menu_help[9] = { const char **network_menu_help[15] = {
(const char*[]){ (const char*[]){
"Setup username to use on", "Setup username to use on",
"the C64 network. Must be", "the C64 network. Must be",
@ -344,6 +366,29 @@ const char **network_menu_help[9] = {
NULL, NULL,
}, },
NULL, NULL,
(const char*[]){
"Set SMB username",
NULL,
},
(const char*[]){
"Set SMB password",
NULL,
},
(const char*[]){
"Set SMB shared folder",
NULL,
},
(const char*[]){
"Set SMB remote IP",
NULL,
},
(const char*[]){
"Connect to the SMB",
"share, or disconnect if",
"you are already connected.",
NULL,
},
NULL,
}; };

View File

@ -19,12 +19,14 @@ extern const char *network_port_dialogue_messages[];
extern const char *network_unset_name_dlg[]; extern const char *network_unset_name_dlg[];
extern const char *network_need_connection[]; extern const char *network_need_connection[];
extern const char *network_need_peer[]; extern const char *network_need_peer[];
extern const char *network_bad_ip_dlg[];
extern const char *broken_theme_dlg[]; extern const char *broken_theme_dlg[];
extern const char *select_analogue_dlg[]; extern const char *select_analogue_dlg[];
extern const char *game_info_bad_year_dlg[]; extern const char *game_info_bad_year_dlg[];
extern const char *game_info_bad_number_dlg[]; extern const char *game_info_bad_number_dlg[];
extern const char *genre_dlg[]; extern const char *genre_dlg[];
extern const char *players_dlg[]; extern const char *players_dlg[];
extern const char *network_is_not_init_dlg[];
extern const char *save_state_done[]; extern const char *save_state_done[];
extern const char *save_prefs_done[]; extern const char *save_prefs_done[];

View File

@ -6,6 +6,51 @@
#include <sysdeps.h> #include <sysdeps.h>
#include <C64.h> #include <C64.h>
#ifdef GEKKO
#include <smb.h>
#endif
/****************************************************************************
* Mount SMB Share
****************************************************************************/
extern bool smbismount;
bool ConnectShare ()
{
if(smbismount)
return true;
#ifdef GEKKO
if(smbInit(ThePrefs.SmbUser, ThePrefs.SmbPwd,ThePrefs.SmbShare, ThePrefs.SmbIp))
smbismount = true;
#endif
if(!smbismount) Gui::gui->status_bar->queueMessage("Failed to connect to SMB share");
else {
Gui::gui->status_bar->queueMessage("Established connection to SMB share");
Gui::gui->np->Port = PORT_SMB;
}
return smbismount;
}
void CloseShare(bool silent)
{
if(smbismount) {
if (!silent) Gui::gui->status_bar->queueMessage("Disconnected from SMB share");
#ifdef GEKKO
smbClose("smb");
#endif
}
smbismount = false;
}
extern bool networkisinit;
class NetworkView; class NetworkView;
class NetworkMenu : public Menu, public KeyboardListener class NetworkMenu : public Menu, public KeyboardListener
@ -48,16 +93,33 @@ public:
else else
Gui::gui->np->NetworkPort = v; Gui::gui->np->NetworkPort = v;
} break; } break;
case 9:
strncpy(Gui::gui->np->SmbUser, str, sizeof(Gui::gui->np->SmbUser));
break;
case 10:
strncpy(Gui::gui->np->SmbPwd, str, sizeof(Gui::gui->np->SmbPwd));
break;
case 11:
strncpy(Gui::gui->np->SmbShare, str, sizeof(Gui::gui->np->SmbShare));
break;
case 12:
if (!inet_aton(str, NULL))
{
DialogueBox *error_dialogue = new DialogueBox(network_bad_ip_dlg);
Gui::gui->pushDialogueBox(error_dialogue);
}
else strncpy(Gui::gui->np->SmbIp, str, sizeof(Gui::gui->np->SmbIp));
break;
default: default:
panic("Cur sel is %d, not possible!\n", this->cur_sel); panic("Cur sel is %d, not possible!\n", this->cur_sel);
break; break;
} }
this->updateMessages(); this->updateMessages();
} }
virtual void selectCallback(int which) virtual void selectCallback(int which)
{ {
printf("option entry %d selected: %s\n", which, this->pp_msgs[which]); //printf("option entry %d selected: %s\n", which, this->pp_msgs[which]);
switch (which) switch (which)
{ {
case 0: case 0:
@ -69,7 +131,8 @@ public:
Gui::gui->pushView(Gui::gui->nrv); Gui::gui->pushView(Gui::gui->nrv);
break; break;
case 4: case 4:
if (TheC64->network) if (!networkisinit) Gui::gui->pushDialogueBox(new DialogueBox(network_is_not_init_dlg));
else if (TheC64->network)
TheC64->network->Disconnect(); TheC64->network->Disconnect();
else if ( strncmp(Gui::gui->np->NetworkName, "Unset", strlen("Unset")) == 0) else if ( strncmp(Gui::gui->np->NetworkName, "Unset", strlen("Unset")) == 0)
Gui::gui->pushDialogueBox(new DialogueBox(network_unset_name_dlg)); Gui::gui->pushDialogueBox(new DialogueBox(network_unset_name_dlg));
@ -101,6 +164,18 @@ public:
TheC64->TheDisplay->TypeNetworkMessage(); TheC64->TheDisplay->TypeNetworkMessage();
} }
break; break;
case 9:
case 10:
case 11:
case 12:
VirtualKeyboard::kbd->activate();
VirtualKeyboard::kbd->registerListener(this);
break;
case 13:
if (!networkisinit) Gui::gui->pushDialogueBox(new DialogueBox(network_is_not_init_dlg));
else {if (smbismount) CloseShare(false); else ConnectShare();this->updateMessages();}
break;
default: default:
break; break;
} }
@ -126,22 +201,36 @@ private:
Gui::gui->np->NetworkServer); Gui::gui->np->NetworkServer);
snprintf(this->strs[2], sizeof(this->strs[2]) - 1, "Set region (%s)", snprintf(this->strs[2], sizeof(this->strs[2]) - 1, "Set region (%s)",
region_to_str(Gui::gui->np->NetworkRegion)); region_to_str(Gui::gui->np->NetworkRegion));
snprintf(this->strs[3], sizeof(this->strs[3]) - 1, "Set SMB user (%s)",
Gui::gui->np->SmbUser);
snprintf(this->strs[4], sizeof(this->strs[4]) - 1, "Set SMB psw (%s)",
Gui::gui->np->SmbPwd);
snprintf(this->strs[5], sizeof(this->strs[5]) - 1, "Set SMB folder (%s)",
Gui::gui->np->SmbShare);
snprintf(this->strs[6], sizeof(this->strs[6]) - 1, "Set SMB IP (%s)",
Gui::gui->np->SmbIp);
this->messages[0] = this->strs[0]; this->messages[0] = this->strs[0];
this->messages[1] = this->strs[1]; this->messages[1] = this->strs[1];
this->messages[2] = this->strs[2]; this->messages[2] = this->strs[2];
this->messages[3] = " "; this->messages[3] = " ";
this->messages[4] = TheC64->network ? "Disconnect" : "Connect to the network!"; this->messages[4] = TheC64->network ? "Disconnect C64 network" : "Connect to C64 network!";
this->messages[5] = " "; this->messages[5] = " ";
this->messages[6] = "Post network message"; this->messages[6] = "Post network message";
this->messages[7] = "Post peer message"; this->messages[7] = "Post peer message";
this->messages[8] = NULL; this->messages[8] = " ";
this->messages[9] = this->strs[3];
this->messages[10] = this->strs[4];
this->messages[11] = this->strs[5];
this->messages[12] = this->strs[6];
this->messages[13] = smbismount ? "Disconnect from SMB share" : "Connect to SMB share";
this->messages[14] = NULL;
this->setText(this->messages); this->setText(this->messages);
} }
char strs[3][255]; char strs[7][255];
const char *messages[9]; const char *messages[15];
HelpBox *help; HelpBox *help;
}; };

View File

@ -65,7 +65,18 @@ public:
default: default:
panic("Impossible submenu value: %d\n", this->p_submenus[3].sel); panic("Impossible submenu value: %d\n", this->p_submenus[3].sel);
} }
Gui::gui->np->Usbport = !this->p_submenus[4].sel; switch (this->p_submenus[4].sel)
{
case 0:
Gui::gui->np->Port = PORT_SD; break;
case 1:
Gui::gui->np->Port = PORT_USB; break;
case 2:
Gui::gui->np->Port = PORT_SMB; break;
default:
panic("Impossible submenu value: %d\n", this->p_submenus[4].sel);
}
Gui::gui->np->Rumble = !this->p_submenus[5].sel; Gui::gui->np->Rumble = !this->p_submenus[5].sel;
} }
@ -89,7 +100,17 @@ public:
submenu_defs[3] = 1; break; submenu_defs[3] = 1; break;
} }
submenu_defs[4] = !Gui::gui->np->Usbport; switch (Gui::gui->np->Port)
{
case PORT_USB:
submenu_defs[4] = 1; break;
case PORT_SMB:
submenu_defs[4] = 2; break;
default:
/* If it has some other value... SD */
submenu_defs[4] = 0; break;
}
submenu_defs[5] = !Gui::gui->np->Rumble; submenu_defs[5] = !Gui::gui->np->Rumble;
this->setText(options_menu_messages, submenu_defs); this->setText(options_menu_messages, submenu_defs);
} }

View File

@ -40,12 +40,19 @@
// Global variables // Global variables
extern int init_graphics(void); extern int init_graphics(void);
extern void CloseShare (bool silent);
// Global variables // Global variables
C64 *TheC64 = NULL; // Global C64 object C64 *TheC64 = NULL; // Global C64 object
char AppDirPath[1024]; // Path of application directory char AppDirPath[1024]; // Path of application directory
bool usbismount = false; bool usbismount = false;
bool networkisinit = false;
bool smbismount = false;
#ifndef GEKKO
networkisinit = true;
#endif
// ROM file names // ROM file names
#ifndef DATADIR #ifndef DATADIR
@ -114,6 +121,21 @@ bool InitUSB()
__io_usbstorage.shutdown(); __io_usbstorage.shutdown();
} }
bool InitNetwork()
{
char myIP[16];
memset(myIP, 0, sizeof(myIP));
printf("Getting IP address via DHCP...\n\n");
if (if_config(myIP, NULL, NULL, true) < 0) {
printf("No DHCP reply\n");
return false;
}
printf("Got an address: %s\n",myIP);
return true;
}
#endif #endif
/* /*
@ -188,7 +210,10 @@ extern "C" int main(int argc, char **argv)
printf("USB FAT subsytem initialized\n\n"); printf("USB FAT subsytem initialized\n\n");
else else
printf("Impossible to initialize USB FAT subsytem\n\n"); printf("Impossible to initialize USB FAT subsytem\n\n");
sleep(3);
networkisinit = InitNetwork();
sleep(4);
//create tmp directory if it does not exist //create tmp directory if it does not exist
dir_tmp = opendir("/frodo/tmp"); dir_tmp = opendir("/frodo/tmp");
@ -201,6 +226,8 @@ extern "C" int main(int argc, char **argv)
the_app->ArgvReceived(argc, argv); the_app->ArgvReceived(argc, argv);
the_app->ReadyToRun(); the_app->ReadyToRun();
delete the_app; delete the_app;
if (smbismount) CloseShare (true);
#ifdef GEKKO #ifdef GEKKO
DeInitUSB(); DeInitUSB();

View File

@ -158,7 +158,7 @@ struct png_write_user_struct
static void user_write_fn(png_structp png_ptr, png_bytep bytes, png_size_t sz) static void user_write_fn(png_structp png_ptr, png_bytep bytes, png_size_t sz)
{ {
struct png_write_user_struct *out = (struct png_write_user_struct *)png_ptr->io_ptr; struct png_write_user_struct *out = (struct png_write_user_struct *) png_get_io_ptr(png_ptr);
out->data = xrealloc(out->data, out->sz + sz); out->data = xrealloc(out->data, out->sz + sz);
memcpy((uint8_t*)out->data + out->sz, bytes, sz); memcpy((uint8_t*)out->data + out->sz, bytes, sz);

View File

@ -2,8 +2,27 @@
<app version="2"> <app version="2">
<name>C64-network.org (Frodo)</name> <name>C64-network.org (Frodo)</name>
<coder>Simon Kagstrom</coder> <coder>Simon Kagstrom</coder>
<version>2.3</version> <version>2.4</version>
<release_date>20110622</release_date> <release_date>20110808</release_date>
<short_description>Commodore 64 emulator</short_description> <short_description>Commodore 64 emulator</short_description>
<long_description>C64-network.org is a networked C64 emulator based on Frodo written by Christian Bauer. It supports C64 disk and tape images in the .d64, .t64 and .prg formats. The port to Wii was done by Simon Kagstrom.</long_description> <long_description>C64-network.org is a networked C64 emulator based on Frodo written by Christian Bauer. It supports C64 disk and tape images in the .d64, .t64 and .prg formats. The port to Wii was done by Simon Kagstrom.
USAGE
------
Put .t64, .d64, prg or p00 files in /frodo/images on your SD card or in any directory on an usb fat disk.
The in-game menu allows you to insert disks/tapes, load them and configure the display, joystick ports etc.
Saves will be stored on the SD card. You can save and load game state.
When you save the game state also some preferences are saved in the state (joystick buttons, screen format, joystick port, 1541 emulation, rumble).
The whole set of preferences is saved from the main in-game menu and it is loaded on Frodo start-up.
Wiimote 1 is by default the joystick in port 1 and wiimote 2 the joystick in port 2, but you can swap this.
If rumble is enabled, the wiimote rumbles each time the fire button is pressed.
You can also load games from your computer through SMB protocol. You should configure and activate the connection in the network menu.
</long_description>
</app> </app>