22 June 2011, 01:05 | #21 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
|
22 June 2011, 02:39 | #22 |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
If anyone has or suspects problems with Devpac/GenAm, there is vasm which is very compatible in Devpac compatibility mode and is actively developed...
http://sun.hasenbraten.de/vasm/ |
22 June 2011, 04:28 | #23 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
A program started from the CLI doesn't need to do anything to run properly, but a program started from the Workbench must retrieve a startup message sent by the Workbench before doing anything else, and return this message to the Workbench before quitting. I can give you my code if you'd like, or you can find instructions on how to do this in the RKM Libraries manual. High five for vasm! Last edited by Leffmann; 22 June 2011 at 04:35. |
|
22 June 2011, 09:36 | #24 | |||
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
Reason I asked that question is simply the fact that it's easy to blame something on the tools you use but in most cases it's your code which is buggy. Trust me on that one. Quote:
Quote:
You want to clear the color registers, but, are you really doing that? Check register a0. |
|||
22 June 2011, 10:26 | #25 | |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
|
Quote:
|
|
23 June 2011, 19:13 | #26 | ||||
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
Quite right, I overlooked a couple of stupid things there - namely the size of each colour register (2 bytes not 4) and used direct addressing instead of indirect addressing. Quote:
Quote:
Quote:
Regards, Lonewolf10 Last edited by Lonewolf10; 23 June 2011 at 19:16. Reason: typographical error |
||||
23 June 2011, 22:03 | #27 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
There are no methods to start program files from the bootblock, so any code you load yourself from the diskdrive can just be run as is. If you want your bootblock to enter AmigaDOS then there's a small procedure that needs to be followed, and it also needs to comply with the AmigaOS ABI and preserve registers D2-D7 and A2-A6. |
|
23 June 2011, 22:19 | #28 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
I currently load my demo via the startup-sequence, but it can also be loaded via workbench.
Any future projects will (hopefully) be loaded via the bootblock. Thanks for answering for both ways anyway Regards, Lonewolf10 |
23 June 2011, 23:58 | #29 | |
Registered User
Join Date: Aug 2008
Location: Salisbury
Posts: 744
|
Quote:
To answer Lonewolf, the coding was going very well. So far i've managed to do scroller scroller cookie cut over a background protracker note scrolling display bitplane sine wave shifting protracker / theplayer scope (orignally ripped from an old PT source but well an truly my own code now!) a module deconstruction and rebuild system I think my proudest effect so far is what I call the banksy effect. spray paints over the screen, which then peels away to reveal a logo, much like stencil art. Also I put together an entire 3 disk long play music disk using most of the stuff listed above, however, it still has a nasty bug involving the CIA replay and the loader... I'm sure Stingray could fill you in on the fun thats been!! BTW - that original block of code in this thread?? absolute bag of shite! Thankfully I got a good system startup block from Stingray. Next on the Agenda.... Finish music disk Start proper demo! |
|
24 June 2011, 08:43 | #30 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
|
|
25 June 2011, 22:37 | #31 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
I have re-written my kill system and restore system routines (see below), but now whilst my demo works as soon as it tries to return to workbench all I get is a black screen
I also tried saving register values on start-up and restoring on exit, but as soon as I started my demo I got an error (80000004) so I have commented them out for now. What am I missing, or doing wrong? New additions are in bold Code:
;Library offsets taken from Amiga Machine Language, pages 240-243 ExecBase equ 4 ;Exec.Library calls ******************* CloseLib equ -414 FindPort equ -390 FindTask equ -294 Forbid equ -132 GetMsg equ -372 OldOpenLib equ -408 Permit equ -138 ReplyMsg equ -378 WaitPort equ -384 ;Graphics.Library calls *********************** DisownBlitter equ -462 OwnBlitter equ -456 LoadView equ -222 WaitBlit equ -228 WaitTOF equ -270 ;Intuition.Library calls ************************ RemakeDisplay equ -384 kill_system: ;**** Kill System (cleanly?) **** * movem.l d0-d7/a0-a6,-(sp) ;store current register values move.l ExecBase,a6 jsr Forbid(a6) ;multitasking off *** ;new, 24th june 2011 lea.l demo_name,a1 jsr FindPort(a6) cmp #0,d0 beq.s killsys_error move.l d0,msg_port ;save msg port address lea.l msg_port,a0 jsr WaitPort(a6) lea.l msg_port,a0 jsr GetMsg(a6) move.l d0,system_msg *** lea.l graphics_lib,a1 ;open Graphics.Library moveq #0,d0 jsr OldOpenLib(a6) ;returns library address in d0 ***** cmp #0,d0 beq.s killsys_error ;new <<<--- 24 june 2011 ***** move.l d0,graphics_base ;store address move.l d0,a6 ;graphics.lib base -> a6 * beq.s allsquare_exit jsr OwnBlitter(a6) ;no input/output for both calls jsr WaitBlit(a6) move.l #0,a1 jsr LoadView(a6) ;no output jsr WaitTOF(a6) ;no input/output (call twice?) jsr WaitTOF(a6) move.w INTENAR,old_INTENAR ;store current settings move.w INTREQR,old_INTREQR move.w DMACONR,old_DMACONR move.w #$7FFF,INTENA ;disable everything move.w #$7FFF,INTREQ move.w #$07FF,DMACON or.b #%10000000,$BFD100 ;as interrupts are off, we manually and.b #%10000111,$BFD100 ;switch off disk drive motor lea.l COLOR00,a0 moveq #31-1,d0 ;number of colours kill_system_colours: move.w #0,(a0) ;was a0 addq #2,a0 dbra d0,kill_system_colours rts demo_name: dc.b "DD_AllSquare",0 even taskCB: dc.l 0 msg_port: dc.l 0 system_msg: dc.l 0 graphics_lib: dc.b "graphics.library",0 even graphics_base: dc.l 0 intuition_lib: dc.b "intuition.library",0 even intuition_base: dc.l 0 old_INTENAR: dc.w 0 old_INTREQR: dc.w 0 old_DMACONR: dc.w 0 restore_system: move.w #$7FFF,INTENA ;*** disable everything *** move.w #$7FFF,INTREQ move.w #$07FF,DMACON lea.l intuition_lib,a1 ;*** Open Intuition.Library *** move.l ExecBase,a6 moveq #0,d0 jsr OldOpenLib(a6) ;returns library address in d0 move.l d0,intuition_base ;store address move.l d0,a6 ;intuition.lib base -> a6 jsr RemakeDisplay(a6) move.l ExecBase,a6 move.l 156(a6),a6 move.l 38(a6),COP1LCH ;restore workbench copperlist move.w #0,COPJMP1 ;write any value to COPJMP1 move.w old_INTENAR,d0 ;*** restore system settings *** bset #15,d0 move.w d0,INTENA move.w old_INTREQR,d0 bset #15,d0 move.w d0,INTREQR move.w old_DMACONR,d0 bset #15,d0 move.w d0,DMACON move.l graphics_base,a6 jsr WaitTOF(a6) jsr DisownBlitter(a6) move.l ExecBase,a6 *** ;new, 24th june 2011 move.l system_msg,a1 jsr ReplyMsg(a6) *** jsr Permit(a6) * movem.l (sp)+,d0-d7/a0-a6 ;restore original register values rts Regards, Lonewolf10 |
25 June 2011, 23:37 | #32 |
Registered User
Join Date: Jun 2008
Location: somewhere else
Posts: 511
|
Code:
;Library offsets taken from Amiga Machine Language, pages 240-243 DMACONR equ $dff002 INTENAR equ $dff01c COP1LCH equ $dff080 COPJMP1 equ $dff088 DMACON equ $dff096 INTENA equ $dff09a COLOR00 equ $dff180 ExecBase equ 4 ;Exec.Library calls ******************* CloseLib equ -414 FindPort equ -390 FindTask equ -294 Forbid equ -132 GetMsg equ -372 OldOpenLib equ -408 Permit equ -138 ReplyMsg equ -378 WaitPort equ -384 ;Graphics.Library calls *********************** DisownBlitter equ -462 OwnBlitter equ -456 LoadView equ -222 WaitBlit equ -228 WaitTOF equ -270 ;Intuition.Library calls ************************ RemakeDisplay equ -384 kill_system: ;**** Kill System (cleanly?) **** * movem.l d0-d7/a0-a6,-(sp) ;store current register values move.l ExecBase,a6 jsr Forbid(a6) ;multitasking off *** ;new, 24th june 2011 lea.l demo_name,a1 jsr FindPort(a6) move.l d0,msg_port ;save msg port address beq.b no_msg lea.l msg_port,a0 jsr WaitPort(a6) lea.l msg_port,a0 jsr GetMsg(a6) move.l d0,system_msg no_msg: *** lea.l graphics_lib,a1 ;open Graphics.Library moveq #0,d0 jsr OldOpenLib(a6) ;returns library address in d0 ***** move.l d0,graphics_base ;store address beq.w killsys_error ;new <<<--- 24 june 2011 ***** move.l d0,a6 ;graphics.lib base -> a6 * beq.s allsquare_exit jsr OwnBlitter(a6) ;no input/output for both calls jsr WaitBlit(a6) move.l #0,a1 jsr LoadView(a6) ;no output jsr WaitTOF(a6) ;no input/output (call twice?) jsr WaitTOF(a6) move.w INTENAR,old_INTENAR ;store current settings move.w DMACONR,old_DMACONR move.w #$7FFF,INTENA ;disable everything move.w #$07FF,DMACON or.b #%10000000,$BFD100 ;as interrupts are off, we manually and.b #%10000111,$BFD100 ;switch off disk drive motor lea.l COLOR00,a0 moveq #32-1,d0 ;number of colours kill_system_colours: move.w #0,(a0) ;was a0 addq #2,a0 dbra d0,kill_system_colours loop: btst #6,$bfe001 ;left mouse button bne.b loop bra.w restore_system demo_name: dc.b "DD_AllSquare",0 even taskCB: dc.l 0 msg_port: dc.l 0 system_msg: dc.l 0 graphics_lib: dc.b "graphics.library",0 even graphics_base: dc.l 0 intuition_lib: dc.b "intuition.library",0 even intuition_base: dc.l 0 old_INTENAR: dc.w 0 old_DMACONR: dc.w 0 restore_system: move.w #$7FFF,INTENA ;*** disable everything *** move.w #$07FF,DMACON lea.l intuition_lib,a1 ;*** Open Intuition.Library *** move.l ExecBase,a6 moveq #0,d0 jsr OldOpenLib(a6) ;returns library address in d0 move.l d0,intuition_base ;store address move.l d0,a6 ;intuition.lib base -> a6 jsr RemakeDisplay(a6) move.l ExecBase,a6 move.l 156(a6),a6 move.l 38(a6),COP1LCH ;restore workbench copperlist move.w #0,COPJMP1 ;write any value to COPJMP1 move.w old_INTENAR,d0 ;*** restore system settings *** or.w #$c000,d0 move.w d0,INTENA move.w old_DMACONR,d0 bset #15,d0 move.w d0,DMACON move.l graphics_base,a6 jsr WaitTOF(a6) jsr DisownBlitter(a6) killsys_error: move.l ExecBase,a6 *** ;new, 24th june 2011 move.l system_msg,d0 beq.b no_replymsg move.l d0,a1 jsr ReplyMsg(a6) no_replymsg: *** jsr Permit(a6) * movem.l (sp)+,d0-d7/a0-a6 ;restore original register values moveq #0,d0 ;return code rts |
26 June 2011, 01:58 | #33 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Thanks for trying to help, hitchhikr, but I already have those registers defined - I just forgot to list them in the above code.
Regards, Lonewolf10 |
26 June 2011, 02:11 | #34 |
Registered User
Join Date: Jun 2008
Location: somewhere else
Posts: 511
|
Check the code i modified more carefully.
|
26 June 2011, 16:11 | #35 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
That code will still not work. You have to call FindTask(0) and then find the message port structure at offset pr_MsgPort. You also need to have multitasking disabled before you call ReplyMsg and leave it disabled, or your program memory might get freed up and reused before you've quit. AmigaOS will enable the multitasking again after your program has quit.
The way you find the system's Copper program through the exec base is probably not safe either. You can f.ex enable interrupts first before calling RethinkDisplay or RemakeDisplay and then enable DMA, and the system will write the Copper pointer itself. Here's a minimal WBStartup you can use like this: jsr WBStartup (run demo) moveq #0, d0 rts |
27 June 2011, 10:06 | #36 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
As Leffmann already assumed, this is causing your black screen by starting a bad copper list.
Code:
move.l ExecBase,a6 move.l 156(a6),a6 move.l 38(a6),COP1LCH ;restore workbench copperlist move.w #0,COPJMP1 ;write any value to COPJMP1 |
27 June 2011, 12:07 | #37 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
You're wrong. This is an old trick to get gfxbase, check my code here for example. I only use this trick when the code needs to be extremely size optimised. It isn't causing the black screen. I don't know why he uses code like that though (probably copy/pasted from somewhere) when he opens the graphics.lib in a "clean" way in his init code. As for the black screen, didn't test the code but I see that he still uses RemakeDisplay when the sytem is disabled. That might be one of the reason for the problems. Last edited by StingRay; 27 June 2011 at 12:15. Reason: Typos |
|
27 June 2011, 12:17 | #38 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
|
|
27 June 2011, 23:00 | #39 | ||
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
I did and Leffmann was right, it didn't fix my problem.
Quote:
Err.. no. Everything was working perfectly ok, including returning to workbench, until I tried to fix the problem with the error message I recieved from workbench and ended up making things worse! Many thanks, it's all working as desired and no error messages when returning back to workbench Quote:
Regards, Lonewolf10 Last edited by Lonewolf10; 27 June 2011 at 23:12. Reason: forgot to reply to hoffman's message |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling WinUAE 2.1.0 | rotacak | support.WinUAE | 8 | 06 May 2010 17:09 |
Help compiling winuaesrc1530 | AAG | support.WinUAE | 2 | 08 January 2009 11:45 |
Compiling BlizKick | Toni Wilen | Coders. General | 2 | 26 December 2007 17:06 |
Compiling 1.3.4 | rotacak | support.WinUAE | 70 | 22 January 2007 08:13 |
Slowly compiling | stainy | Nostalgia & memories | 4 | 10 September 2002 01:28 |
|
|