CPCEval - Simple Evaluation Tool for CPC464 and 6128

Started by Bytebreaker, 21:54, 14 June 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bytebreaker


Hello!


I was quite amazed when I saw the charts and evaluation graphics in the demo programs that were shipped with every CPC464 and CPC6128. Being a big fan of the superior Loco Basic, I tried to imitate what I saw there (which I did not manage entirely - I use mode 2 only and no isometric 3D perspective).


Why did I do this, knowing that MS Excel is 1000x better? Because I could and because it was fun. Maybe some of you find a way to use this simple tool and you create your own charts and keep your CPC occupied for a little while with this program.


Still missing:


- Sending an evaluation screen to real printer (I don't know yet, how to do this)
- Using bubble sort for 2 axis in table mode. I only manage to sort one column separately, but not the corresponding other one. The sorting code is currently inactive and can be found at line 1950. AMSDOS, do you have an idea?

SRS

For printing there are some "hardcopy" routines ... and about 2d bubble - https://en.wikipedia.org/wiki/Bubble_sort ?
#
hope that helps



arnoldemu

@Bytebreaker: You can output text to a printer with

PRINT#8,"hello"

#9 is the tape/disc, #0-#7 are windows.

If the printer is Epson compatible you can use it's control codes to enhance the output:

http://lprng.sourceforge.net/DISTRIB/RESOURCES/PPD/epson.htm

to turn on condensed printing:

print #8,chr$(27);chrs$(15)

It *is* possible to output the screen as graphics to the printer ("hardcopy" as SRS says) from basic. To do this you need to read pixels from the screen (8 columns at a time) and use "9-pin graphics" mode. You will also need to adjust the line spacing to move down after you draw 1 strip of graphics.

It'll be slower in basic but it will work. :)

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bytebreaker


arnoldemu

Quote from: Bytebreaker on 07:51, 15 June 17
Great thanks for the info!
You're welcome.

The problem is that I doubt any emulators will do this.

I know JavaCPC has printer emulation but i'm not sure how advanced it is and  if it does graphics or not.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Bytebreaker

I will work on the sorting problem first anyway. The real printing would have been additional luxury.
I already got hints from my C64 friends on how to solve the issue to keep a second table column sync'ed when sorting the first one.


The sorting then also takes effect on the diagrams, i.e you see the bars, pies etc. in the sorted order, then.

AMSDOS

Unfortunately I'm unable to get to an Amstrad to have a look at your code. The Bubble sort routine I incorporated earlier into a Telephone Database concentrated on sorting the names from one field and repositioning the the phone number alongside it, though I wasn't sure if you looking to take Information from 2 Different Tables and use some Sorting process on it or if you're looking to sort 2 Tables seperate from Smallest to Largest or something like that.




I remember using an emulator to print out a page straight to a printer and that would of been going back to the DOS emulators, I cannot remember if I was using a Star NX-1000 printer I had or the NEC P7 I'd acquired. I think I did print out some stuff on the NEC, I don't know which emulator I was using for it, it could of been CPCEMU, RWCPC or CPE52, I don't think I had Caprice at that stage and was using a 486DX2-66. One of the CPC Programs I remember using was Powerpage (unsure if it was 64 or 128).
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Bytebreaker

@ AMSDOS


The sorting use case only deals with one array that has two dimensions: werte$(30,1).
werte$(i,0) contains the x-Axis Values. werte$(i,1) contains the y-Values. It is all string, which, depending on the chart type, will be converted to numbers or left "as is".


Let's say dimension 0 contains names and dimension 1 contains highscores, then I need the names at the right places when sorting by score and vice versa the scores at the right places when sorting by name.


As far as I can overlook it right know I need key assignments that link fields to each other. I must use these as an index, so I can rearrange the second column after sorting the first and vice versa. I guess this will be the direction I'll go to solve this.


I am still very interested in your phonebook code and the sorting algorithm you have implemented.

VincentGR

Fantastic, I was obsessed with this back then.
Never bought a printer for my cpc, but I used to print through an amiga using cpc emulator and a star lc 200.

Bytebreaker

#9
Thanks!


I will shortly implement a sorting feature + min, max and average value display in Table view.


The solution for the 2-column-sort is a modified insertion sort. Thanks to my friend Michael Kircher I could write something like this:




10 dim w$(7,1)
20 w$(1,0)="tom":w$(1,1)="50"
30 w$(2,0)="fritz":w$(2,1)="70"
40 w$(3,0)="klaus":w$(3,1)="20"
50 w$(4,0)="gabi":w$(4,1)="90"
51 w$(5,0)="hans":w$(5,1)="30"
52 w$(6,0)="peter":w$(6,1)="10"
53 w$(7,0)="lutz":w$(7,1)="80"


61 print chr$(147)
63 print "unsorted array:":print
64 for i=1 to 7
65 print w$(i,0),w$(i,1)
66 next i


67 print


100 for i=2 to 7:a=val(w$(i,1)):b$=w$(i,0)
110 for j=i-1 to 1 step -1
115 if val(w$(j,1))>a then w$(j+1,1)=w$(j,1):w$(j+1,0)=w$(j,0):next
120 w$(j+1,1)=str$(a):w$(j+1,0)=b$:next i


163 print "sorted array:":print
164 for i=1 to 7
165 print w$(i,0),w$(i,1)
166 next i


167 end



Replace line 61 with "cls" and it should work on a CPC too. I did this problem solving on C64 with v2 basic. I will post here when the improved version is finished. Then you can save your evaluations in a sorted state. This affects the order of the pies, bars and line diagrams, too.

Bytebreaker

#10
So here it is. CPCEval with the option to sort both columns.
After doing so you can save the evaluation including changed sort order and you can watch the sorting effect on changed bar/pipe/line charts.


Please keep in mind that for proper number sorting you need filling zeroes so all numbers have the same length (i.e. 3->03  or 3->003)




AMSDOS

Quote from: Bytebreaker on 20:17, 15 June 17

I am still very interested in your phonebook code and the sorting algorithm you have implemented.


It's not really mine, the sorting routine (a Bubble Sort) was part of the BASIC tutorial series Glynne Davies was running for ACU in 1991. It was badly presented by ACU, though it was the kind of tutorial which presented many programs and would setup exercises for you to implement.


You can find the series guide of programs and Disk Image here, the phonebook code I was referring to which the Tutorial set as an exercise is the program called DBASEEX.BAS from Part 5 which uses the Bubble Sort from Part 4 (BUBBLE.BAS).
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Powered by SMFPacks Menu Editor Mod