Jump to content
IGNORED

MADS Knowledge-Base


Recommended Posts

  • 2 weeks later...
  • 2 weeks later...

MADS version 1.9.6 Build 89

 

Can't compile

.echo ""

 

I'm attempting to print a blank line in the compilation output and receive a string error.

 

Workaround: .echo " "

 

this is empty string, xasm report ERROR: Unexpected end of line, mads report ERROR: String error, maybe better "Empty string"

Link to comment
Share on other sites

MADS version 1.9.6 Build 89

 

Can't compile....

.ifdef VALUE1

... code ...

 

#while .byte TEMP1>#0

... code ...

#end

... code ...

.endif

 

In my full code I get....

DECOMPRESS_TILES.asm (104) ERROR: Unreferenced directive .END

 

yes, its bug

 

put #WHILE block into .MACRO block, and this working

 

or use directive .ENDW (.WEND) (end while) instead #END

Edited by tebe
Link to comment
Share on other sites

mads 1.9.7 build 10

 

Tebe, thank you! This no longer creates a compiler error for me.

 

I have another problem. I am unable to give an example at the moment, my code is too large and needs simplifying a lot for an example. Are there any limitations to how far away in the executable a procedure (.proc) can be from the call to the proc? Do they also need to be in the same segment?

Link to comment
Share on other sites

this is empty string, xasm report ERROR: Unexpected end of line, mads report ERROR: String error, maybe better "Empty string"

 

Is it possible that it won't create an error? It would be nice if it printed a newline character (\n). If I print " ", then it would actually print " \n". So if I print "", could it then print "\n"?

Edited by snicklin
Link to comment
Share on other sites

I am unable to give an example at the moment, my code is too large and needs simplifying a lot for an example.

 

OK, I've simplified the code (a bit!), this is all within MAIN:

 

Example 1: Faulty Code:

JMP GOT_PAST

 

icl 'lib/memory/CLEAR_1K.asm'

icl 'lib/memory/CLEAR_PAGE.asm'

icl 'lib/keyboard/get_key.asm'

 

GOT_PAST:

JMP MAIN_GAME_ROUTINES

 

.ifdef GAME_MAIN_GAME_EXISTS

icl 'lib/gameStructure/prepare_main_game.asm'

icl 'lib/gameStructure/start_main_game.asm'

icl 'lib/gameStructure/end_main_game.asm'

MAIN_GAME_ROUTINES:

procPREPARE_MAIN_GAME

procSTART_MAIN_GAME

procEND_MAIN_GAME

.endif

 

This code will produce:

 

procClear_Page .proc ( .byte bytePageNo )

CLEAR_PAGE.asm (10) ERROR: Label PROCCLEAR_PAGE declared twice (BANK=0)

.proc Get_Key ()

get_key.asm (1) ERROR: Label GET_KEY declared twice (BANK=0)

procPMG_Init ; Initialise PMG graphics for ingame usage

prepare_main_game.asm (30) ERROR: Undeclared macro PROCPMG_INIT (BANK=0)

JSR DECOMPRESS_TILES

start_main_game.asm (25) ERROR: Undeclared label DECOMPRESS_TILES (BANK=0)

 

Example 2: Example moves the jump to within the ifdef GAME_MAIN_GAME_EXISTS

 

.ifdef GAME_MAIN_GAME_EXISTS

JMP GOT_PAST

 

icl 'lib/memory/CLEAR_1K.asm'

icl 'lib/memory/CLEAR_PAGE.asm'

icl 'lib/keyboard/get_key.asm'

 

GOT_PAST:

JMP MAIN_GAME_ROUTINES

icl 'lib/gameStructure/prepare_main_game.asm'

icl 'lib/gameStructure/start_main_game.asm'

icl 'lib/gameStructure/end_main_game.asm'

MAIN_GAME_ROUTINES:

procPREPARE_MAIN_GAME

procSTART_MAIN_GAME

procEND_MAIN_GAME

.endif

 

