zbyti Posted November 3, 2020 Share Posted November 3, 2020 1 minute ago, pedgarcia said: Oh, I believe it was @zbyti that said that. I haven't tried 8bit-unity yet. No. You can see who is quoted Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted November 3, 2020 Author Share Posted November 3, 2020 On 10/18/2020 at 7:06 AM, funkheld said: hmmmm .... it's not that easy with the program for atarixl: 8bit-unity greeting True! Actually @funkheld mentioned that... 1 Quote Link to comment Share on other sites More sharing options...
Blues76 Posted November 3, 2020 Share Posted November 3, 2020 2 hours ago, Blues76 said: @pedgarcia I’m curious what exactly did you find difficulty with 8bit-unity ? sorry about that Quote Link to comment Share on other sites More sharing options...
zbyti Posted December 10, 2020 Share Posted December 10, 2020 @pedgarcia hey! What's up in the Action! world? Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 11, 2020 Author Share Posted December 11, 2020 10 hours ago, zbyti said: @pedgarcia hey! What's up in the Action! world? Hey @zbyti, I've been busy with some other stuff (TRS-80 little game), but i have already an article 90% ready, and I am starting to think the next steps. Hopefully in a few days, I can post it! Thanks for the "incentive" btw That helps me keep on track! Cheers 1 Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 15, 2020 Author Share Posted December 15, 2020 Finally another part is done. Not very deep, but useful for people that are starting. https://vintageisthenewold.com/going-into-action-with-atari-xl-xe-part-5-modularization-and-distributing-your-program/ Comments and corrections are welcome! 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted December 15, 2020 Share Posted December 15, 2020 Nice article. But if you mentioned includes as libraries you must say something about MODULE, this KEY WORD allow declare global variables in the middle of the code Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 15, 2020 Author Share Posted December 15, 2020 5 minutes ago, zbyti said: Nice article. But if you mentioned includes as libraries you must say something about MODULE, this KEY WORD allow declare global variables in the middle of the code Oh, yeah. I missed that! Good call. I will update it as soon as possible. Thanks! Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 15, 2020 Author Share Posted December 15, 2020 Hey @zbyti I was thinking about the MODULE keyword and trying to find a good example of when use it. I can see its use is more for something like this: PROC FUNC1() .... RETURN MODULE CARD THIS_IS_GLOBAL=[10] FUNC MAIN() ... RETURN But can you think in a good example to use it when using includes? Only doing the above seems not enough to justify its use, don't you agree? Thanks Quote Link to comment Share on other sites More sharing options...
zbyti Posted December 15, 2020 Share Posted December 15, 2020 If you write your library good practices is starts and ends file with MODULE to be sure your variables compiles. https://github.com/zbyti/a8-action-playground/blob/master/src/LIGHTSPE/SRC/STDIO.ACT Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 15, 2020 Author Share Posted December 15, 2020 1 hour ago, zbyti said: If you write your library good practices is starts and ends file with MODULE to be sure your variables compiles. https://github.com/zbyti/a8-action-playground/blob/master/src/LIGHTSPE/SRC/STDIO.ACT Ah, perfect! Now I get it - I wanted to come up with a problem if we don't do what you just said. Perfect! THanks! 1 Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 15, 2020 Author Share Posted December 15, 2020 I've added the "MODULE keyword" session close to the top. Now it looks much better! Thanks @zbyti 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted December 15, 2020 Share Posted December 15, 2020 (edited) Quote The MODULE keyword is used to indicate that everything declared after this keyword and the next PROC/FUNC will be considered a global variable. The MODULE keyword is used to indicate that everything declared after this keyword UNTIL the next PROC/FUNC will be considered a global variable. Edited December 15, 2020 by zbyti correction to the article Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted December 15, 2020 Author Share Posted December 15, 2020 8 minutes ago, zbyti said: The MODULE keyword is used to indicate that everything declared after this keyword UNTIL the next PROC/FUNC will be considered a global variable. True, bad English made it confusing. Fixing... 1 Quote Link to comment Share on other sites More sharing options...
rsh Posted October 29, 2022 Share Posted October 29, 2022 Whats is Action! doing with B? Seems to be overriding to BYTE not adding to CARD. Is this a bug, or do I just don't understand LSH? PROC MAIN() CARD A,B,C A=193+(2*32) B=193+(2 LSH 5) C=(2 LSH 5) PRINTF(" A = %U %E",A) PRINTF(" B = %U %E",B) PRINTF(" C = %U %E",C) RETURN Output: A = 257 B = 1 C = 64 Quote Link to comment Share on other sites More sharing options...
zbyti Posted October 31, 2022 Share Posted October 31, 2022 On 10/29/2022 at 6:44 PM, rsh said: Whats is Action! doing with B? Seems to be overriding to BYTE not adding to CARD. Is this a bug, or do I just don't understand LSH? PROC MAIN() CARD A,B,C A=193+(2*32) B=193+(2 LSH 5) C=(2 LSH 5) PRINTF(" A = %U %E",A) PRINTF(" B = %U %E",B) PRINTF(" C = %U %E",C) RETURN Output: A = 257 B = 1 C = 64 see to the machine code that Action! compile and then you will know what it is: bug or feature Quote Link to comment Share on other sites More sharing options...
pedgarcia Posted October 31, 2022 Author Share Posted October 31, 2022 On 10/29/2022 at 12:44 PM, rsh said: Whats is Action! doing with B? Seems to be overriding to BYTE not adding to CARD. Is this a bug, or do I just don't understand LSH? PROC MAIN() CARD A,B,C A=193+(2*32) B=193+(2 LSH 5) C=(2 LSH 5) PRINTF(" A = %U %E",A) PRINTF(" B = %U %E",B) PRINTF(" C = %U %E",C) RETURN Output: A = 257 B = 1 C = 64 It seems the bitwise operator are assuming all BYte before assigning it to B (CARD). Other than looking at the machine code, you could try something else. Instead of using the literal 193, try to assign it to a CARD. for example: CARD D = 193 B = D + (2 LSH 5) .... I don't have access to Action! right now so I can't test it. What do you see ? Cheers Quote Link to comment Share on other sites More sharing options...
Alfred Posted November 1, 2022 Share Posted November 1, 2022 It's a bug. The code does the left shift and stores the result in the low byte but then it just stores zero for the second byte, rather than doing ADC #0. I think the earlier guess is right, it sees the 193 as a byte operand and for some reason thinks the output will also be a byte, which isn't true in this case. Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 1, 2022 Share Posted November 1, 2022 Yep its a bug. workaround above 1 Quote Link to comment Share on other sites More sharing options...
rsh Posted November 2, 2022 Share Posted November 2, 2022 Yeah that what I had to do. To get around it more cycles lol. 15 hours ago, zbyti said: Yep its a bug. workaround above Thanks everyone. Maybe this should be posted in the bug appendix... I wasted some time trying to find my problem until I figured this bug out in my program. I did do a change like above to get around it more cycles lol! ... Quote Link to comment Share on other sites More sharing options...
rsh Posted November 2, 2022 Share Posted November 2, 2022 (edited) @zbyti I was looking at your systemoff code compared to the " Using extended RAM in XL and XE Computer" https://atariwiki.org/wiki/Wiki.jsp?page=Use RAM under ROM on XL-XE machines And It claims to free ram at $C000 - ($CFFF or should it be $CEFF ) and $D800 - $FFFF. But, don't we still need an OS swap in at some point. What memory does yours specifically free up? I'm little confused on how a Action program runs without an OS or does it need the OS once you create your com file? I found this mentioned in Mapping The Atari Appendix 12... https://www.atariarchives.org/mapping/appendix12.php Which still takes some of RAM but it won't crash since the OS is still there?? , You get $C000 - $CEFF and another 768 + 256 bytes some other locations and you can overlay the characters set in OSRAM without dup. ;Move XL OS ROM into RAM ; ;RAMROM--Installs the XL ROM-based ; OS in RAM at the same address ; space. This is useful for ; making small patches to the ; OS or for experimenting with ; new design concepts, such as ; multitasking, window ; management, etc. ; ; By Joe Miller. ; ;This version is configured ;as an AUTORUN.SYS file. ; SOURCE EQU $CB ;zero page usage DEST EQU SOURCE+2 START EQU $0600 ;START address OSROM EQU $C000 ;address of OS ROM start OSRAM EQU $4000 ;address of ROM destination NMIEN EQU $D40E ;NMI enable register PORTB EQU $D301 ;memory mgt control latch ORG START LDA #low OSROM STA SOURCE STA DEST ;initialize copy addrs LDA #high OSROM STA SOURCE+1 LDA #high OSRAM STA DEST+l LDY #0 ;Repeat Pass1 LDA (SOURCE),Y ;copy ROM to RAM STA (DEST),Y INY BNE Pass1 INC DEST+1 INC SOURCE+1 BEQ Swap ;If done LDA SOURCE+l CMP #$D0 BNE Pass1 ;skip 2K block at $D000 LDA #$D8 STA SOURCE+1 BNE Pass1 ;Until SOURCE = $0000 Swap PHP ;save processor status SEI ;disable IRQs LDA NMIEN PHA ;save NMIEN LDA #0 STA NMIEN ;disable NMIs LDA PORTB AND #$FE ;turn off ROMs STA PORTB ;(leaving BASIC unchanged!) LDA #high OSROM STA DEST+1 ;set up block copy LDA #high OSRAM STA SOURCE+1 ;Repeat Pass2 LDA (SOURCE),Y ;move RAM OS to proper address STA (DEST),Y INY BNE Pass2 INC SOURCE+1 ;move to next page INC DEST+1 BEQ Enable ;If complete LDA DEST+1 CMP #$D0 BNE Pass2 ;skip block at $D000 LDA #$D8 STA DEST+1 BNE Pass2 ;Until DEST = $000 Enable PLA STA NMIEN ;reestablish NMI mask PLP ;reenable IRQs RTS END START Edited November 2, 2022 by rsh Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 2, 2022 Share Posted November 2, 2022 (edited) 7 hours ago, rsh said: @zbyti I was looking at your systemoff code compared to the " Using extended RAM in XL and XE Computer" https://atariwiki.org/wiki/Wiki.jsp?page=Use RAM under ROM on XL-XE machines And It claims to free ram at $C000 - ($CFFF or should it be $CEFF ) and $D800 - $FFFF. But, don't we still need an OS swap in at some point. What memory does yours specifically free up? I'm little confused on how a Action program runs without an OS or does it need the OS once you create your com file? my SYSTEM OFF need: 1. use Sublime Text (or VSC) to develop (don't use Atari memory for code) 2. don't use Action! runtime (include your own) 3. compile on Atari from file on H6 4. write OBJ to H1 5. turn off Action! cartridge (software) if you run code from memory (right after compiling) then you can use $A000, $B000 and so on for SCREEN memory or other dynamic things because you turn off BASIC and KERNEL. Edited November 2, 2022 by zbyti Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 2, 2022 Share Posted November 2, 2022 (edited) 7 hours ago, rsh said: Yeah that what I had to do. To get around it more cycles lol. Thanks everyone. Maybe this should be posted in the bug appendix... I wasted some time trying to find my problem until I figured this bug out in my program. I did do a change like above to get around it more cycles lol! ... Action! cannot perform mathematical operations on constants during compilation, all such operations take place in runtime. If you know that you need 257 don't write it down as a math operation. Edited November 2, 2022 by zbyti Quote Link to comment Share on other sites More sharing options...
zbyti Posted November 2, 2022 Share Posted November 2, 2022 (edited) 14 hours ago, rsh said: @zbyti I was looking at your systemoff code compared to the " Using extended RAM in XL and XE Computer" https://atariwiki.org/wiki/Wiki.jsp?page=Use RAM under ROM on XL-XE machines And It claims to free ram at $C000 - ($CFFF or should it be $CEFF ) and $D800 - $FFFF. But, don't we still need an OS swap in at some point. What memory does yours specifically free up? ;------------------------------------------------------------------------------ ; Brief Memory Map: ; $0200 - $07ff later usage ; $0800 - $0bff charset 1 ; $0c00 - $0fff charset 2 ; $1000 - $92ff main code (33535 bytes ~ 33 KB) ; $9300 - $cfff later usage ; $d800 - $ffef later usage ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; STABLE CODEBASE APPMHI SET $495=8 : SET $491=$1000 : SET $E=$1000 ;------------------------------------------------------------------------------ https://github.com/zbyti/a8-action-playground/blob/master/src/ZBYTI/OFFTEMPL/MAIN.ACT Edited November 2, 2022 by zbyti Quote Link to comment Share on other sites More sharing options...
rsh Posted November 2, 2022 Share Posted November 2, 2022 7 hours ago, zbyti said: ;------------------------------------------------------------------------------ ; Brief Memory Map: ; $0200 - $07ff later usage ; $0800 - $0bff charset 1 ; $0c00 - $0fff charset 2 ; $1000 - $92ff main code (33535 bytes ~ 33 KB) ; $9300 - $cfff later usage ; $d800 - $ffef later usage ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ ; STABLE CODEBASE APPMHI SET $495=8 : SET $491=$1000 : SET $E=$1000 ;------------------------------------------------------------------------------ https://github.com/zbyti/a8-action-playground/blob/master/src/ZBYTI/OFFTEMPL/MAIN.ACT Thank you I will play around with it, Your method seems way more elegant than the wiki. Looks like with your version you don't need to swap PORTB OS bits.. cause your just there in main memory all the time.. Very cool!! I am trying to free memory up and this looks like a real solution. I was trying to figure out how to compile into 130XE extended ram bank(s) and run code from there lol, but that seems like a real pain in axx.. Have you ever tried to do that, curious? 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.