Revision: 45675
http://sourceforge.net/p/vice-emu/code/45675
Author: compyx
Date: 2025-05-14 08:41:08 +0000 (Wed, 14 May 2025)
Log Message:
-----------
Merge trunk (r45655:HEAD) into branch
Modified Paths:
--------------
branches/compyx/joymap-003/vice/data/hotkeys/hotkeys-cartridge.vhk
branches/compyx/joymap-003/vice/doc/vice.texi
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/iso2022.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/keymap.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/ring.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/table.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vte.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vteaccess.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vteconv.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vtedefines.hh
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vtedraw.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vtegtk.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vterowdata.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vteseq.cc
branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vtestream-file.h
branches/compyx/joymap-003/vice/src/arch/gtk3/uimachinemenu.c
branches/compyx/joymap-003/vice/src/arch/gtk3/uisettings.c
branches/compyx/joymap-003/vice/src/arch/gtk3/widgets/Makefile.am
branches/compyx/joymap-003/vice/src/arch/sdl/actions-cartridge.c
branches/compyx/joymap-003/vice/src/arch/sdl/menu_vic20cart.c
branches/compyx/joymap-003/vice/src/arch/sdl/uiimagefilereq.c
branches/compyx/joymap-003/vice/src/arch/shared/uiactions.c
branches/compyx/joymap-003/vice/src/arch/shared/uiactions.h
branches/compyx/joymap-003/vice/src/c128/c128mem.c
branches/compyx/joymap-003/vice/src/c128/c128mem.h
branches/compyx/joymap-003/vice/src/c128/c128meminit.c
branches/compyx/joymap-003/vice/src/c64/c64datasette.c
branches/compyx/joymap-003/vice/src/c64/c64mem.c
branches/compyx/joymap-003/vice/src/c64/c64mem.h
branches/compyx/joymap-003/vice/src/c64/c64meminit.c
branches/compyx/joymap-003/vice/src/c64/c64memsc.c
branches/compyx/joymap-003/vice/src/c64/cart/ltkernal.c
branches/compyx/joymap-003/vice/src/c64/cart/magicvoice.c
branches/compyx/joymap-003/vice/src/c64/vsidmem.c
branches/compyx/joymap-003/vice/src/c64/vsidmeminit.c
branches/compyx/joymap-003/vice/src/c64dtv/c64dtv-stubs.c
branches/compyx/joymap-003/vice/src/cartridge.h
branches/compyx/joymap-003/vice/src/cbm2/cbm2datasette.c
branches/compyx/joymap-003/vice/src/core/ata.c
branches/compyx/joymap-003/vice/src/datasette/datasette.h
branches/compyx/joymap-003/vice/src/drive/iec/memiec.c
branches/compyx/joymap-003/vice/src/monitor/mon_command.c
branches/compyx/joymap-003/vice/src/monitor/monitor_binary.c
branches/compyx/joymap-003/vice/src/pet/petdatasette.c
branches/compyx/joymap-003/vice/src/plus4/plus4datasette.c
branches/compyx/joymap-003/vice/src/scpu64/scpu64-stubs.c
branches/compyx/joymap-003/vice/src/scpu64/scpu64mem.c
branches/compyx/joymap-003/vice/src/scpu64/scpu64mem.h
branches/compyx/joymap-003/vice/src/scpu64/scpu64meminit.c
branches/compyx/joymap-003/vice/src/tapeport/Makefile.am
branches/compyx/joymap-003/vice/src/tapeport/tapeport.c
branches/compyx/joymap-003/vice/src/tapeport/tapeport.h
branches/compyx/joymap-003/vice/src/tools/cartconv/vic20-cartridges.c
branches/compyx/joymap-003/vice/src/vic20/cart/Makefile.am
branches/compyx/joymap-003/vice/src/vic20/cart/vic20cart.c
branches/compyx/joymap-003/vice/src/vic20/cart/vic20cartmem.c
branches/compyx/joymap-003/vice/src/vic20/cart/vic20cartmem.h
branches/compyx/joymap-003/vice/src/vic20/cart/writenow.c
branches/compyx/joymap-003/vice/src/vic20/vic20datasette.c
Added Paths:
-----------
branches/compyx/joymap-003/vice/src/arch/gtk3/widgets/settings_minimon.c
branches/compyx/joymap-003/vice/src/arch/gtk3/widgets/settings_minimon.h
branches/compyx/joymap-003/vice/src/tapeport/wordcraft-dongle.c
branches/compyx/joymap-003/vice/src/tapeport/wordcraft-dongle.h
branches/compyx/joymap-003/vice/src/vic20/cart/minimon.c
branches/compyx/joymap-003/vice/src/vic20/cart/minimon.h
Modified: branches/compyx/joymap-003/vice/data/hotkeys/hotkeys-cartridge.vhk
===================================================================
--- branches/compyx/joymap-003/vice/data/hotkeys/hotkeys-cartridge.vhk 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/data/hotkeys/hotkeys-cartridge.vhk 2025-05-14 08:41:08 UTC (rev 45675)
@@ -6,13 +6,13 @@
!if !MACOS
cart-attach <Alt>c
cart-detach <Alt><Shift>c
- !if C64 || C64SC || SCPU64 || C128
+ !if C64 || C64SC || SCPU64 || C128 || VIC20
cart-freeze <Alt>z
!endif
!else
cart-attach <Command>c
cart-detach <Command><Shift>c
- !if C64 || C64SC || SCPU64 || C128
+ !if C64 || C64SC || SCPU64 || C128 || VIC20
cart-freeze <Command>z
!endif
!endif
Modified: branches/compyx/joymap-003/vice/doc/vice.texi
===================================================================
--- branches/compyx/joymap-003/vice/doc/vice.texi 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/doc/vice.texi 2025-05-14 08:41:08 UTC (rev 45675)
@@ -8566,6 +8566,9 @@
@item 6
@tab tapecart
@tab x64, x64sc, x128
+@item 7
+@tab WordCraft dongle
+@tab xpet
@end multitable
@table @code
@@ -14375,10 +14378,221 @@
@end itemize
@node VIC20 cartridges, VIC20 memory expansions, VIC20-specific, VIC20-specific
-@subsection Using cartridge images
+@subsection Using cartridges
+
+Generally a cartridge can be enabled by attaching its respective cartridge
+image, or using the respective menu option for cartridges that do not
+require an image.
+
+@dfn{Cartridge images} are like disk images, but contain the contents of
+cartridge ROM and/or RAM images instead of disk images. Two kinds of cartridge
+images are supported:
+
+@itemize @bullet
+@item
+@file{.crt} images, as originally used by the CCS64 emulator by Per H\xE5kan Sundell
+@item
+raw @file{.bin} images, without load address
+@item
+raw @file{.prg} images, with load address
+@end itemize
+
+Use cartconv to convert .bin or .prg images to .crt format.
+
+To attach cartridges, use the ``Attach a cartridge image'' submenu. When using
+@file{.crt} images, this will work for every cartridge which is supported. For
+raw @file{.bin} or @file{.prg} images you will have to select the correct type
+of cartridge first, or use command line options.
+
+When you have successfully attached a cartridge image,
+you should then reset the machine to make sure the cartridge initializes
+itself. (Or enable the "reset on cartridge change" option).
+
+Of course, it is also possible to detach a currently attached
+cartridge image (``Detach cartridge image'').
+
+The cartridge system is organized in "Slots" to allow more than one cartridge
+connected at a time, like it can be done using an expansion port expander on
+a real VIC20 (see below).
+
+The imaginary expansion port expander is organized in 4 slots, the
+cartridges are associated with them like this:
+
+@c @node FIXME
+@subsubsection Slot 0
+
+All carts that have a passthrough connector go here. Once a "Slot 0"
+cartridge is enabled all further cartridges are connected to its respective
+passthrough port.
+
+Only one cartridge of this type can be active at a time.
+
+"Slot 0" carts have individual "enable" switches, enabling means enabling permanently.
+
+The following cartridges are emulated in this slot:
+
+@itemize @bullet
+@item
+Minimon
+@end itemize
+
+
+@c @node FIXME
+@subsubsection Slot 1
+
+Mostly RAM based cartridges which for one reason or the other might make sense
+to be enabled together with one of the "Main Slot" cartridges go here.
+
+Only one cartridge of this type can be active at a time.
+
+"Slot 1" carts have individual "enable" switches, enabling means enabling permanently
+
+Currently no cartridges use this slot
+
+
+@c @node FIXME
+@subsubsection Main Slot
+
+All other cartridges which are not pure i/o extensions go here.
+
+Only one cartridge of this type can be active at a time.
+
+Cartridges in the "Main Slot" must be explicitly set as default to enable them permanently.
+
+The following cartridges are emulated in this slot:
+
+@itemize @bullet
+@item
+generic 4KiB, 8KiB and 16KiB cartridges located at $2000, $4000, $6000, $a000, $b000 (see below)
+@item
+Behrbonz
+@item
+Final Expansion
+@item
+Megacart
+@item
+Mikro Assembler
+@item
+Rabbit tape turbo
+@item
+Super Expander
+@item
+Ultimem
+@item
+VIC Flash Plugin
+@item
+Write Now
+@end itemize
+
+
+@c @node FIXME
+@subsubsection I/O Slot
+
+All carts that are pure I/O extensions go here.
+
+Any number of "I/O Slot" Carts may be active at a time.
+
+"I/O Slot" carts have individual "enable" switches, enabling means enabling permanently.
+
+The following cartridges are emulated in this slot:
+
+@itemize @bullet
+@item
+ACIA (Swiftlink, Turbo232)
+@item
+MIDI (Passport/Syntech, Datel/Siel/JMS/C-Lab, Maplin, Namesoft, Sequential)
+@item
+RAM Expansion Module (REU)
+@item
+SID Cartridge
+@item
+VIC1112 IEEE-488 Interface
+@end itemize
+
+On top of that, xvic emulates the "Masquerade" IO expander, which make it possible
+to use (some) C64 cartridges at the VIC20:
+
+@itemize @bullet
+@item
+ACIA (Swiftlink, Turbo232)
+@item
+DigiMAX
+@item
+DS12C887 RTC
+@item
+Ethernet (The Final Ethernet, RR-Net)
+@item
+GEO-RAM
+@item
+SFX Sound Expander
+@item
+SFX Sound Sampler
+@end itemize
+
+
+@c @node FIXME
+@subsubsection Expected behaviour
+
+When the emulator is run without arguments, all settings from the config file
+should be applied and arguments override settings from the config file.
+
+When saving the settings to the config file it is expected that on the next run
+of the emulator all settings will be in the same state as they were when saved.
+
+There is an exception to this rule: the cartridge in the "Main Slot" must be
+explicitly set as default before it gets saved to the config file.
+
+@code{+cart} should disable ALL cartridges, including eventually activated REU,
+Swiftlink and all similar expansionport devices.
+
+@code{-cartXYZ} options should generally attach AND activate a cart of type XYZ.
+As a consequence, attaching carts this way which are NOT in the "Main Slot" will
+also enable the cart permanently.
+
+@c @node FIXME
+@subsubsection Common problems
+
+If attaching a cartridge does not work as expected, this may be because of various
+reasons:
+
+@itemize @bullet
+
+@item Not seldomly VIC20 related files with @code{.crt} extension found "in the wild" are
+plain binaries, and not in actual @code{.crt} format - if in doubt use @code{cartconv}
+to verify and/or fix).
+
+@item You may have unintentionally enabled more than one cartridge at once, for
+example by saving the settings with GEORAM enabled, and then later attaching a game
+cartridge from the command-line. The cartridge system will allow certain combinations,
+but (as on the real thing) not all do (can) actually work. To make sure this is
+not the case, either detach all cartridges from the menus, or use @code{+cart}
+on the command-line.
+
+@item The cartridge image might be broken. Try one from a different source. If you
+are sure the dump is ok (for example because you dumped it yourself) then make sure
+it is in proper linear order (on some cartridges, for example "capture", address and/or
+data lines at the eprom are shuffled around so a dump made with an eprom burner can not
+be used as is).
+
+@item Last not least you might have encountered a bug in the emulation. If you
+suspect this is the case, and you can still reproduce the bug after checking the
+things above, please file a bug report including the following information:
+
+@itemize @bullet
+@item attach your vicerc and a reference to the cartridge binaries
+@item if you can, comment in the respective DEBUGXYZ macros prominently defined at the
+top of these files: src/vic20/cart/vic20cart.c src/vic20/cart/vic20cartmem.c src/vic20/vic20io.c
+src/vic20/vic20export.c and then recompile. this will add debug output that might make
+it much easier to locate certain problems.
+@end itemize
+
+@end itemize
+
+@subsubsection Using cartridge images
+
As with the C64 (@pxref{C64 cartridges}), it is possible to attach
-several types of cartridge images:
+several types of generic cartridge images:
@itemize @bullet
@item
@@ -14462,6 +14676,10 @@
@item
8: Mikro Assembler
@item
+ 9: Write Now
+@item
+ 10: Minimon
+@item
- 10: SID Cartridge
@item
- 11: IEEE-4888
@@ -14648,11 +14866,27 @@
@item IEEE488
Boolean specifying whether the IEEE488 interface should be emulated or not.
-@vindex MachineVideoStandard
-@item MachineVideoStandard
-Integer that specifies the video standard of the emulated machine
-(1: PAL, 2: NTSC).
+@vindex MinimonFilename
+@item MinimonFilename
+String specifying the filename of the Minimon ROM image.
+@vindex MinimonEnabled
+@item MinimonEnabled
+Boolean specifying whether Minimon emulation is enabled.
+
+@vindex MinimonPgmSwitch
+@item MinimonPgmSwitch
+Boolean specifying whether the Minimon ROM is writeable.
+
+@vindex MinimonIoSwitch
+@item MinimonIoSwitch
+Boolean specifying whether the Minimon ROM is active in IO2/3 (default: enabled)
+
+@vindex MinimonImageWrite
+@item MinimonImageWrite
+Boolean specifying whether changes to the Minimon ROM will be written back to the
+ROM image file.
+
@end table
@c @node FIXME
@@ -14933,22 +15167,34 @@
(@code{GEORAMsize}).
(512, 1024, 2048, 4096)
-@findex -model
-@item -model <model>
-Specify the VIC20 model you want to emulate
-(@code{MachineVideoStandard}, @code{RamBlock0}, @code{RamBlock1}, @code{RamBlock2}, @code{RamBlock3} and @code{RamBlock5}).
-(vic20/vic20pal/vic20ntsc, vic21)
+@findex -minimon, +minimon
+@item -minimon
+@itemx +minimon
+Enable/Disable the Minimon expansion
+(@code{MinimonEnabled=1}, @code{MinimonEnabled=0}).
-@findex -pal
-@item -pal
-Use PAL sync factor
-(@code{MachineVideoStandard=1}).
+@findex -minimonrom
+@item -minimonrom <name>
+Specify name of Minimon ROM image (@code{MinimonFilename}).
-@findex -ntsc
-@item -ntsc
-Use NTSC sync factor
-(@code{MachineVideoStandard=2}).
+@findex -minimonrw, -minimonro
+@item -minimonrw
+@itemx -minimonro
+Save/Do not save the Minimon ROM when changed
+(@code{MinimonImageWrite=1}, @code{MinimonImageWrite=0}).
+@findex -minimonpgm, +minimonpgm
+@item -minimonpgm
+@itemx +minimonpgm
+Set/Remove the Minimon PGM switch
+(@code{MinimonPgmSwitch=1}, @code{MinimonPgmSwitch=0}).
+
+@findex -minimonio, +minimonio
+@item -minimonio
+@itemx +minimonio
+Set/Remove the Minimon IO switch
+(@code{MinimonIoSwitch=1}, @code{MinimonIoSwitch=0}).
+
@end table
@c @node FIXME
@@ -14959,6 +15205,11 @@
@table @code
+@vindex MachineVideoStandard
+@item MachineVideoStandard
+Integer that specifies the video standard of the emulated machine
+(1: PAL, 2: NTSC).
+
@vindex VICVideoCache
@item VICVideoCache
Boolean specifying whether the video cache is turned on.
@@ -15098,6 +15349,22 @@
@table @code
+@findex -model
+@item -model <model>
+Specify the VIC20 model you want to emulate
+(@code{MachineVideoStandard}, @code{RamBlock0}, @code{RamBlock1}, @code{RamBlock2}, @code{RamBlock3} and @code{RamBlock5}).
+(vic20/vic20pal/vic20ntsc, vic21)
+
+@findex -pal
+@item -pal
+Use PAL sync factor
+(@code{MachineVideoStandard=1}).
+
+@findex -ntsc
+@item -ntsc
+Use NTSC sync factor
+(@code{MachineVideoStandard=2}).
+
@findex -VICvcache, +VICvcache
@item -VICvcache
@itemx +VICvcache
@@ -16915,7 +17182,7 @@
@node Colour PET
@subsection Colour PET
The Colour PET is a simple extension by Steve Gray
-@uref{http://www.6502.org/users/sjgray/projects/colourpet/}. It exploits
+@uref{http://cbmsteve.ca/colourpet/index.html}. It exploits
the similarities and differences between the 4032 and 8032 models, to
use memory at $8800 as colour RAM.
@@ -20636,7 +20903,7 @@
@itemx exp
Print out list of attached expansion port devices.
-@item keybuf "<string>"
+@item keybuf <string>
Put the specified string into the keyboard buffer. Note that you can specify
specific keycodes by using C-style escaped hexcodes ("\x0a").
@@ -20883,9 +21150,15 @@
@item rmdir <directory>
Remove directory.
-@item attach <filename> <device>
+@item attach "<filename>" <device>
Attach file to device. (device 32 = cart)
+@item autostart "<filename>" [file_index]
+Autostart a given disk/tape image or program.
+
+@item autoload "<filename>" [file_index]
+Autoload given disk/tape image or program.
+
@item block_read <track> <sector> [<address>]
@itemx br <track> <sector> [<address>]
Read the block at the specified track and sector. If an address is
@@ -20907,7 +21180,7 @@
drive implementation. As a consequence, all limitations of the virtual drives
apply. Use the regular monitor commands to eg execute code in the drive.
-@item list [<directory>]
+@item list [<device>]
List disk contents.
@item load "<filename>" <device> [<address>]
@@ -23609,6 +23882,8 @@
Final Expansion
@item mega
Mega-Cart
+@item mini
+Minimon
@item ma
Mikro Assembler
@item rabbit
@@ -35268,6 +35543,50 @@
@c FIXME: cartridge details
@c @node FIXME
+@subsubsection 10 - Minimon
+
+@multitable @columnfractions .3 .7
+@item Size
+@tab 2KiB (ROM)
+@end multitable
+
+@example
+ 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ASCII
+ ----------------------------------------------- ----------------
+ 0000: 56 49 43 32 30 20 43 41 52 54 52 49 44 47 45 20 VIC20 CARTRIDGE
+ 0010: 00 00 00 40 02 00 00 0a 00 00 00 00 00 00 00 00 ...@............
+ 0020: 4d 69 6e 69 6d 6f 6e 00 00 00 00 00 00 00 00 00 Minimon.........
+ 0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+ 0040: 43 48 49 50 00 00 08 10 00 00 00 00 98 00 08 00 CHIP............
+ 0050: 20 a2 9f a2 00 8e 12 01 20 e2 9f 0d 4d 4f 4e 49 ....... ...MONI
+ 0060: 54 4f 52 0d 00 90 14 d8 a2 05 68 9d 10 01 ca 10 TOR.......h.....
+ 0070: f9 20 e2 9f 0d 42 52 45 41 4b 00 a9 c0 85 9d ba . ...BREAK......
+ 0080: 8e 16 01 a9 00 85 c1 85 c2 58 20 e2 9f 0d 20 20 .........X ...
+ 0090: 50 43 20 20 53 52 20 41 43 20 58 52 20 59 52 20 PC SR AC XR YR
+
+@dots{}
+ 0830: ff ff 68 85 22 68 85 23 e6 22 d0 02 e6 23 a0 00 ..h."h.#."...#..
+ 0840: b1 22 f0 05 20 d2 ff 90 ef a5 23 48 a5 22 48 60 .".. .....#H."H`
+@end example
+
+This cartridge maps 2KiB ROM into the IO2 and IO3 area ($9800 - $9fff). It (the
+monitor) can be started by SYS38912.
+
+The cartridge has two switches:
+
+@itemize @bullet
+@item PGM: when enabled, the memory in the socket can be written to (when it is SRAM
+ or EEPROM)
+@item CART/MON: when in MON position, the ROM is mapped into IO. in CART position
+ the IO is mapped transparent to the pass through port.
+@end itemize
+
+"Freeze" (a long press on the reset button on the original cartridge) will
+trigger a reset, and inhibit reads to BLK5 for ~300ms, to prevent a CBMA0 cart
+from starting.
+
+
+@c @node FIXME
@subsection PLUS4 Cartridge Specifics
@multitable @columnfractions .1 .9
@@ -36167,12 +36486,14 @@
@b{Olaf Seibert}
Contributed some PET, including PET DWW hires, Xaw, lightpen,
hardware scaling, and disk drive patches. Added proper SuperPET
-support, including 6809/6309 CPU emulation. Maintained the Xaw UI.
+support, including 6809/6309 CPU emulation and 6702 'dongle' chip.
+Maintained the Xaw UI.
Added PET HRE (High Res Emulator) board emulation. Added the
2-chip colour board for the Universal PET mainboard. Added
support for 'printer/plotter' Commodore 1520. Overhauled internals
of VIA and CIA code. Corrected pre-CRTC PET display timing.
REL-file support for the filesystem device and c1541.
+Added WordCraft dongle.
@item
@b{Marcus Sutton}
Modified: branches/compyx/joymap-003/vice/src/arch/gtk3/novte/iso2022.cc
===================================================================
--- branches/compyx/joymap-003/vice/src/arch/gtk3/novte/iso2022.cc 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/src/arch/gtk3/novte/iso2022.cc 2025-05-14 08:41:08 UTC (rev 45675)
@@ -170,7 +170,7 @@
/* skip blanks -- TODOegmont: why here? */
j = gunichars->len;
- g_array_set_size(gunichars, gunichars->len + outbuf-buf);
+ g_array_set_size(gunichars, (guint)(gunichars->len + (outbuf - buf)));
for (i = 0; buf + i < outbuf; i++) {
c = buf[i];
if (G_UNLIKELY (c == '\0')) {
Modified: branches/compyx/joymap-003/vice/src/arch/gtk3/novte/keymap.cc
===================================================================
--- branches/compyx/joymap-003/vice/src/arch/gtk3/novte/keymap.cc 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/src/arch/gtk3/novte/keymap.cc 2025-05-14 08:41:08 UTC (rev 45675)
@@ -943,7 +943,7 @@
char **normal,
gssize *normal_length)
{
- int modifier, offset;
+ int modifier; ssize_t offset;
char *nnormal;
enum _vte_modifier_encoding_method modifier_encoding_method;
guint significant_modifiers;
Modified: branches/compyx/joymap-003/vice/src/arch/gtk3/novte/ring.cc
===================================================================
--- branches/compyx/joymap-003/vice/src/arch/gtk3/novte/ring.cc 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/src/arch/gtk3/novte/ring.cc 2025-05-14 08:41:08 UTC (rev 45675)
@@ -1012,7 +1012,7 @@
if (position >= ring->end) {
offset->text_offset = _vte_stream_head (ring->text_stream) + position - ring->end;
offset->fragment_cells = 0;
- offset->eol_cells = column;
+ offset->eol_cells = (gint)column;
return TRUE;
}
@@ -1056,7 +1056,7 @@
for (i = 0, cell = row->cells; i < row->len && i < column; i++, cell++) {
if (G_LIKELY (!cell->attr.fragment())) {
if (G_UNLIKELY (i + cell->attr.columns() > column)) {
- offset->fragment_cells = column - i;
+ offset->fragment_cells = (gint) (column - i);
break;
}
num_chars += _vte_unistr_strlen(cell->c);
@@ -1063,7 +1063,7 @@
}
}
if (i >= row->len) {
- offset->eol_cells = column - i;
+ offset->eol_cells = (gint) (column - i);
}
/* count the number of UTF-8 bytes for the given number of characters */
@@ -1134,7 +1134,7 @@
/* row and buffer now contain the same text, in different representation */
/* count the number of characters for the given UTF-8 text offset */
- off = offset->text_offset - records[0].text_start_offset;
+ off = (unsigned int) (offset->text_offset - records[0].text_start_offset);
num_chars = 0;
for (i = 0; i < off && i < buffer->len; i++) {
if ((buffer->str[i] & 0xC0) != 0x80) {
@@ -1343,7 +1343,7 @@
if (paragraph_is_ascii) {
/* Shortcut for quickly wrapping ASCII (excluding TAB) text.
Don't read text_stream, and advance by a whole row of characters. */
- int len = MIN(runlength, (gsize) (columns - col));
+ ssize_t len = MIN(runlength, (gsize) (columns - col));
col += len;
text_offset += len;
paragraph_len -= len;
@@ -1351,7 +1351,7 @@
} else {
/* Process one character only. */
char textbuf[6]; /* fits at least one UTF-8 character */
- int textbuf_len;
+ ssize_t textbuf_len;
col += attr_change.attr.columns();
/* Find beginning of next UTF-8 character */
text_offset++; paragraph_len--; runlength--;
Modified: branches/compyx/joymap-003/vice/src/arch/gtk3/novte/table.cc
===================================================================
--- branches/compyx/joymap-003/vice/src/arch/gtk3/novte/table.cc 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/src/arch/gtk3/novte/table.cc 2025-05-14 08:41:08 UTC (rev 45675)
@@ -94,7 +94,7 @@
info = head->list;
head->list = last->next;
if (last >= &head->stack[0] && last < &head->stack[G_N_ELEMENTS(head->stack)]){
- head->stack_allocated = last - &head->stack[0];
+ head->stack_allocated = (guint) (last - &head->stack[0]); /* FIXME */
}
do {
struct _vte_table_arginfo *next = info->next;
@@ -211,7 +211,7 @@
}
table->handler = handler;
g_free(table->original);
- table->original = (unsigned char *) g_memdup(original, original_length);
+ table->original = (unsigned char *) g_memdup(original, (guint)original_length);
table->original_length = original_length;
return;
}
@@ -242,11 +242,11 @@
int initial;
GByteArray *b;
- initial = original_length - length;
+ initial = (int) (original_length - length); /* FIXME */
b = g_byte_array_new();
g_byte_array_set_size(b, 0);
g_byte_array_append(b, original, initial);
- g_byte_array_append(b, (const guint8*)pattern + 2, length - 2);
+ g_byte_array_append(b, (const guint8*)pattern + 2, (guint)(length - 2));
_vte_table_addi(table, b->data, b->len, (const char *)b->data + initial,
b->len - initial, handler);
g_byte_array_free(b, TRUE);
Modified: branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vte.cc
===================================================================
--- branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vte.cc 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vte.cc 2025-05-14 08:41:08 UTC (rev 45675)
@@ -349,13 +349,13 @@
* by multiplying by the size of a character cell.
* Always include the extra pixel border and overlap pixel.
*/
- rect.x = column_start * m_cell_width - 1;
+ rect.x = (int)(column_start * (m_cell_width - 1));
/* The extra + 1 is for the faux-bold overdraw */
- int xend = (column_start + n_columns) * m_cell_width + 1 + 1;
+ int xend = (int)(((column_start + n_columns) * m_cell_width) + 1 + 1);
rect.width = xend - rect.x;
- rect.y = row_to_pixel(row_start) - 1;
- int yend = row_to_pixel(row_start + n_rows) + 1;
+ rect.y = (int)(row_to_pixel(row_start) - 1);
+ int yend = (int)(row_to_pixel(row_start + n_rows) + 1);
rect.height = yend - rect.y;
_vte_debug_print (VTE_DEBUG_UPDATES, "Invalidating pixels at (%d,%d)x(%d,%d).\n",
@@ -385,11 +385,11 @@
bool block)
{
if (block || srow == erow) {
- invalidate_cells(scolumn, ecolumn - scolumn + 1, srow, erow - srow + 1);
+ invalidate_cells(scolumn, (int)(ecolumn - scolumn + 1), srow, (int)(erow - srow + 1));
} else {
- invalidate_cells(scolumn, m_column_count - scolumn, srow, 1);
- invalidate_cells(0, m_column_count, srow + 1, erow - srow - 1);
- invalidate_cells(0, ecolumn + 1, erow, 1);
+ invalidate_cells(scolumn, (int)(m_column_count - scolumn), srow, 1);
+ invalidate_cells(0, (int)m_column_count, srow + 1, (int)(erow - srow - 1));
+ invalidate_cells(0, (int)ecolumn + 1, erow, 1);
}
}
@@ -450,8 +450,8 @@
/* We have to repaint the area which is to be
* scrolled. */
invalidate_cells(
- 0, m_column_count,
- row, count);
+ 0, (int)m_column_count,
+ row, (int)count);
}
}
@@ -607,7 +607,7 @@
if (cell->c != 0) {
int right;
_vte_draw_get_char_edges(m_draw, cell->c, columns, style, NULL, &right);
- columns = MAX(columns, howmany(right, m_cell_width));
+ columns = MAX(columns, howmany(right, ((int)m_cell_width)));
}
}
}
@@ -647,7 +647,7 @@
auto style = _vte_draw_get_style(cell->attr.bold(), cell->attr.italic());
if (cell->c != 0) {
int right;
- _vte_draw_get_char_edges(m_draw, cell->c, columns, style, NULL, &right);
+ _vte_draw_get_char_edges(m_draw, cell->c, (int)columns, style, NULL, &right);
columns = MAX(columns, howmany(right, m_cell_width));
}
}
@@ -658,7 +658,7 @@
_vte_debug_print(VTE_DEBUG_UPDATES, "Invalidating cursor at (%ld,%ld-%ld).\n",
row, column, column + columns);
- invalidate_cells(column, columns, row, 1);
+ invalidate_cells(column, (int)columns, row, 1);
}
}
@@ -870,10 +870,10 @@
emit_selection_changed();
- sx = m_selection_start.col;
- sy = m_selection_start.row;
- ex = m_selection_end.col;
- ey = m_selection_end.row;
+ sx = (gint)m_selection_start.col;
+ sy = (gint)m_selection_start.row;
+ ex = (gint)m_selection_end.col;
+ ey = (gint)m_selection_end.row;
extra = m_selection_block_mode ? (VTE_TAB_WIDTH_MAX - 1) : 0;
invalidate_region(MIN (sx, ex), MAX (sx, ex) + extra,
MIN (sy, ey), MAX (sy, ey),
@@ -1102,7 +1102,7 @@
return NULL;
}
- _vte_ring_get_hyperlink_at_position(m_screen->row_data, row, col, false, &hyperlink);
+ _vte_ring_get_hyperlink_at_position(m_screen->row_data, row, (int)col, false, &hyperlink);
if (hyperlink != NULL) {
/* URI is after the first semicolon */
@@ -1374,7 +1374,7 @@
NULL);
if (obuf2 != NULL) {
_vte_byte_array_clear(m_outgoing);
- _vte_byte_array_append(m_outgoing, obuf2, bytes_written);
+ _vte_byte_array_append(m_outgoing, obuf2, (guint)bytes_written);
g_free(obuf2);
}
g_free(obuf1);
@@ -1427,9 +1427,9 @@
/* Figure out how many rows we need to add. */
//FIXMEchpe use long, not int
- int delta = m_screen->cursor.row - _vte_ring_next(m_screen->row_data) + 1;
+ ssize_t delta = m_screen->cursor.row - _vte_ring_next(m_screen->row_data) + 1;
if (delta > 0) {
- row = insert_rows(delta);
+ row = insert_rows((int)delta);
adjust_adjustments();
} else {
/* Find the row the cursor is in. */
@@ -1457,7 +1457,7 @@
auto rows = _vte_ring_next(m_screen->row_data);
auto delta = m_screen->cursor.row - rows + 1;
if (G_UNLIKELY (delta > 0)) {
- insert_rows(delta);
+ insert_rows((guint)delta);
rows = _vte_ring_next(m_screen->row_data);
}
@@ -1671,7 +1671,7 @@
color.red += 0x3fff;
}
} else if (i < 232) {
- int j = i - 16;
+ int j = (int)(i - 16);
int r = j / 36, g = (j / 6) % 6, b = j % 6;
int red = (r == 0) ? 0 : r * 40 + 55;
int green = (g == 0) ? 0 : g * 40 + 55;
@@ -1680,7 +1680,7 @@
color.green = green | green << 8;
color.blue = blue | blue << 8;
} else if (i < 256) {
- int shade = 8 + (i - 232) * 10;
+ int shade = (int)(8 + (i - 232) * 10);
color.red = color.green = color.blue = shade | shade << 8;
} else switch (i) {
case VTE_DEFAULT_BG:
@@ -1725,9 +1725,9 @@
/* Set up the color entry. */
if (unset) {
- reset_color(i, VTE_COLOR_SOURCE_API);
+ reset_color((int)i, VTE_COLOR_SOURCE_API);
} else {
- set_color(i, VTE_COLOR_SOURCE_API, color);
+ set_color((int)i, VTE_COLOR_SOURCE_API, color);
}
}
}
@@ -1932,7 +1932,7 @@
cell_end->c = '\t';
cell_end->attr.set_fragment(false);
g_assert(cell_col->attr.columns() > end - col);
- cell_end->attr.set_columns(cell_col->attr.columns() - (end - col));
+ cell_end->attr.set_columns((int)(cell_col->attr.columns() - (end - col)));
} else {
_vte_debug_print(VTE_DEBUG_MISC,
"Cleaning CJK right half at %ld\n",
@@ -2014,7 +2014,7 @@
ring_insert(end, true);
/* Update the display. */
scroll_region(start, end - start + 1, -1);
- invalidate_cells(0, m_column_count, end - 2, 2);
+ invalidate_cells(0, (int)m_column_count, end - 2, 2);
}
} else {
/* Scroll up with history. */
@@ -2293,7 +2293,7 @@
/* Signal that this part of the window needs drawing. */
if (G_UNLIKELY (invalidate_now)) {
invalidate_cells(col - columns,
- insert ? m_column_count : columns,
+ insert ? (int)m_column_count : columns,
m_screen->cursor.row, 1);
}
@@ -2383,7 +2383,7 @@
if (G_UNLIKELY (processed != chunk->len)) {
/* shuffle the data about */
g_memmove (chunk->data, chunk->data + processed, chunk->len - processed);
- chunk->len = chunk->len - processed;
+ chunk->len = (guint)(chunk->len - processed);
processed = sizeof (chunk->data) - chunk->len;
if (processed != 0 && next_chunk != NULL) {
if (next_chunk->len <= processed) {
@@ -2492,10 +2492,10 @@
m_screen->cursor.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK))) {
/* Clip off any part of the box which isn't already on-screen. */
bbox_topleft.x = MAX(bbox_topleft.x, 0);
- bbox_topleft.y = MAX(bbox_topleft.y, top_row);
- bbox_bottomright.x = MIN(bbox_bottomright.x, m_column_count);
+ bbox_topleft.y = MAX(bbox_topleft.y, ((int)top_row));
+ bbox_bottomright.x = MIN(bbox_bottomright.x, ((gint)m_column_count));
/* lazily apply the +1 to the cursor_row */
- bbox_bottomright.y = MIN(bbox_bottomright.y + 1, bottom_row + 1);
+ bbox_bottomright.y = MIN(bbox_bottomright.y + 1, ((gint)(bottom_row + 1)));
invalidate_cells(bbox_topleft.x,
bbox_bottomright.x - bbox_topleft.x,
@@ -2521,10 +2521,10 @@
if ((c != *next) &&
((*next & 0x1f) == *next) &&
//FIXMEchpe what about C1 controls
- (start + 1 < next - wbuf)) {
+ ((start + 1) < (next - wbuf))) {
const gunichar *tnext = NULL;
gunichar ctrl;
- int i;
+ ptrdiff_t i;
/* We don't want to permute it if it's another
* control sequence, so check if it is. */
sequence_handler_t thandler;
@@ -2536,13 +2536,13 @@
NULL);
/* We only do this for non-control-sequence
* characters and random garbage. */
- if (tnext == next + 1) {
+ if (tnext == (next + 1)) {
/* Save the control character. */
ctrl = *next;
/* Move everything before it up a
* slot. */
/* FIXMEchpe memmove! */
- for (i = next - wbuf; i > start; i--) {
+ for (i = (next - wbuf); i > start; i--) {
wbuf[i] = wbuf[i - 1];
}
/* Move the control character to the
@@ -2566,8 +2566,8 @@
}
}
- bbox_topleft.x = MIN(bbox_topleft.x, m_screen->cursor.col);
- bbox_topleft.y = MIN(bbox_topleft.y, m_screen->cursor.row);
+ bbox_topleft.x = MIN(bbox_topleft.x, ((gint)m_screen->cursor.col));
+ bbox_topleft.y = MIN(bbox_topleft.y, ((int)m_screen->cursor.row));
/* Insert the character. */
/* FIXMEchpe should not use UNLIKELY here */
@@ -2580,10 +2580,10 @@
m_screen->cursor.row < bbox_topleft.y - VTE_CELL_BBOX_SLACK)) {
/* Clip off any part of the box which isn't already on-screen. */
bbox_topleft.x = MAX(bbox_topleft.x, 0);
- bbox_topleft.y = MAX(bbox_topleft.y, top_row);
- bbox_bottomright.x = MIN(bbox_bottomright.x, m_column_count);
+ bbox_topleft.y = MAX(bbox_topleft.y, ((gint)top_row));
+ bbox_bottomright.x = MIN(bbox_bottomright.x, ((gint)m_column_count));
/* lazily apply the +1 to the cursor_row */
- bbox_bottomright.y = MIN(bbox_bottomright.y + 1, bottom_row + 1);
+ bbox_bottomright.y = MIN(bbox_bottomright.y + 1, ((gint)(bottom_row + 1)));
invalidate_cells(bbox_topleft.x,
bbox_bottomright.x - bbox_topleft.x,
@@ -2593,13 +2593,13 @@
bbox_topleft.x = bbox_topleft.y = G_MAXINT;
}
bbox_topleft.x = MIN(bbox_topleft.x, 0);
- bbox_topleft.y = MIN(bbox_topleft.y, m_screen->cursor.row);
+ bbox_topleft.y = MIN(bbox_topleft.y, ((int)m_screen->cursor.row));
}
/* Add the cells over which we have moved to the region
* which we need to refresh for the user. */
- bbox_bottomright.x = MAX(bbox_bottomright.x, m_screen->cursor.col);
+ bbox_bottomright.x = MAX(bbox_bottomright.x, ((int)m_screen->cursor.col));
/* cursor.row + 1 (defer until inv.) */
- bbox_bottomright.y = MAX(bbox_bottomright.y, m_screen->cursor.row);
+ bbox_bottomright.y = MAX(bbox_bottomright.y, ((int)m_screen->cursor.row));
invalidated_text = TRUE;
/* We *don't* emit flush pending signals here. */
@@ -2614,7 +2614,7 @@
* data to consult. If we have data following the
* middle of the sequence, then it's just garbage data,
* and for compatibility, we should discard it. */
- if (wbuf + wcount > next) {
+ if ((wbuf + wcount) > next) {
_vte_debug_print(VTE_DEBUG_PARSE,
"Invalid control "
"sequence, discarding %ld "
@@ -2649,7 +2649,7 @@
/* Remove most of the processed characters. */
if (start < wcount) {
- g_array_remove_range(m_pending, 0, start);
+ g_array_remove_range(m_pending, 0, (guint)start);
} else {
g_array_set_size(m_pending, 0);
/* If we're out of data, we needn't pause to let the
@@ -2690,10 +2690,10 @@
if (invalidated_text) {
/* Clip off any part of the box which isn't already on-screen. */
bbox_topleft.x = MAX(bbox_topleft.x, 0);
- bbox_topleft.y = MAX(bbox_topleft.y, top_row);
- bbox_bottomright.x = MIN(bbox_bottomright.x, m_column_count);
+ bbox_topleft.y = MAX(bbox_topleft.y, ((gint)top_row));
+ bbox_bottomright.x = MIN(bbox_bottomright.x, (gint)m_column_count);
/* lazily apply the +1 to the cursor_row */
- bbox_bottomright.y = MIN(bbox_bottomright.y + 1, bottom_row + 1);
+ bbox_bottomright.y = MIN(bbox_bottomright.y + 1, ((gint)bottom_row + 1));
invalidate_cells(bbox_topleft.x,
bbox_bottomright.x - bbox_topleft.x,
@@ -2948,11 +2948,11 @@
}
cairo_rectangle_int_t rect;
- rect.x = m_screen->cursor.col * m_cell_width + m_padding.left +
- get_preedit_width(false) * m_cell_width;
- rect.width = m_cell_width; /* FIXMEchpe: if columns > 1 ? */
- rect.y = row_to_pixel(m_screen->cursor.row) + m_padding.top;
- rect.height = m_cell_height;
+ rect.x = (int)(m_screen->cursor.col * m_cell_width + m_padding.left +
+ get_preedit_width(false) * m_cell_width);
+ rect.width = (int)m_cell_width; /* FIXMEchpe: if columns > 1 ? */
+ rect.y = (int)(row_to_pixel(m_screen->cursor.row) + m_padding.top);
+ rect.height = (int)m_cell_height;
gtk_im_context_set_cursor_location(m_im_context, &rect);
}
@@ -4042,10 +4042,10 @@
g_assert (top != LONG_MAX && bottom != -1 && left != LONG_MAX && right != -1);
auto allocation = get_allocated_rect();
- bbox->x = allocation.x + m_padding.left + left * m_cell_width;
- bbox->y = allocation.y + m_padding.top + row_to_pixel(top);
- bbox->width = (right - left + 1) * m_cell_width;
- bbox->height = (bottom - top + 1) * m_cell_height;
+ bbox->x = (int)(allocation.x + m_padding.left + left * m_cell_width);
+ bbox->y = (int)(allocation.y + m_padding.top + row_to_pixel(top));
+ bbox->width = (int)((right - left + 1) * m_cell_width);
+ bbox->height = (int)((bottom - top + 1) * m_cell_height);
_vte_debug_print (VTE_DEBUG_HYPERLINK,
"Hyperlink bounding box: x=%d y=%d w=%d h=%d\n",
bbox->x, bbox->y, bbox->width, bbox->height);
@@ -4104,7 +4104,7 @@
* the pseudo idx VTE_HYPERLINK_IDX_TARGET_IN_STREAM and now a real idx is allocated.
* Plus, the ring's internal belief of the hovered hyperlink is also updated. */
if (do_check_hilite) {
- m_hyperlink_hover_idx = _vte_ring_get_hyperlink_at_position(m_screen->row_data, rowcol.row(), rowcol.column(), true, &m_hyperlink_hover_uri);
+ m_hyperlink_hover_idx = _vte_ring_get_hyperlink_at_position(m_screen->row_data, rowcol.row(), (int)rowcol.column(), true, &m_hyperlink_hover_uri);
} else {
m_hyperlink_hover_idx = 0;
m_hyperlink_hover_uri = nullptr;
@@ -4229,7 +4229,7 @@
if (info == VTE_TARGET_TEXT) {
gtk_selection_data_set_text(data,
m_selection[sel]->str,
- m_selection[sel]->len);
+ (gint)m_selection[sel]->len);
} else if (info == VTE_TARGET_HTML) {
gsize len;
auto selection = text_to_utf16_mozilla(m_selection[sel], &len);
@@ -4239,7 +4239,7 @@
gdk_atom_intern_static_string("text/html"),
16,
(const guchar *)selection,
- len);
+ (gint)len);
}
g_free(selection);
} else {
@@ -4361,7 +4361,7 @@
* attributes, one per byte. */
if (attributes) {
vte_g_array_fill(attributes,
- &attr, string->len);
+ &attr, (guint)(string->len));
}
}
@@ -4392,7 +4392,7 @@
if (pcell == NULL) {
g_string_truncate(string, last_nonempty);
if (attributes) {
- g_array_set_size(attributes, string->len);
+ g_array_set_size(attributes, (guint)string->len);
}
attr.column = last_nonemptycol;
}
@@ -4418,7 +4418,7 @@
/* Make sure that the attributes array is as long as the string. */
if (attributes) {
- vte_g_array_fill (attributes, &attr, string->len);
+ vte_g_array_fill (attributes, &attr, (guint)(string->len));
}
}
@@ -5768,9 +5768,9 @@
case GDK_MOTION_NOTIFY:
if (m_selecting_after_threshold) {
if (!gtk_drag_check_threshold (m_widget,
- m_mouse_last_position.x,
- m_mouse_last_position.y,
- pos.x, pos.y)) {
+ (gint)m_mouse_last_position.x,
+ (gint)m_mouse_last_position.y,
+ (gint)pos.x, (gint)pos.y)) {
return true;
}
@@ -6192,7 +6192,7 @@
}
/* Emit a signal that the font changed. */
if (cresize) {
- emit_char_size_changed(m_cell_width, m_cell_height);
+ emit_char_size_changed((int)m_cell_width, (int)m_cell_height);
}
/* Repaint. */
invalidate_all();
@@ -6428,7 +6428,7 @@
drop3 = old_top_lines - new_top_lines;
drop = MIN(MIN(drop1, drop2), drop3);
if (drop > 0) {
- int new_ring_next = screen_->insert_delta + m_row_count - drop;
+ long new_ring_next = screen_->insert_delta + m_row_count - drop;
_vte_debug_print(VTE_DEBUG_RESIZE,
"Dropping %ld [== MIN(%ld, %ld, %ld)] rows at the bottom\n",
drop, drop1, drop2, drop3);
@@ -6814,13 +6814,11 @@
#if 0
refresh_size(); /* FIXME */
#endif
- *minimum_width = m_cell_width * 1;
- *natural_width = m_cell_width * m_column_count;
+ *minimum_width = (int)(m_cell_width * 1);
+ *natural_width = (int)(m_cell_width * m_column_count);
- *minimum_width += m_padding.left +
- m_padding.right;
- *natural_width += m_padding.left +
- m_padding.right;
+ *minimum_width += (int)(m_padding.left + m_padding.right);
+ *natural_width += (int)(m_padding.left + m_padding.right);
_vte_debug_print(VTE_DEBUG_WIDGET_SIZE,
"[Terminal %p] minimum_width=%d, natural_width=%d for %ldx%ld cells (padding %d,%d;%d,%d).\n",
@@ -6842,13 +6840,11 @@
refresh_size(); /* FIXME */
#endif
- *minimum_height = m_cell_height * 1;
- *natural_height = m_cell_height * m_row_count;
+ *minimum_height = (int)(m_cell_height * 1);
+ *natural_height = (int)(m_cell_height * m_row_count);
- *minimum_height += m_padding.top +
- m_padding.bottom;
- *natural_height += m_padding.top +
- m_padding.bottom;
+ *minimum_height += m_padding.top + m_padding.bottom;
+ *natural_height += m_padding.top + m_padding.bottom;
_vte_debug_print(VTE_DEBUG_WIDGET_SIZE,
"[Terminal %p] minimum_height=%d, natural_height=%d for %ldx%ld cells (padding %d,%d;%d,%d).\n",
@@ -7106,7 +7102,7 @@
* and also put text/html on if it's VTE_FORMAT_HTML */
gtk_clipboard_set_text(m_clipboard[sel],
m_selection[sel]->str,
- m_selection[sel]->len);
+ (gint)(m_selection[sel]->len));
}
g_string_free(m_selection[sel], TRUE);
m_selection[sel] = nullptr;
@@ -7509,9 +7505,9 @@
case 1:
_vte_draw_draw_line(m_draw,
x,
- y + m_underline_position,
+ (int)(y + m_underline_position),
x + (columns * column_width) - 1,
- y + m_underline_position + m_underline_thickness - 1,
+ (int)(y + m_underline_position + m_underline_thickness - 1),
VTE_LINE_WIDTH,
&dc, VTE_DRAW_OPAQUE);
break;
@@ -7518,16 +7514,16 @@
case 2:
_vte_draw_draw_line(m_draw,
x,
- y + m_double_underline_position,
+ (int)(y + m_double_underline_position),
x + (columns * column_width) - 1,
- y + m_double_underline_position + m_double_underline_thickness - 1,
+ (int)(y + m_double_underline_position + m_double_underline_thickness - 1),
VTE_LINE_WIDTH,
&dc, VTE_DRAW_OPAQUE);
_vte_draw_draw_line(m_draw,
x,
- y + m_double_underline_position + 2 * m_double_underline_thickness,
+ (int)(y + m_double_underline_position + 2 * m_double_underline_thickness),
x + (columns * column_width) - 1,
- y + m_double_underline_position + 3 * m_double_underline_thickness - 1,
+ (int)(y + m_double_underline_position + 3 * m_double_underline_thickness - 1),
VTE_LINE_WIDTH,
&dc, VTE_DRAW_OPAQUE);
break;
@@ -7543,9 +7539,9 @@
if (attr & VTE_ATTR_STRIKETHROUGH) {
_vte_draw_draw_line(m_draw,
x,
- y + m_strikethrough_position,
+ (int)(y + m_strikethrough_position),
x + (columns * column_width) - 1,
- y + m_strikethrough_position + m_strikethrough_thickness - 1,
+ (int)(y + m_strikethrough_position + m_strikethrough_thickness - 1),
VTE_LINE_WIDTH,
&fg, VTE_DRAW_OPAQUE);
}
@@ -7552,9 +7548,9 @@
if (attr & VTE_ATTR_OVERLINE) {
_vte_draw_draw_line(m_draw,
x,
- y + m_overline_position,
+ (int)(y + m_overline_position),
x + (columns * column_width) - 1,
- y + m_overline_position + m_overline_thickness - 1,
+ (int)(y + m_overline_position + m_overline_thickness - 1),
VTE_LINE_WIDTH,
&fg, VTE_DRAW_OPAQUE);
}
@@ -7561,9 +7557,9 @@
if (hilite) {
_vte_draw_draw_line(m_draw,
x,
- y + m_regex_underline_position,
+ (int)(y + m_regex_underline_position),
x + (columns * column_width) - 1,
- y + m_regex_underline_position + m_regex_underline_thickness - 1,
+ (int)(y + m_regex_underline_position + m_regex_underline_thickness - 1),
VTE_LINE_WIDTH,
&fg, VTE_DRAW_OPAQUE);
} else if (hyperlink) {
@@ -7570,9 +7566,9 @@
for (double j = 1.0 / 6.0; j < columns; j += 0.5) {
_vte_draw_fill_rectangle(m_draw,
x + j * column_width,
- y + m_regex_underline_position,
+ (int)(y + m_regex_underline_position),
MAX(column_width / 6.0, 1.0),
- m_regex_underline_thickness,
+ (int)(m_regex_underline_thickness),
&fg, VTE_DRAW_OPAQUE);
}
}
@@ -7609,7 +7605,7 @@
for (i = 0; i < n; i++) {
gchar ubuf[7];
gint len = g_unichar_to_utf8 (cells[i].c, ubuf);
- props[i].index = sumlen;
+ props[i].index = (guint)sumlen;
props[i].saw_fg = props[i].saw_bg = FALSE;
sumlen += len;
}
@@ -7943,9 +7939,9 @@
rgb_from_index<8, 8, 8>(back, bg);
_vte_draw_fill_rectangle (
m_draw,
- x + i * column_width,
- y,
- (j - i) * column_width + bold_offset,
+ (int)(x + i * column_width),
+ (int)y,
+ (gint)((j - i) * column_width + bold_offset),
row_height,
&bg, VTE_DRAW_OPAQUE);
}
@@ -7969,9 +7965,9 @@
vte::color::rgb bg;
rgb_from_index<8, 8, 8>(back, bg);
_vte_draw_fill_rectangle (m_draw,
- x + i *column_width,
- y,
- (j - i) * column_width,
+ (int)(x + i * column_width),
+ (int)y,
+ (int)((j - i) * column_width),
row_height,
&bg, VTE_DRAW_OPAQUE);
}
@@ -8183,10 +8179,10 @@
#if VTE_DEBUG
cairo_rectangle_int_t old_rect = rect;
#endif
- rect.x = col * m_cell_width;
- rect.width = (col_stop - col) * m_cell_width;
- rect.y = row_to_pixel(row);
- rect.height = (row_stop - row) * m_cell_height;
+ rect.x = (int)(col * m_cell_width);
+ rect.width = (int)((col_stop - col) * m_cell_width);
+ rect.y = (int)row_to_pixel(row);
+ rect.height = (int)((row_stop - row) * m_cell_height);
_vte_debug_print (VTE_DEBUG_UPDATES,
"expand_rectangle"
@@ -8235,10 +8231,10 @@
draw_rows(m_screen,
row, row_stop,
col, col_stop,
- col * m_cell_width,
- row_to_pixel(row),
- m_cell_width,
- m_cell_height);
+ (gint)(col * m_cell_width),
+ (gint)row_to_pixel(row),
+ (gint)m_cell_width,
+ (gint)m_cell_height);
}
void VteTerminalPrivate::paint_cursor()
@@ -8263,8 +8259,8 @@
col = m_screen->cursor.col;
drow = m_screen->cursor.row;
- width = m_cell_width;
- height = m_cell_height;
+ width = (int)m_cell_width;
+ height = (int)m_cell_height;
/* TODOegmont: clamp on rows? tricky... */
if (CLAMP(col, 0, m_column_count - 1) != col) {
@@ -8316,10 +8312,11 @@
int stem_width;
stem_width = (int) (((float) (m_char_ascent + m_char_descent)) * m_cursor_aspect_ratio + 0.5);
- stem_width = CLAMP (stem_width, VTE_LINE_WIDTH, m_cell_width);
+ stem_width = CLAMP (stem_width, VTE_LINE_WIDTH, (int)m_cell_width);
_vte_draw_fill_rectangle(m_draw,
- x, y + m_char_padding.top, stem_width, m_char_ascent + m_char_descent,
+ x, y + m_char_padding.top, stem_width,
+ (int)(m_char_ascent + m_char_descent),
&bg, VTE_DRAW_OPAQUE);
break;
}
@@ -8337,10 +8334,10 @@
/* use height (not width) so underline and ibeam will
* be equally visible */
line_height = (int) (((float) (m_char_ascent + m_char_descent)) * m_cursor_aspect_ratio + 0.5);
- line_height = CLAMP (line_height, VTE_LINE_WIDTH, m_char_ascent + m_char_descent);
+ line_height = CLAMP (line_height, VTE_LINE_WIDTH, (int)(m_char_ascent + m_char_descent));
left = m_char_padding.left;
- right = item.columns * m_cell_width - m_char_padding.right;
+ right = (int)(item.columns * m_cell_width - m_char_padding.right);
if (cell && cell->c != 0 && cell->c != ' ' && cell->c != '\t') {
int l, r;
@@ -8350,7 +8347,8 @@
}
_vte_draw_fill_rectangle(m_draw,
- x + left, y + m_cell_height - m_char_padding.bottom - line_height,
+ x + left,
+ (gint)(y + m_cell_height - m_char_padding.bottom - line_height),
right - left, line_height,
&bg, VTE_DRAW_OPAQUE);
break;
@@ -8413,14 +8411,14 @@
height = m_cell_height;
/* Find out how many columns the pre-edit string takes up. */
- columns = get_preedit_width(false);
- len = get_preedit_length(false);
+ columns = (int)get_preedit_width(false);
+ len = (int)get_preedit_length(false);
/* If the pre-edit string won't fit on the screen if we start
* drawing it at the cursor's position, move it left. */
- col = m_screen->cursor.col;
+ col = (int)(m_screen->cursor.col);
if (col + columns > m_column_count) {
- col = MAX(0, m_column_count - columns);
+ col = MAX(0, (int)(m_column_count - columns));
}
/* Draw the preedit string, boxed. */
@@ -8440,10 +8438,10 @@
}
if (G_LIKELY(m_clear_background)) {
_vte_draw_clear(m_draw,
- col * width,
- row_to_pixel(m_screen->cursor.row),
- width * columns,
- height,
+ (int)(col * width),
+ (gint)row_to_pixel(m_screen->cursor.row),
+ (int)(width * columns),
+ (int)height,
get_color(VTE_DEFAULT_BG), m_background_alpha);
}
draw_cells_with_attributes(
@@ -8450,7 +8448,7 @@
items, len,
m_im_preedit_attrs,
TRUE,
- width, height);
+ (int)width, (int)height);
preedit_cursor = m_im_preedit_cursor;
if (preedit_cursor >= 0 && preedit_cursor < len) {
@@ -8466,7 +8464,7 @@
VTE_ATTR_NONE | VTE_ATTR_BOXED,
FALSE, /* hyperlink */
FALSE, /* hilite */
- width, height);
+ (int)width, (int)height);
}
g_free(items);
}
@@ -8496,8 +8494,8 @@
return;
}
- allocated_width = get_allocated_width();
- allocated_height = get_allocated_height();
+ allocated_width = (int)get_allocated_width();
+ allocated_height = (int)get_allocated_height();
/* Designate the start of the drawing operation and clear the area. */
_vte_draw_set_cairo(m_draw, cr);
Modified: branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vteaccess.cc
===================================================================
--- branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vteaccess.cc 2025-05-12 17:39:06 UTC (rev 45674)
+++ branches/compyx/joymap-003/vice/src/arch/gtk3/novte/vteaccess.cc 2025-05-14 08:41:08 UTC (rev 45675)
@@ -200,7 +200,7 @@
char *next;
long row, offset,...
[truncated message content] |