03 May 2021, 16:10 | #1 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Using LoadView to display a system friendly title screen?
In my project I want to keep the system operational but display a title screen from a copper list I've constructed.
Is it possible to just create a View structure and call Loadview() on it..? Or do I really have to create a ViewPort as well? Any examples would be handy too. Code:
STRUCTURE ViewPort,0 LONG vp_Next LONG vp_ColorMap LONG vp_DspIns LONG vp_SprIns LONG vp_ClrIns LONG vp_UCopIns WORD vp_DWidth WORD vp_DHeight WORD vp_DxOffset WORD vp_DyOffset WORD vp_Modes BYTE vp_SpritePriorities BYTE vp_reserved APTR vp_RasInfo LABEL vp_SIZEOF STRUCTURE View,0 LONG v_ViewPort LONG v_LOFCprList LONG v_SHFCprList WORD v_DyOffset WORD v_DxOffset WORD v_Modes LABEL v_SIZEOF |
03 May 2021, 17:19 | #2 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,236
|
Quote:
Screen front/back hotkeys will erase your view, there will be zero chances to promote your application to any other screen mode than the native ones. Just open a screen. You can hide the drag bar, so there is no visible difference to a view, except that things work nicely. |
|
03 May 2021, 17:33 | #3 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
I'll add some context... My executable is 200kb, once that is loaded by the system I then wanted to load a simple game loading image and display it in a OS friendly manner because I need to use the OS to load the rest of the game. Once the game is loaded then full take over of the system ( Disable(), OwnBlitter() etc ) is done then released when the game ends. |
|
03 May 2021, 17:39 | #4 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,236
|
Use a screen. Really. I'm serious.
For rolling a display yourself, you need a RasInfo, a ViewPort, a ColorMap, a View, and a ViewExtra. Then associatate the ViewExtra to the view, load colors, MakeVPort(), MrgCop(), LoadView(). It is *really really* a lot more hassle than to open a screen, and put a backdrop borderless window on it so nobody can drag it away. Actually, intuition does all the same, but in a fully integrated way without having to worry about the gory details. Is there a particular reason why you want to make it more complicated, plus prime chances to shoot yourself in the foot? Quote:
You cannot disable for more than a couple of ms safely if you want to return to a working system. |
|
03 May 2021, 17:50 | #5 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
What do you mean exactly by opening a screen? I know the very basics of the AmigaOS, do you mean there is an easier OS friendly way to display a simple image on screen? The other sticking point I have is that I am very low on chip ram, I really don't want the OS to start allocating ram ... I was hoping I could get away with just allocating the ram for a copper list and load the image into a buffer that is already under my control. This is looking more tedious than it should be, I'll just skip the game having a loading screen. |
|
03 May 2021, 19:49 | #6 |
Registered User
Join Date: Sep 2017
Location: Kansas, USA
Posts: 328
|
If you're trying to make it OS friendly, try using CloseWorkBench() and OpenWorkBench() to free up and then restore Workbench afterwards if you need the extra ram. Then just open a regular Intuition screen for your game: http://amigadev.elowar.com/read/ADCD.../node00D7.html
|
03 May 2021, 20:14 | #7 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,236
|
I mean intuition OpenScreen()/OpenScreenTagList().
And the RAM for the bitmap falls from the sky if you use LoadView()? OpenScreenTagList(), the CloseWorkBench(), and you have the RAM back. |
03 May 2021, 20:25 | #8 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Assigning memory from a copper list will surely be smaller than allocating ram for a huge bitmap - i already explained i already have the ram allocated for the bitmap under my control, i dont want to allocate it again. |
|
03 May 2021, 21:18 | #9 | |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,236
|
Quote:
*Sigh* In case this was not clear to begin with: OpenScreen() and friends will allocate the same amount of chip ram for the bitmap than you would have to allocate, except that you have to do a lot more footwork, plus the risk to do it wrong. There is nothing to "allocate again". OpenScreen allocates the memory for you - and you find this memory in screen->RastPort.BitMap and the bitmap pointers therein. There is really an Os to do the work for you, with tested and working functions. It does not make sense to re-invent the wheel. The Os knows the corner cases of the chipset, its quirks, such as alignment requirements on the bitmap, independent on the chipset revision and the host system. |
|
03 May 2021, 21:32 | #10 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Not all of us do everything through the OS, if this (sigh) offends you then maybe move swiftly on to another thread. As I've tried to explain... I am short on chip ram, I don't want to allocate upwards of 64kb for a bitmap when I already have that ram available in a previous allocation to load and unpack files from. My question was simple, can I use LoadView() to point to a simple copper list that I previously created... it seems the answer is "no"... that's all you had to say instead of jabbering on. Also, when I take over the system I do a call to Disable(), when the game is done I make a call to Enable() and release all ram and everything comes back fine, minutes may have passed during the interval. Last edited by mcgeezer; 03 May 2021 at 21:38. |
|
03 May 2021, 21:57 | #11 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
This source load an iff image and display it.
It was many images instead of actual text that I typed into a usable source code. http://obligement.free.fr/articles/a...images_iff.php Last edited by kamelito; 03 May 2021 at 22:32. |
03 May 2021, 22:17 | #12 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Hi Graeme, I'm not entirely sure why you want to use a View structure.
What I would do is simply call LoadView(NULL) and then directly write my copper list pointer to COP1LC. Then use the value at GfxBase->copint (offset $26) to restore it at the end. The system is fully active with your copper list in use Someone will turn up their noses because this is unorthodox.. EDIT: sorry, corrected Last edited by ross; 03 May 2021 at 22:36. |
03 May 2021, 22:38 | #13 |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 828
|
@mcgeezer
I think that you can do it in following way: 1. save old view 2. reset display 3. io flush 4. loading assets 5. io flush 6. takeover os I am not sure if I did it in Solomon's Key. But for sure I have source code with loading data with loading screen and very simple progress bar. I need to dig it up. Probably tomorrow I will send you pm. Last edited by Asman; 03 May 2021 at 22:39. Reason: added missing step after loading assets |
03 May 2021, 22:42 | #14 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Hi Ross - thanks for this as it looks like it will work quite easily. So here is the reason I was looking at the View structure, it may be that I'm over complicating what I need. My Turbo Sprint exe is roughly 200kb, when the exe is loaded it then allocates 392kb of ram - this ram becomes under my control to allocate things like screen buffers, sprite sheets etc. But upon load I use it to load a 320kb file which has all of the game assets in a packed format. So as I have 72kb remaining in the buffer I thought I would load a title screen for the game while the 320kb assets load from floppy/hd (using DOS calls). So then because I have the system up and running I need to simply load a title screen image into the back of the 392kb buffer (title screen is 5 bitplanes.. approx 50kb in size so enough space). I then just need to display the image... so the only thought I had was that I would have to use LoadView to create a custom COPPER list which points to my bitplanes and RGB pallette. If there's an easier way to do it then I've missed it... but the upshot is I need to display the title screen while I do a call to Open(), Read(), Close() etc. Hope this makes sense... appreciate the response buddy! Graeme |
|
03 May 2021, 22:47 | #15 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
I also happened to write directly to GfxBase allocated memory for copinit, so I mixed things up a bit.. (this works also, but hmm too much brutal and limited.., only for some dirty job) Try as I wrote in the edit, it should work. |
|
03 May 2021, 22:49 | #16 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
03 May 2021, 22:50 | #17 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Thanks man - will do.
|
03 May 2021, 23:21 | #18 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,154
|
I'm not turning my nose up - because this is probably how I'd do it, too - but just bear in mind that you're only hiding the underlying workbench screen. It's still there, and if you haven't frozen the system, it's also responding to keypresses and mouseclicks.
In theory a careless user who's absent-mindedly clicking around while waiting for the game to load could click the "Yes" button of that "Really format volume Work:" dialog he carelessly left open! For that reason, I'd probably also install an input handler to soak up keypresses or mouse movements. |
03 May 2021, 23:29 | #19 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
|
|
03 May 2021, 23:37 | #20 | |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,154
|
Quote:
Not 100% sure, no - my memory may be playing tricks on me, so I'd have to try it. But would you expect Intuition to notice that its view has been replaced and stop responding to input as a result? EDIT: OK I just tested it, and yes, input events do reach the underlying screen after LoadView(NULL) has removed the system copperlist. A couple of other points: LoadView(NULL) should be followed by a couple of WaitTOF() calls before loading your own copperlist, and you should store GfxBase->ActiView first, and LoadView() that on exit - that way RTG screens should (should!) be correctly restored too. Last edited by robinsonb5; 03 May 2021 at 23:53. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
REQ: NoiseTracker or ProTracker System friendly source | redblade | Coders. Asm / Hardware | 4 | 27 February 2021 08:56 |
Cool e-ink display for 30 euro. Amiga friendly? | TenLeftFingers | support.Hardware | 3 | 11 November 2016 12:21 |
System friendly Protracker Replay? | AGS | Coders. System | 2 | 16 August 2014 20:53 |
Any Screen grabers HighGFX friendly? | NovaCoder | support.Apps | 4 | 17 December 2009 13:50 |
Assembler System Friendly code | redblade | Coders. General | 3 | 29 July 2008 12:15 |
|
|