From 88f7c292541d6e707dc54908df4f3267d4a50082 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 13 Mar 2010 12:47:07 +0000 Subject: [PATCH] Yet another round of dead code cleanup --- Src/1541fs.cpp | 4 - Src/Display.h | 18 - Src/Frodo.rc | 291 ------------ Src/Network.cpp | 1 + Src/ROlib.h | 533 ---------------------- Src/ROlib.s | 1167 ----------------------------------------------- Src/SID.cpp | 47 -- Src/resource.h | 92 ---- Src/sysdeps.h | 47 -- 9 files changed, 1 insertion(+), 2199 deletions(-) delete mode 100644 Src/Frodo.rc delete mode 100644 Src/ROlib.h delete mode 100644 Src/ROlib.s delete mode 100644 Src/resource.h diff --git a/Src/1541fs.cpp b/Src/1541fs.cpp index 303a397..7ebd396 100644 --- a/Src/1541fs.cpp +++ b/Src/1541fs.cpp @@ -42,10 +42,6 @@ #include "main.h" #include "Prefs.h" -#ifdef __riscos__ -#include "ROlib.h" -#endif - // Prototypes static bool match(const char *p, const char *n); diff --git a/Src/Display.h b/Src/Display.h index 903cbf4..7a9a73c 100644 --- a/Src/Display.h +++ b/Src/Display.h @@ -21,18 +21,8 @@ #ifndef _DISPLAY_H #define _DISPLAY_H -#ifdef __BEOS__ -#include -#endif - -#ifdef AMIGA -#include -#endif - -#ifdef HAVE_SDL #include extern SDL_Surface *real_screen; -#endif // Colors for speedometer/drive LEDs enum { @@ -46,14 +36,6 @@ enum { PALETTE_SIZE = 21, }; -#ifdef WIN32 -#include -#endif - -#ifdef __riscos__ -#include "ROlib.h" -#endif - // Display dimensions #if defined(SMALL_DISPLAY) diff --git a/Src/Frodo.rc b/Src/Frodo.rc deleted file mode 100644 index 3e0232f..0000000 --- a/Src/Frodo.rc +++ /dev/null @@ -1,291 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -FRODO_ICON ICON DISCARDABLE "Frodo.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_MAIN_MENU MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&New", ID_FILE_NEW - MENUITEM "&Open...", ID_FILE_OPEN - MENUITEM SEPARATOR - MENUITEM "&Save", ID_FILE_SAVE - MENUITEM "Save &As...", ID_FILE_SAVEAS - MENUITEM SEPARATOR - MENUITEM "E&xit\tF10", ID_FILE_EX - END - POPUP "&Tools" - BEGIN - MENUITEM "&Preferences...", ID_TOOLS_PREFERENCES - MENUITEM SEPARATOR - MENUITEM "P&ause\tPause", ID_TOOLS_PAUSE - MENUITEM "&Fullscreen\tAlt-Enter", ID_TOOLS_FULLSCREEN - MENUITEM "Reset &DirectDraw\tCtrl-Enter", ID_TOOLS_RESETDIRECTDRAW - MENUITEM SEPARATOR - MENUITEM "Reset &C64\tF12", ID_TOOLS_RESETC64 - MENUITEM "&Insert Next Disk", ID_TOOLS_INSERTNEXTDISK - MENUITEM SEPARATOR - MENUITEM "&SAM...", ID_TOOLS_SAM, GRAYED - END - POPUP "&Help" - BEGIN - MENUITEM "&Contents...", ID_HELP_CONTENTS - MENUITEM "&Keyboard...", ID_HELP_KEYBOARD - MENUITEM "&Settings...", ID_HELP_SETTINGS - MENUITEM SEPARATOR - MENUITEM "&About...", ID_HELP_ABOUT - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include \r\n" - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_PREFERENCES_STANDARD DIALOG DISCARDABLE 0, 0, 272, 221 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Standard" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "&Devices",IDC_STATIC,5,0,260,90 - RTEXT "8",IDC_STATIC,10,10,15,10 - EDITTEXT IDC_DEVICE8,35,10,160,14,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_BROWSE8,205,10,50,14 - RTEXT "9",IDC_STATIC,10,30,15,10 - EDITTEXT IDC_DEVICE9,35,30,160,14,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_BROWSE9,205,30,50,14 - RTEXT "10",IDC_STATIC,10,50,15,10 - EDITTEXT IDC_DEVICE10,35,50,160,14,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_BROWSE10,205,50,50,14 - RTEXT "11",IDC_STATIC,10,70,15,10 - EDITTEXT IDC_DEVICE11,35,70,160,14,ES_AUTOHSCROLL - PUSHBUTTON "Browse...",IDC_BROWSE11,205,70,50,14 - GROUPBOX "&Parameters",IDC_STATIC,5,95,260,45 - LTEXT "Normal",IDC_STATIC,15,105,40,8 - EDITTEXT IDC_NORMAL,15,120,35,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_NORMAL_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,40,120,11,14 - LTEXT "Bad Lines",IDC_STATIC,55,105,40,8 - EDITTEXT IDC_BADLINES,55,120,35,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_BADLINES_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,80,120,11,14 - LTEXT "CIA",IDC_STATIC,95,105,35,8 - EDITTEXT IDC_CIA,95,120,35,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_CIA_SPIN,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS,120,120, - 11,14 - LTEXT "Floppy",IDC_STATIC,135,105,40,8 - EDITTEXT IDC_FLOPPY,135,120,35,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_FLOPPY_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,161,120,11,14 - LTEXT "Draw Every",IDC_STATIC,175,105,45,8 - EDITTEXT IDC_DRAWEVERY,175,120,35,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_DRAWEVERY_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,201,120,11,14 - LTEXT "REU Size",IDC_STATIC,220,105,40,8 - COMBOBOX IDC_REUSIZE,220,120,35,95,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - GROUPBOX "&Options",IDC_STATIC,5,145,260,70 - CONTROL "Limit Speed",IDC_LIMITSPEED,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,155,80,10 - CONTROL "Sprites",IDC_SPRITES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,101,155,80,10 - CONTROL "Sprite Collisions",IDC_SPRITECOLLISIONS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,185,155,75,10 - CONTROL "Joystick 1",IDC_JOYSTICK1,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,170,80,10 - CONTROL "Joystick 2",IDC_JOYSTICK2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,101,170,80,10 - CONTROL "Swap Joysticks",IDC_SWAPJOYSTICKS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,185,170,75,10 - CONTROL "Fast Reset",IDC_FASTRESET,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,185,80,10 - CONTROL "CIA IRQ Hack",IDC_CIAIRQHACK,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,101,185,80,10 - CONTROL "Map /",IDC_MAPSLASH,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,185,185,75,10 - CONTROL "SID Emulation",IDC_SIDEMULATION,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,200,80,10 - CONTROL "SID Filters",IDC_SIDFILTERS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,100,200,80,10 - CONTROL "1541 Emulation",IDC_1541EMULATION,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,185,200,75,10 -END - -IDD_PREFERENCES_WIN32 DIALOG DISCARDABLE 0, 0, 272, 221 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "WIN32" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "&Video",IDC_STATIC,5,0,260,60 - CONTROL "Fullscreen at startup",IDC_FULLSCREEN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,15,85,10 - CONTROL "System Memory",IDC_SYSTEMMEMORY,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,30,85,10 - CONTROL "Always Copy",IDC_ALWAYSCOPY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,45,85,10 - LTEXT "View&port",IDC_STATIC,110,20,70,8 - COMBOBOX IDC_VIEWPORT,110,31,70,184,CBS_DROPDOWN | - CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Display &Mode",IDC_STATIC,185,20,70,8 - COMBOBOX IDC_DISPLAYMODE,185,31,70,184,CBS_DROPDOWN | - CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - GROUPBOX "&Window",IDC_STATIC,5,65,260,50 - CONTROL "Hide Cursor",IDC_HIDECURSOR,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,80,85,10 - CONTROL "System Keys",IDC_SYSTEMKEYS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,95,85,10 - RTEXT "Scaling &Numerator",IDC_STATIC,110,75,95,10 - EDITTEXT IDC_SCALINGNUMERATOR,215,75,40,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SCALINGNUMERATOR_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,245,75,11,14 - RTEXT "Scaling &Denominator",IDC_STATIC,110,95,95,10 - EDITTEXT IDC_SCALINGDENOMINATOR,215,95,40,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_SCALINGDENOMINATOR_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,245,95,11,14 - GROUPBOX "&Sound",IDC_STATIC,5,120,260,45 - CONTROL "DirectSound",IDC_DIRECTSOUND,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,135,85,10 - CONTROL "Exclusive",IDC_EXCLUSIVESOUND,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,150,85,10 - LTEXT "Latency Min",IDC_STATIC,105,130,50,8 - EDITTEXT IDC_LATENCYMIN,105,140,40,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_LATENCYMIN_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,135,140,11,14 - LTEXT "Latency Max",IDC_STATIC,160,130,50,8 - EDITTEXT IDC_LATENCYMAX,160,140,40,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_LATENCYMAX_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,190,140,11,14 - LTEXT "Latency Avg",IDC_STATIC,215,130,45,8 - EDITTEXT IDC_LATENCYAVG,215,140,40,14,ES_AUTOHSCROLL - CONTROL "Spin1",IDC_LATENCYAVG_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS,245,140,11,14 - GROUPBOX "&General",IDC_STATIC,5,170,260,45 - CONTROL "Auto Pause",IDC_AUTOPAUSE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,15,185,85,10 - CONTROL "Show LEDs",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,105,185,85,10 - CONTROL "Preferences at startup",IDC_PREFSATSTARTUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,15,200,85,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_PREFERENCES_STANDARD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 214 - END - - IDD_PREFERENCES_WIN32, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 265 - TOPMARGIN, 7 - BOTTOMMARGIN, 214 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Cursor -// - -IDC_INVISIBLE CURSOR DISCARDABLE "Invisible.cur" -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Src/Network.cpp b/Src/Network.cpp index cfe2419..afa2db2 100644 --- a/Src/Network.cpp +++ b/Src/Network.cpp @@ -1260,5 +1260,6 @@ bool Network::networking_started = false; #if defined(GEKKO) #include "NetworkWii.h" #else +/* BSD-style sockets */ #include "NetworkUnix.h" #endif diff --git a/Src/ROlib.h b/Src/ROlib.h deleted file mode 100644 index 89877f5..0000000 --- a/Src/ROlib.h +++ /dev/null @@ -1,533 +0,0 @@ -/* - * ROlib.h - Defines Classes, variables and OS interface calls for Acorn - * RISC OS computers - * - * (C) 1997 Andreas Dehmel - * - * Frodo (C) 1994-1997,2002-2005 Christian Bauer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef RO_CUSTOM_LIB -#define RO_CUSTOM_LIB - -#include - - -#define TASKNAME "Frodo" -#define TASK_WORD 0x4b534154 - -/* Scrap-file for 1541fs directory function */ -#define RO_TEMPFILE ".FrodoDIR" - - - -/* Icon Flags */ -#define IFlg_Text 1 -#define IFlg_Sprite 2 -#define IFlg_Border 4 -#define IFlg_HCenter 8 -#define IFlg_VCenter 16 -#define IFlg_Filled 32 -#define IFlg_AntiA 64 -#define IFlg_AutoRdrw 128 -#define IFlg_Indir 256 -#define IFlg_RAdjust 512 -#define IFlg_Slct (1<<21) -#define IFlg_Grey (1<<22) - -/* Menu Flags */ -#define MFlg_Tick 1 -#define MFlg_Dotted 2 -#define MFlg_Writable 4 -#define MFlg_Warning 8 -#define MFlg_LastItem 128 - -/* Joystick stuff */ -#define JoyDir_Thresh 32 -#define JoyButton1 (1<<16) -#define JoyButton2 (1<<17) - - - -/* Size of WIMP data types */ -#define RO_WINDOW_WORDS 23 -#define RO_WINDOW_BYTES 92 -#define RO_ICON_WORDS 8 -#define RO_ICON_BYTES 32 -#define RO_MHEAD_WORDS 7 -#define RO_MHEAD_BYTES 28 -#define RO_MITEM_WORDS 6 -#define RO_MITEM_BYTES 24 - - - - -/* Structures for directory scanning (mainly 1541fs) */ -/* May hold entire pathname, so DON'T REDUCE!!! */ -#define FILENAME_MAX_CHARS 256 /* must be >= NAMEBUF_LENGTH (256) */ - -typedef struct { - unsigned int load, exec, length, attrib, otype; - char name[FILENAME_MAX_CHARS]; -} dir_full_info; - -typedef struct { - int readno, offset, buffsize; - char *match; -} dir_env; - - - -/* WIMP structures: */ -typedef struct { - int *tit, *val; - int len; -} WIdatI; - -/* data type for window / icon data */ -typedef union { - char strg[12]; - WIdatI ind; -} WIdata; - - -/* Window descriptor - 23 words = 92 bytes */ -typedef struct { - int Handle; - int vminx,vminy,vmaxx,vmaxy; - int scrollx,scrolly; - int stackpos; - unsigned int wflags; - char col_tfg, col_tbg, col_wfg, col_wbg; /* title/work_area fore/background colour */ - char col_sbo, col_sbi, col_tsl, reserved;/* scroll bar inner/outer, title if input focus */ - int wminx, wminy, wmaxx, wmaxy; - unsigned int tflags, waflags; - int SpriteAreaPtr; - short min_width, min_height; - WIdata dat; - int icon_no; -} RO_Window; - - -/* Icon descriptor */ -typedef struct { - int minx, miny, maxx, maxy; - int iflags; - WIdata dat; -} RO_Icon; - - -typedef struct { - int WindowHandle; - int minx, miny, maxx, maxy; - int iflags; - WIdata dat; -} RO_IconDesc; - - -typedef struct { - char title[12]; - char col_tfg, col_tbg, col_wfg, col_wbg; - int width, height, vgap; -} RO_MenuHead; - - -typedef struct { - unsigned int mflags; - RO_MenuHead *submenu; - unsigned int iflags; - WIdata dat; -} RO_MenuItem; - - -/* Caret descriptor */ -typedef struct { - int WHandle; - int IHandle; - int offx, offy; - int height, index; -} RO_Caret; - - - -/* Joystick key descriptor */ -typedef struct { - unsigned char up, down, left, right, fire; -} Joy_Keys; - - - - -/* Declare classes that are needed in the following new classes */ -class C64Display; -class C64; - - - -/* Very simple class to read the resolution and eigen values */ -class RORes -{ - public: - RORes(void); - ~RORes(void); - - int resx,resy,eigx,eigy; -}; - - -/* Handle current screenmode */ -class ROScreen -{ - private: - _kernel_oserror ModeError; - - public: - ROScreen(void); - ~ROScreen(void); - int ReadMode(void); - - int resx, resy, ldbpp, eigx, eigy, ladd; - char *scrbase; -}; - - -class Icon -{ - private: - RO_IconDesc icon; - - public: - Icon(int IconHandle, const RO_IconDesc *IDesc); - ~Icon(void); - void setstate(unsigned int eor, unsigned int clear); - void getstate(void); - - int IHandle; -}; - - -class Window -{ - private: - RO_Window *wind; - bool isopen; - - public: - Window(const int *WDesc, const char *Title); - ~Window(void); - int MyHandle(void); - void GetWorkArea(int *Dest); - void RedrawAWindow(int *Block, uint8 *Bitmap, C64Display *Disp); - RO_Window *Descriptor(void); - RO_Icon *GetIcon(unsigned int number); - void SetIconState(unsigned int number, unsigned int eor, unsigned int clear); - void GetIconState(unsigned int number, int *Block); - void WriteIconText(unsigned int number, const char *text); - void WriteIconTextU(unsigned int number, const char *text); // update instead of force redrw - void WriteIconNumber(unsigned int number, int value); - void WriteIconNumberU(unsigned int number, int value); - char *ReadIconText(unsigned int number); - int ReadIconNumber(unsigned int number); - void ForceIconRedraw(unsigned int number); - void UpdateIcon(unsigned int number); - void WriteTitle(const char *title); - char *ReadTitle(void); - void UpdateTitle(void); - bool HaveInput(void); - bool OpenStatus(void); - bool OpenStatus(int *Block); - void open(void); - void open(int *Block); - void close(void); - void forceredraw(int minx, int miny, int maxx, int maxy); - void update(uint8 *Bitmap, C64Display *Disp); - void update(int *Block, uint8 *Bitmap, C64Display *Disp); - void redraw(int *Block, uint8 *Bitmap, C64Display *Disp); - void extent(int minx, int miny, int maxx, int maxy); - void getstate(void); - void getstate(int *dest); // read window definition to external block -}; - - -class WIMP -{ - private: - _kernel_oserror WimpError; - int Block[64], AuxBlock[64]; // two WIMP blocks for convenience - int Mask; - int DragType, CMOS_DragType; - bool UseScrap; // Scrap file used (data transfer protocol!) - bool EmuPaused; - int UseNULL; // Number of clients that need NULL events - int RAMsize, RAMtransfered, RAMpartner; // for RAM transfer - int LastMenu, LastClick, LastDrag, MenuType, LastIcon, SaveType; - int *SpriteArea; - RO_Caret LastCaret; - int EmuZoom; - Joy_Keys NewJoyKeys[2]; - C64 *the_c64; - - public: - WIMP(C64 *my_c64); - ~WIMP(void); - - // On startup - bool LoadATemplate(char *Name, Window **Which); - - // To make window and pane work as a team - void OpenEmuWindow(void); - void OpenEmuWindow(int *Block); // open at pos - void CloseEmuWindow(void); - void UpdateEmuWindow(void); // update window and pane - void ThePrefsToWindow(void); // write ThePrefs into the window - void WindowToThePrefs(void); // update ThePrefs from window - void SysConfToWindow(void); - void WindowToSysConf(void); - void PollSysConfWindow(void); // low-level koyboard scan - void DragIconSprite(Window *host, unsigned int number); - int CalculateVolume(int *Block); - int CheckFilename(char *name); - void SnapshotSaved(bool OK); - void IssueSnapshotRequest(void); - void SetLEDIcons(bool FloppyEmulation); - void SetEmuWindowSize(void); - void ToggleEmuWindowSize(void); - int ReadEmuWindowSize(void); - void NewDriveImage(int DrNum, int *MsgBlock, bool SetNow); - void SetSpeedLimiter(bool LimitSpeed); - - // Standard WIMP functions - void Poll(bool Paused); - void Redraw(void); - void OpenWindow(void); - void CloseWindow(void); - void MouseClick(void); - void UserDrag(void); - void KeyPressed(void); - void MenuSelection(void); - void UserMessage(void); - void UserMessageAck(void); - - // WIMP's Windows and Icons - Icon *IBicon; - Window *EmuWindow, *EmuPane, *PrefsWindow, *ConfigWindow, *InfoWindow, *SoundWindow, *SaveBox; - char SnapFile[256], RAMFile[256]; -}; - - - -/* system-specific Variables */ - -extern RO_IconDesc IBarIcon; -extern unsigned int TaskHandle; -extern int WimpMessages[]; - - -/* Functions available via ROlib (not RISC OS Lib, mind you) - All SWIs are called in the X-Form! */ - -extern "C" -{ - -/* WIMP FUNCTIONS */ - -/* returns handle or 0 if error */ -extern int Wimp_Initialise(int Version, int tw, const char *TaskName, const int *Messages); - -extern _kernel_oserror *Wimp_CloseDown(int Handle, int tw); - -/* returns handle or 0 if error */ -extern int Wimp_CreateWindow(const int *Window); - -extern int Wimp_CreateIcon(int Priority, const RO_IconDesc *Icon); - -extern _kernel_oserror *Wimp_DeleteWindow(const int *Window); - -extern _kernel_oserror *Wimp_DeleteIcon(int *Block); - -extern _kernel_oserror *Wimp_OpenWindow(const int *Window); - -extern _kernel_oserror *Wimp_CloseWindow(const int *Window); - -extern int Wimp_Poll(unsigned int Mask, int *Block, int *PollWord); - -/* returns 0 if no more to do or error */ -extern int Wimp_RedrawWindow(int *Block); - -extern int Wimp_UpdateWindow(int *Block); - -extern int Wimp_GetRectangle(int *Block); - -extern _kernel_oserror *Wimp_GetWindowState(int *Block); - -extern _kernel_oserror *Wimp_GetWindowInfo(int *Block); - -extern _kernel_oserror *Wimp_SetIconState(int *Block); - -extern _kernel_oserror *Wimp_GetIconState(int *Block); - -extern _kernel_oserror *Wimp_GetPointerInfo(int *Block); - -extern _kernel_oserror *Wimp_DragBox(int *Block); - -extern _kernel_oserror *Wimp_ForceRedraw(int Handle, int minx, int miny, int maxx, int maxy); - -extern _kernel_oserror *Wimp_SetCaretPosition(int WHandle, int IHandle, int xoff, int yoff, int height, int index); - -extern _kernel_oserror *Wimp_GetCaretPosition(RO_Caret *Caret); - -extern _kernel_oserror *Wimp_CreateMenu(const int *Menu, int cx, int cy); - -extern _kernel_oserror *Wimp_SetExtent(int Handle, int *Block); - -extern _kernel_oserror *Wimp_OpenTemplate(char *Name); - -extern _kernel_oserror *Wimp_CloseTemplate(void); - -extern _kernel_oserror *Wimp_LoadTemplate(char **Template, char **Indirect, char *IndirLimit, char *Fonts, char *Name, int *Position); - -extern _kernel_oserror *Wimp_ProcessKey(int Key); - -extern int Wimp_StartTask(char *command); - -extern _kernel_oserror *Wimp_ReportError(const _kernel_oserror *Error, unsigned int Flags, const char *AppName); - -extern _kernel_oserror *Wimp_GetWindowOutline(int *Block); - -extern int Wimp_PollIdle(unsigned int Mask, int *Block, int MinTime, int *PollWord); - -extern _kernel_oserror *Wimp_PlotIcon(int *Block); - -extern _kernel_oserror *Wimp_SendMessage(int Event, int *Block, int THandle, int IHandle); - -extern _kernel_oserror *Wimp_CreateSubMenu(int *MenuBlock, int cx, int xy); - -extern _kernel_oserror *Wimp_SpriteOp(int, int, int, int, int, int, int, int); - -extern _kernel_oserror *Wimp_BaseOfSprites(int *ROM, int *RAM); - -extern _kernel_oserror *Wimp_CommandWindow(int Action); - -extern _kernel_oserror *Wimp_TransferBlock(int SHandle, char *SBuff, int DHandle, char *DBuff, int BuffSize); - -extern _kernel_oserror *Wimp_SpriteInfo(char *name, int *width, int *height, int *mode); - -extern _kernel_oserror *DragASprite_Start(unsigned int Flags, int SpriteArea, char *SpriteName, int *Box, int *BBox); - -extern _kernel_oserror *DragASprite_Stop(void); - -extern _kernel_oserror *ColourTrans_SelectTable(int SMode, int SPal, int DMode, int DPal, char **Buffer, unsigned int Flags, int *TransWork, int *TransFunc); - -extern _kernel_oserror *ColourTrans_SetFontColours(int Handle, int BPal, int FPal, int Offset); - -extern _kernel_oserror *ColourTrans_SetColour(int GCOL, unsigned int Flags, int Action); - -extern _kernel_oserror *ColourTrans_SetGCOL(int Palette, unsigned int Flags, int Action); - - - -/* OS FUNCTIONS */ - -extern int OS_ReadModeVariable(int mode, int var); - -extern int OS_ReadDynamicArea(int area); - -extern int ScanKeys(int keys); - -extern int ReadKeyboardStatus(void); - -extern int ReadDragType(void); - -extern int SetMousePointer(int NewShape); - - -/* Generic sprite op call */ -extern _kernel_oserror *OS_SpriteOp(int, int, int, int, int, int, int, int); - -extern _kernel_oserror *OS_Plot(int Command, int x, int y); - -extern _kernel_oserror *MouseBoundingBox(char Box[8]); - -extern int OS_ReadMonotonicTime(void); - -extern _kernel_oserror *OS_ReadC(char *Code); - -/* returns length of characters read; if length negative ==> terminated by escape */ -extern int OS_ReadLine(char *Buffer, int BuffSize, int minasc, int maxasc, int Echo); - -/* true ==> escape */ -extern bool OS_ReadEscapeState(void); - -/* File related calls */ - -/* Returns object type */ -extern int ReadCatalogueInfo(char *Name, int Result[4]); - -/* Read the next name in the directory */ -extern _kernel_oserror *ReadDirName(const char *dirname, char *buffer, dir_env *env); - -/* Read the next entry (name, length, type,...) in the directory */ -extern _kernel_oserror *ReadDirNameInfo(const char *dirname,dir_full_info *buffer,dir_env *env); - -extern _kernel_oserror *DeleteFile(char *name); - -extern _kernel_oserror *OS_FlushBuffer(int BuffNum); - -/* These functions are more secure than using sprintf because they allow buffersize */ -/* Return value is a pointer to the terminating null */ -extern char *ConvertInteger1(int value, char *buffer, int buffsize); -extern char *ConvertInteger2(int value, char *buffer, int buffsize); -extern char *ConvertInteger3(int value, char *buffer, int buffsize); -extern char *ConvertInteger4(int value, char *buffer, int buffsize); - - -/* Misc */ - -extern unsigned int ModeColourNumber(unsigned int pal_entry); - -/* Returns -1 if error in joystick module, -2 if SWI unknown, joystate otherwise */ -extern int Joystick_Read(int joyno); - - -/* Sound stuff */ - -#define DRState_Active 1 -#define DRState_NeedData 2 -#define DRState_Overflow 4 - -/* Sound calls */ - -extern int Sound_Volume(int volume); - -/* Digital Renderer SWI calls */ -extern _kernel_oserror *DigitalRenderer_Activate(int Channels, int Length, int SamPeriod); - -extern _kernel_oserror *DigitalRenderer_Deactivate(void); - -extern _kernel_oserror *DigitalRenderer_Pause(void); - -extern _kernel_oserror *DigitalRenderer_Resume(void); - -extern _kernel_oserror *DigitalRenderer_GetTables(uint8 **LinToLog, uint8 **LogScale); - -extern int DigitalRenderer_ReadState(void); - -extern _kernel_oserror *DigitalRenderer_NewSample(uint8 *Sample); - -} - -#endif diff --git a/Src/ROlib.s b/Src/ROlib.s deleted file mode 100644 index de8f291..0000000 --- a/Src/ROlib.s +++ /dev/null @@ -1,1167 +0,0 @@ -;* -;* ROlib.h -;* -;* Assembler interface to RISC OS -;* (C) 1997 Andreas Dehmel -;* -;* Frodo (C) 1994-1997,2002-2005 Christian Bauer -;* -;* This program is free software; you can redistribute it and/or modify -;* it under the terms of the GNU General Public License as published by -;* the Free Software Foundation; either version 2 of the License, or -;* (at your option) any later version. -;* -;* This program is distributed in the hope that it will be useful, -;* but WITHOUT ANY WARRANTY; without even the implied warranty of -;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;* GNU General Public License for more details. -;* -;* You should have received a copy of the GNU General Public License -;* along with this program; if not, write to the Free Software -;* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -a1 rn 0 -a2 rn 1 -a3 rn 2 -a4 rn 3 -v1 rn 4 -v2 rn 5 -v3 rn 6 -v4 rn 7 -v5 rn 8 -v6 rn 9 -sl rn 10 -fp rn 11 -ip rn 12 -sp rn 13 -lr rn 14 -pc rn 15 - - - idfn (C) 1997 by Andreas Dehmel - -; ************ WIMP STUFF **************** - - AREA CODE, READONLY - align 4 - export |Wimp_Initialise| - = "Wimp_Initialise" - align 4 - -|Wimp_Initialise|: - swi 0x600c0 ;XWimp_Initialise - movvs a1,#0 ;return 0 if error - movvc a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CloseDown| - = "Wimp_CloseDown" - align 4 - -|Wimp_CloseDown| - swi 0x600dd ;XWimp_CloseDown - movvc a1,#0 ;return pointer to error block - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CreateWindow| - = "Wimp_CreateWindow" - align 4 - -|Wimp_CreateWindow|: - mov a2,a1 - swi 0x600c1 - movvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CreateIcon| - = "Wimp_CreateIcon" - align 4 - -|Wimp_CreateIcon|: - swi 0x600c2 - movvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_DeleteWindow| - = "Wimp_DeleteWindow" - align 4 - -|Wimp_DeleteWindow|: - mov a2,a1 - swi 0x600c3 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_DeleteIcon| - = "Wimp_DeleteIcon" - align 4 - -|Wimp_DeleteIcon|: - mov a2,a1 - swi 0x600c4 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_OpenWindow| - = "Wimp_OpenWindow" - align 4 - -|Wimp_OpenWindow|: - mov a2,a1 - swi 0x600c5 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CloseWindow| - = "Wimp_CloseWindow" - align 4 - -|Wimp_CloseWindow|: - mov a2,a1 - swi 0x600c6 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_Poll| - = "Wimp_Poll" - align 4 - -|Wimp_Poll|: - mov a4,a3 - swi 0x600c7 - mvnvs a1,#0 ;return -1 if error - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_RedrawWindow| - = "Wimp_RedrawWindow" - align 4 - -|Wimp_RedrawWindow|: - mov a2,a1 - swi 0x600c8 - movvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_UpdateWindow| - = "Wimp_UpdateWindow" - align 4 - -|Wimp_UpdateWindow| - mov a2,a1 - swi 0x600c9 - movvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetRectangle| - = "Wimp_GetRectangle" - align 4 - -|Wimp_GetRectangle|: - mov a2,a1 - swi 0x600ca - movvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetWindowState| - = "Wimp_GetWindowState" - align 4 - -|Wimp_GetWindowState|: - mov a2,a1 - swi 0x600cb - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetWindowInfo| - = "Wimp_GetWindowInfo" - align 4 - -|Wimp_GetWindowInfo|: - mov a2,a1 - swi 0x600cc - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_SetIconState| - = "Wimp_SetIconState" - align 4 - -|Wimp_SetIconState|: - mov a2,a1 - swi 0x600cd - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetIconState| - = "Wimp_GetIconState" - align 4 - -|Wimp_GetIconState|: - mov a2,a1 - swi 0x600ce - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetPointerInfo| - = "Wimp_GetPointerInfo" - align 4 - -|Wimp_GetPointerInfo|: - mov a2,a1 - swi 0x600cf - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_DragBox| - = "Wimp_DragBox" - align 4 - -|Wimp_DragBox|: - mov a2,a1 - swi 0x600d0 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_ForceRedraw| - = "Wimp_ForceRedraw" - align 4 - -|Wimp_ForceRedraw|: - stmdb sp!,{v1} - ldr v1,[sp,#4] - swi 0x600d1 - movvc a1,#0 - ldmia sp!,{v1} - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_SetCaretPosition| - = "Wimp_SetCaretPosition" - align 4 - -|Wimp_SetCaretPosition|: - stmdb sp!,{v1,v2} - add v1,sp,#8 - ldmia v1,{v1,v2} - swi 0x600d2 - movvc a1,#0 - ldmia sp!,{v1,v2} - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetCaretPosition| - = "Wimp_GetCaretPosition" - align 4 - -|Wimp_GetCaretPosition|: - mov a2,a1 - swi 0x600d3 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CreateMenu| - = "Wimp_CreateMenu" - align 4 - -|Wimp_CreateMenu|: - mov a4,a3 - mov a3,a2 - mov a2,a1 - swi 0x600d4 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_SetExtent| - = "Wimp_SetExtent" - align 4 - -|Wimp_SetExtent|: - swi 0x600d7 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_OpenTemplate| - = "Wimp_OpenTemplate" - align 4 - -|Wimp_OpenTemplate|: - mov a2,a1 - swi 0x600d9 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CloseTemplate| - = "Wimp_CloseTemplate" - align 4 - -|Wimp_CloseTemplate|: - swi 0x600da - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_LoadTemplate| - = "Wimp_LoadTemplate" - align 4 - -|Wimp_LoadTemplate|: - stmdb sp!,{a1,a2,v1-v4,lr} ;7 registers - mov v1,a4 ;Fonts - mov a4,a3 ;IndirectLimit - ldr a3,[a2] ;*Indirect - ldr a2,[a1] ;*Template - add v2,sp,#28 - ldmia v2,{v2,v4} - ldr v3,[v4] ;Position - swi 0x600db - addvs sp,sp,#8 - bvs |WLTexit| - str v3,[v4] ;store Position - ldmia sp!,{v1,v2} - str a2,[v1] - str a3,[v2] - mov a1,#0 -|WLTexit|: - ldmia sp!,{v1-v4,pc}^ - - - AREA CODE, READONLY - align 4 - export |Wimp_ProcessKey| - = "Wimp_ProcessKey" - align 4 - -|Wimp_ProcessKey|: - swi 0x600dc - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_StartTask| - = "Wimp_StartTask" - align 4 - -|Wimp_StartTask|: - swi 0x600de - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_ReportError| - = "Wimp_ReportError" - align 4 - -|Wimp_ReportError|: - swi 0x600df - movvs a1,#0 - movvc a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_GetWindowOutline| - = "Wimp_GetWindowOutline" - align 4 - -|Wimp_GetWindowOutline|: - mov a2,a1 - swi 0x600e0 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_PollIdle| - = "Wimp_PollIdle" - align 4 - -|Wimp_PollIdle|: - swi 0x600e1 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_PlotIcon| - = "Wimp_PlotIcon" - align 4 - -|Wimp_PlotIcon|: - mov a2,a1 - swi 0x600e2 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_SendMessage| - = "Wimp_SendMessage" - align 4 - -|Wimp_SendMessage|: - swi 0x600e7 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CreateSubMenu| - = "Wimp_CreateSubMenu" - align 4 - -|Wimp_CreateSubMenu|: - mov a4,a3 - mov a3,a2 - mov a2,a1 - swi 0x600e8 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_SpriteOp| - = "Wimp_SpriteOp" - align 4 - -|Wimp_SpriteOp|: - stmdb sp!,{v1-v4,lr} - add v1,sp,#20 - ldmia v1,{v1-v4} - swi 0x600e9 - movvc a1,#0 - ldmia sp!,{v1-v4,pc}^ - - - AREA CODE, READONLY - align 4 - export |Wimp_BaseOfSprites| - = "Wimp_BaseOfSprites" - align 4 - -|Wimp_BaseOfSprites|: - mov a3,a1 - mov a4,a2 - swi 0x600ea - strvc a1,[a3] - strvc a2,[a4] - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_CommandWindow| - = "Wimp_CommandWindow" - align 4 - -|Wimp_CommandWindow|: - swi 0x600ef - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_TransferBlock| - = "Wimp_TransferBlock" - align 4 - -|Wimp_TransferBlock|: - str v1,[sp,#-4]! - ldr v1,[sp,#4] - swi 0x600f1 - ldr v1,[sp],#4 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |Wimp_SpriteInfo| - = "Wimp_SpriteInfo" - align 4 - -|Wimp_SpriteInfo|: - stmdb sp!,{v1-v6,lr} - mov v4,a2 - mov v5,a3 - mov v6,a4 - mov a3,a1 - mov a1,#40 - movvc a1,#0 - swi 0x600e9 ;Wimp_SpriteOp - str a4,[v4] - str v1,[v5] - str v3,[v6] - ldmia sp!,{v1-v6,pc}^ - - - AREA CODE, READONLY - align 4 - export |DragASprite_Start| - = "DragASprite_Start" - align 4 - -|DragASprite_Start|: - swi 0x62400 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DragASprite_Stop| - = "DragASprite_Stop" - align 4 - -|DragASprite_Stop|: - swi 0x62401 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ColourTrans_SelectTable| - = "ColourTrans_SelectTable" - align 4 - -|ColourTrans_SelectTable|: - stmdb sp!,{v1-v4,lr} - add v1,sp,#20 - ldmia v1,{v1-v4} - ldr v1,[v1] - swi 0x60740 - addvs sp,sp,#4 - bvs |CTSTexit| - mov a1,v1 - ldr v1,[sp],#4 - str a1,[v1] - mov a1,#0 -|CTSTexit|: - ldmia sp!,{v2-v4,pc}^ - - - AREA CODE, READONLY - align 4 - export |ColourTrans_SetFontColours| - = "ColourTrans_SetFontColours" - align 4 - -|ColourTrans_SetFontColours|: - swi 0x6074f - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ColourTrans_SetColour| - = "ColourTrans_SetColour" - align 4 - -|ColourTrans_SetColour|: - str v1,[sp,#-4]! - mov v1,a3 - mov a4,a2 - swi 0x6075e - movvc a1,#0 - ldr v1,[sp],#4 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ColourTrans_SetGCOL| - = "ColourTrans_SetGCOL" - align 4 - -|ColourTrans_SetGCOL|: - str v1,[sp,#-4]! - mov v1,a3 - mov a4,a2 - swi 0x60743 - movvc a1,#0 - ldr v1,[sp],#4 - movs pc,lr - - - - - -; ************* OS STUFF *************** - - AREA CODE, READONLY - align 4 - export |OS_ReadModeVariable| - = "OS_ReadModeVariable" - align 4 - -|OS_ReadModeVariable|: - swi 0x20035 - mvncs a1,#0 - movcc a1,a3 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |OS_ReadDynamicArea| - = "OS_ReadDynamicArea" - align 4 - -|OS_ReadDynamicArea|: - swi 0x2005c - movvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ModeColourNumber| - = "ModeColourNumber" - align 4 - -|ModeColourNumber|: - swi 0x60744 ;XColourTrans_ReturnColourNumber - mvnvs a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ScanKeys| - = "ScanKeys" - align 4 - -|ScanKeys|: - mov a2,a1 - mov a1,#121 - swi 0x20006 ;XOS_Byte 121 - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ReadKeyboardStatus| - = "ReadKeyboardStatus" - align 4 - -|ReadKeyboardStatus|: - mov a1,#202 - mov a2,#0 - mov a3,#255 - swi 0x20006 - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ReadDragType| - = "ReadDragType" - align 4 - -|ReadDragType|: - mov a1,#161 - mov a2,#28 - swi 0x20006 - and a1,a3,#2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |SetMousePointer| - = "SetMousePointer" - align 4 - -|SetMousePointer|: - mov a2,a1 - mov a1,#106 - swi 0x20006 - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY ;sprite ops (I have 52, 53 and 56 in mind) - align 4 - export |OS_SpriteOp| - = "OS_SpriteOp" - align 4 - -|OS_SpriteOp|: - stmdb sp!,{v1-v4,lr} - add v1,sp,#20 - ldmia v1,{v1-v4} - swi 0x2002e - movvc a1,#0 - ldmia sp!,{v1-v4,pc}^ - - - AREA CODE, READONLY - align 4 - export |OS_Plot| - = "OS_Plot" - align 4 - -|OS_Plot|: - swi 0x20045 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |MouseBoundingBox| - = "MouseBoundingBox" - align 4 - -|MouseBoundingBox|: - mov a2,a1 - mov a1,#21 - swi 0x20007 ;OS_Word21,1 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |OS_ReadMonotonicTime| - = "OS_ReadMonotonicTime" - align 4 - -|OS_ReadMonotonicTime|: - swi 0x20042 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |OS_ReadC| - = "OS_ReadC" - align 4 - -|OS_ReadC|: - mov a2,a1 - swi 0x20004 - strccb a1,[a2] - movcc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |OS_ReadLine| - = "OS_ReadLine" - align 4 - -|OS_ReadLine|: - stmdb sp!,{a1,v1,v2} - stmdb sp!,{a1-a3} - mov a1,#200 - mov a2,#1 - mvn a3,#1 - swi 0x20006 - mov v2,a2 - ldmia sp!,{a1-a3} - ldr v1,[sp,#8] - swi 0x2000e - mov v1,a2 - mov a1,#200 - mov a2,v2 - mvn a3,#0 - swi 0x20006 - mov a2,v1 - ldmia sp!,{a4,v1,v2} - bic a4,a4,#0xc0000000 - mov a1,#10 - strb a1,[a4,a2] ;make compatible with fgets (terminated by 10, not 13) - mov a1,a2 - rsbcs a1,a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |OS_ReadEscapeState| - = "OS_ReadEscapeState" - align 4 - -|OS_ReadEscapeState|: - swi 0x2002c - movcc a1,#0 - movcs a1,#1 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ReadCatalogueInfo| - = "ReadCatalogueInfo" - align 4 - -|ReadCatalogueInfo|: - stmdb sp!,{v1-v3,lr} - mov v3,a2 - mov a2,a1 - mov a1,#17 - swi 0x20008 ;OS_File 17 - stmia v3,{a3-v2} - ldmia sp!,{v1-v3,pc}^ - - - AREA CODE, READONLY - align 4 - export |ReadDirName| - = "ReadDirName" - align 4 - -|ReadDirName|: - stmdb sp!,{v1-v4,lr} - mov v4,a3 ;preserve dir_env * - ldmia a3,{a4-v3} - mov a3,a2 - mov a2,a1 - mov a1,#9 - swi 0x2000c ;OS_GBPB 9 - stmia v4,{a4,v1} - movvc a1,#0 - ldmia sp!,{v1-v4,pc}^ - - - AREA CODE, READONLY - align 4 - export |ReadDirNameInfo| - = "ReadDirNameInfo" - align 4 - -|ReadDirNameInfo|: - stmdb sp!,{v1-v4,lr} - mov v4,a3 - ldmia a3,{a4-v3} - mov a3,a2 - mov a2,a1 - mov a1,#10 - swi 0x2000c ;OS_GBPB 10 - stmia v4,{a4,v1} - movvc a1,#0 - ldmia sp!,{v1-v4,pc}^ - - - AREA CODE, READONLY - align 4 - export |DeleteFile| - = "DeleteFile" - align 4 - -|DeleteFile|: - stmdb sp!,{v1,v2} - mov a2,a1 - mov a1,#6 - swi 0x20008 ;OS_File 6 - movvc a1,#0 - ldmia sp!,{v1,v2} - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ConvertInteger1| - = "ConvertInteger1" - align 4 - -|ConvertInteger1|: - swi 0x200d9 - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ConvertInteger2| - = "ConvertInteger2" - align 4 - -|ConvertInteger2|: - swi 0x200da - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ConvertInteger3| - = "ConvertInteger3" - align 4 - -|ConvertInteger3|: - swi 0x200db - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |ConvertInteger4| - = "ConvertInteger4" - align 4 - -|ConvertInteger4|: - swi 0x200dc - mov a1,a2 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |OS_FlushBuffer| - = "OS_FlushBuffer" - align 4 - -|OS_FlushBuffer|: - mov a2,a1 - mov a1,#21 - swi 0x20006 - movvc a1,#0 - movs pc,lr - - - - - - -; ************ MISC STUFF *************** - - AREA CODE, READONLY - align 4 - export |Joystick_Read| - = "Joystick_Read" - align 4 - -|Joystick_Read|: - swi 0x63f40 ;XJoystick_Read (Acorn) - bvc |JRexit| - ldr a2,[a1] ;get error-number - eor a2,a2,#0xe6 - eors a2,a2,#0x100 - mvneq a1,#1 ;-2 ==> unknown SWI - mvnne a1,#0 ;-1 ==> error generated from joystick module -|JRexit|: - movs pc,lr - - - - - -; ************** SOUND SWIS ************* - - AREA CODE, READONLY - align 4 - export |Sound_Volume| - = "Sound_Volume" - align 4 - -|Sound_Volume|: - swi 0x60180 - mvnvs a1,#0 - movs pc,lr - - -; *********** DIGITAL RENDERER ********** - -DigiRendChunk equ 0x6F700 ;X flag set - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_Activate| - = "DigitalRenderer_Activate" - align 4 - -|DigitalRenderer_Activate|: - swi DigiRendChunk - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_Deactivate| - = "DigitalRenderer_Deactivate" - align 4 - -|DigitalRenderer_Deactivate|: - swi DigiRendChunk+1 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_Pause| - = "DigitalRenderer_Pause" - align 4 - -|DigitalRenderer_Pause|: - swi DigiRendChunk+2 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_Resume| - = "DigitalRenderer_Resume" - align 4 - -|DigitalRenderer_Resume|: - swi DigiRendChunk+3 - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_GetTables| - = "DigitalRenderer_GetTables" - align 4 - -|DigitalRenderer_GetTables|: - mov a3,a1 - mov a4,a2 - swi DigiRendChunk+4 - strvc a1,[a3] - strvc a2,[a4] - movvc a1,#0 - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_ReadState| - = "DigitalRenderer_ReadState" - align 4 - -|DigitalRenderer_ReadState|: - swi DigiRendChunk+5 - mvnvs a1,#0 ;returns -1 on error - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |DigitalRenderer_NewSample| - = "DigitalRenderer_NewSample" - align 4 - -|DigitalRenderer_NewSample|: - swi DigiRendChunk+6 - movvc a1,#0 - movs pc,lr - - -; *********** PLOTTER ************** - -BPlotChunk equ 0x70100 ;X bit set - - AREA CODE, READONLY - align 4 - export |PlotZoom1| - = "PlotZoom1" - align 4 - -|PlotZoom1|: - swi BPlotChunk - movs pc,lr - - - AREA CODE, READONLY - align 4 - export |PlotZoom2| - = "PlotZoom2" - align 4 - -|PlotZoom2|: - swi BPlotChunk+1 diff --git a/Src/SID.cpp b/Src/SID.cpp index e97138b..a0bcfd5 100644 --- a/Src/SID.cpp +++ b/Src/SID.cpp @@ -32,16 +32,6 @@ #include "Prefs.h" #include "Network.h" -#ifdef __mac__ -#include -#define M_PI 3.14159265358979323846 -#endif - -#ifdef WIN32 -class DigitalPlayer; -#endif - - #ifdef USE_FIXPOINT_MATHS #include "FixPoint.h" #endif @@ -373,35 +363,6 @@ private: int devfd, sndbufsize, buffer_rate; int16 *sound_buffer; #endif - -#ifdef __mac__ - SndChannelPtr chan1; - SndDoubleBufferHeader myDblHeader; - SndDoubleBufferPtr sampleBuffer1, sampleBuffer2; - SCStatus myStatus; - short sndbufsize; - OSErr err; - - static void doubleBackProc(SndChannelPtr chan, SndDoubleBufferPtr doubleBuffer); -#endif - -#ifdef WIN32 -public: - void VBlank(void); - -private: - void StartPlayer(void); - void StopPlayer(void); - - BOOL direct_sound; - DigitalPlayer *ThePlayer; - SWORD *sound_buffer; - int to_output; - int sb_pos; - int divisor; - int *lead; - int lead_pos; -#endif }; // Static data members @@ -1301,15 +1262,7 @@ void MOS6581::open_close_renderer(int old_type, int new_type) // Create new renderer if (new_type == SIDTYPE_DIGITAL) -#if defined(__BEOS__) || defined(__riscos__) - the_renderer = new DigitalRenderer(the_c64); -#else the_renderer = new DigitalRenderer; -#endif -#ifdef AMIGA - else if (new_type == SIDTYPE_SIDCARD) - the_renderer = new SIDCardRenderer; -#endif else the_renderer = NULL; diff --git a/Src/resource.h b/Src/resource.h deleted file mode 100644 index cc66374..0000000 --- a/Src/resource.h +++ /dev/null @@ -1,92 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Frodo.rc -// -#define FRODO_ICON 101 -#define IDR_MAIN_MENU 101 -#define IDD_PREFERENCES_STANDARD 102 -#define IDD_PREFERENCES_WIN32 103 -#define IDC_INVISIBLE 106 -#define IDC_NORMAL 1000 -#define IDC_SPRITES 1001 -#define IDC_SPRITECOLLISIONS 1002 -#define IDC_JOYSTICK1 1003 -#define IDC_JOYSTICK2 1004 -#define IDC_LIMITSPEED 1005 -#define IDC_SWAPJOYSTICKS 1006 -#define IDC_FASTRESET 1007 -#define IDC_CIAIRQHACK 1008 -#define IDC_1541EMULATION 1009 -#define IDC_MAPSLASH 1010 -#define IDC_SIDEMULATION 1011 -#define IDC_SIDFILTERS 1012 -#define IDC_BADLINES 1013 -#define IDC_NORMAL_SPIN 1014 -#define IDC_BADLINES_SPIN 1015 -#define IDC_CIA 1016 -#define IDC_CIA_SPIN 1017 -#define IDC_FLOPPY 1018 -#define IDC_FLOPPY_SPIN 1019 -#define IDC_DRAWEVERY 1020 -#define IDC_DRAWEVERY_SPIN 1021 -#define IDC_DEVICE8 1022 -#define IDC_DEVICE9 1023 -#define IDC_BROWSE8 1024 -#define IDC_BROWSE9 1025 -#define IDC_DEVICE10 1026 -#define IDC_BROWSE10 1027 -#define IDC_DEVICE11 1028 -#define IDC_BROWSE11 1029 -#define IDC_FULLSCREEN 1035 -#define IDC_AUTOPAUSE 1036 -#define IDC_SYSTEMMEMORY 1037 -#define IDC_EXCLUSIVESOUND 1038 -#define IDC_PREFSATSTARTUP 1039 -#define IDC_VIEWPORT 1040 -#define IDC_DISPLAYMODE 1041 -#define IDC_ALWAYSCOPY 1042 -#define IDC_HIDECURSOR 1043 -#define IDC_SYSTEMKEYS 1044 -#define IDC_LATENCYMIN 1045 -#define IDC_LATENCYMAX 1046 -#define IDC_LATENCYAVG 1047 -#define IDC_SCALINGNUMERATOR 1048 -#define IDC_LATENCYMIN_SPIN 1049 -#define IDC_LATENCYAVG_SPIN 1050 -#define IDC_REUSIZE 1050 -#define IDC_LATENCYMAX_SPIN 1051 -#define IDC_SCALINGDENOMINATOR 1052 -#define IDC_SCALINGNUMERATOR_SPIN 1053 -#define IDC_SCALINGDENOMINATOR_SPIN 1054 -#define IDC_DIRECTSOUND 1055 -#define IDC_SHOWLEDS 1056 -#define ID_FILE_EX 40001 -#define ID_TOOLS_RESETC64 40002 -#define ID_TOOLS_SAM 40003 -#define ID_TOOLS_INSERTNEXTDISK 40004 -#define ID_TOOLS_PREFERENCES 40005 -#define ID_HELP_ABOUT 40006 -#define ID_FILE_NEW 40007 -#define ID_FILE_OPEN 40009 -#define ID_FILE_SAVE 40011 -#define ID_FILE_SAVEAS 40012 -#define ID_HELP_CONTENTS 40013 -#define ID_HELP_KEYBOARD 40014 -#define ID_TOOLS_PAUSE 40015 -#define ID_HELP_SETTINGS 40016 -#define ID_TOOLS_FULLSCREEN 40017 -#define ID_TOOLS_RESETDIRECTDRAW 40018 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40019 -#define _APS_NEXT_CONTROL_VALUE 1051 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Src/sysdeps.h b/Src/sysdeps.h index 723b5d4..e9a526d 100644 --- a/Src/sysdeps.h +++ b/Src/sysdeps.h @@ -117,53 +117,10 @@ using std::vector; #include -#if EEXIST == ENOTEMPTY -#define BROKEN_OS_PROBABLY_AIX -#endif - -#ifdef __NeXT__ -#define S_IRUSR S_IREAD -#define S_IWUSR S_IWRITE -#define S_IXUSR S_IEXEC -#define S_ISDIR(val) (S_IFDIR & val) -struct utimbuf -{ - time_t actime; - time_t modtime; -}; -#endif - -#ifdef __DOS__ -#include -#include -#else #undef O_BINARY #define O_BINARY 0 -#endif - -#ifdef __mac__ -#define bool Boolean -#endif - -#ifdef __riscos -#define bool int -#endif - -#ifdef WIN32 -#include -#include -#if !defined(M_PI) -#define M_PI 3.14159265358979323846 -#endif -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#if _MSC_VER < 1100 -#define bool char -#endif -#define LITTLE_ENDIAN_UNALIGNED 1 -#endif /* If char has more then 8 bits, good night. */ -#ifndef __BEOS__ typedef unsigned char uint8; typedef signed char int8; @@ -206,7 +163,3 @@ typedef int64 intptr; #else #error Unsupported size of pointer #endif - -#else -#include -#endif // __BEOS__