mirror of
https://github.com/InvisibleUp/uvmac.git
synced 2025-01-21 16:30:02 +00:00
Replace custom integer types with C stdint.h defs
This commit is contained in:
parent
3a7773e3cf
commit
2373c19e72
493
build.sh
493
build.sh
@ -1,493 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
my_project_d=./bin/
|
||||
|
||||
# ----- make output directory -----
|
||||
|
||||
my_obj_d="${my_project_d}bld/"
|
||||
if test ! -d "${my_obj_d}" ; then
|
||||
mkdir "${my_obj_d}"
|
||||
fi
|
||||
|
||||
|
||||
# ----- Dummy -----
|
||||
|
||||
DestFile="${my_obj_d}dummy.txt"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" 'This file is here because some archive extraction' >> "${DestFile}"
|
||||
printf "%s\n" 'software will not create an empty directory.' >> "${DestFile}"
|
||||
|
||||
|
||||
# ----- make configuration folder -----
|
||||
|
||||
my_config_d="${my_project_d}cfg/"
|
||||
if test ! -d "${my_config_d}" ; then
|
||||
mkdir "${my_config_d}"
|
||||
fi
|
||||
|
||||
|
||||
# ----- C Configuration file -----
|
||||
|
||||
DestFile="${my_config_d}CNFGGLOB.h"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" '/*' >> "${DestFile}"
|
||||
printf "%s\n" ' Configuration options used by both platform specific' >> "${DestFile}"
|
||||
printf "%s\n" ' and platform independent code.' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' This file is automatically generated by the build system,' >> "${DestFile}"
|
||||
printf "%s\n" ' which tries to know what options are valid in what' >> "${DestFile}"
|
||||
printf "%s\n" ' combinations. Avoid changing this file manually unless' >> "${DestFile}"
|
||||
printf "%s\n" ' you know what you'\''re doing.' >> "${DestFile}"
|
||||
printf "%s\n" '*/' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* adapt to current compiler/host processor */' >> "${DestFile}"
|
||||
printf "%s\n" '#ifdef __i386__' >> "${DestFile}"
|
||||
printf "%s\n" '#error "source is configured for 64 bit compiler"' >> "${DestFile}"
|
||||
printf "%s\n" '#endif' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define MayInline inline __attribute__((always_inline))' >> "${DestFile}"
|
||||
printf "%s\n" '#define MayNotInline __attribute__((noinline))' >> "${DestFile}"
|
||||
printf "%s\n" '#define SmallGlobals 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define cIncludeUnused 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define UnusedParam(p) (void) p' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* --- integer types ---- */' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef unsigned char ui3b;' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealui3b 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef signed char si3b;' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealsi3b 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef unsigned short ui4b;' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealui4b 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef short si4b;' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealsi4b 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef unsigned int ui5b;' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealui5b 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef int si5b;' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealsi5b 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealui6b 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define HaveRealsi6b 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* --- integer representation types ---- */' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef ui3b ui3r;' >> "${DestFile}"
|
||||
printf "%s\n" '#define ui3beqr 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef si3b si3r;' >> "${DestFile}"
|
||||
printf "%s\n" '#define si3beqr 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef ui4b ui4r;' >> "${DestFile}"
|
||||
printf "%s\n" '#define ui4beqr 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef si4b si4r;' >> "${DestFile}"
|
||||
printf "%s\n" '#define si4beqr 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef ui5b ui5r;' >> "${DestFile}"
|
||||
printf "%s\n" '#define ui5beqr 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'typedef si5b si5r;' >> "${DestFile}"
|
||||
printf "%s\n" '#define si5beqr 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* capabilities provided by platform specific code */' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define MySoundEnabled 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define MySoundRecenterSilence 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define kLn2SoundSampSz 3' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define dbglog_HAVE 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantAbnormalReports 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define NumDrives 6' >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeSonyRawMode 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeSonyGetName 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeSonyNew 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeSonyNameNew 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define vMacScreenHeight 342' >> "${DestFile}"
|
||||
printf "%s\n" '#define vMacScreenWidth 512' >> "${DestFile}"
|
||||
printf "%s\n" '#define vMacScreenDepth 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define kROM_Size 0x00020000' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludePbufs 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define NumPbufs 4' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define EnableMouseMotion 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeHostTextClipExchange 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define EnableAutoSlow 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmLocalTalk 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define AutoLocation 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define AutoTimeZone 1' >> "${DestFile}"
|
||||
|
||||
|
||||
# ----- C API Configuration file -----
|
||||
|
||||
DestFile="${my_config_d}CNFGRAPI.h"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" '/*' >> "${DestFile}"
|
||||
printf "%s\n" ' Configuration options used by platform specific code.' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' This file is automatically generated by the build system,' >> "${DestFile}"
|
||||
printf "%s\n" ' which tries to know what options are valid in what' >> "${DestFile}"
|
||||
printf "%s\n" ' combinations. Avoid changing this file manually unless' >> "${DestFile}"
|
||||
printf "%s\n" ' you know what you'\''re doing.' >> "${DestFile}"
|
||||
printf "%s\n" '*/' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#include <windows.h>' >> "${DestFile}"
|
||||
printf "%s\n" '#include <time.h>' >> "${DestFile}"
|
||||
printf "%s\n" '#include <shlobj.h>' >> "${DestFile}"
|
||||
printf "%s\n" '#include <tchar.h>' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define RomFileName "vMac.ROM"' >> "${DestFile}"
|
||||
printf "%s\n" '#define kCheckSumRom_Size 0x00020000' >> "${DestFile}"
|
||||
printf "%s\n" '#define kRomCheckSum1 0x4D1EEEE1' >> "${DestFile}"
|
||||
printf "%s\n" '#define kRomCheckSum2 0x4D1EEAE1' >> "${DestFile}"
|
||||
printf "%s\n" '#define kRomCheckSum3 0x4D1F8172' >> "${DestFile}"
|
||||
printf "%s\n" '#define RomStartCheckSum 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define EnableDragDrop 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define SaveDialogEnable 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define EnableAltKeysMode 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Control MKC_CM' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Command MKC_Command' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Option MKC_Option' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Shift MKC_Shift' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_CapsLock MKC_CapsLock' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Escape MKC_Escape' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_BackSlash MKC_BackSlash' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Slash MKC_Slash' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Grave MKC_Grave' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Enter MKC_Enter' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_PageUp MKC_PageUp' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_PageDown MKC_PageDown' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Home MKC_Home' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_End MKC_End' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_Help MKC_Help' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_ForwardDel MKC_ForwardDel' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_F1 MKC_Option' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_F2 MKC_Command' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_F3 MKC_F3' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_F4 MKC_F4' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_F5 MKC_F5' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_RControl MKC_CM' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_RCommand MKC_Command' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_ROption MKC_Option' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_formac_RShift MKC_Shift' >> "${DestFile}"
|
||||
printf "%s\n" '#define MKC_UnMappedKey MKC_Control' >> "${DestFile}"
|
||||
printf "%s\n" '#define VarFullScreen 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantInitFullScreen 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define MayFullScreen 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define MayNotFullScreen 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantInitMagnify 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EnableMagnify 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define MyWindowScale 2' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantInitRunInBackground 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantInitNotAutoSlow 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantInitSpeedValue 3' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantEnblCtrlInt 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantEnblCtrlRst 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantEnblCtrlKtg 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define NeedRequestInsertDisk 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define NeedDoMoreCommandsMsg 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define NeedDoAboutMsg 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define UseControlKeys 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define UseActvCode 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EnableDemoMsg 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* version and other info to display to user */' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define NeedIntlChars 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define ItnlKyBdFix 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define kStrAppName "Mini vMac"' >> "${DestFile}"
|
||||
printf "%s\n" '#define kAppVariationStr "minivmac-36.04-wx64"' >> "${DestFile}"
|
||||
printf "%s\n" '#define kStrCopyrightYear "2018"' >> "${DestFile}"
|
||||
printf "%s\n" '#define kMaintainerName "unknown"' >> "${DestFile}"
|
||||
printf "%s\n" '#define kStrHomePage "(unknown)"' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define kBldOpts "-br 36 -t wx64"' >> "${DestFile}"
|
||||
|
||||
|
||||
# ----- C Platform Independent Configuration file -----
|
||||
|
||||
DestFile="${my_config_d}EMCONFIG.h"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" '/*' >> "${DestFile}"
|
||||
printf "%s\n" ' Configuration options used by platform independent code.' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' This file is automatically generated by the build system,' >> "${DestFile}"
|
||||
printf "%s\n" ' which tries to know what options are valid in what' >> "${DestFile}"
|
||||
printf "%s\n" ' combinations. Avoid changing this file manually unless' >> "${DestFile}"
|
||||
printf "%s\n" ' you know what you'\''re doing.' >> "${DestFile}"
|
||||
printf "%s\n" '*/' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define EmClassicKbrd 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmADB 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmRTC 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmPMU 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmVIA2 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define Use68020 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmFPU 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmMMU 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define EmASC 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define CurEmMd kEmMd_Plus' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define kMyClockMult 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define WantCycByPriOp 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define WantCloserCyc 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define kRAMa_Size 0x00200000' >> "${DestFile}"
|
||||
printf "%s\n" '#define kRAMb_Size 0x00200000' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeVidMem 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define EmVidCard 0' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define MaxATTListN 16' >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeExtnPbufs 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define IncludeExtnHostTextClipExchange 1' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define Sony_SupportDC42 1' >> "${DestFile}"
|
||||
printf "%s\n" '#define Sony_SupportTags 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define Sony_WantChecksumsUpdated 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define Sony_VerifyChecksums 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define CaretBlinkTime 0x03' >> "${DestFile}"
|
||||
printf "%s\n" '#define SpeakerVol 0x07' >> "${DestFile}"
|
||||
printf "%s\n" '#define DoubleClickTime 0x05' >> "${DestFile}"
|
||||
printf "%s\n" '#define MenuBlink 0x03' >> "${DestFile}"
|
||||
printf "%s\n" '#define AutoKeyThresh 0x06' >> "${DestFile}"
|
||||
printf "%s\n" '#define AutoKeyRate 0x03' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* the Wire variables are 1/0, not true/false */' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'enum {' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA0_SoundVolb0,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SoundVolb0 (Wires[Wire_VIA1_iA0_SoundVolb0])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA0 (Wires[Wire_VIA1_iA0_SoundVolb0])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA1_SoundVolb1,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SoundVolb1 (Wires[Wire_VIA1_iA1_SoundVolb1])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA1 (Wires[Wire_VIA1_iA1_SoundVolb1])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA2_SoundVolb2,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SoundVolb2 (Wires[Wire_VIA1_iA2_SoundVolb2])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA2 (Wires[Wire_VIA1_iA2_SoundVolb2])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA4_MemOverlay,' >> "${DestFile}"
|
||||
printf "%s\n" '#define MemOverlay (Wires[Wire_VIA1_iA4_MemOverlay])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA4 (Wires[Wire_VIA1_iA4_MemOverlay])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA4_ChangeNtfy MemOverlay_ChangeNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA6_SCRNvPage2,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SCRNvPage2 (Wires[Wire_VIA1_iA6_SCRNvPage2])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA6 (Wires[Wire_VIA1_iA6_SCRNvPage2])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA5_IWMvSel,' >> "${DestFile}"
|
||||
printf "%s\n" '#define IWMvSel (Wires[Wire_VIA1_iA5_IWMvSel])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA5 (Wires[Wire_VIA1_iA5_IWMvSel])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA7_SCCwaitrq,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SCCwaitrq (Wires[Wire_VIA1_iA7_SCCwaitrq])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA7 (Wires[Wire_VIA1_iA7_SCCwaitrq])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB0_RTCdataLine,' >> "${DestFile}"
|
||||
printf "%s\n" '#define RTCdataLine (Wires[Wire_VIA1_iB0_RTCdataLine])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB0 (Wires[Wire_VIA1_iB0_RTCdataLine])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB0_ChangeNtfy RTCdataLine_ChangeNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB1_RTCclock,' >> "${DestFile}"
|
||||
printf "%s\n" '#define RTCclock (Wires[Wire_VIA1_iB1_RTCclock])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB1 (Wires[Wire_VIA1_iB1_RTCclock])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB1_ChangeNtfy RTCclock_ChangeNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB2_RTCunEnabled,' >> "${DestFile}"
|
||||
printf "%s\n" '#define RTCunEnabled (Wires[Wire_VIA1_iB2_RTCunEnabled])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB2 (Wires[Wire_VIA1_iB2_RTCunEnabled])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB2_ChangeNtfy RTCunEnabled_ChangeNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iA3_SoundBuffer,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SoundBuffer (Wires[Wire_VIA1_iA3_SoundBuffer])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iA3 (Wires[Wire_VIA1_iA3_SoundBuffer])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB3_MouseBtnUp,' >> "${DestFile}"
|
||||
printf "%s\n" '#define MouseBtnUp (Wires[Wire_VIA1_iB3_MouseBtnUp])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB3 (Wires[Wire_VIA1_iB3_MouseBtnUp])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB4_MouseX2,' >> "${DestFile}"
|
||||
printf "%s\n" '#define MouseX2 (Wires[Wire_VIA1_iB4_MouseX2])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB4 (Wires[Wire_VIA1_iB4_MouseX2])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB5_MouseY2,' >> "${DestFile}"
|
||||
printf "%s\n" '#define MouseY2 (Wires[Wire_VIA1_iB5_MouseY2])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB5 (Wires[Wire_VIA1_iB5_MouseY2])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iCB2_KybdDat,' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iCB2 (Wires[Wire_VIA1_iCB2_KybdDat])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iCB2_ChangeNtfy Kybd_DataLineChngNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB6_SCRNbeamInVid,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SCRNbeamInVid (Wires[Wire_VIA1_iB6_SCRNbeamInVid])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB6 (Wires[Wire_VIA1_iB6_SCRNbeamInVid])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_iB7_SoundDisable,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SoundDisable (Wires[Wire_VIA1_iB7_SoundDisable])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iB7 (Wires[Wire_VIA1_iB7_SoundDisable])' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_VIA1_InterruptRequest,' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_InterruptRequest (Wires[Wire_VIA1_InterruptRequest])' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_interruptChngNtfy VIAorSCCinterruptChngNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' Wire_SCCInterruptRequest,' >> "${DestFile}"
|
||||
printf "%s\n" '#define SCCInterruptRequest (Wires[Wire_SCCInterruptRequest])' >> "${DestFile}"
|
||||
printf "%s\n" '#define SCCinterruptChngNtfy VIAorSCCinterruptChngNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" ' kNumWires' >> "${DestFile}"
|
||||
printf "%s\n" '};' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '/* VIA configuration */' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_ORA_FloatVal 0xFF' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_ORB_FloatVal 0xFF' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_ORA_CanIn 0x80' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_ORA_CanOut 0x7F' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_ORB_CanIn 0x79' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_ORB_CanOut 0x87' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_IER_Never0 (1 << 1)' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_IER_Never1 ((1 << 3) | (1 << 4))' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_CB2modesAllowed 0x01' >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_CA2modesAllowed 0x01' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define Mouse_Enabled SCC_InterruptsEnabled' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iCA1_PulseNtfy VIA1_iCA1_Sixtieth_PulseNtfy' >> "${DestFile}"
|
||||
printf "%s\n" '#define Sixtieth_PulseNtfy VIA1_iCA1_Sixtieth_PulseNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define VIA1_iCA2_PulseNtfy VIA1_iCA2_RTC_OneSecond_PulseNtfy' >> "${DestFile}"
|
||||
printf "%s\n" '#define RTC_OneSecond_PulseNtfy VIA1_iCA2_RTC_OneSecond_PulseNtfy' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define GetSoundInvertTime VIA1_GetT1InvertTime' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define KYBD_ShiftInData VIA1_ShiftOutData' >> "${DestFile}"
|
||||
printf "%s\n" '#define KYBD_ShiftOutData VIA1_ShiftInData' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define kExtn_Block_Base 0x00F40000' >> "${DestFile}"
|
||||
printf "%s\n" '#define kExtn_ln2Spc 5' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define kROM_Base 0x00400000' >> "${DestFile}"
|
||||
printf "%s\n" '#define kROM_ln2Spc 20' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '#define WantDisasm 0' >> "${DestFile}"
|
||||
printf "%s\n" '#define ExtraAbnormalReports 0' >> "${DestFile}"
|
||||
|
||||
|
||||
# ----- Language Configuration file -----
|
||||
|
||||
DestFile="${my_config_d}STRCONST.h"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" '#include "STRCNENG.h"' >> "${DestFile}"
|
||||
|
||||
|
||||
# ----- Resource Configuration file -----
|
||||
|
||||
DestFile="${my_config_d}main.rc"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" '256 ICON DISCARDABLE "ICONAPPW.ico"' >> "${DestFile}"
|
||||
|
||||
|
||||
# ----- Make file -----
|
||||
|
||||
DestFile="${my_project_d}Makefile"
|
||||
printf "" > "${DestFile}"
|
||||
|
||||
printf "%s\n" '# make file generated by gryphel build system' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'mk_COptionsCommon = -c -Wall -Wmissing-prototypes -Wno-uninitialized -Wundef -Wstrict-prototypes -Icfg/ -Isrc/' >> "${DestFile}"
|
||||
printf "%s\n" 'mk_COptionsOSGLU = $(mk_COptionsCommon) -Os' >> "${DestFile}"
|
||||
printf "%s\n" 'mk_COptions = $(mk_COptionsCommon) -Os' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" '.PHONY: TheDefaultOutput clean' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'TheDefaultOutput : minivmac.exe' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'bld/OSGLUWIN.o : src/OSGLUWIN.c src/STRCNENG.h cfg/STRCONST.h src/INTLCHAR.h src/COMOSGLU.h src/CONTROLM.h cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/OSGLUWIN.c" -o "bld/OSGLUWIN.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/GLOBGLUE.o : src/GLOBGLUE.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/GLOBGLUE.c" -o "bld/GLOBGLUE.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/M68KITAB.o : src/M68KITAB.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/M68KITAB.c" -o "bld/M68KITAB.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/MINEM68K.o : src/MINEM68K.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/MINEM68K.c" -o "bld/MINEM68K.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/VIAEMDEV.o : src/VIAEMDEV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/VIAEMDEV.c" -o "bld/VIAEMDEV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/IWMEMDEV.o : src/IWMEMDEV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/IWMEMDEV.c" -o "bld/IWMEMDEV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/SCCEMDEV.o : src/SCCEMDEV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/SCCEMDEV.c" -o "bld/SCCEMDEV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/RTCEMDEV.o : src/RTCEMDEV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/RTCEMDEV.c" -o "bld/RTCEMDEV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/ROMEMDEV.o : src/ROMEMDEV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/ROMEMDEV.c" -o "bld/ROMEMDEV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/SCSIEMDV.o : src/SCSIEMDV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/SCSIEMDV.c" -o "bld/SCSIEMDV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/SONYEMDV.o : src/SONYEMDV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/SONYEMDV.c" -o "bld/SONYEMDV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/SCRNEMDV.o : src/SCRNEMDV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/SCRNEMDV.c" -o "bld/SCRNEMDV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/MOUSEMDV.o : src/MOUSEMDV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/MOUSEMDV.c" -o "bld/MOUSEMDV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/KBRDEMDV.o : src/KBRDEMDV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/KBRDEMDV.c" -o "bld/KBRDEMDV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/SNDEMDEV.o : src/SNDEMDEV.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/SNDEMDEV.c" -o "bld/SNDEMDEV.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "%s\n" 'bld/PROGMAIN.o : src/PROGMAIN.c cfg/CNFGGLOB.h' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc "src/PROGMAIN.c" -o "bld/PROGMAIN.o" $(mk_COptions)' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'ObjFiles = \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/MINEM68K.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/OSGLUWIN.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/GLOBGLUE.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/M68KITAB.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/VIAEMDEV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/IWMEMDEV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/SCCEMDEV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/RTCEMDEV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/ROMEMDEV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/SCSIEMDV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/SONYEMDV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/SCRNEMDV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/MOUSEMDV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/KBRDEMDV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/SNDEMDEV.o \' >> "${DestFile}"
|
||||
printf "%s\n" ' bld/PROGMAIN.o \' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'bld/: cfg/main.r' >> "${DestFile}"
|
||||
printf "%s\n" ' windres.exe -i "cfg/main.r" --input-format=rc -o "bld/" -O coff --include-dir SRC' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'minivmac.exe : $(ObjFiles) bld/' >> "${DestFile}"
|
||||
printf "%s\n" ' gcc \' >> "${DestFile}"
|
||||
printf "%s\n" ' -o "minivmac.exe" \' >> "${DestFile}"
|
||||
printf "%s\n" ' $(ObjFiles) "bld/" -mwindows -lwinmm -lole32 -luuid' >> "${DestFile}"
|
||||
printf "\n" >> "${DestFile}"
|
||||
printf "%s\n" 'clean :' >> "${DestFile}"
|
||||
printf "%s\n" ' rm -f $(ObjFiles)' >> "${DestFile}"
|
||||
printf "%s\n" ' rm -f "bld/"' >> "${DestFile}"
|
||||
printf "%s\n" ' rm -f "minivmac.exe"' >> "${DestFile}"
|
@ -13,55 +13,14 @@
|
||||
#error "source is configured for 64 bit compiler"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define MayInline inline __attribute__((always_inline))
|
||||
#define MayNotInline __attribute__((noinline))
|
||||
#define SmallGlobals 0
|
||||
#define cIncludeUnused 0
|
||||
#define UnusedParam(p) (void) p
|
||||
|
||||
/* --- integer types ---- */
|
||||
|
||||
typedef unsigned char ui3b;
|
||||
#define HaveRealui3b 1
|
||||
|
||||
typedef signed char si3b;
|
||||
#define HaveRealsi3b 1
|
||||
|
||||
typedef unsigned short ui4b;
|
||||
#define HaveRealui4b 1
|
||||
|
||||
typedef short si4b;
|
||||
#define HaveRealsi4b 1
|
||||
|
||||
typedef unsigned int ui5b;
|
||||
#define HaveRealui5b 1
|
||||
|
||||
typedef int si5b;
|
||||
#define HaveRealsi5b 1
|
||||
|
||||
#define HaveRealui6b 0
|
||||
#define HaveRealsi6b 0
|
||||
|
||||
/* --- integer representation types ---- */
|
||||
|
||||
typedef ui3b ui3r;
|
||||
#define ui3beqr 1
|
||||
|
||||
typedef si3b si3r;
|
||||
#define si3beqr 1
|
||||
|
||||
typedef ui4b ui4r;
|
||||
#define ui4beqr 1
|
||||
|
||||
typedef si4b si4r;
|
||||
#define si4beqr 1
|
||||
|
||||
typedef ui5b ui5r;
|
||||
#define ui5beqr 1
|
||||
|
||||
typedef si5b si5r;
|
||||
#define si5beqr 1
|
||||
|
||||
/* capabilities provided by platform specific code */
|
||||
|
||||
#define MySoundEnabled 1
|
||||
|
@ -35,17 +35,17 @@
|
||||
ReportAbnormalID unused 0x0C06 - 0x0CFF
|
||||
*/
|
||||
|
||||
IMPORTPROC ADB_ShiftOutData(ui3b v);
|
||||
IMPORTFUNC ui3b ADB_ShiftInData(void);
|
||||
IMPORTPROC ADB_ShiftOutData(uint8_t v);
|
||||
IMPORTFUNC uint8_t ADB_ShiftInData(void);
|
||||
|
||||
#include "ADBSHARE.h"
|
||||
|
||||
LOCALVAR blnr ADB_ListenDatBuf;
|
||||
LOCALVAR ui3b ADB_IndexDatBuf;
|
||||
LOCALVAR uint8_t ADB_IndexDatBuf;
|
||||
|
||||
GLOBALPROC ADB_DoNewState(void)
|
||||
{
|
||||
ui3b state = ADB_st1 * 2 + ADB_st0;
|
||||
uint8_t state = ADB_st1 * 2 + ADB_st0;
|
||||
#ifdef _VIA_Debug
|
||||
fprintf(stderr, "ADB_DoNewState: %d\n", state);
|
||||
#endif
|
||||
@ -188,7 +188,7 @@ GLOBALPROC ADB_DataLineChngNtfy(void)
|
||||
|
||||
GLOBALPROC ADB_Update(void)
|
||||
{
|
||||
ui3b state = ADB_st1 * 2 + ADB_st0;
|
||||
uint8_t state = ADB_st1 * 2 + ADB_st0;
|
||||
|
||||
if (state == 3) { /* idle */
|
||||
if (ADB_TalkDatBuf) {
|
||||
|
@ -32,16 +32,16 @@
|
||||
|
||||
#define ADB_MaxSzDatBuf 8
|
||||
|
||||
LOCALVAR ui3b ADB_SzDatBuf;
|
||||
LOCALVAR uint8_t ADB_SzDatBuf;
|
||||
LOCALVAR blnr ADB_TalkDatBuf = falseblnr;
|
||||
LOCALVAR ui3b ADB_DatBuf[ADB_MaxSzDatBuf];
|
||||
LOCALVAR ui3b ADB_CurCmd = 0;
|
||||
LOCALVAR ui3b NotSoRandAddr = 1;
|
||||
LOCALVAR uint8_t ADB_DatBuf[ADB_MaxSzDatBuf];
|
||||
LOCALVAR uint8_t ADB_CurCmd = 0;
|
||||
LOCALVAR uint8_t NotSoRandAddr = 1;
|
||||
|
||||
LOCALVAR ui3b MouseADBAddress;
|
||||
LOCALVAR uint8_t MouseADBAddress;
|
||||
LOCALVAR blnr SavedCurMouseButton = falseblnr;
|
||||
LOCALVAR ui4r MouseADBDeltaH = 0;
|
||||
LOCALVAR ui4r MouseADBDeltaV = 0;
|
||||
LOCALVAR uint16_t MouseADBDeltaH = 0;
|
||||
LOCALVAR uint16_t MouseADBDeltaV = 0;
|
||||
|
||||
LOCALPROC ADB_DoMouseTalk(void)
|
||||
{
|
||||
@ -49,8 +49,8 @@ LOCALPROC ADB_DoMouseTalk(void)
|
||||
case 0:
|
||||
{
|
||||
MyEvtQEl *p;
|
||||
ui4b partH;
|
||||
ui4b partV;
|
||||
uint16_t partH;
|
||||
uint16_t partV;
|
||||
blnr overflow = falseblnr;
|
||||
blnr MouseButtonChange = falseblnr;
|
||||
|
||||
@ -64,10 +64,10 @@ LOCALPROC ADB_DoMouseTalk(void)
|
||||
partH = MouseADBDeltaH;
|
||||
partV = MouseADBDeltaV;
|
||||
|
||||
if ((si4b)MouseADBDeltaH < 0) {
|
||||
if ((int16_t)MouseADBDeltaH < 0) {
|
||||
partH = - partH;
|
||||
}
|
||||
if ((si4b)MouseADBDeltaV < 0) {
|
||||
if ((int16_t)MouseADBDeltaV < 0) {
|
||||
partV = - partV;
|
||||
}
|
||||
if ((partH >> 6) > 0) {
|
||||
@ -78,10 +78,10 @@ LOCALPROC ADB_DoMouseTalk(void)
|
||||
overflow = trueblnr;
|
||||
partV = (1 << 6) - 1;
|
||||
}
|
||||
if ((si4b)MouseADBDeltaH < 0) {
|
||||
if ((int16_t)MouseADBDeltaH < 0) {
|
||||
partH = - partH;
|
||||
}
|
||||
if ((si4b)MouseADBDeltaV < 0) {
|
||||
if ((int16_t)MouseADBDeltaV < 0) {
|
||||
partV = - partV;
|
||||
}
|
||||
MouseADBDeltaH -= partH;
|
||||
@ -137,9 +137,9 @@ LOCALPROC ADB_DoMouseListen(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui3b KeyboardADBAddress;
|
||||
LOCALVAR uint8_t KeyboardADBAddress;
|
||||
|
||||
LOCALFUNC blnr CheckForADBkeyEvt(ui3b *NextADBkeyevt)
|
||||
LOCALFUNC blnr CheckForADBkeyEvt(uint8_t *NextADBkeyevt)
|
||||
{
|
||||
int i;
|
||||
blnr KeyDown;
|
||||
@ -182,7 +182,7 @@ LOCALPROC ADB_DoKeyboardTalk(void)
|
||||
switch (ADB_CurCmd & 3) {
|
||||
case 0:
|
||||
{
|
||||
ui3b NextADBkeyevt;
|
||||
uint8_t NextADBkeyevt;
|
||||
|
||||
if (CheckForADBkeyEvt(&NextADBkeyevt)) {
|
||||
ADB_SzDatBuf = 2;
|
||||
@ -249,7 +249,7 @@ LOCALFUNC blnr CheckForADBanyEvt(void)
|
||||
|
||||
LOCALPROC ADB_DoTalk(void)
|
||||
{
|
||||
ui3b Address = ADB_CurCmd >> 4;
|
||||
uint8_t Address = ADB_CurCmd >> 4;
|
||||
if (Address == MouseADBAddress) {
|
||||
ADB_DoMouseTalk();
|
||||
} else if (Address == KeyboardADBAddress) {
|
||||
@ -259,7 +259,7 @@ LOCALPROC ADB_DoTalk(void)
|
||||
|
||||
LOCALPROC ADB_EndListen(void)
|
||||
{
|
||||
ui3b Address = ADB_CurCmd >> 4;
|
||||
uint8_t Address = ADB_CurCmd >> 4;
|
||||
if (Address == MouseADBAddress) {
|
||||
ADB_DoMouseListen();
|
||||
} else if (Address == KeyboardADBAddress) {
|
||||
@ -275,7 +275,7 @@ LOCALPROC ADB_DoReset(void)
|
||||
|
||||
LOCALPROC ADB_Flush(void)
|
||||
{
|
||||
ui3b Address = ADB_CurCmd >> 4;
|
||||
uint8_t Address = ADB_CurCmd >> 4;
|
||||
|
||||
if ((Address == KeyboardADBAddress)
|
||||
|| (Address == MouseADBAddress))
|
||||
|
@ -47,7 +47,7 @@ LOCALPROC CheckAltKeyUseMode(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC Keyboard_UpdateKeyMap1(ui3r key, blnr down)
|
||||
LOCALPROC Keyboard_UpdateKeyMap1(uint8_t key, blnr down)
|
||||
{
|
||||
if (MKC_Command == key) {
|
||||
AltKeysTrueCmnd = down;
|
||||
@ -171,7 +171,7 @@ LOCALPROC Keyboard_UpdateKeyMap1(ui3r key, blnr down)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DisconnectKeyCodes1(ui5b KeepMask)
|
||||
LOCALPROC DisconnectKeyCodes1(uint32_t KeepMask)
|
||||
{
|
||||
DisconnectKeyCodes(KeepMask);
|
||||
|
||||
|
120
src/ASCEMDEV.c
120
src/ASCEMDEV.c
@ -33,27 +33,27 @@
|
||||
ReportAbnormalID unused 0x0F0E, 0x0F1E - 0x0FFF
|
||||
*/
|
||||
|
||||
LOCALVAR ui3r SoundReg801 = 0;
|
||||
LOCALVAR ui3r SoundReg802 = 0;
|
||||
LOCALVAR ui3r SoundReg803 = 0;
|
||||
LOCALVAR ui3r SoundReg804 = 0;
|
||||
LOCALVAR ui3r SoundReg805 = 0;
|
||||
LOCALVAR ui3r SoundReg_Volume = 0; /* 0x806 */
|
||||
/* LOCALVAR ui3r SoundReg807 = 0; */
|
||||
LOCALVAR uint8_t SoundReg801 = 0;
|
||||
LOCALVAR uint8_t SoundReg802 = 0;
|
||||
LOCALVAR uint8_t SoundReg803 = 0;
|
||||
LOCALVAR uint8_t SoundReg804 = 0;
|
||||
LOCALVAR uint8_t SoundReg805 = 0;
|
||||
LOCALVAR uint8_t SoundReg_Volume = 0; /* 0x806 */
|
||||
/* LOCALVAR uint8_t SoundReg807 = 0; */
|
||||
|
||||
LOCALVAR ui3b ASC_SampBuff[0x800];
|
||||
LOCALVAR uint8_t ASC_SampBuff[0x800];
|
||||
|
||||
struct ASC_ChanR {
|
||||
ui3b freq[4];
|
||||
ui3b phase[4];
|
||||
uint8_t freq[4];
|
||||
uint8_t phase[4];
|
||||
};
|
||||
typedef struct ASC_ChanR ASC_ChanR;
|
||||
|
||||
LOCALVAR ASC_ChanR ASC_ChanA[4];
|
||||
|
||||
LOCALVAR ui4b ASC_FIFO_Out = 0;
|
||||
LOCALVAR ui4b ASC_FIFO_InA = 0;
|
||||
LOCALVAR ui4b ASC_FIFO_InB = 0;
|
||||
LOCALVAR uint16_t ASC_FIFO_Out = 0;
|
||||
LOCALVAR uint16_t ASC_FIFO_InA = 0;
|
||||
LOCALVAR uint16_t ASC_FIFO_InB = 0;
|
||||
LOCALVAR blnr ASC_Playing = falseblnr;
|
||||
|
||||
#define ASC_dolog (dbglog_HAVE && 0)
|
||||
@ -65,23 +65,23 @@ IMPORTPROC ASC_interrupt_PulseNtfy(void);
|
||||
LOCALPROC ASC_RecalcStatus(void)
|
||||
{
|
||||
if ((1 == SoundReg801) && ASC_Playing) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) {
|
||||
SoundReg804 &= ~ 0x01;
|
||||
} else {
|
||||
SoundReg804 |= 0x01;
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400) {
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400) {
|
||||
SoundReg804 |= 0x02;
|
||||
} else {
|
||||
SoundReg804 &= ~ 0x02;
|
||||
}
|
||||
if (0 != (SoundReg802 & 2)) {
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200) {
|
||||
SoundReg804 &= ~ 0x04;
|
||||
} else {
|
||||
SoundReg804 |= 0x04;
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400) {
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400) {
|
||||
SoundReg804 |= 0x08;
|
||||
} else {
|
||||
SoundReg804 &= ~ 0x08;
|
||||
@ -99,13 +99,13 @@ LOCALPROC ASC_ClearFIFO(void)
|
||||
ASC_RecalcStatus();
|
||||
}
|
||||
|
||||
GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
GLOBALFUNC uint32_t ASC_Access(uint32_t Data, blnr WriteMem, CPTR addr)
|
||||
{
|
||||
if (addr < 0x800) {
|
||||
if (WriteMem) {
|
||||
if (1 == SoundReg801) {
|
||||
if (0 == (addr & 0x400)) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400)
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400)
|
||||
{
|
||||
#if 0 /* seems to happen in tetris */
|
||||
ReportAbnormalID(0x0F01,
|
||||
@ -117,7 +117,7 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
ASC_SampBuff[ASC_FIFO_InA & 0x3FF] = Data;
|
||||
|
||||
++ASC_FIFO_InA;
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200)
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200)
|
||||
{
|
||||
if (0 != (SoundReg804 & 0x01)) {
|
||||
/* happens normally */
|
||||
@ -128,7 +128,7 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
SoundReg804 |= 0x01;
|
||||
#endif
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400)
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400)
|
||||
{
|
||||
SoundReg804 |= 0x02;
|
||||
#if ASC_dolog
|
||||
@ -148,7 +148,7 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
ReportAbnormalID(0x0F03,
|
||||
"ASC - Channel B for Mono");
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400)
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400)
|
||||
{
|
||||
ReportAbnormalID(0x0F04,
|
||||
"ASC - Channel B Overflow");
|
||||
@ -158,7 +158,7 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
ASC_SampBuff[0x400 + (ASC_FIFO_InB & 0x3FF)] = Data;
|
||||
|
||||
++ASC_FIFO_InB;
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200)
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200)
|
||||
{
|
||||
if (0 != (SoundReg804 & 0x04)) {
|
||||
/* happens normally */
|
||||
@ -169,7 +169,7 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
SoundReg804 |= 0x04;
|
||||
#endif
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400)
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400)
|
||||
{
|
||||
SoundReg804 |= 0x08;
|
||||
#if ASC_dolog
|
||||
@ -459,8 +459,8 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
break;
|
||||
}
|
||||
} else if (addr < 0x830) {
|
||||
ui3r b = addr & 3;
|
||||
ui3r chan = ((addr - 0x810) >> 3) & 3;
|
||||
uint8_t b = addr & 3;
|
||||
uint8_t chan = ((addr - 0x810) >> 3) & 3;
|
||||
|
||||
if (0 != (addr & 4)) {
|
||||
|
||||
@ -517,7 +517,7 @@ GLOBALFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
= {approx} (x - kCenterSound) / (8 - SoundVolume) + kCenterSound;
|
||||
*/
|
||||
|
||||
LOCALVAR const ui4b vol_mult[] = {
|
||||
LOCALVAR const uint16_t vol_mult[] = {
|
||||
8192, 9362, 10922, 13107, 16384, 21845, 32768
|
||||
};
|
||||
|
||||
@ -531,21 +531,21 @@ LOCALVAR const trSoundSamp vol_offset[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
LOCALVAR const ui3r SubTick_n[kNumSubTicks] = {
|
||||
LOCALVAR const uint8_t SubTick_n[kNumSubTicks] = {
|
||||
23, 23, 23, 23, 23, 23, 23, 24,
|
||||
23, 23, 23, 23, 23, 23, 23, 24
|
||||
};
|
||||
|
||||
GLOBALPROC ASC_SubTick(int SubTick)
|
||||
{
|
||||
ui4r actL;
|
||||
uint16_t actL;
|
||||
#if MySoundEnabled
|
||||
tpSoundSamp p;
|
||||
#endif
|
||||
ui4r i;
|
||||
ui4r n = SubTick_n[SubTick];
|
||||
uint16_t i;
|
||||
uint16_t n = SubTick_n[SubTick];
|
||||
#if MySoundEnabled
|
||||
ui3b SoundVolume = SoundReg_Volume;
|
||||
uint8_t SoundVolume = SoundReg_Volume;
|
||||
#endif
|
||||
|
||||
#if MySoundEnabled
|
||||
@ -564,8 +564,8 @@ label_retry:
|
||||
if (0 != (SoundReg802 & 2)) {
|
||||
|
||||
if (! ASC_Playing) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200)
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200)
|
||||
{
|
||||
SoundReg804 &= ~ 0x01;
|
||||
SoundReg804 &= ~ 0x04;
|
||||
@ -574,8 +574,8 @@ label_retry:
|
||||
dbglog_WriteNote("ASC : start stereo playing");
|
||||
#endif
|
||||
} else {
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) == 0)
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out))
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) == 0)
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out))
|
||||
>= 370)
|
||||
{
|
||||
#if ASC_dolog
|
||||
@ -592,10 +592,10 @@ label_retry:
|
||||
}
|
||||
|
||||
for (i = 0; i < actL; i++) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) == 0) {
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) == 0) {
|
||||
ASC_Playing = falseblnr;
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) == 0) {
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) == 0) {
|
||||
ASC_Playing = falseblnr;
|
||||
}
|
||||
if (! ASC_Playing) {
|
||||
@ -638,7 +638,7 @@ label_retry:
|
||||
/* mono */
|
||||
|
||||
if (! ASC_Playing) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200)
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200)
|
||||
{
|
||||
SoundReg804 &= ~ 0x01;
|
||||
ASC_Playing = trueblnr;
|
||||
@ -649,7 +649,7 @@ label_retry:
|
||||
}
|
||||
|
||||
for (i = 0; i < actL; i++) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) == 0) {
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) == 0) {
|
||||
ASC_Playing = falseblnr;
|
||||
}
|
||||
if (! ASC_Playing) {
|
||||
@ -671,7 +671,7 @@ label_retry:
|
||||
dbglog_writeCStr(" = ");
|
||||
dbglog_writeHex(*addr);
|
||||
dbglog_writeCStr(", in buff: ");
|
||||
dbglog_writeHex((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out));
|
||||
dbglog_writeHex((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out));
|
||||
dbglog_writeReturn();
|
||||
#endif
|
||||
|
||||
@ -693,20 +693,20 @@ label_retry:
|
||||
}
|
||||
} else if (2 == SoundReg801) {
|
||||
#if MySoundEnabled
|
||||
ui4r v;
|
||||
ui4r i0;
|
||||
ui4r i1;
|
||||
ui4r i2;
|
||||
ui4r i3;
|
||||
uint16_t v;
|
||||
uint16_t i0;
|
||||
uint16_t i1;
|
||||
uint16_t i2;
|
||||
uint16_t i3;
|
||||
#endif
|
||||
ui5r freq0 = do_get_mem_long(ASC_ChanA[0].freq);
|
||||
ui5r freq1 = do_get_mem_long(ASC_ChanA[1].freq);
|
||||
ui5r freq2 = do_get_mem_long(ASC_ChanA[2].freq);
|
||||
ui5r freq3 = do_get_mem_long(ASC_ChanA[3].freq);
|
||||
ui5r phase0 = do_get_mem_long(ASC_ChanA[0].phase);
|
||||
ui5r phase1 = do_get_mem_long(ASC_ChanA[1].phase);
|
||||
ui5r phase2 = do_get_mem_long(ASC_ChanA[2].phase);
|
||||
ui5r phase3 = do_get_mem_long(ASC_ChanA[3].phase);
|
||||
uint32_t freq0 = do_get_mem_long(ASC_ChanA[0].freq);
|
||||
uint32_t freq1 = do_get_mem_long(ASC_ChanA[1].freq);
|
||||
uint32_t freq2 = do_get_mem_long(ASC_ChanA[2].freq);
|
||||
uint32_t freq3 = do_get_mem_long(ASC_ChanA[3].freq);
|
||||
uint32_t phase0 = do_get_mem_long(ASC_ChanA[0].phase);
|
||||
uint32_t phase1 = do_get_mem_long(ASC_ChanA[1].phase);
|
||||
uint32_t phase2 = do_get_mem_long(ASC_ChanA[2].phase);
|
||||
uint32_t phase3 = do_get_mem_long(ASC_ChanA[3].phase);
|
||||
#if ASC_dolog && 1
|
||||
dbglog_writeCStr("freq0=");
|
||||
dbglog_writeNum(freq0);
|
||||
@ -782,12 +782,12 @@ label_retry:
|
||||
Usually have volume at 7, so this
|
||||
is just for completeness.
|
||||
*/
|
||||
ui5b mult = (ui5b)vol_mult[SoundVolume];
|
||||
uint32_t mult = (uint32_t)vol_mult[SoundVolume];
|
||||
trSoundSamp offset = vol_offset[SoundVolume];
|
||||
|
||||
p -= actL;
|
||||
for (i = 0; i < actL; i++) {
|
||||
*p = (trSoundSamp)((ui5b)(*p) * mult >> 16) + offset;
|
||||
*p = (trSoundSamp)((uint32_t)(*p) * mult >> 16) + offset;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
@ -802,7 +802,7 @@ label_retry:
|
||||
|
||||
#if 1
|
||||
if ((1 == SoundReg801) && ASC_Playing) {
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (0 != (SoundReg804 & 0x01)) {
|
||||
ReportAbnormalID(0x0F1A,
|
||||
"half flag A not already clear");
|
||||
@ -819,7 +819,7 @@ label_retry:
|
||||
SoundReg804 |= 0x01;
|
||||
}
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400) {
|
||||
if (((uint16_t)(ASC_FIFO_InA - ASC_FIFO_Out)) >= 0x400) {
|
||||
if (0 == (SoundReg804 & 0x02)) {
|
||||
ReportAbnormalID(0x0F1B, "full flag A not already set");
|
||||
SoundReg804 |= 0x02;
|
||||
@ -831,7 +831,7 @@ label_retry:
|
||||
}
|
||||
}
|
||||
if (0 != (SoundReg802 & 2)) {
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x200) {
|
||||
if (0 != (SoundReg804 & 0x04)) {
|
||||
ReportAbnormalID(0x0F1C,
|
||||
"half flag B not already clear");
|
||||
@ -848,7 +848,7 @@ label_retry:
|
||||
SoundReg804 |= 0x04;
|
||||
}
|
||||
}
|
||||
if (((ui4b)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400) {
|
||||
if (((uint16_t)(ASC_FIFO_InB - ASC_FIFO_Out)) >= 0x400) {
|
||||
if (0 == (SoundReg804 & 0x08)) {
|
||||
ReportAbnormalID(0x0F1D,
|
||||
"full flag B not already set");
|
||||
|
@ -20,5 +20,5 @@
|
||||
#define ASCEMDEV_H
|
||||
#endif
|
||||
|
||||
EXPORTFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTFUNC uint32_t ASC_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTPROC ASC_SubTick(int SubTick);
|
||||
|
@ -38,7 +38,7 @@ static struct bpf_insn insns[] =
|
||||
GLOBALVAR ui3p LT_TxBuffer = NULL;
|
||||
|
||||
/* Transmit state */
|
||||
GLOBALVAR ui4r LT_TxBuffSz = 0;
|
||||
GLOBALVAR uint16_t LT_TxBuffSz = 0;
|
||||
|
||||
/*
|
||||
Transmit buffer that is reused from tx packet to tx packet.
|
||||
@ -61,7 +61,7 @@ static unsigned char tx_buffer[20 + LT_TxBfMxSz] =
|
||||
/* Receive state */
|
||||
GLOBALVAR ui3p LT_RxBuffer = NULL;
|
||||
/* When data pending, this is used */
|
||||
GLOBALVAR ui5r LT_RxBuffSz = 0;
|
||||
GLOBALVAR uint32_t LT_RxBuffSz = 0;
|
||||
/* When data pending, this is used */
|
||||
|
||||
/* Macro used by only the get_sockaddrs function for readability. */
|
||||
|
162
src/COMOSGLU.h
162
src/COMOSGLU.h
@ -39,8 +39,8 @@
|
||||
GLOBALVAR ui3p ROM = nullpr;
|
||||
LOCALVAR blnr ROM_loaded = falseblnr;
|
||||
|
||||
GLOBALVAR ui5b vSonyWritableMask = 0;
|
||||
GLOBALVAR ui5b vSonyInsertedMask = 0;
|
||||
GLOBALVAR uint32_t vSonyWritableMask = 0;
|
||||
GLOBALVAR uint32_t vSonyInsertedMask = 0;
|
||||
|
||||
#if IncludeSonyRawMode
|
||||
GLOBALVAR blnr vSonyRawMode = falseblnr;
|
||||
@ -48,20 +48,20 @@ GLOBALVAR blnr vSonyRawMode = falseblnr;
|
||||
|
||||
#if IncludeSonyNew
|
||||
GLOBALVAR blnr vSonyNewDiskWanted = falseblnr;
|
||||
GLOBALVAR ui5b vSonyNewDiskSize;
|
||||
GLOBALVAR uint32_t vSonyNewDiskSize;
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNameNew
|
||||
GLOBALVAR tPbuf vSonyNewDiskName = NotAPbuf;
|
||||
#endif
|
||||
|
||||
GLOBALVAR ui5b CurMacDateInSeconds = 0;
|
||||
GLOBALVAR uint32_t CurMacDateInSeconds = 0;
|
||||
#if AutoLocation
|
||||
GLOBALVAR ui5b CurMacLatitude = 0;
|
||||
GLOBALVAR ui5b CurMacLongitude = 0;
|
||||
GLOBALVAR uint32_t CurMacLatitude = 0;
|
||||
GLOBALVAR uint32_t CurMacLongitude = 0;
|
||||
#endif
|
||||
#if AutoTimeZone
|
||||
GLOBALVAR ui5b CurMacDelta = 0;
|
||||
GLOBALVAR uint32_t CurMacDelta = 0;
|
||||
#endif
|
||||
|
||||
#if 0 != vMacScreenDepth
|
||||
@ -74,9 +74,9 @@ GLOBALVAR blnr ColorMappingChanged = falseblnr;
|
||||
#endif
|
||||
|
||||
#if (0 != vMacScreenDepth) && (vMacScreenDepth < 4)
|
||||
GLOBALVAR ui4r CLUT_reds[CLUT_size];
|
||||
GLOBALVAR ui4r CLUT_greens[CLUT_size];
|
||||
GLOBALVAR ui4r CLUT_blues[CLUT_size];
|
||||
GLOBALVAR uint16_t CLUT_reds[CLUT_size];
|
||||
GLOBALVAR uint16_t CLUT_greens[CLUT_size];
|
||||
GLOBALVAR uint16_t CLUT_blues[CLUT_size];
|
||||
#endif
|
||||
|
||||
LOCALVAR blnr RequestMacOff = falseblnr;
|
||||
@ -87,22 +87,22 @@ GLOBALVAR blnr WantMacInterrupt = falseblnr;
|
||||
|
||||
GLOBALVAR blnr WantMacReset = falseblnr;
|
||||
|
||||
GLOBALVAR ui3b SpeedValue = WantInitSpeedValue;
|
||||
GLOBALVAR uint8_t SpeedValue = WantInitSpeedValue;
|
||||
|
||||
#if EnableAutoSlow
|
||||
GLOBALVAR blnr WantNotAutoSlow = (WantInitNotAutoSlow != 0);
|
||||
#endif
|
||||
|
||||
GLOBALVAR ui4b CurMouseV = 0;
|
||||
GLOBALVAR ui4b CurMouseH = 0;
|
||||
GLOBALVAR uint16_t CurMouseV = 0;
|
||||
GLOBALVAR uint16_t CurMouseH = 0;
|
||||
|
||||
#if EnableFSMouseMotion
|
||||
LOCALVAR blnr HaveMouseMotion = falseblnr;
|
||||
#endif
|
||||
|
||||
#if EnableAutoSlow
|
||||
GLOBALVAR ui5r QuietTime = 0;
|
||||
GLOBALVAR ui5r QuietSubTicks = 0;
|
||||
GLOBALVAR uint32_t QuietTime = 0;
|
||||
GLOBALVAR uint32_t QuietSubTicks = 0;
|
||||
#endif
|
||||
|
||||
#ifndef GrabKeysFullScreen
|
||||
@ -114,12 +114,12 @@ GLOBALVAR ui5r QuietSubTicks = 0;
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALVAR ui5b PbufAllocatedMask;
|
||||
LOCALVAR ui5b PbufSize[NumPbufs];
|
||||
LOCALVAR uint32_t PbufAllocatedMask;
|
||||
LOCALVAR uint32_t PbufSize[NumPbufs];
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
#define PbufIsAllocated(i) ((PbufAllocatedMask & ((ui5b)1 << (i))) != 0)
|
||||
#define PbufIsAllocated(i) ((PbufAllocatedMask & ((uint32_t)1 << (i))) != 0)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
@ -138,17 +138,17 @@ LOCALFUNC blnr FirstFreePbuf(tPbuf *r)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALPROC PbufNewNotify(tPbuf Pbuf_No, ui5b count)
|
||||
LOCALPROC PbufNewNotify(tPbuf Pbuf_No, uint32_t count)
|
||||
{
|
||||
PbufSize[Pbuf_No] = count;
|
||||
PbufAllocatedMask |= ((ui5b)1 << Pbuf_No);
|
||||
PbufAllocatedMask |= ((uint32_t)1 << Pbuf_No);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALPROC PbufDisposeNotify(tPbuf Pbuf_No)
|
||||
{
|
||||
PbufAllocatedMask &= ~ ((ui5b)1 << Pbuf_No);
|
||||
PbufAllocatedMask &= ~ ((uint32_t)1 << Pbuf_No);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -170,7 +170,7 @@ GLOBALOSGLUFUNC tMacErr CheckPbuf(tPbuf Pbuf_No)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, ui5r *Count)
|
||||
GLOBALOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, uint32_t *Count)
|
||||
{
|
||||
tMacErr result = CheckPbuf(Pbuf_No);
|
||||
|
||||
@ -214,14 +214,14 @@ GLOBALOSGLUFUNC blnr AnyDiskInserted(void)
|
||||
|
||||
GLOBALOSGLUPROC DiskRevokeWritable(tDrive Drive_No)
|
||||
{
|
||||
vSonyWritableMask &= ~ ((ui5b)1 << Drive_No);
|
||||
vSonyWritableMask &= ~ ((uint32_t)1 << Drive_No);
|
||||
}
|
||||
|
||||
LOCALPROC DiskInsertNotify(tDrive Drive_No, blnr locked)
|
||||
{
|
||||
vSonyInsertedMask |= ((ui5b)1 << Drive_No);
|
||||
vSonyInsertedMask |= ((uint32_t)1 << Drive_No);
|
||||
if (! locked) {
|
||||
vSonyWritableMask |= ((ui5b)1 << Drive_No);
|
||||
vSonyWritableMask |= ((uint32_t)1 << Drive_No);
|
||||
}
|
||||
|
||||
QuietEnds();
|
||||
@ -229,19 +229,19 @@ LOCALPROC DiskInsertNotify(tDrive Drive_No, blnr locked)
|
||||
|
||||
LOCALPROC DiskEjectedNotify(tDrive Drive_No)
|
||||
{
|
||||
vSonyWritableMask &= ~ ((ui5b)1 << Drive_No);
|
||||
vSonyInsertedMask &= ~ ((ui5b)1 << Drive_No);
|
||||
vSonyWritableMask &= ~ ((uint32_t)1 << Drive_No);
|
||||
vSonyInsertedMask &= ~ ((uint32_t)1 << Drive_No);
|
||||
}
|
||||
|
||||
/*
|
||||
block type - for operating on multiple ui3b elements
|
||||
block type - for operating on multiple uint8_t elements
|
||||
at a time.
|
||||
*/
|
||||
|
||||
#if LittleEndianUnaligned || BigEndianUnaligned
|
||||
|
||||
#define uibb ui5b
|
||||
#define uibr ui5r
|
||||
#define uibb uint32_t
|
||||
#define uibr uint32_t
|
||||
#define ln2uiblockn 2
|
||||
|
||||
#if 0
|
||||
@ -252,8 +252,8 @@ LOCALPROC DiskEjectedNotify(tDrive Drive_No)
|
||||
|
||||
#else
|
||||
|
||||
#define uibb ui3b
|
||||
#define uibr ui3r
|
||||
#define uibb uint8_t
|
||||
#define uibr uint8_t
|
||||
#define ln2uiblockn 0
|
||||
|
||||
#endif
|
||||
@ -306,7 +306,7 @@ LOCALPROC FindLeftRightChangeInLMat(uibb *ptr1, uibb *ptr2,
|
||||
uibb *p1;
|
||||
uibb *p2;
|
||||
uibr x;
|
||||
ui5r offset = top * width;
|
||||
uint32_t offset = top * width;
|
||||
uibb *p10 = (uibb *)ptr1 + offset;
|
||||
uibb *p20 = (uibb *)ptr2 + offset;
|
||||
uimr LeftMin = *LeftMin0;
|
||||
@ -372,7 +372,7 @@ LOCALVAR blnr ColorTransValid = falseblnr;
|
||||
#endif
|
||||
|
||||
LOCALFUNC blnr ScreenFindChanges(ui3p screencurrentbuff,
|
||||
si3b TimeAdjust, si4b *top, si4b *left, si4b *bottom, si4b *right)
|
||||
int8_t TimeAdjust, int16_t *top, int16_t *left, int16_t *bottom, int16_t *right)
|
||||
{
|
||||
uimr j0;
|
||||
uimr j1;
|
||||
@ -595,18 +595,18 @@ Label_2:
|
||||
}
|
||||
|
||||
GLOBALVAR blnr EmVideoDisable = falseblnr;
|
||||
GLOBALVAR si3b EmLagTime = 0;
|
||||
GLOBALVAR int8_t EmLagTime = 0;
|
||||
|
||||
GLOBALVAR ui5b OnTrueTime = 0;
|
||||
GLOBALVAR uint32_t OnTrueTime = 0;
|
||||
/*
|
||||
The time slice we are currently dealing
|
||||
with, in the same units as TrueEmulatedTime.
|
||||
*/
|
||||
|
||||
LOCALVAR si4b ScreenChangedTop;
|
||||
LOCALVAR si4b ScreenChangedLeft;
|
||||
LOCALVAR si4b ScreenChangedBottom;
|
||||
LOCALVAR si4b ScreenChangedRight;
|
||||
LOCALVAR int16_t ScreenChangedTop;
|
||||
LOCALVAR int16_t ScreenChangedLeft;
|
||||
LOCALVAR int16_t ScreenChangedBottom;
|
||||
LOCALVAR int16_t ScreenChangedRight;
|
||||
|
||||
LOCALPROC ScreenClearChanges(void)
|
||||
{
|
||||
@ -625,18 +625,18 @@ LOCALPROC ScreenChangedAll(void)
|
||||
}
|
||||
|
||||
#if EnableAutoSlow
|
||||
LOCALVAR si4b ScreenChangedQuietTop = vMacScreenHeight;
|
||||
LOCALVAR si4b ScreenChangedQuietLeft = vMacScreenWidth;
|
||||
LOCALVAR si4b ScreenChangedQuietBottom = 0;
|
||||
LOCALVAR si4b ScreenChangedQuietRight = 0;
|
||||
LOCALVAR int16_t ScreenChangedQuietTop = vMacScreenHeight;
|
||||
LOCALVAR int16_t ScreenChangedQuietLeft = vMacScreenWidth;
|
||||
LOCALVAR int16_t ScreenChangedQuietBottom = 0;
|
||||
LOCALVAR int16_t ScreenChangedQuietRight = 0;
|
||||
#endif
|
||||
|
||||
GLOBALOSGLUPROC Screen_OutputFrame(ui3p screencurrentbuff)
|
||||
{
|
||||
si4b top;
|
||||
si4b left;
|
||||
si4b bottom;
|
||||
si4b right;
|
||||
int16_t top;
|
||||
int16_t left;
|
||||
int16_t bottom;
|
||||
int16_t right;
|
||||
|
||||
if (! EmVideoDisable) {
|
||||
if (ScreenFindChanges(screencurrentbuff, EmLagTime,
|
||||
@ -686,13 +686,13 @@ GLOBALOSGLUPROC Screen_OutputFrame(ui3p screencurrentbuff)
|
||||
}
|
||||
|
||||
#if MayFullScreen
|
||||
LOCALVAR ui4r ViewHSize;
|
||||
LOCALVAR ui4r ViewVSize;
|
||||
LOCALVAR ui4r ViewHStart = 0;
|
||||
LOCALVAR ui4r ViewVStart = 0;
|
||||
LOCALVAR uint16_t ViewHSize;
|
||||
LOCALVAR uint16_t ViewVSize;
|
||||
LOCALVAR uint16_t ViewHStart = 0;
|
||||
LOCALVAR uint16_t ViewVStart = 0;
|
||||
#if EnableFSMouseMotion
|
||||
LOCALVAR si4b SavedMouseH;
|
||||
LOCALVAR si4b SavedMouseV;
|
||||
LOCALVAR int16_t SavedMouseH;
|
||||
LOCALVAR int16_t SavedMouseV;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -703,8 +703,8 @@ LOCALVAR si4b SavedMouseV;
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC AutoScrollScreen(void)
|
||||
{
|
||||
si4b Shift;
|
||||
si4b Limit;
|
||||
int16_t Shift;
|
||||
int16_t Limit;
|
||||
|
||||
/*
|
||||
Scroll in multiples of two pixels, so as to
|
||||
@ -793,12 +793,12 @@ LOCALPROC AutoScrollScreen(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALPROC SetLongs(ui5b *p, long n)
|
||||
LOCALPROC SetLongs(uint32_t *p, long n)
|
||||
{
|
||||
long i;
|
||||
|
||||
for (i = n; --i >= 0; ) {
|
||||
*p++ = (ui5b) -1;
|
||||
*p++ = (uint32_t) -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -814,7 +814,7 @@ LOCALVAR ui3p ReserveAllocBigBlock = nullpr;
|
||||
/* warning - CeilPow2Mult evaluates p twice */
|
||||
|
||||
GLOBALOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n,
|
||||
ui3r align, blnr FillOnes)
|
||||
uint8_t align, blnr FillOnes)
|
||||
{
|
||||
ReserveAllocOffset = CeilPow2Mult(ReserveAllocOffset, align);
|
||||
if (nullpr == ReserveAllocBigBlock) {
|
||||
@ -822,7 +822,7 @@ GLOBALOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n,
|
||||
} else {
|
||||
*p = ReserveAllocBigBlock + ReserveAllocOffset;
|
||||
if (FillOnes) {
|
||||
SetLongs((ui5b *)*p, n / 4);
|
||||
SetLongs((uint32_t *)*p, n / 4);
|
||||
}
|
||||
}
|
||||
ReserveAllocOffset += n;
|
||||
@ -902,7 +902,7 @@ GLOBALOSGLUPROC dbglog_writeReturn(void)
|
||||
|
||||
GLOBALOSGLUPROC dbglog_writeHex(uimr x)
|
||||
{
|
||||
ui3r v;
|
||||
uint8_t v;
|
||||
char s[16];
|
||||
char *p = s + 16;
|
||||
uimr n = 0;
|
||||
@ -940,7 +940,7 @@ GLOBALOSGLUPROC dbglog_writeNum(uimr x)
|
||||
/* fprintf(DumpFile, "%d", (int)x); */
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC dbglog_writeMacChar(ui3r x)
|
||||
GLOBALOSGLUPROC dbglog_writeMacChar(uint8_t x)
|
||||
{
|
||||
char s;
|
||||
|
||||
@ -981,8 +981,8 @@ GLOBALOSGLUPROC dbglog_writelnNum(char *s, simr v)
|
||||
#define MyEvtQIMask (MyEvtQSz - 1)
|
||||
|
||||
LOCALVAR MyEvtQEl MyEvtQA[MyEvtQSz];
|
||||
LOCALVAR ui4r MyEvtQIn = 0;
|
||||
LOCALVAR ui4r MyEvtQOut = 0;
|
||||
LOCALVAR uint16_t MyEvtQIn = 0;
|
||||
LOCALVAR uint16_t MyEvtQOut = 0;
|
||||
|
||||
GLOBALOSGLUFUNC MyEvtQEl * MyEvtQOutP(void)
|
||||
{
|
||||
@ -1025,14 +1025,14 @@ LOCALFUNC MyEvtQEl * MyEvtQElAlloc(void)
|
||||
return p;
|
||||
}
|
||||
|
||||
LOCALVAR ui5b theKeys[4];
|
||||
LOCALVAR uint32_t theKeys[4];
|
||||
|
||||
LOCALPROC Keyboard_UpdateKeyMap(ui3r key, blnr down)
|
||||
LOCALPROC Keyboard_UpdateKeyMap(uint8_t key, blnr down)
|
||||
{
|
||||
ui3r k = key & 127; /* just for safety */
|
||||
ui3r bit = 1 << (k & 7);
|
||||
ui3b *kp = (ui3b *)theKeys;
|
||||
ui3b *kpi = &kp[k / 8];
|
||||
uint8_t k = key & 127; /* just for safety */
|
||||
uint8_t bit = 1 << (k & 7);
|
||||
uint8_t *kp = (uint8_t *)theKeys;
|
||||
uint8_t *kpi = &kp[k / 8];
|
||||
blnr CurDown = ((*kpi & bit) != 0);
|
||||
if (CurDown != down) {
|
||||
MyEvtQEl *p = MyEvtQElAlloc();
|
||||
@ -1070,7 +1070,7 @@ LOCALPROC MyMouseButtonSet(blnr down)
|
||||
}
|
||||
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMousePositionSetDelta(ui4r dh, ui4r dv)
|
||||
LOCALPROC MyMousePositionSetDelta(uint16_t dh, uint16_t dv)
|
||||
{
|
||||
if ((dh != 0) || (dv != 0)) {
|
||||
MyEvtQEl *p = MyEvtQElPreviousIn();
|
||||
@ -1091,10 +1091,10 @@ LOCALPROC MyMousePositionSetDelta(ui4r dh, ui4r dv)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALVAR ui4b MyMousePosCurV = 0;
|
||||
LOCALVAR ui4b MyMousePosCurH = 0;
|
||||
LOCALVAR uint16_t MyMousePosCurV = 0;
|
||||
LOCALVAR uint16_t MyMousePosCurH = 0;
|
||||
|
||||
LOCALPROC MyMousePositionSet(ui4r h, ui4r v)
|
||||
LOCALPROC MyMousePositionSet(uint16_t h, uint16_t v)
|
||||
{
|
||||
if ((h != MyMousePosCurH) || (v != MyMousePosCurV)) {
|
||||
MyEvtQEl *p = MyEvtQElPreviousIn();
|
||||
@ -1116,7 +1116,7 @@ LOCALPROC MyMousePositionSet(ui4r h, ui4r v)
|
||||
|
||||
#if 0
|
||||
#define Keyboard_TestKeyMap(key) \
|
||||
((((ui3b *)theKeys)[(key) / 8] & (1 << ((key) & 7))) != 0)
|
||||
((((uint8_t *)theKeys)[(key) / 8] & (1 << ((key) & 7))) != 0)
|
||||
#endif
|
||||
|
||||
LOCALPROC InitKeyCodes(void)
|
||||
@ -1133,7 +1133,7 @@ LOCALPROC InitKeyCodes(void)
|
||||
#define kKeepMaskOption (1 << 3)
|
||||
#define kKeepMaskShift (1 << 4)
|
||||
|
||||
LOCALPROC DisconnectKeyCodes(ui5b KeepMask)
|
||||
LOCALPROC DisconnectKeyCodes(uint32_t KeepMask)
|
||||
{
|
||||
/*
|
||||
Called when may miss key ups,
|
||||
@ -1145,12 +1145,12 @@ LOCALPROC DisconnectKeyCodes(ui5b KeepMask)
|
||||
int j;
|
||||
int b;
|
||||
int key;
|
||||
ui5b m;
|
||||
uint32_t m;
|
||||
|
||||
for (j = 0; j < 16; ++j) {
|
||||
ui3b k1 = ((ui3b *)theKeys)[j];
|
||||
uint8_t k1 = ((uint8_t *)theKeys)[j];
|
||||
if (0 != k1) {
|
||||
ui3b bit = 1;
|
||||
uint8_t bit = 1;
|
||||
for (b = 0; b < 8; ++b) {
|
||||
if (0 != (k1 & bit)) {
|
||||
key = j * 8 + b;
|
||||
@ -1183,7 +1183,7 @@ LOCALPROC MyEvtQTryRecoverFromFull(void)
|
||||
LOCALVAR char *SavedBriefMsg = nullpr;
|
||||
LOCALVAR char *SavedLongMsg;
|
||||
#if WantAbnormalReports
|
||||
LOCALVAR ui4r SavedIDMsg = 0;
|
||||
LOCALVAR uint16_t SavedIDMsg = 0;
|
||||
#endif
|
||||
LOCALVAR blnr SavedFatalMsg;
|
||||
|
||||
@ -1202,7 +1202,7 @@ LOCALPROC MacMsg(char *briefMsg, char *longMsg, blnr fatal)
|
||||
}
|
||||
|
||||
#if WantAbnormalReports
|
||||
GLOBALOSGLUPROC WarnMsgAbnormalID(ui4r id)
|
||||
GLOBALOSGLUPROC WarnMsgAbnormalID(uint16_t id)
|
||||
{
|
||||
MacMsg(kStrReportAbnormalTitle,
|
||||
kStrReportAbnormalMessage, falseblnr);
|
||||
|
@ -68,7 +68,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
|
||||
for (i = 16; --i >= 0; ) {
|
||||
#if 1 == vMacScreenDepth
|
||||
int k;
|
||||
ui3b t0 = *p0;
|
||||
uint8_t t0 = *p0;
|
||||
ui3p p2 = p;
|
||||
for (k = 2; --k >= 0; ) {
|
||||
*p2++ = (((t0) & 0x80) ? 0xC0 : 0x00)
|
||||
@ -80,7 +80,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
|
||||
}
|
||||
#elif 2 == vMacScreenDepth
|
||||
int k;
|
||||
ui3b t0 = *p0;
|
||||
uint8_t t0 = *p0;
|
||||
ui3p p2 = p;
|
||||
for (k = 4; --k >= 0; ) {
|
||||
*p2++ = (((t0) & 0x40) ? 0x0F : 0x00)
|
||||
@ -90,7 +90,7 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
|
||||
}
|
||||
#elif 3 == vMacScreenDepth
|
||||
int k;
|
||||
ui3b t0 = *p0;
|
||||
uint8_t t0 = *p0;
|
||||
ui3p p2 = p;
|
||||
for (k = 8; --k >= 0; ) {
|
||||
*p2++ = ((t0 >> k) & 0x01) ? 0xFF : 0x00;
|
||||
@ -98,25 +98,25 @@ LOCALPROC DrawCell(unsigned int h, unsigned int v, int x)
|
||||
}
|
||||
#elif 4 == vMacScreenDepth
|
||||
int k;
|
||||
ui4r v;
|
||||
ui3b t0 = *p0;
|
||||
uint16_t v;
|
||||
uint8_t t0 = *p0;
|
||||
ui3p p2 = p;
|
||||
for (k = 8; --k >= 0; ) {
|
||||
v = ((t0 >> k) & 0x01) ? 0x0000 : 0x7FFF;
|
||||
/* black RRGGBBAA, white RRGGBBAA */
|
||||
/* *((ui4b *)p2)++ = v; need big endian, so : */
|
||||
/* *((uint16_t *)p2)++ = v; need big endian, so : */
|
||||
*p2++ = v >> 8;
|
||||
*p2++ = v;
|
||||
}
|
||||
#elif 5 == vMacScreenDepth
|
||||
int k;
|
||||
ui5r v;
|
||||
ui3b t0 = *p0;
|
||||
uint32_t v;
|
||||
uint8_t t0 = *p0;
|
||||
ui3p p2 = p;
|
||||
for (k = 8; --k >= 0; ) {
|
||||
v = ((t0 >> k) & 0x01) ? 0x00000000 : 0x00FFFFFF;
|
||||
/* black RRGGBBAA, white RRGGBBAA */
|
||||
/* *((ui5b *)p2)++ = v; need big endian, so : */
|
||||
/* *((uint32_t *)p2)++ = v; need big endian, so : */
|
||||
*p2++ = v >> 24;
|
||||
*p2++ = v >> 16;
|
||||
*p2++ = v >> 8;
|
||||
@ -194,8 +194,8 @@ LOCALPROC DrawCellsBlankLine(void)
|
||||
|
||||
LOCALPROC DrawCellsFromStr(char *s)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
ui3b cs;
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
uint8_t cs;
|
||||
int L;
|
||||
int i;
|
||||
int j;
|
||||
@ -319,7 +319,7 @@ LOCALPROC DrawSpclMode0(char *Title, SpclModeBody Body)
|
||||
#endif
|
||||
|
||||
#if WantAbnormalReports
|
||||
LOCALPROC ClStrAppendHexNib(int *L0, ui3b *r, ui3r v)
|
||||
LOCALPROC ClStrAppendHexNib(int *L0, uint8_t *r, uint8_t v)
|
||||
{
|
||||
if (v < 10) {
|
||||
ClStrAppendChar(L0, r, kCellDigit0 + v);
|
||||
@ -330,7 +330,7 @@ LOCALPROC ClStrAppendHexNib(int *L0, ui3b *r, ui3r v)
|
||||
#endif
|
||||
|
||||
#if WantAbnormalReports
|
||||
LOCALPROC ClStrAppendHexByte(int *L0, ui3b *r, ui3r v)
|
||||
LOCALPROC ClStrAppendHexByte(int *L0, uint8_t *r, uint8_t v)
|
||||
{
|
||||
ClStrAppendHexNib(L0, r, (v >> 4) & 0x0F);
|
||||
ClStrAppendHexNib(L0, r, v & 0x0F);
|
||||
@ -338,7 +338,7 @@ LOCALPROC ClStrAppendHexByte(int *L0, ui3b *r, ui3r v)
|
||||
#endif
|
||||
|
||||
#if WantAbnormalReports
|
||||
LOCALPROC ClStrAppendHexWord(int *L0, ui3b *r, ui4r v)
|
||||
LOCALPROC ClStrAppendHexWord(int *L0, uint8_t *r, uint16_t v)
|
||||
{
|
||||
ClStrAppendHexByte(L0, r, (v >> 8) & 0xFF);
|
||||
ClStrAppendHexByte(L0, r, v & 0xFF);
|
||||
@ -346,9 +346,9 @@ LOCALPROC ClStrAppendHexWord(int *L0, ui3b *r, ui4r v)
|
||||
#endif
|
||||
|
||||
#if WantAbnormalReports
|
||||
LOCALPROC DrawCellsOneLineHexWord(ui4r v)
|
||||
LOCALPROC DrawCellsOneLineHexWord(uint16_t v)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int L = 0;
|
||||
int i;
|
||||
|
||||
@ -398,7 +398,7 @@ LOCALPROC MacMsgDisplayOn(void)
|
||||
SpecialModeSet(SpclModeMessage);
|
||||
}
|
||||
|
||||
LOCALPROC DoMessageModeKey(ui3r key)
|
||||
LOCALPROC DoMessageModeKey(uint8_t key)
|
||||
{
|
||||
if (MKC_C == key) {
|
||||
MacMsgDisplayOff();
|
||||
@ -538,7 +538,7 @@ LOCALPROC Keyboard_UpdateControlKey(blnr down)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SetSpeedValue(ui3b i)
|
||||
LOCALPROC SetSpeedValue(uint8_t i)
|
||||
{
|
||||
SpeedValue = i;
|
||||
CurControlMode = kCntrlModeBase;
|
||||
@ -583,7 +583,7 @@ LOCALPROC HTCEexportSubstCStr(char *s)
|
||||
}
|
||||
}
|
||||
#else
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
|
||||
ClStrFromSubstCStr(&L, ps, s);
|
||||
|
||||
@ -606,7 +606,7 @@ LOCALPROC CopyOptionsStr(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALPROC DoControlModeKey(ui3r key)
|
||||
LOCALPROC DoControlModeKey(uint8_t key)
|
||||
{
|
||||
switch (CurControlMode) {
|
||||
case kCntrlModeBase:
|
||||
@ -808,7 +808,7 @@ LOCALPROC DoControlModeKey(ui3r key)
|
||||
SetSpeedValue(5);
|
||||
break;
|
||||
case MKC_A:
|
||||
SetSpeedValue((ui3b) -1);
|
||||
SetSpeedValue((uint8_t) -1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -1046,7 +1046,7 @@ LOCALFUNC ui3p GetCurDrawBuff(void)
|
||||
}
|
||||
|
||||
#ifdef WantKeyboard_RemapMac
|
||||
LOCALFUNC ui3r Keyboard_RemapMac(ui3r key)
|
||||
LOCALFUNC uint8_t Keyboard_RemapMac(uint8_t key)
|
||||
{
|
||||
switch (key) {
|
||||
#if MKC_formac_Control != MKC_Control
|
||||
@ -1162,7 +1162,7 @@ LOCALFUNC ui3r Keyboard_RemapMac(ui3r key)
|
||||
}
|
||||
#endif /* WantKeyboard_RemapMac */
|
||||
|
||||
LOCALPROC Keyboard_UpdateKeyMap2(ui3r key, blnr down)
|
||||
LOCALPROC Keyboard_UpdateKeyMap2(uint8_t key, blnr down)
|
||||
{
|
||||
#if UseControlKeys
|
||||
if (MKC_CM == key) {
|
||||
@ -1209,10 +1209,10 @@ LOCALPROC DisconnectKeyCodes2(void)
|
||||
#endif
|
||||
|
||||
#if CheckRomCheckSum
|
||||
LOCALFUNC ui5r Calc_Checksum(void)
|
||||
LOCALFUNC uint32_t Calc_Checksum(void)
|
||||
{
|
||||
long int i;
|
||||
ui5b CheckSum = 0;
|
||||
uint32_t CheckSum = 0;
|
||||
ui3p p = 4 + ROM;
|
||||
|
||||
for (i = (kCheckSumRom_Size - 4) >> 1; --i >= 0; ) {
|
||||
@ -1242,7 +1242,7 @@ LOCALPROC WarnMsgUnsupportedROM(void)
|
||||
LOCALFUNC tMacErr ROM_IsValid(void)
|
||||
{
|
||||
#if CheckRomCheckSum
|
||||
ui5r CheckSum = Calc_Checksum();
|
||||
uint32_t CheckSum = Calc_Checksum();
|
||||
|
||||
#if RomStartCheckSum
|
||||
if (CheckSum != do_get_mem_long(ROM)) {
|
||||
|
@ -74,9 +74,9 @@
|
||||
/* */
|
||||
/* ************************************************************* */
|
||||
|
||||
LOCALFUNC ui5b jdate(int day, int month, int year)
|
||||
LOCALFUNC uint32_t jdate(int day, int month, int year)
|
||||
{
|
||||
ui5b days; /* value returned */
|
||||
uint32_t days; /* value returned */
|
||||
int mtable[] = {
|
||||
0, 31, 59, 90, 120, 151,
|
||||
181, 212, 243, 273, 304, 334
|
||||
@ -87,7 +87,7 @@ LOCALFUNC ui5b jdate(int day, int month, int year)
|
||||
and Centenial year stuff
|
||||
*/
|
||||
|
||||
days = (((ui5b)year * 365) + day + mtable[month - 1]
|
||||
days = (((uint32_t)year * 365) + day + mtable[month - 1]
|
||||
+ ((year + 4) / 4) - ((year / 100) - (year / 400)));
|
||||
|
||||
/* now adjust for leap year before March 1st */
|
||||
@ -104,11 +104,11 @@ LOCALFUNC ui5b jdate(int day, int month, int year)
|
||||
return (days + 5);
|
||||
}
|
||||
|
||||
LOCALFUNC ui5b Date2MacSeconds(int second, int minute, int hour,
|
||||
LOCALFUNC uint32_t Date2MacSeconds(int second, int minute, int hour,
|
||||
int day, int month, int year)
|
||||
{
|
||||
ui5b curjdate;
|
||||
ui5b basejdate;
|
||||
uint32_t curjdate;
|
||||
uint32_t basejdate;
|
||||
|
||||
curjdate = jdate(day, month, year);
|
||||
basejdate = jdate(1, 1, 1904);
|
||||
|
132
src/DISAM68K.c
132
src/DISAM68K.c
@ -31,7 +31,7 @@
|
||||
|
||||
#include "DISAM68K.h"
|
||||
|
||||
LOCALVAR ui5r Disasm_pc;
|
||||
LOCALVAR uint32_t Disasm_pc;
|
||||
|
||||
/*
|
||||
don't use get_vm_byte/get_vm_word/get_vm_long
|
||||
@ -40,8 +40,8 @@ LOCALVAR ui5r Disasm_pc;
|
||||
*/
|
||||
|
||||
LOCALVAR ui3p Disasm_pcp;
|
||||
LOCALVAR ui5r Disasm_pc_blockmask;
|
||||
LOCALVAR ui3b Disasm_pcp_dummy[2] = {
|
||||
LOCALVAR uint32_t Disasm_pc_blockmask;
|
||||
LOCALVAR uint8_t Disasm_pcp_dummy[2] = {
|
||||
0, 0
|
||||
};
|
||||
|
||||
@ -63,10 +63,10 @@ LOCALPROC Disasm_Find_pcp(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui4r Disasm_nextiword(void)
|
||||
LOCALFUNC uint16_t Disasm_nextiword(void)
|
||||
/* NOT sign extended */
|
||||
{
|
||||
ui4r r = do_get_mem_word(Disasm_pcp);
|
||||
uint16_t r = do_get_mem_word(Disasm_pcp);
|
||||
Disasm_pcp += 2;
|
||||
Disasm_pc += 2;
|
||||
if (0 == (Disasm_pc_blockmask & Disasm_pc)) {
|
||||
@ -75,16 +75,16 @@ LOCALFUNC ui4r Disasm_nextiword(void)
|
||||
return r;
|
||||
}
|
||||
|
||||
LOCALINLINEFUNC ui3r Disasm_nextibyte(void)
|
||||
LOCALINLINEFUNC uint8_t Disasm_nextibyte(void)
|
||||
{
|
||||
return (ui3b) Disasm_nextiword();
|
||||
return (uint8_t) Disasm_nextiword();
|
||||
}
|
||||
|
||||
LOCALFUNC ui5r Disasm_nextilong(void)
|
||||
LOCALFUNC uint32_t Disasm_nextilong(void)
|
||||
{
|
||||
ui5r hi = Disasm_nextiword();
|
||||
ui5r lo = Disasm_nextiword();
|
||||
ui5r r = ((hi << 16) & 0xFFFF0000)
|
||||
uint32_t hi = Disasm_nextiword();
|
||||
uint32_t lo = Disasm_nextiword();
|
||||
uint32_t r = ((hi << 16) & 0xFFFF0000)
|
||||
| (lo & 0x0000FFFF);
|
||||
|
||||
return r;
|
||||
@ -99,9 +99,9 @@ LOCALPROC Disasm_setpc(CPTR newpc)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui5b Disasm_opcode;
|
||||
LOCALVAR uint32_t Disasm_opcode;
|
||||
|
||||
LOCALVAR ui5b Disasm_opsize;
|
||||
LOCALVAR uint32_t Disasm_opsize;
|
||||
|
||||
#define Disasm_b76 ((Disasm_opcode >> 6) & 3)
|
||||
#define Disasm_b8 ((Disasm_opcode >> 8) & 1)
|
||||
@ -126,7 +126,7 @@ LOCALPROC DisasmOpSizeFromb76(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DisasmModeRegister(ui5b themode, ui5b thereg)
|
||||
LOCALPROC DisasmModeRegister(uint32_t themode, uint32_t thereg)
|
||||
{
|
||||
switch (themode) {
|
||||
case 0 :
|
||||
@ -179,8 +179,8 @@ LOCALPROC DisasmModeRegister(ui5b themode, ui5b thereg)
|
||||
break;
|
||||
case 2 :
|
||||
{
|
||||
ui5r s = Disasm_pc;
|
||||
s += ui5r_FromSWord(Disasm_nextiword());
|
||||
uint32_t s = Disasm_pc;
|
||||
s += uint32_t_FromSWord(Disasm_nextiword());
|
||||
dbglog_writeCStr("(");
|
||||
dbglog_writeHex(s);
|
||||
dbglog_writeCStr(")");
|
||||
@ -244,11 +244,11 @@ LOCALPROC DisasmI_xxxxxxxxssmmmrrr(char *s)
|
||||
DisasmOpSizeFromb76();
|
||||
dbglog_writeCStr(" #");
|
||||
if (Disasm_opsize == 2) {
|
||||
dbglog_writeHex(ui5r_FromSWord(Disasm_nextiword()));
|
||||
dbglog_writeHex(uint32_t_FromSWord(Disasm_nextiword()));
|
||||
} else if (Disasm_opsize < 2) {
|
||||
dbglog_writeHex(ui5r_FromSByte(Disasm_nextibyte()));
|
||||
dbglog_writeHex(uint32_t_FromSByte(Disasm_nextibyte()));
|
||||
} else {
|
||||
dbglog_writeHex(ui5r_FromSLong(Disasm_nextilong()));
|
||||
dbglog_writeHex(uint32_t_FromSLong(Disasm_nextilong()));
|
||||
}
|
||||
dbglog_writeCStr(", ");
|
||||
DisasmModeRegister(Disasm_mode, Disasm_reg);
|
||||
@ -265,7 +265,7 @@ LOCALPROC DisasmsAA_xxxxdddxssxxxrrr(char *s)
|
||||
dbglog_writeReturn();
|
||||
}
|
||||
|
||||
LOCALFUNC ui5r Disasm_octdat(ui5r x)
|
||||
LOCALFUNC uint32_t Disasm_octdat(uint32_t x)
|
||||
{
|
||||
if (x == 0) {
|
||||
return 8;
|
||||
@ -386,8 +386,8 @@ LOCALPROC DisasmCC(void)
|
||||
LOCALPROCUSEDONCE DisasmBcc(void)
|
||||
{
|
||||
/* Bcc 0110ccccnnnnnnnn */
|
||||
ui5b src = ((ui5b)Disasm_opcode) & 255;
|
||||
ui5r s = Disasm_pc;
|
||||
uint32_t src = ((uint32_t)Disasm_opcode) & 255;
|
||||
uint32_t s = Disasm_pc;
|
||||
|
||||
if (0 == ((Disasm_opcode >> 8) & 15)) {
|
||||
DisasmStartOne("BRA");
|
||||
@ -398,17 +398,17 @@ LOCALPROCUSEDONCE DisasmBcc(void)
|
||||
dbglog_writeCStr(" ");
|
||||
|
||||
if (src == 0) {
|
||||
s += ui5r_FromSWord(Disasm_nextiword());
|
||||
s += uint32_t_FromSWord(Disasm_nextiword());
|
||||
} else
|
||||
#if Use68020
|
||||
if (src == 255) {
|
||||
s += ui5r_FromSLong(Disasm_nextilong());
|
||||
s += uint32_t_FromSLong(Disasm_nextilong());
|
||||
/* ReportAbnormal("long branch in DoCode6"); */
|
||||
/* Used by various Apps */
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
s += ui5r_FromSByte(src);
|
||||
s += uint32_t_FromSByte(src);
|
||||
}
|
||||
dbglog_writeHex(s);
|
||||
dbglog_writeReturn();
|
||||
@ -418,7 +418,7 @@ LOCALPROCUSEDONCE DisasmDBcc(void)
|
||||
{
|
||||
/* DBcc 0101cccc11001ddd */
|
||||
|
||||
ui5r s = Disasm_pc;
|
||||
uint32_t s = Disasm_pc;
|
||||
|
||||
DisasmStartOne("DB");
|
||||
DisasmCC();
|
||||
@ -427,7 +427,7 @@ LOCALPROCUSEDONCE DisasmDBcc(void)
|
||||
dbglog_writeHex(Disasm_reg);
|
||||
dbglog_writeCStr(", ");
|
||||
|
||||
s += (si5b)(si4b)Disasm_nextiword();
|
||||
s += (int32_t)(int16_t)Disasm_nextiword();
|
||||
dbglog_writeHex(s);
|
||||
dbglog_writeReturn();
|
||||
}
|
||||
@ -488,7 +488,7 @@ LOCALPROCUSEDONCE DisasmMoveQ(void)
|
||||
{
|
||||
/* MoveQ 0111ddd0nnnnnnnn */
|
||||
DisasmStartOne("MOVEQ #");
|
||||
dbglog_writeHex(ui5r_FromSByte(Disasm_opcode));
|
||||
dbglog_writeHex(uint32_t_FromSByte(Disasm_opcode));
|
||||
dbglog_writeCStr(", D");
|
||||
dbglog_writeHex(Disasm_rg9);
|
||||
dbglog_writeReturn();
|
||||
@ -563,22 +563,22 @@ LOCALPROCUSEDONCE DisasmALine(void)
|
||||
|
||||
LOCALPROCUSEDONCE DisasmBsr(void)
|
||||
{
|
||||
ui5b src = ((ui5b)Disasm_opcode) & 255;
|
||||
ui5r s = Disasm_pc;
|
||||
uint32_t src = ((uint32_t)Disasm_opcode) & 255;
|
||||
uint32_t s = Disasm_pc;
|
||||
|
||||
DisasmStartOne("BSR ");
|
||||
if (src == 0) {
|
||||
s += (si5b)(si4b)Disasm_nextiword();
|
||||
s += (int32_t)(int16_t)Disasm_nextiword();
|
||||
} else
|
||||
#if Use68020
|
||||
if (src == 255) {
|
||||
s += (si5b)Disasm_nextilong();
|
||||
s += (int32_t)Disasm_nextilong();
|
||||
/* ReportAbnormal("long branch in DoCode6"); */
|
||||
/* Used by various Apps */
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
s += (si5b)(si3b)src;
|
||||
s += (int32_t)(int8_t)src;
|
||||
}
|
||||
dbglog_writeHex(s);
|
||||
dbglog_writeReturn();
|
||||
@ -602,8 +602,8 @@ LOCALPROCUSEDONCE DisasmLinkA6(void)
|
||||
LOCALPROCUSEDONCE DisasmMOVEMRmM(void)
|
||||
{
|
||||
/* MOVEM reg to mem 0100100011s100rrr */
|
||||
si4b z;
|
||||
ui5r regmask;
|
||||
int16_t z;
|
||||
uint32_t regmask;
|
||||
|
||||
DisasmStartOne("MOVEM");
|
||||
if (Disasm_b76 == 2) {
|
||||
@ -634,8 +634,8 @@ LOCALPROCUSEDONCE DisasmMOVEMRmM(void)
|
||||
LOCALPROCUSEDONCE DisasmMOVEMApR(void)
|
||||
{
|
||||
/* MOVEM mem to reg 0100110011s011rrr */
|
||||
si4b z;
|
||||
ui5r regmask;
|
||||
int16_t z;
|
||||
uint32_t regmask;
|
||||
|
||||
regmask = Disasm_nextiword();
|
||||
|
||||
@ -752,7 +752,7 @@ LOCALPROCUSEDONCE DisasmSubXm(void)
|
||||
DisasmAAs_xxxxdddxssxxxrrr("SUBX");
|
||||
}
|
||||
|
||||
LOCALPROC DisasmBinOp1(ui5r x)
|
||||
LOCALPROC DisasmBinOp1(uint32_t x)
|
||||
{
|
||||
if (! Disasm_b8) {
|
||||
switch (x) {
|
||||
@ -877,7 +877,7 @@ LOCALPROCUSEDONCE DisasmBitOpND(void)
|
||||
DisasmBinBitOp1();
|
||||
Disasm_opsize = 4;
|
||||
dbglog_writeCStr(" #");
|
||||
dbglog_writeHex(ui5r_FromSByte(Disasm_nextibyte()));
|
||||
dbglog_writeHex(uint32_t_FromSByte(Disasm_nextibyte()));
|
||||
dbglog_writeCStr(", ");
|
||||
DisasmModeRegister(0, Disasm_reg);
|
||||
dbglog_writeReturn();
|
||||
@ -889,7 +889,7 @@ LOCALPROCUSEDONCE DisasmBitOpNM(void)
|
||||
DisasmBinBitOp1();
|
||||
Disasm_opsize = 1;
|
||||
dbglog_writeCStr(" #");
|
||||
dbglog_writeHex(ui5r_FromSByte(Disasm_nextibyte()));
|
||||
dbglog_writeHex(uint32_t_FromSByte(Disasm_nextibyte()));
|
||||
dbglog_writeCStr(", ");
|
||||
DisasmModeRegister(Disasm_mode, Disasm_rg9);
|
||||
dbglog_writeReturn();
|
||||
@ -1124,7 +1124,7 @@ LOCALPROC DisasmBinOpStatusCCR(void)
|
||||
}
|
||||
DisasmOpSizeFromb76();
|
||||
dbglog_writeCStr(" #");
|
||||
dbglog_writeHex(ui5r_FromSWord(Disasm_nextiword()));
|
||||
dbglog_writeHex(uint32_t_FromSWord(Disasm_nextiword()));
|
||||
if (Disasm_b76 != 0) {
|
||||
dbglog_writeCStr(", SR");
|
||||
} else {
|
||||
@ -1133,10 +1133,10 @@ LOCALPROC DisasmBinOpStatusCCR(void)
|
||||
dbglog_writeReturn();
|
||||
}
|
||||
|
||||
LOCALPROC disasmreglist(si4b direction, ui5b m1, ui5b r1)
|
||||
LOCALPROC disasmreglist(int16_t direction, uint32_t m1, uint32_t r1)
|
||||
{
|
||||
si4b z;
|
||||
ui5r regmask;
|
||||
int16_t z;
|
||||
uint32_t regmask;
|
||||
|
||||
DisasmStartOne("MOVEM");
|
||||
|
||||
@ -1188,7 +1188,7 @@ LOCALPROCUSEDONCE DisasmMOVEMmr(void)
|
||||
disasmreglist(1, Disasm_mode, Disasm_reg);
|
||||
}
|
||||
|
||||
LOCALPROC DisasmByteBinOp(char *s, ui5b m1, ui5b r1, ui5b m2, ui5b r2)
|
||||
LOCALPROC DisasmByteBinOp(char *s, uint32_t m1, uint32_t r1, uint32_t m2, uint32_t r2)
|
||||
{
|
||||
DisasmStartOne(s);
|
||||
dbglog_writeCStr(" ");
|
||||
@ -1460,9 +1460,9 @@ LOCALPROCUSEDONCE DisasmDivL(void)
|
||||
DisasmStartOne("DIV");
|
||||
|
||||
{
|
||||
ui4b extra = Disasm_nextiword();
|
||||
ui5b rDr = extra & 7;
|
||||
ui5b rDq = (extra >> 12) & 7;
|
||||
uint16_t extra = Disasm_nextiword();
|
||||
uint32_t rDr = extra & 7;
|
||||
uint32_t rDq = (extra >> 12) & 7;
|
||||
|
||||
if (extra & 0x0800) {
|
||||
dbglog_writeCStr("S");
|
||||
@ -1501,9 +1501,9 @@ LOCALPROCUSEDONCE DisasmMulL(void)
|
||||
DisasmStartOne("MUL");
|
||||
|
||||
{
|
||||
ui4b extra = Disasm_nextiword();
|
||||
ui5b rhi = extra & 7;
|
||||
ui5b rlo = (extra >> 12) & 7;
|
||||
uint16_t extra = Disasm_nextiword();
|
||||
uint32_t rhi = extra & 7;
|
||||
uint32_t rlo = (extra >> 12) & 7;
|
||||
|
||||
if (extra & 0x0800) {
|
||||
dbglog_writeCStr("S");
|
||||
@ -1535,13 +1535,13 @@ LOCALPROCUSEDONCE DisasmRtd(void)
|
||||
{
|
||||
/* Rtd 0100111001110100 */
|
||||
DisasmStartOne("RTD #");
|
||||
dbglog_writeHex((si5b)(si4b)Disasm_nextiword());
|
||||
dbglog_writeHex((int32_t)(int16_t)Disasm_nextiword());
|
||||
dbglog_writeReturn();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if Use68020
|
||||
LOCALPROC DisasmControlReg(ui4r i)
|
||||
LOCALPROC DisasmControlReg(uint16_t i)
|
||||
{
|
||||
switch (i) {
|
||||
case 0x0000:
|
||||
@ -1582,7 +1582,7 @@ LOCALPROCUSEDONCE DisasmMoveC(void)
|
||||
DisasmStartOne("MOVEC ");
|
||||
|
||||
{
|
||||
ui4b src = Disasm_nextiword();
|
||||
uint16_t src = Disasm_nextiword();
|
||||
int regno = (src >> 12) & 0x0F;
|
||||
switch (Disasm_reg) {
|
||||
case 2:
|
||||
@ -2442,7 +2442,7 @@ LOCALPROCUSEDONCE DisasmCode5(void)
|
||||
|
||||
LOCALPROCUSEDONCE DisasmCode6(void)
|
||||
{
|
||||
ui5b cond = (Disasm_opcode >> 8) & 15;
|
||||
uint32_t cond = (Disasm_opcode >> 8) & 15;
|
||||
|
||||
if (cond == 1) {
|
||||
/* Bsr 01100001nnnnnnnn */
|
||||
@ -2833,13 +2833,13 @@ LOCALPROC m68k_Disasm_one(void)
|
||||
#define Ln2SavedPCs 4
|
||||
#define NumSavedPCs (1 << Ln2SavedPCs)
|
||||
#define SavedPCsMask (NumSavedPCs - 1)
|
||||
LOCALVAR ui5r SavedPCs[NumSavedPCs];
|
||||
LOCALVAR ui5r SavedPCsIn = 0;
|
||||
LOCALVAR ui5r SavedPCsOut = 0;
|
||||
LOCALVAR uint32_t SavedPCs[NumSavedPCs];
|
||||
LOCALVAR uint32_t SavedPCsIn = 0;
|
||||
LOCALVAR uint32_t SavedPCsOut = 0;
|
||||
|
||||
#define DisasmIncludeCycles 0
|
||||
|
||||
LOCALPROCUSEDONCE DisasmOneAndBack(ui5r pc)
|
||||
LOCALPROCUSEDONCE DisasmOneAndBack(uint32_t pc)
|
||||
{
|
||||
#if DisasmIncludeCycles
|
||||
dbglog_writeHex(GetCuriCount());
|
||||
@ -2853,17 +2853,17 @@ LOCALPROCUSEDONCE DisasmOneAndBack(ui5r pc)
|
||||
|
||||
LOCALPROCUSEDONCE DisasmSavedPCs(void)
|
||||
{
|
||||
ui5r n = SavedPCsIn - SavedPCsOut;
|
||||
uint32_t n = SavedPCsIn - SavedPCsOut;
|
||||
|
||||
if (n != 0) {
|
||||
ui5r pc;
|
||||
uint32_t pc;
|
||||
#if DisasmIncludeCycles
|
||||
ui5r i;
|
||||
uint32_t i;
|
||||
#endif
|
||||
#if 0
|
||||
blnr Skipped = falseblnr;
|
||||
#endif
|
||||
ui5r j = SavedPCsOut;
|
||||
uint32_t j = SavedPCsOut;
|
||||
|
||||
SavedPCsOut = SavedPCsIn;
|
||||
/*
|
||||
@ -2901,7 +2901,7 @@ LOCALPROCUSEDONCE DisasmSavedPCs(void)
|
||||
|
||||
#if 0
|
||||
if (Skipped) {
|
||||
si4b z;
|
||||
int16_t z;
|
||||
|
||||
for (z = 0; z < 16; ++z) {
|
||||
if (z >= 8) {
|
||||
@ -2920,9 +2920,9 @@ LOCALPROCUSEDONCE DisasmSavedPCs(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui5r DisasmCounter = 0;
|
||||
LOCALVAR uint32_t DisasmCounter = 0;
|
||||
|
||||
GLOBALPROC DisasmOneOrSave(ui5r pc)
|
||||
GLOBALPROC DisasmOneOrSave(uint32_t pc)
|
||||
{
|
||||
if (0 != DisasmCounter) {
|
||||
DisasmOneAndBack(pc);
|
||||
|
@ -24,6 +24,6 @@
|
||||
#define DIS1M68K_H
|
||||
#endif
|
||||
|
||||
EXPORTPROC DisasmOneOrSave(ui5r pc);
|
||||
EXPORTPROC DisasmOneOrSave(uint32_t pc);
|
||||
|
||||
EXPORTPROC m68k_WantDisasmContext(void);
|
||||
|
@ -32,40 +32,40 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define do_get_mem_byte(a) ((ui3r)*((ui3b *)(a)))
|
||||
#define do_get_mem_byte(a) ((uint8_t)*((uint8_t *)(a)))
|
||||
|
||||
#if BigEndianUnaligned
|
||||
#define do_get_mem_word(a) ((ui4r)*((ui4b *)(a)))
|
||||
#define do_get_mem_word(a) ((uint16_t)*((uint16_t *)(a)))
|
||||
#else
|
||||
LOCALINLINEFUNC ui4r do_get_mem_word(ui3p a)
|
||||
LOCALINLINEFUNC uint16_t do_get_mem_word(ui3p a)
|
||||
{
|
||||
#if LittleEndianUnaligned
|
||||
ui4b b = (*((ui4b *)(a)));
|
||||
uint16_t b = (*((uint16_t *)(a)));
|
||||
|
||||
return ((b & 0x00FF) << 8) | ((b >> 8) & 0x00FF);
|
||||
#else
|
||||
return (((ui4r)*a) << 8) | ((ui4r)*(a + 1));
|
||||
return (((uint16_t)*a) << 8) | ((uint16_t)*(a + 1));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BigEndianUnaligned
|
||||
#define do_get_mem_long(a) ((ui5r)*((ui5b *)(a)))
|
||||
#define do_get_mem_long(a) ((uint32_t)*((uint32_t *)(a)))
|
||||
#elif HaveMySwapUi5r && LittleEndianUnaligned
|
||||
#define do_get_mem_long(a) (MySwapUi5r((ui5r)*((ui5b *)(a))))
|
||||
#define do_get_mem_long(a) (MySwapUi5r((uint32_t)*((uint32_t *)(a))))
|
||||
#else
|
||||
LOCALINLINEFUNC ui5r do_get_mem_long(ui3p a)
|
||||
LOCALINLINEFUNC uint32_t do_get_mem_long(ui3p a)
|
||||
{
|
||||
#if LittleEndianUnaligned
|
||||
#if 0
|
||||
ui5b b = (*((ui5b *)(a)));
|
||||
uint32_t b = (*((uint32_t *)(a)));
|
||||
return ((b & 0x000000FF) << 24)
|
||||
| ((b & 0x0000FF00) << 8)
|
||||
| ((b & 0x00FF0000) >> 8)
|
||||
| ((b & 0xFF000000) >> 24);
|
||||
#endif
|
||||
#if 0
|
||||
ui5b b = (*((ui5b *)(a)));
|
||||
uint32_t b = (*((uint32_t *)(a)));
|
||||
return ((b << 24) & 0xFF000000)
|
||||
| ((b << 8) & 0x00FF0000)
|
||||
| ((b >> 8) & 0x0000FF00)
|
||||
@ -75,35 +75,35 @@ LOCALINLINEFUNC ui5r do_get_mem_long(ui3p a)
|
||||
instead try combining two 16 bit swaps.
|
||||
*/
|
||||
#endif
|
||||
ui5b b = (*((ui5b *)(a)));
|
||||
ui4b b1 = b;
|
||||
ui4b b2 = b >> 16;
|
||||
ui4b c1 = ((b1 & 0x00FF) << 8) | ((b1 >> 8) & 0x00FF);
|
||||
ui4b c2 = ((b2 & 0x00FF) << 8) | ((b2 >> 8) & 0x00FF);
|
||||
uint32_t b = (*((uint32_t *)(a)));
|
||||
uint16_t b1 = b;
|
||||
uint16_t b2 = b >> 16;
|
||||
uint16_t c1 = ((b1 & 0x00FF) << 8) | ((b1 >> 8) & 0x00FF);
|
||||
uint16_t c2 = ((b2 & 0x00FF) << 8) | ((b2 >> 8) & 0x00FF);
|
||||
|
||||
return (((ui5r)c1) << 16) | ((ui5r)c2);
|
||||
return (((uint32_t)c1) << 16) | ((uint32_t)c2);
|
||||
/*
|
||||
better, though still doesn't use BSWAP
|
||||
instruction with apple tools for intel.
|
||||
*/
|
||||
#else
|
||||
return (((ui5r)*a) << 24) | (((ui5r)*(a + 1)) << 16)
|
||||
| (((ui5r)*(a + 2)) << 8) | ((ui5r)*(a + 3));
|
||||
return (((uint32_t)*a) << 24) | (((uint32_t)*(a + 1)) << 16)
|
||||
| (((uint32_t)*(a + 2)) << 8) | ((uint32_t)*(a + 3));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#define do_put_mem_byte(a, v) ((*((ui3b *)(a))) = (v))
|
||||
#define do_put_mem_byte(a, v) ((*((uint8_t *)(a))) = (v))
|
||||
|
||||
#if BigEndianUnaligned
|
||||
#define do_put_mem_word(a, v) ((*((ui4b *)(a))) = (v))
|
||||
#define do_put_mem_word(a, v) ((*((uint16_t *)(a))) = (v))
|
||||
#else
|
||||
LOCALINLINEFUNC void do_put_mem_word(ui3p a, ui4r v)
|
||||
LOCALINLINEFUNC void do_put_mem_word(ui3p a, uint16_t v)
|
||||
{
|
||||
#if LittleEndianUnaligned
|
||||
ui4b b = ((v & 0x00FF) << 8) | ((v >> 8) & 0x00FF);
|
||||
uint16_t b = ((v & 0x00FF) << 8) | ((v >> 8) & 0x00FF);
|
||||
|
||||
*(ui4b *)a = b;
|
||||
*(uint16_t *)a = b;
|
||||
#else
|
||||
*a = v >> 8;
|
||||
*(a + 1) = v;
|
||||
@ -112,19 +112,19 @@ LOCALINLINEFUNC void do_put_mem_word(ui3p a, ui4r v)
|
||||
#endif
|
||||
|
||||
#if BigEndianUnaligned
|
||||
#define do_put_mem_long(a, v) ((*((ui5b *)(a))) = (v))
|
||||
#define do_put_mem_long(a, v) ((*((uint32_t *)(a))) = (v))
|
||||
#elif HaveMySwapUi5r && LittleEndianUnaligned
|
||||
#define do_put_mem_long(a, v) ((*((ui5b *)(a))) = MySwapUi5r(v))
|
||||
#define do_put_mem_long(a, v) ((*((uint32_t *)(a))) = MySwapUi5r(v))
|
||||
#else
|
||||
LOCALINLINEFUNC void do_put_mem_long(ui3p a, ui5r v)
|
||||
LOCALINLINEFUNC void do_put_mem_long(ui3p a, uint32_t v)
|
||||
{
|
||||
#if LittleEndianUnaligned
|
||||
ui4b b1 = v;
|
||||
ui4b b2 = v >> 16;
|
||||
ui4b c1 = ((b1 & 0x00FF) << 8) | ((b1 >> 8) & 0x00FF);
|
||||
ui4b c2 = ((b2 & 0x00FF) << 8) | ((b2 >> 8) & 0x00FF);
|
||||
uint16_t b1 = v;
|
||||
uint16_t b2 = v >> 16;
|
||||
uint16_t c1 = ((b1 & 0x00FF) << 8) | ((b1 >> 8) & 0x00FF);
|
||||
uint16_t c2 = ((b2 & 0x00FF) << 8) | ((b2 >> 8) & 0x00FF);
|
||||
|
||||
*(ui5b *)a = (c1 << 16) | c2;
|
||||
*(uint32_t *)a = (c1 << 16) | c2;
|
||||
#else
|
||||
*a = v >> 24;
|
||||
*(a + 1) = v >> 16;
|
||||
|
148
src/FPCPEMDV.h
148
src/FPCPEMDV.h
@ -30,21 +30,21 @@ LOCALVAR struct fpustruct
|
||||
CPTR FPIAR; /* Floating point instruction address register */
|
||||
} fpu_dat;
|
||||
|
||||
LOCALPROC myfp_SetFPIAR(ui5r v)
|
||||
LOCALPROC myfp_SetFPIAR(uint32_t v)
|
||||
{
|
||||
fpu_dat.FPIAR = v;
|
||||
}
|
||||
|
||||
LOCALFUNC ui5r myfp_GetFPIAR(void)
|
||||
LOCALFUNC uint32_t myfp_GetFPIAR(void)
|
||||
{
|
||||
return fpu_dat.FPIAR;
|
||||
}
|
||||
|
||||
LOCALFUNC blnr DecodeAddrModeRegister(ui5b sz)
|
||||
LOCALFUNC blnr DecodeAddrModeRegister(uint32_t sz)
|
||||
{
|
||||
ui4r Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
ui4r themode = (Dat >> 3) & 7;
|
||||
ui4r thereg = Dat & 7;
|
||||
uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
uint16_t themode = (Dat >> 3) & 7;
|
||||
uint16_t thereg = Dat & 7;
|
||||
|
||||
switch (themode) {
|
||||
case 2 :
|
||||
@ -74,11 +74,11 @@ LOCALFUNC blnr DecodeAddrModeRegister(ui5b sz)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC read_long_double(ui5r addr, myfpr *r)
|
||||
LOCALPROC read_long_double(uint32_t addr, myfpr *r)
|
||||
{
|
||||
ui4r v2;
|
||||
ui5r v1;
|
||||
ui5r v0;
|
||||
uint16_t v2;
|
||||
uint32_t v1;
|
||||
uint32_t v0;
|
||||
|
||||
v2 = get_word(addr + 0);
|
||||
/* ignore word at offset 2 */
|
||||
@ -88,11 +88,11 @@ LOCALPROC read_long_double(ui5r addr, myfpr *r)
|
||||
myfp_FromExtendedFormat(r, v2, v1, v0);
|
||||
}
|
||||
|
||||
LOCALPROC write_long_double(ui5r addr, myfpr *xx)
|
||||
LOCALPROC write_long_double(uint32_t addr, myfpr *xx)
|
||||
{
|
||||
ui4r v2;
|
||||
ui5r v1;
|
||||
ui5r v0;
|
||||
uint16_t v2;
|
||||
uint32_t v1;
|
||||
uint32_t v0;
|
||||
|
||||
myfp_ToExtendedFormat(xx, &v2, &v1, &v0);
|
||||
|
||||
@ -102,10 +102,10 @@ LOCALPROC write_long_double(ui5r addr, myfpr *xx)
|
||||
put_long(addr + 8, v0);
|
||||
}
|
||||
|
||||
LOCALPROC read_double(ui5r addr, myfpr *r)
|
||||
LOCALPROC read_double(uint32_t addr, myfpr *r)
|
||||
{
|
||||
ui5r v1;
|
||||
ui5r v0;
|
||||
uint32_t v1;
|
||||
uint32_t v0;
|
||||
|
||||
v1 = get_long(addr + 0);
|
||||
v0 = get_long(addr + 4);
|
||||
@ -113,10 +113,10 @@ LOCALPROC read_double(ui5r addr, myfpr *r)
|
||||
myfp_FromDoubleFormat(r, v1, v0);
|
||||
}
|
||||
|
||||
LOCALPROC write_double(ui5r addr, myfpr *dd)
|
||||
LOCALPROC write_double(uint32_t addr, myfpr *dd)
|
||||
{
|
||||
ui5r v1;
|
||||
ui5r v0;
|
||||
uint32_t v1;
|
||||
uint32_t v0;
|
||||
|
||||
myfp_ToDoubleFormat(dd, &v1, &v0);
|
||||
|
||||
@ -125,23 +125,23 @@ LOCALPROC write_double(ui5r addr, myfpr *dd)
|
||||
}
|
||||
|
||||
#if 0
|
||||
LOCALPROC read_single(ui5r addr, myfpr *r)
|
||||
LOCALPROC read_single(uint32_t addr, myfpr *r)
|
||||
{
|
||||
myfp_FromSingleFormat(r, get_long(addr));
|
||||
}
|
||||
|
||||
LOCALPROC write_single(ui5r addr, myfpr *ff)
|
||||
LOCALPROC write_single(uint32_t addr, myfpr *ff)
|
||||
{
|
||||
put_long(addr, myfp_ToSingleFormat(ff));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
LOCALFUNC int CheckFPCondition(ui4b predicate)
|
||||
LOCALFUNC int CheckFPCondition(uint16_t predicate)
|
||||
{
|
||||
int condition_true = 0;
|
||||
|
||||
ui3r cc = myfp_GetConditionCodeByte();
|
||||
uint8_t cc = myfp_GetConditionCodeByte();
|
||||
|
||||
int c_nan = (cc) & 1;
|
||||
/* int c_inf = (cc >> 1) & 1; */
|
||||
@ -233,7 +233,7 @@ LOCALIPROC DoCodeFPU_dflt(void)
|
||||
"unimplemented Floating Point Instruction");
|
||||
#if dbglog_HAVE
|
||||
{
|
||||
ui4r opcode = ((ui4r)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
uint16_t opcode = ((uint16_t)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
| V_regs.CurDecOpY.v[0].ArgDat;
|
||||
|
||||
dbglog_writelnNum("opcode", opcode);
|
||||
@ -244,7 +244,7 @@ LOCALIPROC DoCodeFPU_dflt(void)
|
||||
|
||||
LOCALIPROC DoCodeFPU_Save(void)
|
||||
{
|
||||
ui4r opcode = ((ui4r)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
uint16_t opcode = ((uint16_t)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
| V_regs.CurDecOpY.v[0].ArgDat;
|
||||
if ((opcode == 0xF327) || (opcode == 0xF32D)) {
|
||||
#if 0
|
||||
@ -279,12 +279,12 @@ LOCALIPROC DoCodeFPU_Save(void)
|
||||
|
||||
LOCALIPROC DoCodeFPU_Restore(void)
|
||||
{
|
||||
ui4r opcode = ((ui4r)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
uint16_t opcode = ((uint16_t)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
| V_regs.CurDecOpY.v[0].ArgDat;
|
||||
ui4r themode = (opcode >> 3) & 7;
|
||||
ui4r thereg = opcode & 7;
|
||||
uint16_t themode = (opcode >> 3) & 7;
|
||||
uint16_t thereg = opcode & 7;
|
||||
if ((opcode == 0xF35F) || (opcode == 0xF36D)) {
|
||||
ui5r dstvalue;
|
||||
uint32_t dstvalue;
|
||||
|
||||
if (! DecodeAddrModeRegister(4)) {
|
||||
DoCodeFPU_dflt();
|
||||
@ -322,7 +322,7 @@ LOCALIPROC DoCodeFPU_FBccW(void)
|
||||
Also get here for a NOP instruction (opcode 0xF280),
|
||||
which is simply a FBF.w with offset 0
|
||||
*/
|
||||
ui4r Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
|
||||
if (CheckFPCondition(Dat & 0x3F)) {
|
||||
DoCodeBraW();
|
||||
@ -335,7 +335,7 @@ LOCALIPROC DoCodeFPU_FBccW(void)
|
||||
|
||||
LOCALIPROC DoCodeFPU_FBccL(void)
|
||||
{
|
||||
ui4r Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
|
||||
if (CheckFPCondition(Dat & 0x3F)) {
|
||||
DoCodeBraL();
|
||||
@ -346,20 +346,20 @@ LOCALIPROC DoCodeFPU_FBccL(void)
|
||||
|
||||
LOCALIPROC DoCodeFPU_DBcc(void)
|
||||
{
|
||||
ui4r Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
ui4r thereg = Dat & 7;
|
||||
ui4b word2 = (int)nextiword();
|
||||
uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
uint16_t thereg = Dat & 7;
|
||||
uint16_t word2 = (int)nextiword();
|
||||
|
||||
ui4b predicate = word2 & 0x3F;
|
||||
uint16_t predicate = word2 & 0x3F;
|
||||
|
||||
int condition_true = CheckFPCondition(predicate);
|
||||
|
||||
if (! condition_true) {
|
||||
ui5b fdb_count = ui5r_FromSWord(m68k_dreg(thereg)) - 1;
|
||||
uint32_t fdb_count = uint32_t_FromSWord(m68k_dreg(thereg)) - 1;
|
||||
|
||||
m68k_dreg(thereg) =
|
||||
(m68k_dreg(thereg) & ~ 0xFFFF) | (fdb_count & 0xFFFF);
|
||||
if ((si5b)fdb_count == -1) {
|
||||
if ((int32_t)fdb_count == -1) {
|
||||
SkipiWord();
|
||||
} else {
|
||||
DoCodeBraW();
|
||||
@ -371,12 +371,12 @@ LOCALIPROC DoCodeFPU_DBcc(void)
|
||||
|
||||
LOCALIPROC DoCodeFPU_Trapcc(void)
|
||||
{
|
||||
ui4r Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
ui4r thereg = Dat & 7;
|
||||
uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
uint16_t thereg = Dat & 7;
|
||||
|
||||
ui4b word2 = (int)nextiword();
|
||||
uint16_t word2 = (int)nextiword();
|
||||
|
||||
ui4b predicate = word2 & 0x3F;
|
||||
uint16_t predicate = word2 & 0x3F;
|
||||
|
||||
int condition_true = CheckFPCondition(predicate);
|
||||
|
||||
@ -397,7 +397,7 @@ LOCALIPROC DoCodeFPU_Trapcc(void)
|
||||
|
||||
LOCALIPROC DoCodeFPU_Scc(void)
|
||||
{
|
||||
ui4b word2 = (int)nextiword();
|
||||
uint16_t word2 = (int)nextiword();
|
||||
|
||||
if (! DecodeModeRegister(1)) {
|
||||
DoCodeFPU_dflt();
|
||||
@ -419,9 +419,9 @@ LOCALPROC DoCodeF_InvalidPlusWord(void)
|
||||
DoCodeFPU_dflt();
|
||||
}
|
||||
|
||||
LOCALFUNC int CountCSIAlist(ui4b word2)
|
||||
LOCALFUNC int CountCSIAlist(uint16_t word2)
|
||||
{
|
||||
ui4b regselect = (word2 >> 10) & 0x7;
|
||||
uint16_t regselect = (word2 >> 10) & 0x7;
|
||||
int num = 0;
|
||||
|
||||
if (regselect & 1) {
|
||||
@ -437,11 +437,11 @@ LOCALFUNC int CountCSIAlist(ui4b word2)
|
||||
return num;
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_Move_EA_CSIA(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_Move_EA_CSIA(uint16_t word2)
|
||||
{
|
||||
int n;
|
||||
ui5b ea_value[3];
|
||||
ui4b regselect = (word2 >> 10) & 0x7;
|
||||
uint32_t ea_value[3];
|
||||
uint16_t regselect = (word2 >> 10) & 0x7;
|
||||
int num = CountCSIAlist(word2);
|
||||
|
||||
if (regselect == 0) {
|
||||
@ -481,13 +481,13 @@ LOCALPROC DoCodeFPU_Move_EA_CSIA(ui4b word2)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_MoveM_CSIA_EA(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_MoveM_CSIA_EA(uint16_t word2)
|
||||
{
|
||||
int n;
|
||||
ui5b ea_value[3];
|
||||
uint32_t ea_value[3];
|
||||
int num = CountCSIAlist(word2);
|
||||
|
||||
ui4b regselect = (word2 >> 10) & 0x7;
|
||||
uint16_t regselect = (word2 >> 10) & 0x7;
|
||||
|
||||
/* FMOVEM.L <FP CR,SR,IAR list>, <EA> */
|
||||
|
||||
@ -525,14 +525,14 @@ LOCALPROC DoCodeFPU_MoveM_CSIA_EA(ui4b word2)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_MoveM_EA_list(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_MoveM_EA_list(uint16_t word2)
|
||||
{
|
||||
int i;
|
||||
ui5r myaddr;
|
||||
ui5r count;
|
||||
ui4b register_list = word2;
|
||||
uint32_t myaddr;
|
||||
uint32_t count;
|
||||
uint16_t register_list = word2;
|
||||
|
||||
ui4b fmove_mode = (word2 >> 11) & 0x3;
|
||||
uint16_t fmove_mode = (word2 >> 11) & 0x3;
|
||||
|
||||
/* FMOVEM.X <ea>, <list> */
|
||||
|
||||
@ -578,18 +578,18 @@ LOCALPROC DoCodeFPU_MoveM_EA_list(ui4b word2)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_MoveM_list_EA(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_MoveM_list_EA(uint16_t word2)
|
||||
{
|
||||
/* FMOVEM.X <list>, <ea> */
|
||||
|
||||
int i;
|
||||
ui5r myaddr;
|
||||
ui5r count;
|
||||
ui4b register_list = word2;
|
||||
ui4r Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
ui4r themode = (Dat >> 3) & 7;
|
||||
uint32_t myaddr;
|
||||
uint32_t count;
|
||||
uint16_t register_list = word2;
|
||||
uint16_t Dat = V_regs.CurDecOpY.v[0].ArgDat;
|
||||
uint16_t themode = (Dat >> 3) & 7;
|
||||
|
||||
ui4b fmove_mode = (word2 >> 11) & 0x3;
|
||||
uint16_t fmove_mode = (word2 >> 11) & 0x3;
|
||||
|
||||
if ((fmove_mode == 1) || (fmove_mode == 3)) {
|
||||
/* Dynamic mode */
|
||||
@ -639,10 +639,10 @@ LOCALPROC DoCodeFPU_MoveM_list_EA(ui4b word2)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_MoveCR(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_MoveCR(uint16_t word2)
|
||||
{
|
||||
/* FMOVECR */
|
||||
ui4r opcode = ((ui4r)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
uint16_t opcode = ((uint16_t)(V_regs.CurDecOpY.v[0].AMd) << 8)
|
||||
| V_regs.CurDecOpY.v[0].ArgDat;
|
||||
|
||||
if (opcode != 0xF200) {
|
||||
@ -651,8 +651,8 @@ LOCALPROC DoCodeFPU_MoveCR(ui4b word2)
|
||||
dbglog_writeln("bad opcode in FMOVECR");
|
||||
#endif
|
||||
} else {
|
||||
ui4b RomOffset = word2 & 0x7F;
|
||||
ui4b DestReg = (word2 >> 7) & 0x7;
|
||||
uint16_t RomOffset = word2 & 0x7F;
|
||||
uint16_t DestReg = (word2 >> 7) & 0x7;
|
||||
|
||||
if (! myfp_getCR(&fpu_dat.fp[DestReg], RomOffset)) {
|
||||
DoCodeF_InvalidPlusWord();
|
||||
@ -669,7 +669,7 @@ LOCALPROC SaveResultAndFPSR(myfpr *DestReg, myfpr *result)
|
||||
myfp_SetConditionCodeByteFromResult(result);
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_GenOp(ui4b word2, myfpr *source)
|
||||
LOCALPROC DoCodeFPU_GenOp(uint16_t word2, myfpr *source)
|
||||
{
|
||||
myfpr result;
|
||||
myfpr t0;
|
||||
@ -984,14 +984,14 @@ LOCALPROC DoCodeFPU_GenOp(ui4b word2, myfpr *source)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_GenOpReg(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_GenOpReg(uint16_t word2)
|
||||
{
|
||||
ui4r regselect = (word2 >> 10) & 0x7;
|
||||
uint16_t regselect = (word2 >> 10) & 0x7;
|
||||
|
||||
DoCodeFPU_GenOp(word2, &fpu_dat.fp[regselect]);
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_GenOpEA(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_GenOpEA(uint16_t word2)
|
||||
{
|
||||
myfpr source;
|
||||
|
||||
@ -1092,11 +1092,11 @@ LOCALPROC DoCodeFPU_GenOpEA(ui4b word2)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC DoCodeFPU_Move_FP_EA(ui4b word2)
|
||||
LOCALPROC DoCodeFPU_Move_FP_EA(uint16_t word2)
|
||||
{
|
||||
/* FMOVE FP?, <EA> */
|
||||
|
||||
ui4r SourceReg = (word2 >> 7) & 0x7;
|
||||
uint16_t SourceReg = (word2 >> 7) & 0x7;
|
||||
myfpr *source = &fpu_dat.fp[SourceReg];
|
||||
|
||||
switch ((word2 >> 10) & 0x7) {
|
||||
@ -1183,7 +1183,7 @@ LOCALPROC DoCodeFPU_Move_FP_EA(ui4b word2)
|
||||
|
||||
LOCALIPROC DoCodeFPU_md60(void)
|
||||
{
|
||||
ui4b word2 = (int)nextiword();
|
||||
uint16_t word2 = (int)nextiword();
|
||||
|
||||
switch ((word2 >> 13) & 0x7) {
|
||||
case 0:
|
||||
|
672
src/FPMATHEM.h
672
src/FPMATHEM.h
File diff suppressed because it is too large
Load Diff
114
src/GLOBGLUE.c
114
src/GLOBGLUE.c
@ -62,34 +62,34 @@ IMPORTPROC Sony_SetQuitOnEject(void);
|
||||
|
||||
IMPORTPROC m68k_IPLchangeNtfy(void);
|
||||
IMPORTPROC MINEM68K_Init(
|
||||
ui3b *fIPL);
|
||||
uint8_t *fIPL);
|
||||
|
||||
IMPORTFUNC ui5b GetCyclesRemaining(void);
|
||||
IMPORTPROC SetCyclesRemaining(ui5b n);
|
||||
IMPORTFUNC uint32_t GetCyclesRemaining(void);
|
||||
IMPORTPROC SetCyclesRemaining(uint32_t n);
|
||||
|
||||
IMPORTPROC SetHeadATTel(ATTep p);
|
||||
IMPORTFUNC ATTep FindATTel(CPTR addr);
|
||||
|
||||
IMPORTFUNC ui5b SCSI_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC ui5b IWM_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC uint32_t SCSI_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC uint32_t SCC_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC uint32_t IWM_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
#if EmVIA2
|
||||
IMPORTFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
#endif
|
||||
#if EmASC
|
||||
IMPORTFUNC ui5b ASC_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
IMPORTFUNC uint32_t ASC_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
#endif
|
||||
|
||||
IMPORTFUNC ui3r get_vm_byte(CPTR addr);
|
||||
IMPORTFUNC ui4r get_vm_word(CPTR addr);
|
||||
IMPORTFUNC ui5r get_vm_long(CPTR addr);
|
||||
IMPORTFUNC uint8_t get_vm_byte(CPTR addr);
|
||||
IMPORTFUNC uint16_t get_vm_word(CPTR addr);
|
||||
IMPORTFUNC uint32_t get_vm_long(CPTR addr);
|
||||
|
||||
IMPORTPROC put_vm_byte(CPTR addr, ui3r b);
|
||||
IMPORTPROC put_vm_word(CPTR addr, ui4r w);
|
||||
IMPORTPROC put_vm_long(CPTR addr, ui5r l);
|
||||
IMPORTPROC put_vm_byte(CPTR addr, uint8_t b);
|
||||
IMPORTPROC put_vm_word(CPTR addr, uint16_t w);
|
||||
IMPORTPROC put_vm_long(CPTR addr, uint32_t l);
|
||||
|
||||
GLOBALVAR ui5r my_disk_icon_addr;
|
||||
GLOBALVAR uint32_t my_disk_icon_addr;
|
||||
|
||||
GLOBALPROC customreset(void)
|
||||
{
|
||||
@ -125,7 +125,7 @@ GLOBALVAR ui3p VidROM = nullpr;
|
||||
GLOBALVAR ui3p VidMem = nullpr;
|
||||
#endif
|
||||
|
||||
GLOBALVAR ui3b Wires[kNumWires];
|
||||
GLOBALVAR uint8_t Wires[kNumWires];
|
||||
|
||||
|
||||
#if WantDisasm
|
||||
@ -152,8 +152,8 @@ GLOBALPROC dbglog_WriteMemArrow(blnr WriteMem)
|
||||
#endif
|
||||
|
||||
#if dbglog_HAVE
|
||||
GLOBALPROC dbglog_AddrAccess(char *s, ui5r Data,
|
||||
blnr WriteMem, ui5r addr)
|
||||
GLOBALPROC dbglog_AddrAccess(char *s, uint32_t Data,
|
||||
blnr WriteMem, uint32_t addr)
|
||||
{
|
||||
dbglog_StartLine();
|
||||
dbglog_writeCStr(s);
|
||||
@ -167,7 +167,7 @@ GLOBALPROC dbglog_AddrAccess(char *s, ui5r Data,
|
||||
#endif
|
||||
|
||||
#if dbglog_HAVE
|
||||
GLOBALPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem)
|
||||
GLOBALPROC dbglog_Access(char *s, uint32_t Data, blnr WriteMem)
|
||||
{
|
||||
dbglog_StartLine();
|
||||
dbglog_writeCStr(s);
|
||||
@ -210,7 +210,7 @@ LOCALVAR blnr GotOneAbnormal = falseblnr;
|
||||
#endif
|
||||
|
||||
#if WantAbnormalReports
|
||||
GLOBALPROC DoReportAbnormalID(ui4r id
|
||||
GLOBALPROC DoReportAbnormalID(uint16_t id
|
||||
#if dbglog_HAVE
|
||||
, char *s
|
||||
#endif
|
||||
@ -303,10 +303,10 @@ GLOBALPROC DoReportAbnormalID(ui4r id
|
||||
|
||||
#if IncludeExtnPbufs
|
||||
LOCALFUNC tMacErr PbufTransferVM(CPTR Buffera,
|
||||
tPbuf i, ui5r offset, ui5r count, blnr IsWrite)
|
||||
tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite)
|
||||
{
|
||||
tMacErr result;
|
||||
ui5b contig;
|
||||
uint32_t contig;
|
||||
ui3p Buffer;
|
||||
|
||||
label_1:
|
||||
@ -356,7 +356,7 @@ LOCALPROC ExtnParamBuffers_Access(CPTR p)
|
||||
case kCmndPbufNew:
|
||||
{
|
||||
tPbuf Pbuf_No;
|
||||
ui5b count = get_vm_long(p + ExtnDat_params + 4);
|
||||
uint32_t count = get_vm_long(p + ExtnDat_params + 4);
|
||||
/* reserved word at offset 2, should be zero */
|
||||
result = PbufNew(count, &Pbuf_No);
|
||||
put_vm_word(p + ExtnDat_params + 0, Pbuf_No);
|
||||
@ -374,7 +374,7 @@ LOCALPROC ExtnParamBuffers_Access(CPTR p)
|
||||
break;
|
||||
case kCmndPbufGetSize:
|
||||
{
|
||||
ui5r Count;
|
||||
uint32_t Count;
|
||||
tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0);
|
||||
/* reserved word at offset 2, should be zero */
|
||||
|
||||
@ -386,17 +386,17 @@ LOCALPROC ExtnParamBuffers_Access(CPTR p)
|
||||
break;
|
||||
case kCmndPbufTransfer:
|
||||
{
|
||||
ui5r PbufCount;
|
||||
uint32_t PbufCount;
|
||||
tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 0);
|
||||
/* reserved word at offset 2, should be zero */
|
||||
ui5r offset = get_vm_long(p + ExtnDat_params + 4);
|
||||
ui5r count = get_vm_long(p + ExtnDat_params + 8);
|
||||
uint32_t offset = get_vm_long(p + ExtnDat_params + 4);
|
||||
uint32_t count = get_vm_long(p + ExtnDat_params + 8);
|
||||
CPTR Buffera = get_vm_long(p + ExtnDat_params + 12);
|
||||
blnr IsWrite =
|
||||
(get_vm_word(p + ExtnDat_params + 16) != 0);
|
||||
result = PbufGetSize(Pbuf_No, &PbufCount);
|
||||
if (mnvm_noErr == result) {
|
||||
ui5r endoff = offset + count;
|
||||
uint32_t endoff = offset + count;
|
||||
if ((endoff < offset) /* overflow */
|
||||
|| (endoff > PbufCount))
|
||||
{
|
||||
@ -484,7 +484,7 @@ LOCALPROC ExtnFind_Access(CPTR p)
|
||||
break;
|
||||
case kCmndFindExtnFind:
|
||||
{
|
||||
ui5b extn = get_vm_long(p + kParamFindExtnTheExtn);
|
||||
uint32_t extn = get_vm_long(p + kParamFindExtnTheExtn);
|
||||
|
||||
if (extn == kDiskDriverExtension) {
|
||||
put_vm_word(p + kParamFindExtnTheId, kExtnDisk);
|
||||
@ -516,7 +516,7 @@ LOCALPROC ExtnFind_Access(CPTR p)
|
||||
break;
|
||||
case kCmndFindExtnId2Code:
|
||||
{
|
||||
ui4r extn = get_vm_word(p + kParamFindExtnTheId);
|
||||
uint16_t extn = get_vm_word(p + kParamFindExtnTheId);
|
||||
|
||||
if (extn == kExtnDisk) {
|
||||
put_vm_long(p + kParamFindExtnTheExtn,
|
||||
@ -560,9 +560,9 @@ LOCALPROC ExtnFind_Access(CPTR p)
|
||||
#define kDSK_Params_Lo 1
|
||||
#define kDSK_QuitOnEject 3 /* obsolete */
|
||||
|
||||
LOCALVAR ui4b ParamAddrHi;
|
||||
LOCALVAR uint16_t ParamAddrHi;
|
||||
|
||||
LOCALPROC Extn_Access(ui5b Data, CPTR addr)
|
||||
LOCALPROC Extn_Access(uint32_t Data, CPTR addr)
|
||||
{
|
||||
switch (addr) {
|
||||
case kDSK_Params_Hi:
|
||||
@ -572,7 +572,7 @@ LOCALPROC Extn_Access(ui5b Data, CPTR addr)
|
||||
{
|
||||
CPTR p = ParamAddrHi << 16 | Data;
|
||||
|
||||
ParamAddrHi = (ui4b) - 1;
|
||||
ParamAddrHi = (uint16_t) - 1;
|
||||
if (kcom_callcheck == get_vm_word(p + ExtnDat_checkval))
|
||||
{
|
||||
put_vm_word(p + ExtnDat_checkval, 0);
|
||||
@ -619,7 +619,7 @@ LOCALPROC Extn_Access(ui5b Data, CPTR addr)
|
||||
|
||||
GLOBALPROC Extn_Reset(void)
|
||||
{
|
||||
ParamAddrHi = (ui4b) - 1;
|
||||
ParamAddrHi = (uint16_t) - 1;
|
||||
}
|
||||
|
||||
/* implementation of read/write for everything but RAM and ROM */
|
||||
@ -691,12 +691,12 @@ enum {
|
||||
|
||||
|
||||
LOCALVAR ATTer ATTListA[MaxATTListN];
|
||||
LOCALVAR ui4r LastATTel;
|
||||
LOCALVAR uint16_t LastATTel;
|
||||
|
||||
|
||||
LOCALPROC AddToATTList(ATTep p)
|
||||
{
|
||||
ui4r NewLast = LastATTel + 1;
|
||||
uint16_t NewLast = LastATTel + 1;
|
||||
if (NewLast >= MaxATTListN) {
|
||||
ReportAbnormalID(0x1101, "MaxATTListN not big enough");
|
||||
} else {
|
||||
@ -725,7 +725,7 @@ LOCALPROC FinishATTList(void)
|
||||
}
|
||||
|
||||
{
|
||||
ui4r i = LastATTel;
|
||||
uint16_t i = LastATTel;
|
||||
ATTep p = &ATTListA[LastATTel];
|
||||
ATTep h = nullpr;
|
||||
|
||||
@ -745,7 +745,7 @@ LOCALPROC FinishATTList(void)
|
||||
ReportAbnormalID(0x1102, "ATTListA bad entry");
|
||||
}
|
||||
for (q2 = q1->Next; nullpr != q2->Next; q2 = q2->Next) {
|
||||
ui5r common_mask = (q1->cmpmask) & (q2->cmpmask);
|
||||
uint32_t common_mask = (q1->cmpmask) & (q2->cmpmask);
|
||||
if ((q1->cmpvalu & common_mask) ==
|
||||
(q2->cmpvalu & common_mask))
|
||||
{
|
||||
@ -764,7 +764,7 @@ LOCALPROC FinishATTList(void)
|
||||
LOCALPROC SetUp_RAM24(void)
|
||||
{
|
||||
ATTer r;
|
||||
ui5r bankbit = 0x00100000 << (((VIA2_iA7 << 1) | VIA2_iA6) << 1);
|
||||
uint32_t bankbit = 0x00100000 << (((VIA2_iA7 << 1) | VIA2_iA6) << 1);
|
||||
|
||||
#if kRAMa_Size == kRAMb_Size
|
||||
if (kRAMa_Size == bankbit) {
|
||||
@ -901,7 +901,7 @@ LOCALPROC SetUp_io(void)
|
||||
but rom accesses it anyway
|
||||
*/
|
||||
{
|
||||
ui5r addr2 = addr & 0x1FFFF;
|
||||
uint32_t addr2 = addr & 0x1FFFF;
|
||||
|
||||
if ((addr2 != 0x1DA00) && (addr2 != 0x1DC00)) {
|
||||
ReportAbnormalID(0x1104, "another unknown access");
|
||||
@ -989,7 +989,7 @@ LOCALPROC SetUp_address32(void)
|
||||
r.Access = kATTA_readreadymask;
|
||||
AddToATTList(&r);
|
||||
} else {
|
||||
ui5r bankbit =
|
||||
uint32_t bankbit =
|
||||
0x00100000 << (((VIA2_iA7 << 1) | VIA2_iA6) << 1);
|
||||
#if kRAMa_Size == kRAMb_Size
|
||||
if (kRAMa_Size == bankbit) {
|
||||
@ -1299,7 +1299,7 @@ LOCALPROC get_fail_realblock(ATTep p)
|
||||
}
|
||||
#endif
|
||||
|
||||
GLOBALFUNC ui5b MMDV_Access(ATTep p, ui5b Data,
|
||||
GLOBALFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data,
|
||||
blnr WriteMem, blnr ByteSize, CPTR addr)
|
||||
{
|
||||
switch (p->MMDV) {
|
||||
@ -1588,10 +1588,10 @@ Label_Retry:
|
||||
return p;
|
||||
}
|
||||
|
||||
GLOBALFUNC ui3p get_real_address0(ui5b L, blnr WritableMem, CPTR addr,
|
||||
ui5b *actL)
|
||||
GLOBALFUNC ui3p get_real_address0(uint32_t L, blnr WritableMem, CPTR addr,
|
||||
uint32_t *actL)
|
||||
{
|
||||
ui5b bankleft;
|
||||
uint32_t bankleft;
|
||||
ui3p p;
|
||||
ATTep q;
|
||||
|
||||
@ -1600,8 +1600,8 @@ GLOBALFUNC ui3p get_real_address0(ui5b L, blnr WritableMem, CPTR addr,
|
||||
*actL = 0;
|
||||
p = nullpr;
|
||||
} else {
|
||||
ui5r m2 = q->usemask & ~ q->cmpmask;
|
||||
ui5r m3 = m2 & ~ (m2 + 1);
|
||||
uint32_t m2 = q->usemask & ~ q->cmpmask;
|
||||
uint32_t m3 = m2 & ~ (m2 + 1);
|
||||
p = q->usebase + (addr & q->usemask);
|
||||
bankleft = (m3 + 1) - (addr & m3);
|
||||
if (bankleft >= L) {
|
||||
@ -1625,12 +1625,12 @@ GLOBALPROC SetInterruptButton(blnr v)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui3b CurIPL = 0;
|
||||
LOCALVAR uint8_t CurIPL = 0;
|
||||
|
||||
GLOBALPROC VIAorSCCinterruptChngNtfy(void)
|
||||
{
|
||||
#if (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx)
|
||||
ui3b NewIPL;
|
||||
uint8_t NewIPL;
|
||||
|
||||
if (InterruptButton) {
|
||||
NewIPL = 7;
|
||||
@ -1644,9 +1644,9 @@ GLOBALPROC VIAorSCCinterruptChngNtfy(void)
|
||||
NewIPL = 0;
|
||||
}
|
||||
#else
|
||||
ui3b VIAandNotSCC = VIA1_InterruptRequest
|
||||
uint8_t VIAandNotSCC = VIA1_InterruptRequest
|
||||
& ~ SCCInterruptRequest;
|
||||
ui3b NewIPL = VIAandNotSCC
|
||||
uint8_t NewIPL = VIAandNotSCC
|
||||
| (SCCInterruptRequest << 1)
|
||||
| (InterruptButton << 2);
|
||||
#endif
|
||||
@ -1688,7 +1688,7 @@ GLOBALPROC PowerOff_ChangeNtfy(void)
|
||||
/* user event queue utilities */
|
||||
|
||||
#if HaveMasterMyEvtQLock
|
||||
GLOBALVAR ui4r MasterMyEvtQLock = 0;
|
||||
GLOBALVAR uint16_t MasterMyEvtQLock = 0;
|
||||
/*
|
||||
Takes a few ticks to process button event because
|
||||
of debounce code of Mac. So have this mechanism
|
||||
@ -1744,18 +1744,18 @@ GLOBALFUNC iCountt GetCuriCount(void)
|
||||
return NextiCount - GetCyclesRemaining();
|
||||
}
|
||||
|
||||
GLOBALPROC ICT_add(int taskid, ui5b n)
|
||||
GLOBALPROC ICT_add(int taskid, uint32_t n)
|
||||
{
|
||||
/* n must be > 0 */
|
||||
si5r x = GetCyclesRemaining();
|
||||
ui5b when = NextiCount - x + n;
|
||||
int32_t x = GetCyclesRemaining();
|
||||
uint32_t when = NextiCount - x + n;
|
||||
|
||||
#ifdef _VIA_Debug
|
||||
fprintf(stderr, "ICT_add: %d, %d, %d\n", when, taskid, n);
|
||||
#endif
|
||||
InsertICT(taskid, when);
|
||||
|
||||
if (x > (si5r)n) {
|
||||
if (x > (int32_t)n) {
|
||||
SetCyclesRemaining(n);
|
||||
NextiCount = when;
|
||||
}
|
||||
|
@ -61,14 +61,14 @@ EXPORTPROC Addr32_ChangeNtfy(void);
|
||||
/*
|
||||
representation of pointer into memory of emulated computer.
|
||||
*/
|
||||
typedef ui5b CPTR;
|
||||
typedef uint32_t CPTR;
|
||||
|
||||
/*
|
||||
mapping of address space to real memory
|
||||
*/
|
||||
|
||||
EXPORTFUNC ui3p get_real_address0(ui5b L, blnr WritableMem, CPTR addr,
|
||||
ui5b *actL);
|
||||
EXPORTFUNC ui3p get_real_address0(uint32_t L, blnr WritableMem, CPTR addr,
|
||||
uint32_t *actL);
|
||||
|
||||
/*
|
||||
memory access routines that can use when have address
|
||||
@ -108,13 +108,13 @@ EXPORTFUNC ui3p get_real_address0(ui5b L, blnr WritableMem, CPTR addr,
|
||||
EXPORTFUNC blnr AddrSpac_Init(void);
|
||||
|
||||
|
||||
#define ui5r_FromSByte(x) ((ui5r)(si5r)(si3b)(ui3b)(x))
|
||||
#define ui5r_FromSWord(x) ((ui5r)(si5r)(si4b)(ui4b)(x))
|
||||
#define ui5r_FromSLong(x) ((ui5r)(si5r)(si5b)(ui5b)(x))
|
||||
#define uint32_t_FromSByte(x) ((uint32_t)(int32_t)(int8_t)(uint8_t)(x))
|
||||
#define uint32_t_FromSWord(x) ((uint32_t)(int32_t)(int16_t)(uint16_t)(x))
|
||||
#define uint32_t_FromSLong(x) ((uint32_t)(int32_t)(int32_t)(uint32_t)(x))
|
||||
|
||||
#define ui5r_FromUByte(x) ((ui5r)(ui3b)(x))
|
||||
#define ui5r_FromUWord(x) ((ui5r)(ui4b)(x))
|
||||
#define ui5r_FromULong(x) ((ui5r)(ui5b)(x))
|
||||
#define uint32_t_FromUByte(x) ((uint32_t)(uint8_t)(x))
|
||||
#define uint32_t_FromUWord(x) ((uint32_t)(uint16_t)(x))
|
||||
#define uint32_t_FromULong(x) ((uint32_t)(uint32_t)(x))
|
||||
|
||||
|
||||
#if WantDisasm
|
||||
@ -129,8 +129,8 @@ EXPORTPROC dbglog_WriteMemArrow(blnr WriteMem);
|
||||
EXPORTPROC dbglog_WriteNote(char *s);
|
||||
EXPORTPROC dbglog_WriteSetBool(char *s, blnr v);
|
||||
EXPORTPROC dbglog_AddrAccess(char *s,
|
||||
ui5r Data, blnr WriteMem, ui5r addr);
|
||||
EXPORTPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem);
|
||||
uint32_t Data, blnr WriteMem, uint32_t addr);
|
||||
EXPORTPROC dbglog_Access(char *s, uint32_t Data, blnr WriteMem);
|
||||
#endif
|
||||
|
||||
#if ! WantAbnormalReports
|
||||
@ -141,7 +141,7 @@ EXPORTPROC dbglog_Access(char *s, ui5r Data, blnr WriteMem);
|
||||
#else
|
||||
#define ReportAbnormalID(id, s) DoReportAbnormalID(id)
|
||||
#endif
|
||||
EXPORTPROC DoReportAbnormalID(ui4r id
|
||||
EXPORTPROC DoReportAbnormalID(uint16_t id
|
||||
#if dbglog_HAVE
|
||||
, char *s
|
||||
#endif
|
||||
@ -175,9 +175,9 @@ enum {
|
||||
kNumICTs
|
||||
};
|
||||
|
||||
EXPORTPROC ICT_add(int taskid, ui5b n);
|
||||
EXPORTPROC ICT_add(int taskid, uint32_t n);
|
||||
|
||||
#define iCountt ui5b
|
||||
#define iCountt uint32_t
|
||||
EXPORTFUNC iCountt GetCuriCount(void);
|
||||
EXPORTPROC ICT_Zap(void);
|
||||
|
||||
@ -185,7 +185,7 @@ EXPORTVAR(uimr, ICTactive)
|
||||
EXPORTVAR(iCountt, ICTwhen[kNumICTs])
|
||||
EXPORTVAR(iCountt, NextiCount)
|
||||
|
||||
EXPORTVAR(ui3b, Wires[kNumWires])
|
||||
EXPORTVAR(uint8_t, Wires[kNumWires])
|
||||
|
||||
#define kLn2CycleScale 6
|
||||
#define kCycleScale (1 << kLn2CycleScale)
|
||||
@ -200,7 +200,7 @@ EXPORTVAR(ui3b, Wires[kNumWires])
|
||||
|
||||
#define HaveMasterMyEvtQLock EmClassicKbrd
|
||||
#if HaveMasterMyEvtQLock
|
||||
EXPORTVAR(ui4r, MasterMyEvtQLock)
|
||||
EXPORTVAR(uint16_t, MasterMyEvtQLock)
|
||||
#endif
|
||||
EXPORTFUNC blnr FindKeyEvent(int *VirtualKey, blnr *KeyDown);
|
||||
|
||||
@ -236,7 +236,7 @@ enum {
|
||||
|
||||
#define kcom_callcheck 0x5B17
|
||||
|
||||
EXPORTVAR(ui5r, my_disk_icon_addr)
|
||||
EXPORTVAR(uint32_t, my_disk_icon_addr)
|
||||
|
||||
EXPORTPROC Memory_Reset(void);
|
||||
|
||||
@ -246,15 +246,15 @@ EXPORTPROC customreset(void);
|
||||
|
||||
struct ATTer {
|
||||
struct ATTer *Next;
|
||||
ui5r cmpmask;
|
||||
ui5r cmpvalu;
|
||||
ui5r Access;
|
||||
ui5r usemask; /* Should be one less than a power of two. */
|
||||
uint32_t cmpmask;
|
||||
uint32_t cmpvalu;
|
||||
uint32_t Access;
|
||||
uint32_t usemask; /* Should be one less than a power of two. */
|
||||
ui3p usebase;
|
||||
ui3r MMDV;
|
||||
ui3r Ntfy;
|
||||
ui4r Pad0;
|
||||
ui5r Pad1; /* make 32 byte structure, on 32 bit systems */
|
||||
uint8_t MMDV;
|
||||
uint8_t Ntfy;
|
||||
uint16_t Pad0;
|
||||
uint32_t Pad1; /* make 32 byte structure, on 32 bit systems */
|
||||
};
|
||||
typedef struct ATTer ATTer;
|
||||
typedef ATTer *ATTep;
|
||||
@ -271,6 +271,6 @@ typedef ATTer *ATTep;
|
||||
#define kATTA_mmdvmask (1 << kATTA_mmdvbit)
|
||||
#define kATTA_ntfymask (1 << kATTA_ntfybit)
|
||||
|
||||
EXPORTFUNC ui5b MMDV_Access(ATTep p, ui5b Data,
|
||||
EXPORTFUNC uint32_t MMDV_Access(ATTep p, uint32_t Data,
|
||||
blnr WriteMem, blnr ByteSize, CPTR addr);
|
||||
EXPORTFUNC blnr MemAccessNtfy(ATTep pT);
|
||||
|
@ -38,7 +38,7 @@
|
||||
#define kAHM_yuck 13
|
||||
#define kAHM_zombie 14
|
||||
|
||||
LOCALVAR const ui3b my_HappyMac_icon[] = {
|
||||
LOCALVAR const uint8_t my_HappyMac_icon[] = {
|
||||
#if CurAltHappyMac == kAHM_aside
|
||||
0x00, 0x00,
|
||||
0x39, 0x38,
|
||||
@ -243,8 +243,8 @@ LOCALPROC PatchHappyMac(void)
|
||||
|| (CurEmMd == kEmMd_II) || (CurEmMd == kEmMd_IIx)
|
||||
|
||||
int i;
|
||||
ui3b *dst = HappyMacBase + ROM + 0x18;
|
||||
ui3b *src = (ui3b *)my_HappyMac_icon;
|
||||
uint8_t *dst = HappyMacBase + ROM + 0x18;
|
||||
uint8_t *src = (uint8_t *)my_HappyMac_icon;
|
||||
|
||||
for (i = 10; --i >= 0; ) {
|
||||
++dst;
|
||||
|
@ -29,7 +29,7 @@
|
||||
ClStrAppendSubstCStr encoding
|
||||
HTML character entity
|
||||
*/
|
||||
LOCALVAR const ui3b CellData[] = {
|
||||
LOCALVAR const uint8_t CellData[] = {
|
||||
/* kCellUpA 101 0x41 0x0041 'A' 'A' A */
|
||||
0x00, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x7E,
|
||||
0x42, 0x42, 0x42, 0x42, 0x00, 0x00, 0x00, 0x00,
|
||||
@ -1064,7 +1064,7 @@ LOCALVAR const char Cell2MacAsciiMap[] = {
|
||||
|
||||
#if NeedCell2WinAsciiMap
|
||||
/* Windows character set (windows-1252 code page) */
|
||||
LOCALVAR const ui3b Cell2WinAsciiMap[] = {
|
||||
LOCALVAR const uint8_t Cell2WinAsciiMap[] = {
|
||||
0x41, /* kCellUpA */
|
||||
0x42, /* kCellUpB */
|
||||
0x43, /* kCellUpC */
|
||||
@ -1454,7 +1454,7 @@ LOCALVAR const char Cell2PlainAsciiMap[] = {
|
||||
|
||||
#if NeedCell2UnicodeMap
|
||||
/* Unicode character set */
|
||||
LOCALVAR const ui4b Cell2UnicodeMap[] = {
|
||||
LOCALVAR const uint16_t Cell2UnicodeMap[] = {
|
||||
0x0041, /* kCellUpA */
|
||||
0x0042, /* kCellUpB */
|
||||
0x0043, /* kCellUpC */
|
||||
@ -1664,7 +1664,7 @@ LOCALVAR blnr RequestInsertDisk = falseblnr;
|
||||
#endif
|
||||
|
||||
#if NeedRequestIthDisk
|
||||
LOCALVAR ui3r RequestIthDisk = 0;
|
||||
LOCALVAR uint8_t RequestIthDisk = 0;
|
||||
#endif
|
||||
|
||||
#if UseControlKeys
|
||||
@ -1844,7 +1844,7 @@ l_exit:
|
||||
return L;
|
||||
}
|
||||
|
||||
LOCALPROC ClStrAppendChar(int *L0, ui3b *r, ui3b c)
|
||||
LOCALPROC ClStrAppendChar(int *L0, uint8_t *r, uint8_t c)
|
||||
{
|
||||
int L = *L0;
|
||||
|
||||
@ -1853,13 +1853,13 @@ LOCALPROC ClStrAppendChar(int *L0, ui3b *r, ui3b c)
|
||||
*L0 = L;
|
||||
}
|
||||
|
||||
LOCALPROC ClStrAppendSubstCStr(int *L, ui3b *r, char *s)
|
||||
LOCALPROC ClStrAppendSubstCStr(int *L, uint8_t *r, char *s)
|
||||
{
|
||||
/* must match ClStrSizeSubstCStr ! */
|
||||
|
||||
char *p = s;
|
||||
char c;
|
||||
ui3b x;
|
||||
uint8_t x;
|
||||
|
||||
while (0 != (c = *p++)) {
|
||||
if ('^' == c) {
|
||||
@ -2171,7 +2171,7 @@ LOCALPROC ClStrAppendSubstCStr(int *L, ui3b *r, char *s)
|
||||
|
||||
#define ClStrMaxLength 512
|
||||
|
||||
LOCALPROC ClStrFromSubstCStr(int *L, ui3b *r, char *s)
|
||||
LOCALPROC ClStrFromSubstCStr(int *L, uint8_t *r, char *s)
|
||||
{
|
||||
int n = ClStrSizeSubstCStr(s);
|
||||
|
||||
|
@ -71,14 +71,14 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ui3b DataIn; /* Read Data Register */
|
||||
ui3b Handshake; /* Read Handshake Register */
|
||||
ui3b Status; /* Read Status Register */
|
||||
ui3b Mode;
|
||||
uint8_t DataIn; /* Read Data Register */
|
||||
uint8_t Handshake; /* Read Handshake Register */
|
||||
uint8_t Status; /* Read Status Register */
|
||||
uint8_t Mode;
|
||||
/* Drive Off : Write Mode Register */
|
||||
/* Drive On : Write Data Register */
|
||||
ui3b DataOut; /* Write Data Register */
|
||||
ui3b Lines; /* Used to Access Disk Drive Registers */
|
||||
uint8_t DataOut; /* Write Data Register */
|
||||
uint8_t Lines; /* Used to Access Disk Drive Registers */
|
||||
} IWM_Ty;
|
||||
|
||||
IWM_Ty IWM;
|
||||
@ -91,7 +91,7 @@ GLOBALPROC IWM_Reset(void)
|
||||
|
||||
typedef enum {On, Off} Mode_Ty;
|
||||
|
||||
LOCALPROC IWM_Set_Lines(ui3b line, Mode_Ty the_mode)
|
||||
LOCALPROC IWM_Set_Lines(uint8_t line, Mode_Ty the_mode)
|
||||
{
|
||||
if (the_mode == Off) {
|
||||
IWM.Lines &= (0xFF - line);
|
||||
@ -100,7 +100,7 @@ LOCALPROC IWM_Set_Lines(ui3b line, Mode_Ty the_mode)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui3b IWM_Read_Reg(void)
|
||||
LOCALFUNC uint8_t IWM_Read_Reg(void)
|
||||
{
|
||||
switch ((IWM.Lines & (kq6 + kq7)) >> 6) {
|
||||
case 0 :
|
||||
@ -138,7 +138,7 @@ LOCALFUNC ui3b IWM_Read_Reg(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC IWM_Write_Reg(ui3b in)
|
||||
LOCALPROC IWM_Write_Reg(uint8_t in)
|
||||
{
|
||||
if (((IWM.Lines & kmtr) >> 4) == 0) {
|
||||
#ifdef _IWM_Debug
|
||||
@ -149,7 +149,7 @@ LOCALPROC IWM_Write_Reg(ui3b in)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALFUNC ui5b IWM_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
GLOBALFUNC uint32_t IWM_Access(uint32_t Data, blnr WriteMem, CPTR addr)
|
||||
{
|
||||
switch (addr) {
|
||||
case kph0L :
|
||||
|
@ -22,4 +22,4 @@
|
||||
|
||||
EXPORTPROC IWM_Reset(void);
|
||||
|
||||
EXPORTFUNC ui5b IWM_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTFUNC uint32_t IWM_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
|
@ -39,8 +39,8 @@
|
||||
ReportAbnormalID unused 0x0B03 - 0x0BFF
|
||||
*/
|
||||
|
||||
IMPORTPROC KYBD_ShiftOutData(ui3b v);
|
||||
IMPORTFUNC ui3b KYBD_ShiftInData(void);
|
||||
IMPORTPROC KYBD_ShiftOutData(uint8_t v);
|
||||
IMPORTFUNC uint8_t KYBD_ShiftInData(void);
|
||||
|
||||
enum {
|
||||
kKybdStateIdle,
|
||||
@ -54,9 +54,9 @@ enum {
|
||||
LOCALVAR int KybdState = kKybdStateIdle;
|
||||
|
||||
LOCALVAR blnr HaveKeyBoardResult = falseblnr;
|
||||
LOCALVAR ui3b KeyBoardResult;
|
||||
LOCALVAR uint8_t KeyBoardResult;
|
||||
|
||||
LOCALPROC GotKeyBoardData(ui3b v)
|
||||
LOCALPROC GotKeyBoardData(uint8_t v)
|
||||
{
|
||||
if (KybdState != kKybdStateIdle) {
|
||||
HaveKeyBoardResult = trueblnr;
|
||||
@ -67,13 +67,13 @@ LOCALPROC GotKeyBoardData(ui3b v)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui3b InstantCommandData = 0x7B;
|
||||
LOCALVAR uint8_t InstantCommandData = 0x7B;
|
||||
|
||||
LOCALFUNC blnr AttemptToFinishInquiry(void)
|
||||
{
|
||||
int i;
|
||||
blnr KeyDown;
|
||||
ui3b Keyboard_Data;
|
||||
uint8_t Keyboard_Data;
|
||||
|
||||
if (FindKeyEvent(&i, &KeyDown)) {
|
||||
if (i < 64) {
|
||||
@ -111,7 +111,7 @@ GLOBALPROC DoKybd_ReceiveCommand(void)
|
||||
ReportAbnormalID(0x0B01,
|
||||
"KybdState != kKybdStateRecievingCommand");
|
||||
} else {
|
||||
ui3b in = KYBD_ShiftInData();
|
||||
uint8_t in = KYBD_ShiftInData();
|
||||
|
||||
KybdState = kKybdStateRecievedCommand;
|
||||
|
||||
|
@ -30,11 +30,11 @@
|
||||
|
||||
struct WorkR {
|
||||
/* expected size : 8 bytes */
|
||||
ui5b opcode;
|
||||
ui5b opsize;
|
||||
ui4r MainClass;
|
||||
uint32_t opcode;
|
||||
uint32_t opsize;
|
||||
uint16_t MainClass;
|
||||
#if WantCycByPriOp
|
||||
ui4r Cycles;
|
||||
uint16_t Cycles;
|
||||
#endif
|
||||
DecOpR DecOp;
|
||||
};
|
||||
@ -71,9 +71,9 @@ enum {
|
||||
|
||||
#define kMyAvgCycPerInstr (10 * kCycleScale + (40 * kCycleScale / 64))
|
||||
|
||||
LOCALFUNC ui3r GetAMdRegSz(WorkR *p)
|
||||
LOCALFUNC uint8_t GetAMdRegSz(WorkR *p)
|
||||
{
|
||||
ui3r CurAMd;
|
||||
uint8_t CurAMd;
|
||||
|
||||
switch (p->opsize) {
|
||||
case 1:
|
||||
@ -91,9 +91,9 @@ LOCALFUNC ui3r GetAMdRegSz(WorkR *p)
|
||||
return CurAMd;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r GetAMdIndirectSz(WorkR *p)
|
||||
LOCALFUNC uint8_t GetAMdIndirectSz(WorkR *p)
|
||||
{
|
||||
ui3r CurAMd;
|
||||
uint8_t CurAMd;
|
||||
|
||||
switch (p->opsize) {
|
||||
case 1:
|
||||
@ -112,9 +112,9 @@ LOCALFUNC ui3r GetAMdIndirectSz(WorkR *p)
|
||||
}
|
||||
|
||||
#if WantCycByPriOp
|
||||
LOCALFUNC ui4r OpEACalcCyc(WorkR *p, ui3r m, ui3r r)
|
||||
LOCALFUNC uint16_t OpEACalcCyc(WorkR *p, uint8_t m, uint8_t r)
|
||||
{
|
||||
ui4r v;
|
||||
uint16_t v;
|
||||
|
||||
switch (m) {
|
||||
case 0:
|
||||
@ -188,9 +188,9 @@ LOCALFUNC ui4r OpEACalcCyc(WorkR *p, ui3r m, ui3r r)
|
||||
#endif
|
||||
|
||||
#if WantCycByPriOp
|
||||
LOCALFUNC ui4r OpEADestCalcCyc(WorkR *p, ui3r m, ui3r r)
|
||||
LOCALFUNC uint16_t OpEADestCalcCyc(WorkR *p, uint8_t m, uint8_t r)
|
||||
{
|
||||
ui4r v;
|
||||
uint16_t v;
|
||||
|
||||
switch (m) {
|
||||
case 0:
|
||||
@ -253,7 +253,7 @@ LOCALFUNC ui4r OpEADestCalcCyc(WorkR *p, ui3r m, ui3r r)
|
||||
#endif
|
||||
|
||||
LOCALPROC SetDcoArgFields(WorkR *p, blnr src,
|
||||
ui3r CurAMd, ui3r CurArgDat)
|
||||
uint8_t CurAMd, uint8_t CurArgDat)
|
||||
{
|
||||
if (src) {
|
||||
p->DecOp.y.v[0].AMd = CurAMd;
|
||||
@ -265,10 +265,10 @@ LOCALPROC SetDcoArgFields(WorkR *p, blnr src,
|
||||
}
|
||||
|
||||
LOCALFUNC blnr CheckValidAddrMode(WorkR *p,
|
||||
ui3r m, ui3r r, ui3r v, blnr src)
|
||||
uint8_t m, uint8_t r, uint8_t v, blnr src)
|
||||
{
|
||||
ui3r CurAMd = 0; /* init to keep compiler happy */
|
||||
ui3r CurArgDat = 0;
|
||||
uint8_t CurAMd = 0; /* init to keep compiler happy */
|
||||
uint8_t CurArgDat = 0;
|
||||
blnr IsOk;
|
||||
|
||||
switch (m) {
|
||||
@ -493,9 +493,9 @@ LOCALFUNC blnr CheckValidAddrMode(WorkR *p,
|
||||
}
|
||||
|
||||
#if WantCycByPriOp
|
||||
LOCALFUNC blnr LeaPeaEACalcCyc(WorkR *p, ui3r m, ui3r r)
|
||||
LOCALFUNC blnr LeaPeaEACalcCyc(WorkR *p, uint8_t m, uint8_t r)
|
||||
{
|
||||
ui4r v;
|
||||
uint16_t v;
|
||||
|
||||
UnusedParam(p);
|
||||
switch (m) {
|
||||
@ -590,9 +590,9 @@ LOCALPROC FindOpSizeFromb76(WorkR *p)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r OpSizeOffset(WorkR *p)
|
||||
LOCALFUNC uint8_t OpSizeOffset(WorkR *p)
|
||||
{
|
||||
ui3r v;
|
||||
uint8_t v;
|
||||
|
||||
switch (p->opsize) {
|
||||
case 1 :
|
||||
@ -611,7 +611,7 @@ LOCALFUNC ui3r OpSizeOffset(WorkR *p)
|
||||
}
|
||||
|
||||
|
||||
LOCALFUNC ui5r octdat(ui5r x)
|
||||
LOCALFUNC uint32_t octdat(uint32_t x)
|
||||
{
|
||||
if (x == 0) {
|
||||
return 8;
|
||||
@ -1155,9 +1155,9 @@ LOCALPROCUSEDONCE DeCode3(WorkR *p)
|
||||
#define MoveAvgN 3
|
||||
#endif
|
||||
|
||||
LOCALFUNC ui4r MoveMEACalcCyc(WorkR *p, ui3r m, ui3r r)
|
||||
LOCALFUNC uint16_t MoveMEACalcCyc(WorkR *p, uint8_t m, uint8_t r)
|
||||
{
|
||||
ui4r v;
|
||||
uint16_t v;
|
||||
|
||||
UnusedParam(p);
|
||||
switch (m) {
|
||||
@ -2039,7 +2039,7 @@ LOCALPROCUSEDONCE DeCode5(WorkR *p)
|
||||
|
||||
LOCALPROCUSEDONCE DeCode6(WorkR *p)
|
||||
{
|
||||
ui5b cond = (p->opcode >> 8) & 15;
|
||||
uint32_t cond = (p->opcode >> 8) & 15;
|
||||
|
||||
if (cond == 1) {
|
||||
/* Bsr 01100001nnnnnnnn */
|
||||
@ -2812,9 +2812,9 @@ LOCALPROCUSEDONCE DeCodeD(WorkR *p)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui5r rolops(WorkR *p, ui5r x)
|
||||
LOCALFUNC uint32_t rolops(WorkR *p, uint32_t x)
|
||||
{
|
||||
ui5r binop;
|
||||
uint32_t binop;
|
||||
|
||||
binop = (x << 1);
|
||||
if (! b8(p)) {
|
||||
@ -3050,10 +3050,10 @@ LOCALPROC DeCodeOneOp(WorkR *p)
|
||||
|
||||
GLOBALPROC M68KITAB_setup(DecOpR *p)
|
||||
{
|
||||
ui5b i;
|
||||
uint32_t i;
|
||||
WorkR r;
|
||||
|
||||
for (i = 0; i < (ui5b)256 * 256; ++i) {
|
||||
for (i = 0; i < (uint32_t)256 * 256; ++i) {
|
||||
r.opcode = i;
|
||||
r.MainClass = kIKindIllegal;
|
||||
|
||||
|
@ -246,15 +246,15 @@ enum {
|
||||
|
||||
struct DecOpXR {
|
||||
/* expected size : 4 bytes */
|
||||
ui4b MainClas;
|
||||
ui4b Cycles;
|
||||
uint16_t MainClas;
|
||||
uint16_t Cycles;
|
||||
};
|
||||
typedef struct DecOpXR DecOpXR;
|
||||
|
||||
struct DecArgR {
|
||||
/* expected size : 2 bytes */
|
||||
ui3b AMd;
|
||||
ui3b ArgDat;
|
||||
uint8_t AMd;
|
||||
uint8_t ArgDat;
|
||||
};
|
||||
typedef struct DecArgR DecArgR;
|
||||
|
||||
|
2184
src/MINEM68K.c
2184
src/MINEM68K.c
File diff suppressed because it is too large
Load Diff
@ -21,19 +21,19 @@
|
||||
#endif
|
||||
|
||||
EXPORTPROC MINEM68K_Init(
|
||||
ui3b *fIPL);
|
||||
uint8_t *fIPL);
|
||||
#if SmallGlobals
|
||||
EXPORTPROC MINEM68K_ReserveAlloc(void);
|
||||
#endif
|
||||
|
||||
EXPORTPROC m68k_IPLchangeNtfy(void);
|
||||
EXPORTPROC DiskInsertedPsuedoException(CPTR newpc, ui5b data);
|
||||
EXPORTPROC DiskInsertedPsuedoException(CPTR newpc, uint32_t data);
|
||||
EXPORTPROC m68k_reset(void);
|
||||
|
||||
EXPORTFUNC si5r GetCyclesRemaining(void);
|
||||
EXPORTPROC SetCyclesRemaining(si5r n);
|
||||
EXPORTFUNC int32_t GetCyclesRemaining(void);
|
||||
EXPORTPROC SetCyclesRemaining(int32_t n);
|
||||
|
||||
EXPORTPROC m68k_go_nCycles(ui5b n);
|
||||
EXPORTPROC m68k_go_nCycles(uint32_t n);
|
||||
|
||||
/*
|
||||
general purpose access of address space
|
||||
@ -41,13 +41,13 @@ EXPORTPROC m68k_go_nCycles(ui5b n);
|
||||
memory mapped hardware.)
|
||||
*/
|
||||
|
||||
EXPORTFUNC ui3r get_vm_byte(CPTR addr);
|
||||
EXPORTFUNC ui4r get_vm_word(CPTR addr);
|
||||
EXPORTFUNC ui5r get_vm_long(CPTR addr);
|
||||
EXPORTFUNC uint8_t get_vm_byte(CPTR addr);
|
||||
EXPORTFUNC uint16_t get_vm_word(CPTR addr);
|
||||
EXPORTFUNC uint32_t get_vm_long(CPTR addr);
|
||||
|
||||
EXPORTPROC put_vm_byte(CPTR addr, ui3r b);
|
||||
EXPORTPROC put_vm_word(CPTR addr, ui4r w);
|
||||
EXPORTPROC put_vm_long(CPTR addr, ui5r l);
|
||||
EXPORTPROC put_vm_byte(CPTR addr, uint8_t b);
|
||||
EXPORTPROC put_vm_word(CPTR addr, uint16_t w);
|
||||
EXPORTPROC put_vm_long(CPTR addr, uint32_t l);
|
||||
|
||||
EXPORTPROC SetHeadATTel(ATTep p);
|
||||
EXPORTFUNC ATTep FindATTel(CPTR addr);
|
||||
|
@ -79,7 +79,7 @@ GLOBALPROC Mouse_Update(void)
|
||||
#endif
|
||||
#endif
|
||||
if (MyEvtQElKindMousePos == p->kind) {
|
||||
ui5r NewMouse = (p->u.pos.v << 16) | p->u.pos.h;
|
||||
uint32_t NewMouse = (p->u.pos.v << 16) | p->u.pos.h;
|
||||
|
||||
if (get_ram_long(0x0828) != NewMouse) {
|
||||
put_ram_long(0x0828, NewMouse);
|
||||
|
132
src/MYOSGLUE.h
132
src/MYOSGLUE.h
@ -35,23 +35,23 @@
|
||||
|
||||
|
||||
#if WantAbnormalReports
|
||||
EXPORTOSGLUPROC WarnMsgAbnormalID(ui4r id);
|
||||
EXPORTOSGLUPROC WarnMsgAbnormalID(uint16_t id);
|
||||
#endif
|
||||
|
||||
#if dbglog_HAVE
|
||||
EXPORTOSGLUPROC dbglog_writeCStr(char *s);
|
||||
EXPORTOSGLUPROC dbglog_writeReturn(void);
|
||||
EXPORTOSGLUPROC dbglog_writeHex(ui5r x);
|
||||
EXPORTOSGLUPROC dbglog_writeNum(ui5r x);
|
||||
EXPORTOSGLUPROC dbglog_writeMacChar(ui3r x);
|
||||
EXPORTOSGLUPROC dbglog_writeHex(uint32_t x);
|
||||
EXPORTOSGLUPROC dbglog_writeNum(uint32_t x);
|
||||
EXPORTOSGLUPROC dbglog_writeMacChar(uint8_t x);
|
||||
EXPORTOSGLUPROC dbglog_writeln(char *s);
|
||||
EXPORTOSGLUPROC dbglog_writelnNum(char *s, simr v);
|
||||
#endif
|
||||
|
||||
EXPORTOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n, ui3r align,
|
||||
EXPORTOSGLUPROC ReserveAllocOneBlock(ui3p *p, uimr n, uint8_t align,
|
||||
blnr FillOnes);
|
||||
|
||||
EXPORTOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount);
|
||||
EXPORTOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount);
|
||||
|
||||
|
||||
EXPORTVAR(ui3p, ROM)
|
||||
@ -61,76 +61,76 @@ EXPORTVAR(ui3p, ROM)
|
||||
(passed back to the emulated 68k code).
|
||||
*/
|
||||
|
||||
#define tMacErr ui4r
|
||||
#define tMacErr uint16_t
|
||||
|
||||
#define mnvm_noErr ((tMacErr) 0x0000)
|
||||
/* (ui4b) 0 - No Error */
|
||||
/* (uint16_t) 0 - No Error */
|
||||
#define mnvm_miscErr ((tMacErr) 0xFFFF)
|
||||
/* (ui4b) - 1 - Should probably replace these */
|
||||
/* (uint16_t) - 1 - Should probably replace these */
|
||||
#define mnvm_controlErr ((tMacErr) 0xFFEF)
|
||||
/* (ui4b) - 17 - I/O System Errors */
|
||||
/* (uint16_t) - 17 - I/O System Errors */
|
||||
#define mnvm_statusErr ((tMacErr) 0xFFEE)
|
||||
/* (ui4b) - 18 - Driver can't respond to Status call */
|
||||
/* (uint16_t) - 18 - Driver can't respond to Status call */
|
||||
#define mnvm_closErr ((tMacErr) 0xFFE8)
|
||||
/* (ui4b) - 24 - I/O System Errors */
|
||||
/* (uint16_t) - 24 - I/O System Errors */
|
||||
#define mnvm_eofErr ((tMacErr) 0xFFD9)
|
||||
/* (ui4b) - 39 - End of file */
|
||||
/* (uint16_t) - 39 - End of file */
|
||||
#define mnvm_tmfoErr ((tMacErr) 0xFFD6)
|
||||
/* (ui4b) - 42 - too many files open */
|
||||
/* (uint16_t) - 42 - too many files open */
|
||||
#define mnvm_fnfErr ((tMacErr) 0xFFD5)
|
||||
/* (ui4b) - 43 - File not found */
|
||||
/* (uint16_t) - 43 - File not found */
|
||||
#define mnvm_wPrErr ((tMacErr) 0xFFD4)
|
||||
/* (ui4b) - 44 - diskette is write protected */
|
||||
/* (uint16_t) - 44 - diskette is write protected */
|
||||
#define mnvm_vLckdErr ((tMacErr) 0xFFD2)
|
||||
/* (ui4b) - 46 - volume is locked */
|
||||
/* (uint16_t) - 46 - volume is locked */
|
||||
#define mnvm_dupFNErr ((tMacErr) 0xFFD0)
|
||||
/* (ui4b) - 48 - duplicate filename */
|
||||
/* (uint16_t) - 48 - duplicate filename */
|
||||
#define mnvm_opWrErr ((tMacErr) 0xFFCF)
|
||||
/* (ui4b) - 49 - file already open with with write permission */
|
||||
/* (uint16_t) - 49 - file already open with with write permission */
|
||||
#define mnvm_paramErr ((tMacErr) 0xFFCE)
|
||||
/* (ui4b) - 50 - error in parameter list */
|
||||
/* (uint16_t) - 50 - error in parameter list */
|
||||
#define mnvm_permErr ((tMacErr) 0xFFCA)
|
||||
/* (ui4b) - 54 - permissions error (on file open) */
|
||||
/* (uint16_t) - 54 - permissions error (on file open) */
|
||||
#define mnvm_nsDrvErr ((tMacErr) 0xFFC8)
|
||||
/* (ui4b) - 56 - No Such Drive */
|
||||
/* (uint16_t) - 56 - No Such Drive */
|
||||
#define mnvm_wrPermErr ((tMacErr) 0xFFC3)
|
||||
/* (ui4b) - 61 - write permissions error */
|
||||
/* (uint16_t) - 61 - write permissions error */
|
||||
#define mnvm_offLinErr ((tMacErr) 0xFFBF)
|
||||
/* (ui4b) - 65 - off-line drive */
|
||||
/* (uint16_t) - 65 - off-line drive */
|
||||
#define mnvm_dirNFErr ((tMacErr) 0xFF88)
|
||||
/* (ui4b) - 120 - directory not found */
|
||||
/* (uint16_t) - 120 - directory not found */
|
||||
#define mnvm_afpAccessDenied ((tMacErr) 0xEC78)
|
||||
/* (ui4b) - 5000 - Insufficient access privileges for operation */
|
||||
/* (uint16_t) - 5000 - Insufficient access privileges for operation */
|
||||
|
||||
#if IncludePbufs
|
||||
|
||||
#define tPbuf ui4r
|
||||
#define tPbuf uint16_t
|
||||
|
||||
#define NotAPbuf ((tPbuf)0xFFFF)
|
||||
|
||||
EXPORTOSGLUFUNC tMacErr CheckPbuf(tPbuf Pbuf_No);
|
||||
EXPORTOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, ui5r *Count);
|
||||
EXPORTOSGLUFUNC tMacErr PbufGetSize(tPbuf Pbuf_No, uint32_t *Count);
|
||||
|
||||
EXPORTOSGLUFUNC tMacErr PbufNew(ui5b count, tPbuf *r);
|
||||
EXPORTOSGLUFUNC tMacErr PbufNew(uint32_t count, tPbuf *r);
|
||||
EXPORTOSGLUPROC PbufDispose(tPbuf i);
|
||||
EXPORTOSGLUPROC PbufTransfer(ui3p Buffer,
|
||||
tPbuf i, ui5r offset, ui5r count, blnr IsWrite);
|
||||
tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite);
|
||||
|
||||
#endif
|
||||
|
||||
#define tDrive ui4r
|
||||
#define tDrive uint16_t
|
||||
|
||||
EXPORTVAR(ui5b, vSonyWritableMask)
|
||||
EXPORTVAR(ui5b, vSonyInsertedMask)
|
||||
EXPORTVAR(uint32_t, vSonyWritableMask)
|
||||
EXPORTVAR(uint32_t, vSonyInsertedMask)
|
||||
|
||||
#define vSonyIsInserted(Drive_No) \
|
||||
((vSonyInsertedMask & ((ui5b)1 << (Drive_No))) != 0)
|
||||
((vSonyInsertedMask & ((uint32_t)1 << (Drive_No))) != 0)
|
||||
|
||||
EXPORTOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount);
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount);
|
||||
EXPORTOSGLUFUNC tMacErr vSonyEject(tDrive Drive_No);
|
||||
EXPORTOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count);
|
||||
EXPORTOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count);
|
||||
|
||||
EXPORTOSGLUFUNC blnr AnyDiskInserted(void);
|
||||
EXPORTOSGLUPROC DiskRevokeWritable(tDrive Drive_No);
|
||||
@ -141,7 +141,7 @@ EXPORTVAR(blnr, vSonyRawMode)
|
||||
|
||||
#if IncludeSonyNew
|
||||
EXPORTVAR(blnr, vSonyNewDiskWanted)
|
||||
EXPORTVAR(ui5b, vSonyNewDiskSize)
|
||||
EXPORTVAR(uint32_t, vSonyNewDiskSize)
|
||||
EXPORTOSGLUFUNC tMacErr vSonyEjectDelete(tDrive Drive_No);
|
||||
#endif
|
||||
|
||||
@ -158,15 +158,15 @@ EXPORTOSGLUFUNC tMacErr HTCEexport(tPbuf i);
|
||||
EXPORTOSGLUFUNC tMacErr HTCEimport(tPbuf *r);
|
||||
#endif
|
||||
|
||||
EXPORTVAR(ui5b, OnTrueTime)
|
||||
EXPORTVAR(uint32_t, OnTrueTime)
|
||||
|
||||
EXPORTVAR(ui5b, CurMacDateInSeconds)
|
||||
EXPORTVAR(uint32_t, CurMacDateInSeconds)
|
||||
#if AutoLocation
|
||||
EXPORTVAR(ui5b, CurMacLatitude)
|
||||
EXPORTVAR(ui5b, CurMacLongitude)
|
||||
EXPORTVAR(uint32_t, CurMacLatitude)
|
||||
EXPORTVAR(uint32_t, CurMacLongitude)
|
||||
#endif
|
||||
#if AutoTimeZone
|
||||
EXPORTVAR(ui5b, CurMacDelta)
|
||||
EXPORTVAR(uint32_t, CurMacDelta)
|
||||
/* (dlsDelta << 24) | (gmtDelta & 0x00FFFFFF) */
|
||||
#endif
|
||||
|
||||
@ -193,13 +193,13 @@ EXPORTVAR(blnr, ColorMappingChanged)
|
||||
#if (0 != vMacScreenDepth) && (vMacScreenDepth < 4)
|
||||
#define CLUT_size (1 << (1 << vMacScreenDepth))
|
||||
|
||||
EXPORTVAR(ui4r, CLUT_reds[CLUT_size])
|
||||
EXPORTVAR(ui4r, CLUT_greens[CLUT_size])
|
||||
EXPORTVAR(ui4r, CLUT_blues[CLUT_size])
|
||||
EXPORTVAR(uint16_t, CLUT_reds[CLUT_size])
|
||||
EXPORTVAR(uint16_t, CLUT_greens[CLUT_size])
|
||||
EXPORTVAR(uint16_t, CLUT_blues[CLUT_size])
|
||||
#endif
|
||||
|
||||
EXPORTVAR(blnr, EmVideoDisable)
|
||||
EXPORTVAR(si3b, EmLagTime)
|
||||
EXPORTVAR(int8_t, EmLagTime)
|
||||
|
||||
EXPORTOSGLUPROC Screen_OutputFrame(ui3p screencurrentbuff);
|
||||
EXPORTOSGLUPROC DoneWithDrawingForTick(void);
|
||||
@ -212,19 +212,19 @@ EXPORTVAR(blnr, WantMacReset)
|
||||
|
||||
EXPORTOSGLUFUNC blnr ExtraTimeNotOver(void);
|
||||
|
||||
EXPORTVAR(ui3b, SpeedValue)
|
||||
EXPORTVAR(uint8_t, SpeedValue)
|
||||
|
||||
#if EnableAutoSlow
|
||||
EXPORTVAR(blnr, WantNotAutoSlow)
|
||||
#endif
|
||||
|
||||
/* where emulated machine thinks mouse is */
|
||||
EXPORTVAR(ui4b, CurMouseV)
|
||||
EXPORTVAR(ui4b, CurMouseH)
|
||||
EXPORTVAR(uint16_t, CurMouseV)
|
||||
EXPORTVAR(uint16_t, CurMouseH)
|
||||
|
||||
#if EnableAutoSlow
|
||||
EXPORTVAR(ui5r, QuietTime)
|
||||
EXPORTVAR(ui5r, QuietSubTicks)
|
||||
EXPORTVAR(uint32_t, QuietTime)
|
||||
EXPORTVAR(uint32_t, QuietSubTicks)
|
||||
|
||||
#define QuietEnds() \
|
||||
{ \
|
||||
@ -236,13 +236,13 @@ EXPORTVAR(ui5r, QuietSubTicks)
|
||||
#endif
|
||||
|
||||
#if 3 == kLn2SoundSampSz
|
||||
#define trSoundSamp ui3r
|
||||
#define tbSoundSamp ui3b
|
||||
#define trSoundSamp uint8_t
|
||||
#define tbSoundSamp uint8_t
|
||||
#define tpSoundSamp ui3p
|
||||
#define kCenterSound 0x80
|
||||
#elif 4 == kLn2SoundSampSz
|
||||
#define trSoundSamp ui4r
|
||||
#define tbSoundSamp ui4b
|
||||
#define trSoundSamp uint16_t
|
||||
#define tbSoundSamp uint16_t
|
||||
#define tpSoundSamp ui4p
|
||||
#define kCenterSound 0x8000
|
||||
#else
|
||||
@ -251,8 +251,8 @@ EXPORTVAR(ui5r, QuietSubTicks)
|
||||
|
||||
#if MySoundEnabled
|
||||
|
||||
EXPORTOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL);
|
||||
EXPORTOSGLUPROC MySound_EndWrite(ui4r actL);
|
||||
EXPORTOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL);
|
||||
EXPORTOSGLUPROC MySound_EndWrite(uint16_t actL);
|
||||
|
||||
/* 370 samples per tick = 22,254.54 per second */
|
||||
#endif
|
||||
@ -261,12 +261,12 @@ EXPORTOSGLUPROC MySound_EndWrite(ui4r actL);
|
||||
|
||||
#define LT_TxBfMxSz 1024
|
||||
EXPORTVAR(ui3p, LT_TxBuffer)
|
||||
EXPORTVAR(ui4r, LT_TxBuffSz)
|
||||
EXPORTVAR(uint16_t, LT_TxBuffSz)
|
||||
|
||||
EXPORTOSGLUPROC LT_TransmitPacket(void);
|
||||
|
||||
EXPORTVAR(ui3p, LT_RxBuffer)
|
||||
EXPORTVAR(ui5r, LT_RxBuffSz)
|
||||
EXPORTVAR(uint32_t, LT_RxBuffSz)
|
||||
|
||||
EXPORTOSGLUPROC LT_ReceivePacket(void);
|
||||
|
||||
@ -281,16 +281,16 @@ EXPORTOSGLUPROC WaitForNextTick(void);
|
||||
|
||||
struct MyEvtQEl {
|
||||
/* expected size : 8 bytes */
|
||||
ui3b kind;
|
||||
ui3b pad[3];
|
||||
uint8_t kind;
|
||||
uint8_t pad[3];
|
||||
union {
|
||||
struct {
|
||||
ui3b down;
|
||||
ui3b key;
|
||||
uint8_t down;
|
||||
uint8_t key;
|
||||
} press;
|
||||
struct {
|
||||
ui4b h;
|
||||
ui4b v;
|
||||
uint16_t h;
|
||||
uint16_t v;
|
||||
} pos;
|
||||
} u;
|
||||
};
|
||||
|
178
src/OSGLUCCO.m
178
src/OSGLUCCO.m
@ -279,7 +279,7 @@ LOCALFUNC blnr HaveMyCGCursorIsVisible(void)
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -358,7 +358,7 @@ LOCALPROC UniCharStrFromSubstCStr(int *L, unichar *x, char *s)
|
||||
{
|
||||
int i;
|
||||
int L0;
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
|
||||
ClStrFromSubstCStr(&L0, ps, s);
|
||||
|
||||
@ -385,19 +385,19 @@ LOCALFUNC blnr MacRomanFileNameToNSString(tPbuf i,
|
||||
{
|
||||
ui3p p;
|
||||
void *Buffer = PbufDat[i];
|
||||
ui5b L = PbufSize[i];
|
||||
uint32_t L = PbufSize[i];
|
||||
|
||||
p = (ui3p)malloc(L /* + 1 */);
|
||||
if (p != NULL) {
|
||||
NSData *d;
|
||||
ui3b *p0 = (ui3b *)Buffer;
|
||||
ui3b *p1 = (ui3b *)p;
|
||||
uint8_t *p0 = (uint8_t *)Buffer;
|
||||
uint8_t *p1 = (uint8_t *)p;
|
||||
|
||||
if (L > 0) {
|
||||
ui5b j = L;
|
||||
uint32_t j = L;
|
||||
|
||||
do {
|
||||
ui3b x = *p0++;
|
||||
uint8_t x = *p0++;
|
||||
if (x < 32) {
|
||||
x = '-';
|
||||
} else if (x >= 128) {
|
||||
@ -452,7 +452,7 @@ LOCALFUNC tMacErr NSStringToRomanPbuf(NSString *string, tPbuf *r)
|
||||
#if 0
|
||||
const char *s = [s0
|
||||
cStringUsingEncoding: NSMacOSRomanStringEncoding];
|
||||
ui5r L = strlen(s);
|
||||
uint32_t L = strlen(s);
|
||||
/* only as of OS X 10.4 */
|
||||
#endif
|
||||
#if 0
|
||||
@ -472,12 +472,12 @@ LOCALFUNC tMacErr NSStringToRomanPbuf(NSString *string, tPbuf *r)
|
||||
v = mnvm_miscErr;
|
||||
} else {
|
||||
/* memcpy((char *)p, s, L); */
|
||||
ui3b *p0 = (ui3b *)s;
|
||||
ui3b *p1 = (ui3b *)p;
|
||||
uint8_t *p0 = (uint8_t *)s;
|
||||
uint8_t *p1 = (uint8_t *)p;
|
||||
int i;
|
||||
|
||||
for (i = L; --i >= 0; ) {
|
||||
ui3b v = *p0++;
|
||||
uint8_t v = *p0++;
|
||||
if (10 == v) {
|
||||
v = 13;
|
||||
}
|
||||
@ -709,12 +709,12 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
ui5r NewSony_Count = 0;
|
||||
uint32_t NewSony_Count = 0;
|
||||
|
||||
if (0 == fseek(refnum, Sony_Start, SEEK_SET)) {
|
||||
if (IsWrite) {
|
||||
@ -735,7 +735,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return err; /*& figure out what really to return &*/
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
@ -1056,11 +1056,11 @@ LOCALFUNC blnr LoadInitialImages(void)
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC blnr WriteZero(FILE *refnum, ui5b L)
|
||||
LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L)
|
||||
{
|
||||
#define ZeroBufferSize 2048
|
||||
ui5b i;
|
||||
ui3b buffer[ZeroBufferSize];
|
||||
uint32_t i;
|
||||
uint8_t buffer[ZeroBufferSize];
|
||||
|
||||
memset(&buffer, 0, ZeroBufferSize);
|
||||
|
||||
@ -1076,7 +1076,7 @@ LOCALFUNC blnr WriteZero(FILE *refnum, ui5b L)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk0(ui5b L, NSString *sPath)
|
||||
LOCALPROC MakeNewDisk0(uint32_t L, NSString *sPath)
|
||||
{
|
||||
blnr IsOk = falseblnr;
|
||||
const char *drivepath = [sPath fileSystemRepresentation];
|
||||
@ -1177,17 +1177,17 @@ LOCALFUNC blnr LoadMacRom(void)
|
||||
GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i)
|
||||
{
|
||||
void *Buffer;
|
||||
ui5r L;
|
||||
uint32_t L;
|
||||
tMacErr err = mnvm_miscErr;
|
||||
|
||||
PbufKillToPtr(&Buffer, &L, i);
|
||||
|
||||
if (L > 0) {
|
||||
int j;
|
||||
ui3b *p = (ui3b *)Buffer;
|
||||
uint8_t *p = (uint8_t *)Buffer;
|
||||
|
||||
for (j = L; --j >= 0; ) {
|
||||
ui3b v = *p;
|
||||
uint8_t v = *p;
|
||||
if (13 == v) {
|
||||
*p = 10;
|
||||
}
|
||||
@ -1262,8 +1262,8 @@ LOCALVAR NSView *MyNSview = nil;
|
||||
LOCALVAR NSGraphicsContext *MyNSgfxContext = nil;
|
||||
LOCALVAR CGContextRef MyCGcontext = nil;
|
||||
LOCALVAR void *MyPixels = NULL;
|
||||
LOCALVAR ui4b MyPitch;
|
||||
LOCALVAR ui3b MyBytesPerPixel;
|
||||
LOCALVAR uint16_t MyPitch;
|
||||
LOCALVAR uint8_t MyBytesPerPixel;
|
||||
#endif
|
||||
|
||||
LOCALVAR NSOpenGLContext *MyNSOpnGLCntxt = nil;
|
||||
@ -1471,7 +1471,7 @@ LOCALPROC ForceShowCursor(void)
|
||||
/* cursor moving */
|
||||
|
||||
#if EnableMoveMouse
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
NSPoint p;
|
||||
CGPoint cgp;
|
||||
@ -1557,8 +1557,8 @@ LOCALPROC AdjustMouseMotionGrab(void)
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
@ -1730,8 +1730,8 @@ LOCALVAR ui3p CLUT_final;
|
||||
|
||||
#endif
|
||||
|
||||
LOCALPROC UpdateLuminanceCopy(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1782,13 +1782,13 @@ LOCALPROC UpdateLuminanceCopy(si4b top, si4b left,
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC MyDrawWithOpenGL(ui4r top, ui4r left, ui4r bottom, ui4r right)
|
||||
LOCALPROC MyDrawWithOpenGL(uint16_t top, uint16_t left, uint16_t bottom, uint16_t right)
|
||||
{
|
||||
if (nil == MyNSOpnGLCntxt) {
|
||||
/* oops */
|
||||
} else {
|
||||
si4b top2;
|
||||
si4b left2;
|
||||
int16_t top2;
|
||||
int16_t left2;
|
||||
|
||||
#if VarFullScreen
|
||||
if (UseFullScreen)
|
||||
@ -1883,7 +1883,7 @@ label_exit:
|
||||
}
|
||||
|
||||
#if UseCGContextDrawImage
|
||||
LOCALPROC SDL_UpdateRect(si5b x, si5b y, ui5b w, ui5b h)
|
||||
LOCALPROC SDL_UpdateRect(int32_t x, int32_t y, uint32_t w, uint32_t h)
|
||||
{
|
||||
if ([MyWindow isMiniaturized]) {
|
||||
|
||||
@ -1916,14 +1916,14 @@ LOCALPROC SDL_UpdateRect(si5b x, si5b y, ui5b w, ui5b h)
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
LOCALVAR NSTimeInterval LatestTime;
|
||||
LOCALVAR NSTimeInterval NextTickChangeTime;
|
||||
|
||||
#define MyTickDuration (1.0 / 60.14742)
|
||||
|
||||
LOCALVAR ui5b NewMacDateInSeconds;
|
||||
LOCALVAR uint32_t NewMacDateInSeconds;
|
||||
|
||||
LOCALVAR blnr EmulationWasInterrupted = falseblnr;
|
||||
|
||||
@ -1966,11 +1966,11 @@ LOCALPROC UpdateTrueEmulatedTime(void)
|
||||
}
|
||||
|
||||
|
||||
LOCALVAR ui5b MyDateDelta;
|
||||
LOCALVAR uint32_t MyDateDelta;
|
||||
|
||||
LOCALFUNC blnr CheckDateTime(void)
|
||||
{
|
||||
NewMacDateInSeconds = ((ui5b)LatestTime) + MyDateDelta;
|
||||
NewMacDateInSeconds = ((uint32_t)LatestTime) + MyDateDelta;
|
||||
if (CurMacDateInSeconds != NewMacDateInSeconds) {
|
||||
CurMacDateInSeconds = NewMacDateInSeconds;
|
||||
return trueblnr;
|
||||
@ -1988,14 +1988,14 @@ LOCALPROC StartUpTimeAdjust(void)
|
||||
LOCALFUNC blnr InitLocationDat(void)
|
||||
{
|
||||
NSTimeZone *MyZone = [NSTimeZone localTimeZone];
|
||||
ui5b TzOffSet = (ui5b)[MyZone secondsFromGMT];
|
||||
uint32_t TzOffSet = (uint32_t)[MyZone secondsFromGMT];
|
||||
#if AutoTimeZone
|
||||
BOOL isdst = [MyZone isDaylightSavingTime];
|
||||
#endif
|
||||
|
||||
MyDateDelta = TzOffSet - 1233815296;
|
||||
LatestTime = [NSDate timeIntervalSinceReferenceDate];
|
||||
NewMacDateInSeconds = ((ui5b)LatestTime) + MyDateDelta;
|
||||
NewMacDateInSeconds = ((uint32_t)LatestTime) + MyDateDelta;
|
||||
CurMacDateInSeconds = NewMacDateInSeconds;
|
||||
#if AutoTimeZone
|
||||
CurMacDelta = (TzOffSet & 0x00FFFFFF)
|
||||
@ -2035,13 +2035,13 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
static volatile ui4b ThePlayOffset;
|
||||
static volatile ui4b TheFillOffset;
|
||||
static volatile ui4b MinFilledSoundBuffs;
|
||||
static volatile uint16_t ThePlayOffset;
|
||||
static volatile uint16_t TheFillOffset;
|
||||
static volatile uint16_t MinFilledSoundBuffs;
|
||||
#if dbglog_SoundBuffStats
|
||||
LOCALVAR ui4b MaxFilledSoundBuffs;
|
||||
LOCALVAR uint16_t MaxFilledSoundBuffs;
|
||||
#endif
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
|
||||
LOCALPROC MySound_Start0(void)
|
||||
{
|
||||
@ -2055,10 +2055,10 @@ LOCALPROC MySound_Start0(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -2092,7 +2092,7 @@ LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
LOCALPROC MySound_WroteABlock(void)
|
||||
{
|
||||
#if (4 == kLn2SoundSampSz)
|
||||
ui4b PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
uint16_t PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
tpSoundSamp p = TheSoundBuffer + (PrevWriteOffset & kAllBuffMask);
|
||||
#endif
|
||||
|
||||
@ -2106,9 +2106,9 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
|
||||
#if dbglog_SoundBuffStats
|
||||
{
|
||||
ui4b ToPlayLen = TheFillOffset
|
||||
uint16_t ToPlayLen = TheFillOffset
|
||||
- ThePlayOffset;
|
||||
ui4b ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (ToPlayBuffs > MaxFilledSoundBuffs) {
|
||||
MaxFilledSoundBuffs = ToPlayBuffs;
|
||||
@ -2117,7 +2117,7 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC blnr MySound_EndWrite0(ui4r actL)
|
||||
LOCALFUNC blnr MySound_EndWrite0(uint16_t actL)
|
||||
{
|
||||
blnr v;
|
||||
|
||||
@ -2161,7 +2161,7 @@ LOCALPROC MySound_SecondNotify0(void)
|
||||
}
|
||||
}
|
||||
|
||||
typedef ui4r trSoundTemp;
|
||||
typedef uint16_t trSoundTemp;
|
||||
|
||||
#define kCenterTempSound 0x8000
|
||||
|
||||
@ -2219,9 +2219,9 @@ LOCALPROC SoundRampTo(trSoundTemp *last_val, trSoundTemp dst_val,
|
||||
|
||||
struct MySoundR {
|
||||
tpSoundSamp fTheSoundBuffer;
|
||||
volatile ui4b (*fPlayOffset);
|
||||
volatile ui4b (*fFillOffset);
|
||||
volatile ui4b (*fMinFilledSoundBuffs);
|
||||
volatile uint16_t (*fPlayOffset);
|
||||
volatile uint16_t (*fFillOffset);
|
||||
volatile uint16_t (*fMinFilledSoundBuffs);
|
||||
|
||||
volatile trSoundTemp lastv;
|
||||
|
||||
@ -2235,12 +2235,12 @@ typedef struct MySoundR MySoundR;
|
||||
|
||||
LOCALPROC my_audio_callback(void *udata, void *stream, int len)
|
||||
{
|
||||
ui4b ToPlayLen;
|
||||
ui4b FilledSoundBuffs;
|
||||
uint16_t ToPlayLen;
|
||||
uint16_t FilledSoundBuffs;
|
||||
int i;
|
||||
MySoundR *datp = (MySoundR *)udata;
|
||||
tpSoundSamp CurSoundBuffer = datp->fTheSoundBuffer;
|
||||
ui4b CurPlayOffset = *datp->fPlayOffset;
|
||||
uint16_t CurPlayOffset = *datp->fPlayOffset;
|
||||
trSoundTemp v0 = datp->lastv;
|
||||
trSoundTemp v1 = v0;
|
||||
tpSoundSamp dst = (tpSoundSamp)stream;
|
||||
@ -2311,7 +2311,7 @@ label_retry:
|
||||
}
|
||||
*datp->fMinFilledSoundBuffs = 0;
|
||||
} else {
|
||||
ui4b PlayBuffContig = kAllBuffLen
|
||||
uint16_t PlayBuffContig = kAllBuffLen
|
||||
- (CurPlayOffset & kAllBuffMask);
|
||||
tpSoundSamp p = CurSoundBuffer
|
||||
+ (CurPlayOffset & kAllBuffMask);
|
||||
@ -2380,7 +2380,7 @@ LOCALPROC MySound_Stop(void)
|
||||
|
||||
if (cur_audio.wantplaying) {
|
||||
OSStatus result;
|
||||
ui4r retry_limit = 50; /* half of a second */
|
||||
uint16_t retry_limit = 50; /* half of a second */
|
||||
|
||||
cur_audio.wantplaying = falseblnr;
|
||||
|
||||
@ -2613,7 +2613,7 @@ LOCALFUNC blnr MySound_Init(void)
|
||||
return trueblnr; /* keep going, even if no sound */
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
}
|
||||
@ -2767,8 +2767,8 @@ LOCALPROC MyMenuSetup(void)
|
||||
|
||||
|
||||
#if ! UseCGContextDrawImage
|
||||
LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
ui4r bottom, ui4r right)
|
||||
LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left,
|
||||
uint16_t bottom, uint16_t right)
|
||||
{
|
||||
if ([MyNSview lockFocusIfCanDraw]) {
|
||||
MyDrawWithOpenGL(top, left, bottom, right);
|
||||
@ -2776,17 +2776,17 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
}
|
||||
}
|
||||
#else
|
||||
LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
ui4r bottom, ui4r right)
|
||||
LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left,
|
||||
uint16_t bottom, uint16_t right)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
ui3b *the_data = (ui3b *)GetCurDrawBuff();
|
||||
ui3b *p;
|
||||
ui5b color;
|
||||
ui5b black_color = 0;
|
||||
uint8_t *the_data = (uint8_t *)GetCurDrawBuff();
|
||||
uint8_t *p;
|
||||
uint32_t color;
|
||||
uint32_t black_color = 0;
|
||||
/* SDL_MapRGB(cur_video.format, 0, 0, 0) */
|
||||
ui5b white_color = 0;
|
||||
uint32_t white_color = 0;
|
||||
/* SDL_MapRGB(cur_video.format, 255, 255, 255) */
|
||||
|
||||
switch (MyBytesPerPixel) {
|
||||
@ -2834,18 +2834,18 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
}
|
||||
switch (MyBytesPerPixel) {
|
||||
case 2: { /* Probably 15-bpp or 16-bpp */
|
||||
ui4b *bufp;
|
||||
uint16_t *bufp;
|
||||
|
||||
bufp = (ui4b *)MyPixels
|
||||
bufp = (uint16_t *)MyPixels
|
||||
+ i * MyPitch / 2 + j;
|
||||
*bufp = color;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: { /* Probably 32-bpp */
|
||||
ui5b *bufp;
|
||||
uint32_t *bufp;
|
||||
|
||||
bufp = (ui5b *)MyPixels
|
||||
bufp = (uint32_t *)MyPixels
|
||||
+ i * MyPitch / 4 + j;
|
||||
*bufp = color;
|
||||
}
|
||||
@ -2866,17 +2866,17 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
}
|
||||
switch (MyBytesPerPixel) {
|
||||
case 2: { /* Probably 15-bpp or 16-bpp */
|
||||
ui4b *bufp;
|
||||
uint16_t *bufp;
|
||||
|
||||
bufp = (ui4b *)MyPixels
|
||||
bufp = (uint16_t *)MyPixels
|
||||
+ i * MyPitch / 2 + j;
|
||||
*bufp = color;
|
||||
}
|
||||
break;
|
||||
case 4: { /* Probably 32-bpp */
|
||||
ui5b *bufp;
|
||||
uint32_t *bufp;
|
||||
|
||||
bufp = (ui5b *)MyPixels
|
||||
bufp = (uint32_t *)MyPixels
|
||||
+ i * MyPitch / 4 + j;
|
||||
*bufp = color;
|
||||
}
|
||||
@ -3088,8 +3088,8 @@ LOCALFUNC blnr Screen_Init(void)
|
||||
#define MyCGMainDisplayID CGMainDisplayID
|
||||
CGDirectDisplayID CurMainDisplayID = MyCGMainDisplayID();
|
||||
|
||||
cur_video.width = (ui5b) CGDisplayPixelsWide(CurMainDisplayID);
|
||||
cur_video.height = (ui5b) CGDisplayPixelsHigh(CurMainDisplayID);
|
||||
cur_video.width = (uint32_t) CGDisplayPixelsWide(CurMainDisplayID);
|
||||
cur_video.height = (uint32_t) CGDisplayPixelsHigh(CurMainDisplayID);
|
||||
#endif
|
||||
|
||||
InitKeyCodes();
|
||||
@ -3727,10 +3727,10 @@ LOCALPROC ZapMyWState(void)
|
||||
#if EnableRecreateW
|
||||
struct MyWState {
|
||||
#if MayFullScreen
|
||||
ui4r f_ViewHSize;
|
||||
ui4r f_ViewVSize;
|
||||
ui4r f_ViewHStart;
|
||||
ui4r f_ViewVStart;
|
||||
uint16_t f_ViewHSize;
|
||||
uint16_t f_ViewVSize;
|
||||
uint16_t f_ViewHStart;
|
||||
uint16_t f_ViewVStart;
|
||||
short f_hOffset;
|
||||
short f_vOffset;
|
||||
#endif
|
||||
@ -3750,8 +3750,8 @@ struct MyWState {
|
||||
NSGraphicsContext *f_MyNSgfxContext;
|
||||
CGContextRef f_MyCGcontext;
|
||||
void *f_MyPixels;
|
||||
ui4b f_MyPitch;
|
||||
ui3b f_MyBytesPerPixel;
|
||||
uint16_t f_MyPitch;
|
||||
uint8_t f_MyBytesPerPixel;
|
||||
#endif
|
||||
NSOpenGLContext *f_MyNSOpnGLCntxt;
|
||||
short f_GLhOffset;
|
||||
@ -4080,7 +4080,7 @@ createDirectoryAtPath:withIntermediateDirectories:attributes:error:
|
||||
@end
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk(ui5b L, NSString *drivename)
|
||||
LOCALPROC MakeNewDisk(uint32_t L, NSString *drivename)
|
||||
{
|
||||
#if SaveDialogEnable
|
||||
NSInteger result = NSCancelButton;
|
||||
@ -4153,7 +4153,7 @@ LOCALPROC MakeNewDisk(ui5b L, NSString *drivename)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDiskAtDefault(ui5b L)
|
||||
LOCALPROC MakeNewDiskAtDefault(uint32_t L)
|
||||
{
|
||||
MakeNewDisk(L, @"untitled.dsk");
|
||||
}
|
||||
@ -4401,7 +4401,7 @@ LOCALPROC ProcessEventLocation(NSEvent *event)
|
||||
|
||||
LOCALPROC ProcessKeyEvent(blnr down, NSEvent *event)
|
||||
{
|
||||
ui3r scancode = [event keyCode];
|
||||
uint8_t scancode = [event keyCode];
|
||||
|
||||
ProcessEventModifiers(event);
|
||||
Keyboard_UpdateKeyMap2(Keyboard_RemapMac(scancode), down);
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -108,7 +108,7 @@ LOCALPROC WriteExtraErr(char *s)
|
||||
|
||||
LOCALPROC NativeStrFromCStr(char *r, char *s, blnr AddEllipsis)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int i;
|
||||
int L;
|
||||
|
||||
@ -150,10 +150,10 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
ui5r NewSony_Count = Sony_Count;
|
||||
uint32_t NewSony_Count = Sony_Count;
|
||||
|
||||
fseek(Drives[Drive_No], Sony_Start, SEEK_SET);
|
||||
|
||||
@ -170,7 +170,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return mnvm_noErr; /*& figure out what really to return &*/
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
fseek(Drives[Drive_No], 0, SEEK_END);
|
||||
*Sony_Count = ftell(Drives[Drive_No]);
|
||||
@ -338,8 +338,8 @@ LOCALVAR blnr gBackgroundFlag = falseblnr;
|
||||
LOCALVAR blnr gTrueBackgroundFlag = falseblnr;
|
||||
LOCALVAR blnr CurSpeedStopped = trueblnr;
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC HaveChangedScreenBuff(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
guchar graybuf[vMacScreenWidth * vMacScreenHeight];
|
||||
|
||||
@ -347,10 +347,10 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
ui3b *p1 = GetCurDrawBuff()
|
||||
+ (ui5r)vMacScreenWidth / 8 * top;
|
||||
ui3b *p2 = (ui3b *)graybuf + (ui5r)vMacScreenWidth * top;
|
||||
ui5b t0;
|
||||
uint8_t *p1 = GetCurDrawBuff()
|
||||
+ (uint32_t)vMacScreenWidth / 8 * top;
|
||||
uint8_t *p2 = (uint8_t *)graybuf + (uint32_t)vMacScreenWidth * top;
|
||||
uint32_t t0;
|
||||
|
||||
UnusedParam(left);
|
||||
UnusedParam(right);
|
||||
@ -371,7 +371,7 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
right - left /* width */,
|
||||
bottom - top /* height */,
|
||||
GDK_RGB_DITHER_NONE,
|
||||
graybuf + left + (ui5r)vMacScreenWidth * top,
|
||||
graybuf + left + (uint32_t)vMacScreenWidth * top,
|
||||
vMacScreenWidth);
|
||||
}
|
||||
|
||||
@ -473,9 +473,9 @@ LOCALPROC CheckMouseState(void)
|
||||
*/
|
||||
|
||||
|
||||
LOCALVAR ui3b KC2MKC[MaxNumKeycode];
|
||||
LOCALVAR uint8_t KC2MKC[MaxNumKeycode];
|
||||
|
||||
LOCALPROC KC2MKCAssignOne(guint keyval, ui3r key)
|
||||
LOCALPROC KC2MKCAssignOne(guint keyval, uint8_t key)
|
||||
{
|
||||
GdkKeymapKey *keys;
|
||||
gint n_keys;
|
||||
@ -766,7 +766,7 @@ LOCALPROC DoKeyCode(guint keycode, blnr down)
|
||||
if (GDK_Caps_Lock == keycode) {
|
||||
CheckTheCapsLock();
|
||||
} else {
|
||||
ui3r key = KC2MKC[keycode & KeyCodeMask];
|
||||
uint8_t key = KC2MKC[keycode & KeyCodeMask];
|
||||
|
||||
if (MKC_None != key) {
|
||||
Keyboard_UpdateKeyMap2(key, down);
|
||||
@ -776,19 +776,19 @@ LOCALPROC DoKeyCode(guint keycode, blnr down)
|
||||
|
||||
/* --- time, date, location --- */
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
#include "DATE2SEC.h"
|
||||
|
||||
#define TicksPerSecond 1000000
|
||||
|
||||
LOCALVAR blnr HaveTimeDelta = falseblnr;
|
||||
LOCALVAR ui5b TimeDelta;
|
||||
LOCALVAR uint32_t TimeDelta;
|
||||
|
||||
LOCALVAR ui5b NewMacDateInSeconds;
|
||||
LOCALVAR uint32_t NewMacDateInSeconds;
|
||||
|
||||
LOCALVAR ui5b LastTimeSec;
|
||||
LOCALVAR ui5b LastTimeUsec;
|
||||
LOCALVAR uint32_t LastTimeSec;
|
||||
LOCALVAR uint32_t LastTimeUsec;
|
||||
|
||||
LOCALPROC GetCurrentTicks(void)
|
||||
{
|
||||
@ -810,21 +810,21 @@ LOCALPROC GetCurrentTicks(void)
|
||||
TimeDelta = Date2MacSeconds(s->tm_sec, s->tm_min, s->tm_hour,
|
||||
s->tm_mday, 1 + s->tm_mon, 1900 + s->tm_year) - t.tv_sec;
|
||||
#if 0 && AutoTimeZone /* how portable is this ? */
|
||||
CurMacDelta = ((ui5b)(s->tm_gmtoff) & 0x00FFFFFF)
|
||||
CurMacDelta = ((uint32_t)(s->tm_gmtoff) & 0x00FFFFFF)
|
||||
| ((s->tm_isdst ? 0x80 : 0) << 24);
|
||||
#endif
|
||||
HaveTimeDelta = trueblnr;
|
||||
}
|
||||
|
||||
NewMacDateInSeconds = t.tv_sec + TimeDelta;
|
||||
LastTimeSec = (ui5b)t.tv_sec;
|
||||
LastTimeUsec = (ui5b)t.tv_usec;
|
||||
LastTimeSec = (uint32_t)t.tv_sec;
|
||||
LastTimeUsec = (uint32_t)t.tv_usec;
|
||||
}
|
||||
|
||||
#define MyInvTimeStep 16626 /* TicksPerSecond / 60.14742 */
|
||||
|
||||
LOCALVAR ui5b NextTimeSec;
|
||||
LOCALVAR ui5b NextTimeUsec;
|
||||
LOCALVAR uint32_t NextTimeSec;
|
||||
LOCALVAR uint32_t NextTimeUsec;
|
||||
|
||||
LOCALPROC IncrNextTime(void)
|
||||
{
|
||||
@ -848,15 +848,15 @@ LOCALPROC StartUpTimeAdjust(void)
|
||||
InitNextTime();
|
||||
}
|
||||
|
||||
LOCALFUNC si5b GetTimeDiff(void)
|
||||
LOCALFUNC int32_t GetTimeDiff(void)
|
||||
{
|
||||
return ((si5b)(LastTimeSec - NextTimeSec)) * TicksPerSecond
|
||||
+ ((si5b)(LastTimeUsec - NextTimeUsec));
|
||||
return ((int32_t)(LastTimeSec - NextTimeSec)) * TicksPerSecond
|
||||
+ ((int32_t)(LastTimeUsec - NextTimeUsec));
|
||||
}
|
||||
|
||||
LOCALPROC UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
si5b TimeDiff;
|
||||
int32_t TimeDiff;
|
||||
|
||||
GetCurrentTicks();
|
||||
|
||||
@ -1293,7 +1293,7 @@ label_retry:
|
||||
}
|
||||
|
||||
if (ExtraTimeNotOver()) {
|
||||
si5b TimeDiff = GetTimeDiff();
|
||||
int32_t TimeDiff = GetTimeDiff();
|
||||
if (TimeDiff < 0) {
|
||||
g_usleep(- TimeDiff);
|
||||
}
|
||||
|
166
src/OSGLUMAC.c
166
src/OSGLUMAC.c
@ -382,7 +382,7 @@ LOCALFUNC blnr InitMacManagers(void)
|
||||
this is used in
|
||||
*/
|
||||
|
||||
#define To_tMacErr(result) ((tMacErr)(ui4b)(result))
|
||||
#define To_tMacErr(result) ((tMacErr)(uint16_t)(result))
|
||||
|
||||
#define CheckSaveMacErr(result) (CheckSavetMacErr(To_tMacErr(result)))
|
||||
|
||||
@ -750,18 +750,18 @@ LOCALPROC dbglog_close0(void)
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
BlockMove((Ptr)srcPtr, (Ptr)destPtr, byteCount);
|
||||
}
|
||||
|
||||
/* don't want to include c libraries, so: */
|
||||
LOCALFUNC si5b CStrLen(char *src)
|
||||
LOCALFUNC int32_t CStrLen(char *src)
|
||||
{
|
||||
char *p = src;
|
||||
while (*p++ != 0) {
|
||||
}
|
||||
return ((si5b)p) - ((si5b)src) - 1;
|
||||
return ((int32_t)p) - ((int32_t)src) - 1;
|
||||
}
|
||||
|
||||
#define PStrMaxLength 255
|
||||
@ -784,9 +784,9 @@ LOCALPROC PStrFromChar(ps3p r, char x)
|
||||
r[1] = (char)x;
|
||||
}
|
||||
|
||||
LOCALPROC PStrFromHandle(ps3p r, Handle h, ui5b MaxL)
|
||||
LOCALPROC PStrFromHandle(ps3p r, Handle h, uint32_t MaxL)
|
||||
{
|
||||
ui5b L = GetHandleSize(h);
|
||||
uint32_t L = GetHandleSize(h);
|
||||
|
||||
if (L > MaxL) {
|
||||
L = MaxL;
|
||||
@ -982,7 +982,7 @@ LOCALPROC MyScaleRect(Rect *r)
|
||||
#endif
|
||||
|
||||
LOCALPROC SetScrnRectFromCoords(Rect *r,
|
||||
si4b top, si4b left, si4b bottom, si4b right)
|
||||
int16_t top, int16_t left, int16_t bottom, int16_t right)
|
||||
{
|
||||
r->left = left;
|
||||
r->right = right;
|
||||
@ -1044,13 +1044,13 @@ LOCALVAR ui3p ScalingTabl = nullpr;
|
||||
#if EnableMagnify
|
||||
LOCALPROC SetUpScalingTabl(void)
|
||||
{
|
||||
ui3b *p4;
|
||||
uint8_t *p4;
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
ui3r bitsRemaining;
|
||||
ui3b t1;
|
||||
ui3b t2;
|
||||
uint8_t bitsRemaining;
|
||||
uint8_t t1;
|
||||
uint8_t t2;
|
||||
|
||||
p4 = ScalingTabl;
|
||||
for (i = 0; i < 256; ++i) {
|
||||
@ -1071,8 +1071,8 @@ LOCALPROC SetUpScalingTabl(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALPROC DefaultDrawScreenBuff(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC DefaultDrawScreenBuff(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
BitMap src;
|
||||
Rect SrcRect;
|
||||
@ -1132,8 +1132,8 @@ LOCALPROC Update_Screen(void)
|
||||
SetPort(savePort);
|
||||
}
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC HaveChangedScreenBuff(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
#if 0 /* experimental code in progress */
|
||||
if (UseFullScreen)
|
||||
@ -1144,15 +1144,15 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
/* LockPixels(pm); */
|
||||
#if EnableMagnify
|
||||
if (! UseMagnify) {
|
||||
#define PixelT ui5b
|
||||
#define PixelT uint32_t
|
||||
PixelT *p1 = (PixelT *)GetPixBaseAddr(pm);
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
ui5b *p0 = (ui5b *)GetCurDrawBuff();
|
||||
ui5b SkipBytes = GetPixRowBytes(pm)
|
||||
uint32_t *p0 = (uint32_t *)GetCurDrawBuff();
|
||||
uint32_t SkipBytes = GetPixRowBytes(pm)
|
||||
- sizeof(PixelT) * vMacScreenWidth;
|
||||
ui5b t0;
|
||||
uint32_t t0;
|
||||
PixelT a[2];
|
||||
|
||||
((Ptr)p1) += (long)GetPixRowBytes(pm) * (top + vOffset);
|
||||
@ -1176,14 +1176,14 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#define PixelT ui5b
|
||||
#define PixelT uint32_t
|
||||
PixelT *p1 = (PixelT *)GetPixBaseAddr(pm);
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
ui5b *p0 = (ui5b *)GetCurDrawBuff();
|
||||
uint32_t *p0 = (uint32_t *)GetCurDrawBuff();
|
||||
PixelT *p2;
|
||||
ui5b t0;
|
||||
uint32_t t0;
|
||||
PixelT a[2];
|
||||
|
||||
p1 += vOffset * MyScaledWidth;
|
||||
@ -1248,7 +1248,7 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void)
|
||||
|
||||
/* --- keyboard --- */
|
||||
|
||||
LOCALVAR ui5b LastEmKeys[4];
|
||||
LOCALVAR uint32_t LastEmKeys[4];
|
||||
|
||||
LOCALPROC ZapEmKeys(void)
|
||||
{
|
||||
@ -1262,14 +1262,14 @@ LOCALPROC CheckKeyBoardState(void)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
ui5b NewKeys[4];
|
||||
uint32_t NewKeys[4];
|
||||
|
||||
GetKeys(*(KeyMap *)NewKeys);
|
||||
|
||||
for (j = 0; j < 16; ++j) {
|
||||
ui3b k1 = ((ui3b *)NewKeys)[j];
|
||||
ui3b k2 = ((ui3b *)LastEmKeys)[j];
|
||||
ui3b k3 = k1 ^ k2;
|
||||
uint8_t k1 = ((uint8_t *)NewKeys)[j];
|
||||
uint8_t k2 = ((uint8_t *)LastEmKeys)[j];
|
||||
uint8_t k3 = k1 ^ k2;
|
||||
|
||||
if (k3 != 0) {
|
||||
for (i = 0; i < 8; ++i) {
|
||||
@ -1288,7 +1288,7 @@ LOCALPROC CheckKeyBoardState(void)
|
||||
LOCALVAR WantCmdOptOnReconnect = falseblnr;
|
||||
|
||||
#define KeyMap_TestBit(m, key) \
|
||||
((((ui3b *)m)[(key) / 8] & (1 << ((key) & 7))) != 0)
|
||||
((((uint8_t *)m)[(key) / 8] & (1 << ((key) & 7))) != 0)
|
||||
|
||||
LOCALPROC ReconnectKeyCodes3(void)
|
||||
/* so keys already pressed will be ignored */
|
||||
@ -1297,7 +1297,7 @@ LOCALPROC ReconnectKeyCodes3(void)
|
||||
int j;
|
||||
blnr oldv;
|
||||
blnr newv;
|
||||
ui5b NewKeys[4];
|
||||
uint32_t NewKeys[4];
|
||||
|
||||
GetKeys(*(KeyMap *)NewKeys);
|
||||
|
||||
@ -1313,10 +1313,10 @@ LOCALPROC ReconnectKeyCodes3(void)
|
||||
WantCmdOptOnReconnect = falseblnr;
|
||||
|
||||
for (i = 0; i < 16; ++i) {
|
||||
ui3b v = ((ui3b *)NewKeys)[i];
|
||||
uint8_t v = ((uint8_t *)NewKeys)[i];
|
||||
for (j = 0; j < 8; ++j) {
|
||||
if (0 != ((1 << j) & v)) {
|
||||
ui3r k = i * 8 + j;
|
||||
uint8_t k = i * 8 + j;
|
||||
if (MKC_CapsLock != k) {
|
||||
Keyboard_UpdateKeyMap2(Keyboard_RemapMac(k),
|
||||
trueblnr);
|
||||
@ -1452,7 +1452,7 @@ pascal void CallCursorTask(void) =
|
||||
#define MyCrsrCouple 0x08CF
|
||||
/* true if the cursor is tied to the mouse */
|
||||
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
/*
|
||||
Move the cursor to the point h, v
|
||||
@ -1466,7 +1466,7 @@ LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
GrafPtr oldPort;
|
||||
Point CurMousePos;
|
||||
Point NewMousePos;
|
||||
ui5b difftime;
|
||||
uint32_t difftime;
|
||||
blnr IsOk;
|
||||
long int StartTime = TickCount();
|
||||
|
||||
@ -1528,7 +1528,7 @@ LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
|
||||
GetMouse(&NewMousePos);
|
||||
IsOk = (h == NewMousePos.h) && (v == NewMousePos.v);
|
||||
difftime = (ui5b)(TickCount() - StartTime);
|
||||
difftime = (uint32_t)(TickCount() - StartTime);
|
||||
} while ((! IsOk) && (difftime < 5));
|
||||
|
||||
SetPort(oldPort);
|
||||
@ -1567,8 +1567,8 @@ LOCALPROC AdjustMouseMotionGrab(void)
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
@ -1723,7 +1723,7 @@ LOCALPROC DisconnectKeyCodes3(void)
|
||||
overflows and wraps.
|
||||
*/
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
/*
|
||||
The amount of time the program has
|
||||
been running, measured in Macintosh
|
||||
@ -1759,7 +1759,7 @@ LOCALPROC UpdateTrueEmulatedTime(void)
|
||||
not for this port.
|
||||
*/
|
||||
long int LatestTime = TickCount();
|
||||
si5b TimeDiff = LatestTime - LastTime;
|
||||
int32_t TimeDiff = LatestTime - LastTime;
|
||||
|
||||
if (TimeDiff != 0) {
|
||||
LastTime = LatestTime;
|
||||
@ -1790,7 +1790,7 @@ LOCALFUNC blnr CheckDateTime(void)
|
||||
different than it was on the last
|
||||
call to CheckDateTime.
|
||||
*/
|
||||
ui5b NewMacDateInSecond;
|
||||
uint32_t NewMacDateInSecond;
|
||||
|
||||
NewMacDateInSecond = My_LMGetTime();
|
||||
if (CurMacDateInSeconds != NewMacDateInSecond) {
|
||||
@ -1808,11 +1808,11 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
|
||||
ReadLocation(&loc);
|
||||
#if AutoLocation
|
||||
CurMacLatitude = (ui5b)loc.latitude;
|
||||
CurMacLongitude = (ui5b)loc.longitude;
|
||||
CurMacLatitude = (uint32_t)loc.latitude;
|
||||
CurMacLongitude = (uint32_t)loc.longitude;
|
||||
#endif
|
||||
#if AutoTimeZone
|
||||
CurMacDelta = (ui5b)loc.u.gmtDelta;
|
||||
CurMacDelta = (uint32_t)loc.u.gmtDelta;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1851,13 +1851,13 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
volatile static ui4b ThePlayOffset;
|
||||
volatile static ui4b TheFillOffset;
|
||||
volatile static ui4b MinFilledSoundBuffs;
|
||||
volatile static uint16_t ThePlayOffset;
|
||||
volatile static uint16_t TheFillOffset;
|
||||
volatile static uint16_t MinFilledSoundBuffs;
|
||||
#if dbglog_SoundBuffStats
|
||||
LOCALVAR ui4b MaxFilledSoundBuffs;
|
||||
LOCALVAR uint16_t MaxFilledSoundBuffs;
|
||||
#endif
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
|
||||
LOCALPROC MySound_Start0(void)
|
||||
{
|
||||
@ -1871,10 +1871,10 @@ LOCALPROC MySound_Start0(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -1908,7 +1908,7 @@ LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
LOCALPROC MySound_WroteABlock(void)
|
||||
{
|
||||
#if (4 == kLn2SoundSampSz)
|
||||
ui4b PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
uint16_t PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
tpSoundSamp p = TheSoundBuffer + (PrevWriteOffset & kAllBuffMask);
|
||||
#endif
|
||||
|
||||
@ -1922,9 +1922,9 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
|
||||
#if dbglog_SoundBuffStats
|
||||
{
|
||||
ui4b ToPlayLen = TheFillOffset
|
||||
uint16_t ToPlayLen = TheFillOffset
|
||||
- ThePlayOffset;
|
||||
ui4b ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (ToPlayBuffs > MaxFilledSoundBuffs) {
|
||||
MaxFilledSoundBuffs = ToPlayBuffs;
|
||||
@ -1933,7 +1933,7 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC blnr MySound_EndWrite0(ui4r actL)
|
||||
LOCALFUNC blnr MySound_EndWrite0(uint16_t actL)
|
||||
{
|
||||
blnr v;
|
||||
|
||||
@ -1981,7 +1981,7 @@ LOCALPROC RampSound(tpSoundSamp p,
|
||||
trSoundSamp BeginVal, trSoundSamp EndVal)
|
||||
{
|
||||
int i;
|
||||
ui5r v = (((ui5r)BeginVal) << kLnOneBuffLen) + (kLnOneBuffLen >> 1);
|
||||
uint32_t v = (((uint32_t)BeginVal) << kLnOneBuffLen) + (kLnOneBuffLen >> 1);
|
||||
|
||||
for (i = kOneBuffLen; --i >= 0; ) {
|
||||
*p++ = v >> kLnOneBuffLen;
|
||||
@ -1997,9 +1997,9 @@ LOCALPROC RampSound(tpSoundSamp p,
|
||||
|
||||
struct MySoundR {
|
||||
tpSoundSamp fTheSoundBuffer;
|
||||
volatile ui4b (*fPlayOffset);
|
||||
volatile ui4b (*fFillOffset);
|
||||
volatile ui4b (*fMinFilledSoundBuffs);
|
||||
volatile uint16_t (*fPlayOffset);
|
||||
volatile uint16_t (*fFillOffset);
|
||||
volatile uint16_t (*fMinFilledSoundBuffs);
|
||||
|
||||
volatile blnr PlayingBuffBlock;
|
||||
volatile trSoundSamp lastv;
|
||||
@ -2062,9 +2062,9 @@ MySound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd)
|
||||
tpSoundSamp p;
|
||||
trSoundSamp v1 = v0;
|
||||
blnr WantRamp = falseblnr;
|
||||
ui4b CurPlayOffset = *datp->fPlayOffset;
|
||||
ui4b ToPlayLen = *datp->fFillOffset - CurPlayOffset;
|
||||
ui4b FilledSoundBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t CurPlayOffset = *datp->fPlayOffset;
|
||||
uint16_t ToPlayLen = *datp->fFillOffset - CurPlayOffset;
|
||||
uint16_t FilledSoundBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (FilledSoundBuffs < *datp->fMinFilledSoundBuffs) {
|
||||
*datp->fMinFilledSoundBuffs = FilledSoundBuffs;
|
||||
@ -2209,7 +2209,7 @@ LOCALPROC MySound_Stop(void)
|
||||
#endif
|
||||
|
||||
if (NULL != sndChannel) {
|
||||
ui4r retry_limit = 50; /* half of a second */
|
||||
uint16_t retry_limit = 50; /* half of a second */
|
||||
SCStatus r;
|
||||
|
||||
cur_audio.wantplaying = falseblnr;
|
||||
@ -2340,7 +2340,7 @@ LOCALFUNC blnr MySound_Init(void)
|
||||
return falseblnr;
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
}
|
||||
@ -2381,7 +2381,7 @@ LOCALPROC NativeStrFromCStr(ps3p r, char *s, blnr AddEllipsis)
|
||||
{
|
||||
int i;
|
||||
int L;
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
|
||||
ClStrFromSubstCStr(&L, ps, s);
|
||||
if (AddEllipsis) {
|
||||
@ -2584,7 +2584,7 @@ LOCALVAR Handle PbufDat[NumPbufs];
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALFUNC tMacErr PbufNewFromHandle(Handle h, ui5b count, tPbuf *r)
|
||||
LOCALFUNC tMacErr PbufNewFromHandle(Handle h, uint32_t count, tPbuf *r)
|
||||
{
|
||||
tPbuf i;
|
||||
tMacErr err;
|
||||
@ -2604,7 +2604,7 @@ LOCALFUNC tMacErr PbufNewFromHandle(Handle h, ui5b count, tPbuf *r)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUFUNC tMacErr PbufNew(ui5b count, tPbuf *r)
|
||||
GLOBALOSGLUFUNC tMacErr PbufNew(uint32_t count, tPbuf *r)
|
||||
{
|
||||
Handle h;
|
||||
tMacErr err = mnvm_miscErr;
|
||||
@ -2670,7 +2670,7 @@ LOCALPROC PbufUnlock(tPbuf i)
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUPROC PbufTransfer(ui3p Buffer,
|
||||
tPbuf i, ui5r offset, ui5r count, blnr IsWrite)
|
||||
tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite)
|
||||
{
|
||||
Handle h = PbufDat[i];
|
||||
|
||||
@ -2710,7 +2710,7 @@ GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i)
|
||||
|
||||
err = ZeroScrap();
|
||||
if (noErr == err) {
|
||||
ui5b L = PbufSize[i];
|
||||
uint32_t L = PbufSize[i];
|
||||
Handle h = PbufDat[i];
|
||||
HLock(h);
|
||||
err = PutScrap(L, 'TEXT', *h);
|
||||
@ -2783,8 +2783,8 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
/*
|
||||
return 0 if it succeeds, nonzero (a
|
||||
@ -2792,7 +2792,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
will do) on failure.
|
||||
*/
|
||||
tMacErr result;
|
||||
ui5r NewSony_Count = Sony_Count;
|
||||
uint32_t NewSony_Count = Sony_Count;
|
||||
|
||||
result =
|
||||
(tMacErr)SetFPos(Drives[Drive_No], fsFromStart, Sony_Start);
|
||||
@ -2823,7 +2823,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return result;
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
/*
|
||||
set Sony_Count to the size of disk image number Drive_No.
|
||||
@ -3711,12 +3711,12 @@ LOCALFUNC blnr LoadInitialImages(void)
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC tMacErr WriteZero(SInt16 refnum, ui5b L)
|
||||
LOCALFUNC tMacErr WriteZero(SInt16 refnum, uint32_t L)
|
||||
{
|
||||
#define ZeroBufferSize 2048
|
||||
tMacErr err;
|
||||
ui5b i;
|
||||
ui3b buffer[ZeroBufferSize];
|
||||
uint32_t i;
|
||||
uint8_t buffer[ZeroBufferSize];
|
||||
|
||||
if (CheckSaveMacErr(SetFPos(refnum, fsFromStart, 0))) {
|
||||
|
||||
@ -3740,7 +3740,7 @@ label_fail:
|
||||
|
||||
#if HaveCPUfamM68K && IncludeSonyNew
|
||||
LOCALPROC MakeNewDiskFromNamevRef(ps3p Name, short vRefNum,
|
||||
ui5b L)
|
||||
uint32_t L)
|
||||
{
|
||||
short refNum;
|
||||
tMacErr err;
|
||||
@ -3773,7 +3773,7 @@ LOCALPROC MakeNewDiskFromNamevRef(ps3p Name, short vRefNum,
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDiskFromSpec(FSSpec *NewFileSpec,
|
||||
ui5b L)
|
||||
uint32_t L)
|
||||
{
|
||||
short refNum;
|
||||
tMacErr err;
|
||||
@ -3857,7 +3857,7 @@ LOCALFUNC tMacErr FindOrMakeChildDirCStr(MyDir_R *new_d,
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk(ui5b L, Handle NewDiskName)
|
||||
LOCALPROC MakeNewDisk(uint32_t L, Handle NewDiskName)
|
||||
{
|
||||
#if SaveDialogEnable
|
||||
OSErr theErr;
|
||||
@ -4697,10 +4697,10 @@ struct MyWState {
|
||||
#if MayFullScreen
|
||||
short f_hOffset;
|
||||
short f_vOffset;
|
||||
ui4r f_ViewHSize;
|
||||
ui4r f_ViewVSize;
|
||||
ui4r f_ViewHStart;
|
||||
ui4r f_ViewVStart;
|
||||
uint16_t f_ViewHSize;
|
||||
uint16_t f_ViewVSize;
|
||||
uint16_t f_ViewHStart;
|
||||
uint16_t f_ViewVStart;
|
||||
#endif
|
||||
#if VarFullScreen
|
||||
blnr f_UseFullScreen;
|
||||
@ -5385,7 +5385,7 @@ LOCALPROC CheckForSystemEvents(void)
|
||||
#if VarFullScreen
|
||||
UseFullScreen &&
|
||||
#endif
|
||||
((ui3b) -1 == SpeedValue) && ! CurSpeedStopped)
|
||||
((uint8_t) -1 == SpeedValue) && ! CurSpeedStopped)
|
||||
{
|
||||
EventRecord theEvent;
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -126,7 +126,7 @@ LOCALPROC WriteExtraErr(char *s)
|
||||
|
||||
LOCALPROC NativeStrFromCStr(char *r, char *s)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int i;
|
||||
int L;
|
||||
|
||||
@ -165,12 +165,12 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
ui5r NewSony_Count = 0;
|
||||
uint32_t NewSony_Count = 0;
|
||||
|
||||
if (0 == fseek(refnum, Sony_Start, SEEK_SET)) {
|
||||
if (IsWrite) {
|
||||
@ -191,7 +191,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return err; /*& figure out what really to return &*/
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
@ -292,7 +292,7 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked,
|
||||
|
||||
#if IncludeSonyGetName || IncludeSonyNew
|
||||
{
|
||||
ui5b L = strlen(drivepath);
|
||||
uint32_t L = strlen(drivepath);
|
||||
char *p = malloc(L + 1);
|
||||
if (p != NULL) {
|
||||
(void) memcpy(p, drivepath, L + 1);
|
||||
@ -368,11 +368,11 @@ LOCALFUNC blnr LoadInitialImages(void)
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC blnr WriteZero(FILE *refnum, ui5b L)
|
||||
LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L)
|
||||
{
|
||||
#define ZeroBufferSize 2048
|
||||
ui5b i;
|
||||
ui3b buffer[ZeroBufferSize];
|
||||
uint32_t i;
|
||||
uint8_t buffer[ZeroBufferSize];
|
||||
|
||||
memset(&buffer, 0, ZeroBufferSize);
|
||||
|
||||
@ -388,7 +388,7 @@ LOCALFUNC blnr WriteZero(FILE *refnum, ui5b L)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk(ui5b L, char *drivepath)
|
||||
LOCALPROC MakeNewDisk(uint32_t L, char *drivepath)
|
||||
{
|
||||
blnr IsOk = falseblnr;
|
||||
FILE *refnum = fopen(drivepath, "wb+");
|
||||
@ -410,7 +410,7 @@ LOCALPROC MakeNewDisk(ui5b L, char *drivepath)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDiskAtDefault(ui5b L)
|
||||
LOCALPROC MakeNewDiskAtDefault(uint32_t L)
|
||||
{
|
||||
char s[ClStrMaxLength + 1];
|
||||
|
||||
@ -485,8 +485,8 @@ LOCALVAR blnr CurSpeedStopped = trueblnr;
|
||||
#define MaxScale 1
|
||||
#endif
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
ui4r bottom, ui4r right)
|
||||
LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left,
|
||||
uint16_t bottom, uint16_t right)
|
||||
{
|
||||
/*
|
||||
Oh god, clean this up.
|
||||
@ -529,8 +529,8 @@ GLOBALOSGLUPROC DoneWithDrawingForTick(void)
|
||||
|
||||
LOCALPROC CheckMouseState(void)
|
||||
{
|
||||
si5b MotionX;
|
||||
si5b MotionY;
|
||||
int32_t MotionX;
|
||||
int32_t MotionY;
|
||||
|
||||
/*
|
||||
TODO:
|
||||
@ -562,14 +562,14 @@ LOCALPROC CheckMouseState(void)
|
||||
|
||||
/* --- keyboard input --- */
|
||||
|
||||
LOCALVAR ui3b KC2MKC[256];
|
||||
LOCALVAR uint8_t KC2MKC[256];
|
||||
|
||||
/*
|
||||
AHA!
|
||||
GCC Was turning this into a macro of some sort which of course
|
||||
broke horribly with libnds's keyboard having some negative values.
|
||||
*/
|
||||
LOCALPROC AssignKeyToMKC(int UKey, int LKey, ui3r MKC)
|
||||
LOCALPROC AssignKeyToMKC(int UKey, int LKey, uint8_t MKC)
|
||||
{
|
||||
if (UKey != NOKEY) {
|
||||
KC2MKC[UKey] = MKC;
|
||||
@ -650,7 +650,7 @@ LOCALFUNC blnr KC2MKCInit(void)
|
||||
|
||||
LOCALPROC DoKeyCode0(int i, blnr down)
|
||||
{
|
||||
ui3r key = KC2MKC[i];
|
||||
uint8_t key = KC2MKC[i];
|
||||
if (MKC_None != key) {
|
||||
fprintf(stderr, "%s() :: %c (%d) == %d\n",
|
||||
__FUNCTION__, (char) i, key, down);
|
||||
@ -676,7 +676,7 @@ LOCALPROC DoKeyCode(int i, blnr down)
|
||||
LOCALVAR blnr DS_Keystate_Menu = falseblnr;
|
||||
LOCALVAR blnr DS_Keystate_Shift = falseblnr;
|
||||
|
||||
LOCALPROC DS_HandleKey(si5b Key, blnr Down)
|
||||
LOCALPROC DS_HandleKey(int32_t Key, blnr Down)
|
||||
{
|
||||
if (Key == NOKEY) {
|
||||
return;
|
||||
@ -728,7 +728,7 @@ LOCALPROC DS_HandleKeyboard(void)
|
||||
|
||||
/* --- time, date, location --- */
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
#include "DATE2SEC.h"
|
||||
|
||||
@ -736,12 +736,12 @@ LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
/* #define TicksPerSecond 1000 */
|
||||
|
||||
LOCALVAR blnr HaveTimeDelta = falseblnr;
|
||||
LOCALVAR ui5b TimeDelta;
|
||||
LOCALVAR uint32_t TimeDelta;
|
||||
|
||||
LOCALVAR ui5b NewMacDateInSeconds;
|
||||
LOCALVAR uint32_t NewMacDateInSeconds;
|
||||
|
||||
LOCALVAR ui5b LastTimeSec;
|
||||
LOCALVAR ui5b LastTimeUsec;
|
||||
LOCALVAR uint32_t LastTimeSec;
|
||||
LOCALVAR uint32_t LastTimeUsec;
|
||||
|
||||
LOCALPROC GetCurrentTicks(void)
|
||||
{
|
||||
@ -764,22 +764,22 @@ LOCALPROC GetCurrentTicks(void)
|
||||
TimeDelta = Date2MacSeconds(s->tm_sec, s->tm_min, s->tm_hour,
|
||||
s->tm_mday, 1 + s->tm_mon, 1900 + s->tm_year) - t.tv_sec;
|
||||
#if 0 && AutoTimeZone /* how portable is this ? */
|
||||
CurMacDelta = ((ui5b)(s->tm_gmtoff) & 0x00FFFFFF)
|
||||
CurMacDelta = ((uint32_t)(s->tm_gmtoff) & 0x00FFFFFF)
|
||||
| ((s->tm_isdst ? 0x80 : 0) << 24);
|
||||
#endif
|
||||
HaveTimeDelta = trueblnr;
|
||||
}
|
||||
|
||||
NewMacDateInSeconds = t.tv_sec + TimeDelta;
|
||||
LastTimeSec = (ui5b)t.tv_sec;
|
||||
LastTimeUsec = (ui5b)t.tv_usec;
|
||||
LastTimeSec = (uint32_t)t.tv_sec;
|
||||
LastTimeUsec = (uint32_t)t.tv_usec;
|
||||
}
|
||||
|
||||
/* #define MyInvTimeStep 16626 */ /* TicksPerSecond / 60.14742 */
|
||||
#define MyInvTimeStep 17
|
||||
|
||||
LOCALVAR ui5b NextTimeSec;
|
||||
LOCALVAR ui5b NextTimeUsec;
|
||||
LOCALVAR uint32_t NextTimeSec;
|
||||
LOCALVAR uint32_t NextTimeUsec;
|
||||
|
||||
LOCALPROC IncrNextTime(void)
|
||||
{
|
||||
@ -803,15 +803,15 @@ LOCALPROC StartUpTimeAdjust(void)
|
||||
InitNextTime();
|
||||
}
|
||||
|
||||
LOCALFUNC si5b GetTimeDiff(void)
|
||||
LOCALFUNC int32_t GetTimeDiff(void)
|
||||
{
|
||||
return ((si5b)(LastTimeSec - NextTimeSec)) * TicksPerSecond
|
||||
+ ((si5b)(LastTimeUsec - NextTimeUsec));
|
||||
return ((int32_t)(LastTimeSec - NextTimeSec)) * TicksPerSecond
|
||||
+ ((int32_t)(LastTimeUsec - NextTimeUsec));
|
||||
}
|
||||
|
||||
LOCALPROC UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
si5b TimeDiff;
|
||||
int32_t TimeDiff;
|
||||
|
||||
GetCurrentTicks();
|
||||
|
||||
@ -1027,7 +1027,7 @@ label_retry:
|
||||
}
|
||||
|
||||
if (ExtraTimeNotOver()) {
|
||||
si5b TimeDiff = GetTimeDiff();
|
||||
int32_t TimeDiff = GetTimeDiff();
|
||||
if (TimeDiff < 0) {
|
||||
/*
|
||||
FIXME:
|
||||
|
114
src/OSGLUOSX.c
114
src/OSGLUOSX.c
@ -627,7 +627,7 @@ LOCALFUNC blnr HaveMyCGCursorIsVisible(void)
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -646,7 +646,7 @@ LOCALPROC PStrFromChar(ps3p r, char x)
|
||||
this is used in
|
||||
*/
|
||||
|
||||
#define To_tMacErr(result) ((tMacErr)(ui4b)(result))
|
||||
#define To_tMacErr(result) ((tMacErr)(uint16_t)(result))
|
||||
|
||||
#define CheckSaveMacErr(result) (CheckSavetMacErr(To_tMacErr(result)))
|
||||
|
||||
@ -661,7 +661,7 @@ LOCALPROC UniCharStrFromSubstCStr(int *L, UniChar *x, char *s)
|
||||
{
|
||||
int i;
|
||||
int L0;
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
|
||||
ClStrFromSubstCStr(&L0, ps, s);
|
||||
|
||||
@ -906,7 +906,7 @@ LOCALPROC dbglog_close0(void)
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
LOCALVAR EventTime NextTickChangeTime;
|
||||
|
||||
@ -945,18 +945,18 @@ GLOBALOSGLUFUNC blnr ExtraTimeNotOver(void)
|
||||
|
||||
/* LOCALVAR EventTime ETimeBase; */
|
||||
LOCALVAR CFAbsoluteTime ATimeBase;
|
||||
LOCALVAR ui5b TimeSecBase;
|
||||
LOCALVAR uint32_t TimeSecBase;
|
||||
|
||||
LOCALFUNC blnr CheckDateTime(void)
|
||||
{
|
||||
ui5b NewMacDateInSecond = TimeSecBase
|
||||
+ (ui5b)(CFAbsoluteTimeGetCurrent() - ATimeBase);
|
||||
uint32_t NewMacDateInSecond = TimeSecBase
|
||||
+ (uint32_t)(CFAbsoluteTimeGetCurrent() - ATimeBase);
|
||||
/*
|
||||
ui5b NewMacDateInSecond = TimeSecBase
|
||||
+ (ui5b)(GetCurrentEventTime() - ETimeBase);
|
||||
uint32_t NewMacDateInSecond = TimeSecBase
|
||||
+ (uint32_t)(GetCurrentEventTime() - ETimeBase);
|
||||
*/
|
||||
/*
|
||||
ui5b NewMacDateInSecond = ((ui5b)(CFAbsoluteTimeGetCurrent()))
|
||||
uint32_t NewMacDateInSecond = ((uint32_t)(CFAbsoluteTimeGetCurrent()))
|
||||
+ 3061137600UL;
|
||||
*/
|
||||
|
||||
@ -977,8 +977,8 @@ LOCALFUNC blnr CheckDateTime(void)
|
||||
LOCALVAR SInt16 Drives[NumDrives]; /* open disk image files */
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
ByteCount actualCount;
|
||||
tMacErr result;
|
||||
@ -1008,7 +1008,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return result;
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
SInt64 forkSize;
|
||||
tMacErr err = To_tMacErr(
|
||||
@ -1214,7 +1214,7 @@ LOCALPROC MyScaleRect(Rect *r)
|
||||
#endif
|
||||
|
||||
LOCALPROC SetScrnRectFromCoords(Rect *r,
|
||||
si4b top, si4b left, si4b bottom, si4b right)
|
||||
int16_t top, int16_t left, int16_t bottom, int16_t right)
|
||||
{
|
||||
r->left = left;
|
||||
r->right = right;
|
||||
@ -1300,8 +1300,8 @@ LOCALVAR ui3p CLUT_final;
|
||||
|
||||
#endif
|
||||
|
||||
LOCALPROC UpdateLuminanceCopy(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC UpdateLuminanceCopy(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1360,15 +1360,15 @@ LOCALVAR short GLvOffset;
|
||||
#define UseAGLdoublebuff 0
|
||||
#endif
|
||||
|
||||
LOCALPROC MyDrawWithOpenGL(ui4r top, ui4r left, ui4r bottom, ui4r right)
|
||||
LOCALPROC MyDrawWithOpenGL(uint16_t top, uint16_t left, uint16_t bottom, uint16_t right)
|
||||
{
|
||||
if (NULL == ctx) {
|
||||
/* oops */
|
||||
} else if (GL_TRUE != aglSetCurrentContext(ctx)) {
|
||||
/* err = aglReportError() */
|
||||
} else {
|
||||
si4b top2;
|
||||
si4b left2;
|
||||
int16_t top2;
|
||||
int16_t left2;
|
||||
|
||||
#if UseAGLdoublebuff
|
||||
/* redraw all */
|
||||
@ -1791,7 +1791,7 @@ LOCALPROC SetCursorArrow(void)
|
||||
}
|
||||
|
||||
#if EnableMoveMouse
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
Point CurMousePos;
|
||||
Rect r;
|
||||
@ -1893,8 +1893,8 @@ LOCALPROC AdjustMouseMotionGrab(void)
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
@ -1956,11 +1956,11 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
|
||||
ReadLocation(&loc);
|
||||
#if AutoLocation
|
||||
CurMacLatitude = (ui5b)loc.latitude;
|
||||
CurMacLongitude = (ui5b)loc.longitude;
|
||||
CurMacLatitude = (uint32_t)loc.latitude;
|
||||
CurMacLongitude = (uint32_t)loc.longitude;
|
||||
#endif
|
||||
#if AutoTimeZone
|
||||
CurMacDelta = (ui5b)loc.u.gmtDelta;
|
||||
CurMacDelta = (uint32_t)loc.u.gmtDelta;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -2025,13 +2025,13 @@ LOCALPROC StartUpTimeAdjust(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
volatile static ui4b ThePlayOffset;
|
||||
volatile static ui4b TheFillOffset;
|
||||
volatile static ui4b MinFilledSoundBuffs;
|
||||
volatile static uint16_t ThePlayOffset;
|
||||
volatile static uint16_t TheFillOffset;
|
||||
volatile static uint16_t MinFilledSoundBuffs;
|
||||
#if dbglog_SoundBuffStats
|
||||
LOCALVAR ui4b MaxFilledSoundBuffs;
|
||||
LOCALVAR uint16_t MaxFilledSoundBuffs;
|
||||
#endif
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
|
||||
LOCALPROC MySound_Start0(void)
|
||||
{
|
||||
@ -2045,10 +2045,10 @@ LOCALPROC MySound_Start0(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -2082,7 +2082,7 @@ LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
LOCALPROC MySound_WroteABlock(void)
|
||||
{
|
||||
#if (4 == kLn2SoundSampSz)
|
||||
ui4b PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
uint16_t PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
tpSoundSamp p = TheSoundBuffer + (PrevWriteOffset & kAllBuffMask);
|
||||
#endif
|
||||
|
||||
@ -2096,9 +2096,9 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
|
||||
#if dbglog_SoundBuffStats
|
||||
{
|
||||
ui4b ToPlayLen = TheFillOffset
|
||||
uint16_t ToPlayLen = TheFillOffset
|
||||
- ThePlayOffset;
|
||||
ui4b ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (ToPlayBuffs > MaxFilledSoundBuffs) {
|
||||
MaxFilledSoundBuffs = ToPlayBuffs;
|
||||
@ -2107,7 +2107,7 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC blnr MySound_EndWrite0(ui4r actL)
|
||||
LOCALFUNC blnr MySound_EndWrite0(uint16_t actL)
|
||||
{
|
||||
blnr v;
|
||||
|
||||
@ -2155,7 +2155,7 @@ LOCALPROC RampSound(tpSoundSamp p,
|
||||
trSoundSamp BeginVal, trSoundSamp EndVal)
|
||||
{
|
||||
int i;
|
||||
ui5r v = (((ui5r)BeginVal) << kLnOneBuffLen) + (kLnOneBuffLen >> 1);
|
||||
uint32_t v = (((uint32_t)BeginVal) << kLnOneBuffLen) + (kLnOneBuffLen >> 1);
|
||||
|
||||
for (i = kOneBuffLen; --i >= 0; ) {
|
||||
*p++ = v >> kLnOneBuffLen;
|
||||
@ -2171,9 +2171,9 @@ LOCALPROC RampSound(tpSoundSamp p,
|
||||
|
||||
struct MySoundR {
|
||||
tpSoundSamp fTheSoundBuffer;
|
||||
volatile ui4b (*fPlayOffset);
|
||||
volatile ui4b (*fFillOffset);
|
||||
volatile ui4b (*fMinFilledSoundBuffs);
|
||||
volatile uint16_t (*fPlayOffset);
|
||||
volatile uint16_t (*fFillOffset);
|
||||
volatile uint16_t (*fMinFilledSoundBuffs);
|
||||
|
||||
volatile blnr PlayingBuffBlock;
|
||||
volatile trSoundSamp lastv;
|
||||
@ -2236,9 +2236,9 @@ MySound_CallBack(SndChannelPtr theChannel, SndCommand * theCallBackCmd)
|
||||
tpSoundSamp p;
|
||||
trSoundSamp v1 = v0;
|
||||
blnr WantRamp = falseblnr;
|
||||
ui4b CurPlayOffset = *datp->fPlayOffset;
|
||||
ui4b ToPlayLen = *datp->fFillOffset - CurPlayOffset;
|
||||
ui4b FilledSoundBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t CurPlayOffset = *datp->fPlayOffset;
|
||||
uint16_t ToPlayLen = *datp->fFillOffset - CurPlayOffset;
|
||||
uint16_t FilledSoundBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (FilledSoundBuffs < *datp->fMinFilledSoundBuffs) {
|
||||
*datp->fMinFilledSoundBuffs = FilledSoundBuffs;
|
||||
@ -2380,7 +2380,7 @@ LOCALPROC MySound_Stop(void)
|
||||
#endif
|
||||
|
||||
if (NULL != sndChannel) {
|
||||
ui4r retry_limit = 50; /* half of a second */
|
||||
uint16_t retry_limit = 50; /* half of a second */
|
||||
SCStatus r;
|
||||
|
||||
cur_audio.wantplaying = falseblnr;
|
||||
@ -2507,7 +2507,7 @@ LOCALFUNC blnr MySound_Init(void)
|
||||
return falseblnr;
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
}
|
||||
@ -3089,14 +3089,14 @@ LOCALFUNC tMacErr InsertADiskFromNameEtc(FSRef *ParentRef,
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC tMacErr WriteZero(SInt16 refnum, ui5b L)
|
||||
LOCALFUNC tMacErr WriteZero(SInt16 refnum, uint32_t L)
|
||||
{
|
||||
#define ZeroBufferSize 2048
|
||||
tMacErr err = mnvm_noErr;
|
||||
ui5b i;
|
||||
ui3b buffer[ZeroBufferSize];
|
||||
uint32_t i;
|
||||
uint8_t buffer[ZeroBufferSize];
|
||||
ByteCount actualCount;
|
||||
ui5b offset = 0;
|
||||
uint32_t offset = 0;
|
||||
|
||||
memset(&buffer, 0, ZeroBufferSize);
|
||||
|
||||
@ -3148,7 +3148,7 @@ LOCALFUNC tMacErr MyCreateFileCFStringRef(FSRef *saveFileParent,
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC tMacErr MakeNewDisk0(FSRef *saveFileParent,
|
||||
CFStringRef saveFileName, ui5b L)
|
||||
CFStringRef saveFileName, uint32_t L)
|
||||
{
|
||||
tMacErr err;
|
||||
FSRef NewRef;
|
||||
@ -3303,7 +3303,7 @@ LOCALPROC InsertADisk0(void)
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk(ui5b L, CFStringRef NewDiskName)
|
||||
LOCALPROC MakeNewDisk(uint32_t L, CFStringRef NewDiskName)
|
||||
{
|
||||
#if SaveDialogEnable
|
||||
NavDialogRef theSaveDialog;
|
||||
@ -4366,10 +4366,10 @@ struct MyWState {
|
||||
#if MayFullScreen
|
||||
short f_hOffset;
|
||||
short f_vOffset;
|
||||
ui4r f_ViewHSize;
|
||||
ui4r f_ViewVSize;
|
||||
ui4r f_ViewHStart;
|
||||
ui4r f_ViewVStart;
|
||||
uint16_t f_ViewHSize;
|
||||
uint16_t f_ViewVSize;
|
||||
uint16_t f_ViewHStart;
|
||||
uint16_t f_ViewVStart;
|
||||
#endif
|
||||
#if VarFullScreen
|
||||
blnr f_UseFullScreen;
|
||||
@ -5222,7 +5222,7 @@ GLOBALOSGLUPROC WaitForNextTick(void)
|
||||
{
|
||||
OSStatus err;
|
||||
EventRef theEvent;
|
||||
ui3r NumChecks;
|
||||
uint8_t NumChecks;
|
||||
EventTimeout inTimeout;
|
||||
EventTargetRef theTarget = GetEventDispatcherTarget();
|
||||
|
||||
|
132
src/OSGLUSD2.c
132
src/OSGLUSD2.c
@ -31,7 +31,7 @@
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -178,7 +178,7 @@ LOCALPROC dbglog_close0(void)
|
||||
|
||||
LOCALPROC NativeStrFromCStr(char *r, char *s)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int i;
|
||||
int L;
|
||||
|
||||
@ -242,12 +242,12 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
MyFilePtr refnum = Drives[Drive_No];
|
||||
ui5r NewSony_Count = 0;
|
||||
uint32_t NewSony_Count = 0;
|
||||
|
||||
if (MySeek(refnum, Sony_Start, MySeekSet) >= 0) {
|
||||
if (IsWrite) {
|
||||
@ -268,7 +268,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return err; /*& figure out what really to return &*/
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
MyFilePtr refnum = Drives[Drive_No];
|
||||
@ -712,21 +712,21 @@ LOCALVAR ui3p CLUT_final;
|
||||
#endif
|
||||
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
ui4r bottom, ui4r right)
|
||||
LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left,
|
||||
uint16_t bottom, uint16_t right)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
ui3b *p;
|
||||
uint8_t *p;
|
||||
Uint32 pixel;
|
||||
#if (0 != vMacScreenDepth) && (vMacScreenDepth < 4)
|
||||
Uint32 CLUT_pixel[CLUT_size];
|
||||
#endif
|
||||
Uint32 BWLUT_pixel[2];
|
||||
ui5r top2;
|
||||
ui5r left2;
|
||||
ui5r bottom2;
|
||||
ui5r right2;
|
||||
uint32_t top2;
|
||||
uint32_t left2;
|
||||
uint32_t bottom2;
|
||||
uint32_t right2;
|
||||
void *pixels;
|
||||
int pitch;
|
||||
SDL_Rect src_rect;
|
||||
@ -815,7 +815,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
{
|
||||
|
||||
int bpp = my_format->BytesPerPixel;
|
||||
ui5r ExpectedPitch = vMacScreenWidth * bpp;
|
||||
uint32_t ExpectedPitch = vMacScreenWidth * bpp;
|
||||
|
||||
#if EnableMagnify && ! UseSDLscaling
|
||||
if (UseMagnify) {
|
||||
@ -973,7 +973,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
}
|
||||
|
||||
} else {
|
||||
ui3b *the_data = (ui3b *)GetCurDrawBuff();
|
||||
uint8_t *the_data = (uint8_t *)GetCurDrawBuff();
|
||||
|
||||
/* adapted from putpixel in SDL documentation */
|
||||
|
||||
@ -997,7 +997,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
p = the_data + ((i0 * vMacScreenWidth + j0)
|
||||
>> (3 - vMacScreenDepth));
|
||||
{
|
||||
ui3r k = (*p >> (((~ j0)
|
||||
uint8_t k = (*p >> (((~ j0)
|
||||
& ((1 << (3 - vMacScreenDepth)) - 1))
|
||||
<< vMacScreenDepth))
|
||||
& (CLUT_size - 1);
|
||||
@ -1006,7 +1006,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
#elif 4 == vMacScreenDepth
|
||||
p = the_data + ((i0 * vMacScreenWidth + j0) << 1);
|
||||
{
|
||||
ui4r t0 = do_get_mem_word(p);
|
||||
uint16_t t0 = do_get_mem_word(p);
|
||||
pixel = SDL_MapRGB(my_format,
|
||||
((t0 & 0x7C00) >> 7)
|
||||
| ((t0 & 0x7000) >> 12),
|
||||
@ -1121,7 +1121,7 @@ LOCALPROC ForceShowCursor(void)
|
||||
#endif
|
||||
|
||||
#if EnableMoveMouse && HaveWorkingWarp
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
#if VarFullScreen
|
||||
if (UseFullScreen)
|
||||
@ -1271,9 +1271,9 @@ LOCALPROC CheckMouseState(void)
|
||||
|
||||
/* --- keyboard input --- */
|
||||
|
||||
LOCALFUNC ui3r SDLScan2MacKeyCode(SDL_Scancode i)
|
||||
LOCALFUNC uint8_t SDLScan2MacKeyCode(SDL_Scancode i)
|
||||
{
|
||||
ui3r v = MKC_None;
|
||||
uint8_t v = MKC_None;
|
||||
|
||||
switch (i) {
|
||||
case SDL_SCANCODE_BACKSPACE: v = MKC_BackSpace; break;
|
||||
@ -1421,7 +1421,7 @@ LOCALFUNC ui3r SDLScan2MacKeyCode(SDL_Scancode i)
|
||||
|
||||
LOCALPROC DoKeyCode(SDL_Keysym *r, blnr down)
|
||||
{
|
||||
ui3r v = SDLScan2MacKeyCode(r->scancode);
|
||||
uint8_t v = SDLScan2MacKeyCode(r->scancode);
|
||||
if (MKC_None != v) {
|
||||
Keyboard_UpdateKeyMap2(v, down);
|
||||
}
|
||||
@ -1449,7 +1449,7 @@ LOCALPROC DisconnectKeyCodes3(void)
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
#define MyInvTimeDivPow 16
|
||||
#define MyInvTimeDiv (1 << MyInvTimeDivPow)
|
||||
@ -1459,7 +1459,7 @@ LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR Uint32 LastTime;
|
||||
|
||||
LOCALVAR Uint32 NextIntTime;
|
||||
LOCALVAR ui5b NextFracTime;
|
||||
LOCALVAR uint32_t NextFracTime;
|
||||
|
||||
LOCALPROC IncrNextTime(void)
|
||||
{
|
||||
@ -1475,12 +1475,12 @@ LOCALPROC InitNextTime(void)
|
||||
IncrNextTime();
|
||||
}
|
||||
|
||||
LOCALVAR ui5b NewMacDateInSeconds;
|
||||
LOCALVAR uint32_t NewMacDateInSeconds;
|
||||
|
||||
LOCALFUNC blnr UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
Uint32 LatestTime;
|
||||
si5b TimeDiff;
|
||||
int32_t TimeDiff;
|
||||
|
||||
LatestTime = SDL_GetTicks();
|
||||
if (LatestTime != LastTime) {
|
||||
@ -1579,13 +1579,13 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
volatile static ui4b ThePlayOffset;
|
||||
volatile static ui4b TheFillOffset;
|
||||
volatile static ui4b MinFilledSoundBuffs;
|
||||
volatile static uint16_t ThePlayOffset;
|
||||
volatile static uint16_t TheFillOffset;
|
||||
volatile static uint16_t MinFilledSoundBuffs;
|
||||
#if dbglog_SoundBuffStats
|
||||
LOCALVAR ui4b MaxFilledSoundBuffs;
|
||||
LOCALVAR uint16_t MaxFilledSoundBuffs;
|
||||
#endif
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
|
||||
LOCALPROC MySound_Init0(void)
|
||||
{
|
||||
@ -1603,10 +1603,10 @@ LOCALPROC MySound_Start0(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -1640,7 +1640,7 @@ LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
LOCALPROC MySound_WroteABlock(void)
|
||||
{
|
||||
#if (4 == kLn2SoundSampSz)
|
||||
ui4b PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
uint16_t PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
tpSoundSamp p = TheSoundBuffer + (PrevWriteOffset & kAllBuffMask);
|
||||
#endif
|
||||
|
||||
@ -1654,9 +1654,9 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
|
||||
#if dbglog_SoundBuffStats
|
||||
{
|
||||
ui4b ToPlayLen = TheFillOffset
|
||||
uint16_t ToPlayLen = TheFillOffset
|
||||
- ThePlayOffset;
|
||||
ui4b ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (ToPlayBuffs > MaxFilledSoundBuffs) {
|
||||
MaxFilledSoundBuffs = ToPlayBuffs;
|
||||
@ -1665,7 +1665,7 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC blnr MySound_EndWrite0(ui4r actL)
|
||||
LOCALFUNC blnr MySound_EndWrite0(uint16_t actL)
|
||||
{
|
||||
blnr v;
|
||||
|
||||
@ -1709,7 +1709,7 @@ LOCALPROC MySound_SecondNotify0(void)
|
||||
}
|
||||
}
|
||||
|
||||
typedef ui4r trSoundTemp;
|
||||
typedef uint16_t trSoundTemp;
|
||||
|
||||
#define kCenterTempSound 0x8000
|
||||
|
||||
@ -1767,9 +1767,9 @@ LOCALPROC SoundRampTo(trSoundTemp *last_val, trSoundTemp dst_val,
|
||||
|
||||
struct MySoundR {
|
||||
tpSoundSamp fTheSoundBuffer;
|
||||
volatile ui4b (*fPlayOffset);
|
||||
volatile ui4b (*fFillOffset);
|
||||
volatile ui4b (*fMinFilledSoundBuffs);
|
||||
volatile uint16_t (*fPlayOffset);
|
||||
volatile uint16_t (*fFillOffset);
|
||||
volatile uint16_t (*fMinFilledSoundBuffs);
|
||||
|
||||
volatile trSoundTemp lastv;
|
||||
|
||||
@ -1780,12 +1780,12 @@ typedef struct MySoundR MySoundR;
|
||||
|
||||
static void my_audio_callback(void *udata, Uint8 *stream, int len)
|
||||
{
|
||||
ui4b ToPlayLen;
|
||||
ui4b FilledSoundBuffs;
|
||||
uint16_t ToPlayLen;
|
||||
uint16_t FilledSoundBuffs;
|
||||
int i;
|
||||
MySoundR *datp = (MySoundR *)udata;
|
||||
tpSoundSamp CurSoundBuffer = datp->fTheSoundBuffer;
|
||||
ui4b CurPlayOffset = *datp->fPlayOffset;
|
||||
uint16_t CurPlayOffset = *datp->fPlayOffset;
|
||||
trSoundTemp v0 = datp->lastv;
|
||||
trSoundTemp v1 = v0;
|
||||
tpSoundSamp dst = (tpSoundSamp)stream;
|
||||
@ -1856,7 +1856,7 @@ label_retry:
|
||||
}
|
||||
*datp->fMinFilledSoundBuffs = 0;
|
||||
} else {
|
||||
ui4b PlayBuffContig = kAllBuffLen
|
||||
uint16_t PlayBuffContig = kAllBuffLen
|
||||
- (CurPlayOffset & kAllBuffMask);
|
||||
tpSoundSamp p = CurSoundBuffer
|
||||
+ (CurPlayOffset & kAllBuffMask);
|
||||
@ -1895,7 +1895,7 @@ LOCALPROC MySound_Stop(void)
|
||||
#endif
|
||||
|
||||
if (cur_audio.wantplaying && HaveSoundOut) {
|
||||
ui4r retry_limit = 50; /* half of a second */
|
||||
uint16_t retry_limit = 50; /* half of a second */
|
||||
|
||||
cur_audio.wantplaying = falseblnr;
|
||||
|
||||
@ -2000,7 +2000,7 @@ LOCALFUNC blnr MySound_Init(void)
|
||||
return trueblnr; /* keep going, even if no sound */
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
}
|
||||
@ -2046,10 +2046,10 @@ LOCALPROC CheckSavedMacMsg(void)
|
||||
/* --- clipboard --- */
|
||||
|
||||
#if IncludeHostTextClipExchange
|
||||
LOCALFUNC uimr MacRoman2UniCodeSize(ui3b *s, uimr L)
|
||||
LOCALFUNC uimr MacRoman2UniCodeSize(uint8_t *s, uimr L)
|
||||
{
|
||||
uimr i;
|
||||
ui3r x;
|
||||
uint8_t x;
|
||||
uimr n;
|
||||
uimr v = 0;
|
||||
|
||||
@ -2327,10 +2327,10 @@ LOCALFUNC uimr MacRoman2UniCodeSize(ui3b *s, uimr L)
|
||||
#endif
|
||||
|
||||
#if IncludeHostTextClipExchange
|
||||
LOCALPROC MacRoman2UniCodeData(ui3b *s, uimr L, char *t)
|
||||
LOCALPROC MacRoman2UniCodeData(uint8_t *s, uimr L, char *t)
|
||||
{
|
||||
uimr i;
|
||||
ui3r x;
|
||||
uint8_t x;
|
||||
|
||||
for (i = 0; i < L; ++i) {
|
||||
x = *s++;
|
||||
@ -2633,8 +2633,8 @@ GLOBALOSGLUFUNC tMacErr HTCEexport(tPbuf i)
|
||||
LOCALFUNC tMacErr UniCodeStrLength(char *s, uimr *r)
|
||||
{
|
||||
tMacErr err;
|
||||
ui3r t;
|
||||
ui3r t2;
|
||||
uint8_t t;
|
||||
uint8_t t2;
|
||||
char *p = s;
|
||||
uimr L = 0;
|
||||
|
||||
@ -2699,13 +2699,13 @@ label_retry:
|
||||
#endif
|
||||
|
||||
#if IncludeHostTextClipExchange
|
||||
LOCALFUNC ui3r UniCodePoint2MacRoman(ui5r x)
|
||||
LOCALFUNC uint8_t UniCodePoint2MacRoman(uint32_t x)
|
||||
{
|
||||
/*
|
||||
adapted from
|
||||
http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/ROMAN.TXT
|
||||
*/
|
||||
ui3r y;
|
||||
uint8_t y;
|
||||
|
||||
if (x < 128) {
|
||||
y = x;
|
||||
@ -2980,11 +2980,11 @@ LOCALFUNC ui3r UniCodePoint2MacRoman(ui5r x)
|
||||
LOCALPROC UniCodeStr2MacRoman(char *s, char *r)
|
||||
{
|
||||
tMacErr err;
|
||||
ui3r t;
|
||||
ui3r t2;
|
||||
ui3r t3;
|
||||
ui3r t4;
|
||||
ui5r v;
|
||||
uint8_t t;
|
||||
uint8_t t2;
|
||||
uint8_t t3;
|
||||
uint8_t t4;
|
||||
uint32_t v;
|
||||
char *p = s;
|
||||
char *q = r;
|
||||
|
||||
@ -3300,8 +3300,8 @@ LOCALPROC UngrabMachine(void)
|
||||
#if EnableFSMouseMotion && HaveWorkingWarp
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
@ -3555,10 +3555,10 @@ LOCALPROC ZapMyWState(void)
|
||||
#if EnableRecreateW
|
||||
struct MyWState {
|
||||
#if MayFullScreen
|
||||
ui4r f_ViewHSize;
|
||||
ui4r f_ViewVSize;
|
||||
ui4r f_ViewHStart;
|
||||
ui4r f_ViewVStart;
|
||||
uint16_t f_ViewHSize;
|
||||
uint16_t f_ViewVSize;
|
||||
uint16_t f_ViewHStart;
|
||||
uint16_t f_ViewVStart;
|
||||
int f_hOffset;
|
||||
int f_vOffset;
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -99,7 +99,7 @@ LOCALPROC dbglog_close0(void)
|
||||
|
||||
LOCALPROC NativeStrFromCStr(char *r, char *s)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int i;
|
||||
int L;
|
||||
|
||||
@ -132,12 +132,12 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
ui5r NewSony_Count = 0;
|
||||
uint32_t NewSony_Count = 0;
|
||||
|
||||
if (0 == fseek(refnum, Sony_Start, SEEK_SET)) {
|
||||
if (IsWrite) {
|
||||
@ -158,7 +158,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return err; /*& figure out what really to return &*/
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
@ -501,21 +501,21 @@ LOCALVAR ui3p CLUT_final;
|
||||
#endif
|
||||
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
ui4r bottom, ui4r right)
|
||||
LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left,
|
||||
uint16_t bottom, uint16_t right)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
ui3b *p;
|
||||
uint8_t *p;
|
||||
Uint32 pixel;
|
||||
#if (0 != vMacScreenDepth) && (vMacScreenDepth < 4)
|
||||
Uint32 CLUT_pixel[CLUT_size];
|
||||
#endif
|
||||
Uint32 BWLUT_pixel[2];
|
||||
ui5r top2 = top;
|
||||
ui5r left2 = left;
|
||||
ui5r bottom2 = bottom;
|
||||
ui5r right2 = right;
|
||||
uint32_t top2 = top;
|
||||
uint32_t left2 = left;
|
||||
uint32_t bottom2 = bottom;
|
||||
uint32_t right2 = right;
|
||||
|
||||
#if EnableMagnify
|
||||
if (UseMagnify) {
|
||||
@ -535,7 +535,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
{
|
||||
|
||||
int bpp = my_surface->format->BytesPerPixel;
|
||||
ui5r ExpectedPitch = vMacScreenWidth * bpp;
|
||||
uint32_t ExpectedPitch = vMacScreenWidth * bpp;
|
||||
|
||||
#if EnableMagnify
|
||||
if (UseMagnify) {
|
||||
@ -693,7 +693,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
}
|
||||
|
||||
} else {
|
||||
ui3b *the_data = (ui3b *)GetCurDrawBuff();
|
||||
uint8_t *the_data = (uint8_t *)GetCurDrawBuff();
|
||||
|
||||
/* adapted from putpixel in SDL documentation */
|
||||
|
||||
@ -717,7 +717,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
p = the_data + ((i0 * vMacScreenWidth + j0)
|
||||
>> (3 - vMacScreenDepth));
|
||||
{
|
||||
ui3r k = (*p >> (((~ j0)
|
||||
uint8_t k = (*p >> (((~ j0)
|
||||
& ((1 << (3 - vMacScreenDepth)) - 1))
|
||||
<< vMacScreenDepth))
|
||||
& (CLUT_size - 1);
|
||||
@ -726,7 +726,7 @@ LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
#elif 4 == vMacScreenDepth
|
||||
p = the_data + ((i0 * vMacScreenWidth + j0) << 1);
|
||||
{
|
||||
ui4r t0 = do_get_mem_word(p);
|
||||
uint16_t t0 = do_get_mem_word(p);
|
||||
pixel = SDL_MapRGB(my_surface->format,
|
||||
((t0 & 0x7C00) >> 7)
|
||||
| ((t0 & 0x7000) >> 12),
|
||||
@ -822,7 +822,7 @@ LOCALPROC ForceShowCursor(void)
|
||||
|
||||
/* cursor moving */
|
||||
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
#if EnableMagnify
|
||||
if (UseMagnify) {
|
||||
@ -908,9 +908,9 @@ LOCALPROC CheckMouseState(void)
|
||||
|
||||
/* --- keyboard input --- */
|
||||
|
||||
LOCALFUNC ui3r SDLKey2MacKeyCode(SDLKey i)
|
||||
LOCALFUNC uint8_t SDLKey2MacKeyCode(SDLKey i)
|
||||
{
|
||||
ui3r v = MKC_None;
|
||||
uint8_t v = MKC_None;
|
||||
|
||||
switch (i) {
|
||||
case SDLK_BACKSPACE: v = MKC_BackSpace; break;
|
||||
@ -1068,7 +1068,7 @@ LOCALFUNC ui3r SDLKey2MacKeyCode(SDLKey i)
|
||||
|
||||
LOCALPROC DoKeyCode(SDL_keysym *r, blnr down)
|
||||
{
|
||||
ui3r v = SDLKey2MacKeyCode(r->sym);
|
||||
uint8_t v = SDLKey2MacKeyCode(r->sym);
|
||||
if (MKC_None != v) {
|
||||
Keyboard_UpdateKeyMap2(v, down);
|
||||
}
|
||||
@ -1096,7 +1096,7 @@ LOCALPROC DisconnectKeyCodes3(void)
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
#define MyInvTimeDivPow 16
|
||||
#define MyInvTimeDiv (1 << MyInvTimeDivPow)
|
||||
@ -1106,7 +1106,7 @@ LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR Uint32 LastTime;
|
||||
|
||||
LOCALVAR Uint32 NextIntTime;
|
||||
LOCALVAR ui5b NextFracTime;
|
||||
LOCALVAR uint32_t NextFracTime;
|
||||
|
||||
LOCALPROC IncrNextTime(void)
|
||||
{
|
||||
@ -1122,12 +1122,12 @@ LOCALPROC InitNextTime(void)
|
||||
IncrNextTime();
|
||||
}
|
||||
|
||||
LOCALVAR ui5b NewMacDateInSeconds;
|
||||
LOCALVAR uint32_t NewMacDateInSeconds;
|
||||
|
||||
LOCALFUNC blnr UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
Uint32 LatestTime;
|
||||
si5b TimeDiff;
|
||||
int32_t TimeDiff;
|
||||
|
||||
LatestTime = SDL_GetTicks();
|
||||
if (LatestTime != LastTime) {
|
||||
@ -1226,13 +1226,13 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
volatile static ui4b ThePlayOffset;
|
||||
volatile static ui4b TheFillOffset;
|
||||
volatile static ui4b MinFilledSoundBuffs;
|
||||
volatile static uint16_t ThePlayOffset;
|
||||
volatile static uint16_t TheFillOffset;
|
||||
volatile static uint16_t MinFilledSoundBuffs;
|
||||
#if dbglog_SoundBuffStats
|
||||
LOCALVAR ui4b MaxFilledSoundBuffs;
|
||||
LOCALVAR uint16_t MaxFilledSoundBuffs;
|
||||
#endif
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
|
||||
LOCALPROC MySound_Init0(void)
|
||||
{
|
||||
@ -1250,10 +1250,10 @@ LOCALPROC MySound_Start0(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -1287,7 +1287,7 @@ LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
LOCALPROC MySound_WroteABlock(void)
|
||||
{
|
||||
#if (4 == kLn2SoundSampSz)
|
||||
ui4b PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
uint16_t PrevWriteOffset = TheWriteOffset - kOneBuffLen;
|
||||
tpSoundSamp p = TheSoundBuffer + (PrevWriteOffset & kAllBuffMask);
|
||||
#endif
|
||||
|
||||
@ -1301,9 +1301,9 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
|
||||
#if dbglog_SoundBuffStats
|
||||
{
|
||||
ui4b ToPlayLen = TheFillOffset
|
||||
uint16_t ToPlayLen = TheFillOffset
|
||||
- ThePlayOffset;
|
||||
ui4b ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
uint16_t ToPlayBuffs = ToPlayLen >> kLnOneBuffLen;
|
||||
|
||||
if (ToPlayBuffs > MaxFilledSoundBuffs) {
|
||||
MaxFilledSoundBuffs = ToPlayBuffs;
|
||||
@ -1312,7 +1312,7 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC blnr MySound_EndWrite0(ui4r actL)
|
||||
LOCALFUNC blnr MySound_EndWrite0(uint16_t actL)
|
||||
{
|
||||
blnr v;
|
||||
|
||||
@ -1356,7 +1356,7 @@ LOCALPROC MySound_SecondNotify0(void)
|
||||
}
|
||||
}
|
||||
|
||||
typedef ui4r trSoundTemp;
|
||||
typedef uint16_t trSoundTemp;
|
||||
|
||||
#define kCenterTempSound 0x8000
|
||||
|
||||
@ -1414,9 +1414,9 @@ LOCALPROC SoundRampTo(trSoundTemp *last_val, trSoundTemp dst_val,
|
||||
|
||||
struct MySoundR {
|
||||
tpSoundSamp fTheSoundBuffer;
|
||||
volatile ui4b (*fPlayOffset);
|
||||
volatile ui4b (*fFillOffset);
|
||||
volatile ui4b (*fMinFilledSoundBuffs);
|
||||
volatile uint16_t (*fPlayOffset);
|
||||
volatile uint16_t (*fFillOffset);
|
||||
volatile uint16_t (*fMinFilledSoundBuffs);
|
||||
|
||||
volatile trSoundTemp lastv;
|
||||
|
||||
@ -1427,12 +1427,12 @@ typedef struct MySoundR MySoundR;
|
||||
|
||||
static void my_audio_callback(void *udata, Uint8 *stream, int len)
|
||||
{
|
||||
ui4b ToPlayLen;
|
||||
ui4b FilledSoundBuffs;
|
||||
uint16_t ToPlayLen;
|
||||
uint16_t FilledSoundBuffs;
|
||||
int i;
|
||||
MySoundR *datp = (MySoundR *)udata;
|
||||
tpSoundSamp CurSoundBuffer = datp->fTheSoundBuffer;
|
||||
ui4b CurPlayOffset = *datp->fPlayOffset;
|
||||
uint16_t CurPlayOffset = *datp->fPlayOffset;
|
||||
trSoundTemp v0 = datp->lastv;
|
||||
trSoundTemp v1 = v0;
|
||||
tpSoundSamp dst = (tpSoundSamp)stream;
|
||||
@ -1503,7 +1503,7 @@ label_retry:
|
||||
}
|
||||
*datp->fMinFilledSoundBuffs = 0;
|
||||
} else {
|
||||
ui4b PlayBuffContig = kAllBuffLen
|
||||
uint16_t PlayBuffContig = kAllBuffLen
|
||||
- (CurPlayOffset & kAllBuffMask);
|
||||
tpSoundSamp p = CurSoundBuffer
|
||||
+ (CurPlayOffset & kAllBuffMask);
|
||||
@ -1542,7 +1542,7 @@ LOCALPROC MySound_Stop(void)
|
||||
#endif
|
||||
|
||||
if (cur_audio.wantplaying && HaveSoundOut) {
|
||||
ui4r retry_limit = 50; /* half of a second */
|
||||
uint16_t retry_limit = 50; /* half of a second */
|
||||
|
||||
cur_audio.wantplaying = falseblnr;
|
||||
|
||||
@ -1647,7 +1647,7 @@ LOCALFUNC blnr MySound_Init(void)
|
||||
return trueblnr; /* keep going, even if no sound */
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
}
|
||||
@ -1829,8 +1829,8 @@ LOCALPROC UngrabMachine(void)
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
|
204
src/OSGLUWIN.c
204
src/OSGLUWIN.c
@ -98,7 +98,7 @@ LOCALFUNC blnr HaveMySHGetSpecialFolderPath(void)
|
||||
|
||||
LOCALPROC NativeStrFromCStr(LPTSTR r, char *s, blnr AddEllipsis)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int i;
|
||||
int L;
|
||||
|
||||
@ -220,7 +220,7 @@ LOCALPROC dbglog_write0(char *s, uimr L)
|
||||
(DWORD)L, /* number of bytes to read */
|
||||
&BytesWritten, /* address of number of bytes read */
|
||||
nullpr) /* address of structure for data */
|
||||
|| ((ui5b)BytesWritten != L))
|
||||
|| ((uint32_t)BytesWritten != L))
|
||||
{
|
||||
/* report error (how?) */
|
||||
}
|
||||
@ -258,7 +258,7 @@ LOCALPROC dbglog_close0(void)
|
||||
|
||||
#define TestBit(i, p) (((unsigned long)(i) & PowOf2(p)) != 0)
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
/*
|
||||
must work even if blocks overlap in memory
|
||||
@ -273,7 +273,7 @@ LOCALVAR HGLOBAL PbufDat[NumPbufs];
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALFUNC tMacErr PbufNewFromHandle(HGLOBAL h, ui5b count, tPbuf *r)
|
||||
LOCALFUNC tMacErr PbufNewFromHandle(HGLOBAL h, uint32_t count, tPbuf *r)
|
||||
{
|
||||
tPbuf i;
|
||||
tMacErr err;
|
||||
@ -293,7 +293,7 @@ LOCALFUNC tMacErr PbufNewFromHandle(HGLOBAL h, ui5b count, tPbuf *r)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUFUNC tMacErr PbufNew(ui5b count, tPbuf *r)
|
||||
GLOBALOSGLUFUNC tMacErr PbufNew(uint32_t count, tPbuf *r)
|
||||
{
|
||||
HGLOBAL h;
|
||||
tMacErr err = mnvm_miscErr;
|
||||
@ -350,7 +350,7 @@ LOCALPROC PbufUnlock(tPbuf i)
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUPROC PbufTransfer(ui3p Buffer,
|
||||
tPbuf i, ui5r offset, ui5r count, blnr IsWrite)
|
||||
tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite)
|
||||
{
|
||||
HGLOBAL h = PbufDat[i];
|
||||
ui3p p0 = GlobalLock(h);
|
||||
@ -411,10 +411,10 @@ LOCALPROC ForceShowCursor(void)
|
||||
|
||||
/* cursor moving */
|
||||
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
POINT NewMousePos;
|
||||
ui5b difftime;
|
||||
uint32_t difftime;
|
||||
blnr IsOk;
|
||||
DWORD StartTime = GetTickCount();
|
||||
LONG x = h;
|
||||
@ -457,7 +457,7 @@ LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
} else {
|
||||
IsOk = (x == NewMousePos.x) && (y == NewMousePos.y);
|
||||
}
|
||||
difftime = (ui5b)(GetTickCount() - StartTime);
|
||||
difftime = (uint32_t)(GetTickCount() - StartTime);
|
||||
} while ((! IsOk) && (difftime < 100));
|
||||
return IsOk;
|
||||
}
|
||||
@ -543,7 +543,7 @@ LOCALPROC SetCurMouseButton(blnr v)
|
||||
#endif
|
||||
|
||||
#if ItnlKyBdFix
|
||||
LOCALVAR ui3b MyVkMapA[256];
|
||||
LOCALVAR uint8_t MyVkMapA[256];
|
||||
#endif
|
||||
|
||||
#if ItnlKyBdFix
|
||||
@ -1670,9 +1670,9 @@ LOCALPROC MyInitCheckKeyboardLayout(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALVAR ui3b WinKey2Mac[256];
|
||||
LOCALVAR uint8_t WinKey2Mac[256];
|
||||
|
||||
LOCALPROC AssignOneMacKey(ui3b WinKey, ui3r MacKey)
|
||||
LOCALPROC AssignOneMacKey(uint8_t WinKey, uint8_t MacKey)
|
||||
{
|
||||
WinKey2Mac[WinKey] = MacKey;
|
||||
}
|
||||
@ -1833,7 +1833,7 @@ LOCALFUNC blnr InitWinKey2Mac(void)
|
||||
|
||||
LOCALPROC DoKeyCode(int i, blnr down)
|
||||
{
|
||||
ui3r key = WinKey2Mac[
|
||||
uint8_t key = WinKey2Mac[
|
||||
#if ItnlKyBdFix
|
||||
MyVkMapA[i]
|
||||
#else
|
||||
@ -1903,7 +1903,7 @@ LOCALPROC DoVKcode0(int i, blnr down)
|
||||
DoKeyCode(i, down);
|
||||
}
|
||||
|
||||
LOCALPROC DoVKcode(int i, ui3r flags, blnr down)
|
||||
LOCALPROC DoVKcode(int i, uint8_t flags, blnr down)
|
||||
{
|
||||
switch (i) {
|
||||
#if MKC_formac_Control != MKC_formac_RControl
|
||||
@ -2184,7 +2184,7 @@ LOCALPROC LowerMyPriority(void)
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
#define MyInvTimeDivPow 16
|
||||
#define MyInvTimeDiv (1 << MyInvTimeDivPow)
|
||||
@ -2194,7 +2194,7 @@ LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR DWORD LastTime;
|
||||
|
||||
LOCALVAR DWORD NextIntTime;
|
||||
LOCALVAR ui5b NextFracTime;
|
||||
LOCALVAR uint32_t NextFracTime;
|
||||
|
||||
LOCALPROC IncrNextTime(void)
|
||||
{
|
||||
@ -2213,7 +2213,7 @@ LOCALPROC InitNextTime(void)
|
||||
LOCALFUNC blnr UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
DWORD LatestTime;
|
||||
si5b TimeDiff;
|
||||
int32_t TimeDiff;
|
||||
|
||||
LatestTime = timeGetTime();
|
||||
if (LatestTime != LastTime) {
|
||||
@ -2250,17 +2250,17 @@ LOCALFUNC blnr UpdateTrueEmulatedTime(void)
|
||||
return falseblnr;
|
||||
}
|
||||
|
||||
LOCALVAR ui5b TimeSecBase;
|
||||
LOCALVAR uint32_t TimeSecBase;
|
||||
LOCALVAR DWORD TimeMilliBase;
|
||||
|
||||
#include "DATE2SEC.h"
|
||||
|
||||
LOCALFUNC blnr CheckDateTime(void)
|
||||
{
|
||||
ui5b NewMacDateInSecond;
|
||||
uint32_t NewMacDateInSecond;
|
||||
|
||||
NewMacDateInSecond =
|
||||
((ui5b)(LastTime - TimeMilliBase)) / 1000 + TimeSecBase;
|
||||
((uint32_t)(LastTime - TimeMilliBase)) / 1000 + TimeSecBase;
|
||||
if (CurMacDateInSeconds != NewMacDateInSecond) {
|
||||
CurMacDateInSeconds = NewMacDateInSecond;
|
||||
|
||||
@ -2288,9 +2288,9 @@ LOCALFUNC blnr Init60thCheck(void)
|
||||
#if AutoTimeZone
|
||||
v = GetTimeZoneInformation(&r);
|
||||
if ((v != 0xFFFFFFFF) && (v != TIME_ZONE_ID_UNKNOWN)) {
|
||||
si5b dlsBias = (v != TIME_ZONE_ID_DAYLIGHT)
|
||||
int32_t dlsBias = (v != TIME_ZONE_ID_DAYLIGHT)
|
||||
? r.StandardBias : r.DaylightBias;
|
||||
CurMacDelta = (((ui5b)(- (r.Bias + dlsBias) * 60))
|
||||
CurMacDelta = (((uint32_t)(- (r.Bias + dlsBias) * 60))
|
||||
& 0x00FFFFFF)
|
||||
| (((v != TIME_ZONE_ID_DAYLIGHT) ? 0 : 0x80)
|
||||
<< 24);
|
||||
@ -2382,11 +2382,11 @@ LOCALPROC MyTimer_Resume(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
LOCALVAR ui4b ThePlayOffset;
|
||||
LOCALVAR ui4b TheFillOffset;
|
||||
LOCALVAR uint16_t ThePlayOffset;
|
||||
LOCALVAR uint16_t TheFillOffset;
|
||||
LOCALVAR blnr wantplaying;
|
||||
LOCALVAR ui4b MinFilledSoundBuffs;
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR uint16_t MinFilledSoundBuffs;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
|
||||
#define SOUND_SAMPLERATE /* 22050 */ 22255
|
||||
/* = round(7833600 * 2 / 704) */
|
||||
@ -2490,7 +2490,7 @@ LOCALPROC MySound_Stop(void)
|
||||
DWORD StartTime = GetTickCount();
|
||||
for (i = 0; i < kSoundBuffers; ++i) {
|
||||
while (((whdr[i].dwFlags & WHDR_DONE) == 0)
|
||||
&& ((ui5b)(GetTickCount() - StartTime) < 1000))
|
||||
&& ((uint32_t)(GetTickCount() - StartTime) < 1000))
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
@ -2524,9 +2524,9 @@ LOCALPROC SoundCheckVeryOften(void)
|
||||
if ((hWaveOut != NULL) && (wantplaying)) {
|
||||
label_retry:
|
||||
{
|
||||
ui4b FilledSoundBuffs;
|
||||
ui4b ToPlaySize = TheFillOffset - ThePlayOffset;
|
||||
ui4b CurPlayBuffer =
|
||||
uint16_t FilledSoundBuffs;
|
||||
uint16_t ToPlaySize = TheFillOffset - ThePlayOffset;
|
||||
uint16_t CurPlayBuffer =
|
||||
(ThePlayOffset >> kLnOneBuffLen) & kSoundBuffMask;
|
||||
|
||||
if ((ToPlaySize > kOneBuffLen)
|
||||
@ -2543,10 +2543,10 @@ label_retry:
|
||||
|
||||
if (FilledSoundBuffs < 2) {
|
||||
MMRESULT mmr;
|
||||
ui4b PrevPlayOffset = ThePlayOffset - kOneBuffLen;
|
||||
ui4b PrevPlayBuffer =
|
||||
uint16_t PrevPlayOffset = ThePlayOffset - kOneBuffLen;
|
||||
uint16_t PrevPlayBuffer =
|
||||
(PrevPlayOffset >> kLnOneBuffLen) & kSoundBuffMask;
|
||||
ui4b LastPlayedOffset =
|
||||
uint16_t LastPlayedOffset =
|
||||
((TheFillOffset >> kLnOneBuffLen) << kLnOneBuffLen)
|
||||
- 1;
|
||||
|
||||
@ -2589,7 +2589,7 @@ LOCALPROC ConvertSoundBlockToNative(tpSoundSamp p)
|
||||
LOCALPROC MySound_FilledBlocks(void)
|
||||
{
|
||||
while (0 != ((TheWriteOffset - TheFillOffset) >> kLnOneBuffLen)) {
|
||||
ui4b CurFillBuffer =
|
||||
uint16_t CurFillBuffer =
|
||||
(TheFillOffset >> kLnOneBuffLen) & kSoundBuffMask;
|
||||
blnr IsOk = falseblnr;
|
||||
|
||||
@ -2632,7 +2632,7 @@ LOCALPROC MySound_WroteABlock(void)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
TheWriteOffset += actL;
|
||||
|
||||
@ -2643,10 +2643,10 @@ GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -2690,7 +2690,7 @@ LOCALPROC GrabTheMachine(void)
|
||||
StartSaveMouseMotion();
|
||||
#endif
|
||||
#if EnableChangePriority
|
||||
if ((ui3b) -1 == SpeedValue) {
|
||||
if ((uint8_t) -1 == SpeedValue) {
|
||||
RaiseMyPriority();
|
||||
}
|
||||
#endif
|
||||
@ -2790,7 +2790,7 @@ LOCALVAR ui3p ScalingBuff = NULL;
|
||||
|
||||
LOCALVAR HDC MainWndDC = NULL;
|
||||
|
||||
LOCALVAR si5b CmdShow;
|
||||
LOCALVAR int32_t CmdShow;
|
||||
|
||||
LOCALVAR TCHAR WndTitle[_MAX_PATH];
|
||||
LOCALVAR const TCHAR WndClassName[] = TEXT("minivmac");
|
||||
@ -3121,8 +3121,8 @@ LOCALFUNC blnr ReCreateMainWindow(void)
|
||||
p.x = 0;
|
||||
p.y = 0;
|
||||
(void) MapWindowPoints(NewMainWindow, NULL, &p, 1);
|
||||
WndX = (si4b)p.x;
|
||||
WndY = (si4b)p.y;
|
||||
WndX = (int16_t)p.x;
|
||||
WndY = (int16_t)p.y;
|
||||
}
|
||||
|
||||
#if MayFullScreen
|
||||
@ -3301,11 +3301,11 @@ typedef struct BITMAPINFOHEADER256 {
|
||||
#define MyScaledWidth (MyWindowScale * vMacScreenWidth)
|
||||
#endif
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC HaveChangedScreenBuff(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
BITMAPINFOHEADER256 bmh;
|
||||
ui3b *cdb = GetCurDrawBuff();
|
||||
uint8_t *cdb = GetCurDrawBuff();
|
||||
int XDest;
|
||||
int YDest;
|
||||
|
||||
@ -3378,12 +3378,12 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
int nDestWidth = (right - left);
|
||||
int nDestHeight = (bottom - top);
|
||||
#if 1 == vMacScreenDepth
|
||||
ui3b *p
|
||||
= ScalingBuff + ((ui5r)vMacScreenWidth / 4) * top;
|
||||
uint8_t *p
|
||||
= ScalingBuff + ((uint32_t)vMacScreenWidth / 4) * top;
|
||||
#elif vMacScreenDepth >= 4
|
||||
ui3b *p = ScalingBuff + (ui5r)vMacScreenByteWidth * top;
|
||||
uint8_t *p = ScalingBuff + (uint32_t)vMacScreenByteWidth * top;
|
||||
#else
|
||||
ui3b *p = cdb + (ui5r)vMacScreenByteWidth * top;
|
||||
uint8_t *p = cdb + (uint32_t)vMacScreenByteWidth * top;
|
||||
#endif
|
||||
|
||||
memset(&bmh, 0, sizeof (bmh));
|
||||
@ -3419,11 +3419,11 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
#if 1 == vMacScreenDepth
|
||||
{
|
||||
int j;
|
||||
ui3b *p1 = (ui3b *)(cdb + (ui5r)vMacScreenByteWidth * top);
|
||||
ui4b *p2 = (ui4b *)p;
|
||||
uint8_t *p1 = (uint8_t *)(cdb + (uint32_t)vMacScreenByteWidth * top);
|
||||
uint16_t *p2 = (uint16_t *)p;
|
||||
for (i = bottom - top; --i >= 0; ) {
|
||||
for (j = vMacScreenWidth / 4; --j >= 0; ) {
|
||||
ui4r t0 = *p1++;
|
||||
uint16_t t0 = *p1++;
|
||||
*p2 ++
|
||||
= ((t0 & 0xC0) >> 2)
|
||||
| ((t0 & 0x30) >> 4)
|
||||
@ -3435,11 +3435,11 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
#elif 4 == vMacScreenDepth
|
||||
{
|
||||
int j;
|
||||
ui4b *p1 = (ui4b *)(cdb + (ui5r)vMacScreenByteWidth * top);
|
||||
ui4b *p2 = (ui4b *)p;
|
||||
uint16_t *p1 = (uint16_t *)(cdb + (uint32_t)vMacScreenByteWidth * top);
|
||||
uint16_t *p2 = (uint16_t *)p;
|
||||
for (i = bottom - top; --i >= 0; ) {
|
||||
for (j = vMacScreenWidth; --j >= 0; ) {
|
||||
ui4r t0 = *p1++;
|
||||
uint16_t t0 = *p1++;
|
||||
*p2 ++ =
|
||||
((t0 & 0xFF00) >> 8) | ((t0 & 0x00FF) << 8);
|
||||
}
|
||||
@ -3448,11 +3448,11 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
#elif 5 == vMacScreenDepth
|
||||
{
|
||||
int j;
|
||||
ui5b *p1 = (ui5b *)(cdb + (ui5r)vMacScreenByteWidth * top);
|
||||
ui5b *p2 = (ui5b *)p;
|
||||
uint32_t *p1 = (uint32_t *)(cdb + (uint32_t)vMacScreenByteWidth * top);
|
||||
uint32_t *p2 = (uint32_t *)p;
|
||||
for (i = bottom - top; --i >= 0; ) {
|
||||
for (j = vMacScreenWidth; --j >= 0; ) {
|
||||
ui5r t0 = *p1++;
|
||||
uint32_t t0 = *p1++;
|
||||
*p2++
|
||||
= ((t0 & 0xFF000000) >> 24)
|
||||
| ((t0 & 0x00FF0000) >> 8)
|
||||
@ -3494,7 +3494,7 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ui3b *p = cdb + (ui5r)vMacScreenMonoByteWidth * top;
|
||||
uint8_t *p = cdb + (uint32_t)vMacScreenMonoByteWidth * top;
|
||||
|
||||
memset(&bmh, 0, sizeof (bmh));
|
||||
bmh.bmi.biSize = sizeof(BITMAPINFOHEADER);
|
||||
@ -3526,23 +3526,23 @@ LOCALPROC HaveChangedScreenBuff(si4b top, si4b left,
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
ui4r left1 = left & (~ 7);
|
||||
ui4r right1 = (right + 7) & (~ 7);
|
||||
ui4r jn = (right1 - left1) / 8;
|
||||
ui3b *p1 =
|
||||
cdb + ((left1 + vMacScreenWidth * (ui5r)top) / 8);
|
||||
ui3b *p2 = ScalingBuff
|
||||
uint16_t left1 = left & (~ 7);
|
||||
uint16_t right1 = (right + 7) & (~ 7);
|
||||
uint16_t jn = (right1 - left1) / 8;
|
||||
uint8_t *p1 =
|
||||
cdb + ((left1 + vMacScreenWidth * (uint32_t)top) / 8);
|
||||
uint8_t *p2 = ScalingBuff
|
||||
/*
|
||||
+ ((left1 + vMacScreenWidth * MyWindowScale
|
||||
* (ui5r)top)
|
||||
* (uint32_t)top)
|
||||
* MyWindowScale / 8)
|
||||
*/
|
||||
;
|
||||
ui3b *p3;
|
||||
ui3b t0;
|
||||
ui3b t1;
|
||||
ui3b t2;
|
||||
ui3b m;
|
||||
uint8_t *p3;
|
||||
uint8_t t0;
|
||||
uint8_t t1;
|
||||
uint8_t t2;
|
||||
uint8_t m;
|
||||
|
||||
for (i = bottom - top; --i >= 0; ) {
|
||||
p3 = p2;
|
||||
@ -3741,8 +3741,8 @@ LOCALFUNC blnr InitTheCursor(void)
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
@ -3859,7 +3859,7 @@ LOCALPROC CheckMouseState(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALVAR const ui3b Native2MacRomanTab[] = {
|
||||
LOCALVAR const uint8_t Native2MacRomanTab[] = {
|
||||
0xAD, 0xB0, 0xE2, 0xC4, 0xE3, 0xC9, 0xA0, 0xE0,
|
||||
0xF6, 0xE4, 0xB6, 0xDC, 0xCE, 0xB2, 0xB3, 0xB7,
|
||||
0xB8, 0xD4, 0xD5, 0xD2, 0xD3, 0xA5, 0xD0, 0xD1,
|
||||
@ -3882,13 +3882,13 @@ LOCALVAR const ui3b Native2MacRomanTab[] = {
|
||||
LOCALFUNC tMacErr NativeTextToMacRomanPbuf(HGLOBAL x, tPbuf *r)
|
||||
{
|
||||
#if MyUseUni
|
||||
#define MyUnsignedChar ui4b
|
||||
#define MyUnsignedChar uint16_t
|
||||
#else
|
||||
#define MyUnsignedChar ui3b
|
||||
#define MyUnsignedChar uint8_t
|
||||
#endif
|
||||
HGLOBAL h;
|
||||
LPTSTR p1;
|
||||
ui5b n;
|
||||
uint32_t n;
|
||||
MyUnsignedChar v;
|
||||
tMacErr err = mnvm_miscErr;
|
||||
|
||||
@ -3906,7 +3906,7 @@ LOCALFUNC tMacErr NativeTextToMacRomanPbuf(HGLOBAL x, tPbuf *r)
|
||||
if (h != NULL) {
|
||||
p1 = GlobalLock(x);
|
||||
if (p1 != NULL) {
|
||||
ui3b *p2 = GlobalLock(h);
|
||||
uint8_t *p2 = GlobalLock(h);
|
||||
if (p2 != NULL) {
|
||||
while ((v = (MyUnsignedChar)*p1++) != 0) {
|
||||
if (v >= 128) {
|
||||
@ -3939,7 +3939,7 @@ LOCALFUNC tMacErr NativeTextToMacRomanPbuf(HGLOBAL x, tPbuf *r)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALVAR const ui3b MacRoman2NativeTab[] = {
|
||||
LOCALVAR const uint8_t MacRoman2NativeTab[] = {
|
||||
0xC4, 0xC5, 0xC7, 0xC9, 0xD1, 0xD6, 0xDC, 0xE1,
|
||||
0xE0, 0xE2, 0xE4, 0xE3, 0xE5, 0xE7, 0xE9, 0xE8,
|
||||
0xEA, 0xEB, 0xED, 0xEC, 0xEE, 0xEF, 0xF1, 0xF3,
|
||||
@ -3963,10 +3963,10 @@ LOCALFUNC blnr MacRomanTextToNativeHand(tPbuf Pbuf_no,
|
||||
blnr IsFileName, HGLOBAL *r)
|
||||
{
|
||||
HGLOBAL h;
|
||||
ui5b i;
|
||||
ui5b rn = 0;
|
||||
uint32_t i;
|
||||
uint32_t rn = 0;
|
||||
HGLOBAL bh = PbufDat[Pbuf_no];
|
||||
ui5b L = PbufSize[Pbuf_no];
|
||||
uint32_t L = PbufSize[Pbuf_no];
|
||||
blnr IsOk = falseblnr;
|
||||
|
||||
if (IsFileName) {
|
||||
@ -3974,7 +3974,7 @@ LOCALFUNC blnr MacRomanTextToNativeHand(tPbuf Pbuf_no,
|
||||
L = 255;
|
||||
}
|
||||
} else {
|
||||
ui3b *Buffer = (ui3b *)GlobalLock(bh);
|
||||
uint8_t *Buffer = (uint8_t *)GlobalLock(bh);
|
||||
if (Buffer != NULL) {
|
||||
for (i = 0; i < L; ++i) {
|
||||
if (Buffer[i] == 13) {
|
||||
@ -3987,13 +3987,13 @@ LOCALFUNC blnr MacRomanTextToNativeHand(tPbuf Pbuf_no,
|
||||
|
||||
h = GlobalAlloc(GMEM_DDESHARE, (L + rn + 1) * sizeof(TCHAR));
|
||||
if (h != NULL) {
|
||||
ui3b *Buffer = (ui3b *)GlobalLock(bh);
|
||||
uint8_t *Buffer = (uint8_t *)GlobalLock(bh);
|
||||
if (Buffer != NULL) {
|
||||
LPTSTR p1 = GlobalLock(h);
|
||||
if (p1 != NULL) {
|
||||
for (i = 0; i < L; ++i) {
|
||||
TCHAR y;
|
||||
ui3b x = ((ui3b *)Buffer)[i];
|
||||
uint8_t x = ((uint8_t *)Buffer)[i];
|
||||
if (x >= 128) {
|
||||
y = (TCHAR)MacRoman2NativeTab[x - 128];
|
||||
} else {
|
||||
@ -4132,8 +4132,8 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
HANDLE refnum;
|
||||
DWORD newL;
|
||||
@ -4149,7 +4149,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
);
|
||||
if (newL == 0xFFFFFFFF) {
|
||||
result = mnvm_miscErr; /*& figure out what really to return &*/
|
||||
} else if (Sony_Start != (ui5b)newL) {
|
||||
} else if (Sony_Start != (uint32_t)newL) {
|
||||
/* not supposed to get here */
|
||||
result = mnvm_miscErr; /*& figure out what really to return &*/
|
||||
} else {
|
||||
@ -4163,7 +4163,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
{
|
||||
result = mnvm_miscErr;
|
||||
/*& figure out what really to return &*/
|
||||
} else if ((ui5b)BytesTransferred != Sony_Count) {
|
||||
} else if ((uint32_t)BytesTransferred != Sony_Count) {
|
||||
result = mnvm_miscErr;
|
||||
/*& figure out what really to return &*/
|
||||
} else {
|
||||
@ -4180,7 +4180,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
{
|
||||
result = mnvm_miscErr;
|
||||
/*& figure out what really to return &*/
|
||||
} else if ((ui5b)BytesTransferred != Sony_Count) {
|
||||
} else if ((uint32_t)BytesTransferred != Sony_Count) {
|
||||
result = mnvm_miscErr;
|
||||
/*& figure out what really to return &*/
|
||||
} else {
|
||||
@ -4196,7 +4196,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return result;
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
tMacErr result;
|
||||
DWORD L;
|
||||
@ -4424,7 +4424,7 @@ LOCALFUNC blnr LoadMacRomFromPath(LPTSTR drivepath)
|
||||
{
|
||||
MacMsgOverride(kStrNoReadROMTitle, kStrNoReadROMMessage);
|
||||
} else
|
||||
if ((ui5b)BytesRead != kROM_Size) {
|
||||
if ((uint32_t)BytesRead != kROM_Size) {
|
||||
MacMsgOverride(kStrShortROMTitle, kStrShortROMMessage);
|
||||
} else
|
||||
{
|
||||
@ -4827,7 +4827,7 @@ LOCALFUNC blnr LoadInitialImages(void)
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC blnr WriteZero(HANDLE refnum, ui5b L)
|
||||
LOCALFUNC blnr WriteZero(HANDLE refnum, uint32_t L)
|
||||
{
|
||||
if (SetFilePointer(
|
||||
refnum, /* handle of file */
|
||||
@ -4839,8 +4839,8 @@ LOCALFUNC blnr WriteZero(HANDLE refnum, ui5b L)
|
||||
return falseblnr;
|
||||
} else {
|
||||
#define ZeroBufferSize 2048
|
||||
ui5b i;
|
||||
ui3b buffer[ZeroBufferSize];
|
||||
uint32_t i;
|
||||
uint8_t buffer[ZeroBufferSize];
|
||||
DWORD BytesWritten;
|
||||
|
||||
memset(&buffer, 0, ZeroBufferSize);
|
||||
@ -4853,7 +4853,7 @@ LOCALFUNC blnr WriteZero(HANDLE refnum, ui5b L)
|
||||
(DWORD)i, /* number of bytes to read */
|
||||
&BytesWritten, /* address of number of bytes read */
|
||||
nullpr) /* address of structure for data */
|
||||
|| ((ui5b)BytesWritten != i))
|
||||
|| ((uint32_t)BytesWritten != i))
|
||||
{
|
||||
return falseblnr;
|
||||
}
|
||||
@ -4867,7 +4867,7 @@ LOCALFUNC blnr WriteZero(HANDLE refnum, ui5b L)
|
||||
#define MaxSavePathSize MAX_PATH
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk0(ui5b L, LPTSTR pathName)
|
||||
LOCALPROC MakeNewDisk0(uint32_t L, LPTSTR pathName)
|
||||
{
|
||||
blnr IsOk = falseblnr;
|
||||
HANDLE newrefNum;
|
||||
@ -4914,7 +4914,7 @@ LOCALPROC MakeNewDisk0(ui5b L, LPTSTR pathName)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk(ui5b L, HGLOBAL NewDiskNameDat)
|
||||
LOCALPROC MakeNewDisk(uint32_t L, HGLOBAL NewDiskNameDat)
|
||||
{
|
||||
#if SaveDialogEnable
|
||||
OPENFILENAME ofn;
|
||||
@ -5659,8 +5659,8 @@ LRESULT CALLBACK Win32WMProc(HWND hwnd,
|
||||
}
|
||||
break;
|
||||
case WM_MOVE:
|
||||
WndX = (si4b) LOWORD(lparam);
|
||||
WndY = (si4b) HIWORD(lparam);
|
||||
WndX = (int16_t) LOWORD(lparam);
|
||||
WndY = (int16_t) HIWORD(lparam);
|
||||
break;
|
||||
case WM_SYSCHAR:
|
||||
case WM_CHAR:
|
||||
@ -5748,7 +5748,7 @@ LOCALPROC WaitForTheNextEvent(void)
|
||||
LOCALPROC CheckForSystemEvents(void)
|
||||
{
|
||||
MSG msg;
|
||||
ui3r i = 0;
|
||||
uint8_t i = 0;
|
||||
|
||||
while ((i < 32) && (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))) {
|
||||
DispatchMessage(&msg);
|
||||
@ -5924,7 +5924,7 @@ LOCALPROC ReserveAllocAll(void)
|
||||
#endif
|
||||
#if EnableScalingBuff
|
||||
{
|
||||
ui5r n = vMacScreenMonoNumBytes
|
||||
uint32_t n = vMacScreenMonoNumBytes
|
||||
#if EnableMagnify
|
||||
* MyWindowScale * MyWindowScale
|
||||
#endif
|
||||
|
140
src/OSGLUXWN.c
140
src/OSGLUXWN.c
@ -45,7 +45,7 @@
|
||||
|
||||
/* --- some simple utilities --- */
|
||||
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, si5b byteCount)
|
||||
GLOBALOSGLUPROC MyMoveBytes(anyp srcPtr, anyp destPtr, int32_t byteCount)
|
||||
{
|
||||
(void) memcpy((char *)destPtr, (char *)srcPtr, byteCount);
|
||||
}
|
||||
@ -318,7 +318,7 @@ LOCALFUNC blnr NetSupportedContains(Atom x)
|
||||
|
||||
#if IncludePbufs
|
||||
/* this is table for Windows, any changes needed for X? */
|
||||
LOCALVAR const ui3b Native2MacRomanTab[] = {
|
||||
LOCALVAR const uint8_t Native2MacRomanTab[] = {
|
||||
0xAD, 0xB0, 0xE2, 0xC4, 0xE3, 0xC9, 0xA0, 0xE0,
|
||||
0xF6, 0xE4, 0xB6, 0xDC, 0xCE, 0xB2, 0xB3, 0xB7,
|
||||
0xB8, 0xD4, 0xD5, 0xD2, 0xD3, 0xA5, 0xD0, 0xD1,
|
||||
@ -345,18 +345,18 @@ LOCALFUNC tMacErr NativeTextToMacRomanPbuf(char *x, tPbuf *r)
|
||||
return mnvm_miscErr;
|
||||
} else {
|
||||
ui3p p;
|
||||
ui5b L = strlen(x);
|
||||
uint32_t L = strlen(x);
|
||||
|
||||
p = (ui3p)malloc(L);
|
||||
if (NULL == p) {
|
||||
return mnvm_miscErr;
|
||||
} else {
|
||||
ui3b *p0 = (ui3b *)x;
|
||||
ui3b *p1 = (ui3b *)p;
|
||||
uint8_t *p0 = (uint8_t *)x;
|
||||
uint8_t *p1 = (uint8_t *)p;
|
||||
int i;
|
||||
|
||||
for (i = L; --i >= 0; ) {
|
||||
ui3b v = *p0++;
|
||||
uint8_t v = *p0++;
|
||||
if (v >= 128) {
|
||||
v = Native2MacRomanTab[v - 128];
|
||||
} else if (10 == v) {
|
||||
@ -373,7 +373,7 @@ LOCALFUNC tMacErr NativeTextToMacRomanPbuf(char *x, tPbuf *r)
|
||||
|
||||
#if IncludePbufs
|
||||
/* this is table for Windows, any changes needed for X? */
|
||||
LOCALVAR const ui3b MacRoman2NativeTab[] = {
|
||||
LOCALVAR const uint8_t MacRoman2NativeTab[] = {
|
||||
0xC4, 0xC5, 0xC7, 0xC9, 0xD1, 0xD6, 0xDC, 0xE1,
|
||||
0xE0, 0xE2, 0xE4, 0xE3, 0xE5, 0xE7, 0xE9, 0xE8,
|
||||
0xEA, 0xEB, 0xED, 0xEC, 0xEE, 0xEF, 0xF1, 0xF3,
|
||||
@ -399,17 +399,17 @@ LOCALFUNC blnr MacRomanTextToNativePtr(tPbuf i, blnr IsFileName,
|
||||
{
|
||||
ui3p p;
|
||||
void *Buffer = PbufDat[i];
|
||||
ui5b L = PbufSize[i];
|
||||
uint32_t L = PbufSize[i];
|
||||
|
||||
p = (ui3p)malloc(L + 1);
|
||||
if (p != NULL) {
|
||||
ui3b *p0 = (ui3b *)Buffer;
|
||||
ui3b *p1 = (ui3b *)p;
|
||||
uint8_t *p0 = (uint8_t *)Buffer;
|
||||
uint8_t *p1 = (uint8_t *)p;
|
||||
int j;
|
||||
|
||||
if (IsFileName) {
|
||||
for (j = L; --j >= 0; ) {
|
||||
ui3b x = *p0++;
|
||||
uint8_t x = *p0++;
|
||||
if (x < 32) {
|
||||
x = '-';
|
||||
} else if (x >= 128) {
|
||||
@ -433,7 +433,7 @@ LOCALFUNC blnr MacRomanTextToNativePtr(tPbuf i, blnr IsFileName,
|
||||
}
|
||||
} else {
|
||||
for (j = L; --j >= 0; ) {
|
||||
ui3b x = *p0++;
|
||||
uint8_t x = *p0++;
|
||||
if (x >= 128) {
|
||||
x = MacRoman2NativeTab[x - 128];
|
||||
} else if (13 == x) {
|
||||
@ -453,7 +453,7 @@ LOCALFUNC blnr MacRomanTextToNativePtr(tPbuf i, blnr IsFileName,
|
||||
|
||||
LOCALPROC NativeStrFromCStr(char *r, char *s)
|
||||
{
|
||||
ui3b ps[ClStrMaxLength];
|
||||
uint8_t ps[ClStrMaxLength];
|
||||
int i;
|
||||
int L;
|
||||
|
||||
@ -492,12 +492,12 @@ LOCALPROC InitDrives(void)
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
ui5r NewSony_Count = 0;
|
||||
uint32_t NewSony_Count = 0;
|
||||
|
||||
if (0 == fseek(refnum, Sony_Start, SEEK_SET)) {
|
||||
if (IsWrite) {
|
||||
@ -518,7 +518,7 @@ GLOBALOSGLUFUNC tMacErr vSonyTransfer(blnr IsWrite, ui3p Buffer,
|
||||
return err; /*& figure out what really to return &*/
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, ui5r *Sony_Count)
|
||||
GLOBALOSGLUFUNC tMacErr vSonyGetSize(tDrive Drive_No, uint32_t *Sony_Count)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
FILE *refnum = Drives[Drive_No];
|
||||
@ -694,7 +694,7 @@ LOCALFUNC blnr Sony_Insert0(FILE *refnum, blnr locked,
|
||||
|
||||
#if IncludeSonyGetName || IncludeSonyNew
|
||||
{
|
||||
ui5b L = strlen(drivepath);
|
||||
uint32_t L = strlen(drivepath);
|
||||
char *p = malloc(L + 1);
|
||||
if (p != NULL) {
|
||||
(void) memcpy(p, drivepath, L + 1);
|
||||
@ -830,11 +830,11 @@ LOCALFUNC blnr LoadInitialImages(void)
|
||||
}
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALFUNC blnr WriteZero(FILE *refnum, ui5b L)
|
||||
LOCALFUNC blnr WriteZero(FILE *refnum, uint32_t L)
|
||||
{
|
||||
#define ZeroBufferSize 2048
|
||||
ui5b i;
|
||||
ui3b buffer[ZeroBufferSize];
|
||||
uint32_t i;
|
||||
uint8_t buffer[ZeroBufferSize];
|
||||
|
||||
memset(&buffer, 0, ZeroBufferSize);
|
||||
|
||||
@ -850,7 +850,7 @@ LOCALFUNC blnr WriteZero(FILE *refnum, ui5b L)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk0(ui5b L, char *drivepath)
|
||||
LOCALPROC MakeNewDisk0(uint32_t L, char *drivepath)
|
||||
{
|
||||
blnr IsOk = falseblnr;
|
||||
FILE *refnum = fopen(drivepath, "wb+");
|
||||
@ -872,7 +872,7 @@ LOCALPROC MakeNewDisk0(ui5b L, char *drivepath)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDisk(ui5b L, char *drivename)
|
||||
LOCALPROC MakeNewDisk(uint32_t L, char *drivename)
|
||||
{
|
||||
char *d =
|
||||
#if CanGetAppPath
|
||||
@ -900,7 +900,7 @@ LOCALPROC MakeNewDisk(ui5b L, char *drivename)
|
||||
#endif
|
||||
|
||||
#if IncludeSonyNew
|
||||
LOCALPROC MakeNewDiskAtDefault(ui5b L)
|
||||
LOCALPROC MakeNewDiskAtDefault(uint32_t L)
|
||||
{
|
||||
char s[ClStrMaxLength + 1];
|
||||
|
||||
@ -1188,13 +1188,13 @@ LOCALVAR ui3p ScalingBuff = nullpr;
|
||||
#if EnableMagnify && ! UseColorImage
|
||||
LOCALPROC SetUpScalingTabl(void)
|
||||
{
|
||||
ui3b *p4;
|
||||
uint8_t *p4;
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
ui3r bitsRemaining;
|
||||
ui3b t1;
|
||||
ui3b t2;
|
||||
uint8_t bitsRemaining;
|
||||
uint8_t t1;
|
||||
uint8_t t2;
|
||||
|
||||
p4 = ScalingTabl;
|
||||
for (i = 0; i < 256; ++i) {
|
||||
@ -1222,7 +1222,7 @@ LOCALPROC SetUpColorScalingTabl(void)
|
||||
int j;
|
||||
int k;
|
||||
int a;
|
||||
ui5r v;
|
||||
uint32_t v;
|
||||
ui5p p4;
|
||||
|
||||
p4 = (ui5p)ScalingTabl;
|
||||
@ -1266,7 +1266,7 @@ LOCALPROC SetUpBW2ColorScalingTabl(void)
|
||||
int i;
|
||||
int k;
|
||||
int a;
|
||||
ui5r v;
|
||||
uint32_t v;
|
||||
ui5p p4;
|
||||
|
||||
p4 = (ui5p)ScalingTabl;
|
||||
@ -1291,7 +1291,7 @@ LOCALPROC SetUpBW2ColorTabl(void)
|
||||
{
|
||||
int i;
|
||||
int k;
|
||||
ui5r v;
|
||||
uint32_t v;
|
||||
ui5p p4;
|
||||
|
||||
p4 = (ui5p)ScalingTabl;
|
||||
@ -1408,8 +1408,8 @@ LOCALPROC SetUpBW2ColorTabl(void)
|
||||
#endif
|
||||
|
||||
|
||||
LOCALPROC HaveChangedScreenBuff(ui4r top, ui4r left,
|
||||
ui4r bottom, ui4r right)
|
||||
LOCALPROC HaveChangedScreenBuff(uint16_t top, uint16_t left,
|
||||
uint16_t bottom, uint16_t right)
|
||||
{
|
||||
int XDest;
|
||||
int YDest;
|
||||
@ -1654,7 +1654,7 @@ LOCALFUNC blnr CreateMyBlankCursor(Window rootwin)
|
||||
/* cursor moving */
|
||||
|
||||
#if EnableMoveMouse
|
||||
LOCALFUNC blnr MyMoveMouse(si4b h, si4b v)
|
||||
LOCALFUNC blnr MyMoveMouse(int16_t h, int16_t v)
|
||||
{
|
||||
int NewMousePosh;
|
||||
int NewMousePosv;
|
||||
@ -1737,8 +1737,8 @@ LOCALPROC StopSaveMouseMotion(void)
|
||||
#if EnableFSMouseMotion
|
||||
LOCALPROC MyMouseConstrain(void)
|
||||
{
|
||||
si4b shiftdh;
|
||||
si4b shiftdv;
|
||||
int16_t shiftdh;
|
||||
int16_t shiftdv;
|
||||
|
||||
if (SavedMouseH < ViewHStart + (ViewHSize / 4)) {
|
||||
shiftdh = ViewHSize / 2;
|
||||
@ -1861,9 +1861,9 @@ LOCALPROC CheckMouseState(void)
|
||||
|
||||
LOCALVAR KeyCode TheCapsLockCode;
|
||||
|
||||
LOCALVAR ui3b KC2MKC[256];
|
||||
LOCALVAR uint8_t KC2MKC[256];
|
||||
|
||||
LOCALPROC KC2MKCAssignOne(KeySym ks, ui3r key)
|
||||
LOCALPROC KC2MKCAssignOne(KeySym ks, uint8_t key)
|
||||
{
|
||||
KeyCode code = XKeysymToKeycode(x_display, ks);
|
||||
if (code != NoSymbol) {
|
||||
@ -2169,7 +2169,7 @@ LOCALPROC CheckTheCapsLock(void)
|
||||
|
||||
LOCALPROC DoKeyCode0(int i, blnr down)
|
||||
{
|
||||
ui3r key = KC2MKC[i];
|
||||
uint8_t key = KC2MKC[i];
|
||||
if (MKC_None != key) {
|
||||
Keyboard_UpdateKeyMap2(key, down);
|
||||
}
|
||||
@ -2286,19 +2286,19 @@ LOCALPROC DisconnectKeyCodes3(void)
|
||||
|
||||
#define dbglog_TimeStuff (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR ui5b TrueEmulatedTime = 0;
|
||||
LOCALVAR uint32_t TrueEmulatedTime = 0;
|
||||
|
||||
#include "DATE2SEC.h"
|
||||
|
||||
#define TicksPerSecond 1000000
|
||||
|
||||
LOCALVAR blnr HaveTimeDelta = falseblnr;
|
||||
LOCALVAR ui5b TimeDelta;
|
||||
LOCALVAR uint32_t TimeDelta;
|
||||
|
||||
LOCALVAR ui5b NewMacDateInSeconds;
|
||||
LOCALVAR uint32_t NewMacDateInSeconds;
|
||||
|
||||
LOCALVAR ui5b LastTimeSec;
|
||||
LOCALVAR ui5b LastTimeUsec;
|
||||
LOCALVAR uint32_t LastTimeSec;
|
||||
LOCALVAR uint32_t LastTimeUsec;
|
||||
|
||||
LOCALPROC GetCurrentTicks(void)
|
||||
{
|
||||
@ -2314,21 +2314,21 @@ LOCALPROC GetCurrentTicks(void)
|
||||
TimeDelta = Date2MacSeconds(s->tm_sec, s->tm_min, s->tm_hour,
|
||||
s->tm_mday, 1 + s->tm_mon, 1900 + s->tm_year) - t.tv_sec;
|
||||
#if 0 && AutoTimeZone /* how portable is this ? */
|
||||
CurMacDelta = ((ui5b)(s->tm_gmtoff) & 0x00FFFFFF)
|
||||
CurMacDelta = ((uint32_t)(s->tm_gmtoff) & 0x00FFFFFF)
|
||||
| ((s->tm_isdst ? 0x80 : 0) << 24);
|
||||
#endif
|
||||
HaveTimeDelta = trueblnr;
|
||||
}
|
||||
|
||||
NewMacDateInSeconds = t.tv_sec + TimeDelta;
|
||||
LastTimeSec = (ui5b)t.tv_sec;
|
||||
LastTimeUsec = (ui5b)t.tv_usec;
|
||||
LastTimeSec = (uint32_t)t.tv_sec;
|
||||
LastTimeUsec = (uint32_t)t.tv_usec;
|
||||
}
|
||||
|
||||
#define MyInvTimeStep 16626 /* TicksPerSecond / 60.14742 */
|
||||
|
||||
LOCALVAR ui5b NextTimeSec;
|
||||
LOCALVAR ui5b NextTimeUsec;
|
||||
LOCALVAR uint32_t NextTimeSec;
|
||||
LOCALVAR uint32_t NextTimeUsec;
|
||||
|
||||
LOCALPROC IncrNextTime(void)
|
||||
{
|
||||
@ -2352,15 +2352,15 @@ LOCALPROC StartUpTimeAdjust(void)
|
||||
InitNextTime();
|
||||
}
|
||||
|
||||
LOCALFUNC si5b GetTimeDiff(void)
|
||||
LOCALFUNC int32_t GetTimeDiff(void)
|
||||
{
|
||||
return ((si5b)(LastTimeSec - NextTimeSec)) * TicksPerSecond
|
||||
+ ((si5b)(LastTimeUsec - NextTimeUsec));
|
||||
return ((int32_t)(LastTimeSec - NextTimeSec)) * TicksPerSecond
|
||||
+ ((int32_t)(LastTimeUsec - NextTimeUsec));
|
||||
}
|
||||
|
||||
LOCALPROC UpdateTrueEmulatedTime(void)
|
||||
{
|
||||
si5b TimeDiff;
|
||||
int32_t TimeDiff;
|
||||
|
||||
GetCurrentTicks();
|
||||
|
||||
@ -2440,10 +2440,10 @@ LOCALFUNC blnr InitLocationDat(void)
|
||||
#define dbglog_SoundBuffStats (0 && dbglog_HAVE)
|
||||
|
||||
LOCALVAR tpSoundSamp TheSoundBuffer = nullpr;
|
||||
LOCALVAR ui4b ThePlayOffset;
|
||||
LOCALVAR ui4b TheFillOffset;
|
||||
LOCALVAR ui4b TheWriteOffset;
|
||||
LOCALVAR ui4b MinFilledSoundBuffs;
|
||||
LOCALVAR uint16_t ThePlayOffset;
|
||||
LOCALVAR uint16_t TheFillOffset;
|
||||
LOCALVAR uint16_t TheWriteOffset;
|
||||
LOCALVAR uint16_t MinFilledSoundBuffs;
|
||||
|
||||
LOCALPROC MySound_Start0(void)
|
||||
{
|
||||
@ -2454,10 +2454,10 @@ LOCALPROC MySound_Start0(void)
|
||||
MinFilledSoundBuffs = kSoundBuffers;
|
||||
}
|
||||
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(uint16_t n, uint16_t *actL)
|
||||
{
|
||||
ui4b ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
ui4b WriteBuffContig =
|
||||
uint16_t ToFillLen = kAllBuffLen - (TheWriteOffset - ThePlayOffset);
|
||||
uint16_t WriteBuffContig =
|
||||
kOneBuffLen - (TheWriteOffset & kOneBuffMask);
|
||||
|
||||
if (WriteBuffContig < n) {
|
||||
@ -2475,7 +2475,7 @@ GLOBALOSGLUFUNC tpSoundSamp MySound_BeginWrite(ui4r n, ui4r *actL)
|
||||
return TheSoundBuffer + (TheWriteOffset & kAllBuffMask);
|
||||
}
|
||||
|
||||
LOCALFUNC blnr MySound_EndWrite0(ui4r actL)
|
||||
LOCALFUNC blnr MySound_EndWrite0(uint16_t actL)
|
||||
{
|
||||
blnr v;
|
||||
|
||||
@ -3380,7 +3380,7 @@ LOCALFUNC blnr Screen_Init(void)
|
||||
my_image = XCreateImage(x_display, Xvisual, 24, ZPixmap, 0,
|
||||
NULL /* (char *)image_Mem1 */,
|
||||
vMacScreenWidth, vMacScreenHeight, 32,
|
||||
4 * (ui5r)vMacScreenWidth);
|
||||
4 * (uint32_t)vMacScreenWidth);
|
||||
if (NULL == my_image) {
|
||||
fprintf(stderr, "XCreateImage Color failed.\n");
|
||||
return falseblnr;
|
||||
@ -3433,7 +3433,7 @@ LOCALFUNC blnr Screen_Init(void)
|
||||
NULL /* (char *)image_Mem1 */,
|
||||
vMacScreenWidth * MyWindowScale,
|
||||
vMacScreenHeight * MyWindowScale,
|
||||
32, 4 * (ui5r)vMacScreenWidth * MyWindowScale);
|
||||
32, 4 * (uint32_t)vMacScreenWidth * MyWindowScale);
|
||||
if (NULL == my_Scaled_image) {
|
||||
fprintf(stderr, "XCreateImage Scaled failed.\n");
|
||||
return falseblnr;
|
||||
@ -3800,10 +3800,10 @@ struct MyWState {
|
||||
#if MayFullScreen
|
||||
short f_hOffset;
|
||||
short f_vOffset;
|
||||
ui4r f_ViewHSize;
|
||||
ui4r f_ViewVSize;
|
||||
ui4r f_ViewHStart;
|
||||
ui4r f_ViewVStart;
|
||||
uint16_t f_ViewHSize;
|
||||
uint16_t f_ViewVSize;
|
||||
uint16_t f_ViewHStart;
|
||||
uint16_t f_ViewVStart;
|
||||
#endif
|
||||
#if VarFullScreen
|
||||
blnr f_UseFullScreen;
|
||||
@ -3861,8 +3861,8 @@ LOCALPROC SetMyWState(MyWState *r)
|
||||
|
||||
#if EnableRecreateW
|
||||
LOCALVAR blnr WantRestoreCursPos = falseblnr;
|
||||
LOCALVAR ui4b RestoreMouseH;
|
||||
LOCALVAR ui4b RestoreMouseV;
|
||||
LOCALVAR uint16_t RestoreMouseH;
|
||||
LOCALVAR uint16_t RestoreMouseV;
|
||||
#endif
|
||||
|
||||
#if EnableRecreateW
|
||||
@ -4454,7 +4454,7 @@ label_retry:
|
||||
struct timespec rqt;
|
||||
struct timespec rmt;
|
||||
|
||||
si5b TimeDiff = GetTimeDiff();
|
||||
int32_t TimeDiff = GetTimeDiff();
|
||||
if (TimeDiff < 0) {
|
||||
rqt.tv_sec = 0;
|
||||
rqt.tv_nsec = (- TimeDiff) * 1000;
|
||||
|
@ -24,7 +24,7 @@ LOCALVAR void *PbufDat[NumPbufs];
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALFUNC tMacErr PbufNewFromPtr(void *p, ui5b count, tPbuf *r)
|
||||
LOCALFUNC tMacErr PbufNewFromPtr(void *p, uint32_t count, tPbuf *r)
|
||||
{
|
||||
tPbuf i;
|
||||
tMacErr err;
|
||||
@ -44,7 +44,7 @@ LOCALFUNC tMacErr PbufNewFromPtr(void *p, ui5b count, tPbuf *r)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
LOCALPROC PbufKillToPtr(void **p, ui5r *count, tPbuf r)
|
||||
LOCALPROC PbufKillToPtr(void **p, uint32_t *count, tPbuf r)
|
||||
{
|
||||
*p = PbufDat[r];
|
||||
*count = PbufSize[r];
|
||||
@ -54,7 +54,7 @@ LOCALPROC PbufKillToPtr(void **p, ui5r *count, tPbuf r)
|
||||
#endif
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUFUNC tMacErr PbufNew(ui5b count, tPbuf *r)
|
||||
GLOBALOSGLUFUNC tMacErr PbufNew(uint32_t count, tPbuf *r)
|
||||
{
|
||||
tMacErr err = mnvm_miscErr;
|
||||
|
||||
@ -71,7 +71,7 @@ GLOBALOSGLUFUNC tMacErr PbufNew(ui5b count, tPbuf *r)
|
||||
GLOBALOSGLUPROC PbufDispose(tPbuf i)
|
||||
{
|
||||
void *p;
|
||||
ui5r count;
|
||||
uint32_t count;
|
||||
|
||||
PbufKillToPtr(&p, &count, i);
|
||||
|
||||
@ -109,7 +109,7 @@ LOCALFUNC ui3p PbufLock(tPbuf i)
|
||||
|
||||
#if IncludePbufs
|
||||
GLOBALOSGLUPROC PbufTransfer(ui3p Buffer,
|
||||
tPbuf i, ui5r offset, ui5r count, blnr IsWrite)
|
||||
tPbuf i, uint32_t offset, uint32_t count, blnr IsWrite)
|
||||
{
|
||||
void *p = ((ui3p)PbufDat[i]) + offset;
|
||||
if (IsWrite) {
|
||||
|
@ -44,25 +44,25 @@ enum {
|
||||
};
|
||||
|
||||
#define PMU_BuffSz 8
|
||||
LOCALVAR ui3b PMU_BuffA[PMU_BuffSz];
|
||||
LOCALVAR uint8_t PMU_BuffA[PMU_BuffSz];
|
||||
LOCALVAR ui3p PMU_p;
|
||||
LOCALVAR ui3r PMU_rem;
|
||||
LOCALVAR ui3r PMU_i;
|
||||
LOCALVAR uint8_t PMU_rem;
|
||||
LOCALVAR uint8_t PMU_i;
|
||||
|
||||
LOCALVAR int PMUState = kPMUStateReadyForCommand;
|
||||
|
||||
LOCALVAR ui3r PMU_CurCommand;
|
||||
LOCALVAR ui3r PMU_SendNext;
|
||||
LOCALVAR ui3r PMU_BuffL;
|
||||
LOCALVAR uint8_t PMU_CurCommand;
|
||||
LOCALVAR uint8_t PMU_SendNext;
|
||||
LOCALVAR uint8_t PMU_BuffL;
|
||||
|
||||
LOCALPROC PmuStartSendResult(ui3r ResultCode, ui3r L)
|
||||
LOCALPROC PmuStartSendResult(uint8_t ResultCode, uint8_t L)
|
||||
{
|
||||
PMU_SendNext = ResultCode;
|
||||
PMU_BuffL = L;
|
||||
PMUState = kPMUStateSendLength;
|
||||
}
|
||||
|
||||
LOCALVAR ui3b PARAMRAM[128];
|
||||
LOCALVAR uint8_t PARAMRAM[128];
|
||||
|
||||
LOCALPROC PmuCheckCommandOp(void)
|
||||
{
|
||||
@ -271,9 +271,9 @@ LOCALPROC LocBuffSetUpNextChunk(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r GetPMUbus(void)
|
||||
LOCALFUNC uint8_t GetPMUbus(void)
|
||||
{
|
||||
ui3r v;
|
||||
uint8_t v;
|
||||
|
||||
v = VIA1_iA7;
|
||||
v <<= 1;
|
||||
@ -294,7 +294,7 @@ LOCALFUNC ui3r GetPMUbus(void)
|
||||
return v;
|
||||
}
|
||||
|
||||
LOCALPROC SetPMUbus(ui3r v)
|
||||
LOCALPROC SetPMUbus(uint8_t v)
|
||||
{
|
||||
VIA1_iA0 = v & 0x01;
|
||||
v >>= 1;
|
||||
@ -370,7 +370,7 @@ GLOBALPROC PmuToReady_ChangeNtfy(void)
|
||||
if (! PmuToReady) {
|
||||
PmuFromReady = 0;
|
||||
} else {
|
||||
ui3r v = GetPMUbus();
|
||||
uint8_t v = GetPMUbus();
|
||||
if (0 == PMU_rem) {
|
||||
PMU_p = nullpr;
|
||||
PmuCheckCommandOp();
|
||||
|
@ -127,7 +127,7 @@ LOCALPROC SubTickNotify(int SubTick)
|
||||
#define CyclesScaledPerTick (130240UL * kMyClockMult * kCycleScale)
|
||||
#define CyclesScaledPerSubTick (CyclesScaledPerTick / kNumSubTicks)
|
||||
|
||||
LOCALVAR ui4r SubTickCounter;
|
||||
LOCALVAR uint16_t SubTickCounter;
|
||||
|
||||
LOCALPROC SubTickTaskDo(void)
|
||||
{
|
||||
@ -328,11 +328,11 @@ LOCALPROC ICT_DoCurrentTasks(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui5b ICT_DoGetNext(ui5b maxn)
|
||||
LOCALFUNC uint32_t ICT_DoGetNext(uint32_t maxn)
|
||||
{
|
||||
int i = 0;
|
||||
uimr m = ICTactive;
|
||||
ui5b v = maxn;
|
||||
uint32_t v = maxn;
|
||||
|
||||
while (0 != m) {
|
||||
if (0 != (m & 1)) {
|
||||
@ -340,7 +340,7 @@ LOCALFUNC ui5b ICT_DoGetNext(ui5b maxn)
|
||||
/* shouldn't happen */
|
||||
m = 0;
|
||||
} else {
|
||||
ui5b d = ICTwhen[i] - NextiCount;
|
||||
uint32_t d = ICTwhen[i] - NextiCount;
|
||||
/* at this point d must be > 0 */
|
||||
if (d < v) {
|
||||
#ifdef _VIA_Debug
|
||||
@ -358,10 +358,10 @@ LOCALFUNC ui5b ICT_DoGetNext(ui5b maxn)
|
||||
return v;
|
||||
}
|
||||
|
||||
LOCALPROC m68k_go_nCycles_1(ui5b n)
|
||||
LOCALPROC m68k_go_nCycles_1(uint32_t n)
|
||||
{
|
||||
ui5b n2;
|
||||
ui5b StopiCount = NextiCount + n;
|
||||
uint32_t n2;
|
||||
uint32_t StopiCount = NextiCount + n;
|
||||
do {
|
||||
ICT_DoCurrentTasks();
|
||||
n2 = ICT_DoGetNext(n);
|
||||
@ -381,13 +381,13 @@ LOCALPROC m68k_go_nCycles_1(ui5b n)
|
||||
} while (n != 0);
|
||||
}
|
||||
|
||||
LOCALVAR ui5b ExtraSubTicksToDo = 0;
|
||||
LOCALVAR uint32_t ExtraSubTicksToDo = 0;
|
||||
|
||||
LOCALPROC DoEmulateOneTick(void)
|
||||
{
|
||||
#if EnableAutoSlow
|
||||
{
|
||||
ui5r NewQuietTime = QuietTime + 1;
|
||||
uint32_t NewQuietTime = QuietTime + 1;
|
||||
|
||||
if (NewQuietTime > QuietTime) {
|
||||
/* if not overflow */
|
||||
@ -397,7 +397,7 @@ LOCALPROC DoEmulateOneTick(void)
|
||||
#endif
|
||||
#if EnableAutoSlow
|
||||
{
|
||||
ui5r NewQuietSubTicks = QuietSubTicks + kNumSubTicks;
|
||||
uint32_t NewQuietSubTicks = QuietSubTicks + kNumSubTicks;
|
||||
|
||||
if (NewQuietSubTicks > QuietSubTicks) {
|
||||
/* if not overflow */
|
||||
@ -412,11 +412,11 @@ LOCALPROC DoEmulateOneTick(void)
|
||||
|
||||
SixtiethEndNotify();
|
||||
|
||||
if ((ui3b) -1 == SpeedValue) {
|
||||
ExtraSubTicksToDo = (ui5b) -1;
|
||||
if ((uint8_t) -1 == SpeedValue) {
|
||||
ExtraSubTicksToDo = (uint32_t) -1;
|
||||
} else {
|
||||
ui5b ExtraAdd = (kNumSubTicks << SpeedValue) - kNumSubTicks;
|
||||
ui5b ExtraLimit = ExtraAdd << 3;
|
||||
uint32_t ExtraAdd = (kNumSubTicks << SpeedValue) - kNumSubTicks;
|
||||
uint32_t ExtraLimit = ExtraAdd << 3;
|
||||
|
||||
ExtraSubTicksToDo += ExtraAdd;
|
||||
if (ExtraSubTicksToDo > ExtraLimit) {
|
||||
@ -463,7 +463,7 @@ LOCALPROC DoEmulateExtraTime(void)
|
||||
do {
|
||||
#if EnableAutoSlow
|
||||
{
|
||||
ui5r NewQuietSubTicks = QuietSubTicks + 1;
|
||||
uint32_t NewQuietSubTicks = QuietSubTicks + 1;
|
||||
|
||||
if (NewQuietSubTicks > QuietSubTicks) {
|
||||
/* if not overflow */
|
||||
@ -478,7 +478,7 @@ LOCALPROC DoEmulateExtraTime(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui5b CurEmulatedTime = 0;
|
||||
LOCALVAR uint32_t CurEmulatedTime = 0;
|
||||
/*
|
||||
The number of ticks that have been
|
||||
emulated so far.
|
||||
@ -507,7 +507,7 @@ LOCALPROC RunEmulatedTicksToTrueTime(void)
|
||||
CurEmulatedTime >= TrueEmulatedTime.
|
||||
*/
|
||||
|
||||
si3b n = OnTrueTime - CurEmulatedTime;
|
||||
int8_t n = OnTrueTime - CurEmulatedTime;
|
||||
|
||||
if (n > 0) {
|
||||
DoEmulateOneTick();
|
||||
|
@ -44,7 +44,7 @@
|
||||
#endif
|
||||
|
||||
#if UseSonyPatch
|
||||
LOCALVAR const ui3b sony_driver[] = {
|
||||
LOCALVAR const uint8_t sony_driver[] = {
|
||||
/*
|
||||
Replacement for .Sony driver
|
||||
68k machine code, compiled from mydriver.a
|
||||
@ -108,7 +108,7 @@ LOCALVAR const ui3b sony_driver[] = {
|
||||
#endif
|
||||
|
||||
#if UseSonyPatch
|
||||
LOCALVAR const ui3b my_disk_icon[] = {
|
||||
LOCALVAR const uint8_t my_disk_icon[] = {
|
||||
0x7F, 0xFF, 0xFF, 0xF0,
|
||||
0x81, 0x00, 0x01, 0x08,
|
||||
0x81, 0x00, 0x71, 0x04,
|
||||
@ -254,16 +254,16 @@ LOCALPROC Sony_Install(void)
|
||||
#ifdef ln2mtb
|
||||
LOCALPROC ROMscrambleForMTB(void)
|
||||
{
|
||||
si5r j;
|
||||
int32_t j;
|
||||
ui3p p = ROM;
|
||||
ui3p p2 = ROM + (1 << ln2mtb);
|
||||
|
||||
for (j = kROM_Size / (1 << ln2mtb) / 2; --j >= 0; ) {
|
||||
si5r i;
|
||||
int32_t i;
|
||||
|
||||
for (i = (1 << ln2mtb); --i >= 0; ) {
|
||||
ui3b t0 = *p;
|
||||
ui3b t1 = *p2;
|
||||
uint8_t t0 = *p;
|
||||
uint8_t t1 = *p2;
|
||||
*p++ = t1;
|
||||
*p2++ = t0;
|
||||
}
|
||||
|
@ -60,29 +60,29 @@
|
||||
typedef struct
|
||||
{
|
||||
/* RTC VIA Flags */
|
||||
ui3b WrProtect;
|
||||
ui3b DataOut;
|
||||
ui3b DataNextOut;
|
||||
uint8_t WrProtect;
|
||||
uint8_t DataOut;
|
||||
uint8_t DataNextOut;
|
||||
|
||||
/* RTC Data */
|
||||
ui3b ShiftData;
|
||||
ui3b Counter;
|
||||
ui3b Mode;
|
||||
ui3b SavedCmd;
|
||||
uint8_t ShiftData;
|
||||
uint8_t Counter;
|
||||
uint8_t Mode;
|
||||
uint8_t SavedCmd;
|
||||
#if HaveXPRAM
|
||||
ui3b Sector;
|
||||
uint8_t Sector;
|
||||
#endif
|
||||
|
||||
/* RTC Registers */
|
||||
ui3b Seconds_1[4];
|
||||
ui3b PARAMRAM[PARAMRAMSize];
|
||||
uint8_t Seconds_1[4];
|
||||
uint8_t PARAMRAM[PARAMRAMSize];
|
||||
} RTC_Ty;
|
||||
|
||||
LOCALVAR RTC_Ty RTC;
|
||||
|
||||
/* RTC Functions */
|
||||
|
||||
LOCALVAR ui5b LastRealDate;
|
||||
LOCALVAR uint32_t LastRealDate;
|
||||
|
||||
#ifndef RTCinitPRAM
|
||||
#define RTCinitPRAM 1
|
||||
@ -148,7 +148,7 @@ GLOBALPROC DumpRTC(void)
|
||||
GLOBALFUNC blnr RTC_Init(void)
|
||||
{
|
||||
int Counter;
|
||||
ui5b secs;
|
||||
uint32_t secs;
|
||||
|
||||
RTC.Mode = RTC.ShiftData = RTC.Counter = 0;
|
||||
RTC.DataOut = RTC.DataNextOut = 0;
|
||||
@ -310,9 +310,9 @@ IMPORTPROC RTC_OneSecond_PulseNtfy(void);
|
||||
|
||||
GLOBALPROC RTC_Interrupt(void)
|
||||
{
|
||||
ui5b Seconds = 0;
|
||||
ui5b NewRealDate = CurMacDateInSeconds;
|
||||
ui5b DateDelta = NewRealDate - LastRealDate;
|
||||
uint32_t Seconds = 0;
|
||||
uint32_t NewRealDate = CurMacDateInSeconds;
|
||||
uint32_t DateDelta = NewRealDate - LastRealDate;
|
||||
|
||||
if (DateDelta != 0) {
|
||||
Seconds = (RTC.Seconds_1[3] << 24) + (RTC.Seconds_1[2] << 16)
|
||||
@ -331,7 +331,7 @@ GLOBALPROC RTC_Interrupt(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui3b RTC_Access_PRAM_Reg(ui3b Data, blnr WriteReg, ui3b t)
|
||||
LOCALFUNC uint8_t RTC_Access_PRAM_Reg(uint8_t Data, blnr WriteReg, uint8_t t)
|
||||
{
|
||||
if (WriteReg) {
|
||||
if (! RTC.WrProtect) {
|
||||
@ -346,9 +346,9 @@ LOCALFUNC ui3b RTC_Access_PRAM_Reg(ui3b Data, blnr WriteReg, ui3b t)
|
||||
return Data;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3b RTC_Access_Reg(ui3b Data, blnr WriteReg, ui3b TheCmd)
|
||||
LOCALFUNC uint8_t RTC_Access_Reg(uint8_t Data, blnr WriteReg, uint8_t TheCmd)
|
||||
{
|
||||
ui3b t = (TheCmd & 0x7C) >> 2;
|
||||
uint8_t t = (TheCmd & 0x7C) >> 2;
|
||||
if (t < 8) {
|
||||
if (WriteReg) {
|
||||
if (! RTC.WrProtect) {
|
||||
|
140
src/SCCEMDEV.c
140
src/SCCEMDEV.c
@ -83,7 +83,7 @@ typedef struct {
|
||||
blnr SyncHunt;
|
||||
blnr TxIP; /* Transmit Interrupt Pending */
|
||||
#if EmLocalTalk
|
||||
ui3r RxBuff;
|
||||
uint8_t RxBuff;
|
||||
#endif
|
||||
#if EmLocalTalk
|
||||
/* otherwise TxBufferEmpty always true */
|
||||
@ -136,37 +136,37 @@ typedef struct {
|
||||
blnr SyncChrLdInhb;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r ClockRate;
|
||||
uint8_t ClockRate;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r DataEncoding;
|
||||
uint8_t DataEncoding;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r TRxCsrc;
|
||||
uint8_t TRxCsrc;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r TClkSlct;
|
||||
uint8_t TClkSlct;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r RClkSlct;
|
||||
uint8_t RClkSlct;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r RBitsPerChar;
|
||||
uint8_t RBitsPerChar;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r TBitsPerChar;
|
||||
uint8_t TBitsPerChar;
|
||||
#endif
|
||||
#if EmLocalTalk || SCC_TrackMore
|
||||
ui3r RxIntMode;
|
||||
uint8_t RxIntMode;
|
||||
#endif
|
||||
#if EmLocalTalk || SCC_TrackMore
|
||||
blnr FirstChar;
|
||||
#endif
|
||||
#if EmLocalTalk || SCC_TrackMore
|
||||
ui3r SyncMode;
|
||||
uint8_t SyncMode;
|
||||
#endif
|
||||
#if SCC_TrackMore
|
||||
ui3r StopBits;
|
||||
uint8_t StopBits;
|
||||
#endif
|
||||
#if 0 /* AllSent always true */
|
||||
blnr AllSent;
|
||||
@ -223,8 +223,8 @@ typedef struct {
|
||||
blnr BreakAbortIE;
|
||||
#endif
|
||||
#if SCC_TrackMore /* don't care about Baud */
|
||||
ui3r BaudLo;
|
||||
ui3r BaudHi;
|
||||
uint8_t BaudLo;
|
||||
uint8_t BaudHi;
|
||||
#endif
|
||||
} Channel_Ty;
|
||||
|
||||
@ -232,7 +232,7 @@ typedef struct {
|
||||
Channel_Ty a[2]; /* 0 = channel A, 1 = channel B */
|
||||
int SCC_Interrupt_Type;
|
||||
int PointerBits;
|
||||
ui3b InterruptVector;
|
||||
uint8_t InterruptVector;
|
||||
blnr MIE; /* master interrupt enable */
|
||||
#if SCC_TrackMore
|
||||
blnr NoVectorSlct;
|
||||
@ -315,7 +315,7 @@ LOCALPROC CheckSCCInterruptFlag(void)
|
||||
#endif
|
||||
;
|
||||
#endif
|
||||
ui3b NewSCCInterruptRequest;
|
||||
uint8_t NewSCCInterruptRequest;
|
||||
|
||||
#if EmLocalTalk
|
||||
blnr ReceiveBInterrupt = falseblnr;
|
||||
@ -593,8 +593,8 @@ GLOBALPROC SCC_Reset(void)
|
||||
#if EmLocalTalk
|
||||
|
||||
LOCALVAR blnr CTSpacketPending = falseblnr;
|
||||
LOCALVAR ui3r CTSpacketRxDA;
|
||||
LOCALVAR ui3r CTSpacketRxSA;
|
||||
LOCALVAR uint8_t CTSpacketRxDA;
|
||||
LOCALVAR uint8_t CTSpacketRxSA;
|
||||
|
||||
/*
|
||||
Function used when all the tx data is sent to the SCC as indicated
|
||||
@ -631,7 +631,7 @@ LOCALPROC process_transmit(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_TxBuffPut(ui3r Data)
|
||||
LOCALPROC SCC_TxBuffPut(uint8_t Data)
|
||||
{
|
||||
/* Buffer the data in the transmit buffer */
|
||||
if (LT_TxBuffSz < LT_TxBfMxSz) {
|
||||
@ -640,7 +640,7 @@ LOCALPROC SCC_TxBuffPut(ui3r Data)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui3b MyCTSBuffer[4];
|
||||
LOCALVAR uint8_t MyCTSBuffer[4];
|
||||
|
||||
LOCALPROC GetCTSpacket(void)
|
||||
{
|
||||
@ -689,7 +689,7 @@ LOCALPROC rx_complete(void)
|
||||
|
||||
LOCALPROC SCC_RxBuffAdvance(void)
|
||||
{
|
||||
ui3r value;
|
||||
uint8_t value;
|
||||
|
||||
/*
|
||||
From the manual:
|
||||
@ -705,7 +705,7 @@ LOCALPROC SCC_RxBuffAdvance(void)
|
||||
if (rx_data_offset < LT_RxBuffSz) {
|
||||
value = LT_RxBuffer[rx_data_offset];
|
||||
} else {
|
||||
ui5r i = rx_data_offset - LT_RxBuffSz;
|
||||
uint32_t i = rx_data_offset - LT_RxBuffSz;
|
||||
|
||||
/* if i==0 in first byte of CRC, have not got EOF yet */
|
||||
if (i == 1) {
|
||||
@ -721,7 +721,7 @@ LOCALPROC SCC_RxBuffAdvance(void)
|
||||
}
|
||||
|
||||
/* LLAP/SDLC address */
|
||||
LOCALVAR ui3b my_node_address = 0;
|
||||
LOCALVAR uint8_t my_node_address = 0;
|
||||
|
||||
LOCALPROC GetNextPacketForMe(void)
|
||||
{
|
||||
@ -934,7 +934,7 @@ LOCALPROC SCC_DbgLogChanStartLine(int chan)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR0(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR0(int chan)
|
||||
{
|
||||
/* happens on boot always */
|
||||
|
||||
@ -966,11 +966,11 @@ LOCALFUNC ui3r SCC_GetRR0(int chan)
|
||||
;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR1(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR1(int chan)
|
||||
{
|
||||
/* happens in MacCheck */
|
||||
|
||||
ui3r value;
|
||||
uint8_t value;
|
||||
#if ! EmLocalTalk
|
||||
UnusedParam(chan);
|
||||
#endif
|
||||
@ -999,12 +999,12 @@ LOCALFUNC ui3r SCC_GetRR1(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR2(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR2(int chan)
|
||||
{
|
||||
/* happens in MacCheck */
|
||||
/* happens in Print to ImageWriter */
|
||||
|
||||
ui3r value = SCC.InterruptVector;
|
||||
uint8_t value = SCC.InterruptVector;
|
||||
|
||||
if (chan != 0) { /* B Channel */
|
||||
#if 0 /* StatusHiLo always false */
|
||||
@ -1103,9 +1103,9 @@ LOCALFUNC ui3r SCC_GetRR2(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR3(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR3(int chan)
|
||||
{
|
||||
ui3r value = 0;
|
||||
uint8_t value = 0;
|
||||
|
||||
UnusedParam(chan);
|
||||
ReportAbnormalID(0x0706, "RR 3");
|
||||
@ -1124,9 +1124,9 @@ LOCALFUNC ui3r SCC_GetRR3(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR8(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR8(int chan)
|
||||
{
|
||||
ui3r value = 0;
|
||||
uint8_t value = 0;
|
||||
|
||||
/* Receive Buffer */
|
||||
/* happens on boot with appletalk on */
|
||||
@ -1160,11 +1160,11 @@ LOCALFUNC ui3r SCC_GetRR8(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR10(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR10(int chan)
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
|
||||
ui3r value = 0;
|
||||
uint8_t value = 0;
|
||||
UnusedParam(chan);
|
||||
|
||||
#if 0 && EmLocalTalk
|
||||
@ -1174,9 +1174,9 @@ LOCALFUNC ui3r SCC_GetRR10(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR12(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR12(int chan)
|
||||
{
|
||||
ui3r value = 0;
|
||||
uint8_t value = 0;
|
||||
|
||||
#if ! SCC_TrackMore
|
||||
UnusedParam(chan);
|
||||
@ -1190,9 +1190,9 @@ LOCALFUNC ui3r SCC_GetRR12(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR13(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR13(int chan)
|
||||
{
|
||||
ui3r value = 0;
|
||||
uint8_t value = 0;
|
||||
|
||||
#if ! SCC_TrackMore
|
||||
UnusedParam(chan);
|
||||
@ -1206,9 +1206,9 @@ LOCALFUNC ui3r SCC_GetRR13(int chan)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetRR15(int chan)
|
||||
LOCALFUNC uint8_t SCC_GetRR15(int chan)
|
||||
{
|
||||
ui3r value = 0;
|
||||
uint8_t value = 0;
|
||||
|
||||
UnusedParam(chan);
|
||||
ReportAbnormalID(0x070A, "RR 15");
|
||||
@ -1261,7 +1261,7 @@ LOCALPROC SCC_DbgLogChanChngBit(int chan, char *s, blnr v)
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALPROC SCC_PutWR0(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR0(uint8_t Data, int chan)
|
||||
/*
|
||||
"CRC initialize, initialization commands for the various modes,
|
||||
Register Pointers"
|
||||
@ -1396,7 +1396,7 @@ LOCALPROC SCC_PutWR0(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR1(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR1(uint8_t Data, int chan)
|
||||
/*
|
||||
"Transmit/Receive interrupt and data transfer mode definition"
|
||||
*/
|
||||
@ -1451,7 +1451,7 @@ LOCALPROC SCC_PutWR1(ui3r Data, int chan)
|
||||
|
||||
#if EmLocalTalk || SCC_TrackMore
|
||||
{
|
||||
ui3r NewRxIntMode = (Data >> 3) & 3;
|
||||
uint8_t NewRxIntMode = (Data >> 3) & 3;
|
||||
if (SCC.a[chan].RxIntMode != NewRxIntMode) {
|
||||
SCC.a[chan].RxIntMode = NewRxIntMode;
|
||||
|
||||
@ -1533,7 +1533,7 @@ LOCALPROC SCC_PutWR1(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR2(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR2(uint8_t Data, int chan)
|
||||
/* "Interrupt Vector (accessed through either channel)" */
|
||||
{
|
||||
/*
|
||||
@ -1583,12 +1583,12 @@ LOCALPROC SCC_PutWR2(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR3(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR3(uint8_t Data, int chan)
|
||||
/* "Receive parameters and control" */
|
||||
{
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewRBitsPerChar = (Data >> 6) & 3;
|
||||
uint8_t NewRBitsPerChar = (Data >> 6) & 3;
|
||||
if (SCC.a[chan].RBitsPerChar != NewRBitsPerChar) {
|
||||
SCC.a[chan].RBitsPerChar = NewRBitsPerChar;
|
||||
|
||||
@ -1725,7 +1725,7 @@ LOCALPROC SCC_PutWR3(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR4(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR4(uint8_t Data, int chan)
|
||||
/* "Transmit/Receive miscellaneous parameters and modes" */
|
||||
{
|
||||
#if ! (EmLocalTalk || SCC_TrackMore)
|
||||
@ -1761,7 +1761,7 @@ LOCALPROC SCC_PutWR4(ui3r Data, int chan)
|
||||
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewStopBits = (Data >> 2) & 3;
|
||||
uint8_t NewStopBits = (Data >> 2) & 3;
|
||||
if (SCC.a[chan].StopBits != NewStopBits) {
|
||||
SCC.a[chan].StopBits = NewStopBits;
|
||||
|
||||
@ -1795,7 +1795,7 @@ LOCALPROC SCC_PutWR4(ui3r Data, int chan)
|
||||
|
||||
#if EmLocalTalk || SCC_TrackMore
|
||||
{
|
||||
ui3r NewSyncMode = (Data >> 4) & 3;
|
||||
uint8_t NewSyncMode = (Data >> 4) & 3;
|
||||
if (SCC.a[chan].SyncMode != NewSyncMode) {
|
||||
SCC.a[chan].SyncMode = NewSyncMode;
|
||||
|
||||
@ -1828,7 +1828,7 @@ LOCALPROC SCC_PutWR4(ui3r Data, int chan)
|
||||
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewClockRate = (Data >> 6) & 3;
|
||||
uint8_t NewClockRate = (Data >> 6) & 3;
|
||||
if (SCC.a[chan].ClockRate != NewClockRate) {
|
||||
SCC.a[chan].ClockRate = NewClockRate;
|
||||
|
||||
@ -1859,7 +1859,7 @@ LOCALPROC SCC_PutWR4(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR5(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR5(uint8_t Data, int chan)
|
||||
/* "Transmit parameters and controls" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -1940,7 +1940,7 @@ LOCALPROC SCC_PutWR5(ui3r Data, int chan)
|
||||
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewTBitsPerChar = (Data >> 5) & 3;
|
||||
uint8_t NewTBitsPerChar = (Data >> 5) & 3;
|
||||
if (SCC.a[chan].TBitsPerChar != NewTBitsPerChar) {
|
||||
SCC.a[chan].TBitsPerChar = NewTBitsPerChar;
|
||||
|
||||
@ -1986,7 +1986,7 @@ LOCALPROC SCC_PutWR5(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR6(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR6(uint8_t Data, int chan)
|
||||
/* "Sync characters or SDLC address field" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2012,7 +2012,7 @@ LOCALPROC SCC_PutWR6(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR7(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR7(uint8_t Data, int chan)
|
||||
/* "Sync character or SDLC flag" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2034,7 +2034,7 @@ LOCALPROC SCC_PutWR7(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR8(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR8(uint8_t Data, int chan)
|
||||
/* "Transmit Buffer" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2081,7 +2081,7 @@ LOCALPROC SCC_PutWR8(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR9(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR9(uint8_t Data, int chan)
|
||||
/*
|
||||
"Master interrupt control and reset
|
||||
(accessed through either channel)"
|
||||
@ -2172,7 +2172,7 @@ LOCALPROC SCC_PutWR9(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR10(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR10(uint8_t Data, int chan)
|
||||
/* "Miscellaneous transmitter/receiver control bits" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2200,7 +2200,7 @@ LOCALPROC SCC_PutWR10(ui3r Data, int chan)
|
||||
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewDataEncoding = (Data >> 5) & 3;
|
||||
uint8_t NewDataEncoding = (Data >> 5) & 3;
|
||||
if (SCC.a[chan].DataEncoding != NewDataEncoding) {
|
||||
SCC.a[chan].DataEncoding = NewDataEncoding;
|
||||
|
||||
@ -2247,7 +2247,7 @@ LOCALPROC SCC_PutWR10(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR11(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR11(uint8_t Data, int chan)
|
||||
/* "Clock mode control" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2261,7 +2261,7 @@ LOCALPROC SCC_PutWR11(ui3r Data, int chan)
|
||||
#if SCC_TrackMore
|
||||
/* Transmit External Control Selection */
|
||||
{
|
||||
ui3r NewTRxCsrc = Data & 3;
|
||||
uint8_t NewTRxCsrc = Data & 3;
|
||||
if (SCC.a[chan].TRxCsrc != NewTRxCsrc) {
|
||||
SCC.a[chan].TRxCsrc = NewTRxCsrc;
|
||||
|
||||
@ -2297,7 +2297,7 @@ LOCALPROC SCC_PutWR11(ui3r Data, int chan)
|
||||
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewTClkSlct = (Data >> 3) & 3;
|
||||
uint8_t NewTClkSlct = (Data >> 3) & 3;
|
||||
if (SCC.a[chan].TClkSlct != NewTClkSlct) {
|
||||
SCC.a[chan].TClkSlct = NewTClkSlct;
|
||||
|
||||
@ -2333,7 +2333,7 @@ LOCALPROC SCC_PutWR11(ui3r Data, int chan)
|
||||
|
||||
#if SCC_TrackMore
|
||||
{
|
||||
ui3r NewRClkSlct = (Data >> 5) & 3;
|
||||
uint8_t NewRClkSlct = (Data >> 5) & 3;
|
||||
if (SCC.a[chan].RClkSlct != NewRClkSlct) {
|
||||
SCC.a[chan].RClkSlct = NewRClkSlct;
|
||||
|
||||
@ -2374,7 +2374,7 @@ LOCALPROC SCC_PutWR11(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR12(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR12(uint8_t Data, int chan)
|
||||
/* "Lower byte of baud rate generator time constant" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2412,7 +2412,7 @@ LOCALPROC SCC_PutWR12(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR13(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR13(uint8_t Data, int chan)
|
||||
/* "Upper byte of baud rate generator time constant" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2442,7 +2442,7 @@ LOCALPROC SCC_PutWR13(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR14(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR14(uint8_t Data, int chan)
|
||||
/* "Miscellaneous control bits" */
|
||||
{
|
||||
/* happens on boot with appletalk on */
|
||||
@ -2526,7 +2526,7 @@ LOCALPROC SCC_PutWR14(ui3r Data, int chan)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutWR15(ui3r Data, int chan)
|
||||
LOCALPROC SCC_PutWR15(uint8_t Data, int chan)
|
||||
/* "External/Status interrupt control" */
|
||||
{
|
||||
/* happens on boot always */
|
||||
@ -2601,9 +2601,9 @@ LOCALPROC SCC_PutWR15(ui3r Data, int chan)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALFUNC ui3r SCC_GetReg(int chan, ui3r SCC_Reg)
|
||||
LOCALFUNC uint8_t SCC_GetReg(int chan, uint8_t SCC_Reg)
|
||||
{
|
||||
ui3r value;
|
||||
uint8_t value;
|
||||
|
||||
switch (SCC_Reg) {
|
||||
case 0:
|
||||
@ -2688,7 +2688,7 @@ LOCALFUNC ui3r SCC_GetReg(int chan, ui3r SCC_Reg)
|
||||
return value;
|
||||
}
|
||||
|
||||
LOCALPROC SCC_PutReg(ui3r Data, int chan, ui3r SCC_Reg)
|
||||
LOCALPROC SCC_PutReg(uint8_t Data, int chan, uint8_t SCC_Reg)
|
||||
{
|
||||
#if SCC_dolog && 0
|
||||
SCC_DbgLogChanStartLine(chan);
|
||||
@ -2763,7 +2763,7 @@ LOCALPROC SCC_PutReg(ui3r Data, int chan, ui3r SCC_Reg)
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBALFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
GLOBALFUNC uint32_t SCC_Access(uint32_t Data, blnr WriteMem, CPTR addr)
|
||||
{
|
||||
#if EmLocalTalk
|
||||
/*
|
||||
@ -2781,7 +2781,7 @@ GLOBALFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
a21 wr/rd
|
||||
*/
|
||||
#endif
|
||||
ui3b SCC_Reg;
|
||||
uint8_t SCC_Reg;
|
||||
int chan = (~ addr) & 1; /* 0=modem, 1=printer */
|
||||
if (((addr >> 1) & 1) == 0) {
|
||||
/* Channel Control */
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
EXPORTPROC SCC_Reset(void);
|
||||
|
||||
EXPORTFUNC ui5b SCC_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTFUNC uint32_t SCC_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
|
||||
EXPORTFUNC blnr SCC_InterruptsEnabled(void);
|
||||
|
||||
|
@ -61,13 +61,13 @@
|
||||
(ScrnMapr_Scale << (ScrnMapr_DstDepth - ScrnMapr_SrcDepth))
|
||||
|
||||
#if 0 == (ScrnMapr_MapElSz & 3)
|
||||
#define ScrnMapr_TranT ui5b
|
||||
#define ScrnMapr_TranT uint32_t
|
||||
#define ScrnMapr_TranLn2Sz 2
|
||||
#elif 0 == (ScrnMapr_MapElSz & 1)
|
||||
#define ScrnMapr_TranT ui4b
|
||||
#define ScrnMapr_TranT uint16_t
|
||||
#define ScrnMapr_TranLn2Sz 1
|
||||
#else
|
||||
#define ScrnMapr_TranT ui3b
|
||||
#define ScrnMapr_TranT uint8_t
|
||||
#define ScrnMapr_TranLn2Sz 0
|
||||
#endif
|
||||
|
||||
@ -77,31 +77,31 @@
|
||||
|
||||
/* now define the procedure */
|
||||
|
||||
LOCALPROC ScrnMapr_DoMap(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC ScrnMapr_DoMap(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
#if (ScrnMapr_TranN > 4) || (ScrnMapr_Scale > 2)
|
||||
int k;
|
||||
#endif
|
||||
ui5r t0;
|
||||
uint32_t t0;
|
||||
ScrnMapr_TranT *pMap;
|
||||
#if ScrnMapr_Scale > 1
|
||||
ScrnMapr_TranT *p3;
|
||||
#endif
|
||||
|
||||
ui4r leftB = left >> (3 - ScrnMapr_SrcDepth);
|
||||
ui4r rightB = (right + (1 << (3 - ScrnMapr_SrcDepth)) - 1)
|
||||
uint16_t leftB = left >> (3 - ScrnMapr_SrcDepth);
|
||||
uint16_t rightB = (right + (1 << (3 - ScrnMapr_SrcDepth)) - 1)
|
||||
>> (3 - ScrnMapr_SrcDepth);
|
||||
ui4r jn = rightB - leftB;
|
||||
ui4r SrcSkip = ScrnMapr_ScrnWB - jn;
|
||||
ui3b *pSrc = ((ui3b *)ScrnMapr_Src)
|
||||
+ leftB + ScrnMapr_ScrnWB * (ui5r)top;
|
||||
uint16_t jn = rightB - leftB;
|
||||
uint16_t SrcSkip = ScrnMapr_ScrnWB - jn;
|
||||
uint8_t *pSrc = ((uint8_t *)ScrnMapr_Src)
|
||||
+ leftB + ScrnMapr_ScrnWB * (uint32_t)top;
|
||||
ScrnMapr_TranT *pDst = ((ScrnMapr_TranT *)ScrnMapr_Dst)
|
||||
+ ((leftB + ScrnMapr_ScrnWB * ScrnMapr_Scale * (ui5r)top)
|
||||
+ ((leftB + ScrnMapr_ScrnWB * ScrnMapr_Scale * (uint32_t)top)
|
||||
* ScrnMapr_TranN);
|
||||
ui5r DstSkip = SrcSkip * ScrnMapr_TranN;
|
||||
uint32_t DstSkip = SrcSkip * ScrnMapr_TranN;
|
||||
|
||||
for (i = bottom - top; --i >= 0; ) {
|
||||
#if ScrnMapr_Scale > 1
|
||||
|
@ -58,27 +58,27 @@
|
||||
|
||||
/* now define the procedure */
|
||||
|
||||
LOCALPROC ScrnTrns_DoTrans(si4b top, si4b left,
|
||||
si4b bottom, si4b right)
|
||||
LOCALPROC ScrnTrns_DoTrans(int16_t top, int16_t left,
|
||||
int16_t bottom, int16_t right)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
ui5b t0;
|
||||
ui5b t1;
|
||||
ui4r jn = right - left;
|
||||
ui4r SrcSkip = vMacScreenByteWidth
|
||||
uint32_t t0;
|
||||
uint32_t t1;
|
||||
uint16_t jn = right - left;
|
||||
uint16_t SrcSkip = vMacScreenByteWidth
|
||||
- (jn << (ScrnTrns_SrcDepth - 3));
|
||||
ui3b *pSrc = ((ui3b *)ScrnTrns_Src)
|
||||
uint8_t *pSrc = ((uint8_t *)ScrnTrns_Src)
|
||||
+ (left << (ScrnTrns_SrcDepth - 3))
|
||||
+ vMacScreenByteWidth * (ui5r)top;
|
||||
ui5b *pDst = ((ui5b *)ScrnTrns_Dst)
|
||||
+ vMacScreenByteWidth * (uint32_t)top;
|
||||
uint32_t *pDst = ((uint32_t *)ScrnTrns_Dst)
|
||||
+ left * ScrnTrns_Scale
|
||||
+ (ui5r)vMacScreenWidth * ScrnTrns_Scale * ScrnTrns_Scale * top;
|
||||
ui4r DstSkip = (vMacScreenWidth - jn) * ScrnTrns_Scale;
|
||||
+ (uint32_t)vMacScreenWidth * ScrnTrns_Scale * ScrnTrns_Scale * top;
|
||||
uint16_t DstSkip = (vMacScreenWidth - jn) * ScrnTrns_Scale;
|
||||
#if ScrnTrns_Scale > 1
|
||||
int k;
|
||||
ui5b *p3;
|
||||
ui5b *p4;
|
||||
uint32_t *p3;
|
||||
uint32_t *p4;
|
||||
#endif
|
||||
|
||||
for (i = bottom - top; --i >= 0; ) {
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
#define kSCSI_Size 0x00010
|
||||
|
||||
LOCALVAR ui3b SCSI[kSCSI_Size];
|
||||
LOCALVAR uint8_t SCSI[kSCSI_Size];
|
||||
|
||||
GLOBALPROC SCSI_Reset(void)
|
||||
{
|
||||
@ -141,7 +141,7 @@ LOCALPROC SCSI_Check(void)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALFUNC ui5b SCSI_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
GLOBALFUNC uint32_t SCSI_Access(uint32_t Data, blnr WriteMem, CPTR addr)
|
||||
{
|
||||
if (addr < (kSCSI_Size / 2)) {
|
||||
addr *= 2;
|
||||
|
@ -22,4 +22,4 @@
|
||||
|
||||
EXPORTPROC SCSI_Reset(void);
|
||||
|
||||
EXPORTFUNC ui5b SCSI_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTFUNC uint32_t SCSI_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
|
@ -1259,8 +1259,8 @@ label_retry:
|
||||
My_snd_strerror(avail));
|
||||
} else {
|
||||
tpSoundSamp NextPlayPtr;
|
||||
ui4b PlayNowSize = 0;
|
||||
ui4b MaskedFillOffset = ThePlayOffset & kOneBuffMask;
|
||||
uint16_t PlayNowSize = 0;
|
||||
uint16_t MaskedFillOffset = ThePlayOffset & kOneBuffMask;
|
||||
|
||||
#if RaspbianWorkAround
|
||||
if ((avail > buffer_size) || (avail < 0)) {
|
||||
@ -1279,7 +1279,7 @@ label_retry:
|
||||
|
||||
if (! MySound_StartPend) {
|
||||
My_snd_pcm_uframes_t used = buffer_size - avail;
|
||||
ui4b TotPendBuffs = used >> kLnOneBuffLen;
|
||||
uint16_t TotPendBuffs = used >> kLnOneBuffLen;
|
||||
|
||||
if (TotPendBuffs < MinFilledSoundBuffs) {
|
||||
MinFilledSoundBuffs = TotPendBuffs;
|
||||
@ -1597,7 +1597,7 @@ LOCALPROC MySound_UnInit(void)
|
||||
MyCloseAlsaLib();
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
ConvertSoundBlockToNative(TheSoundBuffer
|
||||
|
@ -48,13 +48,13 @@ label_retry:
|
||||
fprintf(stderr, "SNDCTL_DSP_GETOSPACE fails\n");
|
||||
} else {
|
||||
tpSoundSamp NextPlayPtr;
|
||||
ui4b PlayNowSize = 0;
|
||||
ui4b MaskedFillOffset = ThePlayOffset & kOneBuffMask;
|
||||
ui4b PrivateBuffUsed = TheFillOffset - ThePlayOffset;
|
||||
uint16_t PlayNowSize = 0;
|
||||
uint16_t MaskedFillOffset = ThePlayOffset & kOneBuffMask;
|
||||
uint16_t PrivateBuffUsed = TheFillOffset - ThePlayOffset;
|
||||
int used = (info.fragstotal * info.fragsize) - info.bytes;
|
||||
|
||||
if (audio_started) {
|
||||
ui4b TotPendBuffs = used >> kLnOneBuffSz;
|
||||
uint16_t TotPendBuffs = used >> kLnOneBuffSz;
|
||||
|
||||
if (TotPendBuffs < MinFilledSoundBuffs) {
|
||||
MinFilledSoundBuffs = TotPendBuffs;
|
||||
@ -209,7 +209,7 @@ LOCALPROC MySound_UnInit(void)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALOSGLUPROC MySound_EndWrite(ui4r actL)
|
||||
GLOBALOSGLUPROC MySound_EndWrite(uint16_t actL)
|
||||
{
|
||||
if (MySound_EndWrite0(actL)) {
|
||||
ConvertSoundBlockToNative(TheSoundBuffer
|
||||
|
@ -50,7 +50,7 @@
|
||||
= {approx} (x - kCenterSound) / (8 - SoundVolume) + kCenterSound;
|
||||
*/
|
||||
|
||||
LOCALVAR const ui4b vol_mult[] = {
|
||||
LOCALVAR const uint16_t vol_mult[] = {
|
||||
8192, 9362, 10922, 13107, 16384, 21845, 32768
|
||||
};
|
||||
|
||||
@ -64,12 +64,12 @@ LOCALVAR const trSoundSamp vol_offset[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
LOCALVAR const ui4b SubTick_offset[kNumSubTicks] = {
|
||||
LOCALVAR const uint16_t SubTick_offset[kNumSubTicks] = {
|
||||
0, 25, 50, 90, 102, 115, 138, 161,
|
||||
185, 208, 231, 254, 277, 300, 323, 346
|
||||
};
|
||||
|
||||
LOCALVAR const ui3r SubTick_n[kNumSubTicks] = {
|
||||
LOCALVAR const uint8_t SubTick_n[kNumSubTicks] = {
|
||||
25, 25, 40, 12, 13, 23, 23, 24,
|
||||
23, 23, 23, 23, 23, 23, 23, 24
|
||||
};
|
||||
@ -99,18 +99,18 @@ LOCALVAR const ui3r SubTick_n[kNumSubTicks] = {
|
||||
writing offset 0 before it is read.
|
||||
*/
|
||||
|
||||
LOCALVAR ui5b SoundInvertPhase = 0;
|
||||
LOCALVAR ui4b SoundInvertState = 0;
|
||||
LOCALVAR uint32_t SoundInvertPhase = 0;
|
||||
LOCALVAR uint16_t SoundInvertState = 0;
|
||||
|
||||
IMPORTFUNC ui4b GetSoundInvertTime(void);
|
||||
IMPORTFUNC uint16_t GetSoundInvertTime(void);
|
||||
|
||||
GLOBALPROC MacSound_SubTick(int SubTick)
|
||||
{
|
||||
ui4r actL;
|
||||
uint16_t actL;
|
||||
tpSoundSamp p;
|
||||
ui4r i;
|
||||
ui5b StartOffset = SubTick_offset[SubTick];
|
||||
ui4r n = SubTick_n[SubTick];
|
||||
uint16_t i;
|
||||
uint32_t StartOffset = SubTick_offset[SubTick];
|
||||
uint16_t n = SubTick_n[SubTick];
|
||||
unsigned long addy =
|
||||
#ifdef SoundBuffer
|
||||
(SoundBuffer == 0) ? kSnd_Alt_Buffer :
|
||||
@ -121,8 +121,8 @@ GLOBALPROC MacSound_SubTick(int SubTick)
|
||||
#else
|
||||
CPTR addr = addy + (2 * StartOffset);
|
||||
#endif
|
||||
ui4b SoundInvertTime = GetSoundInvertTime();
|
||||
ui3b SoundVolume = SoundVolb0
|
||||
uint16_t SoundInvertTime = GetSoundInvertTime();
|
||||
uint8_t SoundVolume = SoundVolb0
|
||||
| (SoundVolb1 << 1)
|
||||
| (SoundVolb2 << 2);
|
||||
|
||||
@ -166,13 +166,13 @@ label_retry:
|
||||
}
|
||||
|
||||
if (SoundInvertTime != 0) {
|
||||
ui5b PhaseIncr = (ui5b)SoundInvertTime * (ui5b)20;
|
||||
uint32_t PhaseIncr = (uint32_t)SoundInvertTime * (uint32_t)20;
|
||||
p -= actL;
|
||||
|
||||
for (i = 0; i < actL; i++) {
|
||||
if (SoundInvertPhase < 704) {
|
||||
ui5b OnPortion = 0;
|
||||
ui5b LastPhase = 0;
|
||||
uint32_t OnPortion = 0;
|
||||
uint32_t LastPhase = 0;
|
||||
do {
|
||||
if (! SoundInvertState) {
|
||||
OnPortion +=
|
||||
@ -202,12 +202,12 @@ label_retry:
|
||||
Usually have volume at 7, so this
|
||||
is just for completeness.
|
||||
*/
|
||||
ui5b mult = (ui5b)vol_mult[SoundVolume];
|
||||
uint32_t mult = (uint32_t)vol_mult[SoundVolume];
|
||||
trSoundSamp offset = vol_offset[SoundVolume];
|
||||
|
||||
p -= actL;
|
||||
for (i = 0; i < actL; i++) {
|
||||
*p = (trSoundSamp)((ui5b)(*p) * mult >> 16) + offset;
|
||||
*p = (trSoundSamp)((uint32_t)(*p) * mult >> 16) + offset;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
|
196
src/SONYEMDV.c
196
src/SONYEMDV.c
@ -44,21 +44,21 @@
|
||||
*/
|
||||
|
||||
|
||||
LOCALVAR ui5b vSonyMountedMask = 0;
|
||||
LOCALVAR uint32_t vSonyMountedMask = 0;
|
||||
|
||||
#define vSonyIsLocked(Drive_No) \
|
||||
((vSonyWritableMask & ((ui5b)1 << (Drive_No))) == 0)
|
||||
((vSonyWritableMask & ((uint32_t)1 << (Drive_No))) == 0)
|
||||
#define vSonyIsMounted(Drive_No) \
|
||||
((vSonyMountedMask & ((ui5b)1 << (Drive_No))) != 0)
|
||||
((vSonyMountedMask & ((uint32_t)1 << (Drive_No))) != 0)
|
||||
|
||||
LOCALFUNC blnr vSonyNextPendingInsert0(tDrive *Drive_No)
|
||||
{
|
||||
/* find next drive to Mount */
|
||||
ui5b MountPending = vSonyInsertedMask & (~ vSonyMountedMask);
|
||||
uint32_t MountPending = vSonyInsertedMask & (~ vSonyMountedMask);
|
||||
if (MountPending != 0) {
|
||||
tDrive i;
|
||||
for (i = 0; i < NumDrives; ++i) {
|
||||
if ((MountPending & ((ui5b)1 << i)) != 0) {
|
||||
if ((MountPending & ((uint32_t)1 << i)) != 0) {
|
||||
*Drive_No = i;
|
||||
return trueblnr; /* only one disk at a time */
|
||||
}
|
||||
@ -85,7 +85,7 @@ LOCALFUNC tMacErr CheckReadableDrive(tDrive Drive_No)
|
||||
|
||||
LOCALFUNC tMacErr vSonyTransferVM(blnr IsWrite,
|
||||
CPTR Buffera, tDrive Drive_No,
|
||||
ui5r Sony_Start, ui5r Sony_Count, ui5r *Sony_ActCount)
|
||||
uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *Sony_ActCount)
|
||||
{
|
||||
/*
|
||||
Transfer data between emulated disk and emulated memory. Taking
|
||||
@ -93,11 +93,11 @@ LOCALFUNC tMacErr vSonyTransferVM(blnr IsWrite,
|
||||
real memory. (Though it generally is for macintosh emulation.)
|
||||
*/
|
||||
tMacErr result;
|
||||
ui5b contig;
|
||||
ui5r actual;
|
||||
uint32_t contig;
|
||||
uint32_t actual;
|
||||
ui3p Buffer;
|
||||
ui5r offset = Sony_Start;
|
||||
ui5r n = Sony_Count;
|
||||
uint32_t offset = Sony_Start;
|
||||
uint32_t n = Sony_Count;
|
||||
|
||||
label_1:
|
||||
if (0 == n) {
|
||||
@ -124,13 +124,13 @@ label_1:
|
||||
return result;
|
||||
}
|
||||
|
||||
LOCALPROC MyMoveBytesVM(CPTR srcPtr, CPTR dstPtr, si5b byteCount)
|
||||
LOCALPROC MyMoveBytesVM(CPTR srcPtr, CPTR dstPtr, int32_t byteCount)
|
||||
{
|
||||
ui3p src;
|
||||
ui3p dst;
|
||||
ui5b contigSrc;
|
||||
ui5b contigDst;
|
||||
ui5r contig;
|
||||
uint32_t contigSrc;
|
||||
uint32_t contigDst;
|
||||
uint32_t contig;
|
||||
|
||||
label_1:
|
||||
if (0 != byteCount) {
|
||||
@ -151,13 +151,13 @@ label_1:
|
||||
}
|
||||
}
|
||||
|
||||
LOCALVAR ui5r ImageDataOffset[NumDrives];
|
||||
LOCALVAR uint32_t ImageDataOffset[NumDrives];
|
||||
/* size of any header in disk image file */
|
||||
LOCALVAR ui5r ImageDataSize[NumDrives];
|
||||
LOCALVAR uint32_t ImageDataSize[NumDrives];
|
||||
/* size of disk image file contents */
|
||||
|
||||
#if Sony_SupportTags
|
||||
LOCALVAR ui5r ImageTagOffset[NumDrives];
|
||||
LOCALVAR uint32_t ImageTagOffset[NumDrives];
|
||||
/* offset to disk image file tags */
|
||||
#endif
|
||||
|
||||
@ -177,15 +177,15 @@ LOCALVAR ui5r ImageTagOffset[NumDrives];
|
||||
|
||||
#if Sony_SupportDC42 && Sony_WantChecksumsUpdated
|
||||
LOCALFUNC tMacErr DC42BlockChecksum(tDrive Drive_No,
|
||||
ui5r Sony_Start, ui5r Sony_Count, ui5r *r)
|
||||
uint32_t Sony_Start, uint32_t Sony_Count, uint32_t *r)
|
||||
{
|
||||
tMacErr result;
|
||||
ui5r n;
|
||||
ui3b Buffer[ChecksumBlockSize];
|
||||
ui3b *p;
|
||||
ui5b sum = 0;
|
||||
ui5r offset = Sony_Start;
|
||||
ui5r remaining = Sony_Count;
|
||||
uint32_t n;
|
||||
uint8_t Buffer[ChecksumBlockSize];
|
||||
uint8_t *p;
|
||||
uint32_t sum = 0;
|
||||
uint32_t offset = Sony_Start;
|
||||
uint32_t remaining = Sony_Count;
|
||||
|
||||
while (0 != remaining) {
|
||||
/* read a block */
|
||||
@ -233,15 +233,15 @@ LOCALFUNC tMacErr DC42BlockChecksum(tDrive Drive_No,
|
||||
LOCALPROC Drive_UpdateChecksums(tDrive Drive_No)
|
||||
{
|
||||
if (! vSonyIsLocked(Drive_No)) {
|
||||
ui5r DataOffset = ImageDataOffset[Drive_No];
|
||||
uint32_t DataOffset = ImageDataOffset[Drive_No];
|
||||
#if Sony_SupportDC42
|
||||
if (kDC42offset_userData == DataOffset) {
|
||||
/* a disk copy 4.2 image */
|
||||
tMacErr result;
|
||||
ui5r dataChecksum;
|
||||
ui3b Buffer[SizeCheckSumsToUpdate];
|
||||
ui5r Sony_Count = SizeCheckSumsToUpdate;
|
||||
ui5r DataSize = ImageDataSize[Drive_No];
|
||||
uint32_t dataChecksum;
|
||||
uint8_t Buffer[SizeCheckSumsToUpdate];
|
||||
uint32_t Sony_Count = SizeCheckSumsToUpdate;
|
||||
uint32_t DataSize = ImageDataSize[Drive_No];
|
||||
|
||||
/* Checksum image data */
|
||||
result = DC42BlockChecksum(Drive_No,
|
||||
@ -253,9 +253,9 @@ LOCALPROC Drive_UpdateChecksums(tDrive Drive_No)
|
||||
do_put_mem_long(Buffer, dataChecksum);
|
||||
#if Sony_SupportTags
|
||||
{
|
||||
ui5r tagChecksum;
|
||||
ui5r TagOffset = ImageTagOffset[Drive_No];
|
||||
ui5r TagSize =
|
||||
uint32_t tagChecksum;
|
||||
uint32_t TagOffset = ImageTagOffset[Drive_No];
|
||||
uint32_t TagSize =
|
||||
(0 == TagOffset) ? 0 : ((DataSize >> 9) * 12);
|
||||
if (TagSize < 12) {
|
||||
tagChecksum = 0;
|
||||
@ -295,7 +295,7 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No)
|
||||
{
|
||||
tDrive i;
|
||||
tMacErr result;
|
||||
ui5r L;
|
||||
uint32_t L;
|
||||
|
||||
if (! vSonyNextPendingInsert0(&i)) {
|
||||
result = mnvm_nsDrvErr;
|
||||
@ -303,10 +303,10 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No)
|
||||
result = vSonyGetSize(i, &L);
|
||||
if (mnvm_noErr == result) {
|
||||
/* first, set up for default format */
|
||||
ui5r DataOffset = 0;
|
||||
ui5r DataSize = L;
|
||||
uint32_t DataOffset = 0;
|
||||
uint32_t DataSize = L;
|
||||
#if Sony_SupportTags
|
||||
ui5r TagOffset = 0;
|
||||
uint32_t TagOffset = 0;
|
||||
#endif
|
||||
|
||||
#if Sony_SupportOtherFormats
|
||||
@ -314,12 +314,12 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No)
|
||||
if (! vSonyRawMode)
|
||||
#endif
|
||||
{
|
||||
ui5r DataOffset0;
|
||||
ui5r DataSize0;
|
||||
ui5r TagOffset0;
|
||||
ui5r TagSize0;
|
||||
ui3b Temp[checkheadersize];
|
||||
ui5r Sony_Count = checkheadersize;
|
||||
uint32_t DataOffset0;
|
||||
uint32_t DataSize0;
|
||||
uint32_t TagOffset0;
|
||||
uint32_t TagSize0;
|
||||
uint8_t Temp[checkheadersize];
|
||||
uint32_t Sony_Count = checkheadersize;
|
||||
blnr gotFormat = falseblnr;
|
||||
|
||||
result = vSonyTransfer(falseblnr, Temp, i,
|
||||
@ -354,11 +354,11 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No)
|
||||
}
|
||||
if (gotFormat) {
|
||||
#if Sony_VerifyChecksums /* mostly useful to check the Checksum code */
|
||||
ui5r dataChecksum;
|
||||
ui5r tagChecksum;
|
||||
ui5r dataChecksum0 = do_get_mem_long(
|
||||
uint32_t dataChecksum;
|
||||
uint32_t tagChecksum;
|
||||
uint32_t dataChecksum0 = do_get_mem_long(
|
||||
&Temp[kDC42offset_dataChecksum]);
|
||||
ui5r tagChecksum0 = do_get_mem_long(
|
||||
uint32_t tagChecksum0 = do_get_mem_long(
|
||||
&Temp[kDC42offset_tagChecksum]);
|
||||
result = DC42BlockChecksum(i,
|
||||
DataOffset0, DataSize0,
|
||||
@ -407,7 +407,7 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No)
|
||||
if (mnvm_noErr == result)
|
||||
#endif /* Sony_SupportOtherFormats */
|
||||
{
|
||||
vSonyMountedMask |= ((ui5b)1 << i);
|
||||
vSonyMountedMask |= ((uint32_t)1 << i);
|
||||
|
||||
ImageDataOffset[i] = DataOffset;
|
||||
ImageDataSize[i] = DataSize;
|
||||
@ -432,7 +432,7 @@ LOCALFUNC tMacErr vSonyNextPendingInsert(tDrive *Drive_No)
|
||||
if call PostEvent too frequently, insert events seem to get lost
|
||||
*/
|
||||
|
||||
LOCALVAR ui4r DelayUntilNextInsert;
|
||||
LOCALVAR uint16_t DelayUntilNextInsert;
|
||||
|
||||
LOCALVAR CPTR MountCallBack = 0;
|
||||
|
||||
@ -446,10 +446,10 @@ GLOBALPROC Sony_Update (void)
|
||||
tDrive i;
|
||||
|
||||
if (mnvm_noErr == vSonyNextPendingInsert(&i)) {
|
||||
ui5b data = i;
|
||||
uint32_t data = i;
|
||||
|
||||
if (vSonyIsLocked(i)) {
|
||||
data |= ((ui5b)0x00FF) << 16;
|
||||
data |= ((uint32_t)0x00FF) << 16;
|
||||
}
|
||||
|
||||
DiskInsertedPsuedoException(MountCallBack, data);
|
||||
@ -470,8 +470,8 @@ GLOBALPROC Sony_Update (void)
|
||||
}
|
||||
|
||||
LOCALFUNC tMacErr Drive_Transfer(blnr IsWrite, CPTR Buffera,
|
||||
tDrive Drive_No, ui5r Sony_Start, ui5r Sony_Count,
|
||||
ui5r *Sony_ActCount)
|
||||
tDrive Drive_No, uint32_t Sony_Start, uint32_t Sony_Count,
|
||||
uint32_t *Sony_ActCount)
|
||||
{
|
||||
tMacErr result;
|
||||
|
||||
@ -486,12 +486,12 @@ LOCALFUNC tMacErr Drive_Transfer(blnr IsWrite, CPTR Buffera,
|
||||
if (IsWrite && vSonyIsLocked(Drive_No)) {
|
||||
result = mnvm_vLckdErr;
|
||||
} else {
|
||||
ui5r DataSize = ImageDataSize[Drive_No];
|
||||
uint32_t DataSize = ImageDataSize[Drive_No];
|
||||
if (Sony_Start > DataSize) {
|
||||
result = mnvm_eofErr;
|
||||
} else {
|
||||
blnr hit_eof = falseblnr;
|
||||
ui5r L = DataSize - Sony_Start;
|
||||
uint32_t L = DataSize - Sony_Start;
|
||||
if (L >= Sony_Count) {
|
||||
L = Sony_Count;
|
||||
} else {
|
||||
@ -523,7 +523,7 @@ LOCALFUNC tMacErr Drive_Eject(tDrive Drive_No)
|
||||
|
||||
result = CheckReadableDrive(Drive_No);
|
||||
if (mnvm_noErr == result) {
|
||||
vSonyMountedMask &= ~ ((ui5b)1 << Drive_No);
|
||||
vSonyMountedMask &= ~ ((uint32_t)1 << Drive_No);
|
||||
#if Sony_WantChecksumsUpdated
|
||||
Drive_UpdateChecksums(Drive_No);
|
||||
#endif
|
||||
@ -548,7 +548,7 @@ LOCALFUNC tMacErr Drive_EjectDelete(tDrive Drive_No)
|
||||
if (vSonyIsLocked(Drive_No)) {
|
||||
result = mnvm_vLckdErr;
|
||||
} else {
|
||||
vSonyMountedMask &= ~ ((ui5b)1 << Drive_No);
|
||||
vSonyMountedMask &= ~ ((uint32_t)1 << Drive_No);
|
||||
result = vSonyEjectDelete(Drive_No);
|
||||
}
|
||||
}
|
||||
@ -632,11 +632,11 @@ GLOBALPROC ExtnDisk_Access(CPTR p)
|
||||
break;
|
||||
case kCmndDiskRead:
|
||||
{
|
||||
ui5r Sony_ActCount;
|
||||
uint32_t Sony_ActCount;
|
||||
CPTR Buffera = get_vm_long(p + kParamDiskBuffer);
|
||||
tDrive Drive_No = get_vm_word(p + kParamDiskDrive_No);
|
||||
ui5r Sony_Start = get_vm_long(p + kParamDiskStart);
|
||||
ui5r Sony_Count = get_vm_long(p + kParamDiskCount);
|
||||
uint32_t Sony_Start = get_vm_long(p + kParamDiskStart);
|
||||
uint32_t Sony_Count = get_vm_long(p + kParamDiskCount);
|
||||
|
||||
result = Drive_Transfer(falseblnr, Buffera, Drive_No,
|
||||
Sony_Start, Sony_Count, &Sony_ActCount);
|
||||
@ -646,11 +646,11 @@ GLOBALPROC ExtnDisk_Access(CPTR p)
|
||||
break;
|
||||
case kCmndDiskWrite:
|
||||
{
|
||||
ui5r Sony_ActCount;
|
||||
uint32_t Sony_ActCount;
|
||||
CPTR Buffera = get_vm_long(p + kParamDiskBuffer);
|
||||
tDrive Drive_No = get_vm_word(p + kParamDiskDrive_No);
|
||||
ui5r Sony_Start = get_vm_long(p + kParamDiskStart);
|
||||
ui5r Sony_Count = get_vm_long(p + kParamDiskCount);
|
||||
uint32_t Sony_Start = get_vm_long(p + kParamDiskStart);
|
||||
uint32_t Sony_Count = get_vm_long(p + kParamDiskCount);
|
||||
|
||||
result = Drive_Transfer(trueblnr, Buffera, Drive_No,
|
||||
Sony_Start, Sony_Count, &Sony_ActCount);
|
||||
@ -690,18 +690,18 @@ GLOBALPROC ExtnDisk_Access(CPTR p)
|
||||
break;
|
||||
case kCmndDiskFeatures:
|
||||
{
|
||||
ui5r v = (0
|
||||
uint32_t v = (0
|
||||
#if IncludeSonyRawMode
|
||||
| ((ui5b)1 << kFeatureCmndDisk_RawMode)
|
||||
| ((uint32_t)1 << kFeatureCmndDisk_RawMode)
|
||||
#endif
|
||||
#if IncludeSonyNew
|
||||
| ((ui5b)1 << kFeatureCmndDisk_New)
|
||||
| ((uint32_t)1 << kFeatureCmndDisk_New)
|
||||
#endif
|
||||
#if IncludeSonyNameNew
|
||||
| ((ui5b)1 << kFeatureCmndDisk_NewName)
|
||||
| ((uint32_t)1 << kFeatureCmndDisk_NewName)
|
||||
#endif
|
||||
#if IncludeSonyGetName
|
||||
| ((ui5b)1 << kFeatureCmndDisk_GetName)
|
||||
| ((uint32_t)1 << kFeatureCmndDisk_GetName)
|
||||
#endif
|
||||
);
|
||||
|
||||
@ -732,7 +732,7 @@ GLOBALPROC ExtnDisk_Access(CPTR p)
|
||||
#if IncludeSonyNew
|
||||
case kCmndDiskNew:
|
||||
{
|
||||
ui5b count = get_vm_long(p + ExtnDat_params + 0);
|
||||
uint32_t count = get_vm_long(p + ExtnDat_params + 0);
|
||||
tPbuf Pbuf_No = get_vm_word(p + ExtnDat_params + 4);
|
||||
/* reserved word at offset 6, should be zero */
|
||||
|
||||
@ -883,11 +883,11 @@ GLOBALPROC ExtnDisk_Access(CPTR p)
|
||||
|
||||
#if 0
|
||||
struct MyDriverDat_R {
|
||||
ui5b zeroes[4]; /* 0 */
|
||||
ui5b checkval; /* 16 */
|
||||
ui5b pokeaddr; /* 20 */
|
||||
ui4b NumDrives; /* 24 */
|
||||
ui4b DiskExtn; /* 26 */
|
||||
uint32_t zeroes[4]; /* 0 */
|
||||
uint32_t checkval; /* 16 */
|
||||
uint32_t pokeaddr; /* 20 */
|
||||
uint16_t NumDrives; /* 24 */
|
||||
uint16_t DiskExtn; /* 26 */
|
||||
TMTask NullTask; /* 28 */
|
||||
/* total size must be <= FirstDriveVarsOffset */
|
||||
};
|
||||
@ -932,7 +932,7 @@ typedef struct MyDriverDat_R MyDriverDat_R;
|
||||
LOCALVAR CPTR TheTagBuffer;
|
||||
#endif
|
||||
|
||||
LOCALFUNC ui5b DriveVarsLocation(tDrive Drive_No)
|
||||
LOCALFUNC uint32_t DriveVarsLocation(tDrive Drive_No)
|
||||
{
|
||||
CPTR SonyVars = get_vm_long(SonyVarsPtr);
|
||||
|
||||
@ -946,7 +946,7 @@ LOCALFUNC ui5b DriveVarsLocation(tDrive Drive_No)
|
||||
|
||||
LOCALFUNC tMacErr Sony_Mount(CPTR p)
|
||||
{
|
||||
ui5b data = get_vm_long(p + ExtnDat_params + 0);
|
||||
uint32_t data = get_vm_long(p + ExtnDat_params + 0);
|
||||
tMacErr result = mnvm_miscErr;
|
||||
tDrive i = data & 0x0000FFFF;
|
||||
CPTR dvl = DriveVarsLocation(i);
|
||||
@ -958,7 +958,7 @@ LOCALFUNC tMacErr Sony_Mount(CPTR p)
|
||||
|
||||
result = mnvm_nsDrvErr;
|
||||
} else if (get_vm_byte(dvl + kDiskInPlace) == 0x00) {
|
||||
ui5b L = ImageDataSize[i] >> 9; /* block count */
|
||||
uint32_t L = ImageDataSize[i] >> 9; /* block count */
|
||||
|
||||
#if Sony_dolog
|
||||
dbglog_StartLine();
|
||||
@ -1036,19 +1036,19 @@ LOCALFUNC tMacErr Sony_Mount(CPTR p)
|
||||
|
||||
#if Sony_SupportTags
|
||||
LOCALFUNC tMacErr Sony_PrimeTags(tDrive Drive_No,
|
||||
ui5r Sony_Start, ui5r Sony_Count, blnr IsWrite)
|
||||
uint32_t Sony_Start, uint32_t Sony_Count, blnr IsWrite)
|
||||
{
|
||||
tMacErr result = mnvm_noErr;
|
||||
ui5r TagOffset = ImageTagOffset[Drive_No];
|
||||
uint32_t TagOffset = ImageTagOffset[Drive_No];
|
||||
|
||||
if ((0 != TagOffset) && (Sony_Count > 0)) {
|
||||
ui5r block = Sony_Start >> 9;
|
||||
ui5r n = Sony_Count >> 9; /* is >= 1 if get here */
|
||||
uint32_t block = Sony_Start >> 9;
|
||||
uint32_t n = Sony_Count >> 9; /* is >= 1 if get here */
|
||||
|
||||
TagOffset += block * 12;
|
||||
|
||||
if (0 != TheTagBuffer) {
|
||||
ui5r count = 12 * n;
|
||||
uint32_t count = 12 * n;
|
||||
result = vSonyTransferVM(IsWrite, TheTagBuffer, Drive_No,
|
||||
TagOffset, count, nullpr);
|
||||
if (mnvm_noErr == result) {
|
||||
@ -1057,13 +1057,13 @@ LOCALFUNC tMacErr Sony_PrimeTags(tDrive Drive_No,
|
||||
} else {
|
||||
if (! IsWrite) {
|
||||
/* only need to read the last block tags */
|
||||
ui5r count = 12;
|
||||
uint32_t count = 12;
|
||||
TagOffset += 12 * (n - 1);
|
||||
result = vSonyTransferVM(falseblnr, 0x02FC, Drive_No,
|
||||
TagOffset, count, nullpr);
|
||||
} else {
|
||||
ui5r count = 12;
|
||||
ui4r BufTgFBkNum = get_vm_word(0x0302);
|
||||
uint32_t count = 12;
|
||||
uint16_t BufTgFBkNum = get_vm_word(0x0302);
|
||||
do {
|
||||
put_vm_word(0x0302, BufTgFBkNum);
|
||||
result = vSonyTransferVM(trueblnr, 0x02FC, Drive_No,
|
||||
@ -1087,13 +1087,13 @@ label_fail:
|
||||
LOCALFUNC tMacErr Sony_Prime(CPTR p)
|
||||
{
|
||||
tMacErr result;
|
||||
ui5r Sony_Count;
|
||||
ui5r Sony_Start;
|
||||
ui5r Sony_ActCount = 0;
|
||||
uint32_t Sony_Count;
|
||||
uint32_t Sony_Start;
|
||||
uint32_t Sony_ActCount = 0;
|
||||
CPTR ParamBlk = get_vm_long(p + ExtnDat_params + 0);
|
||||
CPTR DeviceCtl = get_vm_long(p + ExtnDat_params + 4);
|
||||
tDrive Drive_No = get_vm_word(ParamBlk + kioVRefNum) - 1;
|
||||
ui4r IOTrap = get_vm_word(ParamBlk + kioTrap);
|
||||
uint16_t IOTrap = get_vm_word(ParamBlk + kioTrap);
|
||||
CPTR dvl = DriveVarsLocation(Drive_No);
|
||||
|
||||
if (0 == dvl) {
|
||||
@ -1115,7 +1115,7 @@ LOCALFUNC tMacErr Sony_Prime(CPTR p)
|
||||
#endif
|
||||
{
|
||||
blnr IsWrite = (0 != (IOTrap & 0x0001));
|
||||
ui3b DiskInPlaceV = get_vm_byte(dvl + kDiskInPlace);
|
||||
uint8_t DiskInPlaceV = get_vm_byte(dvl + kDiskInPlace);
|
||||
|
||||
if (DiskInPlaceV != 0x02) {
|
||||
if (DiskInPlaceV == 0x01) {
|
||||
@ -1134,7 +1134,7 @@ LOCALFUNC tMacErr Sony_Prime(CPTR p)
|
||||
}
|
||||
|
||||
#if 0
|
||||
ui4r PosMode = get_vm_word(ParamBlk + kioPosMode);
|
||||
uint16_t PosMode = get_vm_word(ParamBlk + kioPosMode);
|
||||
|
||||
if (0 != (PosMode & 64)) {
|
||||
#if ExtraAbnormalReports
|
||||
@ -1158,7 +1158,7 @@ LOCALFUNC tMacErr Sony_Prime(CPTR p)
|
||||
evidence found in Basilisk II emulator,
|
||||
and disassembly of Mac Plus disk driver.)
|
||||
*/
|
||||
ui5r PosOffset = get_vm_long(ParamBlk + kioPosOffset);
|
||||
uint32_t PosOffset = get_vm_long(ParamBlk + kioPosOffset);
|
||||
switch (PosMode) {
|
||||
case kfsAtMark:
|
||||
Sony_Start = get_vm_long(DeviceCtl + kdCtlPosition);
|
||||
@ -1245,7 +1245,7 @@ LOCALFUNC tMacErr Sony_Control(CPTR p)
|
||||
tMacErr result;
|
||||
CPTR ParamBlk = get_vm_long(p + ExtnDat_params + 0);
|
||||
/* CPTR DeviceCtl = get_vm_long(p + ExtnDat_params + 4); */
|
||||
ui4r OpCode = get_vm_word(ParamBlk + kcsCode);
|
||||
uint16_t OpCode = get_vm_word(ParamBlk + kcsCode);
|
||||
|
||||
if (kKillIO == OpCode) {
|
||||
#if Sony_dolog
|
||||
@ -1273,8 +1273,8 @@ LOCALFUNC tMacErr Sony_Control(CPTR p)
|
||||
result = mnvm_controlErr;
|
||||
#else
|
||||
#if 0
|
||||
ui3r Arg1 = get_vm_byte(ParamBlk + kcsParam);
|
||||
ui3r Arg2 = get_vm_byte(ParamBlk + kcsParam + 1);
|
||||
uint8_t Arg1 = get_vm_byte(ParamBlk + kcsParam);
|
||||
uint8_t Arg2 = get_vm_byte(ParamBlk + kcsParam + 1);
|
||||
if (0 == Arg1) {
|
||||
/* disable track cache */
|
||||
} else {
|
||||
@ -1368,7 +1368,7 @@ LOCALFUNC tMacErr Sony_Control(CPTR p)
|
||||
#if CurEmMd >= kEmMd_SE
|
||||
case kDriveInfo :
|
||||
{
|
||||
ui5b v;
|
||||
uint32_t v;
|
||||
|
||||
#if Sony_dolog
|
||||
dbglog_StartLine();
|
||||
@ -1434,7 +1434,7 @@ LOCALFUNC tMacErr Sony_Status(CPTR p)
|
||||
tMacErr result;
|
||||
CPTR ParamBlk = get_vm_long(p + ExtnDat_params + 0);
|
||||
/* CPTR DeviceCtl = get_vm_long(p + ExtnDat_params + 4); */
|
||||
ui4r OpCode = get_vm_word(ParamBlk + kcsCode);
|
||||
uint16_t OpCode = get_vm_word(ParamBlk + kcsCode);
|
||||
|
||||
#if Sony_dolog
|
||||
dbglog_StartLine();
|
||||
@ -1492,7 +1492,7 @@ LOCALFUNC tMacErr Sony_OpenA(CPTR p)
|
||||
if (MountCallBack != 0) {
|
||||
return mnvm_opWrErr; /* driver already open */
|
||||
} else {
|
||||
ui5b L = FirstDriveVarsOffset + EachDriveVarsSize * NumDrives;
|
||||
uint32_t L = FirstDriveVarsOffset + EachDriveVarsSize * NumDrives;
|
||||
|
||||
if (L < MinSonVarsSize) {
|
||||
L = MinSonVarsSize;
|
||||
@ -1506,7 +1506,7 @@ LOCALFUNC tMacErr Sony_OpenA(CPTR p)
|
||||
|
||||
LOCALFUNC tMacErr Sony_OpenB(CPTR p)
|
||||
{
|
||||
si4b i;
|
||||
int16_t i;
|
||||
CPTR dvl;
|
||||
|
||||
#if Sony_dolog
|
||||
|
@ -27,9 +27,9 @@
|
||||
#include "CNFGGLOB.h"
|
||||
|
||||
|
||||
typedef ui3b *ui3p;
|
||||
typedef ui4b *ui4p;
|
||||
typedef ui5b *ui5p;
|
||||
typedef uint8_t *ui3p;
|
||||
typedef uint16_t *ui4p;
|
||||
typedef uint32_t *ui5p;
|
||||
|
||||
/*
|
||||
Largest efficiently supported
|
||||
@ -37,10 +37,10 @@ typedef ui5b *ui5p;
|
||||
large enough to hold number of elements
|
||||
of any array we will deal with.
|
||||
*/
|
||||
typedef ui5r uimr;
|
||||
typedef si5r simr;
|
||||
typedef uint32_t uimr;
|
||||
typedef int32_t simr;
|
||||
|
||||
#define blnr ui3r
|
||||
#define blnr uint8_t
|
||||
#define trueblnr 1
|
||||
#define falseblnr 0
|
||||
|
||||
@ -111,7 +111,7 @@ typedef si5r simr;
|
||||
*/
|
||||
|
||||
/*
|
||||
best type for ui4r that is probably in register
|
||||
best type for uint16_t that is probably in register
|
||||
(when compiler messes up otherwise)
|
||||
*/
|
||||
|
||||
@ -123,16 +123,16 @@ typedef si5r simr;
|
||||
#define LittleEndianUnaligned 0
|
||||
#endif
|
||||
|
||||
#ifndef ui3rr
|
||||
#define ui3rr ui3r
|
||||
#ifndef uint8_tr
|
||||
#define uint8_tr uint8_t
|
||||
#endif
|
||||
|
||||
#ifndef ui4rr
|
||||
#define ui4rr ui4r
|
||||
#ifndef uint16_tr
|
||||
#define uint16_tr uint16_t
|
||||
#endif
|
||||
|
||||
#ifndef si5rr
|
||||
#define si5rr si5r
|
||||
#ifndef int32_tr
|
||||
#define int32_tr int32_t
|
||||
#endif
|
||||
|
||||
#ifndef my_align_8
|
||||
|
110
src/VIA2EMDV.c
110
src/VIA2EMDV.c
@ -208,21 +208,21 @@ IMPORTPROC VIA2_iCB2_ChangeNtfy(void);
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
ui5b T1C_F; /* Timer 1 Counter Fixed Point */
|
||||
ui5b T2C_F; /* Timer 2 Counter Fixed Point */
|
||||
ui3b ORB; /* Buffer B */
|
||||
/* ui3b ORA_H; Buffer A with Handshake */
|
||||
ui3b DDR_B; /* Data Direction Register B */
|
||||
ui3b DDR_A; /* Data Direction Register A */
|
||||
ui3b T1L_L; /* Timer 1 Latch Low */
|
||||
ui3b T1L_H; /* Timer 1 Latch High */
|
||||
ui3b T2L_L; /* Timer 2 Latch Low */
|
||||
ui3b SR; /* Shift Register */
|
||||
ui3b ACR; /* Auxiliary Control Register */
|
||||
ui3b PCR; /* Peripheral Control Register */
|
||||
ui3b IFR; /* Interrupt Flag Register */
|
||||
ui3b IER; /* Interrupt Enable Register */
|
||||
ui3b ORA; /* Buffer A */
|
||||
uint32_t T1C_F; /* Timer 1 Counter Fixed Point */
|
||||
uint32_t T2C_F; /* Timer 2 Counter Fixed Point */
|
||||
uint8_t ORB; /* Buffer B */
|
||||
/* uint8_t ORA_H; Buffer A with Handshake */
|
||||
uint8_t DDR_B; /* Data Direction Register B */
|
||||
uint8_t DDR_A; /* Data Direction Register A */
|
||||
uint8_t T1L_L; /* Timer 1 Latch Low */
|
||||
uint8_t T1L_H; /* Timer 1 Latch High */
|
||||
uint8_t T2L_L; /* Timer 2 Latch Low */
|
||||
uint8_t SR; /* Shift Register */
|
||||
uint8_t ACR; /* Auxiliary Control Register */
|
||||
uint8_t PCR; /* Peripheral Control Register */
|
||||
uint8_t IFR; /* Interrupt Flag Register */
|
||||
uint8_t IER; /* Interrupt Enable Register */
|
||||
uint8_t ORA; /* Buffer A */
|
||||
} VIA2_Ty;
|
||||
|
||||
LOCALVAR VIA2_Ty VIA2_D;
|
||||
@ -243,9 +243,9 @@ LOCALVAR VIA2_Ty VIA2_D;
|
||||
about their status
|
||||
*/
|
||||
|
||||
LOCALFUNC ui3b VIA2_Get_ORA(ui3b Selection)
|
||||
LOCALFUNC uint8_t VIA2_Get_ORA(uint8_t Selection)
|
||||
{
|
||||
ui3b Value = (~ VIA2_ORA_CanIn) & Selection & VIA2_ORA_FloatVal;
|
||||
uint8_t Value = (~ VIA2_ORA_CanIn) & Selection & VIA2_ORA_FloatVal;
|
||||
|
||||
#if Ui3rTestBit(VIA2_ORA_CanIn, 7)
|
||||
if (Ui3rTestBit(Selection, 7)) {
|
||||
@ -304,9 +304,9 @@ LOCALFUNC ui3b VIA2_Get_ORA(ui3b Selection)
|
||||
about their status
|
||||
*/
|
||||
|
||||
LOCALFUNC ui3b VIA2_Get_ORB(ui3b Selection)
|
||||
LOCALFUNC uint8_t VIA2_Get_ORB(uint8_t Selection)
|
||||
{
|
||||
ui3b Value = (~ VIA2_ORB_CanIn) & Selection & VIA2_ORB_FloatVal;
|
||||
uint8_t Value = (~ VIA2_ORB_CanIn) & Selection & VIA2_ORB_FloatVal;
|
||||
|
||||
#if Ui3rTestBit(VIA2_ORB_CanIn, 7)
|
||||
if (Ui3rTestBit(Selection, 7)) {
|
||||
@ -363,10 +363,10 @@ LOCALFUNC ui3b VIA2_Get_ORB(ui3b Selection)
|
||||
(Ui3rTestBit(Selection, p) && \
|
||||
((v = (Data >> p) & 1) != x))
|
||||
|
||||
LOCALPROC VIA2_Put_ORA(ui3b Selection, ui3b Data)
|
||||
LOCALPROC VIA2_Put_ORA(uint8_t Selection, uint8_t Data)
|
||||
{
|
||||
#if 0 != VIA2_ORA_CanOut
|
||||
ui3b v;
|
||||
uint8_t v;
|
||||
#endif
|
||||
|
||||
#if Ui3rTestBit(VIA2_ORA_CanOut, 7)
|
||||
@ -442,10 +442,10 @@ LOCALPROC VIA2_Put_ORA(ui3b Selection, ui3b Data)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC VIA2_Put_ORB(ui3b Selection, ui3b Data)
|
||||
LOCALPROC VIA2_Put_ORB(uint8_t Selection, uint8_t Data)
|
||||
{
|
||||
#if 0 != VIA2_ORB_CanOut
|
||||
ui3b v;
|
||||
uint8_t v;
|
||||
#endif
|
||||
|
||||
#if Ui3rTestBit(VIA2_ORB_CanOut, 7)
|
||||
@ -521,10 +521,10 @@ LOCALPROC VIA2_Put_ORB(ui3b Selection, ui3b Data)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC VIA2_SetDDR_A(ui3b Data)
|
||||
LOCALPROC VIA2_SetDDR_A(uint8_t Data)
|
||||
{
|
||||
ui3b floatbits = VIA2_D.DDR_A & ~ Data;
|
||||
ui3b unfloatbits = Data & ~ VIA2_D.DDR_A;
|
||||
uint8_t floatbits = VIA2_D.DDR_A & ~ Data;
|
||||
uint8_t unfloatbits = Data & ~ VIA2_D.DDR_A;
|
||||
|
||||
if (floatbits != 0) {
|
||||
VIA2_Put_ORA(floatbits, VIA2_ORA_FloatVal);
|
||||
@ -539,10 +539,10 @@ LOCALPROC VIA2_SetDDR_A(ui3b Data)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC VIA2_SetDDR_B(ui3b Data)
|
||||
LOCALPROC VIA2_SetDDR_B(uint8_t Data)
|
||||
{
|
||||
ui3b floatbits = VIA2_D.DDR_B & ~ Data;
|
||||
ui3b unfloatbits = Data & ~ VIA2_D.DDR_B;
|
||||
uint8_t floatbits = VIA2_D.DDR_B & ~ Data;
|
||||
uint8_t unfloatbits = Data & ~ VIA2_D.DDR_B;
|
||||
|
||||
if (floatbits != 0) {
|
||||
VIA2_Put_ORB(floatbits, VIA2_ORB_FloatVal);
|
||||
@ -560,7 +560,7 @@ LOCALPROC VIA2_SetDDR_B(ui3b Data)
|
||||
|
||||
LOCALPROC VIA2_CheckInterruptFlag(void)
|
||||
{
|
||||
ui3b NewInterruptRequest =
|
||||
uint8_t NewInterruptRequest =
|
||||
((VIA2_D.IFR & VIA2_D.IER) != 0) ? 1 : 0;
|
||||
|
||||
if (NewInterruptRequest != VIA2_InterruptRequest) {
|
||||
@ -572,8 +572,8 @@ LOCALPROC VIA2_CheckInterruptFlag(void)
|
||||
}
|
||||
|
||||
|
||||
LOCALVAR ui3b VIA2_T1_Active = 0;
|
||||
LOCALVAR ui3b VIA2_T2_Active = 0;
|
||||
LOCALVAR uint8_t VIA2_T1_Active = 0;
|
||||
LOCALVAR uint8_t VIA2_T2_Active = 0;
|
||||
|
||||
LOCALVAR blnr VIA2_T1IntReady = falseblnr;
|
||||
|
||||
@ -607,15 +607,15 @@ GLOBALPROC VIA2_Reset(void)
|
||||
VIA2_CheckInterruptFlag();
|
||||
}
|
||||
|
||||
LOCALPROC VIA2_SetInterruptFlag(ui3b VIA_Int)
|
||||
LOCALPROC VIA2_SetInterruptFlag(uint8_t VIA_Int)
|
||||
{
|
||||
VIA2_D.IFR |= ((ui3b)1 << VIA_Int);
|
||||
VIA2_D.IFR |= ((uint8_t)1 << VIA_Int);
|
||||
VIA2_CheckInterruptFlag();
|
||||
}
|
||||
|
||||
LOCALPROC VIA2_ClrInterruptFlag(ui3b VIA_Int)
|
||||
LOCALPROC VIA2_ClrInterruptFlag(uint8_t VIA_Int)
|
||||
{
|
||||
VIA2_D.IFR &= ~ ((ui3b)1 << VIA_Int);
|
||||
VIA2_D.IFR &= ~ ((uint8_t)1 << VIA_Int);
|
||||
VIA2_CheckInterruptFlag();
|
||||
}
|
||||
|
||||
@ -623,13 +623,13 @@ LOCALPROC VIA2_ClrInterruptFlag(ui3b VIA_Int)
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
GLOBALPROC VIA2_ShiftInData(ui3b v)
|
||||
GLOBALPROC VIA2_ShiftInData(uint8_t v)
|
||||
{
|
||||
/*
|
||||
external hardware generates 8 pulses on CB1,
|
||||
writes 8 bits to CB2
|
||||
*/
|
||||
ui3b ShiftMode = (VIA2_D.ACR & 0x1C) >> 2;
|
||||
uint8_t ShiftMode = (VIA2_D.ACR & 0x1C) >> 2;
|
||||
|
||||
if (ShiftMode != 3) {
|
||||
#if ExtraAbnormalReports
|
||||
@ -650,7 +650,7 @@ GLOBALPROC VIA2_ShiftInData(ui3b v)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALFUNC ui3b VIA2_ShiftOutData(void)
|
||||
GLOBALFUNC uint8_t VIA2_ShiftOutData(void)
|
||||
{
|
||||
/*
|
||||
external hardware generates 8 pulses on CB1,
|
||||
@ -679,20 +679,20 @@ GLOBALPROC VIA2_DoTimer1Check(void)
|
||||
iCountt NewTime = GetCuriCount();
|
||||
iCountt deltaTime = (NewTime - VIA2_T1LastTime);
|
||||
if (deltaTime != 0) {
|
||||
ui5b Temp = VIA2_D.T1C_F; /* Get Timer 1 Counter */
|
||||
ui5b deltaTemp =
|
||||
uint32_t Temp = VIA2_D.T1C_F; /* Get Timer 1 Counter */
|
||||
uint32_t deltaTemp =
|
||||
(deltaTime / CyclesPerViaTime) << (16 - kLn2CycleScale);
|
||||
/* may overflow */
|
||||
ui5b NewTemp = Temp - deltaTemp;
|
||||
uint32_t NewTemp = Temp - deltaTemp;
|
||||
if ((deltaTime > (0x00010000UL * CyclesScaledPerViaTime))
|
||||
|| ((Temp <= deltaTemp) && (Temp != 0)))
|
||||
{
|
||||
if ((VIA2_D.ACR & 0x40) != 0) { /* Free Running? */
|
||||
/* Reload Counter from Latches */
|
||||
ui4b v = (VIA2_D.T1L_H << 8) + VIA2_D.T1L_L;
|
||||
ui4b ntrans = 1 + ((v == 0) ? 0 :
|
||||
uint16_t v = (VIA2_D.T1L_H << 8) + VIA2_D.T1L_L;
|
||||
uint16_t ntrans = 1 + ((v == 0) ? 0 :
|
||||
(((deltaTemp - Temp) / v) >> 16));
|
||||
NewTemp += (((ui5b)v * ntrans) << 16);
|
||||
NewTemp += (((uint32_t)v * ntrans) << 16);
|
||||
#if Ui3rTestBit(VIA2_ORB_CanOut, 7)
|
||||
if ((VIA2_D.ACR & 0x80) != 0) { /* invert ? */
|
||||
if ((ntrans & 1) != 0) {
|
||||
@ -725,8 +725,8 @@ GLOBALPROC VIA2_DoTimer1Check(void)
|
||||
VIA2_T1IntReady = falseblnr;
|
||||
if ((VIA2_D.IFR & (1 << kIntT1)) == 0) {
|
||||
if (((VIA2_D.ACR & 0x40) != 0) || (VIA2_T1_Active == 1)) {
|
||||
ui5b NewTemp = VIA2_D.T1C_F; /* Get Timer 1 Counter */
|
||||
ui5b NewTimer;
|
||||
uint32_t NewTemp = VIA2_D.T1C_F; /* Get Timer 1 Counter */
|
||||
uint32_t NewTimer;
|
||||
#ifdef _VIA_Debug
|
||||
fprintf(stderr, "posting Timer1Check, %d, %d\n",
|
||||
Temp, GetCuriCount());
|
||||
@ -765,9 +765,9 @@ LOCALPROC CheckT1IntReady(void)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALFUNC ui4b VIA2_GetT1InvertTime(void)
|
||||
GLOBALFUNC uint16_t VIA2_GetT1InvertTime(void)
|
||||
{
|
||||
ui4b v;
|
||||
uint16_t v;
|
||||
|
||||
if ((VIA2_D.ACR & 0xC0) == 0xC0) {
|
||||
v = (VIA2_D.T1L_H << 8) + VIA2_D.T1L_L;
|
||||
@ -785,11 +785,11 @@ GLOBALPROC VIA2_DoTimer2Check(void)
|
||||
{
|
||||
if (VIA2_T2Running) {
|
||||
iCountt NewTime = GetCuriCount();
|
||||
ui5b Temp = VIA2_D.T2C_F; /* Get Timer 2 Counter */
|
||||
uint32_t Temp = VIA2_D.T2C_F; /* Get Timer 2 Counter */
|
||||
iCountt deltaTime = (NewTime - VIA2_T2LastTime);
|
||||
ui5b deltaTemp = (deltaTime / CyclesPerViaTime)
|
||||
uint32_t deltaTemp = (deltaTime / CyclesPerViaTime)
|
||||
<< (16 - kLn2CycleScale); /* may overflow */
|
||||
ui5b NewTemp = Temp - deltaTemp;
|
||||
uint32_t NewTemp = Temp - deltaTemp;
|
||||
if (VIA2_T2_Active == 1) {
|
||||
if ((deltaTime > (0x00010000UL * CyclesScaledPerViaTime))
|
||||
|| ((Temp <= deltaTemp) && (Temp != 0)))
|
||||
@ -801,7 +801,7 @@ GLOBALPROC VIA2_DoTimer2Check(void)
|
||||
dbglog_WriteNote("VIA2 Timer 2 Interrupt");
|
||||
#endif
|
||||
} else {
|
||||
ui5b NewTimer;
|
||||
uint32_t NewTimer;
|
||||
#ifdef _VIA_Debug
|
||||
fprintf(stderr, "posting Timer2Check, %d, %d\n",
|
||||
Temp, GetCuriCount());
|
||||
@ -837,7 +837,7 @@ GLOBALPROC VIA2_DoTimer2Check(void)
|
||||
#define kIER 0x0E
|
||||
#define kORA 0x0F
|
||||
|
||||
GLOBALFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
GLOBALFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr)
|
||||
{
|
||||
switch (addr) {
|
||||
case kORB :
|
||||
@ -1013,7 +1013,7 @@ GLOBALFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
case kACR:
|
||||
if (WriteMem) {
|
||||
#if 1
|
||||
if ((VIA2_D.ACR & 0x10) != ((ui3b)Data & 0x10)) {
|
||||
if ((VIA2_D.ACR & 0x10) != ((uint8_t)Data & 0x10)) {
|
||||
/* shift direction has changed */
|
||||
if ((Data & 0x10) == 0) {
|
||||
/*
|
||||
|
@ -23,7 +23,7 @@
|
||||
EXPORTPROC VIA2_Zap(void);
|
||||
EXPORTPROC VIA2_Reset(void);
|
||||
|
||||
EXPORTFUNC ui5b VIA2_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTFUNC uint32_t VIA2_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
|
||||
EXPORTPROC VIA2_ExtraTimeBegin(void);
|
||||
EXPORTPROC VIA2_ExtraTimeEnd(void);
|
||||
@ -42,7 +42,7 @@ EXPORTPROC VIA2_iCB2_PulseNtfy(void);
|
||||
EXPORTPROC VIA2_DoTimer1Check(void);
|
||||
EXPORTPROC VIA2_DoTimer2Check(void);
|
||||
|
||||
EXPORTFUNC ui4b VIA2_GetT1InvertTime(void);
|
||||
EXPORTFUNC uint16_t VIA2_GetT1InvertTime(void);
|
||||
|
||||
EXPORTPROC VIA2_ShiftInData(ui3b v);
|
||||
EXPORTFUNC ui3b VIA2_ShiftOutData(void);
|
||||
EXPORTPROC VIA2_ShiftInData(uint8_t v);
|
||||
EXPORTFUNC uint8_t VIA2_ShiftOutData(void);
|
||||
|
110
src/VIAEMDEV.c
110
src/VIAEMDEV.c
@ -208,21 +208,21 @@ IMPORTPROC VIA1_iCB2_ChangeNtfy(void);
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
ui5b T1C_F; /* Timer 1 Counter Fixed Point */
|
||||
ui5b T2C_F; /* Timer 2 Counter Fixed Point */
|
||||
ui3b ORB; /* Buffer B */
|
||||
/* ui3b ORA_H; Buffer A with Handshake */
|
||||
ui3b DDR_B; /* Data Direction Register B */
|
||||
ui3b DDR_A; /* Data Direction Register A */
|
||||
ui3b T1L_L; /* Timer 1 Latch Low */
|
||||
ui3b T1L_H; /* Timer 1 Latch High */
|
||||
ui3b T2L_L; /* Timer 2 Latch Low */
|
||||
ui3b SR; /* Shift Register */
|
||||
ui3b ACR; /* Auxiliary Control Register */
|
||||
ui3b PCR; /* Peripheral Control Register */
|
||||
ui3b IFR; /* Interrupt Flag Register */
|
||||
ui3b IER; /* Interrupt Enable Register */
|
||||
ui3b ORA; /* Buffer A */
|
||||
uint32_t T1C_F; /* Timer 1 Counter Fixed Point */
|
||||
uint32_t T2C_F; /* Timer 2 Counter Fixed Point */
|
||||
uint8_t ORB; /* Buffer B */
|
||||
/* uint8_t ORA_H; Buffer A with Handshake */
|
||||
uint8_t DDR_B; /* Data Direction Register B */
|
||||
uint8_t DDR_A; /* Data Direction Register A */
|
||||
uint8_t T1L_L; /* Timer 1 Latch Low */
|
||||
uint8_t T1L_H; /* Timer 1 Latch High */
|
||||
uint8_t T2L_L; /* Timer 2 Latch Low */
|
||||
uint8_t SR; /* Shift Register */
|
||||
uint8_t ACR; /* Auxiliary Control Register */
|
||||
uint8_t PCR; /* Peripheral Control Register */
|
||||
uint8_t IFR; /* Interrupt Flag Register */
|
||||
uint8_t IER; /* Interrupt Enable Register */
|
||||
uint8_t ORA; /* Buffer A */
|
||||
} VIA1_Ty;
|
||||
|
||||
LOCALVAR VIA1_Ty VIA1_D;
|
||||
@ -243,9 +243,9 @@ LOCALVAR VIA1_Ty VIA1_D;
|
||||
about their status
|
||||
*/
|
||||
|
||||
LOCALFUNC ui3b VIA1_Get_ORA(ui3b Selection)
|
||||
LOCALFUNC uint8_t VIA1_Get_ORA(uint8_t Selection)
|
||||
{
|
||||
ui3b Value = (~ VIA1_ORA_CanIn) & Selection & VIA1_ORA_FloatVal;
|
||||
uint8_t Value = (~ VIA1_ORA_CanIn) & Selection & VIA1_ORA_FloatVal;
|
||||
|
||||
#if Ui3rTestBit(VIA1_ORA_CanIn, 7)
|
||||
if (Ui3rTestBit(Selection, 7)) {
|
||||
@ -304,9 +304,9 @@ LOCALFUNC ui3b VIA1_Get_ORA(ui3b Selection)
|
||||
about their status
|
||||
*/
|
||||
|
||||
LOCALFUNC ui3b VIA1_Get_ORB(ui3b Selection)
|
||||
LOCALFUNC uint8_t VIA1_Get_ORB(uint8_t Selection)
|
||||
{
|
||||
ui3b Value = (~ VIA1_ORB_CanIn) & Selection & VIA1_ORB_FloatVal;
|
||||
uint8_t Value = (~ VIA1_ORB_CanIn) & Selection & VIA1_ORB_FloatVal;
|
||||
|
||||
#if Ui3rTestBit(VIA1_ORB_CanIn, 7)
|
||||
if (Ui3rTestBit(Selection, 7)) {
|
||||
@ -363,10 +363,10 @@ LOCALFUNC ui3b VIA1_Get_ORB(ui3b Selection)
|
||||
(Ui3rTestBit(Selection, p) && \
|
||||
((v = (Data >> p) & 1) != x))
|
||||
|
||||
LOCALPROC VIA1_Put_ORA(ui3b Selection, ui3b Data)
|
||||
LOCALPROC VIA1_Put_ORA(uint8_t Selection, uint8_t Data)
|
||||
{
|
||||
#if 0 != VIA1_ORA_CanOut
|
||||
ui3b v;
|
||||
uint8_t v;
|
||||
#endif
|
||||
|
||||
#if Ui3rTestBit(VIA1_ORA_CanOut, 7)
|
||||
@ -442,10 +442,10 @@ LOCALPROC VIA1_Put_ORA(ui3b Selection, ui3b Data)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC VIA1_Put_ORB(ui3b Selection, ui3b Data)
|
||||
LOCALPROC VIA1_Put_ORB(uint8_t Selection, uint8_t Data)
|
||||
{
|
||||
#if 0 != VIA1_ORB_CanOut
|
||||
ui3b v;
|
||||
uint8_t v;
|
||||
#endif
|
||||
|
||||
#if Ui3rTestBit(VIA1_ORB_CanOut, 7)
|
||||
@ -521,10 +521,10 @@ LOCALPROC VIA1_Put_ORB(ui3b Selection, ui3b Data)
|
||||
#endif
|
||||
}
|
||||
|
||||
LOCALPROC VIA1_SetDDR_A(ui3b Data)
|
||||
LOCALPROC VIA1_SetDDR_A(uint8_t Data)
|
||||
{
|
||||
ui3b floatbits = VIA1_D.DDR_A & ~ Data;
|
||||
ui3b unfloatbits = Data & ~ VIA1_D.DDR_A;
|
||||
uint8_t floatbits = VIA1_D.DDR_A & ~ Data;
|
||||
uint8_t unfloatbits = Data & ~ VIA1_D.DDR_A;
|
||||
|
||||
if (floatbits != 0) {
|
||||
VIA1_Put_ORA(floatbits, VIA1_ORA_FloatVal);
|
||||
@ -539,10 +539,10 @@ LOCALPROC VIA1_SetDDR_A(ui3b Data)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALPROC VIA1_SetDDR_B(ui3b Data)
|
||||
LOCALPROC VIA1_SetDDR_B(uint8_t Data)
|
||||
{
|
||||
ui3b floatbits = VIA1_D.DDR_B & ~ Data;
|
||||
ui3b unfloatbits = Data & ~ VIA1_D.DDR_B;
|
||||
uint8_t floatbits = VIA1_D.DDR_B & ~ Data;
|
||||
uint8_t unfloatbits = Data & ~ VIA1_D.DDR_B;
|
||||
|
||||
if (floatbits != 0) {
|
||||
VIA1_Put_ORB(floatbits, VIA1_ORB_FloatVal);
|
||||
@ -560,7 +560,7 @@ LOCALPROC VIA1_SetDDR_B(ui3b Data)
|
||||
|
||||
LOCALPROC VIA1_CheckInterruptFlag(void)
|
||||
{
|
||||
ui3b NewInterruptRequest =
|
||||
uint8_t NewInterruptRequest =
|
||||
((VIA1_D.IFR & VIA1_D.IER) != 0) ? 1 : 0;
|
||||
|
||||
if (NewInterruptRequest != VIA1_InterruptRequest) {
|
||||
@ -572,8 +572,8 @@ LOCALPROC VIA1_CheckInterruptFlag(void)
|
||||
}
|
||||
|
||||
|
||||
LOCALVAR ui3b VIA1_T1_Active = 0;
|
||||
LOCALVAR ui3b VIA1_T2_Active = 0;
|
||||
LOCALVAR uint8_t VIA1_T1_Active = 0;
|
||||
LOCALVAR uint8_t VIA1_T2_Active = 0;
|
||||
|
||||
LOCALVAR blnr VIA1_T1IntReady = falseblnr;
|
||||
|
||||
@ -607,15 +607,15 @@ GLOBALPROC VIA1_Reset(void)
|
||||
VIA1_CheckInterruptFlag();
|
||||
}
|
||||
|
||||
LOCALPROC VIA1_SetInterruptFlag(ui3b VIA_Int)
|
||||
LOCALPROC VIA1_SetInterruptFlag(uint8_t VIA_Int)
|
||||
{
|
||||
VIA1_D.IFR |= ((ui3b)1 << VIA_Int);
|
||||
VIA1_D.IFR |= ((uint8_t)1 << VIA_Int);
|
||||
VIA1_CheckInterruptFlag();
|
||||
}
|
||||
|
||||
LOCALPROC VIA1_ClrInterruptFlag(ui3b VIA_Int)
|
||||
LOCALPROC VIA1_ClrInterruptFlag(uint8_t VIA_Int)
|
||||
{
|
||||
VIA1_D.IFR &= ~ ((ui3b)1 << VIA_Int);
|
||||
VIA1_D.IFR &= ~ ((uint8_t)1 << VIA_Int);
|
||||
VIA1_CheckInterruptFlag();
|
||||
}
|
||||
|
||||
@ -623,13 +623,13 @@ LOCALPROC VIA1_ClrInterruptFlag(ui3b VIA_Int)
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
GLOBALPROC VIA1_ShiftInData(ui3b v)
|
||||
GLOBALPROC VIA1_ShiftInData(uint8_t v)
|
||||
{
|
||||
/*
|
||||
external hardware generates 8 pulses on CB1,
|
||||
writes 8 bits to CB2
|
||||
*/
|
||||
ui3b ShiftMode = (VIA1_D.ACR & 0x1C) >> 2;
|
||||
uint8_t ShiftMode = (VIA1_D.ACR & 0x1C) >> 2;
|
||||
|
||||
if (ShiftMode != 3) {
|
||||
#if ExtraAbnormalReports
|
||||
@ -650,7 +650,7 @@ GLOBALPROC VIA1_ShiftInData(ui3b v)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALFUNC ui3b VIA1_ShiftOutData(void)
|
||||
GLOBALFUNC uint8_t VIA1_ShiftOutData(void)
|
||||
{
|
||||
/*
|
||||
external hardware generates 8 pulses on CB1,
|
||||
@ -679,20 +679,20 @@ GLOBALPROC VIA1_DoTimer1Check(void)
|
||||
iCountt NewTime = GetCuriCount();
|
||||
iCountt deltaTime = (NewTime - VIA1_T1LastTime);
|
||||
if (deltaTime != 0) {
|
||||
ui5b Temp = VIA1_D.T1C_F; /* Get Timer 1 Counter */
|
||||
ui5b deltaTemp =
|
||||
uint32_t Temp = VIA1_D.T1C_F; /* Get Timer 1 Counter */
|
||||
uint32_t deltaTemp =
|
||||
(deltaTime / CyclesPerViaTime) << (16 - kLn2CycleScale);
|
||||
/* may overflow */
|
||||
ui5b NewTemp = Temp - deltaTemp;
|
||||
uint32_t NewTemp = Temp - deltaTemp;
|
||||
if ((deltaTime > (0x00010000UL * CyclesScaledPerViaTime))
|
||||
|| ((Temp <= deltaTemp) && (Temp != 0)))
|
||||
{
|
||||
if ((VIA1_D.ACR & 0x40) != 0) { /* Free Running? */
|
||||
/* Reload Counter from Latches */
|
||||
ui4b v = (VIA1_D.T1L_H << 8) + VIA1_D.T1L_L;
|
||||
ui4b ntrans = 1 + ((v == 0) ? 0 :
|
||||
uint16_t v = (VIA1_D.T1L_H << 8) + VIA1_D.T1L_L;
|
||||
uint16_t ntrans = 1 + ((v == 0) ? 0 :
|
||||
(((deltaTemp - Temp) / v) >> 16));
|
||||
NewTemp += (((ui5b)v * ntrans) << 16);
|
||||
NewTemp += (((uint32_t)v * ntrans) << 16);
|
||||
#if Ui3rTestBit(VIA1_ORB_CanOut, 7)
|
||||
if ((VIA1_D.ACR & 0x80) != 0) { /* invert ? */
|
||||
if ((ntrans & 1) != 0) {
|
||||
@ -725,8 +725,8 @@ GLOBALPROC VIA1_DoTimer1Check(void)
|
||||
VIA1_T1IntReady = falseblnr;
|
||||
if ((VIA1_D.IFR & (1 << kIntT1)) == 0) {
|
||||
if (((VIA1_D.ACR & 0x40) != 0) || (VIA1_T1_Active == 1)) {
|
||||
ui5b NewTemp = VIA1_D.T1C_F; /* Get Timer 1 Counter */
|
||||
ui5b NewTimer;
|
||||
uint32_t NewTemp = VIA1_D.T1C_F; /* Get Timer 1 Counter */
|
||||
uint32_t NewTimer;
|
||||
#ifdef _VIA_Debug
|
||||
fprintf(stderr, "posting Timer1Check, %d, %d\n",
|
||||
Temp, GetCuriCount());
|
||||
@ -765,9 +765,9 @@ LOCALPROC CheckT1IntReady(void)
|
||||
}
|
||||
}
|
||||
|
||||
GLOBALFUNC ui4b VIA1_GetT1InvertTime(void)
|
||||
GLOBALFUNC uint16_t VIA1_GetT1InvertTime(void)
|
||||
{
|
||||
ui4b v;
|
||||
uint16_t v;
|
||||
|
||||
if ((VIA1_D.ACR & 0xC0) == 0xC0) {
|
||||
v = (VIA1_D.T1L_H << 8) + VIA1_D.T1L_L;
|
||||
@ -785,11 +785,11 @@ GLOBALPROC VIA1_DoTimer2Check(void)
|
||||
{
|
||||
if (VIA1_T2Running) {
|
||||
iCountt NewTime = GetCuriCount();
|
||||
ui5b Temp = VIA1_D.T2C_F; /* Get Timer 2 Counter */
|
||||
uint32_t Temp = VIA1_D.T2C_F; /* Get Timer 2 Counter */
|
||||
iCountt deltaTime = (NewTime - VIA1_T2LastTime);
|
||||
ui5b deltaTemp = (deltaTime / CyclesPerViaTime)
|
||||
uint32_t deltaTemp = (deltaTime / CyclesPerViaTime)
|
||||
<< (16 - kLn2CycleScale); /* may overflow */
|
||||
ui5b NewTemp = Temp - deltaTemp;
|
||||
uint32_t NewTemp = Temp - deltaTemp;
|
||||
if (VIA1_T2_Active == 1) {
|
||||
if ((deltaTime > (0x00010000UL * CyclesScaledPerViaTime))
|
||||
|| ((Temp <= deltaTemp) && (Temp != 0)))
|
||||
@ -801,7 +801,7 @@ GLOBALPROC VIA1_DoTimer2Check(void)
|
||||
dbglog_WriteNote("VIA1 Timer 2 Interrupt");
|
||||
#endif
|
||||
} else {
|
||||
ui5b NewTimer;
|
||||
uint32_t NewTimer;
|
||||
#ifdef _VIA_Debug
|
||||
fprintf(stderr, "posting Timer2Check, %d, %d\n",
|
||||
Temp, GetCuriCount());
|
||||
@ -837,7 +837,7 @@ GLOBALPROC VIA1_DoTimer2Check(void)
|
||||
#define kIER 0x0E
|
||||
#define kORA 0x0F
|
||||
|
||||
GLOBALFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
GLOBALFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr)
|
||||
{
|
||||
switch (addr) {
|
||||
case kORB :
|
||||
@ -1013,7 +1013,7 @@ GLOBALFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr)
|
||||
case kACR:
|
||||
if (WriteMem) {
|
||||
#if 1
|
||||
if ((VIA1_D.ACR & 0x10) != ((ui3b)Data & 0x10)) {
|
||||
if ((VIA1_D.ACR & 0x10) != ((uint8_t)Data & 0x10)) {
|
||||
/* shift direction has changed */
|
||||
if ((Data & 0x10) == 0) {
|
||||
/*
|
||||
|
@ -23,7 +23,7 @@
|
||||
EXPORTPROC VIA1_Zap(void);
|
||||
EXPORTPROC VIA1_Reset(void);
|
||||
|
||||
EXPORTFUNC ui5b VIA1_Access(ui5b Data, blnr WriteMem, CPTR addr);
|
||||
EXPORTFUNC uint32_t VIA1_Access(uint32_t Data, blnr WriteMem, CPTR addr);
|
||||
|
||||
EXPORTPROC VIA1_ExtraTimeBegin(void);
|
||||
EXPORTPROC VIA1_ExtraTimeEnd(void);
|
||||
@ -42,7 +42,7 @@ EXPORTPROC VIA1_iCB2_PulseNtfy(void);
|
||||
EXPORTPROC VIA1_DoTimer1Check(void);
|
||||
EXPORTPROC VIA1_DoTimer2Check(void);
|
||||
|
||||
EXPORTFUNC ui4b VIA1_GetT1InvertTime(void);
|
||||
EXPORTFUNC uint16_t VIA1_GetT1InvertTime(void);
|
||||
|
||||
EXPORTPROC VIA1_ShiftInData(ui3b v);
|
||||
EXPORTFUNC ui3b VIA1_ShiftOutData(void);
|
||||
EXPORTPROC VIA1_ShiftInData(uint8_t v);
|
||||
EXPORTFUNC uint8_t VIA1_ShiftOutData(void);
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#define VID_dolog (dbglog_HAVE && 0)
|
||||
|
||||
LOCALVAR const ui3b VidDrvr_contents[] = {
|
||||
LOCALVAR const uint8_t VidDrvr_contents[] = {
|
||||
0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x2A, 0x00, 0x00, 0x00, 0xE2, 0x00, 0xEC,
|
||||
0x00, 0xB6, 0x15, 0x2E, 0x44, 0x69, 0x73, 0x70,
|
||||
@ -89,7 +89,7 @@ LOCALPROC ChecksumSlotROM(void)
|
||||
/* assuming check sum field initialized to zero */
|
||||
int i;
|
||||
ui3p p = VidROM;
|
||||
ui5b crc = 0;
|
||||
uint32_t crc = 0;
|
||||
|
||||
for (i = kVidROM_Size; --i >= 0; ) {
|
||||
crc = ((crc << 1) | (crc >> 31)) + *p++;
|
||||
@ -99,31 +99,31 @@ LOCALPROC ChecksumSlotROM(void)
|
||||
|
||||
LOCALVAR ui3p pPatch;
|
||||
|
||||
LOCALPROC PatchAByte(ui3b v)
|
||||
LOCALPROC PatchAByte(uint8_t v)
|
||||
{
|
||||
*pPatch++ = v;
|
||||
}
|
||||
|
||||
LOCALPROC PatchAWord(ui4r v)
|
||||
LOCALPROC PatchAWord(uint16_t v)
|
||||
{
|
||||
PatchAByte(v >> 8);
|
||||
PatchAByte(v & 0x00FF);
|
||||
}
|
||||
|
||||
LOCALPROC PatchALong(ui5r v)
|
||||
LOCALPROC PatchALong(uint32_t v)
|
||||
{
|
||||
PatchAWord(v >> 16);
|
||||
PatchAWord(v & 0x0000FFFF);
|
||||
}
|
||||
|
||||
#if 0
|
||||
LOCALPROC PatchAOSLstEntry0(ui3r Id, ui5r Offset)
|
||||
LOCALPROC PatchAOSLstEntry0(uint8_t Id, uint32_t Offset)
|
||||
{
|
||||
PatchALong((Id << 24) | (Offset & 0x00FFFFFF));
|
||||
}
|
||||
#endif
|
||||
|
||||
LOCALPROC PatchAOSLstEntry(ui3r Id, ui3p Offset)
|
||||
LOCALPROC PatchAOSLstEntry(uint8_t Id, ui3p Offset)
|
||||
{
|
||||
PatchALong((Id << 24) | ((Offset - pPatch) & 0x00FFFFFF));
|
||||
}
|
||||
@ -135,7 +135,7 @@ LOCALFUNC ui3p ReservePatchOSLstEntry(void)
|
||||
return v;
|
||||
}
|
||||
|
||||
LOCALPROC PatchAReservedOSLstEntry(ui3p p, ui3r Id)
|
||||
LOCALPROC PatchAReservedOSLstEntry(ui3p p, uint8_t Id)
|
||||
{
|
||||
ui3p pPatchSave = pPatch;
|
||||
pPatch = p;
|
||||
@ -143,7 +143,7 @@ LOCALPROC PatchAReservedOSLstEntry(ui3p p, ui3r Id)
|
||||
pPatch = pPatchSave;
|
||||
}
|
||||
|
||||
LOCALPROC PatchADatLstEntry(ui3r Id, ui5r Data)
|
||||
LOCALPROC PatchADatLstEntry(uint8_t Id, uint32_t Data)
|
||||
{
|
||||
PatchALong((Id << 24) | (Data & 0x00FFFFFF));
|
||||
}
|
||||
@ -156,7 +156,7 @@ LOCALPROC PatchAnEndOfLst(void)
|
||||
GLOBALFUNC blnr Vid_Init(void)
|
||||
{
|
||||
int i;
|
||||
ui5r UsedSoFar;
|
||||
uint32_t UsedSoFar;
|
||||
|
||||
ui3p pAt_sRsrcDir;
|
||||
ui3p pTo_sRsrc_Board;
|
||||
@ -432,7 +432,7 @@ GLOBALPROC Vid_Update(void)
|
||||
}
|
||||
}
|
||||
|
||||
LOCALFUNC ui4r Vid_GetMode(void)
|
||||
LOCALFUNC uint16_t Vid_GetMode(void)
|
||||
{
|
||||
return
|
||||
#if 0 != vMacScreenDepth
|
||||
@ -441,7 +441,7 @@ LOCALFUNC ui4r Vid_GetMode(void)
|
||||
128;
|
||||
}
|
||||
|
||||
LOCALFUNC tMacErr Vid_SetMode(ui4r v)
|
||||
LOCALFUNC tMacErr Vid_SetMode(uint16_t v)
|
||||
{
|
||||
#if 0 == vMacScreenDepth
|
||||
UnusedParam(v);
|
||||
@ -454,7 +454,7 @@ LOCALFUNC tMacErr Vid_SetMode(ui4r v)
|
||||
return mnvm_noErr;
|
||||
}
|
||||
|
||||
GLOBALFUNC ui4r Vid_Reset(void)
|
||||
GLOBALFUNC uint16_t Vid_Reset(void)
|
||||
{
|
||||
#if 0 != vMacScreenDepth
|
||||
UseColorMode = falseblnr;
|
||||
@ -492,20 +492,20 @@ LOCALPROC FillScreenWithGrayPattern(void)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
ui5b *p1 = (ui5b *)VidMem;
|
||||
uint32_t *p1 = (uint32_t *)VidMem;
|
||||
|
||||
#if 0 != vMacScreenDepth
|
||||
if (UseColorMode) {
|
||||
#if 1 == vMacScreenDepth
|
||||
ui5b pat = 0xCCCCCCCC;
|
||||
uint32_t pat = 0xCCCCCCCC;
|
||||
#elif 2 == vMacScreenDepth
|
||||
ui5b pat = 0xF0F0F0F0;
|
||||
uint32_t pat = 0xF0F0F0F0;
|
||||
#elif 3 == vMacScreenDepth
|
||||
ui5b pat = 0xFF00FF00;
|
||||
uint32_t pat = 0xFF00FF00;
|
||||
#elif 4 == vMacScreenDepth
|
||||
ui5b pat = 0x00007FFF;
|
||||
uint32_t pat = 0x00007FFF;
|
||||
#elif 5 == vMacScreenDepth
|
||||
ui5b pat = 0x00000000;
|
||||
uint32_t pat = 0x00000000;
|
||||
#endif
|
||||
for (i = vMacScreenHeight; --i >= 0; ) {
|
||||
for (j = vMacScreenByteWidth >> 2; --j >= 0; ) {
|
||||
@ -525,7 +525,7 @@ LOCALPROC FillScreenWithGrayPattern(void)
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
ui5b pat = 0xAAAAAAAA;
|
||||
uint32_t pat = 0xAAAAAAAA;
|
||||
|
||||
for (i = vMacScreenHeight; --i >= 0; ) {
|
||||
for (j = vMacScreenMonoByteWidth >> 2; --j >= 0; ) {
|
||||
@ -577,7 +577,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
CPTR CntrlParams = get_vm_long(p + 8);
|
||||
CPTR csParam =
|
||||
get_vm_long(CntrlParams + CntrlParam_csParam);
|
||||
ui4r csCode =
|
||||
uint16_t csCode =
|
||||
get_vm_word(CntrlParams + CntrlParam_csCode);
|
||||
|
||||
switch (csCode) {
|
||||
@ -631,17 +631,17 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
if (UseColorMode) {
|
||||
CPTR csTable = get_vm_long(
|
||||
csParam + VDSetEntryRecord_csTable);
|
||||
ui4r csStart = get_vm_word(
|
||||
uint16_t csStart = get_vm_word(
|
||||
csParam + VDSetEntryRecord_csStart);
|
||||
ui4r csCount = 1 + get_vm_word(
|
||||
uint16_t csCount = 1 + get_vm_word(
|
||||
csParam + VDSetEntryRecord_csCount);
|
||||
|
||||
if (((ui4r) 0xFFFF) == csStart) {
|
||||
if (((uint16_t) 0xFFFF) == csStart) {
|
||||
int i;
|
||||
|
||||
result = mnvm_noErr;
|
||||
for (i = 0; i < csCount; ++i) {
|
||||
ui4r j = get_vm_word(csTable + 0);
|
||||
uint16_t j = get_vm_word(csTable + 0);
|
||||
if (j == 0) {
|
||||
/* ignore input, leave white */
|
||||
} else
|
||||
@ -653,11 +653,11 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
result = mnvm_paramErr;
|
||||
} else
|
||||
{
|
||||
ui4r r =
|
||||
uint16_t r =
|
||||
get_vm_word(csTable + 2);
|
||||
ui4r g =
|
||||
uint16_t g =
|
||||
get_vm_word(csTable + 4);
|
||||
ui4r b =
|
||||
uint16_t b =
|
||||
get_vm_word(csTable + 6);
|
||||
CLUT_reds[j] = r;
|
||||
CLUT_greens[j] = g;
|
||||
@ -687,11 +687,11 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
/* ignore input, leave black */
|
||||
} else
|
||||
{
|
||||
ui4r r =
|
||||
uint16_t r =
|
||||
get_vm_word(csTable + 2);
|
||||
ui4r g =
|
||||
uint16_t g =
|
||||
get_vm_word(csTable + 4);
|
||||
ui4r b =
|
||||
uint16_t b =
|
||||
get_vm_word(csTable + 6);
|
||||
CLUT_reds[j] = r;
|
||||
CLUT_greens[j] = g;
|
||||
@ -735,7 +735,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
#endif
|
||||
{
|
||||
#if 0
|
||||
ui4r csPage = get_vm_word(
|
||||
uint16_t csPage = get_vm_word(
|
||||
csParam + VDPageInfo_csPage);
|
||||
/* not implemented */
|
||||
#endif
|
||||
@ -749,7 +749,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
"Video_Access kCmndVideoControl, SetGray");
|
||||
#endif
|
||||
{
|
||||
ui3r csMode = get_vm_byte(
|
||||
uint8_t csMode = get_vm_byte(
|
||||
csParam + VDPageInfo_csMode);
|
||||
/*
|
||||
"Designing Cards and Drivers" book
|
||||
@ -800,7 +800,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
CPTR CntrlParams = get_vm_long(p + 8);
|
||||
CPTR csParam = get_vm_long(
|
||||
CntrlParams + CntrlParam_csParam);
|
||||
ui4r csCode = get_vm_word(
|
||||
uint16_t csCode = get_vm_word(
|
||||
CntrlParams + CntrlParam_csCode);
|
||||
|
||||
result = mnvm_statusErr;
|
||||
@ -855,7 +855,7 @@ GLOBALPROC ExtnVideo_Access(CPTR p)
|
||||
" GetPageAddr");
|
||||
#endif
|
||||
{
|
||||
ui4r csPage = get_vm_word(
|
||||
uint16_t csPage = get_vm_word(
|
||||
csParam + VDPageInfo_csPage);
|
||||
if (0 != csPage) {
|
||||
/*
|
||||
|
@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
EXPORTFUNC blnr Vid_Init(void);
|
||||
EXPORTFUNC ui4r Vid_Reset(void);
|
||||
EXPORTFUNC uint16_t Vid_Reset(void);
|
||||
EXPORTPROC Vid_Update(void);
|
||||
|
||||
EXPORTPROC ExtnVideo_Access(CPTR p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user