English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 04 September 2011, 18:47   #1
Jherek Carnelia
Dazed and Confused
 
Jherek Carnelia's Avatar
 
Join Date: Dec 2001
Location: portsmouth/uk
Posts: 242
LoadRGB4() puzzle

I've opened an Intuition friendly CustomScreen and want to change the colours, so I do this:

Code:
movea.l  GfxBase,a6
movea.l  my_screen,a0           ;pointer to my new screen
movea.l  sc_ViewPort(a0),a0    ;and its ViewPort
lea        colors,a1                  ;array of my colours
move.w #NUM_COLOURS,d0	
jsr        _LVOLoadRGB4(a6)      ;my colours into colormap
movea.l  IntBase(pc),a6
movea.l  my_screen(pc),a0
jsr        _LVOMakeScreen(a6)   ;make new copperlist
jsr        _LVORethinkDisplay(a6)	
bra       menus_done
What I thought would happen is that the colour registers for my screen would be changed to the values I supplied, but nothing changes. However, when I quit back to workbench, the colours have changed to the ones I wanted! It would seem that I don't really understand how to use this function call; Can someone point out the error of my ways??
Jherek Carnelia is offline  
Old 04 September 2011, 21:12   #2
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Hi,

I'm not sure but a0 in your code doesn't point to your screen ViewPort. Try with this

Code:
lea sc_ViewPort(a0),a0
instead of
Code:
move.l sc_ViewPort(a0),a0
Regards
Asman is offline  
Old 04 September 2011, 21:52   #3
Jherek Carnelia
Dazed and Confused
 
Jherek Carnelia's Avatar
 
Join Date: Dec 2001
Location: portsmouth/uk
Posts: 242
That was it. Thanks Asman.

I'm always getting lea and movea.l mixed up, I seem to have some kind of a blind spot there!
Jherek Carnelia is offline  
Old 05 September 2011, 22:40   #4
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by Jherek Carnelia View Post
That was it. Thanks Asman.

I'm always getting lea and movea.l mixed up, I seem to have some kind of a blind spot there!
You're not the only one, I have done that before Now it's one of the first things I check if something doesn't work as intended


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 06 September 2011, 15:51   #5
Ed Cruse
Registered User
 
Join Date: Sep 2007
Location: Las Cruces, USA
Age: 71
Posts: 351
My biggest problem was leaving out #.

As an example, instead of

move.l #127,d0

I would put

move.l 127,d0

I can't tell you how many times I've done that and how long it took to find them, my brain just wouldn't see them. I just got to the point where I would look for that anytime something didn't work correctly.

I probably lost half my hair this way.
Ed Cruse 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
Puzzle Games Gordon Retrogaming General Discussion 45 08 July 2013 06:06
Mickey's Jigsaw Puzzle s2325 request.Old Rare Games 2 23 April 2008 11:17
puzzle platformer Asimir Looking for a game name ? 4 19 November 2005 23:50
Looking for a puzzle game Phiber Looking for a game name ? 11 31 July 2004 22:12
Candy Puzzle CD³² ? RetroMan request.Old Rare Games 1 19 January 2002 10:27

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 19:59.

Top

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