| Previous | 15994 Revisions | Next |
| r1433 Monday 24th December, 2007 at 18:32:50 UTC by Nathan Woods |
|---|
| Added static qualifiers [Atari Ace] |
| [src/mess] | filemngr.c uimess.c utils.c |
| [src/mess/audio] | arcadia.c channelf.c gb.c osi.c vc4000.c wswan.c |
| [src/mess/devices] | chd_cd.c mfmdisk.c |
| [src/mess/drivers] | 3do.c a2600.c a310.c abc80.c abc80x.c amstrad.c apexc.c apf.c aquarius.c astrocde.c avigo.c bbcbc.c c16.c cbmb.c cgenie.c channelf.c comquest.c coupe.c cpschngr.c dai.c dgn_beta.c einstein.c enterp.c exidy.c galaxy.c gamecom.c gb.c genesis.c glasgow.c intv.c ip20.c ip22.c jaguar.c jupiter.c kaypro.c kc.c lviv.c lynx.c mekd2.c mpf1.c msx.c mtx.c mz700.c n64.c nascom1.c nes.c odyssey2.c osi.c pc8801.c pce.c pcw.c pcw16.c pet.c pmd85.c primo.c psx.c saturn.c sg1000.c sms.c sord.c ssystem3.c studio2.c svision.c sym1.c ti85.c tm990189.c tmc600.c trs80.c tx0.c vectrex.c vip.c x68k.c zx.c |
| [src/mess/formats] | a26_cas.c ap_dsk35.c apf_apt.c csw_cas.c fmsx_cas.c lviv_lvt.c mz_cas.c oric_tap.c pmd_pmd.c primoptp.c sord_cas.c svi_cas.c thom_cas.c thom_dsk.c tzx_cas.c uef_cas.c vt_cas.c wavfile.c zx81_p.c |
| [src/mess/includes] | msx_slot.h |
| [src/mess/machine] | 74145.c 8530scc.c 99_dsk.c 99_ide.c 99_peb.c adam.c advision.c aim65.c apple2.c atarifdc.c atom.c bbc.c c128.c c64.c cbmb.c cgenie.c coco.c compis.c concept.c cpm_bios.c dgn_beta.c electron.c gamecom.c gb.c hd63450.c intv.c lisa.c lviv.c mbee.c mc6850.c msx_slot.c mz700.c nes.c nes_mmc.c oric.c osi.c pc8801.c pc_fdc.c pmd85.c pokemini.c primo.c rp5c15.c sgi.c sms.c sym1.c ti99_4x.c uart8250.c vc1541.c vc20tape.c wswan.c |
| [src/mess/osd/windows] | menu.c |
| [src/mess/osd/winui] | layoutms.c |
| [src/mess/tools/dat2html] | dat2html.c |
| [src/mess/tools/imgtool] | iflopimg.c imghd.c imgtool.c stubs.c |
| [src/mess/tools/imgtool/modules] | cybiko.c fat.c pc_hard.c rsdos.c thomson.c ti99.c ti990hd.c vzdos.c |
| [src/mess/tools/messtest] | tststubs.c |
| [src/mess/video] | 733_asr.c a7800.c aim65.c amstrad.c astrocde.c avigo.c bbc.c dgn_beta.c electron.c gamecom.c gb.c i82720.c m6847.c newport.c odyssey2.c pc1403.c pc8801.c pc_aga.c pc_cga.c pcw16.c saa5050.c spectrum.c thomson.c vtech1.c wswan.c x68k.c zx.c |
| [src/osd/winui] | columnedit.c datafile.c dialogs.c mkhelp.c mui_audit.c mui_opts.c properties.c splitters.c treeview.c winui.c |
| r1432 | r1433 | |
|---|---|---|
| 33 | 33 | #include "winui.h" |
| 34 | 34 | |
| 35 | 35 | // Returns TRUE if successful |
| 36 | int DoExchangeItem(HWND hFrom, HWND hTo, int nMinItem) | |
| 36 | static int DoExchangeItem(HWND hFrom, HWND hTo, int nMinItem) | |
| 37 | 37 | { |
| 38 | 38 | LV_ITEM lvi; |
| 39 | 39 | TCHAR buf[80]; |
| r1432 | r1433 | |
| 69 | 69 | return FALSE; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | void DoMoveItem( HWND hWnd, BOOL bDown) | |
| 72 | static void DoMoveItem( HWND hWnd, BOOL bDown) | |
| 73 | 73 | { |
| 74 | 74 | LV_ITEM lvi; |
| 75 | 75 | TCHAR buf[80]; |
| r1432 | r1433 | |
|---|---|---|
| 57 | 57 | ****************************************************************************/ |
| 58 | 58 | #define DATAFILE_TAG '$' |
| 59 | 59 | |
| 60 | const char *DATAFILE_TAG_KEY = "$info"; | |
| 61 | const char *DATAFILE_TAG_BIO = "$bio"; | |
| 62 | const char *DATAFILE_TAG_MAME = "$mame"; | |
| 60 | static const char *DATAFILE_TAG_KEY = "$info"; | |
| 61 | static const char *DATAFILE_TAG_BIO = "$bio"; | |
| 62 | static const char *DATAFILE_TAG_MAME = "$mame"; | |
| 63 | 63 | |
| 64 | 64 | const char *history_filename = NULL; |
| 65 | 65 | const char *mameinfo_filename = NULL; |
| r1432 | r1433 | |
|---|---|---|
| 63 | 63 | #define SAMPLES_NOT_USED 3 |
| 64 | 64 | #define MAX_AUDITBOX_TEXT 0x7FFFFFFE |
| 65 | 65 | |
| 66 | HWND hAudit; | |
| 66 | static HWND hAudit; | |
| 67 | 67 | static int rom_index; |
| 68 | 68 | static int roms_correct; |
| 69 | 69 | static int roms_incorrect; |
| r1432 | r1433 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | /* Called with hWnd = Parent Window */ |
| 89 | void CalcSplitter(HWND hWnd, LPHZSPLITTER lpSplitter) | |
| 89 | static void CalcSplitter(HWND hWnd, LPHZSPLITTER lpSplitter) | |
| 90 | 90 | { |
| 91 | 91 | POINT p = {0,0}; |
| 92 | 92 | RECT leftRect, rightRect; |
| r1432 | r1433 | |
| 226 | 226 | numSplitters++; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | void OnInvertTracker(HWND hWnd, const RECT *rect) | |
| 229 | static void OnInvertTracker(HWND hWnd, const RECT *rect) | |
| 230 | 230 | { |
| 231 | 231 | HDC hDC = GetDC(hWnd); |
| 232 | 232 | HBRUSH hBrush = CreateSolidBrush(RGB(0xFF, 0xFF, 0xFF)); |
| r1432 | r1433 | |
| 241 | 241 | DeleteObject(hBrush); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | void StartTracking(HWND hWnd, UINT hitArea) | |
| 244 | static void StartTracking(HWND hWnd, UINT hitArea) | |
| 245 | 245 | { |
| 246 | 246 | if (!bTracking && lpCurSpltr != 0 && hitArea == SPLITTER_HITITEM) |
| 247 | 247 | { |
| r1432 | r1433 | |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | void StopTracking(HWND hWnd) | |
| 260 | static void StopTracking(HWND hWnd) | |
| 261 | 261 | { |
| 262 | 262 | if (bTracking) |
| 263 | 263 | { |
| r1432 | r1433 | |
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | UINT SplitterHitTest(HWND hWnd, POINTS p) | |
| 280 | static UINT SplitterHitTest(HWND hWnd, POINTS p) | |
| 281 | 281 | { |
| 282 | 282 | RECT rect; |
| 283 | 283 | POINT pt; |
| r1432 | r1433 | |
|---|---|---|
| 405 | 405 | // Screen shot Page tab control text |
| 406 | 406 | // these must match the order of the options flags in options.h |
| 407 | 407 | // (TAB_...) |
| 408 | const char* image_tabs_long_name[MAX_TAB_TYPES] = | |
| 408 | static const char* image_tabs_long_name[MAX_TAB_TYPES] = | |
| 409 | 409 | { |
| 410 | 410 | "Snapshot ", |
| 411 | 411 | "Flyer ", |
| r1432 | r1433 | |
| 417 | 417 | "History ", |
| 418 | 418 | }; |
| 419 | 419 | |
| 420 | const char* image_tabs_short_name[MAX_TAB_TYPES] = | |
| 420 | static const char* image_tabs_short_name[MAX_TAB_TYPES] = | |
| 421 | 421 | { |
| 422 | 422 | "snapshot", |
| 423 | 423 | "flyer", |
| r1432 | r1433 | |
|---|---|---|
| 25 | 25 | #include "osdcore.h" |
| 26 | 26 | |
| 27 | 27 | |
| 28 | int compare( const void *arg1, const void *arg2 ); | |
| 29 | void extract_help_ids(const char *buffer, FILE *fp); | |
| 28 | static int compare( const void *arg1, const void *arg2 ); | |
| 29 | static void extract_help_ids(const char *buffer, FILE *fp); | |
| 30 | 30 | |
| 31 | 31 | /*------------------------------------------------- |
| 32 | 32 | main - primary entry point |
| r1432 | r1433 | |
| 101 | 101 | return 0; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | int compare( const void *arg1, const void *arg2 ) | |
| 104 | static int compare( const void *arg1, const void *arg2 ) | |
| 105 | 105 | { |
| 106 | 106 | /* Compare all of both strings: */ |
| 107 | 107 | return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | void extract_help_ids(const char *buffer, FILE *fp) | |
| 110 | static void extract_help_ids(const char *buffer, FILE *fp) | |
| 111 | 111 | { |
| 112 | 112 | const char *ptr = buffer; |
| 113 | 113 | char **help_ids = malloc(500 * sizeof(char *)); |
| r1432 | r1433 | |
|---|---|---|
| 62 | 62 | #define NUM_EXCLUSIONS 10 |
| 63 | 63 | |
| 64 | 64 | /* Pairs of filters that exclude each other */ |
| 65 | DWORD filterExclusion[NUM_EXCLUSIONS] = | |
| 65 | static DWORD filterExclusion[NUM_EXCLUSIONS] = | |
| 66 | 66 | { |
| 67 | 67 | IDC_FILTER_CLONES, IDC_FILTER_ORIGINALS, |
| 68 | 68 | IDC_FILTER_NONWORKING, IDC_FILTER_WORKING, |
| r1432 | r1433 | |
|---|---|---|
| 111 | 111 | |
| 112 | 112 | /* this only has an entry for each TOP LEVEL extra folder + SubFolders*/ |
| 113 | 113 | LPEXFOLDERDATA ExtraFolderData[MAX_EXTRA_FOLDERS * MAX_EXTRA_SUBFOLDERS]; |
| 114 | int numExtraFolders = 0; | |
| 114 | static int numExtraFolders = 0; | |
| 115 | 115 | static int numExtraIcons = 0; |
| 116 | 116 | static char *ExtraFolderIcons[MAX_EXTRA_FOLDERS]; |
| 117 | 117 | |
| r1432 | r1433 | |
| 230 | 230 | SetWindowLongPtr(GetTreeView(), GWLP_WNDPROC, (LONG_PTR)TreeWndProc); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | #ifdef UNUSED_FUNCTION | |
| 233 | 234 | void DestroyTree(HWND hWnd) |
| 234 | 235 | { |
| 235 | 236 | if ( hTreeSmall ) |
| r1432 | r1433 | |
| 238 | 239 | hTreeSmall = NULL; |
| 239 | 240 | } |
| 240 | 241 | } |
| 242 | #endif | |
| 241 | 243 | |
| 242 | 244 | void SetCurrentFolder(LPTREEFOLDER lpFolder) |
| 243 | 245 | { |
| r1432 | r1433 | |
| 2157 | 2159 | *num_folders = numFolders; |
| 2158 | 2160 | } |
| 2159 | 2161 | |
| 2160 | BOOL TryRenameCustomFolderIni(LPTREEFOLDER lpFolder,const char *old_name,const char *new_name) | |
| 2162 | static BOOL TryRenameCustomFolderIni(LPTREEFOLDER lpFolder,const char *old_name,const char *new_name) | |
| 2161 | 2163 | { |
| 2162 | 2164 | char filename[MAX_PATH]; |
| 2163 | 2165 | char new_filename[MAX_PATH]; |
| r1432 | r1433 | |
|---|---|---|
| 216 | 216 | #define DBU_MIN_WIDTH 292 |
| 217 | 217 | #define DBU_MIN_HEIGHT 190 |
| 218 | 218 | |
| 219 | int MIN_WIDTH = DBU_MIN_WIDTH; | |
| 220 | int MIN_HEIGHT = DBU_MIN_HEIGHT; | |
| 219 | static int MIN_WIDTH = DBU_MIN_WIDTH; | |
| 220 | static int MIN_HEIGHT = DBU_MIN_HEIGHT; | |
| 221 | 221 | |
| 222 | 222 | /* Max number of bkground picture files */ |
| 223 | 223 | #define MAX_BGFILES 100 |
| r1432 | r1433 | |
| 349 | 349 | static void UpdateHistory(void); |
| 350 | 350 | |
| 351 | 351 | |
| 352 | void RemoveCurrentGameCustomFolder(void); | |
| 353 | void RemoveGameCustomFolder(int driver_index); | |
| 352 | static void RemoveCurrentGameCustomFolder(void); | |
| 353 | static void RemoveGameCustomFolder(int driver_index); | |
| 354 | 354 | |
| 355 | void BeginListViewDrag(NM_LISTVIEW *pnmv); | |
| 356 | void MouseMoveListViewDrag(POINTS pt); | |
| 357 | void ButtonUpListViewDrag(POINTS p); | |
| 355 | static void BeginListViewDrag(NM_LISTVIEW *pnmv); | |
| 356 | static void MouseMoveListViewDrag(POINTS pt); | |
| 357 | static void ButtonUpListViewDrag(POINTS p); | |
| 358 | 358 | |
| 359 | void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height); | |
| 359 | static void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height); | |
| 360 | 360 | |
| 361 | 361 | BOOL MouseHasBeenMoved(void); |
| 362 | void SwitchFullScreenMode(void); | |
| 362 | static void SwitchFullScreenMode(void); | |
| 363 | 363 | |
| 364 | 364 | /*************************************************************************** |
| 365 | 365 | External variables |
| r1432 | r1433 | |
| 795 | 795 | static BOOL use_gui_romloading = FALSE; |
| 796 | 796 | |
| 797 | 797 | static BOOL g_listview_dragging = FALSE; |
| 798 | HIMAGELIST himl_drag; | |
| 799 | int game_dragged; /* which game started the drag */ | |
| 800 | HTREEITEM prev_drag_drop_target; /* which tree view item we're currently highlighting */ | |
| 798 | static HIMAGELIST himl_drag; | |
| 799 | static int game_dragged; /* which game started the drag */ | |
| 800 | static HTREEITEM prev_drag_drop_target; /* which tree view item we're currently highlighting */ | |
| 801 | 801 | |
| 802 | 802 | static BOOL g_in_treeview_edit = FALSE; |
| 803 | 803 | |
| r1432 | r1433 | |
| 1047 | 1047 | * March '00- Seriously butchered from MSDN for mine own |
| 1048 | 1048 | * purposes, sayeth H0ek. |
| 1049 | 1049 | */ |
| 1050 | HICON FormatICOInMemoryToHICON(PBYTE ptrBuffer, UINT nBufferSize) | |
| 1050 | static HICON FormatICOInMemoryToHICON(PBYTE ptrBuffer, UINT nBufferSize) | |
| 1051 | 1051 | { |
| 1052 | 1052 | ICONIMAGE IconImage; |
| 1053 | 1053 | LPICONDIRENTRY lpIDE = NULL; |
| r1432 | r1433 | |
| 1646 | 1646 | free(buf); |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | void SetMainTitle(void) | |
| 1649 | static void SetMainTitle(void) | |
| 1650 | 1650 | { |
| 1651 | 1651 | char version[50]; |
| 1652 | 1652 | char buffer[100]; |
| r1432 | r1433 | |
| 4692 | 4692 | Picker_SetSelectedItem(hwndList, driver_index); |
| 4693 | 4693 | } |
| 4694 | 4694 | |
| 4695 | int GamePicker_GetItemImage(HWND hwndPicker, int nItem) | |
| 4695 | static int GamePicker_GetItemImage(HWND hwndPicker, int nItem) | |
| 4696 | 4696 | { |
| 4697 | 4697 | return GetIconForDriver(nItem); |
| 4698 | 4698 | } |
| 4699 | 4699 | |
| 4700 | const TCHAR *GamePicker_GetItemString(HWND hwndPicker, int nItem, int nColumn, | |
| 4700 | static const TCHAR *GamePicker_GetItemString(HWND hwndPicker, int nItem, int nColumn, | |
| 4701 | 4701 | TCHAR *pszBuffer, UINT nBufferLength) |
| 4702 | 4702 | { |
| 4703 | 4703 | const TCHAR *s = NULL; |
| r1432 | r1433 | |
| 6457 | 6457 | return CallWindowProc(g_lpPictureWndProc, hWnd, uMsg, wParam, lParam); |
| 6458 | 6458 | } |
| 6459 | 6459 | |
| 6460 | void RemoveCurrentGameCustomFolder(void) | |
| 6460 | static void RemoveCurrentGameCustomFolder(void) | |
| 6461 | 6461 | { |
| 6462 | 6462 | RemoveGameCustomFolder(Picker_GetSelectedItem(hwndList)); |
| 6463 | 6463 | } |
| 6464 | 6464 | |
| 6465 | void RemoveGameCustomFolder(int driver_index) | |
| 6465 | static void RemoveGameCustomFolder(int driver_index) | |
| 6466 | 6466 | { |
| 6467 | 6467 | int i; |
| 6468 | 6468 | TREEFOLDER **folders; |
| r1432 | r1433 | |
| 6499 | 6499 | } |
| 6500 | 6500 | |
| 6501 | 6501 | |
| 6502 | void BeginListViewDrag(NM_LISTVIEW *pnmv) | |
| 6502 | static void BeginListViewDrag(NM_LISTVIEW *pnmv) | |
| 6503 | 6503 | { |
| 6504 | 6504 | LV_ITEM lvi; |
| 6505 | 6505 | POINT pt; |
| r1432 | r1433 | |
| 6534 | 6534 | |
| 6535 | 6535 | } |
| 6536 | 6536 | |
| 6537 | void MouseMoveListViewDrag(POINTS p) | |
| 6537 | static void MouseMoveListViewDrag(POINTS p) | |
| 6538 | 6538 | { |
| 6539 | 6539 | HTREEITEM htiTarget; |
| 6540 | 6540 | TV_HITTESTINFO tvht; |
| r1432 | r1433 | |
| 6565 | 6565 | } |
| 6566 | 6566 | } |
| 6567 | 6567 | |
| 6568 | void ButtonUpListViewDrag(POINTS p) | |
| 6568 | static void ButtonUpListViewDrag(POINTS p) | |
| 6569 | 6569 | { |
| 6570 | 6570 | POINT pt; |
| 6571 | 6571 | HTREEITEM htiTarget; |
| r1432 | r1433 | |
| 6676 | 6676 | ListView_GetTopIndex(hwndList)+ ListView_GetCountPerPage(hwndList) ); |
| 6677 | 6677 | } |
| 6678 | 6678 | |
| 6679 | void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height) | |
| 6679 | static void CalculateBestScreenShotRect(HWND hWnd, RECT *pRect, BOOL restrict_height) | |
| 6680 | 6680 | { |
| 6681 | 6681 | int destX, destY; |
| 6682 | 6682 | int destW, destH; |
| r1432 | r1433 | |
| 6823 | 6823 | knew to remove the menu dynamically. |
| 6824 | 6824 | */ |
| 6825 | 6825 | |
| 6826 | void SwitchFullScreenMode(void) | |
| 6826 | static void SwitchFullScreenMode(void) | |
| 6827 | 6827 | { |
| 6828 | 6828 | LONG lMainStyle; |
| 6829 | 6829 |
| r1432 | r1433 | |
|---|---|---|
| 210 | 210 | #endif |
| 211 | 211 | |
| 212 | 212 | static void UpdateBackgroundBrush(HWND hwndTab); |
| 213 | HBRUSH hBkBrush; | |
| 213 | static HBRUSH hBkBrush; | |
| 214 | 214 | |
| 215 | 215 | /************************************************************** |
| 216 | 216 | * Local private variables |
| r1432 | r1433 | |
| 233 | 233 | /* Property sheets */ |
| 234 | 234 | |
| 235 | 235 | #define HIGHLIGHT_COLOR RGB(0,196,0) |
| 236 | HBRUSH highlight_brush = NULL; | |
| 237 | HBRUSH background_brush = NULL; | |
| 236 | static HBRUSH highlight_brush = NULL; | |
| 237 | static HBRUSH background_brush = NULL; | |
| 238 | 238 | #define VECTOR_COLOR RGB( 190, 0, 0) //DARK RED |
| 239 | 239 | #define FOLDER_COLOR RGB( 0, 128, 0 ) // DARK GREEN |
| 240 | 240 | #define PARENT_COLOR RGB( 190, 128, 192 ) // PURPLE |
| r1432 | r1433 | |
|---|---|---|
| 226 | 226 | an extension list |
| 227 | 227 | -------------------------------------------------*/ |
| 228 | 228 | |
| 229 | int internal_find_extension(const char *extension_list, const char *target_extension) | |
| 229 | static int internal_find_extension(const char *extension_list, const char *target_extension) | |
| 230 | 230 | { |
| 231 | 231 | /* this version allows target_extension to be delimited with a comma */ |
| 232 | 232 | int pos = 0; |
| r1432 | r1433 | |
|---|---|---|
| 38 | 38 | #define mfm_disk_header_size 0x0100 |
| 39 | 39 | |
| 40 | 40 | /* size of a double density track in this image */ |
| 41 | const int TrackSizeMFMLo = 0x01900; | |
| 41 | static const int TrackSizeMFMLo = 0x01900; | |
| 42 | 42 | |
| 43 | 43 | /* number of disk images that this code can handle at one time */ |
| 44 | 44 | #define MAX_MFM_DISK 4 |
| r1432 | r1433 | |
|---|---|---|
| 93 | 93 | * |
| 94 | 94 | *************************************/ |
| 95 | 95 | |
| 96 | int device_init_mess_cd(mess_image *image) | |
| 96 | static int device_init_mess_cd(mess_image *image) | |
| 97 | 97 | { |
| 98 | 98 | struct mess_cd *cd; |
| 99 | 99 | |
| r1432 | r1433 | |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | int device_load_mess_cd(mess_image *image) | |
| 152 | static int device_load_mess_cd(mess_image *image) | |
| 153 | 153 | { |
| 154 | 154 | return internal_load_mess_cd(image, NULL); |
| 155 | 155 | } |
| r1432 | r1433 | |
| 164 | 164 | * |
| 165 | 165 | *************************************/ |
| 166 | 166 | |
| 167 | void device_unload_mess_cd(mess_image *image) | |
| 167 | static void device_unload_mess_cd(mess_image *image) | |
| 168 | 168 | { |
| 169 | 169 | struct mess_cd *cd = get_drive(image); |
| 170 | 170 | assert(cd->cdrom_handle); |
| r1432 | r1433 | |
|---|---|---|
| 12 | 12 | #include "uimess.h" |
| 13 | 13 | #include "input.h" |
| 14 | 14 | |
| 15 | int mess_pause_for_ui = 0; | |
| 15 | //int mess_pause_for_ui = 0; | |
| 16 | 16 | static int ui_active = 0; |
| 17 | 17 | |
| 18 | 18 | int mess_ui_active(void) |
| r1432 | r1433 | |
|---|---|---|
| 16 | 16 | #include "osdmess.h" |
| 17 | 17 | #include "utils.h" |
| 18 | 18 | |
| 19 | void replace_lt_gt(char *line) | |
| 19 | static void replace_lt_gt(char *line) | |
| 20 | 20 | { |
| 21 | 21 | char buff[1024] = "", *src = line, *dst = buff; |
| 22 | 22 | |
| r1432 | r1433 | |
| 38 | 38 | strcpy(line, buff); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | void a_href_url(char *line) | |
| 41 | static void a_href_url(char *line) | |
| 42 | 42 | { |
| 43 | 43 | char buff[1024], c; |
| 44 | 44 | char *url_beg = strstr(line, "http://"), *url_end; |
| r1432 | r1433 | |
|---|---|---|
| 10 | 10 | #include "debug/debugcpu.h" |
| 11 | 11 | #endif /* MAME_DEBUG */ |
| 12 | 12 | |
| 13 | #ifdef UNUSED_FUNCTION | |
| 13 | 14 | int osd_create_display(const osd_create_params *params, UINT32 *rgb_components) |
| 14 | 15 | { |
| 15 | 16 | rgb_components[0] = 0xff0000; |
| r1432 | r1433 | |
| 31 | 32 | { |
| 32 | 33 | return NULL; |
| 33 | 34 | } |
| 35 | #endif | |
| 34 | 36 | |
| 35 | 37 | void osd_set_mastervolume(int attenuation) |
| 36 | 38 | { |
| 37 | 39 | } |
| 38 | 40 | |
| 41 | #ifdef UNUSED_FUNCTION | |
| 39 | 42 | int osd_get_mastervolume(void) |
| 40 | 43 | { |
| 41 | 44 | return 0; |
| r1432 | r1433 | |
| 94 | 97 | void osd_trak_read(int player, int *deltax, int *deltay) |
| 95 | 98 | { |
| 96 | 99 | } |
| 100 | #endif | |
| 97 | 101 | |
| 98 | 102 | void osd_customize_inputport_list(input_port_default_entry *defaults) |
| 99 | 103 | { |
| 100 | 104 | } |
| 101 | 105 | |
| 106 | #ifdef UNUSED_FUNCTION | |
| 102 | 107 | void osd_logerror(const char *text) |
| 103 | 108 | { |
| 104 | 109 | } |
| 110 | #endif | |
| 105 | 111 | |
| 106 | 112 | int osd_keyboard_disabled(void) |
| 107 | 113 | { |
| 108 | 114 | return 0; |
| 109 | 115 | } |
| 110 | 116 | |
| 117 | #ifdef UNUSED_FUNCTION | |
| 111 | 118 | void osd_begin_final_unloading(void) |
| 112 | 119 | { |
| 113 | 120 | } |
| r1432 | r1433 | |
| 115 | 122 | void osd_image_load_status_changed(mess_image *img, int is_final_unload) |
| 116 | 123 | { |
| 117 | 124 | } |
| 125 | #endif | |
| 118 | 126 | |
| 119 | 127 | #ifdef MAME_DEBUG |
| 120 | 128 | void osd_wait_for_debugger(void) |
| r1432 | r1433 | |
| 123 | 131 | } |
| 124 | 132 | #endif // MAME_DEBUG |
| 125 | 133 | |
| 134 | #ifdef UNUSED_FUNCTION | |
| 126 | 135 | int win_mess_config_init(void) |
| 127 | 136 | { |
| 128 | 137 | return 0; |
| 129 | 138 | } |
| 139 | #endif | |
| 130 | 140 | |
| 131 | 141 | void osd_break_into_debugger(const char *message) |
| 132 | 142 | { |
| 133 | 143 | } |
| 134 | 144 | |
| 145 | #ifdef UNUSED_FUNCTION | |
| 135 | 146 | void win_mess_options_init(void) |
| 136 | 147 | { |
| 137 | 148 | } |
| 149 | #endif | |
| 138 | 150 | |
| 139 | 151 | //============================================================ |
| 140 | 152 | // osd_alloc_executable |
| r1432 | r1433 | |
| 191 | 203 | } |
| 192 | 204 | |
| 193 | 205 | |
| 206 | #ifdef UNUSED_FUNCTION | |
| 194 | 207 | void osd_mess_config_init(running_machine *machine) |
| 195 | 208 | { |
| 196 | 209 | } |
| 210 | #endif |
| r1432 | r1433 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | const game_driver *const drivers[1]; |
| 9 | 9 | int rompath_extra; |
| 10 | int cheatfile; | |
| 11 | const char *db_filename; | |
| 10 | //int cheatfile; | |
| 11 | //const char *db_filename; | |
| 12 | 12 | int history_filename; |
| 13 | 13 | int mameinfo_filename; |
| 14 | 14 |
| r1432 | r1433 | |
|---|---|---|
| 200 | 200 | |
| 201 | 201 | |
| 202 | 202 | |
| 203 | imgtoolerr_t imgtool_floppy_get_sector_size(imgtool_image *image, UINT32 track, UINT32 head, UINT32 sector, UINT32 *sector_size) | |
| 203 | static imgtoolerr_t imgtool_floppy_get_sector_size(imgtool_image *image, UINT32 track, UINT32 head, UINT32 sector, UINT32 *sector_size) | |
| 204 | 204 | { |
| 205 | 205 | floperr_t ferr; |
| 206 | 206 | |
| r1432 | r1433 | |
| 213 | 213 | |
| 214 | 214 | |
| 215 | 215 | |
| 216 | imgtoolerr_t imgtool_floppy_read_sector(imgtool_image *image, UINT32 track, UINT32 head, UINT32 sector, void *buffer, size_t len) | |
| 216 | static imgtoolerr_t imgtool_floppy_read_sector(imgtool_image *image, UINT32 track, UINT32 head, UINT32 sector, void *buffer, size_t len) | |
| 217 | 217 | { |
| 218 | 218 | floperr_t ferr; |
| 219 | 219 | |
| r1432 | r1433 | |
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | |
| 229 | imgtoolerr_t imgtool_floppy_write_sector(imgtool_image *image, UINT32 track, UINT32 head, UINT32 sector, const void *buffer, size_t len) | |
| 229 | static imgtoolerr_t imgtool_floppy_write_sector(imgtool_image *image, UINT32 track, UINT32 head, UINT32 sector, const void *buffer, size_t len) | |
| 230 | 230 | { |
| 231 | 231 | floperr_t ferr; |
| 232 | 232 |
| r1432 | r1433 | |
|---|---|---|
| 82 | 82 | GLOBALS |
| 83 | 83 | ***************************************************************************/ |
| 84 | 84 | |
| 85 | imgtool_library *global_imgtool_library; | |
| 85 | static imgtool_library *global_imgtool_library; | |
| 86 | 86 | |
| 87 | 87 | static int global_omit_untested; |
| 88 | 88 | static void (*global_warn)(const char *message); |
| r1432 | r1433 | |
|---|---|---|
| 3860 | 3860 | dsk_createopts_density = 'F' |
| 3861 | 3861 | }; |
| 3862 | 3862 | |
| 3863 | OPTION_GUIDE_START( dsk_create_optionguide ) | |
| 3863 | static OPTION_GUIDE_START( dsk_create_optionguide ) | |
| 3864 | 3864 | OPTION_STRING(dsk_createopts_volname, "label", "Volume name" ) |
| 3865 | 3865 | OPTION_INT(dsk_createopts_sides, "sides", "Sides" ) |
| 3866 | 3866 | OPTION_INT(dsk_createopts_tracks, "tracks", "Tracks" ) |
| r1432 | r1433 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | #define FAT_SECLEN 512 |
| 55 | 55 | |
| 56 | OPTION_GUIDE_START( pc_chd_create_optionguide ) | |
| 56 | static OPTION_GUIDE_START( pc_chd_create_optionguide ) | |
| 57 | 57 | OPTION_INT('T', "cylinders", "Cylinders" ) |
| 58 | 58 | OPTION_INT('H', "heads", "Heads" ) |
| 59 | 59 | OPTION_INT('S', "sectors", "Sectors" ) |
| r1432 | r1433 | |
|---|---|---|
| 539 | 539 | return IMGTOOLERR_SUCCESS; |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | OPTION_GUIDE_START( cybiko_image_createimage_optguide ) | |
| 542 | static OPTION_GUIDE_START( cybiko_image_createimage_optguide ) | |
| 543 | 543 | OPTION_ENUM_START( 'F', "flash", "Flash Type" ) |
| 544 | 544 | OPTION_ENUM( 0, "AT45DB041", "AT45DB041 (528 KByte)" ) |
| 545 | 545 | OPTION_ENUM( 1, "AT45DB081", "AT45DB081 (1056 KByte)" ) |
| r1432 | r1433 | |
|---|---|---|
| 1523 | 1523 | |
| 1524 | 1524 | /************************* driver ***************************/ |
| 1525 | 1525 | |
| 1526 | OPTION_GUIDE_START( thom_createimage_optguide ) | |
| 1526 | static OPTION_GUIDE_START( thom_createimage_optguide ) | |
| 1527 | 1527 | OPTION_INT( 'H', "heads", "Heads" ) |
| 1528 | 1528 | OPTION_INT( 'T', "tracks", "Tracks" ) |
| 1529 | 1529 | OPTION_ENUM_START( 'D', "density", "Density" ) |
| r1432 | r1433 | |
| 1533 | 1533 | OPTION_STRING( 'N', "name", "Floppy name" ) |
| 1534 | 1534 | OPTION_GUIDE_END |
| 1535 | 1535 | |
| 1536 | OPTION_GUIDE_START( thom_writefile_optguide ) | |
| 1536 | static OPTION_GUIDE_START( thom_writefile_optguide ) | |
| 1537 | 1537 | OPTION_ENUM_START( 'T', "ftype", "File type" ) |
| 1538 | 1538 | OPTION_ENUM( 0, "auto", "Automatic (by extension)" ) |
| 1539 | 1539 | OPTION_ENUM( 1, "B", "Program" ) |
| r1432 | r1433 | |
|---|---|---|
| 409 | 409 | ti990_createopts_sectorsize = 'E' |
| 410 | 410 | }; |
| 411 | 411 | |
| 412 | OPTION_GUIDE_START( ti990_create_optionguide ) | |
| 412 | static OPTION_GUIDE_START( ti990_create_optionguide ) | |
| 413 | 413 | /*OPTION_STRING(ti990_createopts_volname, "label", "Volume name" )*/ |
| 414 | 414 | OPTION_INT(ti990_createopts_cylinders, "cylinders", "Cylinders" ) |
| 415 | 415 | OPTION_INT(ti990_createopts_heads, "heads", "Heads" ) |
| r1432 | r1433 | |
|---|---|---|
| 907 | 907 | Imgtool module declaration |
| 908 | 908 | *********************************************************************/ |
| 909 | 909 | |
| 910 | OPTION_GUIDE_START(vzdos_writefile_optionguide) | |
| 910 | static OPTION_GUIDE_START(vzdos_writefile_optionguide) | |
| 911 | 911 | OPTION_ENUM_START( 'T', "ftype", "File type" ) |
| 912 | 912 | OPTION_ENUM( 0, "basic", "Basic" ) |
| 913 | 913 | OPTION_ENUM( 1, "binary", "Binary" ) |
| r1432 | r1433 | |
|---|---|---|
| 449 | 449 | |
| 450 | 450 | |
| 451 | 451 | |
| 452 | imgtoolerr_t fat_partition_create(imgtool_image *image, UINT64 first_block, UINT64 block_count) | |
| 452 | static imgtoolerr_t fat_partition_create(imgtool_image *image, UINT64 first_block, UINT64 block_count) | |
| 453 | 453 | { |
| 454 | 454 | imgtoolerr_t err; |
| 455 | 455 | UINT32 heads, tracks, sectors_per_track; |
| r1432 | r1433 | |
|---|---|---|
| 579 | 579 | Imgtool module declaration |
| 580 | 580 | *********************************************************************/ |
| 581 | 581 | |
| 582 | OPTION_GUIDE_START( coco_rsdos_writefile_optionguide ) | |
| 582 | static OPTION_GUIDE_START( coco_rsdos_writefile_optionguide ) | |
| 583 | 583 | OPTION_ENUM_START( RSDOS_OPTIONS_FTYPE, "ftype", "File type" ) |
| 584 | 584 | OPTION_ENUM( 0, "basic", "Basic" ) |
| 585 | 585 | OPTION_ENUM( 1, "data", "Data" ) |
| r1432 | r1433 | |
|---|---|---|
| 243 | 243 | mess_hd_createopts_seclen = 'F' |
| 244 | 244 | }; |
| 245 | 245 | |
| 246 | OPTION_GUIDE_START( mess_hd_create_optionguide ) | |
| 246 | static OPTION_GUIDE_START( mess_hd_create_optionguide ) | |
| 247 | 247 | OPTION_INT(mess_hd_createopts_blocksize, "blocksize", "Sectors Per Block" ) |
| 248 | 248 | OPTION_INT(mess_hd_createopts_cylinders, "cylinders", "Cylinders" ) |
| 249 | 249 | OPTION_INT(mess_hd_createopts_heads, "heads", "Heads" ) |
| r1432 | r1433 | |
|---|---|---|
| 48 | 48 | UINT8 master_volume; /* Master volume */ |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | struct SND snd; | |
| 51 | static struct SND snd; | |
| 52 | 52 | |
| 53 | void wswan_ch_set_freq( struct CHAN *ch, UINT16 freq ) { | |
| 53 | static void wswan_ch_set_freq( struct CHAN *ch, UINT16 freq ) { | |
| 54 | 54 | ch->freq = freq; |
| 55 | 55 | ch->period = Machine->sample_rate / ( 3072000 / ( ( 2048 - freq ) << 5 ) ); |
| 56 | 56 | } |
| r1432 | r1433 | |
|---|---|---|
| 67 | 67 | /* Sound handler start */ |
| 68 | 68 | /************************************/ |
| 69 | 69 | |
| 70 | void *vc4000_custom_start(int clock, const struct CustomSound_interface *config) | |
| 70 | static void *vc4000_custom_start(int clock, const struct CustomSound_interface *config) | |
| 71 | 71 | { |
| 72 | 72 | vc4000_sound.channel = stream_create(0, 1, Machine->sample_rate, 0, vc4000_update); |
| 73 | 73 | return (void *) ~0; |
| r1432 | r1433 | |
|---|---|---|
| 11 | 11 | static int envelope; |
| 12 | 12 | static UINT32 sample_counter = 0; |
| 13 | 13 | |
| 14 | const int max_amplitude = 0x7fff; | |
| 14 | static const int max_amplitude = 0x7fff; | |
| 15 | 15 | |
| 16 | 16 | void channelf_sound_w(int mode) |
| 17 | 17 | { |
| r1432 | r1433 | |
|---|---|---|
| 71 | 71 | /* Sound handler start */ |
| 72 | 72 | /************************************/ |
| 73 | 73 | |
| 74 | void *arcadia_custom_start(int clock, const struct CustomSound_interface *config) | |
| 74 | static void *arcadia_custom_start(int clock, const struct CustomSound_interface *config) | |
| 75 | 75 | { |
| 76 | 76 | arcadia_sound.channel = stream_create(0, 1, Machine->sample_rate, 0, arcadia_update); |
| 77 | 77 | return (void *) ~0; |
| r1432 | r1433 | |
|---|---|---|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | void gb_sound_w_internal(int offset, UINT8 data ) { | |
| 185 | static void gb_sound_w_internal(int offset, UINT8 data ) { | |
| 186 | 186 | /* Store the value */ |
| 187 | 187 | snd_regs[offset] = data; |
| 188 | 188 |
| r1432 | r1433 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "sound/discrete.h" |
| 3 | 3 | |
| 4 | const discrete_dac_r1_ladder sb2m600_dac = | |
| 4 | static const discrete_dac_r1_ladder sb2m600_dac = | |
| 5 | 5 | { |
| 6 | 6 | 4, // size of ladder |
| 7 | 7 | {180, 180, 180, 180, 0, 0, 0, 0}, // R68, R69, R70, R71 |
| r1432 | r1433 | |
|---|---|---|
| 14 | 14 | } msx_slot_layout; |
| 15 | 15 | |
| 16 | 16 | #define MSX_LAYOUT_INIT(msx) \ |
| 17 | msx_slot_layout msx_slot_layout_##msx[] = { | |
| 17 | static const msx_slot_layout msx_slot_layout_##msx[] = { | |
| 18 | 18 | |
| 19 | 19 | #define MSX_LAYOUT_SLOT(prim, sec, page, extend, type, size, option) \ |
| 20 | 20 | { \ |
| r1432 | r1433 | |
| 220 | 220 | |
| 221 | 221 | typedef struct { |
| 222 | 222 | char name[9]; |
| 223 | msx_slot_layout *layout; | |
| 223 | const msx_slot_layout *layout; | |
| 224 | 224 | } msx_driver_struct; |
| 225 | 225 | |
| 226 | 226 | extern const msx_driver_struct msx_driver_list[]; |
| r1432 | r1433 | |
|---|---|---|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | void wswan_setup_palettes(void) { | |
| 51 | static void wswan_setup_palettes(void) { | |
| 52 | 52 | int i,j; |
| 53 | 53 | |
| 54 | 54 | if ( vdp.color_mode ) { |
| r1432 | r1433 | |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | void wswan_draw_background(void) { | |
| 70 | static void wswan_draw_background(void) { | |
| 71 | 71 | UINT16 map_addr; |
| 72 | 72 | UINT8 start_column; |
| 73 | 73 | int column; |
| r1432 | r1433 | |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | void wswan_draw_foreground_0( void ) { | |
| 160 | static void wswan_draw_foreground_0( void ) { | |
| 161 | 161 | UINT16 map_addr; |
| 162 | 162 | UINT8 start_column; |
| 163 | 163 | int column; |
| r1432 | r1433 | |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | void wswan_draw_foreground_2( void ) { | |
| 247 | static void wswan_draw_foreground_2( void ) { | |
| 248 | 248 | UINT16 map_addr; |
| 249 | 249 | UINT8 start_column; |
| 250 | 250 | int column; |
| r1432 | r1433 | |
| 331 | 331 | } |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | void wswan_draw_foreground_3( void ) { | |
| 334 | static void wswan_draw_foreground_3( void ) { | |
| 335 | 335 | UINT16 map_addr; |
| 336 | 336 | UINT8 start_column; |
| 337 | 337 | int column; |
| r1432 | r1433 | |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | void wswan_handle_sprites( int mask ) { | |
| 421 | static void wswan_handle_sprites( int mask ) { | |
| 422 | 422 | int i; |
| 423 | 423 | if ( vdp.sprite_count == 0 ) |
| 424 | 424 | return; |
| r1432 | r1433 | |
|---|---|---|
| 23 | 23 | #include "sound/dac.h" |
| 24 | 24 | |
| 25 | 25 | emu_timer *ula_nmi = NULL; |
| 26 | emu_timer *ula_irq = NULL; | |
| 26 | //emu_timer *ula_irq = NULL; | |
| 27 | 27 | int ula_nmi_active, ula_irq_active; |
| 28 | 28 | int ula_frame_vsync = 0; |
| 29 | 29 | int ula_scancode_count = 0; |
| 30 | 30 | int ula_scanline_count = 0; |
| 31 | int old_x = 0; | |
| 32 | int old_y = 0; | |
| 33 | int old_c = 0; | |
| 31 | static int old_x = 0; | |
| 32 | static int old_y = 0; | |
| 33 | static int old_c = 0; | |
| 34 | 34 | |
| 35 | 35 | /* |
| 36 | 36 | * Toggle the video output between black and white. |
| r1432 | r1433 | |
|---|---|---|
| 363 | 363 | /**************************/ |
| 364 | 364 | |
| 365 | 365 | /* Plot a pixel on beta text screen, takes care of doubling height and width where needed */ |
| 366 | void plot_text_pixel(int x, int y,int Dot,int Colour, int CharsPerLine, mame_bitmap *bitmap) | |
| 366 | static void plot_text_pixel(int x, int y,int Dot,int Colour, int CharsPerLine, mame_bitmap *bitmap) | |
| 367 | 367 | { |
| 368 | 368 | int PlotX; |
| 369 | 369 | int PlotY; |
| r1432 | r1433 | |
| 500 | 500 | |
| 501 | 501 | /* Plot a pixel on the graphics screen, similar to character plotter above */ |
| 502 | 502 | /* May merge at some point in the future, if they turn out to be sufficiently similar ! */ |
| 503 | void plot_gfx_pixel(int x, int y, int Dot, int Colour, mame_bitmap *bitmap) | |
| 503 | static void plot_gfx_pixel(int x, int y, int Dot, int Colour, mame_bitmap *bitmap) | |
| 504 | 504 | { |
| 505 | 505 | int DoubleX = (~GCtrl & GCtrlHiLo) ? 1 : 0; |
| 506 | 506 | int DoubleY = (~m6845_get_register(INTERLACE) & 0x03) ? 1 : 0; |
| r1432 | r1433 | |
|---|---|---|
| 333 | 333 | return (nbr >> 1) | (nbr << 15); |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | UINT32 gdc_get_base_addr(TYP_GDC* gdcp) | |
| 336 | static UINT32 gdc_get_base_addr(TYP_GDC* gdcp) | |
| 337 | 337 | { |
| 338 | 338 | int i; |
| 339 | 339 | UINT32 ret_val = 0; |
| r1432 | r1433 | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | |
| 352 | UINT32 gdc_partition_length(TYP_GDC* gdcp) | |
| 352 | static UINT32 gdc_partition_length(TYP_GDC* gdcp) | |
| 353 | 353 | { |
| 354 | 354 | /* Get a byte and put it into a temp */ |
| 355 | 355 | UINT32 pram_byte_low = gdcp->pram[2] >> 4; |
| r1432 | r1433 | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | /* Address here is from the top of the screen */ |
| 361 | void gdc_plot_word(UINT32 address, UINT16 writeWord) | |
| 361 | static void gdc_plot_word(UINT32 address, UINT16 writeWord) | |
| 362 | 362 | { |
| 363 | 363 | TYP_GDC_REGS_DISPLAY* dispregs = &gdc.registers.display; |
| 364 | 364 | UINT32 x; |
| r1432 | r1433 | |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | |
| 392 | void gdc_write_data(UINT16 data, | |
| 392 | static void gdc_write_data(UINT16 data, | |
| 393 | 393 | UINT16 mask, |
| 394 | 394 | UINT8 operation) |
| 395 | 395 | { |
| r1432 | r1433 | |
| 421 | 421 | address, base_addr); */ |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | void gdc_update_ead_and_mask(void) | |
| 424 | static void gdc_update_ead_and_mask(void) | |
| 425 | 425 | { |
| 426 | 426 | UINT32 maxAddr = gdc.registers.display.words_per_line * |
| 427 | 427 | gdc.registers.display.lines_per_field; |
| r1432 | r1433 | |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | |
| 454 | void gdc_auto_write_data(UINT16 data, | |
| 454 | static void gdc_auto_write_data(UINT16 data, | |
| 455 | 455 | UINT8 operation) |
| 456 | 456 | { |
| 457 | 457 | gdc_write_data(data, gdc.registers.display.mask, operation); |
| r1432 | r1433 | |
| 460 | 460 | gdc_update_ead_and_mask(); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | UINT16 gdc_read_data(UINT16 mask) | |
| 463 | static UINT16 gdc_read_data(UINT16 mask) | |
| 464 | 464 | { |
| 465 | 465 | /* Save address */ |
| 466 | 466 | UINT32 address = gdc.registers.display.ead; |
| r1432 | r1433 | |
| 468 | 468 | return gdc_mess.vram[address & gdc_mess.vramsize] & mask; |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | UINT16 gdc_auto_read_data(void) | |
| 471 | static UINT16 gdc_auto_read_data(void) | |
| 472 | 472 | { |
| 473 | 473 | UINT16 ret_val = gdc_read_data(gdc.registers.display.mask); |
| 474 | 474 | /* Update the ead and mask */ |
| r1432 | r1433 | |
| 515 | 515 | /* Name: gdc_cmd_sync */ |
| 516 | 516 | /* Desc: CMD - Sync */ |
| 517 | 517 | /*-------------------------------------------------------------------------*/ |
| 518 | void gdc_cmd_sync(void) | |
| 518 | static void gdc_cmd_sync(void) | |
| 519 | 519 | { |
| 520 | 520 | UINT16 reg16; |
| 521 | 521 | UINT8 reg; |
| r1432 | r1433 | |
| 893 | 893 | temp_reg &= 0xff; |
| 894 | 894 | break; |
| 895 | 895 | case 0x18: |
| 896 | /* FIXME: B | |
| 896 | /* FIXME: Bo | |
| 897 | 897 | /* FIXME: Save the mask */ |
| 898 | 898 | gdc.registers.display.mask &= 0xff00; |
| 899 | 899 | temp_reg = ( (temp_reg & 0xff ) << 8); |
| r1432 | r1433 | |
| 1016 | 1016 | /* The command bytes are decoded, and the succeeding parameters are */ |
| 1017 | 1017 | /* distributed to their proper destinations within the GDC. */ |
| 1018 | 1018 | /*-------------------------------------------------------------------------*/ |
| 1019 | void gdc_command_processor(UINT8 command) | |
| 1019 | static void gdc_command_processor(UINT8 command) | |
| 1020 | 1020 | { |
| 1021 | 1021 | switch(command) |
| 1022 | 1022 | { |
| r1432 | r1433 | |
| 1181 | 1181 | /* Param: command - the command */ |
| 1182 | 1182 | /* Return: Number of expected parameter bytes for the command. */ |
| 1183 | 1183 | /*-------------------------------------------------------------------------*/ |
| 1184 | int gdc_nbr_expected_params(UINT8 command) | |
| 1184 | static int gdc_nbr_expected_params(UINT8 command) | |
| 1185 | 1185 | { |
| 1186 | 1186 | switch(command) |
| 1187 | 1187 | { |
| r1432 | r1433 | |
| 1367 | 1367 | /* Name: compis_gdc_reset */ |
| 1368 | 1368 | /* Desc: GDC - Reset */ |
| 1369 | 1369 | /*-------------------------------------------------------------------------*/ |
| 1370 | #ifdef UNUSED_FUNCTION | |
| 1370 | 1371 | void compis_gdc_reset(void) |
| 1371 | 1372 | { |
| 1372 | 1373 | gdc_fifo_reset(&gdc); |
| 1373 | 1374 | |
| 1374 | 1375 | } |
| 1376 | #endif | |
| 1375 | 1377 | |
| 1376 | 1378 | /* |
| 1377 | 1379 | * MESS Stuff |
| r1432 | r1433 | |
|---|---|---|
| 42 | 42 | #define _NR_GB_VID_REGS 0x40 |
| 43 | 43 | |
| 44 | 44 | static UINT8 bg_zbuf[160]; |
| 45 | UINT8 gb_vid_regs[_NR_GB_VID_REGS]; | |
| 45 | static UINT8 gb_vid_regs[_NR_GB_VID_REGS]; | |
| 46 | 46 | static UINT16 cgb_bpal[32]; /* CGB current background palette table */ |
| 47 | 47 | static UINT16 cgb_spal[32]; /* CGB current background palette table */ |
| 48 | 48 | UINT16 sgb_pal[128]; /* SGB palette remapping */ |
| r1432 | r1433 | |
| 52 | 52 | UINT8 *gb_oam = NULL; |
| 53 | 53 | UINT8 *gb_vram; |
| 54 | 54 | static UINT8 *gb_vram_ptr; |
| 55 | int gbc_hdma_enabled; | |
| 55 | static int gbc_hdma_enabled; | |
| 56 | 56 | static UINT8 *gb_chrgen; /* Character generator */ |
| 57 | 57 | static UINT8 *gb_bgdtab; /* Background character table */ |
| 58 | 58 | static UINT8 *gb_wndtab; /* Window character table */ |
| r1432 | r1433 | |
| 95 | 95 | emu_timer *lcd_timer; |
| 96 | 96 | } gb_lcd; |
| 97 | 97 | |
| 98 | void (*update_scanline)(void); | |
| 98 | static void (*update_scanline)(void); | |
| 99 | 99 | |
| 100 | 100 | /* Prototypes */ |
| 101 | 101 | static TIMER_CALLBACK(gb_lcd_timer_proc); |
| r1432 | r1433 | |
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | 1453 | /* Ignore write when LCD is on and STAT is 02 or 03 */ |
| 1454 | int gb_video_oam_locked( void ) { | |
| 1454 | static int gb_video_oam_locked( void ) { | |
| 1455 | 1455 | gb_video_up_to_date(); |
| 1456 | 1456 | if ( ( LCDCONT & 0x80 ) && ( LCDSTAT & 0x02 ) ) { |
| 1457 | 1457 | return 1; |
| r1432 | r1433 | |
| 1479 | 1479 | gb_vram_ptr[offset] = data; |
| 1480 | 1480 | } |
| 1481 | 1481 | |
| 1482 | #ifdef UNUSED_FUNCTION | |
| 1482 | 1483 | READ8_HANDLER( gb_oam_r ) { |
| 1483 | 1484 | return gb_video_oam_locked() ? 0xFF : gb_oam[offset]; |
| 1484 | 1485 | } |
| 1486 | #endif | |
| 1485 | 1487 | |
| 1486 | 1488 | WRITE8_HANDLER( gb_oam_w ) { |
| 1487 | 1489 | if ( gb_video_oam_locked() || offset >= 0xa0 ) { |
| r1432 | r1433 | |
|---|---|---|
| 208 | 208 | return 0; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | UINT16 nCMAP0_PaletteIndex; | |
| 212 | UINT32 nCMAP0_Palette[0x10000]; | |
| 211 | static UINT16 nCMAP0_PaletteIndex; | |
| 212 | static UINT32 nCMAP0_Palette[0x10000]; | |
| 213 | 213 | |
| 214 | 214 | static WRITE32_HANDLER( newport_cmap0_w ) |
| 215 | 215 | { |
| r1432 | r1433 | |
|---|---|---|
| 6 | 6 | int pcw16_video_control; |
| 7 | 7 | |
| 8 | 8 | /* 16 colours, + 1 for border */ |
| 9 | unsigned short pcw16_colour_table[PCW16_NUM_COLOURS] = | |
| 9 | static unsigned short pcw16_colour_table[PCW16_NUM_COLOURS] = | |
| 10 | 10 | { |
| 11 | 11 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 12 | 12 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, |
| r1432 | r1433 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | #define Y_PIXELS 200 |
| 6 | 6 | |
| 7 | int scanline; | |
| 8 | unsigned int base_address; | |
| 7 | static int scanline; | |
| 8 | static unsigned int base_address; | |
| 9 | 9 | |
| 10 | #ifdef UNUSED_FUNCTION | |
| 10 | 11 | void gamecom_video_init( void ) { |
| 11 | 12 | scanline = 0; |
| 12 | 13 | } |
| 14 | #endif | |
| 13 | 15 | |
| 14 | 16 | INTERRUPT_GEN( gamecom_scanline ) { |
| 15 | 17 | // draw line |
| r1432 | r1433 | |
|---|---|---|
| 16 | 16 | static int flag_a; |
| 17 | 17 | static int flag_b; |
| 18 | 18 | |
| 19 | UINT16 *printerRAM; | |
| 19 | //UINT16 *printerRAM; | |
| 20 | 20 | |
| 21 | 21 | static emu_timer *print_timer; |
| 22 | 22 | static int printer_level; |
| r1432 | r1433 | |
| 43 | 43 | */ |
| 44 | 44 | |
| 45 | 45 | |
| 46 | void aim65_printer_inc(void) | |
| 46 | static void aim65_printer_inc(void) | |
| 47 | 47 | { |
| 48 | 48 | if (printer_dir) |
| 49 | 49 | { |
| r1432 | r1433 | |
| 74 | 74 | flag_b=0; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | void aim65_printer_cr(void) { | |
| 77 | static void aim65_printer_cr(void) { | |
| 78 | 78 | printer_x=0; |
| 79 | 79 | printer_y++; |
| 80 | 80 | if (printer_y > 500) printer_y = 0; |
| r1432 | r1433 | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| 145 | #ifdef UNUSED_FUNCTION | |
| 145 | 146 | VIDEO_UPDATE( aim65 ) |
| 146 | 147 | { |
| 147 | 148 | /* Display printer output */ |
| r1432 | r1433 | |
| 174 | 175 | |
| 175 | 176 | return 0; |
| 176 | 177 | } |
| 178 | #endif | |
| 177 | 179 |
| r1432 | r1433 | |
|---|---|---|
| 2048 | 2048 | * |
| 2049 | 2049 | *************************************/ |
| 2050 | 2050 | |
| 2051 | #ifdef UNUSED_FUNCTION | |
| 2051 | 2052 | void m6847_set_dirty(void) { set_dirty(); } |
| 2052 | 2053 | int m6847_get_scanline(void) { return get_scanline(); } |
| 2054 | #endif |
| r1432 | r1433 | |
|---|---|---|
| 787 | 787 | #define FUN(x) { x##_scandraw_8, x##_scandraw_16 } |
| 788 | 788 | |
| 789 | 789 | |
| 790 | const thom_scandraw thom_scandraw_funcs[THOM_VMODE_NB][2] = | |
| 790 | static const thom_scandraw thom_scandraw_funcs[THOM_VMODE_NB][2] = | |
| 791 | 791 | { |
| 792 | 792 | FUN(to770), FUN(mo5), FUN(bitmap4), FUN(bitmap4alt), FUN(mode80), |
| 793 | 793 | FUN(bitmap16), FUN(page1), FUN(page2), FUN(overlay), FUN(overlay3), |
| r1432 | r1433 | |
| 799 | 799 | /* called at the start of each scanline in the active area, just after |
| 800 | 800 | left border (-1<=y<199), and also after the last scanline (y=199) |
| 801 | 801 | */ |
| 802 | TIMER_CALLBACK( thom_scanline_start ) | |
| 802 | static TIMER_CALLBACK( thom_scanline_start ) | |
| 803 | 803 | { |
| 804 | 804 | int y = param; |
| 805 | 805 |
| r1432 | r1433 | |
|---|---|---|
| 42 | 42 | UINT16* x68k_spriteram; // sprite/background RAM |
| 43 | 43 | UINT16* x68k_spritereg; // sprite/background registers |
| 44 | 44 | |
| 45 | mame_bitmap* x68k_text_bitmap; // 1024x1024 4x1bpp planes text | |
| 46 | mame_bitmap* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages | |
| 47 | mame_bitmap* x68k_gfx_1_bitmap_16; | |
| 48 | mame_bitmap* x68k_gfx_2_bitmap_16; | |
| 49 | mame_bitmap* x68k_gfx_3_bitmap_16; | |
| 50 | mame_bitmap* x68k_gfx_0_bitmap_256; // 256 colour, 512x512, 2 pages | |
| 51 | mame_bitmap* x68k_gfx_1_bitmap_256; | |
| 52 | mame_bitmap* x68k_gfx_0_bitmap_65536; // 65536 colour, 512x512, 1 page | |
| 45 | static mame_bitmap* x68k_text_bitmap; // 1024x1024 4x1bpp planes text | |
| 46 | static mame_bitmap* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages | |
| 47 | static mame_bitmap* x68k_gfx_1_bitmap_16; | |
| 48 | static mame_bitmap* x68k_gfx_2_bitmap_16; | |
| 49 | static mame_bitmap* x68k_gfx_3_bitmap_16; | |
| 50 | static mame_bitmap* x68k_gfx_0_bitmap_256; // 256 colour, 512x512, 2 pages | |
| 51 | static mame_bitmap* x68k_gfx_1_bitmap_256; | |
| 52 | static mame_bitmap* x68k_gfx_0_bitmap_65536; // 65536 colour, 512x512, 1 page | |
| 53 | 53 | |
| 54 | tilemap* x68k_bg0_8; // two 64x64 tilemaps, 8x8 characters | |
| 55 | tilemap* x68k_bg1_8; | |
| 56 | tilemap* x68k_bg0_16; // two 64x64 tilemaps, 16x16 characters | |
| 57 | tilemap* x68k_bg1_16; | |
| 54 | static tilemap* x68k_bg0_8; // two 64x64 tilemaps, 8x8 characters | |
| 55 | static tilemap* x68k_bg1_8; | |
| 56 | static tilemap* x68k_bg0_16; // two 64x64 tilemaps, 16x16 characters | |
| 57 | static tilemap* x68k_bg1_16; | |
| 58 | 58 | |
| 59 | 59 | extern unsigned int x68k_scanline; |
| 60 | int sprite_shift; | |
| 60 | static int sprite_shift; | |
| 61 | 61 | |
| 62 | void x68k_render_video_word(int offset); | |
| 63 | void x68k_crtc_refresh_mode(void); | |
| 62 | static void x68k_render_video_word(int offset); | |
| 63 | static void x68k_crtc_refresh_mode(void); | |
| 64 | 64 | void x68k_scanline_check(int); |
| 65 | 65 | |
| 66 | 66 | INLINE void x68k_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color) |
| r1432 | r1433 | |
| 68 | 68 | *BITMAP_ADDR16(bitmap, y, x) = (UINT16)color; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | mame_bitmap* x68k_get_gfx_pri(int pri,int type) | |
| 71 | static mame_bitmap* x68k_get_gfx_pri(int pri,int type) | |
| 72 | 72 | { |
| 73 | 73 | if(type == GFX16) |
| 74 | 74 | { |
| r1432 | r1433 | |
| 106 | 106 | return NULL; // should never reach here either. |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | void x68k_crtc_text_copy(int src, int dest) | |
| 109 | static void x68k_crtc_text_copy(int src, int dest) | |
| 110 | 110 | { |
| 111 | 111 | // copys one raster in T-VRAM to another raster |
| 112 | 112 | int src_ram = src * 256; // 128 bytes per scanline |
| r1432 | r1433 | |
| 141 | 141 | sys.crtc.operation &= ~bit; |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | void x68k_crtc_refresh_mode() | |
| 144 | static void x68k_crtc_refresh_mode() | |
| 145 | 145 | { |
| 146 | 146 | // rectangle rect; |
| 147 | 147 | // double scantime; |
| r1432 | r1433 | |
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | TIMER_CALLBACK(x68k_crtc_raster_end) | |
| 263 | static TIMER_CALLBACK(x68k_crtc_raster_end) | |
| 264 | 264 | { |
| 265 | 265 | sys.mfp.gpio |= 0x40; |
| 266 | 266 | } |
| r1432 | r1433 | |
| 513 | 513 | return 0xffff; |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | int x68k_get_text_pixel(int offset, int bit) | |
| 516 | static int x68k_get_text_pixel(int offset, int bit) | |
| 517 | 517 | { |
| 518 | 518 | int ret = 0; |
| 519 | 519 | |
| r1432 | r1433 | |
| 532 | 532 | return ret; |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | void x68k_render_video_word(int offset) | |
| 535 | static void x68k_render_video_word(int offset) | |
| 536 | 536 | { |
| 537 | 537 | int x,y; |
| 538 | 538 | int l; |
| r1432 | r1433 | |
| 700 | 700 | { |
| 701 | 701 | return x68k_spriteram[offset]; |
| 702 | 702 | } |
| 703 | void x68k_draw_gfx(mame_bitmap* bitmap,rectangle cliprect) | |
| 703 | static void x68k_draw_gfx(mame_bitmap* bitmap,rectangle cliprect) | |
| 704 | 704 | { |
| 705 | 705 | int priority; |
| 706 | 706 | rectangle rect; |
| r1432 | r1433 | |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | // Sprite controller "Cynthia" at 0xeb0000 |
| 804 | void x68k_draw_sprites(mame_bitmap* bitmap, int priority, rectangle cliprect) | |
| 804 | static void x68k_draw_sprites(mame_bitmap* bitmap, int priority, rectangle cliprect) | |
| 805 | 805 | { |
| 806 | 806 | /* |
| 807 | 807 | 0xeb0000 - 0xeb07ff - Sprite registers (up to 128) |
| r1432 | r1433 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | unsigned char *spectrum_characterram; |
| 23 | 23 | unsigned char *spectrum_colorram; |
| 24 | unsigned char *charsdirty; | |
| 24 | static unsigned char *charsdirty; | |
| 25 | 25 | static int frame_number; /* Used for handling FLASH 1 */ |
| 26 | 26 | static int flash_invert; |
| 27 | 27 |
| r1432 | r1433 | |
|---|---|---|
| 18 | 18 | #include <math.h> /* for sin() and cos() */ |
| 19 | 19 | |
| 20 | 20 | unsigned char *astrocade_videoram; |
| 21 | int magic_expand_color, magic_control, magic_expand_flipflop, collision; | |
| 21 | static int magic_expand_color, magic_control, magic_expand_flipflop, collision; | |
| 22 | 22 | |
| 23 | 23 | static int ColourSplit=0; /* Colour System vars */ |
| 24 | 24 | static int Colour[8] = {0,0,0,0,0,0,0,0}; |
| r1432 | r1433 | |
|---|---|---|
| 25 | 25 | static UINT16 dmac_addr[3],dmac_size[3]; |
| 26 | 26 | static UINT8 dmac_flag,dmac_status; |
| 27 | 27 | |
| 28 | enum | |
| 28 | static enum | |
| 29 | 29 | { |
| 30 | 30 | noblink_underline, |
| 31 | 31 | blink_underline, |
| r1432 | r1433 | |
| 33 | 33 | blink_block |
| 34 | 34 | } cursor_mode; |
| 35 | 35 | |
| 36 | enum | |
| 36 | static enum | |
| 37 | 37 | { |
| 38 | 38 | parameter0, |
| 39 | 39 | parameter1, |
| r1432 | r1433 | |
|---|---|---|
| 39 | 39 | UINT8 reg[0x100]; |
| 40 | 40 | } pc1403_lcd; |
| 41 | 41 | |
| 42 | const struct { int x, y; } pos[]={ | |
| 42 | static const struct { int x, y; } pos[]={ | |
| 43 | 43 | { 152,67 }, // pc1403 |
| 44 | 44 | { 155,69 } // pc1403h |
| 45 | 45 | }; |
| r1432 | r1433 | |
|---|---|---|
| 56 | 56 | *BITMAP_ADDR16(bitmap, y, x) = (UINT16)color; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | void electron_drawline( void ) { | |
| 59 | static void electron_drawline( void ) { | |
| 60 | 60 | int i; |
| 61 | 61 | int x = 0; |
| 62 | 62 | int pal[16]; |
| r1432 | r1433 | |
|---|---|---|
| 39 | 39 | #define DPPL 0x30 |
| 40 | 40 | #define CTRL 0x3c |
| 41 | 41 | |
| 42 | int maria_palette[8][4]; | |
| 43 | int maria_write_mode; | |
| 44 | int maria_scanline; | |
| 45 | unsigned int maria_dll; | |
| 46 | unsigned int maria_dl; | |
| 47 | int maria_holey; | |
| 48 | int maria_offset; | |
| 49 | int maria_vblank; | |
| 50 | int maria_dli; | |
| 51 | int maria_dmaon; /* dma is enabled */ | |
| 52 | int maria_dodma; /* doing dma right now */ | |
| 53 | int maria_wsync; | |
| 54 | int maria_backcolor; | |
| 42 | static int maria_palette[8][4]; | |
| 43 | static int maria_write_mode; | |
| 44 | static int maria_scanline; | |
| 45 | static unsigned int maria_dll; | |
| 46 | static unsigned int maria_dl; | |
| 47 | static int maria_holey; | |
| 48 | static int maria_offset; | |
| 49 | static int maria_vblank; | |
| 50 | static int maria_dli; | |
| 51 | static int maria_dmaon; /* dma is enabled */ | |
| 52 | static int maria_dodma; /* doing dma right now */ | |
| 53 | static int maria_wsync; | |
| 54 | static int maria_backcolor; | |
| 55 | 55 | |
| 56 | int maria_color_kill; | |
| 57 | int maria_cwidth; | |
| 58 | int maria_bcntl; | |
| 59 | int maria_kangaroo; | |
| 60 | int maria_rm; | |
| 56 | static int maria_color_kill; | |
| 57 | static int maria_cwidth; | |
| 58 | static int maria_bcntl; | |
| 59 | static int maria_kangaroo; | |
| 60 | static int maria_rm; | |
| 61 | 61 | |
| 62 | unsigned int maria_charbase; | |
| 62 | static unsigned int maria_charbase; | |
| 63 | 63 | |
| 64 | 64 | // 20030621 ericball define using logical operations |
| 65 | 65 | #define inc_hpos() { hpos = (hpos + 1) & 0x1FF; } |
| r1432 | r1433 | |
|---|---|---|
| 44 | 44 | 8*16 |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | gfx_layout pc200_mda_charlayout = | |
| 47 | static gfx_layout pc200_mda_charlayout = | |
| 48 | 48 | { |
| 49 | 49 | 9,32, /* 9 x 32 characters (9 x 15 is the default, but..) */ |
| 50 | 50 | 256, /* 256 characters */ |
| r1432 | r1433 | |
| 60 | 60 | 8*16 /* every char takes 8 bytes (upper half) */ |
| 61 | 61 | }; |
| 62 | 62 | |
| 63 | gfx_layout pc200_cga_charlayout = | |
| 63 | static gfx_layout pc200_cga_charlayout = | |
| 64 | 64 | { |
| 65 | 65 | 8,16, /* 8 x 16 characters */ |
| 66 | 66 | 256, /* 256 characters */ |
| r1432 | r1433 | |
|---|---|---|
| 1373 | 1373 | } |
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | READ8_HANDLER ( pc1512_r ) | |
| 1376 | static READ8_HANDLER ( pc1512_r ) | |
| 1377 | 1377 | { |
| 1378 | 1378 | UINT8 data; |
| 1379 | 1379 |
| r1432 | r1433 | |
|---|---|---|
| 37 | 37 | Palette Initialisation |
| 38 | 38 | ******************************************************************************/ |
| 39 | 39 | |
| 40 | UINT32 vtech1_palette_mono[16]; | |
| 40 | static UINT32 vtech1_palette_mono[16]; | |
| 41 | 41 | |
| 42 | 42 | /* note - Juergen's colors do not match the colors in the m6847 code */ |
| 43 | 43 | static UINT8 vtech1_palette[] = |
| r1432 | r1433 | |
|---|---|---|
| 33 | 33 | extern int amstrad_plus_dma_2_addr; |
| 34 | 34 | extern int amstrad_plus_dma_prescaler[3]; // DMA channel prescaler |
| 35 | 35 | |
| 36 | int amstrad_plus_dma_repeat[3]; // marks the location of the channels' last repeat | |
| 37 | int amstrad_plus_dma_pause[3]; // pause count | |
| 38 | int amstrad_plus_dma_loopcount[3]; // counts loops taken on this channel | |
| 36 | static int amstrad_plus_dma_repeat[3]; // marks the location of the channels' last repeat | |
| 37 | static int amstrad_plus_dma_pause[3]; // pause count | |
| 38 | static int amstrad_plus_dma_loopcount[3]; // counts loops taken on this channel | |
| 39 | 39 | |
| 40 | 40 | extern unsigned char *amstrad_plus_asic_ram; |
| 41 | 41 | |
| 42 | int amstrad_plus_split_scanline; // ASIC split screen | |
| 43 | int amstrad_plus_split_address; | |
| 44 | int amstrad_screen_width; // width in bytes | |
| 42 | static int amstrad_plus_split_scanline; // ASIC split screen | |
| 43 | static int amstrad_plus_split_address; | |
| 44 | static int amstrad_screen_width; // width in bytes | |
| 45 | 45 | |
| 46 | void amstrad_plus_handle_dma(void); | |
| 46 | static void amstrad_plus_handle_dma(void); | |
| 47 | 47 | |
| 48 | 48 | #ifdef MAME_DEBUG |
| 49 | 49 | extern int amstrad_plus_lower_enabled; |
| r1432 | r1433 | |
| 72 | 72 | /* display origin - used to align hardware sprites */ |
| 73 | 73 | static int display_x; |
| 74 | 74 | static int display_y; |
| 75 | int display_update; // flag to get location at first DE | |
| 75 | static int display_update; // flag to get location at first DE | |
| 76 | 76 | |
| 77 | 77 | /* this contains the colours in Machine->pens form.*/ |
| 78 | 78 | /* this is updated from the eventlist and reflects the current state |
| r1432 | r1433 | |
| 761 | 761 | |
| 762 | 762 | &6422 - &643f Sprite palette, 12-bit, xxxxGGGGRRRRBBBB, sprite pens 1-15 (0 is always transparent) |
| 763 | 763 | */ |
| 764 | void amstrad_plus_sprite_draw(mame_bitmap* scr_bitmap) | |
| 764 | static void amstrad_plus_sprite_draw(mame_bitmap* scr_bitmap) | |
| 765 | 765 | { |
| 766 | 766 | int spr; // sprite number |
| 767 | 767 | int xloc,yloc; |
| r1432 | r1433 | |
| 817 | 817 | 4020h STOP Stop processing the sound list. |
| 818 | 818 | */ |
| 819 | 819 | |
| 820 | void amstrad_plus_dma_parse(int channel, int *addr) | |
| 820 | static void amstrad_plus_dma_parse(int channel, int *addr) | |
| 821 | 821 | { |
| 822 | 822 | unsigned short command; |
| 823 | 823 | |
| r1432 | r1433 | |
| 884 | 884 | (*addr)+=2; // point to next DMA instruction |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | void amstrad_plus_handle_dma() | |
| 887 | static void amstrad_plus_handle_dma() | |
| 888 | 888 | { |
| 889 | 889 | if(amstrad_plus_dma_status & 0x01) // DMA channel 0 |
| 890 | 890 | amstrad_plus_dma_parse(0,&amstrad_plus_dma_0_addr); |
| r1432 | r1433 | |
|---|---|---|
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | 18 | /* backdrop */ |
| 19 | struct artwork_info *avigo_backdrop; | |
| 19 | //struct artwork_info *avigo_backdrop; | |
| 20 | 20 | |
| 21 | 21 | /* mem size = 0x017c0 */ |
| 22 | 22 | |
| r1432 | r1433 | |
| 191 | 191 | } |
| 192 | 192 | #endif |
| 193 | 193 | } |
| 194 | unsigned int avigo_ad_x; | |
| 195 | unsigned int avigo_ad_y; | |
| 194 | static unsigned int avigo_ad_x; | |
| 195 | static unsigned int avigo_ad_y; | |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 |
| r1432 | r1433 | |
|---|---|---|
| 51 | 51 | 0xff,0xff,0xff /* White */ |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | UINT8 o2_shape[0x40][8]={ | |
| 54 | static UINT8 o2_shape[0x40][8]={ | |
| 55 | 55 | { 0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00 }, // 0 |
| 56 | 56 | { 0x18,0x38,0x18,0x18,0x18,0x18,0x3C,0x00 }, |
| 57 | 57 | { 0x3C,0x66,0x0C,0x18,0x30,0x60,0x7E,0x00 }, |
| r1432 | r1433 | |
| 120 | 120 | static UINT8 *odyssey2_display; |
| 121 | 121 | int odyssey2_vh_hpos; |
| 122 | 122 | |
| 123 | union { | |
| 123 | static union { | |
| 124 | 124 | UINT8 reg[0x100]; |
| 125 | 125 | struct { |
| 126 | 126 | struct { |
| r1432 | r1433 | |
|---|---|---|
| 24 | 24 | #define SAA5050_BLACK 0 |
| 25 | 25 | #define SAA5050_WHITE 7 |
| 26 | 26 | |
| 27 | struct | |
| 27 | static struct { | |
| 28 | 28 | UINT16 saa5050_flags; |
| 29 | 29 | UINT8 saa5050_forecol; |
| 30 | 30 | UINT8 saa5050_backcol; |
| r1432 | r1433 | |
|---|---|---|
| 46 | 46 | asr_window_offset_y+asr_window_height-1 /* max_y */ |
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | struct | |
| 49 | static struct | |
| 50 | 50 | { |
| 51 | 51 | /*UINT8 OutQueue[ASROutQueueSize]; |
| 52 | 52 | int OutQueueHead; |
| r1432 | r1433 | |
|---|---|---|
| 15 | 15 | //#include "video/bbctext.h" |
| 16 | 16 | |
| 17 | 17 | |
| 18 | void BBC_draw_hi_res(void); | |
| 19 | void BBC_draw_teletext(void); | |
| 18 | static void BBC_draw_hi_res(void); | |
| 19 | static void BBC_draw_teletext(void); | |
| 20 | 20 | |
| 21 | 21 | static void (*draw_function)(void); |
| 22 | 22 | |
| 23 | void BBC_draw_RGB_in(int offset,int data); | |
| 23 | static void BBC_draw_RGB_in(int offset,int data); | |
| 24 | 24 | |
| 25 | 25 | /************************************************************************ |
| 26 | 26 | * video_refresh flag is used in optimising the screen redrawing |
| r1432 | r1433 | |
| 205 | 205 | BBC_draw_RGB_in, |
| 206 | 206 | }; |
| 207 | 207 | |
| 208 | void BBC_draw_teletext(void) | |
| 208 | static void BBC_draw_teletext(void) | |
| 209 | 209 | { |
| 210 | 210 | |
| 211 | 211 | //Teletext Latch bits 0 to 5 go to bits 0 to 5 on the Teletext chip |
| r1432 | r1433 | |
| 380 | 380 | |
| 381 | 381 | // the Video ULA hi-res shift registers, pallette lookup and display enabled circuits |
| 382 | 382 | |
| 383 | void BBC_draw_hi_res(void) | |
| 383 | static void BBC_draw_hi_res(void) | |
| 384 | 384 | { |
| 385 | 385 | int meml; |
| 386 | 386 | unsigned char i=0; |
| r1432 | r1433 | |
| 422 | 422 | |
| 423 | 423 | // RGB input to the Video ULA from the Teletext IC |
| 424 | 424 | // Just pass on the output at the correct pixel size. |
| 425 | void BBC_draw_RGB_in(int offset,int data) | |
| 425 | static void BBC_draw_RGB_in(int offset,int data) | |
| 426 | 426 | { |
| 427 | 427 | BBC_ula_drawpixel(data,emulation_pixels_per_real_pixel); |
| 428 | 428 | } |
| r1432 | r1433 | |
|---|---|---|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
| 196 | char current_filespecification[32] = "*.*"; | |
| 197 | const char fs_directory[] = "[DIR]"; | |
| 198 | const char fs_device[] = "[DRIVE]"; | |
| 199 | const char fs_file[] = "[FILE]"; | |
| 196 | static char current_filespecification[32] = "*.*"; | |
| 197 | static const char fs_directory[] = "[DIR]"; | |
| 198 | static const char fs_device[] = "[DRIVE]"; | |
| 199 | static const char fs_file[] = "[FILE]"; | |
| 200 | 200 | /*const char fs_archive[] = "[ARCHIVE]"; */ |
| 201 | 201 | |
| 202 | 202 | static ui_menu_item *fs_item; |
| r1432 | r1433 | |
| 213 | 213 | FILESELECT_DEVICE, |
| 214 | 214 | FILESELECT_DIRECTORY, |
| 215 | 215 | FILESELECT_FILE |
| 216 | } | |
| 216 | } | |
| 217 | 217 | |
| 218 | 218 | |
| 219 | 219 | static void fs_free(void) |
| r1432 | r1433 | |
|---|---|---|
| 505 | 505 | |
| 506 | 506 | |
| 507 | 507 | |
| 508 | void state_load(HWND wnd, running_machine *machine) | |
| 508 | static void state_load(HWND wnd, running_machine *machine) | |
| 509 | 509 | { |
| 510 | 510 | state_dialog(wnd, WIN_FILE_DIALOG_OPEN, OFN_FILEMUSTEXIST, mame_schedule_load, machine); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | void state_save_as(HWND wnd, running_machine *machine) | |
| 513 | static void state_save_as(HWND wnd, running_machine *machine) | |
| 514 | 514 | { |
| 515 | 515 | state_dialog(wnd, WIN_FILE_DIALOG_SAVE, OFN_OVERWRITEPROMPT, mame_schedule_save, machine); |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | void state_save(running_machine *machine) | |
| 518 | static void state_save(running_machine *machine) | |
| 519 | 519 | { |
| 520 | 520 | mame_schedule_save(machine, state_filename); |
| 521 | 521 | } |
| r1432 | r1433 | |
| 1887 | 1887 | // set_menu_text |
| 1888 | 1888 | //============================================================ |
| 1889 | 1889 | |
| 1890 | void set_menu_text(HMENU menu_bar, int command, const char *text) | |
| 1890 | static void set_menu_text(HMENU menu_bar, int command, const char *text) | |
| 1891 | 1891 | { |
| 1892 | 1892 | TCHAR *t_text; |
| 1893 | 1893 | MENUITEMINFO mii; |
| r1432 | r1433 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | const TCHAR g_szPlayGameString[] = TEXT("&Run %s"); |
| 162 | 162 | const char g_szGameCountString[] = "%d systems"; |
| 163 | const char g_szHistoryFileName[] = "sysinfo.dat"; | |
| 164 | const char g_szMameInfoFileName[] = "messinfo.dat"; | |
| 163 | static const char g_szHistoryFileName[] = "sysinfo.dat"; | |
| 164 | static const char g_szMameInfoFileName[] = "messinfo.dat"; | |
| 165 | 165 | |
| 166 | 166 | static BOOL FilterAvailable(int driver_index) |
| 167 | 167 | { |
| r1432 | r1433 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | enum enum_system { WSWAN=0, WSC }; |
| 25 | 25 | enum enum_sram { SRAM_NONE=0, SRAM_64K, SRAM_256K, SRAM_512K, SRAM_1M, SRAM_2M, EEPROM_1K, EEPROM_16K, EEPROM_8K, SRAM_UNKNOWN }; |
| 26 | const char* wswan_sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", "512Kbit SRAM", "1Mbit SRAM", "2Mbit SRAM", "1Kbit EEPROM", "16Kbit EEPROM", "8Kbit EEPROM", "Unknown" }; | |
| 27 | const int wswan_sram_size[] = { 0, 64*1024/8, 256*1024/8, 512*1024/8, 1024*1024/8, 2*1024*1024/8, 1024/8, 16*1024/8, 8*1024/8, 0 }; | |
| 26 | static const char* wswan_sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", "512Kbit SRAM", "1Mbit SRAM", "2Mbit SRAM", "1Kbit EEPROM", "16Kbit EEPROM", "8Kbit EEPROM", "Unknown" }; | |
| 27 | static const int wswan_sram_size[] = { 0, 64*1024/8, 256*1024/8, 512*1024/8, 1024*1024/8, 2*1024*1024/8, 1024/8, 16*1024/8, 8*1024/8, 0 }; | |
| 28 | 28 | |
| 29 | 29 | struct EEPROM { |
| 30 | 30 | UINT8 mode; /* eeprom mode */ |
| r1432 | r1433 | |
| 64 | 64 | static struct EEPROM eeprom; |
| 65 | 65 | static struct RTC rtc; |
| 66 | 66 | static struct SoundDMA sound_dma; |
| 67 | UINT8 *ws_ram; | |
| 68 | UINT8 *ws_bios_bank = NULL; | |
| 67 | static UINT8 *ws_ram; | |
| 68 | static UINT8 *ws_bios_bank = NULL; | |
| 69 | 69 | static UINT8 wswan_bios_disabled; |
| 70 | 70 | UINT8 ws_portram[256]; |
| 71 | 71 | static UINT8 ws_portram_init[256] = |
| r1432 | r1433 | |
| 124 | 124 | 0xea, 0xc0, 0xff, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
| 125 | 125 | }; |
| 126 | 126 | |
| 127 | void wswan_handle_irqs( void ) { | |
| 127 | static void wswan_handle_irqs( void ) { | |
| 128 | 128 | if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_HBLTMR ) { |
| 129 | 129 | cpunum_set_input_line_and_vector( 0, 0, HOLD_LINE, ws_portram[0xb0] + WSWAN_INT_HBLTMR ); |
| 130 | 130 | } else if ( ws_portram[0xb2] & ws_portram[0xb6] & WSWAN_IFLAG_VBL ) { |
| r1432 | r1433 | |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | void wswan_set_irq_line(int irq) { | |
| 149 | static void wswan_set_irq_line(int irq) { | |
| 150 | 150 | if ( ws_portram[0xb2] & irq ) { |
| 151 | 151 | ws_portram[0xb6] |= irq; |
| 152 | 152 | wswan_handle_irqs(); |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | void wswan_clear_irq_line(int irq) { | |
| 156 | static void wswan_clear_irq_line(int irq) { | |
| 157 | 157 | ws_portram[0xb6] &= ~irq; |
| 158 | 158 | wswan_handle_irqs(); |
| 159 | 159 | } |
| r1432 | r1433 | |
| 1245 | 1245 | |
| 1246 | 1246 | #ifdef MAME_DEBUG |
| 1247 | 1247 | enum enum_romsize { ROM_4M=0, ROM_8M, ROM_16M, ROM_32M, ROM_64M, ROM_128M, ROM_UNKNOWN }; |
| 1248 | const char* wswan_romsize_str[] = { | |
| 1248 | static const char* wswan_romsize_str[] = { | |
| 1249 | 1249 | "4Mbit", "8Mbit", "16Mbit", "32Mbit", "64Mbit", "128Mbit", "Unknown" |
| 1250 | 1250 | }; |
| 1251 | 1251 |
| r1432 | r1433 | |
|---|---|---|
| 138 | 138 | #define INVALID_KEYROW -1 /* no ketrow selected */ |
| 139 | 139 | #define NO_KEY_PRESSED 0x7F /* retrurned by hardware if no key pressed */ |
| 140 | 140 | |
| 141 | int SelectedKeyrow(int Rows); | |
| 141 | static int SelectedKeyrow(int Rows); | |
| 142 | 142 | |
| 143 | 143 | int dgnbeta_font=0; |
| 144 | 144 | |
| r1432 | r1433 | |
| 209 | 209 | static struct PageReg PageRegs[MaxTasks+1][MaxPage+1]; /* 16 sets of 16 page regs, allowing for 16 seperate contexts */ |
| 210 | 210 | /* Task 17 is power on default, when banking not enabled */ |
| 211 | 211 | |
| 212 | int IsIOPage(int Page) | |
| 212 | static int IsIOPage(int Page) | |
| 213 | 213 | { |
| 214 | 214 | if ((Page==IOPage) || (Page==IOPage+1)) |
| 215 | 215 | return 1; |
| r1432 | r1433 | |
| 479 | 479 | never moved past the first row, by scanning for the last active row |
| 480 | 480 | the beta_test rom works, and it does not break the OS-9 driver :) |
| 481 | 481 | */ |
| 482 | int SelectedKeyrow(int Rows) | |
| 482 | static int SelectedKeyrow(int Rows) | |
| 483 | 483 | { |
| 484 | 484 | int Idx; |
| 485 | 485 | int Row; /* Row selected */ |
| r1432 | r1433 | |
| 507 | 507 | |
| 508 | 508 | /* GetKeyRow, returns the value of a keyrow, checking for invalid rows */ |
| 509 | 509 | /* and returning no key pressed if row is invalid */ |
| 510 | int GetKeyRow(int RowNo) | |
| 510 | static int GetKeyRow(int RowNo) | |
| 511 | 511 | { |
| 512 | 512 | if(RowNo==INVALID_KEYROW) |
| 513 | 513 | { |
| r1432 | r1433 | |
| 1023 | 1023 | /* Scan physical keyboard into Keyboard array */ |
| 1024 | 1024 | /* gonna try and sync this more closely with hardware as keyboard being scanned */ |
| 1025 | 1025 | /* on *EVERY* vblank ! */ |
| 1026 | void ScanInKeyboard(void) | |
| 1026 | static void ScanInKeyboard(void) | |
| 1027 | 1027 | { |
| 1028 | 1028 | #if 0 |
| 1029 | 1029 | int Idx; |
| r1432 | r1433 | |
|---|---|---|
| 54 | 54 | } send; |
| 55 | 55 | } UART8250; |
| 56 | 56 | |
| 57 | UART8250 uart[4]={ { { TYPE8250 } } }; | |
| 57 | static UART8250 uart[4]={ { { TYPE8250 } } }; | |
| 58 | 58 | |
| 59 | 59 | /* int's pending */ |
| 60 | 60 | #define COM_INT_PENDING_RECEIVED_DATA_AVAILABLE 0x0001 |
| r1432 | r1433 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | unsigned char getKeyFromBuffer(void) | |
| 83 | static unsigned char getKeyFromBuffer(void) | |
| 84 | 84 | { |
| 85 | 85 | int i; |
| 86 | 86 | UINT8 kbcode; |
| r1432 | r1433 | |
| 95 | 95 | return kbcode; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | void addToKeyboardBuffer(unsigned char kbcode) | |
| 98 | static void addToKeyboardBuffer(unsigned char kbcode) | |
| 99 | 99 | { |
| 100 | 100 | if (KbRepeatTable[kbcode]==0) |
| 101 | 101 | { |
| r1432 | r1433 | |
| 514 | 514 | /* 0xF0-0xFF - Reserved for internal use by keyboard software */ |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | void master6801_behaviour(int offset, int data) | |
| 517 | static void master6801_behaviour(int offset, int data) | |
| 518 | 518 | { |
| 519 | 519 | /* |
| 520 | 520 | The Master MC6801 controls all AdamNet operations, keyboard, tapes, disks... |
| r1432 | r1433 | |
|---|---|---|
| 188 | 188 | cbm_ieee_data_w(0, data); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | const cia6526_interface cbmb_cia = | |
| 191 | static const cia6526_interface cbmb_cia = | |
| 192 | 192 | { |
| 193 | 193 | CIA6526, |
| 194 | 194 | tpi6525_0_irq2_level, |
| r1432 | r1433 | |
|---|---|---|
| 64 | 64 | return mbee_workram[offset]; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | offs_t mbee_opbase_handler(offs_t address) | |
| 67 | static offs_t mbee_opbase_handler(offs_t address) | |
| 68 | 68 | { |
| 69 | 69 | if (address > 0x7fff) |
| 70 | 70 | { |
| r1432 | r1433 | |
| 74 | 74 | return address; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | offs_t mbee56_opbase_handler(offs_t address) | |
| 77 | static offs_t mbee56_opbase_handler(offs_t address) | |
| 78 | 78 | { |
| 79 | 79 | if (address > 0xdfff) |
| 80 | 80 | { |
| r1432 | r1433 | |
|---|---|---|
| 329 | 329 | state->cart.scc.active = 0; |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | READ8_HANDLER (konami_scc_bank5) | |
| 332 | static READ8_HANDLER (konami_scc_bank5) | |
| 333 | 333 | { |
| 334 | 334 | if (offset & 0x80) { |
| 335 | 335 | #if 0 |
| r1432 | r1433 | |
| 1971 | 1971 | state->cart.sccp.sccp_active = 0; |
| 1972 | 1972 | } |
| 1973 | 1973 | |
| 1974 | READ8_HANDLER (soundcartridge_scc) | |
| 1974 | static READ8_HANDLER (soundcartridge_scc) | |
| 1975 | 1975 | { |
| 1976 | 1976 | int reg; |
| 1977 | 1977 | |
| r1432 | r1433 | |
| 2002 | 2002 | return 0xff; |
| 2003 | 2003 | } |
| 2004 | 2004 | |
| 2005 | READ8_HANDLER (soundcartridge_sccp) | |
| 2005 | static READ8_HANDLER (soundcartridge_sccp) | |
| 2006 | 2006 | { |
| 2007 | 2007 | int reg; |
| 2008 | 2008 |
| r1432 | r1433 | |
|---|---|---|
| 29 | 29 | emu_timer *timer3_timer; /* Timer 3 */ |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | UINT8 pokemini_hwreg[0x100]; | |
| 32 | static UINT8 pokemini_hwreg[0x100]; | |
| 33 | 33 | static struct VDP vdp; |
| 34 | 34 | static struct TIMERS timers; |
| 35 | 35 | |
| r1432 | r1433 | |
| 677 | 677 | return INIT_PASS; |
| 678 | 678 | } |
| 679 | 679 | |
| 680 | void pokemini_render( void ) { | |
| 680 | static void pokemini_render( void ) { | |
| 681 | 681 | if ( vdp.background_enabled ) { |
| 682 | 682 | int x, y; |
| 683 | 683 | for ( y = 0; y < 8; y++ ) { |
| r1432 | r1433 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | #include "rp5c15.h" |
| 71 | 71 | |
| 72 | struct rp5c15 rtc; | |
| 72 | static struct rp5c15 rtc; | |
| 73 | 73 | |
| 74 | emu_timer* rtc_timer; | |
| 74 | static emu_timer* rtc_timer; | |
| 75 | 75 | |
| 76 | 76 | TIMER_CALLBACK(rtc_alarm_pulse) |
| 77 | 77 | { |
| r1432 | r1433 | |
| 139 | 139 | timer_adjust(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32)); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | int rp5c15_read(int offset, UINT16 mem_mask) | |
| 142 | static int rp5c15_read(int offset, UINT16 mem_mask) | |
| 143 | 143 | { |
| 144 | 144 | if((rtc.mode & 0x01) == 0x00) // BANK 0 selected |
| 145 | 145 | { |
| r1432 | r1433 | |
| 210 | 210 | return 0; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | void rp5c15_write(int offset, int data, UINT16 mem_mask) | |
| 213 | static void rp5c15_write(int offset, int data, UINT16 mem_mask) | |
| 214 | 214 | { |
| 215 | 215 | if(offset == 13) |
| 216 | 216 | { |
| r1432 | r1433 | |
|---|---|---|
| 242 | 242 | |
| 243 | 243 | /* ******* other input lines ******* */ |
| 244 | 244 | |
| 245 | #ifdef UNUSED_FUNCTION | |
| 245 | 246 | void MC6850_DCD(int offset, int data) |
| 246 | 247 | { |
| 247 | 248 | STR=(STR&0xfb)|((data&1)<<2); |
| r1432 | r1433 | |
| 253 | 254 | STR=(STR&0xf7)|((data&1)<<3); |
| 254 | 255 | // this also sets the Transmit Controller |
| 255 | 256 | } |
| 257 | #endif | |
| 256 | 258 | |
| 257 | 259 | void MC6850_Receive_Clock(int Receive_Data) |
| 258 | 260 | { |
| r1432 | r1433 | |
| 317 | 319 | dcd_count=0; |
| 318 | 320 | } |
| 319 | 321 | |
| 322 | #ifdef UNUSED_FUNCTION | |
| 320 | 323 | int MC6850_Transmit_Clock(void) |
| 321 | 324 | { |
| 322 | 325 | // clock out the data and return a Trasmit Data bit |
| r1432 | r1433 | |
| 325 | 328 | if we get to outputing data too */ |
| 326 | 329 | return 0; |
| 327 | 330 | } |
| 331 | #endif | |
| 328 | 332 | |
| 329 | 333 | |
| 330 | 334 | /* ******* other output lines ******* */ |
| 331 | 335 | |
| 336 | #ifdef UNUSED_FUNCTION | |
| 332 | 337 | int MC6850_transmit_data(int offset) |
| 333 | 338 | { |
| 334 | 339 | // return the last transmitted bit |
| 335 | 340 | return 0; |
| 336 | 341 | } |
| 337 | 342 | |
| 338 | int MC6850_RTS(int offset) | |
| 343 | static int MC6850_RTS(int offset) | |
| 339 | 344 | { |
| 340 | 345 | // is this correct ???? |
| 341 | 346 | return RTS; |
| 342 | 347 | } |
| 348 | #endif | |
| 343 | 349 | |
| 344 | 350 | /* |
| 345 | 351 | interrupt Request is the only other output |
| r1432 | r1433 | |
|---|---|---|
| 1384 | 1384 | static void (*printer_out)(int data); |
| 1385 | 1385 | |
| 1386 | 1386 | /* Printer output for the CoCo, output to bitbanger port */ |
| 1387 | void printer_out_coco(int data) | |
| 1387 | static void printer_out_coco(int data) | |
| 1388 | 1388 | { |
| 1389 | 1389 | bitbanger_output(bitbanger_image(), (data & 2) >> 1); |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | /* Printer output for the Dragon, output to Paralel port */ |
| 1393 | void printer_out_dragon(int data) | |
| 1393 | static void printer_out_dragon(int data) | |
| 1394 | 1394 | { |
| 1395 | 1395 | /* If strobe bit is high send data from pia0 port b to dragon parallel printer */ |
| 1396 | 1396 | if (data & 0x02) |
| r1432 | r1433 | |
| 2877 | 2877 | acia_6551_init(); |
| 2878 | 2878 | } |
| 2879 | 2879 | |
| 2880 | #ifdef UNUSED_FUNCTION | |
| 2880 | 2881 | MACHINE_START( d64plus ) |
| 2881 | 2882 | { |
| 2882 | 2883 | machine_init_interface init; |
| r1432 | r1433 | |
| 2899 | 2900 | dragon_plus_reg = 0; |
| 2900 | 2901 | plus_reg_w(0,0); |
| 2901 | 2902 | } |
| 2903 | #endif | |
| 2902 | 2904 | |
| 2903 | 2905 | MACHINE_START( tanodr64 ) |
| 2904 | 2906 | { |
| r1432 | r1433 | |
|---|---|---|
| 42 | 42 | GLOBAL VARIABLES |
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | UINT8 battery_data[BATTERY_SIZE]; | |
| 45 | static UINT8 battery_data[BATTERY_SIZE]; | |
| 46 | 46 | |
| 47 | 47 | struct nes_struct nes; |
| 48 | 48 | struct fds_struct nes_fds; |
| r1432 | r1433 | |
|---|---|---|
| 92 | 92 | static UINT8 GBC_RAMBank; /* (GBC) Number of RAM bank currently used */ |
| 93 | 93 | static UINT8 sgb_atf_data[4050]; /* (SGB) Attribute files */ |
| 94 | 94 | UINT8 *sgb_tile_data; |
| 95 | UINT8 *gb_cart = NULL; | |
| 96 | UINT8 *gb_cart_ram = NULL; | |
| 97 | UINT8 gb_io[0x10]; | |
| 98 | UINT8 gb_ie; | |
| 99 | UINT8 *gb_dummy_rom_bank = NULL; | |
| 100 | UINT8 *gb_dummy_ram_bank = NULL; | |
| 95 | static UINT8 *gb_cart = NULL; | |
| 96 | static UINT8 *gb_cart_ram = NULL; | |
| 97 | static UINT8 gb_io[0x10]; | |
| 98 | //UINT8 gb_ie; | |
| 99 | static UINT8 *gb_dummy_rom_bank = NULL; | |
| 100 | static UINT8 *gb_dummy_ram_bank = NULL; | |
| 101 | 101 | /* TAMA5 related global variables */ |
| 102 | UINT8 gbTama5Memory[32]; | |
| 103 | UINT8 gbTama5Byte; | |
| 104 | UINT8 gbTama5Address; | |
| 105 | UINT8 gbLastTama5Command; | |
| 102 | static UINT8 gbTama5Memory[32]; | |
| 103 | static UINT8 gbTama5Byte; | |
| 104 | static UINT8 gbTama5Address; | |
| 105 | static UINT8 gbLastTama5Command; | |
| 106 | 106 | /* Timer related globals */ |
| 107 | 107 | static struct gb_timer_struct { |
| 108 | 108 | UINT16 divcount; |
| r1432 | r1433 | |
| 113 | 113 | } gb_timer; |
| 114 | 114 | /* Serial I/O related */ |
| 115 | 115 | static UINT32 SIOCount; /* Serial I/O counter */ |
| 116 | emu_timer *gb_serial_timer = NULL; | |
| 116 | static emu_timer *gb_serial_timer = NULL; | |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | 119 | Prototypes |
| r1432 | r1433 | |
| 121 | 121 | |
| 122 | 122 | static TIMER_CALLBACK(gb_serial_timer_proc); |
| 123 | 123 | static void gb_machine_stop(running_machine *machine); |
| 124 | WRITE8_HANDLER( gb_rom_bank_select_mbc1 ); | |
| 125 | WRITE8_HANDLER( gb_ram_bank_select_mbc1 ); | |
| 126 | WRITE8_HANDLER( gb_mem_mode_select_mbc1 ); | |
| 127 | WRITE8_HANDLER( gb_rom_bank_select_mbc2 ); | |
| 128 | WRITE8_HANDLER( gb_rom_bank_select_mbc3 ); | |
| 129 | WRITE8_HANDLER( gb_ram_bank_select_mbc3 ); | |
| 130 | WRITE8_HANDLER( gb_mem_mode_select_mbc3 ); | |
| 131 | WRITE8_HANDLER( gb_rom_bank_select_mbc5 ); | |
| 132 | WRITE8_HANDLER( gb_ram_bank_select_mbc5 ); | |
| 133 | WRITE8_HANDLER( gb_rom_bank_select_mbc7 ); | |
| 134 | WRITE8_HANDLER( gb_rom_bank_unknown_mbc7 ); | |
| 135 | WRITE8_HANDLER( gb_ram_tama5 ); | |
| 136 | WRITE8_HANDLER( gb_rom_bank_select_wisdom ); | |
| 137 | WRITE8_HANDLER( gb_rom_bank_mmm01_0000_w ); | |
| 138 | WRITE8_HANDLER( gb_rom_bank_mmm01_2000_w ); | |
| 139 | WRITE8_HANDLER( gb_rom_bank_mmm01_4000_w ); | |
| 140 | WRITE8_HANDLER( gb_rom_bank_mmm01_6000_w ); | |
| 124 | static WRITE8_HANDLER( gb_rom_bank_select_mbc1 ); | |
| 125 | static WRITE8_HANDLER( gb_ram_bank_select_mbc1 ); | |
| 126 | static WRITE8_HANDLER( gb_mem_mode_select_mbc1 ); | |
| 127 | static WRITE8_HANDLER( gb_rom_bank_select_mbc2 ); | |
| 128 | static WRITE8_HANDLER( gb_rom_bank_select_mbc3 ); | |
| 129 | static WRITE8_HANDLER( gb_ram_bank_select_mbc3 ); | |
| 130 | static WRITE8_HANDLER( gb_mem_mode_select_mbc3 ); | |
| 131 | static WRITE8_HANDLER( gb_rom_bank_select_mbc5 ); | |
| 132 | static WRITE8_HANDLER( gb_ram_bank_select_mbc5 ); | |
| 133 | static WRITE8_HANDLER( gb_rom_bank_select_mbc7 ); | |
| 134 | static WRITE8_HANDLER( gb_rom_bank_unknown_mbc7 ); | |
| 135 | static WRITE8_HANDLER( gb_ram_tama5 ); | |
| 136 | static WRITE8_HANDLER( gb_rom_bank_select_wisdom ); | |
| 137 | static WRITE8_HANDLER( gb_rom_bank_mmm01_0000_w ); | |
| 138 | static WRITE8_HANDLER( gb_rom_bank_mmm01_2000_w ); | |
| 139 | static WRITE8_HANDLER( gb_rom_bank_mmm01_4000_w ); | |
| 140 | static WRITE8_HANDLER( gb_rom_bank_mmm01_6000_w ); | |
| 141 | 141 | static void gb_timer_increment( void ); |
| 142 | 142 | |
| 143 | 143 | #ifdef MAME_DEBUG |
| r1432 | r1433 | |
| 362 | 362 | image_battery_save(image_from_devtype_and_index(IO_CARTSLOT, 0), gb_cart_ram, RAMBanks * 0x2000 ); |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | void gb_set_mbc1_banks( void ) { | |
| 365 | static void gb_set_mbc1_banks( void ) { | |
| 366 | 366 | memory_set_bankptr( 1, ROMMap[ ROMBank ] ); |
| 367 | 367 | memory_set_bankptr( 2, RAMMap[ MBC1Mode ? ( ROMBank >> 5 ) : 0 ] ); |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | WRITE8_HANDLER( gb_rom_bank_select_mbc1 ) | |
| 370 | static WRITE8_HANDLER( gb_rom_bank_select_mbc1 ) | |
| 371 | 371 | { |
| 372 | 372 | data &= 0x1F; /* Only uses lower 5 bits */ |
| 373 | 373 | /* Selecting bank 0 == selecting bank 1 */ |
| r1432 | r1433 | |
| 379 | 379 | gb_set_mbc1_banks(); |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | WRITE8_HANDLER( gb_rom_bank_select_mbc2 ) | |
| 382 | static WRITE8_HANDLER( gb_rom_bank_select_mbc2 ) | |
| 383 | 383 | { |
| 384 | 384 | data &= 0x0F; /* Only uses lower 4 bits */ |
| 385 | 385 | /* Selecting bank 0 == selecting bank 1 */ |
| r1432 | r1433 | |
| 393 | 393 | memory_set_bankptr (1, ROMMap[ROMBank] ); |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | WRITE8_HANDLER( gb_rom_bank_select_mbc3 ) | |
| 396 | static WRITE8_HANDLER( gb_rom_bank_select_mbc3 ) | |
| 397 | 397 | { |
| 398 | 398 | logerror( "0x%04X: write to mbc3 rom bank select register 0x%04X <- 0x%02X\n", activecpu_get_pc(), offset, data ); |
| 399 | 399 | data &= 0x7F; /* Only uses lower 7 bits */ |
| r1432 | r1433 | |
| 406 | 406 | memory_set_bankptr (1, ROMMap[ROMBank] ); |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | WRITE8_HANDLER( gb_rom_bank_select_mbc5 ) | |
| 409 | static WRITE8_HANDLER( gb_rom_bank_select_mbc5 ) | |
| 410 | 410 | { |
| 411 | 411 | /* MBC5 has a 9 bit bank select |
| 412 | 412 | Writing into 2000-2FFF sets the lower 8 bits |
| r1432 | r1433 | |
| 422 | 422 | memory_set_bankptr (1, ROMMap[ROMBank] ); |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | WRITE8_HANDLER( gb_rom_bank_select_mbc7 ) { | |
| 425 | static WRITE8_HANDLER( gb_rom_bank_select_mbc7 ) { | |
| 426 | 426 | logerror( "0x%04X: write to mbc7 rom select register: 0x%04X <- 0x%02X\n", activecpu_get_pc(), 0x2000 + offset, data ); |
| 427 | 427 | /* Bit 12 must be set for writing to the mbc register */ |
| 428 | 428 | if ( offset & 0x0100 ) { |
| r1432 | r1433 | |
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | WRITE8_HANDLER( gb_rom_bank_unknown_mbc7 ) { | |
| 434 | static WRITE8_HANDLER( gb_rom_bank_unknown_mbc7 ) { | |
| 435 | 435 | logerror( "0x%04X: write to mbc7 rom area: 0x%04X <- 0x%02X\n", activecpu_get_pc(), 0x3000 + offset, data ); |
| 436 | 436 | /* Bit 12 must be set for writing to the mbc register */ |
| 437 | 437 | if ( offset & 0x0100 ) { |
| r1432 | r1433 | |
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | WRITE8_HANDLER( gb_rom_bank_select_wisdom ) { | |
| 449 | static WRITE8_HANDLER( gb_rom_bank_select_wisdom ) { | |
| 450 | 450 | logerror( "0x%04X: wisdom tree mapper write to address 0x%04X\n", activecpu_get_pc(), offset ); |
| 451 | 451 | /* The address determines the bank to select */ |
| 452 | 452 | ROMBank = ( offset << 1 ) & 0x1FF; |
| r1432 | r1433 | |
| 455 | 455 | memory_set_bankptr( 1, ROMMap[ ROMBank + 1 ] ); |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | WRITE8_HANDLER( gb_ram_bank_select_mbc1 ) | |
| 458 | static WRITE8_HANDLER( gb_ram_bank_select_mbc1 ) | |
| 459 | 459 | { |
| 460 | 460 | data &= 0x3; /* Only uses the lower 2 bits */ |
| 461 | 461 | |
| r1432 | r1433 | |
| 466 | 466 | gb_set_mbc1_banks(); |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | WRITE8_HANDLER( gb_ram_bank_select_mbc3 ) | |
| 469 | static WRITE8_HANDLER( gb_ram_bank_select_mbc3 ) | |
| 470 | 470 | { |
| 471 | 471 | logerror( "0x%04X: write mbc3 ram bank select register 0x%04X <- 0x%02X\n", activecpu_get_pc(), offset, data ); |
| 472 | 472 | if( data & 0x8 ) { /* RTC banks */ |
| r1432 | r1433 | |
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | WRITE8_HANDLER( gb_ram_bank_select_mbc5 ) | |
| 488 | static WRITE8_HANDLER( gb_ram_bank_select_mbc5 ) | |
| 489 | 489 | { |
| 490 | 490 | logerror( "0x%04X: MBC5 RAM Bank select write 0x%04X <- 0x%02X\n", activecpu_get_pc(), offset, data ); |
| 491 | 491 | data &= 0x0F; |
| r1432 | r1433 | |
| 504 | 504 | logerror( "0x%04X: Write to ram enable register 0x%04X <- 0x%02X\n", activecpu_get_pc(), offset, data ); |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | WRITE8_HANDLER( gb_mem_mode_select_mbc1 ) | |
| 507 | static WRITE8_HANDLER( gb_mem_mode_select_mbc1 ) | |
| 508 | 508 | { |
| 509 | 509 | MBC1Mode = data & 0x1; |
| 510 | 510 | gb_set_mbc1_banks(); |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | WRITE8_HANDLER( gb_mem_mode_select_mbc3 ) | |
| 513 | static WRITE8_HANDLER( gb_mem_mode_select_mbc3 ) | |
| 514 | 514 | { |
| 515 | 515 | logerror( "0x%04X: Write to mbc3 mem mode select register 0x%04X <- 0x%02X\n", activecpu_get_pc(), offset, data ); |
| 516 | 516 | if( CartType & TIMER ) { |
| r1432 | r1433 | |
| 523 | 523 | } |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | WRITE8_HANDLER( gb_ram_tama5 ) { | |
| 526 | static WRITE8_HANDLER( gb_ram_tama5 ) { | |
| 527 | 527 | logerror( "0x%04X: TAMA5 write 0x%04X <- 0x%02X\n", activecpu_get_pc(), 0xA000 + offset, data ); |
| 528 | 528 | switch( offset & 0x0001 ) { |
| 529 | 529 | case 0x0000: /* Write to data register */ |
| r1432 | r1433 | |
| 600 | 600 | |
| 601 | 601 | /* This mmm01 implementation is mostly guess work, no clue how correct it all is */ |
| 602 | 602 | |
| 603 | UINT8 mmm01_bank_offset; | |
| 604 | UINT8 mmm01_reg1; | |
| 605 | UINT8 mmm01_bank; | |
| 606 | UINT8 mmm01_bank_mask; | |
| 603 | static UINT8 mmm01_bank_offset; | |
| 604 | static UINT8 mmm01_reg1; | |
| 605 | static UINT8 mmm01_bank; | |
| 606 | static UINT8 mmm01_bank_mask; | |
| 607 | 607 | |
| 608 | WRITE8_HANDLER( gb_rom_bank_mmm01_0000_w ) { | |
| 608 | static WRITE8_HANDLER( gb_rom_bank_mmm01_0000_w ) { | |
| 609 | 609 | logerror( "0x%04X: write 0x%02X to 0x%04X\n", activecpu_get_pc(), data, offset+0x000 ); |
| 610 | 610 | if ( data & 0x40 ) { |
| 611 | 611 | mmm01_bank_offset = mmm01_reg1; |
| r1432 | r1433 | |
| 615 | 615 | } |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | WRITE8_HANDLER( gb_rom_bank_mmm01_2000_w ) { | |
| 618 | static WRITE8_HANDLER( gb_rom_bank_mmm01_2000_w ) { | |
| 619 | 619 | logerror( "0x%04X: write 0x%02X to 0x%04X\n", activecpu_get_pc(), data, offset+0x2000 ); |
| 620 | 620 | |
| 621 | 621 | mmm01_reg1 = data & ROMMask; |
| r1432 | r1433 | |
| 626 | 626 | memory_set_bankptr( 1, ROMMap[ mmm01_bank_offset + mmm01_bank ] ); |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | WRITE8_HANDLER( gb_rom_bank_mmm01_4000_w ) { | |
| 629 | static WRITE8_HANDLER( gb_rom_bank_mmm01_4000_w ) { | |
| 630 | 630 | logerror( "0x%04X: write 0x%02X to 0x%04X\n", activecpu_get_pc(), data, offset+0x4000 ); |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | WRITE8_HANDLER( gb_rom_bank_mmm01_6000_w ) { | |
| 633 | static WRITE8_HANDLER( gb_rom_bank_mmm01_6000_w ) { | |
| 634 | 634 | logerror( "0x%04X: write 0x%02X to 0x%04X\n", activecpu_get_pc(), data, offset+0x6000 ); |
| 635 | 635 | /* Not sure if this is correct, Taito Variety Pack sets these values */ |
| 636 | 636 | /* Momotarou Collection 2 writes 01 and 21 here */ |
| r1432 | r1433 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | /* Expansion slots */ |
| 73 | 73 | |
| 74 | struct | |
| 74 | static struct | |
| 75 | 75 | { |
| 76 | 76 | read8_handler reg_read; |
| 77 | 77 | write8_handler reg_write; |
| r1432 | r1433 | |
|---|---|---|
| 354 | 354 | /* on rising edge, sets DVENA for 4.23 seconds on rising edge */ |
| 355 | 355 | static int motor_on; |
| 356 | 356 | /* count 4.23s from rising edge of motor_on */ |
| 357 | void *motor_on_timer; | |
| 357 | static void *motor_on_timer; | |
| 358 | 358 | |
| 359 | 359 | static const ti99_peb_card_handlers_t fdc_handlers = |
| 360 | 360 | { |
| r1432 | r1433 | |
|---|---|---|
| 44 | 44 | int check_value; |
| 45 | 45 | } GAMECOM_TIMER; |
| 46 | 46 | |
| 47 | UINT8 *internal_ram; | |
| 47 | static UINT8 *internal_ram; | |
| 48 | 48 | UINT8 internal_registers[0x80]; |
| 49 | 49 | UINT8 gamecom_vram[16*1024]; |
| 50 | UINT8 *cartridge1 = NULL; | |
| 51 | UINT8 *cartridge2 = NULL; | |
| 52 | UINT8 *cartridge = NULL; | |
| 53 | UINT8 *dummy_bank = NULL; | |
| 50 | static UINT8 *cartridge1 = NULL; | |
| 51 | static UINT8 *cartridge2 = NULL; | |
| 52 | static UINT8 *cartridge = NULL; | |
| 53 | static UINT8 *dummy_bank = NULL; | |
| 54 | 54 | |
| 55 | 55 | static emu_timer *gamecom_clock_timer = NULL; |
| 56 | GAMECOM_DMA gamecom_dma; | |
| 57 | GAMECOM_TIMER gamecom_timer[2]; | |
| 56 | static GAMECOM_DMA gamecom_dma; | |
| 57 | static GAMECOM_TIMER gamecom_timer[2]; | |
| 58 | 58 | |
| 59 | 59 | //int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 }; |
| 60 | int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }; | |
| 60 | static int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }; | |
| 61 | 61 | |
| 62 | void gamecom_dma_init(void); | |
| 62 | static void gamecom_dma_init(void); | |
| 63 | 63 | |
| 64 | 64 | static TIMER_CALLBACK(gamecom_clock_timer_callback) |
| 65 | 65 | { |
| r1432 | r1433 | |
| 407 | 407 | |
| 408 | 408 | /* The manual is not conclusive as to which bit of the DMVP register (offset 0x3D) determines |
| 409 | 409 | which page for source or destination is used */ |
| 410 | void gamecom_dma_init(void) { | |
| 410 | static void gamecom_dma_init(void) { | |
| 411 | 411 | if ( gamecom_dma.decrement_x || gamecom_dma.decrement_y ) { |
| 412 | 412 | logerror( "TODO: Decrement-x and decrement-y are not supported yet\n" ); |
| 413 | 413 | } |
| r1432 | r1433 | |
|---|---|---|
| 15 | 15 | #include "sound/dac.h" |
| 16 | 16 | #include "cpuint.h" |
| 17 | 17 | |
| 18 | unsigned char *advision_ram; | |
| 19 | int advision_rambank; | |
| 18 | static unsigned char *advision_ram; | |
| 19 | static int advision_rambank; | |
| 20 | 20 | int advision_framestart; |
| 21 | int advision_videoenable; | |
| 21 | static int advision_videoenable; | |
| 22 | 22 | int advision_videobank; |
| 23 | 23 | static int Lvalue[3]; |
| 24 | 24 | static int wLpointer; |
| r1432 | r1433 | |
|---|---|---|
| 55 | 55 | static void pit_clk_1(double clock); |
| 56 | 56 | static void pit_irq_2(int which); |
| 57 | 57 | |
| 58 | struct pit8253_config pit8253 = | |
| 58 | static struct pit8253_config pit8253 = | |
| 59 | 59 | { |
| 60 | 60 | TYPE8253, |
| 61 | 61 | { |
| r1432 | r1433 | |
|---|---|---|
| 25 | 25 | Function Prototypes |
| 26 | 26 | ******************************************************************************/ |
| 27 | 27 | |
| 28 | void aim65_update_ds1(int digit, int data); | |
| 29 | void aim65_update_ds2(int digit, int data); | |
| 30 | void aim65_update_ds3(int digit, int data); | |
| 31 | void aim65_update_ds4(int digit, int data); | |
| 32 | void aim65_update_ds5(int digit, int data); | |
| 28 | static void aim65_update_ds1(int digit, int data); | |
| 29 | static void aim65_update_ds2(int digit, int data); | |
| 30 | static void aim65_update_ds3(int digit, int data); | |
| 31 | static void aim65_update_ds4(int digit, int data); | |
| 32 | static void aim65_update_ds5(int digit, int data); | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | |
| r1432 | r1433 | |
| 134 | 134 | }; |
| 135 | 135 | |
| 136 | 136 | |
| 137 | void aim65_update_ds1(int digit, int data) { output_set_digit_value( 0 + (digit ^ 3), data); } | |
| 138 | void aim65_update_ds2(int digit, int data) { output_set_digit_value( 4 + (digit ^ 3), data); } | |
| 139 | void aim65_update_ds3(int digit, int data) { output_set_digit_value( 8 + (digit ^ 3), data); } | |
| 140 | void aim65_update_ds4(int digit, int data) { output_set_digit_value(12 + (digit ^ 3), data); } | |
| 141 | void aim65_update_ds5(int digit, int data) { output_set_digit_value(16 + (digit ^ 3), data); } | |
| 137 | static void aim65_update_ds1(int digit, int data) { output_set_digit_value( 0 + (digit ^ 3), data); } | |
| 138 | static void aim65_update_ds2(int digit, int data) { output_set_digit_value( 4 + (digit ^ 3), data); } | |
| 139 | static void aim65_update_ds3(int digit, int data) { output_set_digit_value( 8 + (digit ^ 3), data); } | |
| 140 | static void aim65_update_ds4(int digit, int data) { output_set_digit_value(12 + (digit ^ 3), data); } | |
| 141 | static void aim65_update_ds5(int digit, int data) { output_set_digit_value(16 + (digit ^ 3), data); } | |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | |
| r1432 | r1433 | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | void aim65_riot_irq(int state) | |
| 172 | static void aim65_riot_irq(int state) | |
| 173 | 173 | { |
| 174 | 174 | cpunum_set_input_line(0, M6502_IRQ_LINE, state ? HOLD_LINE : CLEAR_LINE); |
| 175 | 175 | } |
| r1432 | r1433 | |
|---|---|---|
| 31 | 31 | #define LOG_FDS 1 |
| 32 | 32 | |
| 33 | 33 | /* Global variables */ |
| 34 | int prg_mask; | |
| 34 | static int prg_mask; | |
| 35 | 35 | |
| 36 | int IRQ_enable, IRQ_enable_latch; | |
| 37 | UINT16 IRQ_count, IRQ_count_latch, IRQ_reload; | |
| 38 | UINT8 IRQ_status; | |
| 39 | UINT8 IRQ_mode_jaleco; | |
| 36 | static int IRQ_enable, IRQ_enable_latch; | |
| 37 | static UINT16 IRQ_count, IRQ_count_latch, IRQ_reload; | |
| 38 | static UINT8 IRQ_status; | |
| 39 | static UINT8 IRQ_mode_jaleco; | |
| 40 | 40 | |
| 41 | 41 | int MMC1_extended; /* 0 = normal MMC1 cart, 1 = 512k MMC1, 2 = 1024k MMC1 */ |
| 42 | 42 |
| r1432 | r1433 | |
|---|---|---|
| 172 | 172 | } d64; |
| 173 | 173 | } CBM_Drive_Emu; |
| 174 | 174 | |
| 175 | CBM_Drive_Emu vc1541_static= { 0 }, *vc1541 = &vc1541_static; | |
| 175 | static CBM_Drive_Emu vc1541_static= { 0 }, *vc1541 = &vc1541_static; | |
| 176 | 176 | |
| 177 | 177 | /* four different frequencies for the 4 different zones on the disk */ |
| 178 | 178 | static double vc1541_times[4]= { |
| r1432 | r1433 | |
| 315 | 315 | gcr_double_2_gcr(0, 0, 0, 0, vc1541->head.data+i);i+=5; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | ADDRESS_MAP_START( vc1541_readmem , ADDRESS_SPACE_PROGRAM, 8) | |
| 318 | static ADDRESS_MAP_START( vc1541_readmem , ADDRESS_SPACE_PROGRAM, 8) | |
| 319 | 319 | AM_RANGE(0x0000, 0x07ff) AM_READ( MRA8_RAM) |
| 320 | 320 | AM_RANGE(0x1800, 0x180f) AM_READ( via_2_r) /* 0 and 1 used in vc20 */ |
| 321 | 321 | AM_RANGE(0x1810, 0x189f) AM_READ( MRA8_NOP) /* for debugger */ |
| r1432 | r1433 | |
| 324 | 324 | AM_RANGE(0xc000, 0xffff) AM_READ( MRA8_ROM) |
| 325 | 325 | ADDRESS_MAP_END |
| 326 | 326 | |
| 327 | ADDRESS_MAP_START( vc1541_writemem , ADDRESS_SPACE_PROGRAM, 8) | |
| 327 | static ADDRESS_MAP_START( vc1541_writemem , ADDRESS_SPACE_PROGRAM, 8) | |
| 328 | 328 | AM_RANGE(0x0000, 0x07ff) AM_WRITE( MWA8_RAM) |
| 329 | 329 | AM_RANGE(0x1800, 0x180f) AM_WRITE( via_2_w) |
| 330 | 330 | AM_RANGE(0x1c00, 0x1c0f) AM_WRITE( via_3_w) |
| 331 | 331 | AM_RANGE(0xc000, 0xffff) AM_WRITE( MWA8_ROM) |
| 332 | 332 | ADDRESS_MAP_END |
| 333 | 333 | |
| 334 | ADDRESS_MAP_START( dolphin_readmem , ADDRESS_SPACE_PROGRAM, 8) | |
| 334 | static ADDRESS_MAP_START( dolphin_readmem , ADDRESS_SPACE_PROGRAM, 8) | |
| 335 | 335 | AM_RANGE(0x0000, 0x07ff) AM_READ( MRA8_RAM) |
| 336 | 336 | AM_RANGE(0x1800, 0x180f) AM_READ( via_2_r) /* 0 and 1 used in vc20 */ |
| 337 | 337 | AM_RANGE(0x1c00, 0x1c0f) AM_READ( via_3_r) |
| r1432 | r1433 | |
| 339 | 339 | AM_RANGE(0xa000, 0xffff) AM_READ( MRA8_ROM) |
| 340 | 340 | ADDRESS_MAP_END |
| 341 | 341 | |
| 342 | ADDRESS_MAP_START( dolphin_writemem , ADDRESS_SPACE_PROGRAM, 8) | |
| 342 | static ADDRESS_MAP_START( dolphin_writemem , ADDRESS_SPACE_PROGRAM, 8) | |
| 343 | 343 | AM_RANGE(0x0000, 0x07ff) AM_WRITE( MWA8_RAM) |
| 344 | 344 | AM_RANGE(0x1800, 0x180f) AM_WRITE( via_2_w) |
| 345 | 345 | AM_RANGE(0x1c00, 0x1c0f) AM_WRITE( via_3_w) |
| r1432 | r1433 | |
| 961 | 961 | return 0; |
| 962 | 962 | } |
| 963 | 963 | |
| 964 | ADDRESS_MAP_START( c1551_readmem , ADDRESS_SPACE_PROGRAM, 8) | |
| 964 | static ADDRESS_MAP_START( c1551_readmem , ADDRESS_SPACE_PROGRAM, 8) | |
| 965 | 965 | AM_RANGE(0x0000, 0x0001) AM_READ( c1551_port_r) |
| 966 | 966 | AM_RANGE(0x0002, 0x07ff) AM_READ( MRA8_RAM) |
| 967 | 967 | AM_RANGE(0x4000, 0x4007) AM_READ( tpi6525_0_port_r) |
| 968 | 968 | AM_RANGE(0xc000, 0xffff) AM_READ( MRA8_ROM) |
| 969 | 969 | ADDRESS_MAP_END |
| 970 | 970 | |
| 971 | ADDRESS_MAP_START( c1551_writemem , ADDRESS_SPACE_PROGRAM, 8) | |
| 971 | static ADDRESS_MAP_START( c1551_writemem , ADDRESS_SPACE_PROGRAM, 8) | |
| 972 | 972 | AM_RANGE(0x0000, 0x0001) AM_WRITE( c1551_port_w) |
| 973 | 973 | AM_RANGE(0x0002, 0x07ff) AM_WRITE( MWA8_RAM) |
| 974 | 974 | AM_RANGE(0x4000, 0x4007) AM_WRITE( tpi6525_0_port_w) |
| r1432 | r1433 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /* Data Write */ |
| 113 | void ttl74145_write(int which, offs_t offset, UINT8 data) | |
| 113 | static void ttl74145_write(int which, offs_t offset, UINT8 data) | |
| 114 | 114 | { |
| 115 | 115 | /* Decode number */ |
| 116 | 116 | UINT16 new_number = bcd_2_dec(data & 0x0f); |
| r1432 | r1433 | |
|---|---|---|
| 50 | 50 | */ |
| 51 | 51 | |
| 52 | 52 | /* up to 2MB of 68k RAM (normally 1MB or 512kb), generally 16kb of ROM */ |
| 53 | UINT8 *lisa_ram_ptr; | |
| 54 | UINT8 *lisa_rom_ptr; | |
| 53 | static UINT8 *lisa_ram_ptr; | |
| 54 | static UINT8 *lisa_rom_ptr; | |
| 55 | 55 | |
| 56 | 56 | /* offsets in REGION_CPU1 */ |
| 57 | 57 | #define RAM_OFFSET 0x004000 |
| r1432 | r1433 | |
| 64 | 64 | UINT8 *lisa_fdc_rom; |
| 65 | 65 | |
| 66 | 66 | /* special ROM (includes S/N) */ |
| 67 | UINT8 *videoROM_ptr; | |
| 67 | static UINT8 *videoROM_ptr; | |
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | /* |
| r1432 | r1433 | |
| 170 | 170 | /* |
| 171 | 171 | lisa model identification |
| 172 | 172 | */ |
| 173 | enum | |
| 173 | static enum | |
| 174 | 174 | { |
| 175 | 175 | /*lisa1,*/ /* twiggy floppy drive */ |
| 176 | 176 | lisa2, /* 3.5'' Sony floppy drive */ |
| r1432 | r1433 | |
| 178 | 178 | mac_xl /* same as above with modified video */ |
| 179 | 179 | } lisa_model; |
| 180 | 180 | |
| 181 | struct | |
| 181 | static struct | |
| 182 | 182 | { |
| 183 | 183 | unsigned int has_fast_timers : 1; /* I/O board VIAs are clocked at 1.25 MHz (?) instead of .5 MHz (?) (Lisa 2/10, Mac XL) */ |
| 184 | 184 | /* Note that the beep routine in boot ROMs implies that |
| r1432 | r1433 | |
|---|---|---|
| 15 | 15 | static int scc_reg; |
| 16 | 16 | static int scc_status; |
| 17 | 17 | |
| 18 | unsigned char scc_reg_val_a[16]; | |
| 19 | unsigned char scc_reg_val_b[16]; | |
| 18 | static unsigned char scc_reg_val_a[16]; | |
| 19 | static unsigned char scc_reg_val_b[16]; | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | void scc_init(const struct scc8530_interface *intf) |
| r1432 | r1433 | |
|---|---|---|
| 33 | 33 | ******************************************************************************/ |
| 34 | 34 | |
| 35 | 35 | |
| 36 | void sym1_74145_output_0_w(int state) | |
| 36 | static void sym1_74145_output_0_w(int state) | |
| 37 | 37 | { |
| 38 | 38 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 0, attotime_never); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | void sym1_74145_output_1_w(int state) | |
| 42 | static void sym1_74145_output_1_w(int state) | |
| 43 | 43 | { |
| 44 | 44 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 1, attotime_never); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | void sym1_74145_output_2_w(int state) | |
| 48 | static void sym1_74145_output_2_w(int state) | |
| 49 | 49 | { |
| 50 | 50 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 2, attotime_never); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| 54 | void sym1_74145_output_3_w(int state) | |
| 54 | static void sym1_74145_output_3_w(int state) | |
| 55 | 55 | { |
| 56 | 56 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 3, attotime_never); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| 60 | void sym1_74145_output_4_w(int state) | |
| 60 | static void sym1_74145_output_4_w(int state) | |
| 61 | 61 | { |
| 62 | 62 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 4, attotime_never); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| 66 | void sym1_74145_output_5_w(int state) | |
| 66 | static void sym1_74145_output_5_w(int state) | |
| 67 | 67 | { |
| 68 | 68 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 5, attotime_never); |
| 69 | 69 | } |
| r1432 | r1433 | |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | /* The speaker is connected to output 6 of the 74145 */ |
| 79 | void sym1_74145_output_6_w(int state) | |
| 79 | static void sym1_74145_output_6_w(int state) | |
| 80 | 80 | { |
| 81 | 81 | speaker_level_w(0, state); |
| 82 | 82 | } |
| r1432 | r1433 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | int cgenie_tv_mode = -1; |
| 33 | int cgenie_load_cas = 0; | |
| 33 | static int cgenie_load_cas = 0; | |
| 34 | 34 | static int port_ff = 0xff; |
| 35 | 35 | |
| 36 | 36 | #define CGENIE_DRIVE_INFO |
| r1432 | r1433 | |
|---|---|---|
| 773 | 773 | return address; |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | void pmd85_common_driver_init (void) | |
| 776 | static void pmd85_common_driver_init (void) | |
| 777 | 777 | { |
| 778 | 778 | memory_set_opbase_handler(0, pmd85_opbaseoverride); |
| 779 | 779 |
| r1432 | r1433 | |
|---|---|---|
| 246 | 246 | game=c64_game; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | UINT8 c128_mmu[0x0b]; | |
| 249 | static UINT8 c128_mmu[0x0b]; | |
| 250 | 250 | static int c128_mmu_helper[4] = |
| 251 | 251 | {0x400, 0x1000, 0x2000, 0x4000}; |
| 252 | 252 | static int mmu_cpu=0; |
| r1432 | r1433 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | unsigned char * lviv_video_ram; |
| 25 | 25 | |
| 26 | UINT8 lviv_ppi_port_outputs[2][3]; | |
| 26 | static UINT8 lviv_ppi_port_outputs[2][3]; | |
| 27 | 27 | |
| 28 | 28 | static UINT8 startup_mem_map; |
| 29 | 29 |
| r1432 | r1433 | |
|---|---|---|
| 37 | 37 | static UINT8 extmem_ctrl[2]; |
| 38 | 38 | |
| 39 | 39 | static int use_5FD; |
| 40 | void pc8801_init_5fd(void); | |
| 40 | static void pc8801_init_5fd(void); | |
| 41 | 41 | |
| 42 | 42 | static void pc88sr_init_fmsound(void); |
| 43 | 43 | static int enable_FM_IRQ; |
| r1432 | r1433 | |
| 776 | 776 | static READ8_HANDLER( load_8255_chip1_C ) { return load_8255_C(1); } |
| 777 | 777 | |
| 778 | 778 | |
| 779 | const ppi8255_interface pc8801_8255_config = | |
| 779 | static const ppi8255_interface pc8801_8255_config = | |
| 780 | 780 | { |
| 781 | 781 | 2, |
| 782 | 782 | { load_8255_chip0_A, load_8255_chip1_A }, |
| r1432 | r1433 | |
| 811 | 811 | pc8801_fdc_dma_drq |
| 812 | 812 | }; |
| 813 | 813 | |
| 814 | void pc8801_init_5fd(void) | |
| 814 | static void pc8801_init_5fd(void) | |
| 815 | 815 | { |
| 816 | 816 | use_5FD = (input_port_18_r(0)&0x80)!=0x00; |
| 817 | 817 | ppi8255_init(&pc8801_8255_config); |
| r1432 | r1433 | |
|---|---|---|
| 9 | 9 | static int sb2m600_tape_size; |
| 10 | 10 | static int sb2m600_tape_index; |
| 11 | 11 | |
| 12 | READ8_HANDLER( sb2m600_acia0_casin ) | |
| 12 | static READ8_HANDLER( sb2m600_acia0_casin ) | |
| 13 | 13 | { |
| 14 | 14 | if (sb2m600_tape_image && (sb2m600_tape_index < sb2m600_tape_size)) |
| 15 | 15 | return sb2m600_tape_image[sb2m600_tape_index++]; |
| r1432 | r1433 | |
| 17 | 17 | return 0; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | READ8_HANDLER (sb2m600_acia0_statin ) | |
| 20 | static READ8_HANDLER (sb2m600_acia0_statin ) | |
| 21 | 21 | { |
| 22 | 22 | if (sb2m600_tape_image && (sb2m600_tape_index < sb2m600_tape_size)) |
| 23 | 23 | return ACIA_6850_RDRF; |
| r1432 | r1433 | |
|---|---|---|
| 452 | 452 | |
| 453 | 453 | */ |
| 454 | 454 | |
| 455 | struct via6522_interface oric_6522_interface= | |
| 455 | static struct via6522_interface oric_6522_interface= | |
| 456 | 456 | { |
| 457 | 457 | oric_via_in_a_func, |
| 458 | 458 | oric_via_in_b_func, |
| r1432 | r1433 | |
| 1433 | 1433 | |
| 1434 | 1434 | oric_refresh_ints(); |
| 1435 | 1435 | } |
| 1436 | struct via6522_interface telestrat_via2_interface= | |
| 1436 | static struct via6522_interface telestrat_via2_interface= | |
| 1437 | 1437 | { |
| 1438 | 1438 | telestrat_via2_in_a_func, |
| 1439 | 1439 | telestrat_via2_in_b_func, |
| r1432 | r1433 | |
|---|---|---|
| 27 | 27 | #include "sound/speaker.h" |
| 28 | 28 | |
| 29 | 29 | UINT8 atom_8255_porta; |
| 30 | UINT8 atom_8255_portb; | |
| 30 | static UINT8 atom_8255_portb; | |
| 31 | 31 | UINT8 atom_8255_portc; |
| 32 | 32 | |
| 33 | 33 | /* printer data written */ |
| r1432 | r1433 | |
| 104 | 104 | previous_ca2_data = data; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | struct via6522_interface atom_6522_interface= | |
| 107 | static struct via6522_interface atom_6522_interface= | |
| 108 | 108 | { |
| 109 | 109 | atom_via_in_a_func, /* printer status */ |
| 110 | 110 | NULL, |
| r1432 | r1433 | |
|---|---|---|
| 13 | 13 | #include "devices/cassette.h" |
| 14 | 14 | |
| 15 | 15 | ULA ula; |
| 16 | emu_timer *electron_tape_timer; | |
| 16 | static emu_timer *electron_tape_timer; | |
| 17 | 17 | |
| 18 | 18 | static mess_image *cassette_device_image( void ) { |
| 19 | 19 | return image_from_devtype_and_index( IO_CASSETTE, 0 ); |
| r1432 | r1433 | |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | READ8_HANDLER( electron_read_keyboard ) { | |
| 97 | static READ8_HANDLER( electron_read_keyboard ) { | |
| 98 | 98 | UINT8 data = 0; |
| 99 | 99 | int i; |
| 100 | 100 | //logerror( "PC=%04x: keyboard read from paged rom area, address: %04x", activecpu_get_pc(), offset ); |
| r1432 | r1433 | |
|---|---|---|
| 44 | 44 | int int_state; |
| 45 | 45 | |
| 46 | 46 | struct pc_fdc_interface fdc_interface; |
| 47 | } | |
| 47 | } | |
| 48 | 48 | |
| 49 | 49 | static struct pc_fdc *fdc; |
| 50 | 50 |
| r1432 | r1433 | |
|---|---|---|
| 66 | 66 | |
| 67 | 67 | static int ide_irq, clk_irq; |
| 68 | 68 | |
| 69 | struct ide_interface ti99_ide_interface = | |
| 69 | static struct ide_interface ti99_ide_interface = | |
| 70 | 70 | { |
| 71 | 71 | ide_interrupt_callback |
| 72 | 72 | }; |
| r1432 | r1433 | |
|---|---|---|
| 408 | 408 | return intv_load_rom_file(image, 1); |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | #ifdef UNUSED_FUNCTION | |
| 411 | 412 | DRIVER_INIT( intv ) |
| 412 | 413 | { |
| 413 | 414 | } |
| 415 | #endif | |
| 414 | 416 | |
| 415 | 417 | /* Set Reset and INTR/INTRM Vector */ |
| 416 | 418 | MACHINE_RESET( intv ) |
| r1432 | r1433 | |
|---|---|---|
| 162 | 162 | static int tmp_buffer; |
| 163 | 163 | |
| 164 | 164 | /* inta/intb handlers */ |
| 165 | void (*inta_callback)(int state); | |
| 166 | void (*intb_callback)(int state); | |
| 165 | static void (*inta_callback)(int state); | |
| 166 | static void (*intb_callback)(int state); | |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | /* |
| r1432 | r1433 | |
|---|---|---|
| 57 | 57 | BDOS >> 8 |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | cpm_dph dph[NDSK] = { | |
| 60 | static cpm_dph dph[NDSK] = { | |
| 61 | 61 | { 0, 0, 0, 0, DIRBUF, DPB0, 0, 0 }, |
| 62 | 62 | { 0, 0, 0, 0, DIRBUF, DPB1, 0, 0 }, |
| 63 | 63 | { 0, 0, 0, 0, DIRBUF, DPB2, 0, 0 }, |
| r1432 | r1433 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #define MAX_CARTRIDGES 16 |
| 15 | 15 | |
| 16 | UINT8 smsBiosPageCount; | |
| 17 | UINT8 smsFMDetect; | |
| 18 | UINT8 smsVersion; | |
| 19 | int smsPaused; | |
| 16 | static UINT8 smsBiosPageCount; | |
| 17 | static UINT8 smsFMDetect; | |
| 18 | static UINT8 smsVersion; | |
| 19 | static int smsPaused; | |
| 20 | 20 | |
| 21 | UINT8 biosPort; | |
| 21 | static UINT8 biosPort; | |
| 22 | 22 | |
| 23 | UINT8 *BIOS; | |
| 23 | static UINT8 *BIOS; | |
| 24 | 24 | |
| 25 | UINT8 *sms_mapper_ram; | |
| 26 | UINT8 sms_mapper[4]; | |
| 27 | UINT8 *sms_banking_bios[5]; /* we are going to use 1-4, same as bank numbers */ | |
| 28 | UINT8 *sms_banking_cart[5]; /* we are going to use 1-4, same as bank numbers */ | |
| 29 | UINT8 *sms_banking_none[5]; /* we are going to use 1-4, same as bank numbers */ | |
| 30 | UINT8 ggSIO[5] = { 0x7F, 0xFF, 0x00, 0xFF, 0x00 }; | |
| 31 | UINT8 sms_store_control = 0; | |
| 25 | static UINT8 *sms_mapper_ram; | |
| 26 | static UINT8 sms_mapper[4]; | |
| 27 | static UINT8 *sms_banking_bios[5]; /* we are going to use 1-4, same as bank numbers */ | |
| 28 | static UINT8 *sms_banking_cart[5]; /* we are going to use 1-4, same as bank numbers */ | |
| 29 | static UINT8 *sms_banking_none[5]; /* we are going to use 1-4, same as bank numbers */ | |
| 30 | static UINT8 ggSIO[5] = { 0x7F, 0xFF, 0x00, 0xFF, 0x00 }; | |
| 31 | static UINT8 sms_store_control = 0; | |
| 32 | 32 | |
| 33 | UINT8 sms_input_port0; | |
| 34 | UINT8 sms_input_port1; | |
| 33 | static UINT8 sms_input_port0; | |
| 34 | static UINT8 sms_input_port1; | |
| 35 | 35 | |
| 36 | 36 | /* Data needed for Rapid Fire Unit support */ |
| 37 | emu_timer *rapid_fire_timer; | |
| 38 | UINT8 rapid_fire_state_1; | |
| 39 | UINT8 rapid_fire_state_2; | |
| 37 | static emu_timer *rapid_fire_timer; | |
| 38 | static UINT8 rapid_fire_state_1; | |
| 39 | static UINT8 rapid_fire_state_2; | |
| 40 | 40 | |
| 41 | 41 | /* Data needed for Paddle Control controller */ |
| 42 | UINT32 last_paddle_read_time; | |
| 43 | UINT8 paddle_read_state; | |
| 42 | static UINT32 last_paddle_read_time; | |
| 43 | static UINT8 paddle_read_state; | |
| 44 | 44 | |
| 45 | 45 | /* Data needed for Sports Pad controller */ |
| 46 | UINT32 last_sports_pad_time_1; | |
| 47 | UINT32 last_sports_pad_time_2; | |
| 48 | UINT8 sports_pad_state_1; | |
| 49 | UINT8 sports_pad_state_2; | |
| 50 | UINT8 sports_pad_last_data_1; | |
| 51 | UINT8 sports_pad_last_data_2; | |
| 52 | UINT8 sports_pad_1_x; | |
| 53 | UINT8 sports_pad_1_y; | |
| 54 | UINT8 sports_pad_2_x; | |
| 55 | UINT8 sports_pad_2_y; | |
| 46 | static UINT32 last_sports_pad_time_1; | |
| 47 | static UINT32 last_sports_pad_time_2; | |
| 48 | static UINT8 sports_pad_state_1; | |
| 49 | static UINT8 sports_pad_state_2; | |
| 50 | static UINT8 sports_pad_last_data_1; | |
| 51 | static UINT8 sports_pad_last_data_2; | |
| 52 | static UINT8 sports_pad_1_x; | |
| 53 | static UINT8 sports_pad_1_y; | |
| 54 | static UINT8 sports_pad_2_x; | |
| 55 | static UINT8 sports_pad_2_y; | |
| 56 | 56 | |
| 57 | struct { | |
| 57 | static struct { | |
| 58 | 58 | UINT8 *ROM; /* Pointer to ROM image data */ |
| 59 | 59 | UINT32 size; /* Size of the ROM image */ |
| 60 | 60 | UINT8 features; /* on-cartridge special hardware */ |
| r1432 | r1433 | |
| 64 | 64 | UINT32 ram_size; /* size of the on-cartridge RAM */ |
| 65 | 65 | UINT8 ram_page; /* currently swapped in cartridge RAM */ |
| 66 | 66 | } sms_cartridge[MAX_CARTRIDGES]; |
| 67 | UINT8 sms_current_cartridge; | |
| 67 | static UINT8 sms_current_cartridge; | |
| 68 | 68 | |
| 69 | 69 | static TIMER_CALLBACK( rapid_fire_callback ) { |
| 70 | 70 | rapid_fire_state_1 ^= 0xFF; |
| r1432 | r1433 | |
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | WRITE8_HANDLER(sms_codemasters_page0_w) { | |
| 450 | static WRITE8_HANDLER(sms_codemasters_page0_w) { | |
| 451 | 451 | if ( sms_cartridge[sms_current_cartridge].ROM && sms_cartridge[sms_current_cartridge].features & CF_CODEMASTERS_MAPPER ) { |
| 452 | 452 | UINT8 rom_page_count = sms_cartridge[sms_current_cartridge].size / 0x4000; |
| 453 | 453 | sms_banking_cart[1] = sms_cartridge[sms_current_cartridge].ROM + ( ( rom_page_count > 0) ? data % rom_page_count : 0 ) * 0x4000; |
| r1432 | r1433 | |
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | WRITE8_HANDLER(sms_codemasters_page1_w) { | |
| 460 | static WRITE8_HANDLER(sms_codemasters_page1_w) { | |
| 461 | 461 | if ( sms_cartridge[sms_current_cartridge].ROM && sms_cartridge[sms_current_cartridge].features & CF_CODEMASTERS_MAPPER ) { |
| 462 | 462 | /* Check if we need to switch in some RAM */ |
| 463 | 463 | if ( data & 0x80 ) { |
| r1432 | r1433 | |
|---|---|---|
| 1091 | 1091 | apple2_c08x_r |
| 1092 | 1092 | ***************************************************************************/ |
| 1093 | 1093 | |
| 1094 | READ8_HANDLER ( apple2_c08x_r ) | |
| 1094 | static READ8_HANDLER ( apple2_c08x_r ) | |
| 1095 | 1095 | { |
| 1096 | 1096 | UINT32 val, mask; |
| 1097 | 1097 | |
| r1432 | r1433 | |
| 1127 | 1127 | apple2_c08x_w |
| 1128 | 1128 | ***************************************************************************/ |
| 1129 | 1129 | |
| 1130 | WRITE8_HANDLER ( apple2_c08x_w ) | |
| 1130 | static WRITE8_HANDLER ( apple2_c08x_w ) | |
| 1131 | 1131 | { |
| 1132 | 1132 | apple2_c08x_r(offset); |
| 1133 | 1133 | } |
| r1432 | r1433 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | *******************************************************************************/ |
| 43 | 43 | |
| 44 | void primo_update_memory (void) | |
| 44 | static void primo_update_memory (void) | |
| 45 | 45 | { |
| 46 | 46 | switch (primo_port_FD & 0x03) |
| 47 | 47 | { |
| r1432 | r1433 | |
| 204 | 204 | |
| 205 | 205 | *******************************************************************************/ |
| 206 | 206 | |
| 207 | void primo_common_driver_init (void) | |
| 207 | static void primo_common_driver_init (void) | |
| 208 | 208 | { |
| 209 | 209 | primo_port_FD = 0x00; |
| 210 | 210 | } |
| r1432 | r1433 | |
| 233 | 233 | |
| 234 | 234 | *******************************************************************************/ |
| 235 | 235 | |
| 236 | void primo_common_machine_init (void) | |
| 236 | static void primo_common_machine_init (void) | |
| 237 | 237 | { |
| 238 | 238 | if (readinputport(6)) |
| 239 | 239 | primo_port_FD = 0x00; |
| r1432 | r1433 | |
|---|---|---|
| 61 | 61 | UINT8 *c64_chargen; |
| 62 | 62 | UINT8 *c64_roml=0; |
| 63 | 63 | UINT8 *c64_romh=0; |
| 64 | UINT8 *c64_io_mirror = NULL; | |
| 64 | static UINT8 *c64_io_mirror = NULL; | |
| 65 | 65 | |
| 66 | 66 | static UINT8 c64_port_data; |
| 67 | 67 | |
| r1432 | r1433 | |
| 362 | 362 | * flag restore key or rs232 received data input |
| 363 | 363 | * irq to nmi connected ? |
| 364 | 364 | */ |
| 365 | UINT8 c64_cia1_port_a_r (void) | |
| 365 | static UINT8 c64_cia1_port_a_r (void) | |
| 366 | 366 | { |
| 367 | 367 | UINT8 value = 0xff; |
| 368 | 368 | |
| r1432 | r1433 | |
| 966 | 966 | vicirq = 0; |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | OPBASE_HANDLER( c64_opbase ) { | |
| 969 | static OPBASE_HANDLER( c64_opbase ) { | |
| 970 | 970 | if ( ( address & 0xf000 ) == 0xd000 ) { |
| 971 | 971 | if ( c64_io_enabled ) { |
| 972 | 972 | opcode_mask = 0x0fff; |
| r1432 | r1433 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | static struct hd63450 dmac; |
| 10 | 10 | |
| 11 | TIMER_CALLBACK(dma_transfer_timer); | |
| 12 | void dma_transfer_abort(int channel); | |
| 13 | void dma_transfer_halt(int channel); | |
| 14 | void dma_transfer_continue(int channel); | |
| 11 | static TIMER_CALLBACK(dma_transfer_timer); | |
| 12 | static void dma_transfer_abort(int channel); | |
| 13 | static void dma_transfer_halt(int channel); | |
| 14 | static void dma_transfer_continue(int channel); | |
| 15 | 15 | |
| 16 | 16 | void hd63450_init(struct hd63450_interface* intf) |
| 17 | 17 | { |
| r1432 | r1433 | |
| 216 | 216 | logerror("DMA: Transfer begins: size=0x%08x\n",dmac.transfer_size[channel]); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | TIMER_CALLBACK(dma_transfer_timer) | |
| 219 | static TIMER_CALLBACK(dma_transfer_timer) | |
| 220 | 220 | { |
| 221 | 221 | hd63450_single_transfer(param); |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | void dma_transfer_abort(int channel) | |
| 224 | static void dma_transfer_abort(int channel) | |
| 225 | 225 | { |
| 226 | 226 | logerror("DMA#%i: Transfer aborted\n",channel); |
| 227 | 227 | timer_adjust(dmac.timer[channel],attotime_zero,0,attotime_zero); |
| r1432 | r1433 | |
| 231 | 231 | dmac.reg[channel].csr &= ~0x08; // channel no longer active |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | void dma_transfer_halt(int channel) | |
| 234 | static void dma_transfer_halt(int channel) | |
| 235 | 235 | { |
| 236 | 236 | dmac.halted[channel] = 1; |
| 237 | 237 | timer_adjust(dmac.timer[channel],attotime_zero,0,attotime_zero); |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | void dma_transfer_continue(int channel) | |
| 240 | static void dma_transfer_continue(int channel) | |
| 241 | 241 | { |
| 242 | 242 | if(dmac.halted[channel] != 0) |
| 243 | 243 | { |
| r1432 | r1433 | |
|---|---|---|
| 336 | 336 | } GROM_port_t; |
| 337 | 337 | |
| 338 | 338 | /* descriptor for console GROMs */ |
| 339 | GROM_port_t console_GROMs; | |
| 339 | static GROM_port_t console_GROMs; | |
| 340 | 340 | |
| 341 | 341 | /* true if hsgpl is enabled (i.e. has_hsgpl is true and hsgpl cru bit crdena is |
| 342 | 342 | set) */ |
| r1432 | r1433 | |
| 927 | 927 | mecmouse_y = 0; |
| 928 | 928 | } |
| 929 | 929 | |
| 930 | #ifdef UNUSED_FUNCTION | |
| 930 | 931 | void machine_stop_ti99(void) |
| 931 | 932 | { |
| 932 | 933 | if (has_ide) |
| r1432 | r1433 | |
| 940 | 941 | |
| 941 | 942 | tms9901_cleanup(0); |
| 942 | 943 | } |
| 944 | #endif | |
| 943 | 945 | |
| 944 | 946 | |
| 945 | 947 | /* |
| r1432 | r1433 | |
|---|---|---|
| 602 | 602 | logerror("atari %d bytes to read\n", atari_fdc.serin_count); |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | void a800_serial_write(void) | |
| 605 | static void a800_serial_write(void) | |
| 606 | 606 | { |
| 607 | 607 | int i, drive, sector, offset; |
| 608 | 608 |
| r1432 | r1433 | |
|---|---|---|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | void *tMC_UpdateTimer; | |
| 27 | static void *tMC_UpdateTimer; | |
| 28 | 28 | static UINT32 nMC_CPUControl0; |
| 29 | 29 | static UINT32 nMC_CPUControl1; |
| 30 | 30 | static UINT32 nMC_Watchdog; |
| r1432 | r1433 | |
|---|---|---|
| 38 | 38 | tape; |
| 39 | 39 | |
| 40 | 40 | /* these are the values for wav files */ |
| 41 | struct | |
| 41 | static struct | |
| 42 | 42 | { |
| 43 | 43 | int state; |
| 44 | 44 | emu_timer *timer; |
| r1432 | r1433 | |
| 48 | 48 | } wav; |
| 49 | 49 | |
| 50 | 50 | /* these are the values for prg files */ |
| 51 | struct | |
| 51 | static struct | |
| 52 | 52 | { |
| 53 | 53 | int state; |
| 54 | 54 | emu_timer *prg_timer; |
| r1432 | r1433 | |
|---|---|---|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | |
| 431 | WRITE8_HANDLER ( page_selectbm_w ) | |
| 431 | static WRITE8_HANDLER ( page_selectbm_w ) | |
| 432 | 432 | { |
| 433 | 433 | pagedRAM=(data&0x80)>>7; |
| 434 | 434 | bbc_rombank=data&0x0f; |
| r1432 | r1433 | |
| 859 | 859 | |
| 860 | 860 | |
| 861 | 861 | /* This the BBC Masters Real Time Clock and NVRam IC */ |
| 862 | void MC146818_set(void) | |
| 862 | static void MC146818_set(void) | |
| 863 | 863 | { |
| 864 | 864 | logerror ("146181 WR=%d DS=%d AS=%d CE=%d \n",MC146818_WR,MC146818_DS,MC146818_AS,MC146818_CE); |
| 865 | 865 | |
| r1432 | r1433 | |
| 1202 | 1202 | file. I now need to look at the new printer code and see how I should |
| 1203 | 1203 | connect this code up to that */ |
| 1204 | 1204 | |
| 1205 | int bbc_printer_porta; | |
| 1206 | int bbc_printer_ca1; | |
| 1207 | int bbc_printer_ca2; | |
| 1205 | static int bbc_printer_porta; | |
| 1206 | static int bbc_printer_ca1; | |
| 1207 | static int bbc_printer_ca2; | |
| 1208 | 1208 | |
| 1209 | 1209 | /* USER VIA 6522 port A is buffered as an output through IC70 so |
| 1210 | 1210 | reading from this port will always return 0xff */ |
| r1432 | r1433 | |
| 1357 | 1357 | |
| 1358 | 1358 | |
| 1359 | 1359 | |
| 1360 | void Serial_interrupt(int level) | |
| 1360 | static void Serial_interrupt(int level) | |
| 1361 | 1361 | { |
| 1362 | 1362 | MC6850_irq=level; |
| 1363 | 1363 | bbc_setirq(); |
| r1432 | r1433 | |
| 1386 | 1386 | static int len2=0; |
| 1387 | 1387 | static int len3=0; |
| 1388 | 1388 | |
| 1389 | emu_timer *bbc_tape_timer; | |
| 1389 | static emu_timer *bbc_tape_timer; | |
| 1390 | 1390 | |
| 1391 | 1391 | static TIMER_CALLBACK(bbc_tape_timer_cb) |
| 1392 | 1392 | { |
| r1432 | r1433 | |
| 1448 | 1448 | |
| 1449 | 1449 | } |
| 1450 | 1450 | |
| 1451 | void BBC_Cassette_motor(unsigned char status) | |
| 1451 | static void BBC_Cassette_motor(unsigned char status) | |
| 1452 | 1452 | { |
| 1453 | 1453 | if (status) |
| 1454 | 1454 | { |
| r1432 | r1433 | |
| 1530 | 1530 | }; |
| 1531 | 1531 | |
| 1532 | 1532 | |
| 1533 | READ8_HANDLER( bbc_i8271_read ) | |
| 1533 | static READ8_HANDLER( bbc_i8271_read ) | |
| 1534 | 1534 | { |
| 1535 | 1535 | int ret; |
| 1536 | 1536 | ret=0x0ff; |
| r1432 | r1433 | |
| 1556 | 1556 | return 0x0ff; |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | WRITE8_HANDLER( bbc_i8271_write ) | |
| 1559 | static WRITE8_HANDLER( bbc_i8271_write ) | |
| 1560 | 1560 | { |
| 1561 | 1561 | logerror("i8271 write %d %d\n",offset,data); |
| 1562 | 1562 | |
| r1432 | r1433 | |
| 1688 | 1688 | |
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | WRITE8_HANDLER(bbc_wd177x_status_w) | |
| 1691 | static WRITE8_HANDLER(bbc_wd177x_status_w) | |
| 1692 | 1692 | { |
| 1693 | 1693 | drive_control = data; |
| 1694 | 1694 | |
| r1432 | r1433 | |
| 1805 | 1805 | static int opusbank; |
| 1806 | 1806 | |
| 1807 | 1807 | |
| 1808 | WRITE8_HANDLER( bbc_opus_status_w ) | |
| 1808 | static WRITE8_HANDLER( bbc_opus_status_w ) | |
| 1809 | 1809 | { |
| 1810 | 1810 | drive_control = data; |
| 1811 | 1811 |
| r1432 | r1433 | |
|---|---|---|
| 92 | 92 | } i186; |
| 93 | 93 | |
| 94 | 94 | /* Keyboard */ |
| 95 | const UINT8 compis_keyb_codes[6][16] = { | |
| 95 | static const UINT8 compis_keyb_codes[6][16] = { | |
| 96 | 96 | {0x39, 0x32, 0x29, 0x20, 0x17, 0x0e, 0x05, 0x56, 0x4d, 0x44, 0x08, 0x57, 0x59, 0x4e, 0x43, 0x3a}, |
| 97 | 97 | {0x31, 0x28, 0x1f, 0x16, 0x0d, 0x04, 0x55, 0x4c, 0x4f, 0x58, 0x00, 0x07, 0xff, 0x42, 0x3b, 0x30}, |
| 98 | 98 | {0x27, 0x1e, 0x15, 0x0c, 0x03, 0x54, 0x06, 0x50, 0x01, 0xfe, 0x38, 0x2f, 0x26, 0x1d, 0x14, 0x0b}, |
| r1432 | r1433 | |
| 182 | 182 | /* Name: compis_irq_set */ |
| 183 | 183 | /* Desc: IRQ - Issue an interrupt request */ |
| 184 | 184 | /*-------------------------------------------------------------------------*/ |
| 185 | #ifdef UNUSED_FUNCTION | |
| 185 | 186 | void compis_irq_set(UINT8 irq) |
| 186 | 187 | { |
| 187 | 188 | cpunum_set_input_line_vector(0, 0, irq); |
| 188 | 189 | cpunum_set_input_line(0, 0, HOLD_LINE); |
| 189 | 190 | } |
| 191 | #endif | |
| 190 | 192 | |
| 191 | 193 | /*-------------------------------------------------------------------------*/ |
| 192 | 194 | /* OSP PIC 8259 */ |
| 193 | 195 | /*-------------------------------------------------------------------------*/ |
| 194 | 196 | |
| 195 | void compis_osp_pic_irq(UINT8 irq) | |
| 197 | static void compis_osp_pic_irq(UINT8 irq) | |
| 196 | 198 | { |
| 197 | 199 | pic8259_set_irq_line(0, irq, 1); |
| 198 | 200 | pic8259_set_irq_line(0, irq, 0); |
| r1432 | r1433 | |
| 211 | 213 | /*-------------------------------------------------------------------------*/ |
| 212 | 214 | /* Keyboard */ |
| 213 | 215 | /*-------------------------------------------------------------------------*/ |
| 214 | void compis_keyb_update(void) | |
| 216 | static void compis_keyb_update(void) | |
| 215 | 217 | { |
| 216 | 218 | UINT8 key_code; |
| 217 | 219 | UINT8 key_status; |
| r1432 | r1433 | |
| 265 | 267 | } |
| 266 | 268 | } |
| 267 | 269 | |
| 268 | void compis_keyb_init(void) | |
| 270 | static void compis_keyb_init(void) | |
| 269 | 271 | { |
| 270 | 272 | compis.keyboard.key_code = 0; |
| 271 | 273 | compis.keyboard.key_status = 0x80; |
| r1432 | r1433 | |
| 284 | 286 | nec765_set_reset_state(1); |
| 285 | 287 | } |
| 286 | 288 | |
| 287 | void compis_fdc_tc(int state) | |
| 289 | static void compis_fdc_tc(int state) | |
| 288 | 290 | { |
| 289 | 291 | /* Terminal count if iSBX-218A has DMA enabled */ |
| 290 | 292 | if (readinputport(7)) |
| r1432 | r1433 | |
| 293 | 295 | } |
| 294 | 296 | } |
| 295 | 297 | |
| 296 | void compis_fdc_int(int state) | |
| 298 | static void compis_fdc_int(int state) | |
| 297 | 299 | { |
| 298 | 300 | /* No interrupt requests if iSBX-218A has DMA enabled */ |
| 299 | 301 | if (!readinputport(7) && state) |
| r1432 | r1433 | |
| 523 | 525 | /*-------------------------------------------------------------------------*/ |
| 524 | 526 | /* USART 8251 */ |
| 525 | 527 | /*-------------------------------------------------------------------------*/ |
| 526 | void compis_usart_rxready(int state) | |
| 528 | static void compis_usart_rxready(int state) | |
| 527 | 529 | { |
| 528 | 530 | /* |
| 529 | 531 | if (state) |
| r1432 | r1433 | |
| 1516 | 1518 | /* Name: compis */ |
| 1517 | 1519 | /* Desc: CPU - Initialize the 80186 CPU */ |
| 1518 | 1520 | /*-------------------------------------------------------------------------*/ |
| 1519 | void compis_cpu_init(void) | |
| 1521 | static void compis_cpu_init(void) | |
| 1520 | 1522 | { |
| 1521 | 1523 | /* create timers here so they stick around */ |
| 1522 | 1524 | i186.timer[0].int_timer = timer_alloc(internal_timer_int, NULL); |
| r1432 | r1433 | |
|---|---|---|
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | |
| 179 | struct CassetteFormat fmsx_cas_format = | |
| 179 | static struct CassetteFormat fmsx_cas_format = | |
| 180 | 180 | { |
| 181 | 181 | "tap", |
| 182 | 182 | fmsx_cas_identify, |
| r1432 | r1433 | |
|---|---|---|
| 72 | 72 | return p; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | UINT8 *gz_ptr = NULL; | |
| 75 | static UINT8 *gz_ptr = NULL; | |
| 76 | 76 | |
| 77 | 77 | static float get_uef_float( const UINT8 *Float) |
| 78 | 78 | { |
| r1432 | r1433 | |
|---|---|---|
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | |
| 141 | struct CassetteFormat apf_apt_format = | |
| 141 | static struct CassetteFormat apf_apt_format = | |
| 142 | 142 | { |
| 143 | 143 | "apt", |
| 144 | 144 | apf_apt_identify, |
| r1432 | r1433 | |
|---|---|---|
| 477 | 477 | return cassette_legacy_construct( cassette, &tap_legacy_fill_wave ); |
| 478 | 478 | } |
| 479 | 479 | |
| 480 | struct CassetteFormat tzx_cassette_format = { | |
| 480 | static struct CassetteFormat tzx_cassette_format = { | |
| 481 | 481 | "tzx", |
| 482 | 482 | tzx_cassette_identify, |
| 483 | 483 | tzx_cassette_load, |
| 484 | 484 | NULL |
| 485 | 485 | }; |
| 486 | 486 | |
| 487 | struct CassetteFormat tap_cassette_format = { | |
| 487 | static struct CassetteFormat tap_cassette_format = { | |
| 488 | 488 | "tap", |
| 489 | 489 | tap_cassette_identify, |
| 490 | 490 | tap_cassette_load, |
| r1432 | r1433 | |
|---|---|---|
| 114 | 114 | return cassette_legacy_construct(cassette, &vtech1_legacy_fill_wave); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | struct CassetteFormat vtech1_cas_format = | |
| 117 | static struct CassetteFormat vtech1_cas_format = | |
| 118 | 118 | { |
| 119 | 119 | "cas", |
| 120 | 120 | vtech1_cas_identify, |
| r1432 | r1433 | |
| 209 | 209 | return cassette_legacy_construct(cassette, &vtech2_legacy_fill_wave); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | struct CassetteFormat vtech2_cas_format = | |
| 212 | static struct CassetteFormat vtech2_cas_format = | |
| 213 | 213 | { |
| 214 | 214 | "cas", |
| 215 | 215 | vtech2_cas_identify, |
| r1432 | r1433 | |
|---|---|---|
| 36 | 36 | return LITTLE_ENDIANIZE_INT32(value); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | int mycaslen; | |
| 39 | static int mycaslen; | |
| 40 | 40 | |
| 41 | 41 | static int csw_cas_to_wav_size( const UINT8 *casdata, int caslen ) { |
| 42 | 42 | UINT32 SampleRate; |
| r1432 | r1433 | |
| 310 | 310 | return cassette_legacy_construct( cassette, &csw_legacy_fill_wave ); |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | struct CassetteFormat csw_cassette_format = { | |
| 313 | static struct CassetteFormat csw_cassette_format = { | |
| 314 | 314 | "csw", |
| 315 | 315 | csw_cassette_identify, |
| 316 | 316 | csw_cassette_load, |
| r1432 | r1433 | |
|---|---|---|
| 248 | 248 | This code has already identified some rounding errors |
| 249 | 249 | *********************************************************************/ |
| 250 | 250 | |
| 251 | #ifdef UNUSED_FUNCTION | |
| 251 | 252 | void wavfile_testload(const char *fname) |
| 252 | 253 | { |
| 253 | 254 | cassette_image *cassette; |
| r1432 | r1433 | |
| 279 | 280 | |
| 280 | 281 | cassette_close(cassette); |
| 281 | 282 | } |
| 283 | #endif | |
| 282 | 284 | |
| 283 | 285 | |
| 284 | 286 |
| r1432 | r1433 | |
|---|---|---|
| 543 | 543 | |
| 544 | 544 | |
| 545 | 545 | |
| 546 | UINT32 apple35_get_track_size(floppy_image *floppy, int head, int track) | |
| 546 | static UINT32 apple35_get_track_size(floppy_image *floppy, int head, int track) | |
| 547 | 547 | { |
| 548 | 548 | if ((track < 0) || (track >= 80)) |
| 549 | 549 | return 0; |
| r1432 | r1433 | |
|---|---|---|
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | |
| 329 | struct CassetteFormat mz700_cas_format = | |
| 329 | static struct CassetteFormat mz700_cas_format = | |
| 330 | 330 | { |
| 331 | 331 | "m12", |
| 332 | 332 | mz700_cas_identify, |
| r1432 | r1433 | |
|---|---|---|
| 191 | 191 | |
| 192 | 192 | |
| 193 | 193 | |
| 194 | struct CassetteFormat svi_cas_format = | |
| 194 | static struct CassetteFormat svi_cas_format = | |
| 195 | 195 | { |
| 196 | 196 | "cas", |
| 197 | 197 | svi_cas_identify, |
| r1432 | r1433 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | static const UINT8 SORDM5_CAS_HEADER[6] = { 'S', 'O', 'R', 'D', 'M', '5'}; |
| 18 | 18 | |
| 19 | const struct CassetteModulation sordm5_cas_modulation = | |
| 19 | static const struct CassetteModulation sordm5_cas_modulation = | |
| 20 | 20 | { |
| 21 | 21 | CASSETTE_MODULATION_SINEWAVE, |
| 22 | 22 | 1575.0 - 300, 1575.0, 1575.0 + 300, |
| 23 | 23 | 1575.5 + 300, 3150.0, 3150.0 + 600 |
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | UINT8 cassette_image_read_uint8( cassette_image *cassette, UINT64 offset) | |
| 26 | static UINT8 cassette_image_read_uint8( cassette_image *cassette, UINT64 offset) | |
| 27 | 27 | { |
| 28 | 28 | UINT8 data; |
| 29 | 29 | cassette_image_read( cassette, &data, offset, 1); |
| r1432 | r1433 | |
| 126 | 126 | return CASSETTE_ERROR_SUCCESS; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | struct CassetteFormat sordm5_cas_format = | |
| 129 | static struct CassetteFormat sordm5_cas_format = | |
| 130 | 130 | { |
| 131 | 131 | "cas", |
| 132 | 132 | sordm5_tap_identify, |
| r1432 | r1433 | |
|---|---|---|
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | |
| 137 | struct CassetteFormat lviv_lvt_image_format = | |
| 137 | static struct CassetteFormat lviv_lvt_image_format = | |
| 138 | 138 | { |
| 139 | 139 | "lvt", |
| 140 | 140 | lviv_lvt_identify, |
| r1432 | r1433 | |
|---|---|---|
| 472 | 472 | |
| 473 | 473 | |
| 474 | 474 | |
| 475 | void thom_floppy_fd_save ( mess_image* image ) | |
| 475 | static void thom_floppy_fd_save ( mess_image* image ) | |
| 476 | 476 | { |
| 477 | 477 | thom_floppy_drive* d = thom_floppy_drives + image_index_in_device( image ); |
| 478 | 478 | unsigned size = d->sides * d->tracks * d->sectors * d->sector_size; |
| r1432 | r1433 | |
| 552 | 552 | |
| 553 | 553 | |
| 554 | 554 | |
| 555 | void thom_floppy_qd_save ( mess_image* image ) | |
| 555 | static void thom_floppy_qd_save ( mess_image* image ) | |
| 556 | 556 | { |
| 557 | 557 | thom_floppy_drive* d = thom_floppy_drives + image_index_in_device( image ); |
| 558 | 558 | unsigned size = d->sides * d->tracks * d->sectors * d->sector_size; |
| r1432 | r1433 | |
|---|---|---|
| 235 | 235 | return cassette_legacy_construct(cassette, &primo_legacy_fill_wave); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | struct CassetteFormat primo_ptp_image_format = | |
| 238 | static struct CassetteFormat primo_ptp_image_format = | |
| 239 | 239 | { |
| 240 | 240 | "ptp", |
| 241 | 241 | primo_ptp_identify, |
| r1432 | r1433 | |
|---|---|---|
| 106 | 106 | return cassette_legacy_construct(cassette, &pmd85_legacy_fill_wave); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | struct CassetteFormat pmd85_pmd_image_format = | |
| 109 | static struct CassetteFormat pmd85_pmd_image_format = | |
| 110 | 110 | { |
| 111 | 111 | "pmd", |
| 112 | 112 | pmd85_pmd_identify, |
| r1432 | r1433 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | /* ZX-81 functions */ |
| 130 | 130 | |
| 131 | UINT8 zx81_chars[]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*00h-07h*/ | |
| 131 | static UINT8 zx81_chars[]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*00h-07h*/ | |
| 132 | 132 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*08h-0fh*/ |
| 133 | 133 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*10h-17h*/ |
| 134 | 134 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*18h-1fh*/ |
| r1432 | r1433 | |
| 211 | 211 | return cassette_legacy_construct(cassette, &zx81_legacy_fill_wave); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | struct CassetteFormat zx81_p_image_format = | |
| 214 | static struct CassetteFormat zx81_p_image_format = | |
| 215 | 215 | { |
| 216 | 216 | "p,81", |
| 217 | 217 | zx81_p_identify, |
| r1432 | r1433 | |
| 274 | 274 | return cassette_legacy_construct(cassette, &zx80_legacy_fill_wave); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | struct CassetteFormat zx80_o_image_format = | |
| 277 | static struct CassetteFormat zx80_o_image_format = | |
| 278 | 278 | { |
| 279 | 279 | "o,80", |
| 280 | 280 | zx80_o_identify, |
| r1432 | r1433 | |
|---|---|---|
| 516 | 516 | |
| 517 | 517 | |
| 518 | 518 | |
| 519 | struct CassetteFormat oric_tap_format = | |
| 519 | static struct CassetteFormat oric_tap_format = | |
| 520 | 520 | { |
| 521 | 521 | "tap", |
| 522 | 522 | oric_tap_identify, |
| r1432 | r1433 | |
|---|---|---|
| 153 | 153 | return cassette_legacy_construct( cassette, &a26_legacy_fill_wave ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | struct CassetteFormat a26_cassette_format = { | |
| 156 | static struct CassetteFormat a26_cassette_format = { | |
| 157 | 157 | "a26", |
| 158 | 158 | a26_cassette_identify, |
| 159 | 159 | a26_cassette_load, |
| r1432 | r1433 | |
|---|---|---|
| 942 | 942 | |
| 943 | 943 | |
| 944 | 944 | |
| 945 | casserr_t mo5_wav_identify ( cassette_image *cass, | |
| 945 | static casserr_t mo5_wav_identify ( cassette_image *cass, | |
| 946 | 946 | struct CassetteOptions *opts ) |
| 947 | 947 | { |
| 948 | 948 | casserr_t e = wavfile_format.identify( cass, opts ); |
| r1432 | r1433 | |
| 951 | 951 | |
| 952 | 952 | |
| 953 | 953 | |
| 954 | casserr_t mo5_wav_load ( cassette_image *cass ) | |
| 954 | static casserr_t mo5_wav_load ( cassette_image *cass ) | |
| 955 | 955 | { |
| 956 | 956 | casserr_t e = wavfile_format.load( cass ); |
| 957 | 957 | struct CassetteInfo info; |
| r1432 | r1433 | |
| 967 | 967 | |
| 968 | 968 | |
| 969 | 969 | |
| 970 | casserr_t mo5_wav_save ( cassette_image *cass, const struct CassetteInfo *info ) | |
| 970 | static casserr_t mo5_wav_save ( cassette_image *cass, const struct CassetteInfo *info ) | |
| 971 | 971 | { |
| 972 | 972 | int len = info->sample_count / info->sample_frequency; |
| 973 | 973 | PRINT (( "mo5_wav_save: saving cassette, length %imn %is, %i Hz, %i bps\n", len / 60, len % 60, info->sample_frequency, info->bits_per_sample )); |
| r1432 | r1433 | |
|---|---|---|
| 215 | 215 | |
| 216 | 216 | /* System Configuration */ |
| 217 | 217 | |
| 218 | QUICKLOAD_LOAD( vip ) | |
| 218 | static QUICKLOAD_LOAD( vip ) | |
| 219 | 219 | { |
| 220 | 220 | int size = image_length(image); |
| 221 | 221 |
| r1432 | r1433 | |
|---|---|---|
| 224 | 224 | // memory_set_bankptr(1,mem+0x00000); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | UINT32 amask= 0xffff; | |
| 227 | static UINT32 amask= 0xffff; | |
| 228 | 228 | |
| 229 | 229 | |
| 230 | 230 | static MACHINE_DRIVER_START( comquest ) |
| r1432 | r1433 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | /* Memory Maps */ |
| 34 | 34 | |
| 35 | ADDRESS_MAP_START( zx80_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 35 | static ADDRESS_MAP_START( zx80_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 36 | 36 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 37 | 37 | AM_RANGE(0x8000, 0xffff) AM_NOP |
| 38 | 38 | ADDRESS_MAP_END |
| 39 | 39 | |
| 40 | ADDRESS_MAP_START( zx81_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 40 | static ADDRESS_MAP_START( zx81_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 41 | 41 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 42 | 42 | AM_RANGE(0x8000, 0xffff) AM_NOP |
| 43 | 43 | ADDRESS_MAP_END |
| 44 | 44 | |
| 45 | ADDRESS_MAP_START( pc8300_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 45 | static ADDRESS_MAP_START( pc8300_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 46 | 46 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 47 | 47 | AM_RANGE(0x4000, 0x7fff) AM_RAM // PC8300 comes with 16K RAM |
| 48 | 48 | AM_RANGE(0x8000, 0xffff) AM_NOP |
| r1432 | r1433 | |
|---|---|---|
| 64 | 64 | |
| 65 | 65 | */ |
| 66 | 66 | |
| 67 | unsigned char dgnbeta_palette[] = | |
| 67 | static unsigned char dgnbeta_palette[] = | |
| 68 | 68 | { |
| 69 | 69 | /*normal brightness */ |
| 70 | 70 | 0x00,0x00,0x00, /* black */ |
| r1432 | r1433 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | #include "drivers/cps1.c" |
| 26 | 26 | |
| 27 | #ifdef UNUSED_FUNCTION | |
| 27 | 28 | void wof_decode(void) { } |
| 28 | 29 | void dino_decode(void) { } |
| 29 | 30 | void punisher_decode(void) { } |
| 30 | 31 | void slammast_decode(void) { } |
| 32 | #endif | |
| 31 | 33 | |
| 32 | 34 | /*************************************************************************** |
| 33 | 35 |
| r1432 | r1433 | |
|---|---|---|
| 440 | 440 | jaguar_dsp_cpu_int |
| 441 | 441 | }; |
| 442 | 442 | |
| 443 | MACHINE_DRIVER_START( jaguar ) | |
| 443 | static MACHINE_DRIVER_START( jaguar ) | |
| 444 | 444 | |
| 445 | 445 | /* basic machine hardware */ |
| 446 | 446 | MDRV_CPU_ADD(M68EC020, 13295000) |
| r1432 | r1433 | |
|---|---|---|
| 106 | 106 | #define X2_CLOCK_NTSC 49090000 |
| 107 | 107 | #define X601_CLOCK 16934400 |
| 108 | 108 | |
| 109 | UINT32 *dram; | |
| 110 | UINT32 *vram; | |
| 109 | static UINT32 *dram; | |
| 110 | static UINT32 *vram; | |
| 111 | 111 | |
| 112 | 112 | static ADDRESS_MAP_START( 3do_mem, ADDRESS_SPACE_PROGRAM, 32) |
| 113 | 113 | AM_RANGE(0x00000000, 0x001FFFFF) AM_RAMBANK(1) AM_BASE(&dram) /* DRAM */ |
| r1432 | r1433 | |
| 123 | 123 | static INPUT_PORTS_START( 3do ) |
| 124 | 124 | INPUT_PORTS_END |
| 125 | 125 | |
| 126 | MACHINE_RESET( 3do ) | |
| 126 | static MACHINE_RESET( 3do ) | |
| 127 | 127 | { |
| 128 | 128 | memory_set_bankptr(2,memory_region(REGION_USER1)); |
| 129 | 129 |
| r1432 | r1433 | |
|---|---|---|
| 70 | 70 | #include "mslegacy.h" |
| 71 | 71 | |
| 72 | 72 | /* I/O ports */ |
| 73 | ADDRESS_MAP_START( dai_io , ADDRESS_SPACE_IO, 8) | |
| 73 | static ADDRESS_MAP_START( dai_io , ADDRESS_SPACE_IO, 8) | |
| 74 | 74 | ADDRESS_MAP_END |
| 75 | 75 | |
| 76 | 76 | /* memory w/r functions */ |
| 77 | ADDRESS_MAP_START( dai_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 77 | static ADDRESS_MAP_START( dai_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 78 | 78 | AM_RANGE( 0x0000, 0xbfff) AM_RAMBANK(1) |
| 79 | 79 | AM_RANGE( 0xc000, 0xdfff) AM_ROM |
| 80 | 80 | AM_RANGE( 0xe000, 0xefff) AM_ROMBANK(2) |
| r1432 | r1433 | |
|---|---|---|
| 417 | 417 | /*C64_DIPS */ |
| 418 | 418 | INPUT_PORTS_END |
| 419 | 419 | |
| 420 | unsigned char cbm700_palette[] = | |
| 420 | static unsigned char cbm700_palette[] = | |
| 421 | 421 | { |
| 422 | 422 | 0,0,0, /* black */ |
| 423 | 423 | 0,0x80,0, /* green */ |
| r1432 | r1433 | |
|---|---|---|
| 55 | 55 | |
| 56 | 56 | static unsigned char fd5_databus; |
| 57 | 57 | |
| 58 | ADDRESS_MAP_START( sord_fd5_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 58 | static ADDRESS_MAP_START( sord_fd5_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 59 | 59 | AM_RANGE(0x0000, 0x03fff) AM_ROM /* internal rom */ |
| 60 | 60 | AM_RANGE(0x4000, 0x0ffff) AM_RAM |
| 61 | 61 | ADDRESS_MAP_END |
| r1432 | r1433 | |
| 150 | 150 | /* 0x030 fd5 reads from this port to communicate with m5 */ |
| 151 | 151 | /* 0x040 */ |
| 152 | 152 | /* 0x050 */ |
| 153 | ADDRESS_MAP_START( readport_sord_fd5 , ADDRESS_SPACE_IO, 8) | |
| 153 | static ADDRESS_MAP_START( readport_sord_fd5 , ADDRESS_SPACE_IO, 8) | |
| 154 | 154 | AM_RANGE( 0x000, 0x000) AM_READ( nec765_status_r) |
| 155 | 155 | AM_RANGE( 0x001, 0x001) AM_READ( nec765_data_r) |
| 156 | 156 | AM_RANGE( 0x010, 0x010) AM_READ( fd5_data_r) |
| 157 | 157 | AM_RANGE( 0x030, 0x030) AM_READ( fd5_communication_r) |
| 158 | 158 | ADDRESS_MAP_END |
| 159 | 159 | |
| 160 | ADDRESS_MAP_START( writeport_sord_fd5 , ADDRESS_SPACE_IO, 8) | |
| 160 | static ADDRESS_MAP_START( writeport_sord_fd5 , ADDRESS_SPACE_IO, 8) | |
| 161 | 161 | AM_RANGE( 0x001, 0x001) AM_WRITE( nec765_data_w) |
| 162 | 162 | AM_RANGE( 0x010, 0x010) AM_WRITE( fd5_data_w) |
| 163 | 163 | AM_RANGE( 0x020, 0x020) AM_WRITE( fd5_communication_w) |
| r1432 | r1433 | |
| 337 | 337 | return readinputport(offset); |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | ADDRESS_MAP_START( sord_m5_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 340 | static ADDRESS_MAP_START( sord_m5_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 341 | 341 | AM_RANGE(0x0000, 0x01fff) AM_ROM /* internal rom */ |
| 342 | 342 | AM_RANGE(0x2000, 0x06fff) AM_ROMBANK(1) |
| 343 | 343 | AM_RANGE(0x7000, 0x0ffff) AM_RAM |
| r1432 | r1433 | |
| 429 | 429 | centronics_write_data(0,data); |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | ADDRESS_MAP_START( sord_m5_io , ADDRESS_SPACE_IO, 8) | |
| 432 | static ADDRESS_MAP_START( sord_m5_io , ADDRESS_SPACE_IO, 8) | |
| 433 | 433 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 434 | 434 | AM_RANGE(0x00, 0x0f) AM_READWRITE(sord_ctc_r, sord_ctc_w) |
| 435 | 435 | AM_RANGE(0x10, 0x10) AM_MIRROR(0x0e) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w) |
| r1432 | r1433 | |
| 440 | 440 | AM_RANGE(0x50, 0x50) AM_READWRITE(sord_sys_r, sord_sys_w) |
| 441 | 441 | ADDRESS_MAP_END |
| 442 | 442 | |
| 443 | ADDRESS_MAP_START( srdm5fd5_io , ADDRESS_SPACE_IO, 8) | |
| 443 | static ADDRESS_MAP_START( srdm5fd5_io , ADDRESS_SPACE_IO, 8) | |
| 444 | 444 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 445 | 445 | AM_RANGE(0x00, 0x0f) AM_READWRITE(sord_ctc_r, sord_ctc_w) |
| 446 | 446 | AM_RANGE(0x10, 0x10) AM_MIRROR(0x0e) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w) |
| r1432 | r1433 | |
|---|---|---|
| 222 | 222 | PORT_BIT ( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Change Disk Side") |
| 223 | 223 | INPUT_PORTS_END |
| 224 | 224 | |
| 225 | #ifdef UNUSED_FUNCTION | |
| 225 | 226 | /* This layout is not changed at runtime */ |
| 226 | 227 | gfx_layout nes_vram_charlayout = |
| 227 | 228 | { |
| r1432 | r1433 | |
| 233 | 234 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 234 | 235 | 16*8 /* every char takes 16 consecutive bytes */ |
| 235 | 236 | }; |
| 237 | #endif | |
| 236 | 238 | |
| 237 | 239 | static struct NESinterface nes_interface = |
| 238 | 240 | { |
| r1432 | r1433 | |
|---|---|---|
| 448 | 448 | static UINT16 cgb_cpu_regs[6] = { 0x11B0, 0x0013, 0x00D8, 0x014D, 0xFFFE, 0x0100 }; /* GameBoy Color / Gameboy Advance */ |
| 449 | 449 | static UINT16 megaduck_cpu_regs[6] = { 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFE, 0x0000 }; /* Megaduck */ |
| 450 | 450 | |
| 451 | Z80GB_CONFIG dmg_cpu_reset = { NULL, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 452 | Z80GB_CONFIG sgb_cpu_reset = { sgb_cpu_regs, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 453 | Z80GB_CONFIG mgb_cpu_reset = { mgb_cpu_regs, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 454 | Z80GB_CONFIG cgb_cpu_reset = { cgb_cpu_regs, 0, gb_timer_callback }; | |
| 455 | Z80GB_CONFIG megaduck_cpu_reset = { megaduck_cpu_regs, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 451 | static Z80GB_CONFIG dmg_cpu_reset = { NULL, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 452 | static Z80GB_CONFIG sgb_cpu_reset = { sgb_cpu_regs, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 453 | static Z80GB_CONFIG mgb_cpu_reset = { mgb_cpu_regs, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 454 | static Z80GB_CONFIG cgb_cpu_reset = { cgb_cpu_regs, 0, gb_timer_callback }; | |
| 455 | static Z80GB_CONFIG megaduck_cpu_reset = { megaduck_cpu_regs, Z80GB_FEATURE_HALT_BUG, gb_timer_callback }; | |
| 456 | 456 | |
| 457 | 457 | static ADDRESS_MAP_START(gb_map, ADDRESS_SPACE_PROGRAM, 8) |
| 458 | 458 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| r1432 | r1433 | |
|---|---|---|
| 109 | 109 | #include "machine/intelfsh.h" |
| 110 | 110 | |
| 111 | 111 | // interrupt counter |
| 112 | unsigned long pcw16_interrupt_counter; | |
| 112 | static unsigned long pcw16_interrupt_counter; | |
| 113 | 113 | // video control |
| 114 | 114 | extern int pcw16_video_control; |
| 115 | 115 | /* controls which bank of 2mb address space is paged into memory */ |
| r1432 | r1433 | |
| 527 | 527 | |
| 528 | 528 | /* PCW16 KEYBOARD */ |
| 529 | 529 | |
| 530 | unsigned char pcw16_keyboard_status; | |
| 531 | unsigned char pcw16_keyboard_data_shift; | |
| 530 | //unsigned char pcw16_keyboard_status; | |
| 531 | static unsigned char pcw16_keyboard_data_shift; | |
| 532 | 532 | |
| 533 | 533 | |
| 534 | 534 |
| r1432 | r1433 | |
|---|---|---|
| 40 | 40 | irq_flag, |
| 41 | 41 | lcd_invert, |
| 42 | 42 | key_selector; |
| 43 | ||
| 43 | static UINT8 board_value; | |
| 44 | 44 | static UINT16 beeper; |
| 45 | 45 | |
| 46 | 46 | |
| r1432 | r1433 | |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | |
| 103 | BOARD_FIELD m_board[8][8]; | |
| 103 | static BOARD_FIELD m_board[8][8]; | |
| 104 | 104 | |
| 105 | BOARD_FIELD start_board[8][8] = | |
| 105 | static BOARD_FIELD start_board[8][8] = | |
| 106 | 106 | { |
| 107 | 107 | { { 7,44,434,"WR1"}, { 6,100,434,"WN1"}, { 5,156,434,"WB1"}, { 4,212,434,"WQ1"}, { 3,268,434,"WK"}, { 2,324,434,"WB2"}, { 1,380,434,"WN2"}, { 0,436,434,"WR2"} }, |
| 108 | 108 | { {15,44,378,"WP1"}, {14,100,378,"WP2"}, {13,156,378,"WP3"}, {12,212,378,"WP4"}, {11,268,378,"WP5"}, {10,324,378,"WP6"}, { 9,380,378,"WP7"}, { 8,436,378,"WP8"} }, |
| r1432 | r1433 | |
|---|---|---|
| 2047 | 2047 | ROM_LOAD ("70fdkfn.rom", 0x30000, 0x20000, CRC(c9651b32) SHA1(84a645becec0a25d3ab7a909cde1b242699a8662)) |
| 2048 | 2048 | ROM_END |
| 2049 | 2049 | |
| 2050 | #ifdef UNUSED_FUNCTION | |
| 2050 | 2051 | MSX_LAYOUT_INIT (phc70fd) |
| 2051 | 2052 | MSX_LAYOUT_SLOT (0, 0, 0, 2, ROM, 0x8000, 0x0000) |
| 2052 | 2053 | MSX_LAYOUT_SLOT (1, 0, 0, 4, CARTRIDGE1, 0x0000, 0x0000) |
| r1432 | r1433 | |
| 2060 | 2061 | MSX_LAYOUT_KANJI (0x30000) |
| 2061 | 2062 | MSX_LAYOUT_RAMIO_SET_BITS (0x80) |
| 2062 | 2063 | MSX_LAYOUT_END |
| 2064 | #endif | |
| 2063 | 2065 | |
| 2064 | 2066 | ROM_START (phc70fd2) |
| 2065 | 2067 | ROM_REGION (0x70000, REGION_CPU1,0) |
| r1432 | r1433 | |
|---|---|---|
| 36 | 36 | static GFXDECODE_START( gamecom_gfxdecodeinfo ) |
| 37 | 37 | GFXDECODE_END |
| 38 | 38 | |
| 39 | SM8500_CONFIG gamecom_cpu_config = { | |
| 39 | static SM8500_CONFIG gamecom_cpu_config = { | |
| 40 | 40 | gamecom_handle_dma, |
| 41 | 41 | gamecom_update_timers |
| 42 | 42 | }; |
| r1432 | r1433 | |
|---|---|---|
| 396 | 396 | |
| 397 | 397 | /* System Configuration */ |
| 398 | 398 | |
| 399 | QUICKLOAD_LOAD( tmc600 ) | |
| 399 | static QUICKLOAD_LOAD( tmc600 ) | |
| 400 | 400 | { |
| 401 | 401 | image_fread(image, memory_region(REGION_CPU1) + 0x6300, 0x9500); |
| 402 | 402 |
| r1432 | r1433 | |
|---|---|---|
| 79 | 79 | #define LOG(N,M,A) |
| 80 | 80 | #endif |
| 81 | 81 | |
| 82 | ADDRESS_MAP_START( mz700_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 82 | static ADDRESS_MAP_START( mz700_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 83 | 83 | AM_RANGE( 0x00000, 0x00fff) AM_RAMBANK(1) |
| 84 | 84 | AM_RANGE( 0x01000, 0x0cfff) AM_RAM |
| 85 | 85 | AM_RANGE( 0x0d000, 0x0d7ff) AM_RAMBANK(6) |
| r1432 | r1433 | |
| 93 | 93 | #endif |
| 94 | 94 | ADDRESS_MAP_END |
| 95 | 95 | |
| 96 | ADDRESS_MAP_START(mz700_io, ADDRESS_SPACE_IO, 8) | |
| 96 | static ADDRESS_MAP_START(mz700_io, ADDRESS_SPACE_IO, 8) | |
| 97 | 97 | AM_RANGE(0xe0, 0xe6) AM_WRITE( mz700_bank_w ) |
| 98 | 98 | ADDRESS_MAP_END |
| 99 | 99 | |
| 100 | ADDRESS_MAP_START(mz800_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 100 | static ADDRESS_MAP_START(mz800_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 101 | 101 | AM_RANGE( 0x00000, 0x00fff) AM_RAMBANK(1) |
| 102 | 102 | AM_RANGE( 0x01000, 0x01fff) AM_RAMBANK(2) |
| 103 | 103 | AM_RANGE( 0x02000, 0x07fff) AM_RAM |
| r1432 | r1433 | |
| 115 | 115 | #endif |
| 116 | 116 | ADDRESS_MAP_END |
| 117 | 117 | |
| 118 | ADDRESS_MAP_START(mz800_io, ADDRESS_SPACE_IO, 8) | |
| 118 | static ADDRESS_MAP_START(mz800_io, ADDRESS_SPACE_IO, 8) | |
| 119 | 119 | AM_RANGE( 0xcc, 0xcc) AM_WRITE( mz800_write_format_w ) |
| 120 | 120 | AM_RANGE( 0xcd, 0xcd) AM_WRITE( mz800_read_format_w ) |
| 121 | 121 | AM_RANGE( 0xce, 0xce) AM_READWRITE( mz800_crtc_r, mz800_display_mode_w ) |
| r1432 | r1433 | |
|---|---|---|
| 16 | 16 | #include "devices/cartslot.h" |
| 17 | 17 | #include "sound/ay8910.h" |
| 18 | 18 | |
| 19 | ADDRESS_MAP_START( vectrex_map , ADDRESS_SPACE_PROGRAM, 8) | |
| 19 | static ADDRESS_MAP_START( vectrex_map , ADDRESS_SPACE_PROGRAM, 8) | |
| 20 | 20 | AM_RANGE( 0x0000, 0x7fff) AM_ROM |
| 21 | 21 | AM_RANGE( 0xc800, 0xcbff) AM_RAM AM_MIRROR( 0x0400 ) AM_BASE(&vectrex_ram_base) AM_SIZE(&vectrex_ram_size) |
| 22 | 22 | AM_RANGE( 0xd000, 0xd7ff) AM_READWRITE( via_0_r, via_0_w ) |
| r1432 | r1433 | |
| 183 | 183 | |
| 184 | 184 | *****************************************************************/ |
| 185 | 185 | |
| 186 | ADDRESS_MAP_START( raaspec_map , ADDRESS_SPACE_PROGRAM, 8) | |
| 186 | static ADDRESS_MAP_START( raaspec_map , ADDRESS_SPACE_PROGRAM, 8) | |
| 187 | 187 | AM_RANGE( 0x0000, 0x7fff) AM_ROM |
| 188 | 188 | AM_RANGE( 0x8000, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| 189 | 189 | AM_RANGE( 0xa000, 0xa000) AM_WRITE( raaspec_led_w ) |
| r1432 | r1433 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | tm990_189_palette_size = 3 |
| 69 | 69 | }; |
| 70 | unsigned char tm990_189_palette[tm990_189_palette_size*3] = | |
| 70 | static unsigned char tm990_189_palette[tm990_189_palette_size*3] = | |
| 71 | 71 | { |
| 72 | 72 | 0x00,0x00,0x00, /* black */ |
| 73 | 73 | 0xFF,0x00,0x00 /* red for LEDs */ |
| r1432 | r1433 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | /* pointers to memory locations */ |
| 24 | 24 | UINT8 *sym1_monitor; |
| 25 | UINT8 *sym1_ram_1k; | |
| 26 | UINT8 *sym1_ram_2k; | |
| 27 | UINT8 *sym1_ram_3k; | |
| 28 | UINT8 *sym1_riot_ram; | |
| 25 | static UINT8 *sym1_ram_1k; | |
| 26 | static UINT8 *sym1_ram_2k; | |
| 27 | static UINT8 *sym1_ram_3k; | |
| 28 | static UINT8 *sym1_riot_ram; | |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 |
| r1432 | r1433 | |
|---|---|---|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | struct CustomSound_interface lynx_sound_interface = | |
| 205 | static struct CustomSound_interface lynx_sound_interface = | |
| 206 | 206 | { |
| 207 | 207 | lynx_custom_start |
| 208 | 208 | }; |
| 209 | 209 | |
| 210 | struct CustomSound_interface lynx2_sound_interface = | |
| 210 | static struct CustomSound_interface lynx2_sound_interface = | |
| 211 | 211 | { |
| 212 | 212 | lynx2_custom_start |
| 213 | 213 | }; |
| r1432 | r1433 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | /* port i/o functions */ |
| 36 | 36 | |
| 37 | ADDRESS_MAP_START( aquarius_io , ADDRESS_SPACE_IO, 8) | |
| 37 | static ADDRESS_MAP_START( aquarius_io , ADDRESS_SPACE_IO, 8) | |
| 38 | 38 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 39 | 39 | AM_RANGE(0xfc, 0xfc) AM_WRITE( aquarius_port_fc_w) |
| 40 | 40 | AM_RANGE(0xfe, 0xfe) AM_READWRITE( aquarius_port_fe_r, aquarius_port_fe_w) |
| r1432 | r1433 | |
| 43 | 43 | |
| 44 | 44 | /* Memory w/r functions */ |
| 45 | 45 | |
| 46 | ADDRESS_MAP_START( aquarius_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 46 | static ADDRESS_MAP_START( aquarius_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 47 | 47 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 48 | 48 | AM_RANGE(0x2000, 0x2fff) AM_NOP |
| 49 | 49 | AM_RANGE(0x3000, 0x37ff) AM_READWRITE(videoram_r, aquarius_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| r1432 | r1433 | |
|---|---|---|
| 243 | 243 | PORT_BIT(0x80, 0x00, IPT_UNKNOWN) PORT_NAME("Joy 2 [*]") PORT_CODE(JOYCODE_BUTTON1) |
| 244 | 244 | INPUT_PORTS_END |
| 245 | 245 | |
| 246 | gfx_layout cgenie_charlayout = | |
| 246 | static gfx_layout cgenie_charlayout = | |
| 247 | 247 | { |
| 248 | 248 | 8,8, /* 8*8 characters */ |
| 249 | 249 | 384, /* 256 fixed + 128 defineable characters */ |
| r1432 | r1433 | |
|---|---|---|
| 179 | 179 | |
| 180 | 180 | /* I/O ports */ |
| 181 | 181 | |
| 182 | ADDRESS_MAP_START( pmd85_readport , ADDRESS_SPACE_IO, 8) | |
| 182 | static ADDRESS_MAP_START( pmd85_readport , ADDRESS_SPACE_IO, 8) | |
| 183 | 183 | AM_RANGE( 0x00, 0xff) AM_READ( pmd85_io_r ) |
| 184 | 184 | ADDRESS_MAP_END |
| 185 | 185 | |
| 186 | ADDRESS_MAP_START( pmd85_writeport , ADDRESS_SPACE_IO, 8) | |
| 186 | static ADDRESS_MAP_START( pmd85_writeport , ADDRESS_SPACE_IO, 8) | |
| 187 | 187 | AM_RANGE( 0x00, 0xff) AM_WRITE( pmd85_io_w ) |
| 188 | 188 | ADDRESS_MAP_END |
| 189 | 189 | |
| 190 | ADDRESS_MAP_START( mato_readport , ADDRESS_SPACE_IO, 8) | |
| 190 | static ADDRESS_MAP_START( mato_readport , ADDRESS_SPACE_IO, 8) | |
| 191 | 191 | AM_RANGE( 0x00, 0xff) AM_READ( mato_io_r ) |
| 192 | 192 | ADDRESS_MAP_END |
| 193 | 193 | |
| 194 | ADDRESS_MAP_START( mato_writeport , ADDRESS_SPACE_IO, 8) | |
| 194 | static ADDRESS_MAP_START( mato_writeport , ADDRESS_SPACE_IO, 8) | |
| 195 | 195 | AM_RANGE( 0x00, 0xff) AM_WRITE( mato_io_w ) |
| 196 | 196 | ADDRESS_MAP_END |
| 197 | 197 | |
| 198 | 198 | /* memory w/r functions */ |
| 199 | 199 | |
| 200 | ADDRESS_MAP_START( pmd85_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 200 | static ADDRESS_MAP_START( pmd85_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 201 | 201 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK1) |
| 202 | 202 | AM_RANGE(0x1000, 0x1fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK2) |
| 203 | 203 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE(MRA8_BANK3, MWA8_BANK3) |
| r1432 | r1433 | |
| 210 | 210 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(MRA8_BANK8, MWA8_BANK8) |
| 211 | 211 | ADDRESS_MAP_END |
| 212 | 212 | |
| 213 | ADDRESS_MAP_START( pmd852a_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 213 | static ADDRESS_MAP_START( pmd852a_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 214 | 214 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK1) |
| 215 | 215 | AM_RANGE(0x1000, 0x1fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK2) |
| 216 | 216 | AM_RANGE(0x2000, 0x2fff) AM_READWRITE(MRA8_BANK3, MWA8_BANK3) |
| r1432 | r1433 | |
| 223 | 223 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(MRA8_BANK10, MWA8_BANK10) |
| 224 | 224 | ADDRESS_MAP_END |
| 225 | 225 | |
| 226 | ADDRESS_MAP_START( pmd853_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 226 | static ADDRESS_MAP_START( pmd853_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 227 | 227 | AM_RANGE(0x0000, 0x1fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK9) |
| 228 | 228 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK10) |
| 229 | 229 | AM_RANGE(0x4000, 0x5fff) AM_READWRITE(MRA8_BANK3, MWA8_BANK11) |
| r1432 | r1433 | |
| 234 | 234 | AM_RANGE(0xe000, 0xffff) AM_READWRITE(MRA8_BANK8, MWA8_BANK16) |
| 235 | 235 | ADDRESS_MAP_END |
| 236 | 236 | |
| 237 | ADDRESS_MAP_START( alfa_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 237 | static ADDRESS_MAP_START( alfa_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 238 | 238 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK1) |
| 239 | 239 | AM_RANGE(0x1000, 0x33ff) AM_READWRITE(MRA8_BANK2, MWA8_BANK2) |
| 240 | 240 | AM_RANGE(0x3400, 0x3fff) AM_READWRITE(MRA8_BANK3, MWA8_BANK3) |
| r1432 | r1433 | |
| 245 | 245 | AM_RANGE(0xc000, 0xffff) AM_READWRITE(MRA8_BANK7, MWA8_BANK7) |
| 246 | 246 | ADDRESS_MAP_END |
| 247 | 247 | |
| 248 | ADDRESS_MAP_START( mato_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 248 | static ADDRESS_MAP_START( mato_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 249 | 249 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK1) |
| 250 | 250 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK2) |
| 251 | 251 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK3, MWA8_ROM) |
| r1432 | r1433 | |
|---|---|---|
| 395 | 395 | |
| 396 | 396 | /* Interrupt Generators */ |
| 397 | 397 | |
| 398 | INTERRUPT_GEN( abc80_nmi_interrupt ) | |
| 398 | static INTERRUPT_GEN( abc80_nmi_interrupt ) | |
| 399 | 399 | { |
| 400 | 400 | cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE); |
| 401 | 401 | } |
| r1432 | r1433 | |
|---|---|---|
| 38 | 38 | int writable; |
| 39 | 39 | } cylinder; |
| 40 | 40 | |
| 41 | cylinder apexc_cylinder; | |
| 41 | static cylinder apexc_cylinder; | |
| 42 | 42 | |
| 43 | 43 | /* |
| 44 | 44 | Open cylinder image and read RAM |
| r1432 | r1433 | |
| 146 | 146 | mess_image *fd; |
| 147 | 147 | } tape; |
| 148 | 148 | |
| 149 | tape apexc_tapes[2]; | |
| 149 | static tape apexc_tapes[2]; | |
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 |
| r1432 | r1433 | |
|---|---|---|
| 144 | 144 | |
| 145 | 145 | extern UINT16* gvram; // Graphic VRAM |
| 146 | 146 | extern UINT16* tvram; // Text VRAM |
| 147 | UINT16* sram; // SRAM | |
| 147 | static UINT16* sram; // SRAM | |
| 148 | 148 | extern UINT16* x68k_spriteram; // sprite/background RAM |
| 149 | 149 | extern UINT16* x68k_spritereg; // sprite/background registers |
| 150 | UINT8 ppi_port[3]; | |
| 151 | int current_vector[8]; | |
| 152 | UINT8 current_irq_line; | |
| 153 | unsigned int x68k_scanline; | |
| 150 | static UINT8 ppi_port[3]; | |
| 151 | static int current_vector[8]; | |
| 152 | static UINT8 current_irq_line; | |
| 153 | static unsigned int x68k_scanline; | |
| 154 | 154 | |
| 155 | UINT8 mfp_key; | |
| 155 | static UINT8 mfp_key; | |
| 156 | 156 | |
| 157 | 157 | extern mame_bitmap* x68k_text_bitmap; // 1024x1024 4x1bpp planes text |
| 158 | 158 | extern mame_bitmap* x68k_gfx_0_bitmap_16; // 16 colour, 512x512, 4 pages |
| r1432 | r1433 | |
| 168 | 168 | extern tilemap* x68k_bg0_16; // two 64x64 tilemaps, 16x16 characters |
| 169 | 169 | extern tilemap* x68k_bg1_16; |
| 170 | 170 | |
| 171 | emu_timer* kb_timer; | |
| 171 | static emu_timer* kb_timer; | |
| 172 | 172 | //emu_timer* mfp_timer[4]; |
| 173 | 173 | //emu_timer* mfp_irq; |
| 174 | 174 | emu_timer* scanline_timer; |
| 175 | 175 | emu_timer* raster_irq; |
| 176 | 176 | emu_timer* vblank_irq; |
| 177 | emu_timer* mouse_timer; // to set off the mouse interrupts via the SCC | |
| 177 | static emu_timer* mouse_timer; // to set off the mouse interrupts via the SCC | |
| 178 | 178 | |
| 179 | 179 | // MFP is clocked at 4MHz, so at /4 prescaler the timer is triggered after 1us (4 cycles) |
| 180 | 180 | // No longer necessary with the new MFP core |
| r1432 | r1433 | |
| 195 | 195 | } |
| 196 | 196 | }*/ |
| 197 | 197 | |
| 198 | void mfp_init(void); | |
| 198 | static void mfp_init(void); | |
| 199 | 199 | //static TIMER_CALLBACK(mfp_update_irq); |
| 200 | 200 | |
| 201 | void mfp_init() | |
| 201 | static void mfp_init() | |
| 202 | 202 | { |
| 203 | 203 | sys.mfp.tadr = sys.mfp.tbdr = sys.mfp.tcdr = sys.mfp.tddr = 0xff; |
| 204 | 204 | |
| r1432 | r1433 | |
| 343 | 343 | */ |
| 344 | 344 | |
| 345 | 345 | // 4 channel DMA controller (Hitachi HD63450) |
| 346 | WRITE16_HANDLER( x68k_dmac_w ) | |
| 346 | static WRITE16_HANDLER( x68k_dmac_w ) | |
| 347 | 347 | { |
| 348 | 348 | hd63450_w(offset, data, mem_mask); |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | READ16_HANDLER( x68k_dmac_r ) | |
| 351 | static READ16_HANDLER( x68k_dmac_r ) | |
| 352 | 352 | { |
| 353 | 353 | return hd63450_r(offset, mem_mask); |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | void x68k_keyboard_ctrl_w(int data) | |
| 356 | static void x68k_keyboard_ctrl_w(int data) | |
| 357 | 357 | { |
| 358 | 358 | /* Keyboard control commands: |
| 359 | 359 | 00xxxxxx - TV Control |
| r1432 | r1433 | |
| 418 | 418 | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | #ifdef UNUSED_FUNCTION | |
| 421 | 422 | int x68k_keyboard_pop_scancode(void) |
| 422 | 423 | { |
| 423 | 424 | int ret; |
| r1432 | r1433 | |
| 432 | 433 | logerror("MFP: Keyboard buffer pop 0x%02x\n",ret); |
| 433 | 434 | return ret; |
| 434 | 435 | } |
| 436 | #endif | |
| 435 | 437 | |
| 436 | void x68k_keyboard_push_scancode(unsigned char code) | |
| 438 | static void x68k_keyboard_push_scancode(unsigned char code) | |
| 437 | 439 | { |
| 438 | 440 | sys.keyboard.keynum++; |
| 439 | 441 | if(sys.keyboard.keynum >= 1) |
| r1432 | r1433 | |
| 501 | 503 | } |
| 502 | 504 | |
| 503 | 505 | |
| 506 | #ifdef UNUSED_FUNCTION | |
| 504 | 507 | void mfp_recv_data(int data) |
| 505 | 508 | { |
| 506 | 509 | sys.mfp.rsr |= 0x80; // Buffer full |
| r1432 | r1433 | |
| 510 | 513 | // mfp_trigger_irq(MFP_IRQ_RX_FULL); |
| 511 | 514 | // logerror("MFP: Receive buffer full IRQ sent\n"); |
| 512 | 515 | } |
| 516 | #endif | |
| 513 | 517 | |
| 514 | 518 | // mouse input |
| 515 | 519 | // port B of the Z8530 SCC |
| 516 | 520 | // typically read from the SCC data port on receive buffer full interrupt per byte |
| 517 | int x68k_read_mouse(void) | |
| 521 | static int x68k_read_mouse(void) | |
| 518 | 522 | { |
| 519 | 523 | char val = 0; |
| 520 | 524 | char ipt = 0; |
| r1432 | r1433 | |
| 554 | 558 | 0xe98005 - Z8530 command port A |
| 555 | 559 | 0xe98007 - Z8530 data port A (RS232) |
| 556 | 560 | */ |
| 557 | READ16_HANDLER( x68k_scc_r ) | |
| 561 | static READ16_HANDLER( x68k_scc_r ) | |
| 558 | 562 | { |
| 559 | 563 | offset %= 4; |
| 560 | 564 | switch(offset) |
| r1432 | r1433 | |
| 572 | 576 | } |
| 573 | 577 | } |
| 574 | 578 | |
| 575 | WRITE16_HANDLER( x68k_scc_w ) | |
| 579 | static WRITE16_HANDLER( x68k_scc_w ) | |
| 576 | 580 | { |
| 577 | 581 | static unsigned char prev; |
| 578 | 582 | offset %= 4; |
| r1432 | r1433 | |
| 630 | 634 | } |
| 631 | 635 | |
| 632 | 636 | // Judging from the XM6 source code, PPI ports A and B are joystick inputs |
| 633 | READ8_HANDLER( ppi_port_a_r ) | |
| 637 | static READ8_HANDLER( ppi_port_a_r ) | |
| 634 | 638 | { |
| 635 | 639 | // Joystick 1 |
| 636 | 640 | if(sys.joy.joy1_enable == 0) |
| r1432 | r1433 | |
| 639 | 643 | return 0xff; |
| 640 | 644 | } |
| 641 | 645 | |
| 642 | READ8_HANDLER( ppi_port_b_r ) | |
| 646 | static READ8_HANDLER( ppi_port_b_r ) | |
| 643 | 647 | { |
| 644 | 648 | // Joystick 2 |
| 645 | 649 | if(sys.joy.joy2_enable == 0) |
| r1432 | r1433 | |
| 648 | 652 | return 0xff; |
| 649 | 653 | } |
| 650 | 654 | |
| 651 | READ8_HANDLER( ppi_port_c_r ) | |
| 655 | static READ8_HANDLER( ppi_port_c_r ) | |
| 652 | 656 | { |
| 653 | 657 | return ppi_port[2]; |
| 654 | 658 | } |
| 655 | 659 | |
| 660 | #ifdef UNUSED_FUNCTION | |
| 656 | 661 | WRITE8_HANDLER( ppi_port_a_w ) |
| 657 | 662 | { |
| 658 | 663 | ppi_port[0] = data; |
| r1432 | r1433 | |
| 662 | 667 | { |
| 663 | 668 | ppi_port[1] = data; |
| 664 | 669 | } |
| 670 | #endif | |
| 665 | 671 | |
| 666 | WRITE8_HANDLER( ppi_port_c_w ) | |
| 672 | static WRITE8_HANDLER( ppi_port_c_w ) | |
| 667 | 673 | { |
| 668 | 674 | // ADPCM / Joystick control |
| 669 | 675 | ppi_port[2] = data; |
| r1432 | r1433 | |
| 678 | 684 | |
| 679 | 685 | |
| 680 | 686 | // NEC uPD72065 at 0xe94000 |
| 681 | WRITE16_HANDLER( x68k_fdc_w ) | |
| 687 | static WRITE16_HANDLER( x68k_fdc_w ) | |
| 682 | 688 | { |
| 683 | 689 | unsigned int drive, x; |
| 684 | 690 | switch(offset) |
| r1432 | r1433 | |
| 721 | 727 | } |
| 722 | 728 | } |
| 723 | 729 | |
| 724 | READ16_HANDLER( x68k_fdc_r ) | |
| 730 | static READ16_HANDLER( x68k_fdc_r ) | |
| 725 | 731 | { |
| 726 | 732 | unsigned int ret; |
| 727 | 733 | int x; |
| r1432 | r1433 | |
| 757 | 763 | } |
| 758 | 764 | } |
| 759 | 765 | |
| 760 | void fdc_irq(int state) | |
| 766 | static void fdc_irq(int state) | |
| 761 | 767 | { |
| 762 | 768 | if((sys.ioc.irqstatus & 0x04) && state == ASSERT_LINE) |
| 763 | 769 | { |
| r1432 | r1433 | |
| 769 | 775 | } |
| 770 | 776 | } |
| 771 | 777 | |
| 772 | int x68k_fdc_read_byte(int addr) | |
| 778 | static int x68k_fdc_read_byte(int addr) | |
| 773 | 779 | { |
| 774 | 780 | int data = -1; |
| 775 | 781 | |
| r1432 | r1433 | |
| 779 | 785 | return data; |
| 780 | 786 | } |
| 781 | 787 | |
| 782 | void x68k_fdc_write_byte(int addr, int data) | |
| 788 | static void x68k_fdc_write_byte(int addr, int data) | |
| 783 | 789 | { |
| 784 | 790 | nec765_dack_w(0,data); |
| 785 | 791 | } |
| 786 | 792 | |
| 787 | void fdc_drq(int state, int read_write) | |
| 793 | static void fdc_drq(int state, int read_write) | |
| 788 | 794 | { |
| 789 | 795 | sys.fdc.drq_state = state; |
| 790 | 796 | } |
| 791 | 797 | |
| 792 | WRITE16_HANDLER( x68k_hdc_w ) | |
| 798 | static WRITE16_HANDLER( x68k_hdc_w ) | |
| 793 | 799 | { |
| 794 | 800 | // SASI HDC - HDDs are not a required system component, so this is something to be done later |
| 795 | 801 | logerror("SASI: write to HDC, offset %04x, data %04x\n",offset,data); |
| 796 | 802 | } |
| 797 | 803 | |
| 798 | READ16_HANDLER( x68k_hdc_r ) | |
| 804 | static READ16_HANDLER( x68k_hdc_r ) | |
| 799 | 805 | { |
| 800 | 806 | logerror("SASI: [%08x] read from HDC, offset %04x\n",activecpu_get_pc(),offset); |
| 801 | 807 | switch(offset) |
| r1432 | r1433 | |
| 807 | 813 | } |
| 808 | 814 | } |
| 809 | 815 | |
| 810 | WRITE16_HANDLER( x68k_fm_w ) | |
| 816 | static WRITE16_HANDLER( x68k_fm_w ) | |
| 811 | 817 | { |
| 812 | 818 | switch(offset) |
| 813 | 819 | { |
| r1432 | r1433 | |
| 822 | 828 | } |
| 823 | 829 | } |
| 824 | 830 | |
| 825 | READ16_HANDLER( x68k_fm_r ) | |
| 831 | static READ16_HANDLER( x68k_fm_r ) | |
| 826 | 832 | { |
| 827 | 833 | if(offset == 0x01) |
| 828 | 834 | return YM2151_status_port_0_r(0); |
| r1432 | r1433 | |
| 830 | 836 | return 0xff; |
| 831 | 837 | } |
| 832 | 838 | |
| 833 | WRITE8_HANDLER( x68k_ct_w ) | |
| 839 | static WRITE8_HANDLER( x68k_ct_w ) | |
| 834 | 840 | { |
| 835 | 841 | // CT1 and CT2 bits from YM2151 port 0x1b |
| 836 | 842 | // CT1 - ADPCM clock - 0 = 8MHz, 1 = 4MHz |
| r1432 | r1433 | |
| 839 | 845 | } |
| 840 | 846 | |
| 841 | 847 | |
| 842 | WRITE16_HANDLER( x68k_ioc_w ) | |
| 848 | static WRITE16_HANDLER( x68k_ioc_w ) | |
| 843 | 849 | { |
| 844 | 850 | switch(offset) |
| 845 | 851 | { |
| r1432 | r1433 | |
| 871 | 877 | } |
| 872 | 878 | } |
| 873 | 879 | |
| 874 | READ16_HANDLER( x68k_ioc_r ) | |
| 880 | static READ16_HANDLER( x68k_ioc_r ) | |
| 875 | 881 | { |
| 876 | 882 | switch(offset) |
| 877 | 883 | { |
| r1432 | r1433 | |
| 883 | 889 | } |
| 884 | 890 | } |
| 885 | 891 | |
| 886 | WRITE16_HANDLER( x68k_sysport_w ) | |
| 892 | static WRITE16_HANDLER( x68k_sysport_w ) | |
| 887 | 893 | { |
| 888 | 894 | render_container* container; |
| 889 | 895 | switch(offset) |
| r1432 | r1433 | |
| 908 | 914 | } |
| 909 | 915 | } |
| 910 | 916 | |
| 911 | READ16_HANDLER( x68k_sysport_r ) | |
| 917 | static READ16_HANDLER( x68k_sysport_r ) | |
| 912 | 918 | { |
| 913 | 919 | int ret = 0; |
| 914 | 920 | switch(offset) |
| r1432 | r1433 | |
| 991 | 997 | } |
| 992 | 998 | } |
| 993 | 999 | */ |
| 994 | WRITE16_HANDLER( x68k_mfp_w ) | |
| 1000 | static WRITE16_HANDLER( x68k_mfp_w ) | |
| 995 | 1001 | { |
| 996 | 1002 | /* For the Interrupt registers, the bits are set out as such: |
| 997 | 1003 | Reg A - bit 7: GPIP7 (HSync) |
| r1432 | r1433 | |
| 1119 | 1125 | } |
| 1120 | 1126 | |
| 1121 | 1127 | |
| 1122 | WRITE16_HANDLER( x68k_ppi_w ) | |
| 1128 | static WRITE16_HANDLER( x68k_ppi_w ) | |
| 1123 | 1129 | { |
| 1124 | 1130 | ppi8255_w(0,offset & 0x03,data); |
| 1125 | 1131 | } |
| 1126 | 1132 | |
| 1127 | READ16_HANDLER( x68k_ppi_r ) | |
| 1133 | static READ16_HANDLER( x68k_ppi_r ) | |
| 1128 | 1134 | { |
| 1129 | 1135 | return ppi8255_r(0,offset & 0x03); |
| 1130 | 1136 | } |
| 1131 | 1137 | |
| 1132 | READ16_HANDLER( x68k_rtc_r ) | |
| 1138 | static READ16_HANDLER( x68k_rtc_r ) | |
| 1133 | 1139 | { |
| 1134 | 1140 | return rp5c15_r(offset,mem_mask); |
| 1135 | 1141 | } |
| 1136 | 1142 | |
| 1137 | WRITE16_HANDLER( x68k_rtc_w ) | |
| 1143 | static WRITE16_HANDLER( x68k_rtc_w ) | |
| 1138 | 1144 | { |
| 1139 | 1145 | rp5c15_w(offset,data,mem_mask); |
| 1140 | 1146 | } |
| 1141 | 1147 | |
| 1142 | void x68k_rtc_alarm_irq(int state) | |
| 1148 | static void x68k_rtc_alarm_irq(int state) | |
| 1143 | 1149 | { |
| 1144 | 1150 | if(sys.mfp.aer & 0x01) |
| 1145 | 1151 | { |
| r1432 | r1433 | |
| 1156 | 1162 | } |
| 1157 | 1163 | |
| 1158 | 1164 | |
| 1159 | WRITE16_HANDLER( x68k_sram_w ) | |
| 1165 | static WRITE16_HANDLER( x68k_sram_w ) | |
| 1160 | 1166 | { |
| 1161 | 1167 | if(sys.sysport.sram_writeprotect == 0x31) |
| 1162 | 1168 | { |
| r1432 | r1433 | |
| 1164 | 1170 | } |
| 1165 | 1171 | } |
| 1166 | 1172 | |
| 1167 | READ16_HANDLER( x68k_sram_r ) | |
| 1173 | static READ16_HANDLER( x68k_sram_r ) | |
| 1168 | 1174 | { |
| 1169 | 1175 | // HACKS! |
| 1170 | 1176 | if(offset == 0x5a/2) // 0x5a should be 0 if no SASI HDs are present. |
| r1432 | r1433 | |
| 1180 | 1186 | return generic_nvram16[offset]; |
| 1181 | 1187 | } |
| 1182 | 1188 | |
| 1183 | WRITE16_HANDLER( x68k_vid_w ) | |
| 1189 | static WRITE16_HANDLER( x68k_vid_w ) | |
| 1184 | 1190 | { |
| 1185 | 1191 | int val; |
| 1186 | 1192 | if(offset < 0x100) |
| r1432 | r1433 | |
| 1222 | 1228 | } |
| 1223 | 1229 | } |
| 1224 | 1230 | |
| 1225 | READ16_HANDLER( x68k_vid_r ) | |
| 1231 | static READ16_HANDLER( x68k_vid_r ) | |
| 1226 | 1232 | { |
| 1227 | 1233 | if(offset < 0x100) |
| 1228 | 1234 | return sys.video.gfx_pal[offset]; |
| r1432 | r1433 | |
| 1245 | 1251 | return 0xff; |
| 1246 | 1252 | } |
| 1247 | 1253 | |
| 1248 | READ16_HANDLER( x68k_adpcm_r ) | |
| 1254 | static READ16_HANDLER( x68k_adpcm_r ) | |
| 1249 | 1255 | { |
| 1250 | 1256 | return 0x0000; |
| 1251 | 1257 | } |
| 1252 | 1258 | |
| 1253 | WRITE16_HANDLER( x68k_adpcm_w ) | |
| 1259 | static WRITE16_HANDLER( x68k_adpcm_w ) | |
| 1254 | 1260 | { |
| 1255 | 1261 | } |
| 1256 | 1262 | |
| 1257 | READ16_HANDLER( x68k_areaset_r ) | |
| 1263 | static READ16_HANDLER( x68k_areaset_r ) | |
| 1258 | 1264 | { |
| 1259 | 1265 | // register is write-only |
| 1260 | 1266 | return 0xffff; |
| 1261 | 1267 | } |
| 1262 | 1268 | |
| 1263 | WRITE16_HANDLER( x68k_areaset_w ) | |
| 1269 | static WRITE16_HANDLER( x68k_areaset_w ) | |
| 1264 | 1270 | { |
| 1265 | 1271 | // TODO |
| 1266 | 1272 | logerror("SYS: Supervisor area set: 0x%02x\n",data & 0xff); |
| 1267 | 1273 | } |
| 1268 | 1274 | |
| 1269 | WRITE16_HANDLER( x68k_enh_areaset_w ) | |
| 1275 | static WRITE16_HANDLER( x68k_enh_areaset_w ) | |
| 1270 | 1276 | { |
| 1271 | 1277 | // TODO |
| 1272 | 1278 | logerror("SYS: Enhanced Supervisor area set (from %iMB): 0x%02x\n",(offset + 1) * 2,data & 0xff); |
| r1432 | r1433 | |
| 1300 | 1306 | } |
| 1301 | 1307 | } |
| 1302 | 1308 | |
| 1303 | READ16_HANDLER( x68k_rom0_r ) | |
| 1309 | static READ16_HANDLER( x68k_rom0_r ) | |
| 1304 | 1310 | { |
| 1305 | 1311 | /* this location contains the address of some expansion device ROM, if no ROM exists, |
| 1306 | 1312 | then access causes a bus error */ |
| r1432 | r1433 | |
| 1310 | 1316 | return 0xff; |
| 1311 | 1317 | } |
| 1312 | 1318 | |
| 1313 | WRITE16_HANDLER( x68k_rom0_w ) | |
| 1319 | static WRITE16_HANDLER( x68k_rom0_w ) | |
| 1314 | 1320 | { |
| 1315 | 1321 | /* this location contains the address of some expansion device ROM, if no ROM exists, |
| 1316 | 1322 | then access causes a bus error */ |
| r1432 | r1433 | |
| 1319 | 1325 | cpunum_set_input_line_and_vector(0,2,ASSERT_LINE,current_vector[2]); |
| 1320 | 1326 | } |
| 1321 | 1327 | |
| 1322 | READ16_HANDLER( x68k_exp_r ) | |
| 1328 | static READ16_HANDLER( x68k_exp_r ) | |
| 1323 | 1329 | { |
| 1324 | 1330 | /* These are expansion devices, if not present, they cause a bus error */ |
| 1325 | 1331 | if(readinputportbytag("options") & 0x02) |
| r1432 | r1433 | |
| 1335 | 1341 | return 0xffff; |
| 1336 | 1342 | } |
| 1337 | 1343 | |
| 1338 | WRITE16_HANDLER( x68k_exp_w ) | |
| 1344 | static WRITE16_HANDLER( x68k_exp_w ) | |
| 1339 | 1345 | { |
| 1340 | 1346 | /* These are expansion devices, if not present, they cause a bus error */ |
| 1341 | 1347 | if(readinputportbytag("options") & 0x02) |
| r1432 | r1433 | |
| 1350 | 1356 | } |
| 1351 | 1357 | } |
| 1352 | 1358 | |
| 1353 | void x68k_dma_irq(int channel) | |
| 1359 | static void x68k_dma_irq(int channel) | |
| 1354 | 1360 | { |
| 1355 | 1361 | current_vector[3] = hd63450_get_vector(channel); |
| 1356 | 1362 | current_irq_line = 3; |
| r1432 | r1433 | |
| 1358 | 1364 | cpunum_set_input_line_and_vector(0,3,ASSERT_LINE,current_vector[3]); |
| 1359 | 1365 | } |
| 1360 | 1366 | |
| 1361 | void x68k_dma_end(int channel,int irq) | |
| 1367 | static void x68k_dma_end(int channel,int irq) | |
| 1362 | 1368 | { |
| 1363 | 1369 | if(irq != 0) |
| 1364 | 1370 | { |
| r1432 | r1433 | |
| 1366 | 1372 | } |
| 1367 | 1373 | } |
| 1368 | 1374 | |
| 1369 | void x68k_dma_error(int channel, int irq) | |
| 1375 | static void x68k_dma_error(int channel, int irq) | |
| 1370 | 1376 | { |
| 1371 | 1377 | if(irq != 0) |
| 1372 | 1378 | { |
| r1432 | r1433 | |
| 1376 | 1382 | } |
| 1377 | 1383 | } |
| 1378 | 1384 | |
| 1379 | void x68k_fm_irq(int irq) | |
| 1385 | static void x68k_fm_irq(int irq) | |
| 1380 | 1386 | { |
| 1381 | 1387 | if(irq == CLEAR_LINE) |
| 1382 | 1388 | { |
| r1432 | r1433 | |
| 1389 | 1395 | |
| 1390 | 1396 | } |
| 1391 | 1397 | |
| 1392 | READ8_HANDLER(mfp_gpio_r) | |
| 1398 | static READ8_HANDLER(mfp_gpio_r) | |
| 1393 | 1399 | { |
| 1394 | 1400 | UINT8 data = sys.mfp.gpio; |
| 1395 | 1401 | |
| r1432 | r1433 | |
| 1401 | 1407 | return data; |
| 1402 | 1408 | } |
| 1403 | 1409 | |
| 1404 | void mfp_irq_callback(int which, int state) | |
| 1410 | static void mfp_irq_callback(int which, int state) | |
| 1405 | 1411 | { |
| 1406 | 1412 | static int prev; |
| 1407 | 1413 | if(prev == CLEAR_LINE && state == CLEAR_LINE) // eliminate unnecessary calls to set the IRQ line for speed reasons |
| r1432 | r1433 | |
| 1725 | 1731 | |
| 1726 | 1732 | INPUT_PORTS_END |
| 1727 | 1733 | |
| 1728 | void dimdsk_set_geometry(mess_image* image) | |
| 1734 | static void dimdsk_set_geometry(mess_image* image) | |
| 1729 | 1735 | { |
| 1730 | 1736 | // DIM disk image header, most of this is guesswork |
| 1731 | 1737 | int tracks = 77; |
| r1432 | r1433 | |
| 1785 | 1791 | basicdsk_set_geometry(image, tracks+1, heads, sectors, sectorlen, firstsector, 0x100, FALSE); |
| 1786 | 1792 | } |
| 1787 | 1793 | |
| 1788 | DEVICE_LOAD( x68k_floppy ) | |
| 1794 | static DEVICE_LOAD( x68k_floppy ) | |
| 1789 | 1795 | { |
| 1790 | 1796 | if (device_load_basicdsk_floppy(image)==INIT_PASS) |
| 1791 | 1797 | { |
| r1432 | r1433 | |
| 1810 | 1816 | return INIT_FAIL; |
| 1811 | 1817 | } |
| 1812 | 1818 | |
| 1813 | DEVICE_UNLOAD( x68k_floppy ) | |
| 1819 | static DEVICE_UNLOAD( x68k_floppy ) | |
| 1814 | 1820 | { |
| 1815 | 1821 | if(sys.ioc.irqstatus & 0x02) |
| 1816 | 1822 | { |
| r1432 | r1433 | |
| 1844 | 1850 | } |
| 1845 | 1851 | } |
| 1846 | 1852 | |
| 1847 | MACHINE_RESET( x68000 ) | |
| 1853 | static MACHINE_RESET( x68000 ) | |
| 1848 | 1854 | { |
| 1849 | 1855 | /* The last half of the IPLROM is mapped to 0x000000 on reset only |
| 1850 | 1856 | Just copying the inital stack pointer and program counter should |
| r1432 | r1433 | |
| 1897 | 1903 | sys.mfp.gpio = 0xfb; |
| 1898 | 1904 | } |
| 1899 | 1905 | |
| 1900 | MACHINE_START( x68000 ) | |
| 1906 | static MACHINE_START( x68000 ) | |
| 1901 | 1907 | { |
| 1902 | 1908 | /* Install RAM handlers */ |
| 1903 | 1909 | x68k_spriteram = (UINT16*)memory_region(REGION_USER1); |
| r1432 | r1433 | |
| 1922 | 1928 | sys.mouse.inputtype = 0; |
| 1923 | 1929 | } |
| 1924 | 1930 | |
| 1925 | DRIVER_INIT( x68000 ) | |
| 1931 | static DRIVER_INIT( x68000 ) | |
| 1926 | 1932 | { |
| 1927 | 1933 | unsigned char* rom = memory_region(REGION_CPU1); |
| 1928 | 1934 | unsigned char* user2 = memory_region(REGION_USER2); |
| r1432 | r1433 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | |
| 143 | VIDEO_UPDATE( mpf1 ) | |
| 143 | static VIDEO_UPDATE( mpf1 ) | |
| 144 | 144 | { |
| 145 | 145 | int x; |
| 146 | 146 | static UINT8 xpositions[] = { 20, 59, 97, 135, 185, 223 }; |
| r1432 | r1433 | |
|---|---|---|
| 49 | 49 | astrocade_sound1_w(offset + 0x18, data); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | ADDRESS_MAP_START( astrocade_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 52 | static ADDRESS_MAP_START( astrocade_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 53 | 53 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(MRA8_ROM, astrocade_magicram_w) |
| 54 | 54 | AM_RANGE(0x1000, 0x3fff) AM_ROM /* Star Fortress writes in here?? */ |
| 55 | 55 | AM_RANGE(0x4000, 0x4fff) AM_READWRITE(MRA8_RAM, astrocade_videoram_w) AM_BASE(&astrocade_videoram) AM_SIZE(&videoram_size) /* ASG */ |
| 56 | 56 | ADDRESS_MAP_END |
| 57 | 57 | |
| 58 | ADDRESS_MAP_START( astrocade_io, ADDRESS_SPACE_IO, 8 ) | |
| 58 | static ADDRESS_MAP_START( astrocade_io, ADDRESS_SPACE_IO, 8 ) | |
| 59 | 59 | AM_RANGE(0x00, 0x07) AM_MIRROR(0xff00) AM_WRITE(astrocade_colour_register_w) |
| 60 | 60 | AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) AM_READWRITE(astrocade_intercept_r, astrocade_mode_w) |
| 61 | 61 | AM_RANGE(0x09, 0x09) AM_MIRROR(0xff00) AM_WRITE(astrocade_colour_split_w) |
| r1432 | r1433 | |
|---|---|---|
| 18 | 18 | AM_RANGE( 0x0000, 0xffff) AM_RAM |
| 19 | 19 | ADDRESS_MAP_END |
| 20 | 20 | |
| 21 | ADDRESS_MAP_START( kaypro_io , ADDRESS_SPACE_IO, 8) | |
| 21 | static ADDRESS_MAP_START( kaypro_io , ADDRESS_SPACE_IO, 8) | |
| 22 | 22 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 23 | 23 | AM_RANGE( BIOS_CONST, BIOS_CONST) AM_READWRITE( kaypro_const_r, kaypro_const_w ) |
| 24 | 24 | AM_RANGE( BIOS_CONIN, BIOS_CONIN) AM_READWRITE( kaypro_conin_r, kaypro_conin_w ) |
| r1432 | r1433 | |
|---|---|---|
| 74 | 74 | signal_rcp_interrupt(VI_INTERRUPT); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | MACHINE_RESET( n64 ) | |
| 77 | static MACHINE_RESET( n64 ) | |
| 78 | 78 | { |
| 79 | 79 | n64_machine_reset(); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | MACHINE_DRIVER_START( n64 ) | |
| 82 | static MACHINE_DRIVER_START( n64 ) | |
| 83 | 83 | /* basic machine hardware */ |
| 84 | 84 | MDRV_CPU_ADD(R4600BE, 93750000) |
| 85 | 85 | MDRV_CPU_CONFIG(config) |
| r1432 | r1433 | |
| 112 | 112 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0) |
| 113 | 113 | MACHINE_DRIVER_END |
| 114 | 114 | |
| 115 | #ifdef UNUSED_FUNCTION | |
| 115 | 116 | DRIVER_INIT( n64 ) |
| 116 | 117 | { |
| 117 | 118 | } |
| 119 | #endif | |
| 118 | 120 | |
| 119 | 121 | ROM_START( n64) |
| 120 | 122 | ROM_REGION( 0x800000, REGION_CPU1, 0 ) /* dummy region for R4300 */ |
| r1432 | r1433 | |
|---|---|---|
| 790 | 790 | } |
| 791 | 791 | } |
| 792 | 792 | |
| 793 | DEVICE_LOAD( sf7000_floppy ) | |
| 793 | static DEVICE_LOAD( sf7000_floppy ) | |
| 794 | 794 | { |
| 795 | 795 | if (image_has_been_created(image)) |
| 796 | 796 | return INIT_FAIL; |
| r1432 | r1433 | |
| 821 | 821 | } |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | DEVICE_LOAD( sf7000_serial ) | |
| 824 | static DEVICE_LOAD( sf7000_serial ) | |
| 825 | 825 | { |
| 826 | 826 | /* filename specified */ |
| 827 | 827 | if (serial_device_load(image)==INIT_PASS) |
| r1432 | r1433 | |
|---|---|---|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | |
| 311 | tx0_reset_param_t tx0_reset_param = | |
| 311 | static tx0_reset_param_t tx0_reset_param = | |
| 312 | 312 | { |
| 313 | 313 | { |
| 314 | 314 | tx0_io_cpy, |
| r1432 | r1433 | |
|---|---|---|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | UINT8 nRTC_Regs[0x80]; | |
| 79 | UINT8 nRTC_UserRAM[0x200]; | |
| 80 | UINT8 nRTC_RAM[0x800]; | |
| 78 | static UINT8 nRTC_Regs[0x80]; | |
| 79 | static UINT8 nRTC_UserRAM[0x200]; | |
| 80 | static UINT8 nRTC_RAM[0x800]; | |
| 81 | 81 | |
| 82 | 82 | static UINT32 nHPC_SCSI0Descriptor, nHPC_SCSI0DMACtrl; |
| 83 | 83 | |
| r1432 | r1433 | |
| 385 | 385 | } |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | UINT32 nHPC3_enetr_nbdp; | |
| 389 | UINT32 nHPC3_enetr_cbp; | |
| 390 | UINT32 nHPC3_hd0_register; | |
| 391 | UINT32 nHPC3_hd0_regs[0x20]; | |
| 392 | UINT32 nHPC3_hd1_regs[0x20]; | |
| 388 | static UINT32 nHPC3_enetr_nbdp; | |
| 389 | static UINT32 nHPC3_enetr_cbp; | |
| 390 | //UINT32 nHPC3_hd0_register; | |
| 391 | //UINT32 nHPC3_hd0_regs[0x20]; | |
| 392 | //UINT32 nHPC3_hd1_regs[0x20]; | |
| 393 | 393 | |
| 394 | 394 | static READ32_HANDLER( hpc3_hd_enet_r ) |
| 395 | 395 | { |
| r1432 | r1433 | |
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | UINT32 nHPC3_unk0; | |
| 511 | UINT32 nHPC3_unk1; | |
| 512 | UINT32 nHPC3_IC_Unk0; | |
| 510 | static UINT32 nHPC3_unk0; | |
| 511 | static UINT32 nHPC3_unk1; | |
| 512 | static UINT32 nHPC3_IC_Unk0; | |
| 513 | 513 | |
| 514 | 514 | static READ32_HANDLER( hpc3_pbus4_r ) |
| 515 | 515 | { |
| r1432 | r1433 | |
| 933 | 933 | COMBINE_DATA(&ip22_mainram[offset]); |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | UINT32 nHAL2_IAR; | |
| 937 | UINT32 nHAL2_IDR[4]; | |
| 936 | static UINT32 nHAL2_IAR; | |
| 937 | static UINT32 nHAL2_IDR[4]; | |
| 938 | 938 | |
| 939 | 939 | #define H2_IAR_TYPE 0xf000 |
| 940 | 940 | #define H2_IAR_NUM 0x0f00 |
| r1432 | r1433 | |
| 1097 | 1097 | #define PBUS_DMADESC_TXD 0x00008000 |
| 1098 | 1098 | #define PBUS_DMADESC_BC 0x00003fff |
| 1099 | 1099 | |
| 1100 | UINT8 nPBUS_DMA_Active; | |
| 1101 | UINT32 nPBUS_DMA_CurPtr; | |
| 1102 | UINT32 nPBUS_DMA_DescPtr; | |
| 1103 | UINT32 nPBUS_DMA_NextPtr; | |
| 1104 | UINT32 nPBUS_DMA_WordsLeft; | |
| 1100 | static UINT8 nPBUS_DMA_Active; | |
| 1101 | static UINT32 nPBUS_DMA_CurPtr; | |
| 1102 | static UINT32 nPBUS_DMA_DescPtr; | |
| 1103 | static UINT32 nPBUS_DMA_NextPtr; | |
| 1104 | static UINT32 nPBUS_DMA_WordsLeft; | |
| 1105 | 1105 | |
| 1106 | 1106 | static TIMER_CALLBACK(ip22_dma) |
| 1107 | 1107 | { |
| r1432 | r1433 | |
| 1227 | 1227 | AM_RANGE( 0x20000000, 0x27ffffff ) AM_RAM AM_SHARE(1) AM_WRITE(ip22_write_ram) |
| 1228 | 1228 | ADDRESS_MAP_END |
| 1229 | 1229 | |
| 1230 | UINT32 nIntCounter; | |
| 1230 | static UINT32 nIntCounter; | |
| 1231 | 1231 | |
| 1232 | 1232 | // mc_update wants once every millisecond (1/1000th of a second) |
| 1233 | 1233 | static TIMER_CALLBACK(ip22_timer) |
| r1432 | r1433 | |
| 1570 | 1570 | } |
| 1571 | 1571 | #endif |
| 1572 | 1572 | |
| 1573 | MACHINE_DRIVER_START( ip225015 ) | |
| 1573 | static MACHINE_DRIVER_START( ip225015 ) | |
| 1574 | 1574 | MDRV_CPU_ADD_TAG( "main", R5000BE, 50000000*3 ) |
| 1575 | 1575 | MDRV_CPU_CONFIG( config ) |
| 1576 | 1576 | MDRV_CPU_PROGRAM_MAP( ip225015_map, 0 ) |
| r1432 | r1433 | |
| 1599 | 1599 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1600 | 1600 | MACHINE_DRIVER_END |
| 1601 | 1601 | |
| 1602 | MACHINE_DRIVER_START( ip224613 ) | |
| 1602 | static MACHINE_DRIVER_START( ip224613 ) | |
| 1603 | 1603 | MDRV_IMPORT_FROM( ip225015 ) |
| 1604 | 1604 | MDRV_CPU_REPLACE( "main", R4600BE, 133333333 ) |
| 1605 | 1605 | MACHINE_DRIVER_END |
| 1606 | 1606 | |
| 1607 | MACHINE_DRIVER_START( ip244415 ) | |
| 1607 | static MACHINE_DRIVER_START( ip244415 ) | |
| 1608 | 1608 | MDRV_IMPORT_FROM( ip225015 ) |
| 1609 | 1609 | MDRV_CPU_REPLACE( "main", R4600BE, 150000000 ) |
| 1610 | 1610 | MACHINE_DRIVER_END |
| r1432 | r1433 | |
|---|---|---|
| 292 | 292 | |
| 293 | 293 | /* I/O ports */ |
| 294 | 294 | |
| 295 | ADDRESS_MAP_START( lviv_readport , ADDRESS_SPACE_IO, 8) | |
| 295 | static ADDRESS_MAP_START( lviv_readport , ADDRESS_SPACE_IO, 8) | |
| 296 | 296 | AM_RANGE( 0x00, 0xff) AM_READ( lviv_io_r ) |
| 297 | 297 | ADDRESS_MAP_END |
| 298 | 298 | |
| 299 | ADDRESS_MAP_START( lviv_writeport , ADDRESS_SPACE_IO, 8) | |
| 299 | static ADDRESS_MAP_START( lviv_writeport , ADDRESS_SPACE_IO, 8) | |
| 300 | 300 | AM_RANGE( 0x00, 0xff) AM_WRITE( lviv_io_w ) |
| 301 | 301 | ADDRESS_MAP_END |
| 302 | 302 | |
| 303 | 303 | /* memory w/r functions */ |
| 304 | 304 | |
| 305 | ADDRESS_MAP_START( lviv_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 305 | static ADDRESS_MAP_START( lviv_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 306 | 306 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK1) |
| 307 | 307 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK2) |
| 308 | 308 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK3, MWA8_BANK3) |
| r1432 | r1433 | |
|---|---|---|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
| 356 | ADDRESS_MAP_START( exidy_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 356 | static ADDRESS_MAP_START( exidy_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 357 | 357 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| 358 | 358 | AM_RANGE(0x0000, 0x7fff) AM_RAM /* ram 32k machine */ |
| 359 | 359 | AM_RANGE(0xbc00, 0xbcff) AM_ROM |
| r1432 | r1433 | |
| 365 | 365 | AM_RANGE(0xfc00, 0xffff) AM_RAM /* programmable chars */ |
| 366 | 366 | ADDRESS_MAP_END |
| 367 | 367 | |
| 368 | ADDRESS_MAP_START( exidyd_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 368 | static ADDRESS_MAP_START( exidyd_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 369 | 369 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| 370 | 370 | AM_RANGE(0x0000, 0xbfff) AM_RAM /* ram 48k diskless machine */ |
| 371 | 371 | AM_RANGE(0xc000, 0xefff) AM_ROM /* rom pac */ |
| r1432 | r1433 | |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | |
| 654 | ADDRESS_MAP_START( exidy_io , ADDRESS_SPACE_IO, 8) | |
| 654 | static ADDRESS_MAP_START( exidy_io , ADDRESS_SPACE_IO, 8) | |
| 655 | 655 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 656 | 656 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| 657 | 657 | AM_RANGE(0xfc, 0xfc) AM_READWRITE( exidy_fc_port_r, exidy_fc_port_w ) |
| r1432 | r1433 | |
|---|---|---|
| 373 | 373 | INPUT_PORTS_END |
| 374 | 374 | |
| 375 | 375 | |
| 376 | ADDRESS_MAP_START( pc8801_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 376 | static ADDRESS_MAP_START( pc8801_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 377 | 377 | AM_RANGE(0x0000, 0x5fff) AM_RAMBANK(1) |
| 378 | 378 | AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(2) |
| 379 | 379 | AM_RANGE(0x8000, 0x83ff) AM_RAMBANK(3) |
| r1432 | r1433 | |
| 382 | 382 | AM_RANGE(0xf000, 0xffff) AM_RAMBANK(6) |
| 383 | 383 | ADDRESS_MAP_END |
| 384 | 384 | |
| 385 | ADDRESS_MAP_START( pc88sr_io, ADDRESS_SPACE_IO, 8) | |
| 385 | static ADDRESS_MAP_START( pc88sr_io, ADDRESS_SPACE_IO, 8) | |
| 386 | 386 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 387 | 387 | ADDRESS_MAP_FLAGS( AMEF_UNMAP(1) ) |
| 388 | 388 | AM_RANGE(0x00, 0x00) AM_READ( input_port_0_r ) /* keyboard */ |
| r1432 | r1433 | |
| 447 | 447 | { |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | ADDRESS_MAP_START( pc8801fd_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 450 | static ADDRESS_MAP_START( pc8801fd_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 451 | 451 | AM_RANGE( 0x0000, 0x07ff) AM_ROM |
| 452 | 452 | AM_RANGE( 0x4000, 0x7fff) AM_RAM |
| 453 | 453 | ADDRESS_MAP_END |
| 454 | 454 | |
| 455 | ADDRESS_MAP_START( pc8801fd_io , ADDRESS_SPACE_IO, 8) | |
| 455 | static ADDRESS_MAP_START( pc8801fd_io , ADDRESS_SPACE_IO, 8) | |
| 456 | 456 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 457 | 457 | AM_RANGE(0xf8, 0xf8) AM_READ( pc8801fd_nec765_tc ) |
| 458 | 458 | AM_RANGE(0xfa, 0xfa) AM_READ( nec765_status_r ) |
| r1432 | r1433 | |
|---|---|---|
| 471 | 471 | PORT_DIPSETTING( 1, DEF_STR( Yes ) ) |
| 472 | 472 | INPUT_PORTS_END |
| 473 | 473 | |
| 474 | unsigned char pet_palette[] = | |
| 474 | static unsigned char pet_palette[] = | |
| 475 | 475 | { |
| 476 | 476 | 0,0,0, /* black */ |
| 477 | 477 | 0,0x80,0, /* green */ |
| r1432 | r1433 | |
|---|---|---|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | |
| 588 | void modeF8_switch(UINT16 offset, UINT8 data) | |
| 588 | static void modeF8_switch(UINT16 offset, UINT8 data) | |
| 589 | 589 | { |
| 590 | 590 | bank_base[1] = CART + 0x1000 * offset; |
| 591 | 591 | memory_set_bankptr(1, bank_base[1]); |
| 592 | 592 | } |
| 593 | void modeFA_switch(UINT16 offset, UINT8 data) | |
| 593 | static void modeFA_switch(UINT16 offset, UINT8 data) | |
| 594 | 594 | { |
| 595 | 595 | bank_base[1] = CART + 0x1000 * offset; |
| 596 | 596 | memory_set_bankptr(1, bank_base[1]); |
| 597 | 597 | } |
| 598 | void modeF6_switch(UINT16 offset, UINT8 data) | |
| 598 | static void modeF6_switch(UINT16 offset, UINT8 data) | |
| 599 | 599 | { |
| 600 | 600 | bank_base[1] = CART + 0x1000 * offset; |
| 601 | 601 | memory_set_bankptr(1, bank_base[1]); |
| 602 | 602 | } |
| 603 | void modeF4_switch(UINT16 offset, UINT8 data) | |
| 603 | static void modeF4_switch(UINT16 offset, UINT8 data) | |
| 604 | 604 | { |
| 605 | 605 | bank_base[1] = CART + 0x1000 * offset; |
| 606 | 606 | memory_set_bankptr(1, bank_base[1]); |
| 607 | 607 | } |
| 608 | void mode3F_switch(UINT16 offset, UINT8 data) | |
| 608 | static void mode3F_switch(UINT16 offset, UINT8 data) | |
| 609 | 609 | { |
| 610 | 610 | bank_base[1] = CART + 0x800 * (data & (number_banks - 1)); |
| 611 | 611 | memory_set_bankptr(1, bank_base[1]); |
| 612 | 612 | } |
| 613 | void modeUA_switch(UINT16 offset, UINT8 data) | |
| 613 | static void modeUA_switch(UINT16 offset, UINT8 data) | |
| 614 | 614 | { |
| 615 | 615 | bank_base[1] = CART + (offset >> 6) * 0x1000; |
| 616 | 616 | memory_set_bankptr(1, bank_base[1]); |
| 617 | 617 | } |
| 618 | void modeE0_switch(UINT16 offset, UINT8 data) | |
| 618 | static void modeE0_switch(UINT16 offset, UINT8 data) | |
| 619 | 619 | { |
| 620 | 620 | int bank = 1 + (offset >> 3); |
| 621 | 621 | bank_base[bank] = CART + 0x400 * (offset & 7); |
| 622 | 622 | memory_set_bankptr(bank, bank_base[bank]); |
| 623 | 623 | } |
| 624 | void modeE7_switch(UINT16 offset, UINT8 data) | |
| 624 | static void modeE7_switch(UINT16 offset, UINT8 data) | |
| 625 | 625 | { |
| 626 | 626 | bank_base[1] = CART + 0x800 * offset; |
| 627 | 627 | memory_set_bankptr(1, bank_base[1]); |
| 628 | 628 | } |
| 629 | void modeE7_RAM_switch(UINT16 offset, UINT8 data) | |
| 629 | static void modeE7_RAM_switch(UINT16 offset, UINT8 data) | |
| 630 | 630 | { |
| 631 | 631 | memory_set_bankptr(9, extra_RAM + (4 + offset) * 256 ); |
| 632 | 632 | } |
| 633 | void modeDC_switch(UINT16 offset, UINT8 data) | |
| 633 | static void modeDC_switch(UINT16 offset, UINT8 data) | |
| 634 | 634 | { |
| 635 | 635 | bank_base[1] = CART + 0x1000 * next_bank(); |
| 636 | 636 | memory_set_bankptr(1, bank_base[1]); |
| 637 | 637 | } |
| 638 | void mode3E_switch(UINT16 offset, UINT8 data) | |
| 638 | static void mode3E_switch(UINT16 offset, UINT8 data) | |
| 639 | 639 | { |
| 640 | 640 | bank_base[1] = CART + 0x800 * (data & (number_banks - 1)); |
| 641 | 641 | memory_set_bankptr(1, bank_base[1]); |
| 642 | 642 | mode3E_ram_enabled = 0; |
| 643 | 643 | } |
| 644 | void mode3E_RAM_switch(UINT16 offset, UINT8 data) | |
| 644 | static void mode3E_RAM_switch(UINT16 offset, UINT8 data) | |
| 645 | 645 | { |
| 646 | 646 | ram_base = extra_RAM + 0x200 * ( data & 0x3F ); |
| 647 | 647 | memory_set_bankptr(1, ram_base ); |
| 648 | 648 | mode3E_ram_enabled = 1; |
| 649 | 649 | } |
| 650 | void modeFV_switch(UINT16 offset, UINT8 data) | |
| 650 | static void modeFV_switch(UINT16 offset, UINT8 data) | |
| 651 | 651 | { |
| 652 | 652 | //printf("ModeFV %04x\n",offset); |
| 653 | 653 | if (!FVlocked && ( activecpu_get_pc() & 0x1F00 ) == 0x1F00 ) { |
| r1432 | r1433 | |
| 657 | 657 | memory_set_bankptr(1, bank_base[1]); |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | void modeJVP_switch(UINT16 offset, UINT8 data) | |
| 660 | static void modeJVP_switch(UINT16 offset, UINT8 data) | |
| 661 | 661 | { |
| 662 | 662 | switch( offset ) { |
| 663 | 663 | case 0x00: |
| r1432 | r1433 | |
| 708 | 708 | static WRITE8_HANDLER(modeJVP_switch_w) { modeJVP_switch(offset, data); riot_ram[ 0x20 + offset ] = data; } |
| 709 | 709 | |
| 710 | 710 | |
| 711 | OPBASE_HANDLER( modeF6_opbase ) | |
| 711 | static OPBASE_HANDLER( modeF6_opbase ) | |
| 712 | 712 | { |
| 713 | 713 | if ( ( address & 0x1FFF ) >= 0x1FF6 && ( address & 0x1FFF ) <= 0x1FF9 ) { |
| 714 | 714 | modeF6_switch_w( ( address & 0x1FFF ) - 0x1FF6, 0 ); |
| r1432 | r1433 | |
| 716 | 716 | return address; |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | OPBASE_HANDLER( modeSS_opbase ) | |
| 719 | static OPBASE_HANDLER( modeSS_opbase ) | |
| 720 | 720 | { |
| 721 | 721 | if ( address & 0x1000 ) { |
| 722 | 722 | opcode_mask = 0x7ff; |
| r1432 | r1433 | |
| 1013 | 1013 | static opbase_handler FE_old_opbase_handler; |
| 1014 | 1014 | static int FETimer; |
| 1015 | 1015 | |
| 1016 | OPBASE_HANDLER(modeFE_opbase_handler) | |
| 1016 | static OPBASE_HANDLER(modeFE_opbase_handler) | |
| 1017 | 1017 | { |
| 1018 | 1018 | if ( ! FETimer ) |
| 1019 | 1019 | { |
| r1432 | r1433 | |
| 1033 | 1033 | return address; |
| 1034 | 1034 | } |
| 1035 | 1035 | |
| 1036 | void modeFE_switch(UINT16 offset, UINT8 data) | |
| 1036 | static void modeFE_switch(UINT16 offset, UINT8 data) | |
| 1037 | 1037 | { |
| 1038 | 1038 | /* Retrieve last byte read by the cpu (for this mapping scheme this |
| 1039 | 1039 | should be the last byte that was on the data bus |
| r1432 | r1433 | |
|---|---|---|
| 334 | 334 | |
| 335 | 335 | #define ST2_HEADER_SIZE 256 |
| 336 | 336 | |
| 337 | DEVICE_LOAD( studio2_cart ) | |
| 337 | static DEVICE_LOAD( studio2_cart ) | |
| 338 | 338 | { |
| 339 | 339 | UINT8 *ptr = NULL; |
| 340 | 340 | UINT8 header[ST2_HEADER_SIZE]; |
| r1432 | r1433 | |
|---|---|---|
| 105 | 105 | // uncomment for debug log output |
| 106 | 106 | //#define VERBOSE |
| 107 | 107 | |
| 108 | void pcw_fdc_interrupt(int); | |
| 108 | static void pcw_fdc_interrupt(int); | |
| 109 | 109 | |
| 110 | 110 | // pointer to pcw ram |
| 111 | 111 | unsigned int roller_ram_addr; |
| 112 | 112 | // flag to indicate if boot-program is enabled/disabled |
| 113 | 113 | static int pcw_boot; |
| 114 | int pcw_system_status; | |
| 114 | static int pcw_system_status; | |
| 115 | 115 | unsigned short roller_ram_offset; |
| 116 | 116 | // code for CPU int type generated when FDC int is triggered |
| 117 | 117 | static int fdc_interrupt_code; |
| r1432 | r1433 | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /* fdc interrupt callback. set/clear fdc int */ |
| 218 | void pcw_fdc_interrupt(int state) | |
| 218 | static void pcw_fdc_interrupt(int state) | |
| 219 | 219 | { |
| 220 | 220 | pcw_system_status &= ~(1<<5); |
| 221 | 221 |
| r1432 | r1433 | |
|---|---|---|
| 781 | 781 | MDRV_CPU_PROGRAM_MAP(c364_readmem, c364_writemem) |
| 782 | 782 | MACHINE_DRIVER_END |
| 783 | 783 | |
| 784 | DRIVER_INIT( c16 ) { c16_driver_init(); } | |
| 784 | static DRIVER_INIT( c16 ) { c16_driver_init(); } | |
| 785 | #ifdef UNUSED_FUNCTION | |
| 785 | 786 | DRIVER_INIT( c16hun ) { c16_driver_init(); } |
| 786 | 787 | DRIVER_INIT( c16c ) { c16_driver_init(); } |
| 787 | 788 | DRIVER_INIT( c16v ) { c16_driver_init(); } |
| 788 | DRIVER_INIT( plus4 ) { c16_driver_init(); } | |
| 789 | #endif | |
| 790 | static DRIVER_INIT( plus4 ) { c16_driver_init(); } | |
| 791 | #ifdef UNUSED_FUNCTION | |
| 789 | 792 | DRIVER_INIT( plus4c ) { c16_driver_init(); } |
| 790 | 793 | DRIVER_INIT( plus4v ) { c16_driver_init(); } |
| 791 | 794 | DRIVER_INIT( c364 ) { c16_driver_init(); } |
| 795 | #endif | |
| 792 | 796 | |
| 793 | 797 | static void c16cart_device_getinfo(const device_class *devclass, UINT32 state, union devinfo *info) |
| 794 | 798 | { |
| r1432 | r1433 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | /* Memory Maps */ |
| 22 | 22 | |
| 23 | ADDRESS_MAP_START( sb2m600_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 23 | static ADDRESS_MAP_START( sb2m600_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 24 | 24 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 25 | 25 | AM_RANGE(0x1000, 0x1fff) AM_RAM |
| 26 | 26 | AM_RANGE(0xa000, 0xbfff) AM_ROM |
| r1432 | r1433 | |
| 33 | 33 | AM_RANGE(0xf800, 0xffff) AM_ROM |
| 34 | 34 | ADDRESS_MAP_END |
| 35 | 35 | |
| 36 | ADDRESS_MAP_START( uk101_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 36 | static ADDRESS_MAP_START( uk101_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 37 | 37 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 38 | 38 | AM_RANGE(0x1000, 0x1fff) AM_RAM |
| 39 | 39 | AM_RANGE(0xa000, 0xbfff) AM_ROM |
| r1432 | r1433 | |
|---|---|---|
| 166 | 166 | /* enterprise interface to dave - ok, so Dave chip is unique |
| 167 | 167 | to Enterprise. But these functions make it nice and easy to see |
| 168 | 168 | whats going on. */ |
| 169 | DAVE_INTERFACE enterprise_dave_interface= | |
| 169 | static DAVE_INTERFACE enterprise_dave_interface= | |
| 170 | 170 | { |
| 171 | 171 | enterprise_dave_reg_read, |
| 172 | 172 | enterprise_dave_reg_write, |
| r1432 | r1433 | |
| 284 | 284 | |
| 285 | 285 | /* I've done this because the ram is banked in 16k blocks, and |
| 286 | 286 | the rom can be paged into bank 0 and bank 3. */ |
| 287 | ADDRESS_MAP_START( enterprise_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 287 | static ADDRESS_MAP_START( enterprise_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 288 | 288 | AM_RANGE( 0x00000, 0x03fff) AM_READWRITE( MRA8_BANK1, MWA8_BANK5 ) |
| 289 | 289 | AM_RANGE( 0x04000, 0x07fff) AM_READWRITE( MRA8_BANK2, MWA8_BANK6 ) |
| 290 | 290 | AM_RANGE( 0x08000, 0x0bfff) AM_READWRITE( MRA8_BANK3, MWA8_BANK7 ) |
| r1432 | r1433 | |
| 370 | 370 | return EXDOS_CARD_R; |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | ADDRESS_MAP_START( enterprise_io , ADDRESS_SPACE_IO, 8) | |
| 373 | static ADDRESS_MAP_START( enterprise_io , ADDRESS_SPACE_IO, 8) | |
| 374 | 374 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 375 | 375 | AM_RANGE( 0x010, 0x017) AM_READWRITE( enterprise_wd177x_read, enterprise_wd177x_write ) |
| 376 | 376 | AM_RANGE( 0x018, 0x018) AM_READWRITE( exdos_card_r, exdos_card_w ) |
| r1432 | r1433 | |
|---|---|---|
| 47 | 47 | static READ8_HANDLER(mekd2_kbd_r) { return 0xff; } |
| 48 | 48 | #endif |
| 49 | 49 | |
| 50 | UINT8 pia[8]; | |
| 50 | static UINT8 pia[8]; | |
| 51 | 51 | |
| 52 | 52 | #ifdef UNUSED_FUNCTION |
| 53 | 53 | static WRITE8_HANDLER(mekd2_pia_w) { } |
| r1432 | r1433 | |
|---|---|---|
| 71 | 71 | { |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | unsigned char previous_mode; | |
| 74 | static unsigned char previous_mode; | |
| 75 | 75 | |
| 76 | 76 | static WRITE8_HANDLER(apf_m1000_pia_out_b_func) |
| 77 | 77 | { |
| r1432 | r1433 | |
|---|---|---|
| 197 | 197 | static UINT8 *smpc_ram; |
| 198 | 198 | //static void stv_dump_ram(void); |
| 199 | 199 | |
| 200 | UINT32* stv_workram_l; | |
| 201 | UINT32* stv_workram_h; | |
| 202 | UINT32* stv_backupram; | |
| 200 | static UINT32* stv_workram_l; | |
| 201 | static UINT32* stv_workram_h; | |
| 202 | //UINT32* stv_backupram; | |
| 203 | 203 | extern UINT32* stv_scu; |
| 204 | 204 | static UINT16* scsp_regs; |
| 205 | 205 | static UINT16* sound_ram; |
| r1432 | r1433 | |
| 207 | 207 | static int saturn_region; |
| 208 | 208 | |
| 209 | 209 | int stv_vblank,stv_hblank; |
| 210 | int stv_enable_slave_sh2; | |
| 210 | static int stv_enable_slave_sh2; | |
| 211 | 211 | /*SMPC stuff*/ |
| 212 | 212 | static UINT8 NMI_reset; |
| 213 | 213 | static void system_reset(void); |
| r1432 | r1433 | |
| 240 | 240 | static void dma_indirect_lv2(void); /*DMA level 2 indirect transfer function*/ |
| 241 | 241 | |
| 242 | 242 | |
| 243 | int minit_boost,sinit_boost; | |
| 244 | double minit_boost_timeslice, sinit_boost_timeslice; | |
| 243 | static int minit_boost,sinit_boost; | |
| 244 | static double minit_boost_timeslice, sinit_boost_timeslice; | |
| 245 | 245 | |
| 246 | 246 | static int scanline; |
| 247 | 247 | |
| r1432 | r1433 | |
| 428 | 428 | #define SMPC_CONTROL_MODE_PORT_1 IOSEL1 = 0 |
| 429 | 429 | #define SMPC_CONTROL_MODE_PORT_2 IOSEL2 = 0 |
| 430 | 430 | |
| 431 | int DectoBCD(int num) | |
| 431 | static int DectoBCD(int num) | |
| 432 | 432 | { |
| 433 | 433 | int i, cnt = 0, tmp, res = 0; |
| 434 | 434 | |
| r1432 | r1433 | |
| 999 | 999 | #define D1MV_0 if(DMA_STATUS & 0x100) DMA_STATUS^=0x100 |
| 1000 | 1000 | #define D2MV_0 if(DMA_STATUS & 0x1000) DMA_STATUS^=0x1000 |
| 1001 | 1001 | |
| 1002 | UINT32 scu_index_0,scu_index_1,scu_index_2; | |
| 1002 | static UINT32 scu_index_0,scu_index_1,scu_index_2; | |
| 1003 | 1003 | static UINT8 scsp_to_main_irq; |
| 1004 | 1004 | |
| 1005 | 1005 | static UINT32 scu_add_tmp; |
| r1432 | r1433 | |
| 1013 | 1013 | #define WORK_RAM_H(_lv_) ((scu_##_lv_ & 0x07ffffff) >= 0x06000000) && ((scu_##_lv_ & 0x07ffffff) <= 0x060fffff) |
| 1014 | 1014 | #define SOUND_RAM(_lv_) ((scu_##_lv_ & 0x07ffffff) >= 0x05a00000) && ((scu_##_lv_ & 0x07ffffff) <= 0x05afffff) |
| 1015 | 1015 | |
| 1016 | READ32_HANDLER( stv_scu_r32 ) | |
| 1016 | static READ32_HANDLER( stv_scu_r32 ) | |
| 1017 | 1017 | { |
| 1018 | 1018 | /*TODO: write only registers must return 0...*/ |
| 1019 | 1019 | //popmessage("%02x",DMA_STATUS); |
| r1432 | r1433 | |
| 1056 | 1056 | } |
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | WRITE32_HANDLER( stv_scu_w32 ) | |
| 1059 | static WRITE32_HANDLER( stv_scu_w32 ) | |
| 1060 | 1060 | { |
| 1061 | 1061 | COMBINE_DATA(&stv_scu[offset]); |
| 1062 | 1062 | |
| r1432 | r1433 | |
| 1831 | 1831 | |
| 1832 | 1832 | /**************************************************************************************/ |
| 1833 | 1833 | |
| 1834 | WRITE32_HANDLER( stv_sh2_soundram_w ) | |
| 1834 | static WRITE32_HANDLER( stv_sh2_soundram_w ) | |
| 1835 | 1835 | { |
| 1836 | 1836 | COMBINE_DATA(sound_ram+offset*2+1); |
| 1837 | 1837 | data >>= 16; |
| r1432 | r1433 | |
| 1839 | 1839 | COMBINE_DATA(sound_ram+offset*2); |
| 1840 | 1840 | } |
| 1841 | 1841 | |
| 1842 | READ32_HANDLER( stv_sh2_soundram_r ) | |
| 1842 | static READ32_HANDLER( stv_sh2_soundram_r ) | |
| 1843 | 1843 | { |
| 1844 | 1844 | return (sound_ram[offset*2]<<16)|sound_ram[offset*2+1]; |
| 1845 | 1845 | } |
| r1432 | r1433 | |
| 2087 | 2087 | smpc_ram[0x5f] = 0x10; |
| 2088 | 2088 | } |
| 2089 | 2089 | |
| 2090 | #ifdef UNUSED_FUNCTION | |
| 2090 | 2091 | DRIVER_INIT( saturn ) |
| 2091 | 2092 | { |
| 2092 | 2093 | saturn_init_driver(0); |
| 2093 | 2094 | } |
| 2095 | #endif | |
| 2094 | 2096 | |
| 2095 | DRIVER_INIT( saturnus ) | |
| 2097 | static DRIVER_INIT( saturnus ) | |
| 2096 | 2098 | { |
| 2097 | 2099 | saturn_init_driver(4); |
| 2098 | 2100 | } |
| 2099 | 2101 | |
| 2100 | DRIVER_INIT( saturneu ) | |
| 2102 | static DRIVER_INIT( saturneu ) | |
| 2101 | 2103 | { |
| 2102 | 2104 | saturn_init_driver(12); |
| 2103 | 2105 | } |
| 2104 | 2106 | |
| 2105 | DRIVER_INIT( saturnjp ) | |
| 2107 | static DRIVER_INIT( saturnjp ) | |
| 2106 | 2108 | { |
| 2107 | 2109 | saturn_init_driver(1); |
| 2108 | 2110 | } |
| r1432 | r1433 | |
| 2110 | 2112 | |
| 2111 | 2113 | static int scsp_last_line = 0; |
| 2112 | 2114 | |
| 2113 | MACHINE_START( saturn ) | |
| 2115 | static MACHINE_START( saturn ) | |
| 2114 | 2116 | { |
| 2115 | 2117 | SCSP_set_ram_base(0, sound_ram); |
| 2116 | 2118 | |
| r1432 | r1433 | |
| 2143 | 2145 | add_exit_callback(machine, stvcd_exit); |
| 2144 | 2146 | } |
| 2145 | 2147 | |
| 2146 | MACHINE_RESET( saturn ) | |
| 2148 | static MACHINE_RESET( saturn ) | |
| 2147 | 2149 | { |
| 2148 | 2150 | // don't let the slave cpu and the 68k go anywhere |
| 2149 | 2151 | cpunum_set_input_line(1, INPUT_LINE_RESET, ASSERT_LINE); |
| r1432 | r1433 | |
| 2241 | 2243 | GFXDECODE_ENTRY( REGION_GFX2, 0, tiles16x16x8_layout, 0x00, 0x20 ) |
| 2242 | 2244 | GFXDECODE_END |
| 2243 | 2245 | |
| 2244 | struct sh2_config sh2_conf_master = { 0 }; | |
| 2245 | struct sh2_config sh2_conf_slave = { 1 }; | |
| 2246 | static struct sh2_config sh2_conf_master = { 0 }; | |
| 2247 | static struct sh2_config sh2_conf_slave = { 1 }; | |
| 2246 | 2248 | |
| 2247 | 2249 | static void scsp_irq(int irq) |
| 2248 | 2250 | { |
| r1432 | r1433 | |
|---|---|---|
| 91 | 91 | return port_read_with_latch(0xff,latch[3]); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | struct { /* SKR - 2102 RAM chip on carts 10 and 18 I/O ports */ | |
| 94 | static struct { /* SKR - 2102 RAM chip on carts 10 and 18 I/O ports */ | |
| 95 | 95 | UINT8 d; /* data bit:inverted logic, but reading/writing cancel out */ |
| 96 | 96 | UINT8 r_w; /* inverted logic: 0 means read, 1 means write */ |
| 97 | 97 | UINT8 a[10]; /* addr bits: inverted logic, but reading/writing cancel out */ |
| r1432 | r1433 | |
|---|---|---|
| 659 | 659 | z80dart_init(0, &abc800_dart_intf); |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | INTERRUPT_GEN( abc802_vblank_interrupt ) | |
| 662 | static INTERRUPT_GEN( abc802_vblank_interrupt ) | |
| 663 | 663 | { |
| 664 | 664 | z80dart_set_ri(0, 0); |
| 665 | 665 | z80dart_set_ri(0, 1); |
| r1432 | r1433 | |
| 942 | 942 | } |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | DEVICE_LOAD( abc800_serial ) | |
| 945 | static DEVICE_LOAD( abc800_serial ) | |
| 946 | 946 | { |
| 947 | 947 | /* filename specified */ |
| 948 | 948 | if (serial_device_load(image)==INIT_PASS) |
| r1432 | r1433 | |
|---|---|---|
| 56 | 56 | #include "mslegacy.h" |
| 57 | 57 | |
| 58 | 58 | /* Memory w/r functions */ |
| 59 | ADDRESS_MAP_START( nascom1_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 59 | static ADDRESS_MAP_START( nascom1_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 60 | 60 | AM_RANGE(0x0000, 0x07ff) AM_ROM |
| 61 | 61 | AM_RANGE(0x0800, 0x0bff) AM_READWRITE( videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 62 | 62 | AM_RANGE(0x0c00, 0x0fff) AM_RAM |
| r1432 | r1433 | |
| 68 | 68 | ADDRESS_MAP_END |
| 69 | 69 | |
| 70 | 70 | /* port i/o functions */ |
| 71 | ADDRESS_MAP_START( nascom1_io , ADDRESS_SPACE_IO, 8) | |
| 71 | static ADDRESS_MAP_START( nascom1_io , ADDRESS_SPACE_IO, 8) | |
| 72 | 72 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 73 | 73 | AM_RANGE(0x00, 0x00) AM_READWRITE( nascom1_port_00_r, nascom1_port_00_w ) |
| 74 | 74 | AM_RANGE(0x01, 0x01) AM_READWRITE( nascom1_port_01_r, nascom1_port_01_w ) |
| r1432 | r1433 | |
|---|---|---|
| 600 | 600 | TMS9928A_interrupt(); |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | ADDRESS_MAP_START( mtx_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 603 | static ADDRESS_MAP_START( mtx_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 604 | 604 | AM_RANGE( 0x0000, 0x1fff) AM_READWRITE( MRA8_BANK1, mtx_trap_write ) |
| 605 | 605 | AM_RANGE( 0x2000, 0x3fff) AM_READWRITE( MRA8_BANK2, MWA8_BANK10 ) |
| 606 | 606 | AM_RANGE( 0x4000, 0x5fff) AM_READWRITE( MRA8_BANK3, MWA8_BANK11 ) |
| r1432 | r1433 | |
| 611 | 611 | AM_RANGE( 0xe000, 0xffff) AM_READWRITE( MRA8_BANK8, MWA8_BANK16 ) |
| 612 | 612 | ADDRESS_MAP_END |
| 613 | 613 | |
| 614 | ADDRESS_MAP_START( mtx_io, ADDRESS_SPACE_IO, 8) | |
| 614 | static ADDRESS_MAP_START( mtx_io, ADDRESS_SPACE_IO, 8) | |
| 615 | 615 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 616 | 616 | AM_RANGE( 0x00, 0x00) AM_READWRITE( mtx_strobe_r, mtx_bankswitch_w ) |
| 617 | 617 | AM_RANGE( 0x01, 0x02) AM_READWRITE( mtx_vdp_r, mtx_vdp_w ) |
| r1432 | r1433 | |
|---|---|---|
| 784 | 784 | /* keyboard int->ctc/adc->pio */ |
| 785 | 785 | |
| 786 | 786 | |
| 787 | ADDRESS_MAP_START( einstein_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 787 | static ADDRESS_MAP_START( einstein_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 788 | 788 | AM_RANGE(0x0000, 0x01fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK3) |
| 789 | 789 | AM_RANGE(0x2000, 0x0ffff) AM_READWRITE(MRA8_BANK2, MWA8_BANK4) |
| 790 | 790 | ADDRESS_MAP_END |
| r1432 | r1433 | |
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | 1313 | |
| 1314 | ADDRESS_MAP_START( einstein2_io , ADDRESS_SPACE_IO, 8) | |
| 1314 | static ADDRESS_MAP_START( einstein2_io , ADDRESS_SPACE_IO, 8) | |
| 1315 | 1315 | AM_RANGE(0x0000,0x0ffff) AM_READWRITE(einstein2_port_r, einstein2_port_w) |
| 1316 | 1316 | ADDRESS_MAP_END |
| 1317 | 1317 | |
| 1318 | ADDRESS_MAP_START( einstein_io , ADDRESS_SPACE_IO, 8) | |
| 1318 | static ADDRESS_MAP_START( einstein_io , ADDRESS_SPACE_IO, 8) | |
| 1319 | 1319 | AM_RANGE(0x0000,0x0ffff) AM_READWRITE(einstein_port_r, einstein_port_w) |
| 1320 | 1320 | ADDRESS_MAP_END |
| 1321 | 1321 | |
| r1432 | r1433 | |
| 1348 | 1348 | |
| 1349 | 1349 | |
| 1350 | 1350 | |
| 1351 | struct msm8251_interface einstein_msm8251_intf= | |
| 1351 | static struct msm8251_interface einstein_msm8251_intf= | |
| 1352 | 1352 | { |
| 1353 | 1353 | NULL, |
| 1354 | 1354 | NULL, |
| r1432 | r1433 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | /* graphics output */ |
| 94 | 94 | |
| 95 | gfx_layout intv_gromlayout = | |
| 95 | static gfx_layout intv_gromlayout = | |
| 96 | 96 | { |
| 97 | 97 | 16, 16, |
| 98 | 98 | 256, |
| r1432 | r1433 | |
| 104 | 104 | 8 * 16 |
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | gfx_layout intv_gramlayout = | |
| 107 | static gfx_layout intv_gramlayout = | |
| 108 | 108 | { |
| 109 | 109 | 16, 16, |
| 110 | 110 | 64, |
| r1432 | r1433 | |
| 116 | 116 | 8 * 8 |
| 117 | 117 | }; |
| 118 | 118 | |
| 119 | gfx_layout intvkbd_charlayout = | |
| 119 | static gfx_layout intvkbd_charlayout = | |
| 120 | 120 | { |
| 121 | 121 | 8, 8, |
| 122 | 122 | 256, |
| r1432 | r1433 | |
|---|---|---|
| 37 | 37 | #include "mslegacy.h" |
| 38 | 38 | |
| 39 | 39 | /* memory w/r functions */ |
| 40 | ADDRESS_MAP_START( jupiter_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 40 | static ADDRESS_MAP_START( jupiter_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 41 | 41 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 42 | 42 | AM_RANGE(0x2000, 0x22ff) AM_NOP |
| 43 | 43 | AM_RANGE(0x2300, 0x23ff) AM_RAM |
| r1432 | r1433 | |
| 52 | 52 | ADDRESS_MAP_END |
| 53 | 53 | |
| 54 | 54 | /* port i/o functions */ |
| 55 | ADDRESS_MAP_START( jupiter_io , ADDRESS_SPACE_IO, 8) | |
| 55 | static ADDRESS_MAP_START( jupiter_io , ADDRESS_SPACE_IO, 8) | |
| 56 | 56 | AM_RANGE( 0x00fe, 0xfffe) AM_WRITE( jupiter_port_fe_w ) |
| 57 | 57 | AM_RANGE( 0xfefe, 0xfefe) AM_READ( jupiter_port_fefe_r ) |
| 58 | 58 | AM_RANGE( 0xfdfe, 0xfdfe) AM_READ( jupiter_port_fdfe_r ) |
| r1432 | r1433 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | struct via6522_interface config= | |
| 44 | static struct via6522_interface config= | |
| 45 | 45 | { |
| 46 | 46 | 0,//read8_handler in_a_func; |
| 47 | 47 | 0,//read8_handler in_b_func; |
| r1432 | r1433 | |
|---|---|---|
| 96 | 96 | // This is the sequence for unlocking the ASIC in the CPC+/GX4000 |
| 97 | 97 | // These are outed to port &bc00, after syncing the lock by outing a non-zero value then a zero to &bc00 |
| 98 | 98 | // To lock the ASIC again, repeat the sequence without the last &ee |
| 99 | unsigned char asic_unlock_seq[15] = | |
| 99 | static unsigned char asic_unlock_seq[15] = | |
| 100 | 100 | { |
| 101 | 101 | 0xff, 0x77, 0xb3, 0x51, 0xa8, 0xd4, 0x62, 0x39, 0x9c, 0x46, 0x2b, 0x15, 0x8a, 0xcd, 0xee |
| 102 | 102 | }; |
| 103 | 103 | |
| 104 | 104 | int amstrad_system_type; |
| 105 | int amstrad_plus_lower; // CPC+/GX4000 cartridge bank loaded in lower ROM area | |
| 106 | int amstrad_plus_lower_addr; // CPC+/GX4000 lower ROM area address / ASIC register page enable | |
| 107 | int amstrad_plus_lower_enabled; // secondary lower ROM select in use? | |
| 105 | static int amstrad_plus_lower; // CPC+/GX4000 cartridge bank loaded in lower ROM area | |
| 106 | static int amstrad_plus_lower_addr; // CPC+/GX4000 lower ROM area address / ASIC register page enable | |
| 107 | static int amstrad_plus_lower_enabled; // secondary lower ROM select in use? | |
| 108 | 108 | int amstrad_plus_asic_enabled; // ASIC enabled |
| 109 | int amstrad_plus_asic_regpage; // ASIC register page enabled | |
| 110 | int amstrad_plus_asic_seqptr; // current position in the ASIC unlocking sequence | |
| 109 | static int amstrad_plus_asic_regpage; // ASIC register page enabled | |
| 110 | static int amstrad_plus_asic_seqptr; // current position in the ASIC unlocking sequence | |
| 111 | 111 | int amstrad_plus_pri; // Programmable raster interrupt, 0=disabled. |
| 112 | 112 | int amstrad_plus_irq_cause; // part of the interrupt vector for IM 2. 6 = raster IRQ, 4 = DMA channel 2, 2 = DMA channel 1, 0 = DMA channel 0 |
| 113 | 113 | int amstrad_plus_scroll_x; // soft scroll - horizontal (0-15), in mode 2 pixels |
| r1432 | r1433 | |
| 118 | 118 | int amstrad_plus_dma_1_addr; |
| 119 | 119 | int amstrad_plus_dma_2_addr; |
| 120 | 120 | int amstrad_plus_dma_prescaler[3]; // DMA channel prescaler |
| 121 | int amstrad_plus_dma_clear; // set if DMA interrupts are to be cleared automatically | |
| 121 | static int amstrad_plus_dma_clear; // set if DMA interrupts are to be cleared automatically | |
| 122 | 122 | |
| 123 | 123 | extern int amstrad_scanline; |
| 124 | 124 | extern int prev_reg; |
| 125 | 125 | |
| 126 | void amstrad_plus_seqcheck(int data); | |
| 126 | static void amstrad_plus_seqcheck(int data); | |
| 127 | 127 | static WRITE8_HANDLER( amstrad_plus_asic_4000_w ); |
| 128 | 128 | static WRITE8_HANDLER( amstrad_plus_asic_6000_w ); |
| 129 | 129 | static READ8_HANDLER( amstrad_plus_asic_4000_r ); |
| r1432 | r1433 | |
| 458 | 458 | } |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | void AmstradCPC_SetLowerRom(int Data) | |
| 461 | static void AmstradCPC_SetLowerRom(int Data) | |
| 462 | 462 | { |
| 463 | 463 | if(amstrad_plus_asic_enabled != 0) |
| 464 | 464 | { |
| r1432 | r1433 | |
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | 1247 | // Handler for checking the ASIC unlocking sequence |
| 1248 | void amstrad_plus_seqcheck(int data) | |
| 1248 | static void amstrad_plus_seqcheck(int data) | |
| 1249 | 1249 | { |
| 1250 | 1250 | static int prev_data; |
| 1251 | 1251 | |
| r1432 | r1433 | |
| 1604 | 1604 | multiface_reset(); |
| 1605 | 1605 | } |
| 1606 | 1606 | |
| 1607 | void kccomp_reset_machine(void) | |
| 1607 | static void kccomp_reset_machine(void) | |
| 1608 | 1608 | { |
| 1609 | 1609 | /* enable lower rom (OS rom) */ |
| 1610 | 1610 | amstrad_GateArray_write(0x089); |
| r1432 | r1433 | |
|---|---|---|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | const smsvdp_configuration config_315_5124 = { MODEL_315_5124, sms_int_callback }; | |
| 276 | const smsvdp_configuration config_315_5246 = { MODEL_315_5246, sms_int_callback }; | |
| 277 | const smsvdp_configuration config_315_5378 = { MODEL_315_5378, sms_int_callback }; | |
| 278 | const smsvdp_configuration config_store = { MODEL_315_5124, sms_store_int_callback }; | |
| 275 | static const smsvdp_configuration config_315_5124 = { MODEL_315_5124, sms_int_callback }; | |
| 276 | static const smsvdp_configuration config_315_5246 = { MODEL_315_5246, sms_int_callback }; | |
| 277 | static const smsvdp_configuration config_315_5378 = { MODEL_315_5378, sms_int_callback }; | |
| 278 | static const smsvdp_configuration config_store = { MODEL_315_5124, sms_store_int_callback }; | |
| 279 | 279 | |
| 280 | VIDEO_START(sega_315_5124) { | |
| 280 | static VIDEO_START(sega_315_5124) { | |
| 281 | 281 | smsvdp_video_init( &config_315_5124 ); |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | VIDEO_START(sega_315_5246) { | |
| 284 | static VIDEO_START(sega_315_5246) { | |
| 285 | 285 | smsvdp_video_init( &config_315_5246 ); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | VIDEO_START(sega_315_5378) { | |
| 288 | static VIDEO_START(sega_315_5378) { | |
| 289 | 289 | smsvdp_video_init( &config_315_5378 ); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | VIDEO_START(sega_store_315_5124) { | |
| 292 | static VIDEO_START(sega_store_315_5124) { | |
| 293 | 293 | smsvdp_video_init( &config_store ); |
| 294 | 294 | } |
| 295 | 295 |
| r1432 | r1433 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | static emu_timer *vbl_timer, *timer[4], *snd_timer; |
| 87 | 87 | |
| 88 | VIDEO_START( a310 ) | |
| 88 | static VIDEO_START( a310 ) | |
| 89 | 89 | { |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | VIDEO_UPDATE( a310 ) | |
| 92 | static VIDEO_UPDATE( a310 ) | |
| 93 | 93 | { |
| 94 | 94 | return 0; |
| 95 | 95 | } |
| r1432 | r1433 | |
|---|---|---|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | |
| 462 | ADDRESS_MAP_START( avigo_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 462 | static ADDRESS_MAP_START( avigo_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 463 | 463 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE( MRA8_BANK1, MWA8_BANK5 ) |
| 464 | 464 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE( MRA8_BANK2, MWA8_BANK6 ) |
| 465 | 465 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE( MRA8_BANK3, MWA8_BANK7 ) |
| r1432 | r1433 | |
| 802 | 802 | |
| 803 | 803 | |
| 804 | 804 | |
| 805 | ADDRESS_MAP_START( avigo_io, ADDRESS_SPACE_IO, 8) | |
| 805 | static ADDRESS_MAP_START( avigo_io, ADDRESS_SPACE_IO, 8) | |
| 806 | 806 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 807 | 807 | |
| 808 | 808 | AM_RANGE(0x000, 0x000) AM_READ( avigo_unmapped_r) |
| r1432 | r1433 | |
|---|---|---|
| 19 | 19 | #include "sound/psx.h" |
| 20 | 20 | #include "debugger.h" |
| 21 | 21 | |
| 22 | struct | |
| 22 | static struct | |
| 23 | 23 | { |
| 24 | 24 | UINT8 id[ 8 ]; |
| 25 | 25 | UINT32 text; /* SCE only */ |
| r1432 | r1433 | |
| 544 | 544 | |
| 545 | 545 | /* ----------------------------------------------------------------------- */ |
| 546 | 546 | |
| 547 | READ32_HANDLER( psx_cd_r ) | |
| 547 | static READ32_HANDLER( psx_cd_r ) | |
| 548 | 548 | { |
| 549 | 549 | UINT32 result = 0; |
| 550 | 550 | |
| r1432 | r1433 | |
| 596 | 596 | return result; |
| 597 | 597 | } |
| 598 | 598 | |
| 599 | WRITE32_HANDLER( psx_cd_w ) | |
| 599 | static WRITE32_HANDLER( psx_cd_w ) | |
| 600 | 600 | { |
| 601 | 601 | void (*psx_cdcmd)(void); |
| 602 | 602 |
| r1432 | r1433 | |
|---|---|---|
| 34 | 34 | #include "sound/saa1099.h" |
| 35 | 35 | #include "sound/speaker.h" |
| 36 | 36 | |
| 37 | ADDRESS_MAP_START( coupe_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 37 | static ADDRESS_MAP_START( coupe_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 38 | 38 | AM_RANGE( 0x0000, 0x3FFF) AM_RAMBANK(1) |
| 39 | 39 | AM_RANGE( 0x4000, 0x7FFF) AM_RAMBANK(2) |
| 40 | 40 | AM_RANGE( 0x8000, 0xBFFF) AM_RAMBANK(3) |
| r1432 | r1433 | |
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | ADDRESS_MAP_START( coupe_io , ADDRESS_SPACE_IO, 8) | |
| 265 | static ADDRESS_MAP_START( coupe_io , ADDRESS_SPACE_IO, 8) | |
| 266 | 266 | AM_RANGE( 0x0000, 0x0ffff) AM_READWRITE( coupe_port_r, coupe_port_w ) |
| 267 | 267 | ADDRESS_MAP_END |
| 268 | 268 |
| r1432 | r1433 | |
|---|---|---|
| 85 | 85 | #define FW TRS80_FONT_W |
| 86 | 86 | #define FH TRS80_FONT_H |
| 87 | 87 | |
| 88 | READ8_HANDLER (trs80_wd179x_r) | |
| 88 | static READ8_HANDLER (trs80_wd179x_r) | |
| 89 | 89 | { |
| 90 | 90 | if (readinputport(0) & 0x80) |
| 91 | 91 | { |
| r1432 | r1433 | |
|---|---|---|
| 13 | 13 | #include "devices/cartslot.h" |
| 14 | 14 | #include "inputx.h" |
| 15 | 15 | |
| 16 | ADDRESS_MAP_START( odyssey2_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 16 | static ADDRESS_MAP_START( odyssey2_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 17 | 17 | AM_RANGE( 0x0000, 0x03FF) AM_ROM |
| 18 | 18 | AM_RANGE( 0x0400, 0x0BFF) AM_RAMBANK(1) |
| 19 | 19 | AM_RANGE( 0x0C00, 0x0FFF) AM_RAMBANK(2) |
| 20 | 20 | ADDRESS_MAP_END |
| 21 | 21 | |
| 22 | ADDRESS_MAP_START( odyssey2_io , ADDRESS_SPACE_IO, 8) | |
| 22 | static ADDRESS_MAP_START( odyssey2_io , ADDRESS_SPACE_IO, 8) | |
| 23 | 23 | AM_RANGE( 0x00, 0xff) AM_READWRITE( odyssey2_bus_r, odyssey2_bus_w) |
| 24 | 24 | AM_RANGE( I8039_p1, I8039_p1) AM_READWRITE( odyssey2_getp1, odyssey2_putp1 ) |
| 25 | 25 | AM_RANGE( I8039_p2, I8039_p2) AM_READWRITE( odyssey2_getp2, odyssey2_putp2 ) |
| r1432 | r1433 | |
|---|---|---|
| 112 | 112 | #include "mslegacy.h" |
| 113 | 113 | |
| 114 | 114 | |
| 115 | ADDRESS_MAP_START( primoa_port, ADDRESS_SPACE_IO, 8 ) | |
| 115 | static ADDRESS_MAP_START( primoa_port, ADDRESS_SPACE_IO, 8 ) | |
| 116 | 116 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 117 | 117 | AM_RANGE( 0x00, 0x3f ) AM_READWRITE( primo_be_1_r, primo_ki_1_w ) |
| 118 | 118 | AM_RANGE( 0xfd, 0xfd ) AM_WRITE( primo_FD_w ) |
| 119 | 119 | ADDRESS_MAP_END |
| 120 | 120 | |
| 121 | ADDRESS_MAP_START( primob_port, ADDRESS_SPACE_IO, 8 ) | |
| 121 | static ADDRESS_MAP_START( primob_port, ADDRESS_SPACE_IO, 8 ) | |
| 122 | 122 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 123 | 123 | AM_RANGE( 0x00, 0x3f ) AM_READWRITE( primo_be_1_r, primo_ki_1_w ) |
| 124 | 124 | AM_RANGE( 0x40, 0x7f ) AM_READWRITE( primo_be_2_r, primo_ki_2_w ) |
| 125 | 125 | AM_RANGE( 0xfd, 0xfd ) AM_WRITE( primo_FD_w ) |
| 126 | 126 | ADDRESS_MAP_END |
| 127 | 127 | |
| 128 | ADDRESS_MAP_START( primo32_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 128 | static ADDRESS_MAP_START( primo32_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 129 | 129 | AM_RANGE( 0x0000, 0x3fff ) AM_RAMBANK(1) |
| 130 | 130 | AM_RANGE( 0x4000, 0x7fff ) AM_RAM |
| 131 | 131 | ADDRESS_MAP_END |
| 132 | 132 | |
| 133 | ADDRESS_MAP_START( primo48_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 133 | static ADDRESS_MAP_START( primo48_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 134 | 134 | AM_RANGE( 0x0000, 0x3fff ) AM_RAMBANK(1) |
| 135 | 135 | AM_RANGE( 0x4000, 0x7fff ) AM_RAM |
| 136 | 136 | AM_RANGE( 0x8000, 0xbfff ) AM_RAM AM_MIRROR ( 0x4000 ) |
| 137 | 137 | ADDRESS_MAP_END |
| 138 | 138 | |
| 139 | ADDRESS_MAP_START( primo64_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 139 | static ADDRESS_MAP_START( primo64_mem, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 140 | 140 | AM_RANGE( 0x0000, 0x3fff ) AM_RAMBANK(1) |
| 141 | 141 | AM_RANGE( 0x4000, 0xffff ) AM_RAM |
| 142 | 142 | ADDRESS_MAP_END |
| r1432 | r1433 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | /* port i/o functions */ |
| 142 | 142 | |
| 143 | ADDRESS_MAP_START( ti81_io, ADDRESS_SPACE_IO, 8) | |
| 143 | static ADDRESS_MAP_START( ti81_io, ADDRESS_SPACE_IO, 8) | |
| 144 | 144 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 145 | 145 | AM_RANGE(0x0000, 0x0000) AM_READWRITE( ti85_port_0000_r, ti85_port_0000_w ) |
| 146 | 146 | AM_RANGE(0x0001, 0x0001) AM_READWRITE( ti85_port_0001_r, ti85_port_0001_w ) |
| r1432 | r1433 | |
| 151 | 151 | AM_RANGE(0x0007, 0x0007) AM_WRITE( ti81_port_0007_w) |
| 152 | 152 | ADDRESS_MAP_END |
| 153 | 153 | |
| 154 | ADDRESS_MAP_START( ti85_io, ADDRESS_SPACE_IO, 8) | |
| 154 | static ADDRESS_MAP_START( ti85_io, ADDRESS_SPACE_IO, 8) | |
| 155 | 155 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 156 | 156 | AM_RANGE(0x0000, 0x0000) AM_READWRITE( ti85_port_0000_r, ti85_port_0000_w ) |
| 157 | 157 | AM_RANGE(0x0001, 0x0001) AM_READWRITE( ti85_port_0001_r, ti85_port_0001_w ) |
| r1432 | r1433 | |
| 163 | 163 | AM_RANGE(0x0007, 0x0007) AM_READWRITE( ti85_port_0007_r, ti85_port_0007_w ) |
| 164 | 164 | ADDRESS_MAP_END |
| 165 | 165 | |
| 166 | ADDRESS_MAP_START( ti86_io, ADDRESS_SPACE_IO, 8) | |
| 166 | static ADDRESS_MAP_START( ti86_io, ADDRESS_SPACE_IO, 8) | |
| 167 | 167 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 168 | 168 | AM_RANGE(0x0000, 0x0000) AM_READWRITE( ti85_port_0000_r, ti85_port_0000_w ) |
| 169 | 169 | AM_RANGE(0x0001, 0x0001) AM_READWRITE( ti85_port_0001_r, ti85_port_0001_w ) |
| r1432 | r1433 | |
| 177 | 177 | |
| 178 | 178 | /* memory w/r functions */ |
| 179 | 179 | |
| 180 | ADDRESS_MAP_START( ti81_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 180 | static ADDRESS_MAP_START( ti81_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 181 | 181 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE( MRA8_BANK1, MWA8_BANK3 ) |
| 182 | 182 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE( MRA8_BANK2, MWA8_BANK4 ) |
| 183 | 183 | AM_RANGE(0x8000, 0xffff) AM_RAM |
| 184 | 184 | ADDRESS_MAP_END |
| 185 | 185 | |
| 186 | ADDRESS_MAP_START( ti85_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 186 | static ADDRESS_MAP_START( ti85_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 187 | 187 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE( MRA8_BANK1, MWA8_BANK3 ) |
| 188 | 188 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE( MRA8_BANK2, MWA8_BANK4 ) |
| 189 | 189 | AM_RANGE(0x8000, 0xffff) AM_RAM |
| 190 | 190 | ADDRESS_MAP_END |
| 191 | 191 | |
| 192 | ADDRESS_MAP_START( ti86_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 192 | static ADDRESS_MAP_START( ti86_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 193 | 193 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE( MRA8_BANK1, MWA8_BANK5 ) |
| 194 | 194 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE( MRA8_BANK2, MWA8_BANK6 ) |
| 195 | 195 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE( MRA8_BANK3, MWA8_BANK7 ) |
| r1432 | r1433 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | static UINT8 *svision_reg; |
| 31 | 31 | |
| 32 | struct | |
| 32 | static struct | |
| 33 | 33 | { |
| 34 | 34 | emu_timer *timer1; |
| 35 | 35 | int timer_shot; |
| 36 | 36 | } svision; |
| 37 | 37 | |
| 38 | struct | |
| 38 | static struct | |
| 39 | 39 | { |
| 40 | 40 | int state; |
| 41 | 41 | int on, clock, data; |
| r1432 | r1433 | |
| 43 | 43 | emu_timer *timer; |
| 44 | 44 | } svision_pet; |
| 45 | 45 | |
| 46 | struct | |
| 46 | static struct | |
| 47 | 47 | { |
| 48 | 48 | UINT16 palette[4/*0x40?*/]; /* rgb8 */ |
| 49 | 49 | int palette_on; |
| r1432 | r1433 | |
| 471 | 471 | tvlink.palette[3] = MAKE24_RGB15(svisionp_palette[(PALETTE_START+3)*3+0], svisionp_palette[(PALETTE_START+3)*3+1], svisionp_palette[(PALETTE_START+3)*3+2]); |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | struct CustomSound_interface svision_sound_interface = | |
| 474 | static struct CustomSound_interface svision_sound_interface = | |
| 475 | 475 | { |
| 476 | 476 | svision_custom_start |
| 477 | 477 | }; |
| r1432 | r1433 | |
|---|---|---|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| 132 | int device_load_genesis_cart(mess_image *image) | |
| 132 | static int device_load_genesis_cart(mess_image *image) | |
| 133 | 133 | { |
| 134 | 134 | unsigned char *tmpROMnew, *tmpROM; |
| 135 | 135 | unsigned char *secondhalf; |
| r1432 | r1433 | |
| 272 | 272 | CONFIG_DEVICE(genesis_cartslot_getinfo) |
| 273 | 273 | SYSTEM_CONFIG_END |
| 274 | 274 | |
| 275 | WRITE16_HANDLER( genesis_ssf2_bank_w ) | |
| 275 | static WRITE16_HANDLER( genesis_ssf2_bank_w ) | |
| 276 | 276 | { |
| 277 | 277 | UINT8 *ROM = memory_region(REGION_CPU1); |
| 278 | 278 |
| r1432 | r1433 | |
|---|---|---|
| 65 | 65 | #define PCE_CD_CLOCK 9216000 |
| 66 | 66 | |
| 67 | 67 | |
| 68 | ADDRESS_MAP_START( pce_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 68 | static ADDRESS_MAP_START( pce_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 69 | 69 | AM_RANGE( 0x000000, 0x07FFFF) AM_ROMBANK(1) |
| 70 | 70 | AM_RANGE( 0x080000, 0x087FFF) AM_ROMBANK(2) |
| 71 | 71 | AM_RANGE( 0x088000, 0x0CFFFF) AM_ROMBANK(3) |
| r1432 | r1433 | |
| 84 | 84 | AM_RANGE( 0x1FF800, 0x1FFBFF) AM_READWRITE( pce_cd_intf_r, pce_cd_intf_w ) |
| 85 | 85 | ADDRESS_MAP_END |
| 86 | 86 | |
| 87 | ADDRESS_MAP_START( pce_io , ADDRESS_SPACE_IO, 8) | |
| 87 | static ADDRESS_MAP_START( pce_io , ADDRESS_SPACE_IO, 8) | |
| 88 | 88 | AM_RANGE( 0x00, 0x03) AM_READWRITE( vdc_0_r, vdc_0_w ) |
| 89 | 89 | ADDRESS_MAP_END |
| 90 | 90 | |
| 91 | ADDRESS_MAP_START( sgx_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 91 | static ADDRESS_MAP_START( sgx_mem , ADDRESS_SPACE_PROGRAM, 8) | |
| 92 | 92 | AM_RANGE( 0x000000, 0x07FFFF) AM_ROMBANK(1) |
| 93 | 93 | AM_RANGE( 0x080000, 0x087FFF) AM_ROMBANK(2) |
| 94 | 94 | AM_RANGE( 0x088000, 0x0CFFFF) AM_ROMBANK(3) |
| r1432 | r1433 | |
| 109 | 109 | AM_RANGE( 0x1FF800, 0x1FFBFF) AM_READWRITE( pce_cd_intf_r, pce_cd_intf_w ) |
| 110 | 110 | ADDRESS_MAP_END |
| 111 | 111 | |
| 112 | ADDRESS_MAP_START( sgx_io , ADDRESS_SPACE_IO, 8) | |
| 112 | static ADDRESS_MAP_START( sgx_io , ADDRESS_SPACE_IO, 8) | |
| 113 | 113 | AM_RANGE( 0x00, 0x03) AM_READWRITE( sgx_vdc_r, sgx_vdc_w ) |
| 114 | 114 | ADDRESS_MAP_END |
| 115 | 115 |
| r1432 | r1433 | |
|---|---|---|
| 603 | 603 | 32768 /* data cache size */ |
| 604 | 604 | }; |
| 605 | 605 | |
| 606 | MACHINE_DRIVER_START( ip204415 ) | |
| 606 | static MACHINE_DRIVER_START( ip204415 ) | |
| 607 | 607 | MDRV_CPU_ADD_TAG( "main", R4600BE, 50000000*3 ) |
| 608 | 608 | MDRV_CPU_CONFIG( config ) |
| 609 | 609 | MDRV_CPU_PROGRAM_MAP( ip204415_map, 0 ) |
| r1432 | r1433 | |
|---|---|---|
| 30 | 30 | #include "includes/galaxy.h" |
| 31 | 31 | #include "devices/snapquik.h" |
| 32 | 32 | |
| 33 | ADDRESS_MAP_START (galaxy_readport, ADDRESS_SPACE_IO, 8) | |
| 33 | static ADDRESS_MAP_START (galaxy_readport, ADDRESS_SPACE_IO, 8) | |
| 34 | 34 | ADDRESS_MAP_END |
| 35 | 35 | |
| 36 | ADDRESS_MAP_START (galaxy_writeport, ADDRESS_SPACE_IO, 8) | |
| 36 | static ADDRESS_MAP_START (galaxy_writeport, ADDRESS_SPACE_IO, 8) | |
| 37 | 37 | ADDRESS_MAP_END |
| 38 | 38 | |
| 39 | 39 | |
| 40 | ADDRESS_MAP_START (galaxy_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 40 | static ADDRESS_MAP_START (galaxy_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 41 | 41 | AM_RANGE(0x0000, 0x0fff) AM_READWRITE(MRA8_ROM, MWA8_ROM) |
| 42 | 42 | AM_RANGE(0x2000, 0x2037) AM_MIRROR(0x07c0) AM_READ( galaxy_keyboard_r ) |
| 43 | 43 | AM_RANGE(0x2038, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE( galaxy_latch_r, galaxy_latch_w ) |
| r1432 | r1433 | |
|---|---|---|
| 37 | 37 | TMS9928A_interrupt(); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | INPUT_PORTS_START( bbcbc ) | |
| 40 | static INPUT_PORTS_START( bbcbc ) | |
| 41 | 41 | INPUT_PORTS_END |
| 42 | 42 | |
| 43 | 43 | static const TMS9928a_interface tms9129_interface = |
| r1432 | r1433 | |
|---|---|---|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | |
| 115 | ADDRESS_MAP_START(kc85_4_io, ADDRESS_SPACE_IO, 8) | |
| 115 | static ADDRESS_MAP_START(kc85_4_io, ADDRESS_SPACE_IO, 8) | |
| 116 | 116 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 117 | 117 | AM_RANGE(0x0000, 0x0ffff) AM_READWRITE( kc85_4_port_r, kc85_4_port_w ) |
| 118 | 118 | ADDRESS_MAP_END |
| 119 | 119 | |
| 120 | 120 | |
| 121 | #ifdef UNUSED_FUNCTION | |
| 121 | 122 | static READ8_HANDLER(kc85_4d_port_r) |
| 122 | 123 | { |
| 123 | 124 | int port; |
| r1432 | r1433 | |
| 214 | 215 | ADDRESS_MAP_START(kc85_4d_io, ADDRESS_SPACE_IO, 8) |
| 215 | 216 | AM_RANGE(0x0000, 0x0ffff) AM_READWRITE(kc85_4d_port_r, kc85_4d_port_w) |
| 216 | 217 | ADDRESS_MAP_END |
| 218 | #endif | |
| 217 | 219 | |
| 218 | ADDRESS_MAP_START(kc85_4_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 220 | static ADDRESS_MAP_START(kc85_4_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 219 | 221 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK7) |
| 220 | 222 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK8) |
| 221 | 223 | AM_RANGE(0x8000, 0xa7ff) AM_READWRITE(MRA8_BANK3, MWA8_BANK9) |
| r1432 | r1433 | |
| 225 | 227 | AM_RANGE(0xe000, 0xffff) AM_READ(MRA8_BANK6) |
| 226 | 228 | ADDRESS_MAP_END |
| 227 | 229 | |
| 228 | ADDRESS_MAP_START(kc85_3_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 230 | static ADDRESS_MAP_START(kc85_3_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 229 | 231 | AM_RANGE(0x0000, 0x3fff) AM_READWRITE(MRA8_BANK1, MWA8_BANK6) |
| 230 | 232 | AM_RANGE(0x4000, 0x7fff) AM_READWRITE(MRA8_BANK2, MWA8_BANK7) |
| 231 | 233 | AM_RANGE(0x8000, 0xbfff) AM_READWRITE(MRA8_BANK3, MWA8_BANK8) |
| r1432 | r1433 | |
| 295 | 297 | } |
| 296 | 298 | |
| 297 | 299 | |
| 298 | ADDRESS_MAP_START(kc85_3_io, ADDRESS_SPACE_IO, 8) | |
| 300 | static ADDRESS_MAP_START(kc85_3_io, ADDRESS_SPACE_IO, 8) | |
| 299 | 301 | ADDRESS_MAP_FLAGS( AMEF_ABITS(8) ) |
| 300 | 302 | AM_RANGE(0x0000, 0x0ffff) AM_READWRITE(kc85_3_port_r, kc85_3_port_w) |
| 301 | 303 | ADDRESS_MAP_END |
| r1432 | r1433 | |
| 310 | 312 | /********************/ |
| 311 | 313 | /** DISC INTERFACE **/ |
| 312 | 314 | |
| 313 | ADDRESS_MAP_START(kc85_disc_hw_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 315 | static ADDRESS_MAP_START(kc85_disc_hw_mem, ADDRESS_SPACE_PROGRAM, 8) | |
| 314 | 316 | AM_RANGE(0x0000, 0x0ffff) AM_RAM |
| 315 | 317 | ADDRESS_MAP_END |
| 316 | 318 | |
| 317 | ADDRESS_MAP_START(kc85_disc_hw_io, ADDRESS_SPACE_IO, 8) | |
| 319 | static ADDRESS_MAP_START(kc85_disc_hw_io, ADDRESS_SPACE_IO, 8) | |
| 318 | 320 | AM_RANGE(0x0f0, 0x0f0) AM_READ(nec765_status_r) |
| 319 | 321 | AM_RANGE(0x0f1, 0x0f1) AM_READWRITE(nec765_data_r, nec765_data_w) |
| 320 | 322 | AM_RANGE(0x0f2, 0x0f3) AM_READWRITE(nec765_dack_r, nec765_dack_w) |
| Previous | 15994 Revisions | Next |