English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 28 December 2022, 12:04   #1
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Many Questions

  1. When I open diskfont.library, it returns a 0 outside of workbench.
  2. Where do I need to put fonts for diskfont to find them? (Somewhere under SYS:?)
  3. If I make a bootable floppy disk, that will boot and there'll be no background OS running, right?

Thanks in advance
Steam Ranger is offline  
Old 28 December 2022, 12:24   #2
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,030
Quote:
Originally Posted by Steam Ranger View Post
When I open diskfont.library, it returns a 0 outside of workbench.
No, if the library can be found on disk, it will open, no matter if Workbench is running or not.

Quote:
Where do I need to put fonts for diskfont to find them? (Somewhere under SYS:?)
Fonts:, wherever that points to. Normally Sys:fonts, but you can assign it elsewhere. And if you insert a disk called Fonts, it will take precedence.


Quote:
If I make a bootable floppy disk, that will boot and there'll be no background OS running, right?
No, wrong. When the initial CLI is opened, all the OS is active, except the Worbench desktop, but that's not needed to run your program.

Only if you write your own bootblock, then you have the option to interrupt OS initialisation at an early stage. But still you can use graphics, intuition and other parts which do not need DOS.
thomas is offline  
Old 29 December 2022, 00:00   #3
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Quote:
Originally Posted by thomas View Post
No, if the library can be found on disk, it will open, no matter if Workbench is running or not.
So what your saying is that it's on disk rather than in ROM?

Quote:
Originally Posted by thomas View Post
Fonts:, wherever that points to. Normally Sys:fonts, but you can assign it elsewhere. And if you insert a disk called Fonts, it will take precedence.
Ok.

Quote:
Originally Posted by thomas View Post
No, wrong. When the initial CLI is opened, all the OS is active, except the Worbench desktop, but that's not needed to run your program.

Only if you write your own bootblock, then you have the option to interrupt OS initialisation at an early stage. But still you can use graphics, intuition and other parts which do not need DOS.
The main thing is, if I use my own copper list to change screen colours, will it interfere with anything?

Speaking of that, is there any better way to change screen colours than copper lists?
Steam Ranger is offline  
Old 29 December 2022, 07:25   #4
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
PS: I'm using SetRGB4() as is suggested in the intuition manual, but for some reason it's changing the colour of the screen of the app that opened it. Examples: If I open it from a shell, the workbench colours change to what my screen's should, but my screen's colours don't change. If I open it from DOpus, it's colours change but my screen's colours don't.

I'm totally perplexed as to why this is happening, please help...
Steam Ranger is offline  
Old 29 December 2022, 10:41   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,030
Quote:
Originally Posted by Steam Ranger View Post
So what your saying is that it's on disk rather than in ROM?
Yes. OpenFont() is a function of graphics.library which is in ROM, but it can only open fonts which are already in memory. OpenDiskFont() belongs to diskfont.library. It can load fonts from disk. Loading from disk requires DOS to be active. It does not make sense to put this library in ROM which already has very limited space.

Quote:
Originally Posted by Steam Ranger View Post
PS: I'm using SetRGB4() as is suggested in the intuition manual, but for some reason it's changing the colour of the screen of the app that opened it.
SetRGB4 changes the colours of the ViewPort you give to it. If you want to change your screen's colours you have to supply your screen's ViewPort.

myscreen = OpenScreen (&newscreen);
SetRGB4 (&myscreen->ViewPort,0,15,8,0);
thomas is offline  
Old 29 December 2022, 11:59   #6
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Quote:
Originally Posted by thomas View Post
myscreen = OpenScreen (&newscreen);
SetRGB4 (&myscreen->ViewPort,0,15,8,0);
That's exactly what I'm doing. Here's my code:
Code:
	lea.l	NewProgramScreen,A0	; Load the screen's specifications into A)
	CallIntuition	OpenScreen	; Attempt to open the screen
	tst.l	D0			; Was the screen opened?
	beq	IntuitionFailiure	; If not, start exiting the program
	move.l	D0,ProgramScreen	; Otherwise, store the screen
	move.l	D0,A2

	UseGraphics
	move.l	sc_ViewPort(A2),A0
	moveq	#0,D0
	moveq	#$0,D1
	moveq	#$0,D2
	moveq	#$0,D3
	Call	SetRGB4
	move.l	sc_ViewPort(A2),A0
	moveq	#1,D0
	moveq	#$C,D1
	moveq	#$8,D2
	moveq	#$0,D3
	Call	SetRGB4
I've attached pictures.





Before my program runs:







After my program runs and opens a screen:

Attached Thumbnails
Click image for larger version

Name:	Normal.png
Views:	379
Size:	12.4 KB
ID:	77572   Click image for larger version

Name:	After Program.png
Views:	372
Size:	7.4 KB
ID:	77573  
Steam Ranger is offline  
Old 29 December 2022, 12:32   #7
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,030
Code:
move.l	sc_ViewPort(A2),A0
This should be

