User avatar
Gernot66

Posted Wed Nov 09, 2022 3:45 am

Batchrequester issue - solved

It was simply the wrong ASL.LIBRARY version. BATCHREQUESTER depends heavy on asl.library and as it seems i had (for a test which has endet right now) installed a not 100% compliant asl.library revrting this to V37.27 solved the issue completely i can start now batchrequester n-times and it won't hang or crash the OS (which it occasionally did before, not when i run the program itself from the cli but when it was invoked by a script which it is meant for).

Really i thought it could be my fault and in a further sense it was but problems caused by a different library version usually appear only sparse up to almost never and then you mostly don't expect that it will be a specific librarary, since it is a requester it was quite obvious that the cause must be the asl.library and it was the first i tried today.

The funny thing is if i use a different version the OS sometimes didn't finds the program itself when i use a different name for it, as you might know i renamed batchrequester to batchreq (i'm a lazy typer - no i can't type at all i'm a typical hacker if it was about me i would name batchrequester simply "br" - yes i know...)
and strangewisely the OS often returned "not found". Using the proper library version this never happened (after 100 and one tries) neither that the program will hang, didn't pops up the requester or in the worst case crashes the OS.

Just to tell the problems wasn't caused by my script(s) they was caused by the wrong library version.

User avatar
Gernot66

Posted Wed Nov 09, 2022 4:48 am

A few words about JMENU (multiple choice requester i used for the "ExChange" script)

JMENU is not very easy to understand how to use it, it depends on a premade script for the menu itself, how you setup this script won't matter you can do this in advance or by using ECHO >stdout, i will show here the "echo variant".
The syntax for JMENU is <file name> <variable name>, while until i never used the <variable name> and i recently don't see exactly what's the purpose of it.

The structure of the JMenu menu file is:
TITLE the requesters title - do not use quotes here any of the strings will be interpreted as one string regardless of spaces.
MENU the menu entry
EXEC setenv foo bla - in example.
MENU next entry
EXEC setenv foo2 blabla - it could be anything which is executable, a program or a script called by execute i prefere to use SETENV and list the to perform actions later.

To finally use this you must write a little script or echo that turd to a temporary script in the following manner:

Code: Select all

ECHO >T:JM "TITLE Multiple choice selection*NMENU First entry*NEXEC SETENV JM FIRST*NMENU Second entry*NEXEC SETENV JM SECOND"
Take care that the string isn't longer as 256 characters, if you exceed this simply append a new echo line by using ECHO >>T:JM i.e.. The only limit for the number of entries and length of the strings in the boxes is the screen resolution and the used font. JMENU numbers the menu entries and they can be selected by pressing the respective number instead to be clicked on, that is quite comfortable i guess.

