Commit Graph

167 Commits

Author SHA1 Message Date
Andrea b2926390c8
Remove unused includes. (PR #1178) 2023-02-05 21:04:45 +00:00
tomcw 597cea1d86 NTSC: Change to NTSC_GetVblBar() from NTSC_GetVideoVert().
Debugger: fix video scanner position's visibility (green colour) for SHR - didn't work for lines $C0-C7.
2023-01-14 14:30:12 +00:00
tomcw d63a31a043 NTSC: only use accessors to get internal video clock vert/horz values 2023-01-14 14:08:58 +00:00
Kelvin Lee 80f3eaeb91
Various *Name() functions can simply return const std::string& (PR #1049) 2022-02-28 20:52:18 +00:00
Andrea 5fbd8339c1
Screenshot: reset file pointer to the end. (PR #1016) 2022-01-07 21:06:24 +00:00
Andrea d63e406573
Correct BMP creation on Linux (PR #1014)
Enable BMP Header packing on all compilers.
Add virtual function to FrameBase to select where to save screenshots.
2022-01-03 14:41:03 +00:00
Andrea a07ba4ade0
Set SHR alpha channel to 255 for consistency with other video modes. (PR #1010) 2021-12-11 18:05:06 +00:00
tomcw c594d6e101 VidHD: Fix SHIFT+PRINTSCRN for 320x200 2021-12-07 21:59:05 +00:00
TomCh 443545b0f6
Support SHR video modes with a VidHD card (#997, PR #1004)
Support VidHD in slot 3 (via Config GUI or '-s3 vidhd') for SHR video modes only.
- AppleWin window is slightly enlarged when VidHD card is inserted.
Support IIgs 320x200 (and fill mode) and 640x200 video modes.
Debugger: add 'shr' command to view video
CUI: Allow user to specify width & height (for full-screen); and allow separate x,y scaling in full-screen mode.
2021-11-30 21:41:02 +00:00
Andrea 816e22524f
VideoReinitialize(): remove default arg & refactor out common code (PR #911) 2021-01-13 22:02:48 +00:00
Andrea 159cde7d64
Video & FrameBase: better split (PR #908)
* Video / FrameBase: move arch specific code to FrameBase.
* Video::Initialize & SetFrameBuffer.
Ensure initialization and SetBuffer can only happen in the right order.
* Video: move virtual functions to FrameBase.
With these changes all the virtual functions are in FrameBase and Video gets closer to be (only) the Apple ][ Video device.
* Move a few more functions from Video to FrameBase (snapshot related)
Now, the inclusion is one way with Video *not* including FrameBase.
* FrameBase::VideoRefreshScreen move Video related code to Video.
And only leave management to FrameBase.
2021-01-03 16:21:24 +00:00
Andrea 9d7aa7d309
Move VideoRedrawScreen() to Video. (PR #904) 2021-01-01 12:42:24 +00:00
tomcw c7d9a780bb Minor tweaks + comment for GCC needing header file 2020-12-29 21:45:56 +00:00
Andrea d0cd7ca090
WinVideo: share some generic code (PR #901)
* WinVideo: move some generic functions back to Video.

Introduce a new virtual function (VideoPresentScreen) to draw the video buffer to video memory.

* Move Win32Frame::VideoRedrawScreen() to FrameBase as it is generic.
2020-12-29 21:30:17 +00:00
TomCh 3aa5750dcf
Make Video.cpp and WinVideo.cpp into a dependent class hierarchy (PR #898)
. class hierarchy: WinVideo IS_A Video (ie. WinVideo is a subclass of Video)
. GetVideo() singleton instance of WinVideo in AppleWin.cpp, exposed via Interface.h
2020-12-28 16:25:29 +00:00
Andrea b8296e6c9c
Frame.h: merge into Video.h. (PR #896)
. The functions GetFrameBufferXXX() have been moved next to g_pFramebufferbits.
2020-12-27 19:01:35 +00:00
Andrea e27879ac99
Move interface into a class FrameBase. (PR #893)
. Move the Win32  implementation into Win32Frame.
2020-12-24 15:08:50 +00:00
Andrea 7ca547479b
Move Windows related functions to Interface.h (PR #882)
This is not complete as header files from Windows/.. are still included in:

Keyboard.cpp
SerialComms.cpp
Joystick.cpp

But probably these are arch specific and will have to be completely reimplemented elsewhere.
2020-11-29 17:30:06 +00:00
Andrea 3d70a9dd35
Some small changes to ensure code compiles with GCC. (PR #877) 2020-11-27 20:57:35 +00:00
Andrea bbe88da787
AppleWin.cpp split (PR #875)
. Split AppleWin -> Core with the functionality really needed by the emulator.
. Split AppleWin -> Utilities for generic code not called by other emulator components.
. Split AppleWin -> CmdLine for the command line option parsing.
2020-11-26 21:50:06 +00:00
Andrea c455488b50
Split Frame.cpp to WinFrame.cpp (PR #874) 2020-11-23 19:21:20 +00:00
tomcw c79abb45eb Renamed DirectVideoInitialize/Destroy() to WinVideoInitialize/Destroy() 2020-11-21 21:13:21 +00:00
Andrea 2a7191f5ce
Split Video.cpp to WinVideo.cpp to remove most of the Win32 specific functions (PR #872)
. Moved DirectInput.cpp/h and WinVideo.cpp/h to a new "Windows" folder.
2020-11-21 20:57:56 +00:00
tomcw bd1d65ce4f Renamed Applewin.h to AppleWin.h across entire project 2020-11-11 22:12:39 +00:00
Andrea 01ad5d1882
Ensure all header files can be included (in any order) after stdafx.h. (PR #866) 2020-11-11 21:15:27 +00:00
tomcw cfe482cd52 NTSC: fix rare crash in NTSC_SetVideoMode() after a VM restart 2020-10-11 21:29:26 +01:00
tomcw 1a11c65d37 Replaced global g_CardMgr with a singleton object & GetCardMgr() call. (Fixes #843) 2020-10-11 17:34:44 +01:00
TomCh 6125c2b12d
Support for synchronous events (PR #841)
Switched Mockingboard/6522 Timer interrupts & Mousecard's VBlank interrupt to use synchronous events.
This is a linked-list of ordered timer-based event, where only the head of the list needs updating after every opcode.
2020-10-11 16:08:05 +01:00
Cyril Lambin 08458a9d29
Extended support for RGB cards (#819) (PR #837)
Video mode: "Color (RGB Card/Monitor)"
. RGB HGR rendering (no half-dot-shift, no vertical blend)
. RGB DHGR rendering
  - Color 140-mode is a real 140x192 mode with no color fringe (Video7 patent, shows that way on real hardware)
  - Mixed mode: correct transition for Color 140-mode <-> B&W (validated on a real IIc adapter.)
. Complete Féline support (eg. 2 distinct greys)
. Fixed Video7 SL7 inverse text
. Fixed DHIRES mixed mode detection
. NB. Prince of Persia will switch to B&W (560-mode) when going from HGR back to DHGR (same on real hardware).

Video mode: "Color (Composite Idealized)"
. Previously this was "Color (RGB Monitor)" (and before that, the AppleWin 1.25 "Color (Standard)")
. Now this mode does not support the extra RGB cards' video modes
2020-09-27 14:09:02 +01:00
tomcw 039ad8a547 Small refactor for app window's title 2020-08-17 19:26:06 +01:00
tomcw 221e35edc7 Changed app window's title to reflect NTSC or PAL for 'Color (xxx Monitor)' 2020-08-17 18:29:18 +01:00
TomCh 769d4c6927
Support 2nd Disk][ card and improved card management (#726) (PR #741)
Support 2nd Disk][ in slot-5, via command line:
- -s5 diskii
- -s5d1 \<imagefile\>
- -s5d2 \<imagefile\>

NB. there's currently no Configuration UI support, except the Drive icons' tooltips show what's in slot-5 & slot-6 (for drive-n). So there's no way to eject the disks or insert new disks. The use-case I'm supporting it Wasteland which just has the 4 disks in the 4 drives.

Improved card management:
- Added `class Card` (in Card.h) which all other cards (that exist as classes) derive from (eg. LC,SSC,Mouse,Disk2).
- Added `class CardManager` (in CardManager.cpp\h) which now manages the 8 slots (and aux slot).
- Added `class Disk2CardManager` (in Disk2CardManager.cpp\h) which provides methods for operations that act on all Disk2 instances at the same time.
- Currently limited to just 1x SSC and 1x Mouse card (why would you need more?). This simplifies things, meaning there's no need to have dedicated SSCManager / MouseCardManager objects.
- Currently the 2nd Disk2 card can only be put into slot-5. This limitation is just due to the complexity of the Configuration UI. Having a more general drop-down per slot UI would remove this limitation.
2019-12-19 19:42:30 +00:00
TomCh d1b595f7bd
Fix for "Mad Effect 1&2" demos (PR #725)
. 6502 interrupt delays 1 opcode when interrupt occurs on last cycle of opcode (#724).
. Only 1-cycle delay for VF_TEXT & VF_MIXED mode changes (#656).
NB. Mad Effect 1 still has a bit of flicker on Space Invader (left edge)
2019-11-16 23:49:21 +00:00
tomcw 97e73c632d Full-speed: new VideoGetVblBarEx() required when called from main loop 2019-11-11 19:55:46 +00:00
tomcw 20b8515b7b Full-speed: Only redraw video screen during VBl (support VBl in full-speed) 2019-11-10 23:52:29 +00:00
tomcw 4ad0923399 Fix video tearing by only updating during the Apple II VBL (#711) 2019-11-03 15:05:28 +00:00
Andrea Odetti f5f60310c1 More std::strings.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2019-09-07 09:02:39 +01:00
tomcw 2f6b24b970 Fixed up the Debug/Release NoDX configurations 2019-09-01 11:28:24 +01:00
tomcw fe375534cf NTSC: Commit to the improved TV modes. (#650) 2019-08-31 15:02:32 +01:00
tomcw bad963026c 1.29.1.1: test improved TV modes for #650. Use Ctrl-9 to toggle 1.29.1.0 and 1.29.1.1. 2019-08-30 21:58:03 +01:00
tomcw b54fc8a058 Reverted 8a11feb7 (#650) - missed a bit! 2019-08-26 15:56:34 +01:00
tomcw 521a09e75a Reverted 8a11feb7 (#650) 2019-08-25 19:41:30 +01:00
tomcw 2f52206e1e Merge branch 'master' of ssh://github.com/beevik/AppleWin into beevik-master 2019-08-25 17:18:23 +01:00
tomcw e09cd21703 Added experiment code for DirectDraw & WaitForVerticalBlank() - #680 2019-08-25 17:07:08 +01:00
tomcw 8a11feb739 NTSC TV video modes: adjust y-position by 1 pixel (#650) 2019-08-09 22:58:12 +01:00
Brett Vickers 9e5e21b8c9 Prevent uninitialized value bugs and improve string safety.
This change does two things:

1. Updates the registry APIs to reduce the likelihood of uninitialized
variables.

The code wasn't always checking the return value of registry load operations.
In some cases, this led to uninitialized memory being used, and crashes could
result. For example, LoadConfiguration in Applewin.cpp was using an
uninitialized value for the computer type if no registry variable for the
"Apple 2 type" was set.

New registry reading methods and macros have also been introduced, allowing
default value fallbacks for the cases where a registry variable is not found.
This makes registry access simpler and safer when a default value is known in
advance.

The registry code's style has also been updated to conform with the rest of
the code base (tabs instead of spaces, naming conventions, etc.)

2. Introduces string safety improvements.

A number of code paths have been modified to use safe-string functions instead
of their unsafe counterparts (e.g., strcpy, sprintf).  In the process, some
strings were converted from "char" to "TCHAR". This was done mostly for
consistency with the rest of the code-base.
2019-08-09 13:38:50 -07:00
tomcw 73ce127eef Removed some old commented out code 2019-06-29 17:05:07 +01:00
TomCh bd86088c59
Support 50Hz(PAL) (#648) (PR #658)
- Added Configuration GUI to include checkbox for "50Hz"
- Implicitly use PAL or NTSC base 6502 clocks depending on video refresh rate
- Added new -50hz and -60hz command line switches
- Updated save-state for video refresh rate

1.28.8.0: Updated version & history.txt
2019-06-28 21:34:34 +01:00
tomcw dbcb789442 Don't delay a PAGE1/2 video mode change (#656) 2019-06-24 22:05:32 +01:00
tomcw e6e52ffcf4 Delay any video mode change by 1 cycle (#654) 2019-06-15 18:15:00 +01:00