Author Topic: Firmware Indirections  (Read 1522 times)

0 Members and 1 Guest are viewing this topic.

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.939
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1159
  • Likes Given: 1931
Firmware Indirections
« on: 08:47, 11 December 10 »
On Page 75 of the PDF form of the Firmware guide, I'm confused as to why there is an alternative set of Firmware Instructions which seemly appear to do what other Firmware instructions would be doing.
 
For example there's GRA PLOT (&BDDC) & GRA LINE (&BDE2) both of which appear to do the same job as GRA PLOT ABSOLUTE (&BBEA) & GRA LINE ABSOLUTE (&BBF6), I just don't understand what that means and the Firmware Guide clearly doesn't define what the Advantages/Disadvantages would be.
* 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

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2280
  • Likes Given: 3478
Re: Firmware Indirections
« Reply #1 on: 12:34, 11 December 10 »
On Page 75 of the PDF form of the Firmware guide, I'm confused as to why there is an alternative set of Firmware Instructions which seemly appear to do what other Firmware instructions would be doing.
 
For example there's GRA PLOT (&BDDC) & GRA LINE (&BDE2) both of which appear to do the same job as GRA PLOT ABSOLUTE (&BBEA) & GRA LINE ABSOLUTE (&BBF6), I just don't understand what that means and the Firmware Guide clearly doesn't define what the Advantages/Disadvantages would be.
The firmware functions call the indirection functions. And you can patch the indirections so that you can change how the firmware works.
Think of the gra plot absolute and gra line absolute as the high level functions, and then gra plot and gra line as the low level ones.
GRA PLOT ABSOLUTE calls GRA PLOT inside.
If you want low level control over the firmware, patch the indirections. This is exactly what I have done for the text printing code (6x8 char font).
I also found that if I patched the cursor indirections then I can draw the cursor in the correct place with the correct size.

So this is what they are for.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.939
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1159
  • Likes Given: 1931
Re: Firmware Indirections
« Reply #2 on: 23:25, 11 December 10 »
arnoldemu wrote:

The firmware functions call the indirection functions. And you can patch the indirections so that you can change how the firmware works.
Think of the gra plot absolute and gra line absolute as the high level functions, and then gra plot and gra line as the low level ones.
GRA PLOT ABSOLUTE calls GRA PLOT inside.
If you want low level control over the firmware, patch the indirections. This is exactly what I have done for the text printing code (6x8 char font).
I also found that if I patched the cursor indirections then I can draw the cursor in the correct place with the correct size.

So this is what they are for.


Just seems bizarre. I guess it's like the High Level Functions are there in case something goes wrong your computer merely resets, misuse the Low Level Functions and your computer blows up or something to that extent!  ???  Don't recall AA ever covering anything like this in Assembly tutorials (which makes it seem like their use at your own risk kind of Functions), I noticed you used an alternative Indirection which Prints to screen, though knew there was another alternative printing to screen instruction (besides &BB5A - TXT OUTPUT) in the form of &BB5D - TXT WR CHAR. An article from AA and the Firmware Guide confirms how &BB5A can be used when you want to Preserve the Registers and &BB5D does the opposite.
 
I would presume that because the Firmware Indirections are at Low Level, things like the Enter Firmware (&BE9B) from CP/M won't work because it's only meant to be used on the High Level Functions?
* 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