With this, there is no problem, it compiles as it should. So the problem seems to be if you are using ifdef. Is this a valid bug?

 

Please note that GAME_MAIN_GAME_EXISTS is true.

Edited by snicklin
Link to comment
Share on other sites

  • 4 weeks later...

Version 1.9.6_b7: Feature request

 

.opt f+

...

org bank2+$fe4

 

>Bank2-End.asm (21) ERROR: Can't fill from higher to lower memory location

 

Could you please add the 2 address values (current PC and resulting ORG) that don't match and maybe also the number of bytes exceeding the ORG value?

  • Like 1
Link to comment
Share on other sites

+1. I run into this a lot when working in my OS kernel around places that need to match absolute addresses, and the error message doesn't tell you how many bytes you need to trim to fit. Instead, I have to manually check and report overflows:

 

.if *>$f3f6-8
.error 'ROM overflow into Screen Handler region: ',*,' > $F3EE.'
.endif

org $f3f6-8

Link to comment
Share on other sites

  • 4 weeks later...

don't know if it's off-topic

 

but

 

how can i get this (atari roots chapter 13) running on mads?

 

10 ;

20 ;HELLO SCREEN

30 ;

40 *=$3000

50 JMP INIT

60 ;

70 SDMCTL=$022F

80 ;

90 SDLSTL=$0230

0100 SDLSTH=$0231

0110 ;

0120 COLOR0=$02C4; OS COLOR REGISTERS

0130 COLOR1=$02C5

0140 COLOR2=$02C6

0150 COLOR3=$02C7

0160 COLOR4=$02C8

0170 ;

0180 ;DISPLAY LIST DATA

0190 ;

0200 START

0210 ;

0220 LINE1 .SBYTE " PRESENTING "

0230 LINE2 .SBYTE " the big program "

0240 LINE3 .SBYTE " By (your name) "

0250 ;

0260 LINE4 .SBYTE " PLEASE STAND BY "

0270 ;

0280 ;DISPLAY LIST

0290 ;

0300 HLIST

0310 .BYTE $70,$70,$70; 3 BLANK LINES

0320 .BYTE $70, $70, $70, $70,$70; MORE BLANK LINES

0330 .BYTE $46; LSM, ANTIC MODE 6 (BASIC MODE 2)

0340 .WORD LINE1; (TEXT LINE: "PRESENTING...")

0350 .BYTE $70,$70,$70,$70,$47; LMS, ANTIC MODE 7

0360 .WORD LINE2; (TEXT LINE: "THE BIG PROGRAM")

0370 .BYTE $70,$42; (LMS, ANTIC MODE 2 [GR.0])

0380 .WORD LINE3;(TEXT LINE: "By [Your Name]")

0390 .BYTE $70,$70,$70,$70,$46;LMS, ANTIC MODE 6

0400 .WORD LINE4; (TEXT LINE: "PLEASE STAND BY")

0410 .BYTE $70,$70,$70,$70,$70; 5 BLANK LINES

0420 .BYTE $41; JVB INSTRUCTION

0430 .WORD HLIST; TO JUMP BACK TO START OF LIST

0440 ;

0450 ;RUN PROGRAM

0460 ;

0470 INIT NOP; SWITCHING COLOR REGISTERS FOR NICELY COLORED DISPLAY

0480 LDA COLOR3

0490 STA COLOR1

0500 LDA COLOR4

0510 STA COLOR2

0520 ; NOW WE'LL RUN THE PROGRAM

0530 LDA #0

0540 STA SDMCTL; TURN ANTIC OFF FOR A MOMENT ...

0550 LDA #HLIST&; WHILE WE STORE OUR NEW LIST'S ADDRESS

0560 STA SDLSTL; IN THE OS DISPLAY POINTER.

0570 LDA # HLIST/256; NOW FOR THE HIGH BYTE.

0580 STA SDLSTH; NOW ANTIC WILL KNOW OUR NEW ADDRESS

0590 LDA #$22

