News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

#1
16 bit DOS Programming / Re: Bouncing Square Clipping
Last post by NoCforMe - Today at 09:46:24 AM
Quote from: tda0626 on Today at 05:04:32 AMWhen drawing a filled in rectangle or square, is there a preferred method? The way I draw it now is line by line, top to bottom.
Well, assuming you've drawn a contiguous border, you could use a flood-fill routine, I guess, but that might actually be slower, as well as requiring recursion.

The advantage of using flood-fill is that it will fill any fully-enclosed shape, regular or not.
#2
16 bit DOS Programming / Re: Bouncing Square Clipping
Last post by tda0626 - Today at 05:04:32 AM
Quote from: _japheth on June 13, 2024, 08:38:09 PM
Quote from: tda0626 on June 13, 2024, 04:11:48 AMThank you. Is the technique you are describing called double buffering?

No - I guess double buffering is closely related to "page flipping" ( changing the start address of the "visible" video memory ).

QuoteWhen you allocate memory with DOS function AH=48, you specify the number of pages of memory needed as 1000h. Why did you specify that and not 4000 decimal, which is 64k/16?

You're right, 4000 would have been the exact value - 1000h wastes 1536 bytes.

Btw., I made some timing tests: your code, with the vsync wait deactivated, needs 86 ms for 600 loops - so < 150 microsecs for one loop - for my understanding that's far too fast to cause "flickering" troubles. Would be interesting to see what's displayed with a true CRT monitor attached - regrettably I don't have one.


Is that good for a line draw routine? Never benchmarked it. I am sure it could use a little bit of optimization.

When drawing a filled in rectangle or square, is there a preferred method? The way I draw it now is line by line, top to bottom.
#3
16 bit DOS Programming / Re: Bouncing Square Clipping
Last post by _japheth - June 13, 2024, 08:38:09 PM
Quote from: tda0626 on June 13, 2024, 04:11:48 AMThank you. Is the technique you are describing called double buffering?

No - I guess double buffering is closely related to "page flipping" ( changing the start address of the "visible" video memory ).

QuoteWhen you allocate memory with DOS function AH=48, you specify the number of pages of memory needed as 1000h. Why did you specify that and not 4000 decimal, which is 64k/16?

You're right, 4000 would have been the exact value - 1000h wastes 1536 bytes.

Btw., I made some timing tests: your code, with the vsync wait deactivated, needs 86 ms for 600 loops - so < 150 microsecs for one loop - for my understanding that's far too fast to cause "flickering" troubles. Would be interesting to see what's displayed with a true CRT monitor attached - regrettably I don't have one.
#4
Hardware & Software Corner / Re: Languages
Last post by stoo23 - June 13, 2024, 04:39:40 PM
Via a link from the above pages, I stumbled on this:
Zig

Made me instantly think of 'NoCforMe'  :wink2:  :smiley:  as it's Not C and has No Macros !!  :biggrin:  :cool:

The article, suggests;
QuoteZig is an effort to create a general-purpose programming language with program-level memory controls that outperforms C, while offering a more powerful and less error-prone syntax.
The goal is nothing less than supplanting C as the baseline language of the programming ecosystem.
Because C is ubiquitous (i.e., the most common component in systems and devices everywhere), success for Zig could mean widespread improvements in performance and stability.
That's something we should all hope for.
Plus, Zig is a good, old-fashioned grass-roots project with a huge ambition and an open-source ethos.
:smiley:
#7
16 bit DOS Programming / Re: Bouncing Square Clipping
Last post by NoCforMe - June 13, 2024, 10:27:55 AM
#8
The Campus / Re: COM, create rule in Firewa...
Last post by TimoVJL - June 13, 2024, 07:59:31 AM
Is it time to make standard way to handle COM objects.
After that, TLB to INC converter is possible to make finally.
In this site are at least three persons, who can do that.
#9
16 bit DOS Programming / Re: Bouncing Square Clipping
Last post by tda0626 - June 13, 2024, 07:51:07 AM
Quote from: NoCforMe on June 13, 2024, 05:27:38 AM
Quote from: tda0626 on June 13, 2024, 04:11:48 AMWhen you allocate memory with DOS function AH=48, you specify the number of pages of memory needed as 1000h. Why did you specify that and not 4000 decimal, which is 64k/16?
1000h = 4096 decimal, which is "4K"
64K (65,536) / 16 = 4096, not 4000

We like to use hex numbers here.

But 320x200x1 byte is 64000 bytes /16 page = 4000 or am I missing something here?

Quote from: FORTRANS on June 13, 2024, 07:27:56 AMHi,

Quote from: tda0626 on June 13, 2024, 04:46:18 AMDo you have a good resource that you can point me to about sprite manipulation?

   If you were following my comments in another thread about Wu
antialiased lines, there was an animation in a chapter of the
book I pointed out.

Abrash's Graphic Programming Black Book

;LISTING 43.1 L43-1.ASM
; Program to demonstrate bit-plane animation. Performs
; flicker-free animation with image transparency and
; image precedence across four distinct planes, with
; 13 32x32 images kept in motion at once.
; Bit-Plane Animation 801
; Set to higher values to slow down on faster computers.
; 0 is fine for a PC. 500 is a reasonable setting for an AT.
; Slowing animation further allows a good look at
; transparency and the lack of flicker and color effects
; when images cross.

Regards,

Steve N.

Thanks, Steve. I will have to read that book.

Tim
#10
16 bit DOS Programming / Re: Bouncing Square Clipping
Last post by FORTRANS - June 13, 2024, 07:27:56 AM
Hi,

Quote from: tda0626 on June 13, 2024, 04:46:18 AMDo you have a good resource that you can point me to about sprite manipulation?

   If you were following my comments in another thread about Wu
antialiased lines, there was an animation in a chapter of the
book I pointed out.

Abrash's Graphic Programming Black Book

;LISTING 43.1 L43-1.ASM
; Program to demonstrate bit-plane animation. Performs
; flicker-free animation with image transparency and
; image precedence across four distinct planes, with
; 13 32x32 images kept in motion at once.
; Bit-Plane Animation 801
; Set to higher values to slow down on faster computers.
; 0 is fine for a PC. 500 is a reasonable setting for an AT.
; Slowing animation further allows a good look at
; transparency and the lack of flicker and color effects
; when images cross.

Regards,

Steve N.