Tezz Posted August 26, 2013 Share Posted August 26, 2013 (edited) oops, thanks pps I'd forgotten about listing the example with the rc pic for aking, I've had my head in fixing Druid for NTSC this evening. so... I assume you wanted the text intro before the raster converter picture which can be done like so .. ; ; Hello screen ; sdmctl = $022F sdlstl = $0230 sdlsth = $0231 skctl = $D20F color0 = $02C4 ; OS color REGISTERS color1 = $02C5 color2 = $02C6 color3 = $02C7 color4 = $02C8 ;-------------------------------- org $1800 ; 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 dlist 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(dlist) init nop ; Switching color registers for nicely colored display lda color3 sta color1 lda color4 sta color2 mva #0 sdmctl ; Turn Antic off for a moment ... mwa #dlist sdlstl ; ... while we store our new display list's address in the os display pointer mva #$22 sdmctl ; ... so we'll turn antic back on now _kbd lda skctl ; wait for key bounce loop and #4 bne _kbd jmp $5800 ; execute the included raster converter image ;------- org $2000 opt h- ; include the binary file with opt h- to remove the file header ins 'AtariForce.xex' opt h+ ;------- ini init ;------- example.xex Edited August 26, 2013 by Tezz Quote Link to comment Share on other sites More sharing options...
Aking Posted August 27, 2013 Share Posted August 27, 2013 oops, thanks pps I'd forgotten about listing the example with the rc pic for aking, I've had my head in fixing Druid for NTSC this evening. so... I assume you wanted the text intro before the raster converter picture which can be done like so .. ; ; Hello screen ; sdmctl = $022F sdlstl = $0230 sdlsth = $0231 skctl = $D20F color0 = $02C4 ; OS color REGISTERS color1 = $02C5 color2 = $02C6 color3 = $02C7 color4 = $02C8 ;-------------------------------- org $1800 ; 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 dlist 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(dlist) init nop ; Switching color registers for nicely colored display lda color3 sta color1 lda color4 sta color2 mva #0 sdmctl ; Turn Antic off for a moment ... mwa #dlist sdlstl ; ... while we store our new display list's address in the os display pointer mva #$22 sdmctl ; ... so we'll turn antic back on now _kbd lda skctl ; wait for key bounce loop and #4 bne _kbd jmp $5800 ; execute the included raster converter image ;------- org $2000 opt h- ; include the binary file with opt h- to remove the file header ins 'AtariForce.xex' opt h+ ;------- ini init ;------- got some errors but pps 's rutine assembled both programs without problems Quote Link to comment Share on other sites More sharing options...
1NG Posted September 19, 2013 Share Posted September 19, 2013 I just tried the cool feature .segment, but it didn´t work as expected (Message: "Value out of Range" for each .endseg) Until I used the newest version So everything is just fine! BTW: I saw the size of the mads.exe in the three last versions and it was 214016 bytes each. Why is it exactly 209 KB? Quote Link to comment Share on other sites More sharing options...
1NG Posted September 21, 2013 Share Posted September 21, 2013 Now I ran into a problem with mads: One file of my source code doesn´t compile any more after upgrading to a new version (see above: upgrade needed for .segment) I striped the problem down to this: SHEARED_SCROLL = 0 org $2400 main: jmp main .if SHEARED_SCROLL ScrollLineOffsetFractAdd_ .rept 85 dta <(((#*25*256)/1000 + 64)*2/1) .endr ScrollLineOffsetFixAdd_ .rept 85 dta >(((#*25*256)/1000 + 64)*2/1) .endr .else ScrollLineOffsetFractAdd_ .rept 85 dta <(80) .endr ScrollLineOffsetFixAdd_ .rept 85 dta >(80) .endr .endif ; ----- start address ------------------------------------------ run main The MADS console output is 0,stop with output files of 0-size length Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted September 21, 2013 Author Share Posted September 21, 2013 (edited) Now I ran into a problem with mads: Interesting. If you strip it right down to this, it still doesn't compile: flag = 0 org $2400 .if flag .rept 85 .byte 0 .endr .else .byte 1 .endif Doesn't seem to like REPT in the positive clause of an IF condition. I also noticed empty IF/ELSE clauses cause an error. Edited September 21, 2013 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted September 25, 2013 Author Share Posted September 25, 2013 (edited) Latest MADS ends with rather ambiguous "0,stop" message and produces no object file when compiling the Ultimate 1MB PBI ROM. Absolutely no clue given to what's causing the problem. Is there a debug mode so I can at least find the offending line of source code? Last one which works (fortunately) is the MADS build in post #93. The one a couple of posts later has a gloss saying that "REPT" has been rewritten, etc... maybe something got screwed up there, but it's hard to know what. Will have to stick with the post #93 version for now. Edited September 25, 2013 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
tebe Posted September 27, 2013 Share Posted September 27, 2013 fixed REPT mads 24.09.2013 mads_24.09.2013.zip 2 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted September 27, 2013 Author Share Posted September 27, 2013 fixed REPT mads 24.09.2013 Great - thanks Tebe. U1MB PBI sources appear to compile now. Quote Link to comment Share on other sites More sharing options...
1NG Posted September 28, 2013 Share Posted September 28, 2013 Good work! My source is OK now too. Quote Link to comment Share on other sites More sharing options...
tebe Posted September 28, 2013 Share Posted September 28, 2013 ING .rept 85 dta >(80) .endr short repeat :85 dta >(80) Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 29, 2013 Share Posted September 29, 2013 OSX port? Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 29, 2013 Share Posted September 29, 2013 Just spotted the compilation section on the English sites Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted September 29, 2013 Author Share Posted September 29, 2013 Here's an OS X build: mads_24.09.2013_OS_X.zip Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 5, 2013 Share Posted October 5, 2013 Regression with .fl in 1.9.7 build 53: it is no longer able to encode numbers smaller than 1e-10. opt h- org $2000 .fl 1e-20 :10 dta 0 .fl 1e-15 :10 dta 0 .fl 1e-12 :10 dta 0 .fl 1e-11 :10 dta 0 .fl 1e-10 :10 dta 0 .fl 1e-9 :10 dta 0 .fl 1e-5 :10 dta 0 1.9.7 build 10: 00000000: 36 01 00 00 00 00 00000010: 38 10 00 00 00 00 00000020: 3A 01 00 00 00 00 00000030: 3A 10 00 00 00 00 00000040: 3B 01 00 00 00 00 00000050: 3B 10 00 00 00 00 00000060: 3D 10 00 00 00 00 1.9.7 build 53: 00000000: 00 00 00 00 00 00 00000010: 00 00 00 00 00 00 00000020: 00 00 00 00 00 00 00000030: 00 00 00 00 00 00 00000040: 3B 01 00 00 00 00 00000050: 3B 10 00 00 00 00 00000060: 3D 10 00 00 00 00 Quote Link to comment Share on other sites More sharing options...
tebe Posted October 7, 2013 Share Posted October 7, 2013 (edited) .fl fixed, ROR (65816) fixed mads 1.9.8 build 5 (07.10.2013) mads198b5.zip Edited October 7, 2013 by tebe Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 8, 2013 Share Posted October 8, 2013 Thanks -- that fixes both issues! I don't suppose I could convince you to support LONGA/LONGI? It's the standard syntax for telling a 65816 assembler M/X state without actually emitting a REP/SEP insn. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted October 17, 2013 Author Share Posted October 17, 2013 And multiple .RELOC blocks of user-definable types (main, extended, etc)??? Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 12, 2013 Author Share Posted November 12, 2013 (edited) Just stumbled across this one: mva #0 Ds1[0].ReturnCode This puts $00 into the proper element of struct Ds1. mva #0 Ds1 [0].ReturnCode However, the second example (note space between struct name and array index) always stores $00 in the first byte of the struct. Edited November 12, 2013 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
fibrewire Posted November 14, 2013 Share Posted November 14, 2013 .fl fixed, ROR (65816) fixed mads 1.9.8 build 5 (07.10.2013) Any chance you can tell me how to use .RELOC blocks in mads? I'm new Quote Link to comment Share on other sites More sharing options...
tebe Posted November 14, 2013 Share Posted November 14, 2013 mads .. \examples\tetris.asm mads .. \examples\tetris_reloc.asm mads .. \examples\LIBRARIES\ Quote Link to comment Share on other sites More sharing options...
snicklin Posted November 16, 2013 Share Posted November 16, 2013 Using Mads 1.9.8 B5 If I do this, .var .byte count=0 LDA enemyData[count].defaultY If I compile the above, I get "ERROR: Constant expression violates subrange bounds" If however, I use LDA enemyData[0].defaultY or LDA enemyData[1].defaultY then it compiles and works. What I do not understand is that previously I have declared enemyData dta enemyDataStruct [2] As count=0, it isn't out of bounds... but it reports that it is. I guess the problem is due to the compiler knowing that 'count' could be set to a value greater than/equal to 2. How can I refer to a structure which is indexed by a variable?? I don't want to have to write code for each and every enemy, I will have many enemies in my game, which is better represented as an array. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted November 18, 2013 Share Posted November 18, 2013 There are 2 standard approaches for this "object based" access: Assume objects have 4 attribute "a","b","c","d" of size 1 byte each. Approach 1: Column based NUMBER_OF_ENEMIES = 10 .local enemies a .ds NUMBER_OF_ENEMIES b .ds NUMBER_OF_ENEMIES c .ds NUMBER_OF_ENEMIES d .ds NUMBER_OF_ENEMIES .endl ldx #enemy_id lda enemies.a,x .. lda enemies.b,x .. Approach 2: Row based lda #enemy_id asl asl tax lda enemies.a,x .. lda enemies.b,x .. .local enemies a = enemies+0 b = enemies+1 c = enemies+2 d = enemies+3 .ds NUMBER_OF_ENEMIES*4 .endl the 2nd approach can also be written as structs probably, I'm simply more accustomed to this notation. 1 Quote Link to comment Share on other sites More sharing options...
snicklin Posted November 27, 2013 Share Posted November 27, 2013 Thank you for this Jac! Unfortunately I haven't seen this until now, only just read it today. I think that the 2nd approach seems to make more sense to me. I will try to use it. Quote Link to comment Share on other sites More sharing options...
snicklin Posted November 28, 2013 Share Posted November 28, 2013 (edited) MADS 1.9.8 build 5 The following code crashes. 65 92E2 A5 8E C9 B7 B0 03 + #if .byte PLAYER0X > #GAME_RIGHT_BORDER 66 92F0 A5 C8 C9 03 D0 05 #if .byte ROOM_X = #WORLD_WIDTH-1 67 92F6 C6 8E DEC PLAYER0X 68 92F8 4C 05 93 #else 69 92FB E6 C8 INC ROOM_X 70 92FD A9 01 85 A0 MVA #1 SCREEN_COMPLETE 71 9301 A9 40 LDA #GAME_LEFT_BORDER 72 9303 85 8E STA PLAYER0X 73 9305 #end 74 ;#else ; Leave this else in, even if it does nothing as the game crashes without it 75 9305 #end The next block of code is the same as the above block of code,except an 'else' has been added. This works fine. 65 92E2 A5 8E C9 B7 90 1A + #if .byte PLAYER0X > #GAME_RIGHT_BORDER 66 92EA A5 C8 C9 03 D0 05 #if .byte ROOM_X = #WORLD_WIDTH-1 67 92F0 C6 8E DEC PLAYER0X 68 92F2 4C FF 92 #else 69 92F5 E6 C8 INC ROOM_X 70 92F7 A9 01 85 A0 MVA #1 SCREEN_COMPLETE 71 92FB A9 40 LDA #GAME_LEFT_BORDER 72 92FD 85 8E STA PLAYER0X 73 92FF #end 74 92FF 4C 02 93 #else ; Leave this else in, even if it does nothing as the game crashes without it 75 9302 #end Edited November 28, 2013 by snicklin Quote Link to comment Share on other sites More sharing options...
phaeron Posted December 1, 2013 Share Posted December 1, 2013 Oops, spoke too soon on the .FL fix -- it is losing significant digits between 10^-3 and 10^-9 (MADS 1.9.8 build 5): 48 20F0 3E 12 34 56 79 00 .fl 1.23456789e-3 49 20F6 00 00 00 00 00 00 + :10 dta 0 50 51 2100 3E 01 23 45 68 00 .fl 1.23456789e-4 52 2106 00 00 00 00 00 00 + :10 dta 0 53 54 2110 3D 12 34 57 00 00 .fl 1.23456789e-5 55 2116 00 00 00 00 00 00 + :10 dta 0 56 57 2120 3D 01 23 46 00 00 .fl 1.23456789e-6 58 2126 00 00 00 00 00 00 + :10 dta 0 59 60 2130 3C 12 35 00 00 00 .fl 1.23456789e-7 61 2136 00 00 00 00 00 00 + :10 dta 0 62 63 2140 3C 01 23 00 00 00 .fl 1.23456789e-8 64 2146 00 00 00 00 00 00 + :10 dta 0 65 66 2150 3B 12 00 00 00 00 .fl 1.23456789e-9 67 2156 00 00 00 00 00 00 + :10 dta 0 68 69 2160 3B 01 00 00 00 00 .fl 1.23456789e-10 70 2166 00 00 00 00 00 00 + :10 dta 0 71 72 2170 3A 12 34 56 78 90 .fl 1.23456789e-11 73 2176 00 00 00 00 00 00 + :10 dta 0 74 75 2180 3A 01 23 45 67 89 .fl 1.23456789e-12 76 2186 00 00 00 00 00 00 + :10 dta 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.