Weapons Menu pop up

Working in a weapons' menu pop up fir the select button, but I continue to get An illegal instruction. I have my .nam file in the nametables and believe I have it set to see this file too. attached Is the input code too.
 

Attachments

  • illegEL INSTRUCTION.PNG
    illegEL INSTRUCTION.PNG
    13.5 KB · Views: 3,455
  • Weapons menu pop up.PNG
    Weapons menu pop up.PNG
    13.5 KB · Views: 3,455

Mugi

Member
you're missing a comma from line 7
it's #$00, #$00 #$20
it should be #$00, #$00, #$20

just for further reference, the error message states exactly where the error is: 1Myfunction (line 7): DrawBox (column19)
 

baardbi

Well-known member
Also (correct me if I'm wrong) I believe you need a # in front of a constant. I'm assuming that NT_WeaponScreen and Nt_StartScreen are constants.
 
Thank you for the help. Small over sights. Now all the labels are undefined. So I will just point the code to where it needs to go and this should work
 
looks like these are the ARG in DrawBox Macro I have left everything alone. Any pointers on how to finish up the Arguments ?
 

Attachments

  • ARG1.PNG
    ARG1.PNG
    27.5 KB · Views: 3,423

baardbi

Well-known member
Are NT_WeaponScreen and NT_StartScreen variables or constants? As I said earlier, constants need a # in front of them; #MyConstant

The errors refer to the two lines where you have used the NT constants/variables.
 

Oonan

New member
If you click on defined scripts you can bring up the macro definition. On the right hand side, of the defined scripts, is a button that says macros, along with a box. If the macros are not visible, try expanding the screen and pressing the macros button. Look through the list and find DrawBox, click on it. There is a very small line at the bottom of the screen that you can click and drag up, there you will see the code for DrawBox.

DrawBox takes 9 arguments, you only gave 8. They are as followed: box x origin, box y origin, box width, box height, box att width, box att height, 0/1 hide show sprites, just refresh box, use text box or just use blackout and attribute.

Code:
MACRO DrawBox arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8
	;arg 0 = box x origin
	;arg 1 = box y origin
	;arg 2 = box width
	;arg 3 = box height
	;arg 4 = box att width
	;arg 5 = box att height
	;arg 6 = 0= show sprites, 1 = hide sprites
	;arg 7 = just refresh the box
	;arg 8 = use textbox or just use blackout and attribute?

Hopefully that helps, you can also look at DrawBox.asm found in GameEngineData\Routines\Basic\System\Macros\ or replace Basic with Basic_NoScroll folder.
 
Oonan said:
If you click on defined scripts you can bring up the macro definition. On the right hand side, of the defined scripts, is a button that says macros, along with a box. If the macros are not visible, try expanding the screen and pressing the macros button. Look through the list and find DrawBox, click on it. There is a very small line at the bottom of the screen that you can click and drag up, there you will see the code for DrawBox.

DrawBox takes 9 arguments, you only gave 8. They are as followed: box x origin, box y origin, box width, box height, box att width, box att height, 0/1 hide show sprites, just refresh box, use text box or just use blackout and attribute.

Code:
MACRO DrawBox arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8
	;arg 0 = box x origin
	;arg 1 = box y origin
	;arg 2 = box width
	;arg 3 = box height
	;arg 4 = box att width
	;arg 5 = box att height
	;arg 6 = 0= show sprites, 1 = hide sprites
	;arg 7 = just refresh the box
	;arg 8 = use textbox or just use blackout and attribute?

Hopefully that helps, you can also look at DrawBox.asm found in GameEngineData\Routines\Basic\System\Macros\ or replace Basic with Basic_NoScroll folder.

What would the 9th one be?
 

Oonan

New member
The arguments are zero based - meaning the first argument is 0 and the 9th one is 8. In this case the 9th argument is asking if it should create the textbox or just fill the area with black. I have not tried it but I would assume you pass it either zero or 1.

I am very new to ASM so I am not sure this will fix your issue but matching the correct number of arguments I think might help.
 

baardbi

Well-known member
Yes. Oonan is right. the ninth argument is 8 because 0 is the first. Also you will get the "Unknown label" error if you do not fill in all the arguments. It's not clear what you should put in argument 8, but i agree with oonan that it's probably 1 or 0.
 
Hmm no luck on changin changing the Arguments. I get the same errors for line 7 and 13. Any other ideas. I know that this could be benefit everyone here if this weapons menu works
 

dale_coop

Moderator
Staff member
Are you sure that your "NT_WeaponScreen" is declared and set somewhere?

if I try:
Code:
LDA #$00
STA temp

DrawBox #$00, #$00, #$20, #$08, #$1E, temp, #$00, #$00, #$00

the drawbox works.
 

baardbi

Well-known member
I think there may be some misunderstandings here. I suggest you post a screenshot of your constants and variables (from the Project Settings window).
 
Here are all the Constance . change of controller script and errors that come along with each change.
 

Attachments

  • Unknown Lable Error.GIF
    Unknown Lable Error.GIF
    19.6 KB · Views: 3,582
  • Value opf of range Weapons Menu.GIF
    Value opf of range Weapons Menu.GIF
    16.9 KB · Views: 3,582
  • Weapons Meni Value constant.GIF
    Weapons Meni Value constant.GIF
    29.9 KB · Views: 3,582
  • Weapons Menu Image 2.GIF
    Weapons Menu Image 2.GIF
    185.9 KB · Views: 3,582

dale_coop

Moderator
Staff member
Oh, "NT_WeaponScreen" is a constant name?!
So, you need to use #NT_WeaponScreen

Code:
	DrawBox #$00, #$00, #$20, #$08, #$1E, #NT_WeaponScreen, #$00, #$00, #$00
 
Top Bottom