AHCC

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: AHCC

Postby peterlane » Wed Oct 28, 2015 1:13 pm

jruark56 wrote:peterlane,

I tried your code for setting the vertical slider, but it doesn't work for me. The directory of files does move according to the other parts of the code, but the slider position never changes.


I've only tried it on an emulated STE under Hatari. The (float) version I've been using on my Firebee.

I think I don't understand your solution. You set the first tmp variable to the integer division of top and the total number of lines minus the lines currently shown in the window multiplying the result by 1000. When I apply the math using real numbers outside of the program, this always results in 0. Is it supposed to be something else?


It's probably best to look at an example.

I replaced the following line:

Code: Select all

   pos = (int) ( (((float) top) / ((float)(files.count - lines_avail))) * 1000);


with these three lines:

Code: Select all

   tmp_1 = 1000 * (top / (files.count - lines_avail));
   tmp_2 = 1000 * (top % (files.count - lines_avail));
   pos = tmp_1 + (tmp_2 / (files.count - lines_avail));


let's say files.count = 40, and lines_avail = 15 (size of window).

If 'top' = 10 then, the original has:

Code: Select all

   pos = (int) (10.0 / (40.0-15.0)) * 1000 = 400


My ST version has:

Code: Select all

   tmp1 = 1000 * (10 / (40-15)) = 0
   tmp2 = 1000 * (10 % (40 - 15)) = 1000 * 10 = 10000
   pos = 0 + 10000 / (40-15) = 400


So it gets the same. 400 out of 1000 is 40% of the way down. As we see 15 lines in the screen, we only scroll over 25, and 10 out of 25 is 40%. So this is correct.

The tmp1 is needed in the case when 'top = 25' (i.e. when the scroll bar is at the bottom of the window),
when:

Code: Select all

   tmp1 = 1000 * (25 / (40-15)) = 1000
   tmp2 = 1000 * (25 % (40-15)) = 1000 * 0 = 0
   pos = 1000 + 0/ (40-15) = 1000


So now pos = 1000, which means the scroll bar is at the bottom. (Without the tmp1 the scroll bar pops back to the top when taken to the bottom.)

I don't know what to suggest to try to fix this on STEEM. Perhaps try printing out tmp1, tmp2 and pos to see if they are giving the right values?

(Incidentally, my three lines could be simplified, as top should probably never exceed files.count - lines_avail.)

Good news is STEEM does not crash or freeze when the program is run.


Good!
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

jruark56
Atari freak
Atari freak
Posts: 56
Joined: Sun Nov 09, 2008 2:58 am

Re: AHCC

Postby jruark56 » Thu Oct 29, 2015 12:53 am

peterlane,

I was kinda headed that direction myself to try and isolate the problem. I'll try printing out the values in the function and see where that leads me. Good to know that my thinking was not that far off concerning the value for tmp_1. I did not try the case where top=25. Thanks for pointing that special case out.

I will report back with any further progress. Thanks for the help. I appreciate it.
Russ Ruark Jr.

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: AHCC

Postby peterlane » Sat Nov 14, 2015 10:36 pm

peterlane wrote:
jruark56 wrote:peterlane,

I tried your code for setting the vertical slider, but it doesn't work for me. The directory of files does move according to the other parts of the code, but the slider position never changes.


I've only tried it on an emulated STE under Hatari.


I've now tried this on an actual STE (with TOS 2.06), and the scrolling part works perfectly: the files and slider move as expected, and the slider changes size as the window is resized.

Unfortunately, the mouse freezes on exiting the program - I'm not sure why yet. The keyboard works, as I can open disks, etc, but the mouse won't budge. So there's still something to fix here. The Firebee version is working fine, and exits cleanly.
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

jruark56
Atari freak
Atari freak
Posts: 56
Joined: Sun Nov 09, 2008 2:58 am

Re: AHCC

Postby jruark56 » Mon Nov 16, 2015 12:03 am

peterlane,

Thanks for the update. I did experience the mouse lockup in Steem, after all. My previous attempts that did not produce the lockup used my previously typed in code adapted with your integer math workaround for the missing floating point functions.

Please let me know if you do get this issue resolved and thanks again for providing the adapted code.

I am taking a break from this for a while, but I will come back to it soon. Still have this project to complete.
Russ Ruark Jr.

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: AHCC

Postby peterlane » Tue Nov 17, 2015 12:05 am

jruark56 wrote:Please let me know if you do get this issue resolved and thanks again for providing the adapted code.


I found the mistake - a typo on my part. There's a difference between v_clswk and v_clsvwk ... note the extra 'v'.
With that corrected, the windows examples terminate cleanly on my STe.

I imagine under Mint the multi-tasking system kept things going, so hid the problem on my Firebee.

I'll update the .PRJ and .C files on my github repository.
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

jruark56
Atari freak
Atari freak
Posts: 56
Joined: Sun Nov 09, 2008 2:58 am

Re: AHCC

Postby jruark56 » Wed Nov 18, 2015 6:27 pm

peterlane,