0600 STA SDMCTL; ... SO WE'LL TURN ANTIC BACK ON NOW

0610 ;

0620 FINI

0630 RTS

Link to comment
Share on other sites

;
;HELLO SCREEN
;

SDMCTL=$022F

SDLSTL=$0230
SDLSTH=$0231

COLOR0=$02C4                ; OS COLOR REGISTERS
COLOR1=$02C5
COLOR2=$02C6
COLOR3=$02C7
COLOR4=$02C8

   org $3000

;
; Screen data
;

LINE1    dta d '	  PRESENTING    '
LINE2    dta d '   the big program  '
LINE3    dta d '			   By (your name)		 '
LINE4    dta d '   PLEASE STAND BY   '

;
; Display list
;

HLIST    dta $70,$70,$70            ; 3 BLANK LINES
   dta $70,$70,$70,$70,$70        ; MORE BLANK LINES

   dta $46                ; LSM, ANTIC MODE 6 (BASIC MODE 2)
   .word LINE1            ; (TEXT LINE: "PRESENTING...")
   dta $70,$70,$70,$70,$47        ; LMS, ANTIC MODE 7
   .word LINE2            ; (TEXT LINE: "THE BIG PROGRAM")
   dta $70,$42            ; (LMS, ANTIC MODE 2 [GR.0])
   .word LINE3            ; (TEXT LINE: "By [Your Name]")
   dta $70,$70,$70,$70,$46        ; LMS, ANTIC MODE 6
   .word LINE4            ; (TEXT LINE: "PLEASE STAND BY")

   dta $70,$70,$70,$70,$70        ; 5 BLANK LINES
   dta $41                ; JVB INSTRUCTION
   .word HLIST            ; TO JUMP BACK TO START OF LIST

;
; Run program
;

init    NOP                ; SWITCHING COLOR REGISTERS FOR NICELY COLORED DISPLAY
   LDA COLOR3
   STA COLOR1
   LDA COLOR4
   STA COLOR2

   LDA #0
   STA SDMCTL            ; TURN ANTIC OFF FOR A MOMENT ...

   LDA #<HLIST            ; WHILE WE STORE OUR NEW LIST'S ADDRESS
   STA SDLSTL            ; IN THE OS DISPLAY POINTER.

   LDA #>HLIST            ; NOW FOR THE HIGH BYTE.
   STA SDLSTH            ; NOW ANTIC WILL KNOW OUR NEW ADDRESS

   LDA #$22
   STA SDMCTL            ; ... SO WE'LL TURN ANTIC BACK ON NOW

finish    jmp finish            ; endless loop

;-------
   run init

example.xex

Link to comment
Share on other sites

other ways to format your tables...

 

; display list

hlist    dta $70,$70,$70,$70,$70,$70,$70,$70,$46,a(line1),$70,$70,$70,$70,$47,a(line2),$70,$42,a(line3),$70,$70,$70,$70,$46,a(line4)
   dta $70,$70,$70,$70,$70,$41,a(hlist)

 

or..

 

; display list

hlist    dta $70,$70,$70,$70,$70,$70,$70,$70,$46,<line1,>line1,$70,$70,$70,$70,$47,<line2,>line2,$70,$42,<line3,>line3,$70,$70,$70,$70,$46,<line4,>line4
   dta $70,$70,$70,$70,$70,$41,<hlist,>hlist

Link to comment
Share on other sites

other ways to format your tables...

 

; display list

hlist dta $70,$70,$70,$70,$70,$70,$70,$70,$46,a(line1),$70,$70,$70,$70,$47,a(line2),$70,$42,a(line3),$70,$70,$70,$70,$46,a(line4)
dta $70,$70,$70,$70,$70,$41,a(hlist)

 

or..

 

; display list

hlist dta $70,$70,$70,$70,$70,$70,$70,$70,$46,<line1,>line1,$70,$70,$70,$70,$47,<line2,>line2,$70,$42,<line3,>line3,$70,$70,$70,$70,$46,<line4,>line4
dta $70,$70,$70,$70,$70,$41,<hlist,>hlist

 

 