Code:
lea	sc_ViewPort(A2),A0
The viewport is embedded in the screen structure, it is not a pointer to another memory area. Apparently viewports are linked in a pointered list. By reading the pointer from the beginning of your viewport you got the address of another viewport by chance.
thomas is offline  
Old 30 December 2022, 09:45   #8
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
I'm continuing to run into issues with diskfont.

This is how I'm opening and closing fonts:
Code:
	lea.l	FontTextAttribute,A0	; Load the font's specifications into A0
	CallDiskFont	OpenDiskFont	; Attempt to open the font
	tst.l	D0
	beq	FontFailiure
	move.l	D0,Font
Code:
	move.l	Font,A1			; Load the font into A1
	CallDiskFont	CloseFont	; Close the font
However, error 80000005 is generated when CloseFont is run, what's causing this? I'm using diskfont, I'm loading the correct font into the correct register, all that stuff.
Steam Ranger is offline  
Old 30 December 2022, 09:53   #9
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,030
CloseFont is in graphics.library, not in diskfont.library.

diskfont is really only to load fonts from disk, everything else is done by graphics.
thomas is offline  
Old 30 December 2022, 10:35   #10
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
I keep making the mistake of using the wrong library. Thanks. I'm going to add that to my list of things to check for.
Steam Ranger is offline  
Old 30 December 2022, 12:16   #11
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
I'm trying to open a screen in WB 1.3, here are the details:
Code:
NewProgramScreen
	dc.w	0,0				; XPos, YPos
NewScreenWidth
	dc.w	320				; Width
NewScreenHeight
	dc.w	200				; Height
	dc.w	2				; Colour Depth
	dc.b	2,1				; Detail Pen, Block Pen
	dc.w	0				; View Mode
	dc.w	CUSTOM_SCREEN			; Screen Type
	Pointer	FontTextAttribute		; Font
	Pointer	ProgramScreenTitle		; Pointer to title string
	Pointer					; Gadgets
	Pointer					; Bitmap
Code:
FontTextAttribute
	Pointer	FontName			; Name
	dc.w	11				; Height
	dc.b	FS_NORMAL			; Style
	dc.b	0				; Flags
Code:
ProgramScreenTitle	String	"abcdef ABCDEF"
I'm making sure that the font is opened, that works without any errors. But when this is run:
Code:
	lea.l	NewProgramScreen,A0	; Load the screen's specifications into A)
	CallIntuition	OpenScreen	; Attempt to open the screen
It gives error 00000025, which is some random CPU error. I'm assuming that I'm doing something wrong with the libraries, but I can't figure out what. The new screen is using features that are available in that version of kickstart, I'm opening intuition. No idea what's wrong.

Thanks for all the help so far by the way.
Steam Ranger is offline  
Old 30 December 2022, 13:09   #12
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,030
Is it really necessary to do this in assembler? It is so difficult to read. And to write obviously. A higher level language would have told you about most of the mistakes you did. And it lets you call the functions by name only. The correct library base is used implicitly.

The code you quoted is ok. You have to quote the entire program to reproduce the error and to find the mistake.
thomas is offline  
Old 30 December 2022, 16:08   #13
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,068
Assuming that String is 'DC.B' and Pointer is 'DC.L \1 or 0', it looks OK. How does CallIntuition look like, is the pointer valid?
If possible, go through the code with debugger and skip over system calls... Also, alignment OK?
a/b is offline  
Old 30 December 2022, 20:09   #14
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,549
Guru #00000025 would be a
trap #5
instruction. Is it reproducible? Then try to use it as a breakpoint in the UAE debugger (
fi 4e45
).

When the crash happens at OpenScreen it is most likely that you are jumping at some random address. Wrong base pointer in A6? As a/b said: get accustomed to using a debugger and have a closer look at that call.
phx is offline  
Old 30 December 2022, 23:33   #15
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Ah, I was using custom_screen rather than customscreen.
Steam Ranger is offline  
Old 01 January 2023, 12:39   #16
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
For some reason CloseFont isn't freeing any memory. Is this normal?
Steam Ranger is offline  
Old 01 January 2023, 12:42   #17
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,378
if the font is already open by some other application, probably. Those are shared resources.
jotd is offline  
Old 01 January 2023, 14:47   #18
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,319
Fonts work pretty much like libraries. They aren't removed from memory automatically - only if the system runs low on memory.
Thomas Richter is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apollo 1240 - Questions about questions StompinSteve Hardware mods 19 19 July 2021 02:05
OS 3.9 Questions videofx support.Apps 2 06 July 2014 10:39
Thank you but more questions! bluebrummie New to Emulation or Amiga scene 12 18 April 2006 04:22
Two questions Drakon request.Old Rare Games 7 19 November 2002 19:33
A few questions! One1 New to Emulation or Amiga scene 2 30 October 2002 17:41

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:49.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11223 seconds with 14 queries