13 June 2010, 01:16 | #81 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
Thanks for your help guys
|
14 June 2010, 12:43 | #82 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
Tried to open my own screen with the following code in DevPac318 but the A1200 crash and I don´t know why.
Any Ideas? Code:
MoveScr =-162 OpenScr =-198 CloseScr =-66 CloseLib =-414 OpenLib =-552 ExecBase =4 IntuitRev EQU 31 bsr OpenInt bsr ScrOpen move.l #10000,d0 Wait: sub.w #1,d0 cmp.w #1,d0 bgt Wait bsr ScrClose bsr CloseInt rts OpenInt: moveq #IntuitRev,d0 move.l ExecBase,a6 lea IntName,a1 jsr OpenLib(a6) move.l d0,IntBase rts CloseInt: move.l ExecBase,a6 move.l IntBase,a1 jsr CloseLib(a6) rts ScrOpen: move.l IntBase,a6 lea ScrDefs,a0 jsr OpenScr move.l d0,ScrHandle rts ScrClose: move.l IntBase,a6 move.l ScrHandle,a0 jsr CloseScr(a6) rts align ScrDefs: x_pos: dc.w 0 y_pos: dc.w 0 width: dc.w 320 height: dc.w 200 deph: dc.w 2 detail_pen: dc.b 1 block_pen: dc.b 3 view_modes: dc.w 2 screen_type: dc.w 15 font: dc.l 0 title: dc.l sname gadgets: dc.l 0 bitmap: dc.l 0 IntBase: dc.l 0 ScrHandle: dc.l 0 IntName: dc.b 'intuition.library',0 sname: dc.b 'Our Screen',0 |
14 June 2010, 12:59 | #83 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
It's just because you forgot to add (A6) after jsr OpenScr
Also the delay loop will finish almost instantly. Even on an old Amiga 500 that loop will be done in a fraction of a second. You can check for the left mouse button like this: Code:
waitmouse btst #6, $bfe001 bne waitmouse |
14 June 2010, 13:42 | #84 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
This my error was so rookie that I´m still amazed
Thanks for the help Leffmann Also, one of my next items in the learning list was: how to make a routine for waiting a mouse click. Thanks to you, now I already know |
14 June 2010, 16:29 | #85 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
If we have some FastRam installed how we can force some code to run in ChipRam?
Do have any option in DevPac to force the code to be in ChipRam or it can be done directly in the code? |
14 June 2010, 17:01 | #86 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
|
14 June 2010, 22:19 | #87 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
@StingRay
Thanks for the help. Tried your tip but DevPac gives an error in ´CODE_c´ maybe it doesn´t support that op-code. There is other way to force data into ChipMem? |
14 June 2010, 23:10 | #88 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
He was thinking about ASM-One in Devpac it's just "section code_c".
The section types you can use are code, data and bss, and the postfixes are c, f and p. bss is a section of zeroed space that will be allocated for you when the program starts, so you don't have to add to size your executable. I'm not sure if AmigaOS itself makes any distinction between between code and data type sections, since it seems it will start program execution in the first section regardless of its type, so you should always put your program code first. The postfixes are c for chipmem, f for fastmem or slowmem, and p for public. Public memory is fastmem or slowmem if available, and chipmem if not. Public is to prefer for all code and things like constants since it could potentially end up in fastmem and run faster. Only use chipmem for the stuff that must go there, like audio and graphics data to be accessed directly by the hardware. |
15 June 2010, 01:52 | #89 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
You are right Leffmann, with 'section code_c' DevPac assembles with no errors. Already downloaded DevPac´s manual too and read the 'Output file directives' chapter so I could understand this stuff
|
15 June 2010, 09:05 | #90 | ||
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
StingRay was (almost ) correct in what he posted - that's the first time I've ever said "almost" in relation to an assetion by Stinger and, to be fair, the guy doesn't even use Devpac! The error with this: Quote:
Code:
SECTION CODE,CODE_c |
||
15 June 2010, 09:33 | #91 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
|
|
15 June 2010, 11:54 | #92 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Yeah you're right, I should've spotted that since I've never been a fan of Devpac's strict syntax.
In any case per the current topic of Bippy's hijacked thread and it being in the tutorial forum, the reason for using anonymous or identical sections is to have the assembler coalesce them to f.ex benefit from PC-relative addressing. Splitting things up in several sections with different names might give your program a better chance of starting when you're low on memory or if it's fragmented. F.ex if you have a demo with 4 large songs of 100 kB each and stick them in the same section, your program won't start if there's no contiguous block of 400 kB. But if you put them in separate sections it might because there's a bigger chance you'd find 4 separate blocks of 100 kB each. |
16 June 2010, 11:44 | #93 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,525
|
As this is a tutorial thread (and I'm currently bored at the office ) some more information on sections, names and linkers:
The general syntax, which should be supported by all assemblers is: Code:
SECTION <name>,<type> Code:
SECTION <name>,<type>,<memattr> Devpac and others (like vasm) also support omitting the <name> field. In this case it will automatically use <type> as section name. Special section names: Unnamed sections have a special meaning to the linker. The linker will never coalesce unnamed sections! The same effect is achieved by naming a section _NOMERGE. Another very useful section name is __MERGED. All data and bss sections with this name will be automatically coalesced, building a so-called data-bss section. This is a Data hunk which defines a larger size than it contains initialized data. The unitialized data is automatically cleared by LoadSeg() (Warning: only since OS2.0, otherwise you have to clear it yourself). A perfect construct for small data segments. |
16 June 2010, 17:06 | #94 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
I´m trying to make something visible on screen but with no luck until now.
Assembled the code below with DevPac in UAE 68040 so I could see screen change color but when run it in CLI from RamDisk: I couldn´t see nothing appear on screen until I click the mouse and program stops. Why?..Do I need to setup my own screen? Code:
CODE_c moveq #-1,d0 Loop: move.w $dff006,$dff180 subq.w #1,d0 bne.b Loop moveq #0,d0 WaitMouse: btst #6, $bfe001 bne WaitMouse rts Last edited by AlfaRomeo; 16 June 2010 at 17:20. |
16 June 2010, 17:54 | #95 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,546
|
Quote:
|
|
16 June 2010, 19:41 | #96 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
Yes, Tony I´m using RTG.
What I have to do so I can view the colors from the code above? Last edited by AlfaRomeo; 16 June 2010 at 19:47. |
16 June 2010, 22:24 | #97 |
Global Moderator
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
|
Boot into a non RTG screen.
I.e use a native amiga screenmode! |
16 June 2010, 22:49 | #98 |
A1200 040 SAM440EP 667
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
|
Understood.. that happens because UAE doesn´t emulate Amiga custom chips.
But some demos could start directly from UAE like the one I uploaded now to the zone: VectorBalls Means that demos like that one are OS friendly? Sorry for my "so basic" questions Last edited by AlfaRomeo; 16 June 2010 at 23:04. |
16 June 2010, 23:04 | #99 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,867
|
|
16 June 2010, 23:09 | #100 | |
68k
Join Date: Sep 2005
Location: Somewhere
Posts: 829
|
Quote:
Its mean you should first add to source two routines. First kill the os and second one restore os. But much easier is to use prefs and switch to the PAL screen then you will see colors. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Downfall - diary of a game... | Graham Humphrey | Amiga scene | 505 | 15 March 2015 19:26 |
Uridium 2 : Diary of a Game | silkworm | Amiga scene | 15 | 09 August 2011 09:00 |
19 Part One - Boot Camp | Retro-Nerd | project.aGTW | 2 | 19 February 2008 22:11 |
Help....what is this part 2? | Dizzy | Retrogaming General Discussion | 7 | 05 June 2007 15:27 |
|
|