It can happen that JMENU mirrors the text of the next field or the entry for the to execute program in a text field, this has no influence on functionality (perhaps he shouldn't have forgo to set the strings in quotes i assume this problem is caused by the parsing)

Since i used an env variable i can now use if to determine the choice;

Code: Select all

IF $JM EQ FIRST
  EXECUTE script1
ENDIF
IF $JM EQ SECOND
  RUN >NIL: program2
ENDIF
I assume the argument <variable name> replaces my SETENV procedure with a single variable since you can make only a single selection using JMENU, but i used it from start on in the above manner because i need to have the statement "EXEC" in the menu (without it won't work) and if i need this statement i have to do something with it ergo SETENV or ECHO >stdout. You can use a predefinied variable but you still need to use EXEC and some command and since it is in this manner it makes absolutely no difference to set the variable in the field EXEC. A predefinied variable name would give you the possibility to perform something using the field EXEC AND to store the choice in the variable i.e for a later use or a use in a different script.

Even when JMenu works with any OS version the appearance is OS2.x which leads to an orange menu, one mustn't like this but as for the filerequester this is the only multiple choice requester i found working well under OS1.3.
To compare:

QUICKREQ is a simple ask replacement and allows only the two choices yes/no, but well for this task it is fine and it uses the systems requester which suits to the rest depending on how you use it it is properly titled "System Request" i like that.

BATCHMASTER sounds better as it is and only offers four choices and no title for the requester, overall this is an ugly requester which displays four simple frames on a grey ground also the text boxes aren't dynamic in size thus the text is very limited in length, not very appealing.

JMENU respects resolutions, means it will work well on a lo-res screen, EXCEPT when you run your system i.e. in high-res interlaced and open a non-interlaced screen then it won't open on this screen arguing that it finds no space for the menu to display.

Once you used JMENU or the filerequester BATCHREQUESTER you won't like to forgo them they are very useful for OS1.3 scripts and replace well the later OS internal "RequestFile" and "RequestChoice" programs.

User avatar
Gernot66

Posted Wed Nov 09, 2022 5:41 am

In the linked file "Amiga_Terrain.zip" you will find a bunch of icons i made from the Terrains, the size is the recommended maximum of 80x40 pixels. They use two bitplanes and come in OS1.3 colors but by a simple use of i.e. "Swap Colors" they can be used well in later OS's also because i did forgo the button bevelling i use else for my 1.3 icons since i like to use tem in OS3.1
The icons are well enough to recognize the shape of the terrain but unfortunaltely it takes "years" until the 256 icons are splattered on the screen.
To diplay the attched IFF image i use "ShowIFF" the reason is that i use "GIMP" to make the images and "GIMP" will export exactly 5 colors (writes a palette of only 5 colors), but many programs i.e. "PPShow" refuse to display an IFF which isn't exactly 2,3,4,6,7 or 8 bitplanes since "5" is not equal to 3 bitplanes (8 colors) many programs fail to open the images.
ShowIFF won't fail and neither DPaint will fail to open them (a write back using DPaint would solve this little issue).
I will see if i can fix this using a script because i don't like to open and save 256 images for "nothing".

Most programs will display an image which isn't in screen size in the upper left corner, ShowIFF nicely places the image in the center of the screen.

How i setup SimCity it isn't as easy to start it using a specific terrain or saved city, SimCity (unfortunately) depends on that it is run from its own directory if not it won't find its config file and neither the tile sets mit needs to run.
Since i store my played cities in a top level (to SimCityII) directory "Cities" they can't be started from their icons (so easy).

But i like to run it from the city icon!

There is help (which complicates it a little):

Step One:
First i use "ICONMISER" which is ingtentionally meant for OS2.x and above but it works flawless in OS1.3, with IconMiser i replace the standard icons SimCity or the TerrainEditor create this replacement contains as tool following string:
"SIMCITY:SimCity"

Step Two:
Copy the three files "SimCity.config", "BaseSimData" and "Classic Graphics.SimData" (or any of the graphics sets, or all) to SYS: since SimCity will search in SYS: for them if it's run from SYS:

Step Three
Now as long as SIMCITY: isn't assigned to a directory SimCity can't try to open this file which is only good because SimCity doesn't likes if a program is hooked on the audio device like it is the case for "DCLOCK". To run SimCity i MUST first quit such programs else it will crash.
It needs an "Assign Me" project in which you quit as first such programs and then you can assign SIMCITY: to your SimCity directory.
If you like a special SimCity font you can set this here, SimCity takes the systemwide font as font (e.g. FF CBMSans.font)

Bingo, now you can start a stored city or a terrain by simply clicking on the icon no matter in which directory that icon is placed.

If you like to play an endless loop in the background start this after you started SimCity then the audio device is "free" to use (e.g. SOUND SCC Q D).

You can do all this in a start script and add a multiple choice requester to it which let's you select how you like to run SimCity, like this:
004.png
As you can see by the title of JMENU it randomly selects in advance a to use Terrain from my 256 terrains set (it displays the picture for this terrain in advance) if you don't like it you can either make a new random selection, select a terrain using the filerequester, skip all that and start SimCity in the usual manner.

In near future this script will be changed a little, it will open in advance a requester to determine betweeen "Start SimCity", "Random Terrain", "Load last saved city" before it will select a random terrain.

"Yech, why does that pointer look so ugly"
Simply because the SimCity start script recalls a special "SimCity pointer" this pointer has "wrong colors" in the OS but will look fine in SimCity itself. Also the background picture you see will turn the pointer colors to default else it would be in skin color
005.png
The colors of the pointer in SimCity itself i can't change (without to hack SimCity), fortunately the orange suits halfaways.
Funny is that if you open the city statistics the pointer will appear in the meant skin colors:
006.png

User avatar
Gernot66

Posted Wed Nov 09, 2022 6:13 am

Statistics

Not written yet but it's the next thing i've planned, you already see a "Last saved city" this tiny script i will expand to a statistics script which will show you in advance a few stats of a city like, "r,c,i" population, crime rate, pollution rate, traffic, amount of police stations, amount of fire stations, amount of churches, amount of hospitals, amount of "r,c,i" buildings, amount of terrain tiles "forest, river, dirt, channel, road, railway, power line", assesed value, major rating, taxes & founding. That will be of little interest for an empty terrain but it will be a nice addition to "More Cities" (50 played cities i collected from Amiga and MS-DOS releases) to compare them or to compare your own played cities.

Most of the data i first have to evaluate (buildings, tiles), but theoretically i could tell you the exact amount of i.e. low-value residentials in a city. Theoretically one could make a different score from these values which will tell how wealthy the city residents are.

But all that is still future music...

User avatar
Gernot66

Posted Wed Nov 09, 2022 7:07 am

Btw, i guess it was on the "english amiga board" where i stumbled over the question "what is in a SC2K file?", now these are SimCity city files and you already know most of what is in them.

SC2K cities doesn't differ much and differ much nonetheless.
Certain content i could tell by the heart because i needed that to create own "Streets" scenarios (scenarios not only a race track), unlike for "SimCity" for SC2K the scenario data is stored in the city file.
There was a dude who started to reverse engineer "SimCopter" (Mac release) but he cancelled his work for whatever reason and never picked that up again, that is sad because he really disassembled all data in a sc2k city file (except for the scenario data used for "streets" or "SC2K" itself they differ somewhat, the IFF format of the files allows such).

Scenarios for SimCity are hard coded in the game but you can theoretically use any city to replace them, just copy the appropriate data to this city except for the city structure itself (else it won't be recognized as scenario even if the whole scenario is hard coded).
First i assumed a similar way as in sc2k since there is sometimes quite obvious data in some cities/scenarios to see, things which come with a ascii declaration which let's one assume this could be relevant, but as i found out this data never changes and must be a sort of remnant from playing SimCity.

It needs further investigation because probably you can tell by this (or other data) if a city was "hacked" or if you used "FUND" to raise your cash or if you load/saved it using the terrain editor, if you reset the Year and/or how old the city is for real, at least i assume such data somewhere, space there is enough even if some cities look crammed and certain data is written where it doesn't belongs to (i.e. it sometimes writes gibberish where the funding percentage should be, strangewisely this crippled data has no influence on how the funding is interpretet - as long as it is 100% i assume because 0x1 00 00 DOS is interpreted the same as 0x64 00 00 Amiga, no matter what is stored in the 0x00 00, 0x64 is 100 in any case and anything above 0x1 00 00 is interpreted as 100 by DOS, i assume only if the percngtage is lower as 100 it will write this to the "unused" addresses). It has some specialities like how population is counted.
Something i quite don't understand is why they used for the DOS release a longword to store what fits in a word?
0xFF FF FF makes absolutely no sense to me to store 0 - 100. Also this difference hinders that the funding will be proper interpreted if you load a city to a different OS release. Means DOS will interprete the 0x64 right since that is 0x64 00 00 and that equals to 0x1 00 00 but the Amiga release would interprete 0x1 00 00 as "one percent funding".
This is most probably the reason why you can load an Amiga SimCity file directly to MS-DOS SimCity, while vice versa you need to save the MS-DOS SimCity city using the Amiga TerrainEditor to correct this (and some other?) difference before you can load it to the game.

"errare humanum est"
MS-DOS SimCity V1.02 won't interprete the funding proper:
simcity_000.png
any later release will interprete it right as 100%

How the MS-DOS release TerrainEditor passed the qualitiy test is a riddle to me, up to release 1.03 it won't write the difficulty setting to the file (huh?!), this release is content of SimCity for Windows 16bit, any previous release contains this error. Further the MS-DOS TerrainEditor doubles the cash amount in the field where the fire funding percentage should be if you load a city from the Amiga release i.e. else it writes to all funding fields 0xFFFF which is as good as 100%, another stupid little issue which could have been fixed easy i guess. It seems the terrianeditor gets confused by the 0x64 00 00 - sometimes and sometimes not :)

User avatar
Gernot66

Posted Wed Nov 09, 2022 7:36 am

Talking 'bout differences i found.
"SimCity Enhnaced CD-ROM" doesn't only differs in graphics from any SimCity it also differs in hardness (it could be a bug or an issue of DOS-Box because you will see that is weird)

Traffic costs in "SC Enhanced" in hard mode four to five times what it costs in the amiga release played at the same difficulty "hard". To play "hard" is already hard and often you won't have enough cash flow to finance a railroad system, but 4 to 5 times higher is impossible to solve, you cannot connect the buildings with streets even if all is rated high-density high-value, the costs will eat you up!
For a similar sized small village i need $1000 to $1200 to finance the roads while the income with a tax rate of 8% is perhaps $400, a same sized vilage in Amiga SC needs $200 - $300 to finance the same grid.
This isn't "hard" this is "absolutely impossible to solve".
(maybe not absolutely, a building will work with a single road tile connected to it, this road tile must not be connected to the grid, means you could theoretically forgo the grid and place only this single road tile to keep the costs as low as possible, i will see if that works even if it won't please me).

The strange thing i encountered is that this cost stays when you load such a "SC-Enhanced" city to the Amiga release, thus it must be stored in the city file and it isn't (only) hard coded in the game.

This difference and if the MS-DOS release acts similar i need to test further also if their is a way to fix this issue because i can't imagine that it was meant five times higher which makes the game impossible to play in hard mode.

Stupid but that works out well:
sccd_006.png
This "no roads" city grows and i have now $400 plus instead of $400 minus.
It is a "stupid game" i still like it but i never expected that it will work without any functional road grid.
Ever tried this? Me i never did so.

What a stupid issue, you can have a city with nearly no roads and due to that no traffic, the Sims drive all off roaders or tractors.

This dude here is obviousely a liar
Often players did forgo the roads for residential zones and replace them with railroads to avoid traffic, of course.
Me i found out that railroads raises traffic in certain regions instead to lower it thus i mostly already played without a railroad in hard mode which works well also the roads never have crossings (bulldozed), all the years i assumed connectivity stays over one or two tiles but it seems it is irrelevant at all.
Yes sure the manual states "...need at least one road tile connected..." at least and as maximum as it seems, a matter of how you interprete this sentence.

User avatar
Gernot66

Posted Wed Nov 09, 2022 8:58 am

Personally i'm not amazed about this issue, it takes some life out of the game since i know that i can cheat the traffic in such a simple manner.
Let's see if i can grow a metropolis in SimCity Enhanced hard mode using this cheat.

Something else i like to try out is a sort of "starter town" someone created decades ago, it's named "Deadwood" and has everything pre-placed it is just not settled, i strongly assume it won't grow well but what i have in mind is to alter this city a little and to replace the empty zones with high density high value buildings and to see how the city will degrade from this. It will degrade if i look at the stiff layout of "Deadwood" one thing you can't expect is that the sims will follow your plans - your planning has to follow the mood of the sims (means you cannot simply expect that commercials work best in the center of the city if they are to far from residential zones the commercials won't grow and in return the residentials will "move to another city", the best working would be a small cell containing residentials, commercials and industrial zones, but such cells on the other hand boost pollution and crime in the residential zone and neither will work well thus it must be something in-between depending what grows where best because just a single tile to the left and a residential zone can be a moneywell or a slum, certain things are random in SimCity).
But since i know now how to replace buildings i had the idea to fill this map and to see what happens to it if it is started.

Do have churches and hospitals any population?
Let's find out, let's make a city filled with hospitals instead of residentials.

User avatar
Gernot66

Posted Wed Nov 09, 2022 9:54 am

004.png
Is that something someone will like (the icons i mean)?
SimCity_Icons.zip
(6.92 KiB)
With a size of 128x64 they are somewhat oversized but since they only stay in a specific games directory that is ok (i have even larger ones for some games like "LotR" or "PoC").

The backdrop you see is from this repo:
city_images(ny).zip
(1.45 MiB)
You will need to change the attached scripts to your setup since they simply call a script to display any of my backdrops together with a random soundeffect, also this script will store the selected backdrop in ENV: and ENVARC: (to remove and reload the backdrop and palette(s) for it). All this might not be very handy for you.
Don't be surprised the images have all a palette of four times 0x05A (blue on blue in blue ;) ) the to use palette.list of which you can select randomly one is in the images directory, do use the palette i use SETCOLOR because it's a very small program and exactly right for the purpose. To select a palette i use RANDLINE which extracts and executes a random line from a listing, that is also why the call for SETCOLOR is in the palette.list.

Personally i prefere to use WBPIC over SIMGEN since it shows no splash screen and is due to that somewhat faster in displaying the backdrop, the drawback of WBPIC is that you can't use pattern tiles like for SIMGEN.

links?
will follow, but now it's supper time.

User avatar
Gernot66

Posted Wed Nov 09, 2022 1:17 pm

WBPIC
https://aminet.net/misc/fish/fish-0234.lha

SETCOLOR
https://aminet.net/misc/fish/fish-0939.lha
This specific SetColor is part of "Ian Utils"
I really didn't expected it to find it in a OS2.1 package neither that i retrieved it from this fishdisk, where i have it from i don't remember but it isn't specific OS3.1 rather not because you can only set 32 colors which is to less for a OS3.x use but exactly what you need for OS1.3 to cover even the pointer palette.
However it's a small assembler program that's mostly why i prefere it over other programs with the same function.

Correction: same author slightly different program, the SETCOLOR i use accepts hex and decimal values the one in the linked package only hex values, therefore since it was meant for OS2.x it supports specific public screen names instead of "WB,FRONT,ACTIVE"

Since i can't find this specific release of setcolor i will link mine here
SetColor.zip
(1.81 KiB)
In the zip is the output of "SetColor ?" that is the only documentation i have to this program, like i said i have no idea where i have this program from - Ian Einman at least this i know ;)
But the use is simple SETCOLOR [WB,FRONT,ACTIVE] [color register 0 - 31, [color r,g,b dec or $rgb hex]

However there exists a bunch of programs which perform the same task, some like SCM/SCL (or one named SCT if i remember this right) let you write and load palettes, it's your choice which you like best aminet will help you.

BATCHREQUESTER
(renamed to BATCHREQ for the use in my scripts)
the one and only handy OS1.3 filerequester
https://aminet.net/util/batch/BatchRequester.lha
005.png
Batchrequester needs the asl.library, preferably asl.library V37.27

JMENU
https://aminet.net/util/batch/JMenu.lha
007.png
REPSTRING
CLI program to replace ascii strings or hex values in a file
https://aminet.net/util/cli/RepString.lha

SPLITQ
(renamed to SPLIT for the use in my scripts)
CLI program to split a file at a decimal address to a snippet of a decimal length.
https://aminet.net/util/arc/SplitQ.lha
There exist many CLI tools which will split a file - mostly in two sections, this one splits the file to a single new file and leaves the source untouched. It is what i use mostly and recently it replaces a program with wich i can alter a value at a specific address, using SPLITQ i can extract the relevant section, alter the data and put the turd together again, a bit clumsy but effective.

SOUND
The by me preferred 8SVX file player.
https://aminet.net/mus/play/Sound.lha
Many many same & similar named programs, this is the one i prefere because it plays even a raw stereo file proper further it's until the only i found which i can always terminate using CTRL-C (as long as the player window is visible if it's in quiet mode unfortunately it can't be exited).

Dunno what the dudes thought of who implemented the stupid "exit using RMB" feature in their file players because select something from any menu and the sound ends - pardon me but that is stupid. The meant two file players are good but this "anti-feature" kills all what is good within. Ah yes you can bypass the "exit rmb" (anti)feature well but then it can't be exited at all.... hmpfsgrmbl!
Anything - press all of the most uncommon keys together but not "exit using RMB", i mean that is fine for a picture viewer displaying a picture on an own screen but not for a file player which should play a probably longer SFX or even some music or a loop while playing or using the machine otherwise.
Sure on a floppy driven A500 such large SFX files won't make sense but already on my A2000 with a 250MB HD i would have liked to loop a track while playing SimCity, since i attached my CD32 (using the communicator) as a cheap CD-ROM substitute to my A2000 i could have played a CD or a bunch of low sample/bitrate 8SVX (until i bought the A4000 the CD32 -> communicator -> A2000 setup was quite good for me, besides this was for this hillbilly the first contact with "fish" since i own the PD collection II on which fishdisk 1 to 500 is stored - if i remember this right, honestly i spent months even years to browse this repo - all via the serial port and a terminal program).

One could guess "oh sound handler"
but
"shit this handler only allows a playback in mono and this on a single channel (above linked SOUND plays mono on two channels as long as two of the four channels are free).
It isn't the right thing and i always end up with SOUND because it's still unbeaten.
SOUND is good i just kept searching for something else because i would like to exit the player even when the player window isn't visible (which would be the case for the two which use the "exit using LMB" anti-feature).
The handler could be controlled using a AREXX script, while this is neither what i like to offer here (or not yet), the scripts i offer here need to work in a standard OS1.3 (by addition of a couple of needed shared libraries like the not to forgo asl.library).
Neither i like to depend on ARP (except for a couple of standalone working programs like the ARP LIST) or a special shell like K-Shell or whatsoever because all of them interprete most probably the scripts a little different. I.e. the ARP shell, the biggest problem within this is that it interpretes the skip LABELS different as the standard shell, what works for standard OS1.3 refuses to work in ARP Shell and to change this fore and back depending on what shell you use is more as just stupid, standard OS1.3 compliant or bust it!
A very obvious difference is the interpretation of comments using the semicolon, ARP does not allow to use a semicolon at start of the line it must be indented at least by a single space character, this effectively will mean that i have to change ALL of my scripts or at least that i have to revisit them to see if i didn't used a semicolon at start of a line - stupid. A reason why i didn't use the semicolon for comments respectively onlöy for in-line commenting if the whole line is a comment i use "dot space" which is to prefere over the semicolon "dot space" will tell the interpreter to skip the line just like REM for MS-DOS a line commented out with a semicolon will still be readed, but not all of my scripts are changed to this manner. And because of all that - no extras.
Filename completition, history, scroll bar, these are all nice features but the thing is i don't miss them in OS1.3.
Rarely i use the scrollback feature of KCON in OS3.1, it isn't worth the change(s) to OS1.3 to have this feature when you almost never need it.
I script the hell out of OS1.3 but i don't need a scrollback or history feature for this neither that i need a different editor for the scripts as Ed.
But well i'm no measurement, i even script geometry in a standard windoze notepad...
(at least when i started out with this, a little later i used a specific LUA script-pad, since long i use notepad++ but in the end it is stilll the same as to script it using the bareboned notepad all the rest notepad++ offers for this specific task is just comfort. The "BREAKOUT" hack which i showed off in a different thread is a script as well, fortunately Joe was so clever to add a script parsing function to his Intellivision emulator, i wasn't really aware of it even if i noticed that it needed the load of hacks by "Midnight Blue International" to understand how easy this hacking an assembler program makes. Using the script parsing function you could theoretically write a complete program in GI1600 assembler as a sort of script, yeah not a speechy script - still a lot of gibberish just nicely one after the other which makes it a bit easier to underdstand what performs which task. Skipping to a given address is easier as well to skip a count of bytes for or back overall you will have a better overview and easier learn what the purpose of certain commands is and how to use them - from the "inside" which is something i really like - to be honest i never compiled an assembler program using Joe's SDK or any until it is still hacking the bare values, this makes it somewhat hard to understand but results in a different understanding. That is if something refuses to work as you meant it you better understand why it can't work in this manner at all, a SDK won't show you this it will prevent you from doing it without to tell any reason for it on the other hand this can lead to a complete different solution since many ways lead to rome, i.e. i made a few fixes to some games while making the fixes i found some solutions no one used before, repectively no one expected it, that is i.e. some games open in with a wrong screen color on a PAL Intellivision this fix only depends on at which specific address a certain data stands, it is something that can't be explained proper because it should work exactly the same at any address but it won't (personally i assume it's rooted in the different timing of NTSC and PAL consoles somehow this can skip data at least the solution is to make a sort of wider gap, as effect on a NTSC console the opening screen is black and on my PAL console it stays in standard olive green and the difference is to move the data to tint the screen black to a different address that on the other hand can refuse to be interpreted proper by the SEARS release of this console but there is always an intermediate point which works for all), such solutions you won't find using a SDK since this expects only things which are known. Further on i found a way to use the standard opening screen in a different manner as meant and in a different manner as Coleco did because of copyrighting and in a different manner as Mattel Electronics did to display animations in a title, such is only possible to find if you examine the code byte by byte and take a long sleep to get clear what can be done with it. Also the SDK will depend on resources which will be taken over completely even if you only need a sparse section of that, if you directly write the assembler code there are no dependencies which aren't needed by the program, no extra space for unused data. The use of the parser allows me to use the smallest gap of zero bytes in a ROM to write data to it, sure this could be used otherwise as well but not that easy. Means certain hacks where i didn't made a exclusive "Yoursoft Unlimited" screen for use exactly the same amount of bytes as the original - the title screen will blow this because most of the time i have to leave this code intact, but sometimes i can even overwrite this section or another section which i bypassed).
Just to tell how far you can go with the use of a standard notepad or Ed for the Amiga, there are no limits except your imagination.

At last but not at least my FILTER hack
The original FILTER i use you find i this CLI utilities package:
https://aminet.net/util/cli/CLI_Utilities.lha
But the original FILTER won't filter CRLF which is what i use it for therefore it filters all umlauts which is exactly what i didn't need, thus i hacked this program to filter CRLF but keep umlauts and other special ascii characters.
That i use exactly this one for this purpose is rooted in that it was the easiest to be hacked it was a sneeze to find the relevant code, respectively how he disabled a range of characters for the filter function.

My FILTER hack:
Filter_hack.zip
(2.87 KiB)
There is a good reason for hacking this proggy, i didn't found a CLI program for OS1.3 which filters CR/LF without to change the CR/LF to "space" and also most will exactly like "TYPE" add a CR/LF at end of the file if there is none, the only one i found which would be suitable works only from on OS2.0.
This FILTER program at least doesn't adds a CR/LF and like i said it was a sneeze to find the relevant data.

One could as well easy hack OS1.3 "TYPE", the ending CR/LF is easy to find in it if you replace this 0x0A with 0x00 the LF is gone for good but leaves a 0x00 at the end of the typed file, this is usually no problem because most programs simply disregard a 0x00, but well some might argue about the binary data in a ascii string, FILTER(hack) is better.
Using something like FILTER or a "TYPE_NoLinefeed" makes it easier to concatenate strings (commands), instead to write each snippet to a seperate temp file and join this finally using "JOIN" you can add string by string by variable by string by variable by string (and so on) into a single temp file to be executet, this spares at least the JOIN and it leaves a better overview as to use seperate temp files and then to join them (further you can type out this concatented string immediately after creation or in between creation to check the integrity);
"what did i joined with what?" - "where does this snippet belong to?"
no question by using FILTER and ECHO one stands nicely after the other.
NOTE: FILTER refuses to write a new file when you use append (>>stdout), if it should create a file it needs to be redirect (>stdout), if that isn't possible like in of my scripts then you have to create in advance an empty file with
ECHO >stdout

I guess this covers all programs i used for this scripts which aren't standard OS1.3.
Some or even most i showed already off in my two other threads and mostly i will use the same over and over for my scripts since this covers quite all what one will need.
What can follow is the use of EDIT but this is standard and/or the use of "MAT" which is somewhat similar to EDIT but adds some features one will like, you can parse strings with MAT, it's so far the only program which offers me parsing a string in a more or less simple manner, perhaps i can even use MAT to read and write hex values to given addresses but this i first have to learn the documentetion to MAT is a beast and until i used MAT only a single time for exactly this task to parse a string. In the scripts i showed here i use the clumsy manner to split the string or file at the address i like to retrieve the data from or like to write the data to and then i have to rejoin the snippets to the full string or full file, i'm used to but it's clumsy. MAT i used a single time to perform this in one try to read and another to write, MAT can retrieve a single character instead of a complete line like EDIT. The syntax for MAT is extremely complicated but as more flexibility a program offers as more complicated the syntax will be (up to that the syntax ends to a sort of little program), a simple parser like i use for MS-DOS has a simple syntax because it performs only one simple thing - parse a field by a specified field marker - basta. In general i like such better as a "i can perform all" thing like MAT is.

User avatar
Gernot66

Posted Wed Nov 09, 2022 3:59 pm

A few words to SPLITQ and what i did with it in the showed scripts.
I onyl use it here to check the icontype you selected by shift-click, the icontype is stored in the icon at address 0x30 (dec 48), i use SPLIT to extract only this single byte which ranges from 0x1 to 0x5 (0x6 if you add the "device" type).
Of course this i can't compare using IF since that is a hex value thus as next step i use TYPE "string" HEX to a temp file, this will be then readable and i have to use SPLIT a second time to get to the single value i need to compare with IF.
Clumsy but it works.

However i have no idea what was in my mind when i used for my "FloatDirectory" script the complicated way to check the content of a drawer, this is stupid and if there are sub directories in this directory it needs "forever" until all that is checked, i wasn't aware but stumbled over this when i used it to float the directory of the 256 terrains which contains three directories with again 512 files (incl. icons) per dir, all this will be checked if i check the content of a directory, to check the icontype is much better since that cost not a tenth of the time even in the above described clumsy manner.
In the end the result is the same it is (in case for the simcity additions) either a project icon or not, if true proceed, if false exit. In case for my "FloatDir" and "SortIcons" scripts it is a drawer icon or not - basta.

Next change to this scripts will be a use of MAT to shorten the above described procedure or a dedicated program to create patches with but this proggy (i remeber from peeping in the doc that it can retrieve and write hex values from and to hex addresses) but i first have to refind it and that isn't easy if you forgot the name of it because i just noticed it while i was looking for something else. The keyword "create patch" will help me to find it in he fishdisk content listing.





Return to “Software”