Thanks for the update. I will certainly take a new look at your code when I return to this project. Your hard work here certainly has advanced my knowledge level and made a frustrating situation much more bearable.
Russ Ruark Jr.

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC v5.3

Postby Henk Robbers » Sun Feb 07, 2016 3:23 pm

Sorry for being late. I suppose you all read comp.sys.atari.programmer ?

January 21 2016
v5.3
Compiler:
Fixed a bug that prevented proper casting of constants
by explicit casting.

Fixed wrong code for casting the result of a comparison
to a float (e.g. R1 = R2 < R3 where all R's are floats).

Fixed a regression after v4.f
Wrong code was generated for comparing the address of
a array to zero (spurious, but must be OK).

Fixed an obscure error where AHCC crashed on extremely
large (more than about a 1000 ch's) string denotations.

A teeny tiny little bit of clean up.

Assembler:
Fixed a regression since v5 where register masks for movem
instructions involving D6 and/or D7 spelled in upper case
were wrong. (typo in defs.h)

Shell:
implement asinh & acosh in tiny calculator in console.

Editor:
Find 'word' did not reverse neatly. fixed.
Unselected ^I did not select anymore. Fixed.

Library ahccstdf:
Fixed bugs in pow, sinh, asinh, cosh, acosh and tanh.
(error in common function _Exp).

Have fun

H.Robbers

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: AHCC

Postby peterlane » Fri Apr 01, 2016 12:07 pm

I'm missing something in the configuration when installing version 5.3. When I try to compile the provided HELLO_CF.PRJ I get the following errors:

L1 Can't open runtime header: 'AHCCCFRT.H'
L2 Can't open include file 'stdio.h'

So it seems it cannot find the 'INCLUDE' folder.
This is version 5.3, the Coldfire build, running on a Firebee.

Version 5.2 is working fine, and I don't remember having to change anything for it to find the INCLUDE folder.
All I have done is download the zip file, unpack it, and copy it to the Firebee. Then double click on AHCCCF.PRG.
I've tried comparing the compiler options in both versions, but I haven't found the problem.

Any idea as to what I'm missing?
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

Re: AHCC

Postby Henk Robbers » Tue Apr 05, 2016 11:18 pm

Sorry, my mistake.
Do you still have your old ahcccf.cfg ?

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: AHCC

Postby peterlane » Tue Apr 05, 2016 11:25 pm

Henk Robbers wrote:Sorry, my mistake.
Do you still have your old ahcccf.cfg ?


Yes, I keep the previous versions of AHCC. I'm still using version 5.2. Do I need to copy that file over to the new version?

EDIT: Yes, copying over the ahcccf.cfg file seemed to do the trick, and I can compile with version 5.3.

Thanks for the hint. :cheers:
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC v5.4

Postby Henk Robbers » Sun Jun 12, 2016 8:59 pm

LS
There is a new version available on my home page:
http://members.chello.nl/h.robbers/

Changes:

June 6 2016
v5.4
Compiler:
Fixed a bug in register health analysis where in certain
rare circumstances too many operations were discarded.
Shell: (not AHCCST)
New menu item: Project-->PRJ from folder.
Produce a skeleton project file from file names in a
given folder. (only 1 deep).
Usefull for constructing new project files for AHCC.
Editor:
Tile windows when started with 2 previous opened files.
Fixed a bug where ^2 could loose sync when searching for
next unequal lines.

Have fun
Henk Robbers

Henk Robbers
AHCC Developer
AHCC Developer
Posts: 39
Joined: Mon Nov 14, 2011 2:37 pm

AHCC v5.5

Postby Henk Robbers » Tue Jan 17, 2017 1:20 pm

LS
There is a new version available on my home page

Changes:

January 17 2017
v5.5
Compiler:
Commandline versions:
Do not wait for a keypress under MiNT or MagiC.
All:
Wrong code was generated for comparison to a constant
in rare situations, resulting in a tst to a immediate.
Now either a branch or no operation is generated.
Prevent crashes on ill formed defines.
Removed some leftover debug info in messages.
include/aes.h
Added a few defines for the newest aes's.

Fixed a memory violation that has haunted me for many years.
It was about improper use of strncpy were strcpy sufficed.
Null padding by strncpy caused behaviour popping in
and out of harmfulness depending on internal distances.
Quite a relief to find this mistake.

Standard library:
Forgot to include stdlib.c in the source tree. Fixed.
atof (strtod) forgot to skip leading spaces. Fixed.

printf now only removes dot and all fractional zeros
with format %g

Synced tos.h and mint.h in both include and sinclude folder.

Editor:
If a window menu is pulled and the mouse is moved outside
the windows work area, the menu is pushed(removed).
This prevents a annoying lock up of the screen.

Page scrolling scrolled 1 line too many. Fixed.
A page down detetects form feed character (decimal 12)
displayed as ).
Scrolling down stops when a at the beginning of a line is
detected or when the last line of a window appears on top.

Shell::KIT::FIND
save state of buttons 'verbose' and '1 per file'
in config.

Have fun.


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 1 guest