great !!

 

now how can i "connect" resulting .XEX with the other generated by rastaconverter (intro screen) ?

Link to comment
Share on other sites

By a programmer spoiled by mads:

 

; Display list values
DL_LMS_MASK = %01000000
DL_JVB = 65
DL_BLANK_8 = 112

; Basic graphic modes
GM_CHAR_G0 = 2 ; 2 colors, 40x24, 960b, 40xline, 8 scanlines
GM_CHAR_G1 = 6 ; 4 colors, 20x24, 480b, 40xline, 8 scanlines
GM_CHAR_G2 = 7 ; 4 colors, 20x12, 240b, 20xline, 16 scanlines

; display list
hlist
:8 .byte DL_BLANK_8
.byte GM_CHAR_G1+DL_LMS_MASK
.word line1

:4 .byte DL_BLANK_8
.byte GM_CHAR_G2+DL_LMS_MASK
.word line2

.byte DL_BLANK_8
.byte GM_CHAR_G0+DL_LMS_MASK
.word line3

:4 .byte DL_BLANK_8
.byte GM_CHAR_G1+DL_LMS_MASK
.word line4

.byte DL_JVB
.word hlist

 

And could be better with macros x)

  • Like 1
Link to comment
Share on other sites

yea :) repeat is certainly very handy, I use it a lot too.

 

I usually prefer to construct my dl manually with addition .. like this from my boulderdash loader..

 

antic	 :9 .byte $70
.byte $80
.byte $40+$0d+$80,a(scr)
.byte $40+$0d+$80,a(scr+40)
.byte $40+$0d+$80,a(scr+80)
.byte $40+$0d+$80,a(scr+120)
.byte $40+$0d+$80,a(scr+160)
.byte $40+$0d+$80,a(scr+200)
.byte $40+$0d+$80,a(scr+240)
.byte $40+$0d+$80,a(scr+280)
.byte $40+$0d+$80,a(scr+320)
.byte $40+$0d+$80,a(scr+360)
.byte $40+$0d+$80,a(scr+400)
.byte $40+$0d+$80,a(scr+440)
.byte $40+$0d+$80,a(scr+480)
.byte $40+$0d+$80,a(scr+520)
.byte $40+$0d+$80,a(scr+560)
.byte $40+$0d+$80,a(scr+600)
.byte $40+$0d+$80,a(scr+640)
.byte $40+$0d+$80,a(scr+680)
.byte $40+$0d+$80,a(scr+720)
.byte $40+$0d+$80,a(scr+760)
.byte $40+$0d+$80,a(scr+800)
.byte $40+$0d+$80,a(scr+840)
.byte $40+$0d+$80,a(scr+880)
.byte $40+$0d+$80,a(scr+920)
.byte $f0
.byte $c4,a(scr2)
.byte $4
.byte $f0
.byte $2
.byte $41,a(antic)

 

@ Aking. I should've mentioned also that you can still use ".byte" too with MADS :)

 

I most often use specific hexadecimal tables via .he with MADS which negates the requirement to include the $.

I find the source is then much neater and easier to view when I'm working.

 

.he 00 00 19 1A 1B 1C

Edited by Tezz
Link to comment
Share on other sites

;

;HELLO SCREEN

;

...
...
...

    STA SDMCTL            ; ... SO WE'LL TURN ANTIC BACK ON NOW



finish    jmp finish            ; endless loop



;-------

    run init

Seems that this was questioned more than one time here...

 

Sow now we have 2 options for beginners here within this forum now :)

And I see, I forgot to run init in my version - tough altirra runs it fine :o

Link to comment
Share on other sites

The upper xex together with the upper 'the big program'.

 

Simply add this code right at the top of Tezz's version:

    opt h-
    ins 'AtariForce.xex'
    opt h+
    ini $5800    ;## ini address found in xex file ##

And dont forget to have this file also within the right folder ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...