-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v_opnvwk() / v_opnwk shouldn't use Getrez() + 2 #89
Comments
You mean that 2 + Getrez() is wrong? Mike Fulton wrote me:For the v_opnwk() and v_opnvwk() functions, the correct input for work_in[0] is always the value of Getrez() + 2. The idea of a value of 1 meaning the current resolution is not correct. The source of this idea seems to be the common reference to device 1 in the ASSIGN.SYS file being commented as “default screen” in many examples, but that was never intended to mean “current resolution”. At least not on the Atari. Maybe on PC. This mistake is easily overlooked because in most cases there is no consequence to doing it wrong. That’s largely because the device code is actually ignored by the ROM implementation of VDI. However, if you are loading GDOS, it can cause problems with loading the correct fonts, and it can cause problems with the correct driver not being used when a non-standard display is used. This was constantly a pain in my behind back in the day. Pretty much whenever a program didn’t work right with the TT030 or Falcon030’s newer video modes, or when it didn’t work right with an add-on display of some sort, it tracked back to this as often as not. I know of at least one company that created a patch program to go along with their add-on display that grabbed the GEM trap, looked for open-workstation calls, and changed references to device 1. |
@pulsar122 that's why I linked the comment of the fVDI author, stating otherwise. And I have a personal experience with that too - in 640x480x8bpl NVDI fixes the Getrez() call but still, it's wrong. |
On Donnerstag, 18. Oktober 2018 19:42:22 CEST pulsar122 wrote:
That’s largely because the device code is actually ignored by the ROM
implementation of VDI.
The problem is, that this is not true anymore. The VDI of TOS 4.04 at least
*does* honor the device ID. And it also interprets device id 1 as synonym for
"current resolution". So imho using 1 is the correct thing to do, Getrez() +2
has absolute no meaning for device drivers of video cards, where you can have
almost any resolution in steps of 16.
|
As I'm constantly forgetting about this: freemint/freemint#102 (comment) ... fVDI in 256c crashes regardless of the |
I see https://freemint.github.io/tos.hyp/en/vdi_control.html#v_opnvwk still recommends |
Actually The Compendium differentiate between v_opnvwk: [...] work_in[0]: Device identification number. This indicates the physical device ID of the device (the line number of the driver in ASSIGN.SYS when using GDOS). For screen devices you should normally use the value of 1. v_opnwk: [...] For screen devices you should normally use the value Getrez() + 2 for the work_in[0] field, however, a value of 1 is acceptable if not using any loaded fonts. I think tos.hyp should say something similar. |
Nice explanation by Johan Klockars: http://www.fultonsoft.com/revisiting-gem-for-the-atari-st-part-1/comment-page-1/#comment-11 (at the bottom).
When using
2 + Getrez()
as recommended in toshyp on Falcon's 640x480x8 for example, VDI thinks it is 640x400x1, i.e. totally wrong.The text was updated successfully, but these errors were encountered: