+JAC! Posted October 3, 2012 Share Posted October 3, 2012 (edited) looking at the source in my post 8, there are only these 4 locations where an absolute address is used: 0667: 20 2C 06 JSR $062C 0671: 20 00 06 JSR $0600 0694: 20 00 06 JSR $0600 06CF: 20 2C 06 JSR $062C If you place the code at the begin of $xy00, then you only need to replace the $06 (3rd byte) by $xy there. I'd poke/load the routine to "start" (plain page) and the start=$xy000 poke start+$69,start/256 poke start+$73,start/256 poke start+$96,start/256 poke start+$d1,start/256 Edited October 3, 2012 by JAC! Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted October 3, 2012 Share Posted October 3, 2012 OK, another beginner question: It seems the best way for this to work is to place the code on a page boundary. Assuming this is true, are there any other good places to store this code (244 bytes) besides Pages 4 and 6? One thing I had thought of doing was placing this at the end of my PMBASE below RAMTOP. I've figured out that I would need to reserve PEEK(106)-24 to cover 4K worth of font data plus PMG's in double line resolution. Would this be enough to also store my code, or do I need to reserve more pages? Or alternatively, another spare 244 bytes elsewhere in RAM to store this thing? Quote Link to comment Share on other sites More sharing options...
+JAC! Posted October 3, 2012 Share Posted October 3, 2012 The PM area starts with $300 unused bytes at a page boundary, before the missles and then the player data. I'd put is there. Quote Link to comment Share on other sites More sharing options...
576XE Posted December 20, 2020 Share Posted December 20, 2020 (edited) Does anyone can help me with some strange behaviour in my program. When 4-th bit of PORTB flips/flops GR0 screen blinks and output crashes. After turning ON/OFF all goes normally Your any suggestions will be very appreciated. It's PL65 sample code. !====================================! ! BANKS.PRG ! ! Using 130XE Extended Banks in ! ! PL65 Programming Language ! !------------------------------------! ! Evgeny Zolotarev,(aka 576XE), 2020 ! !====================================! INCLUDE TERMINAL.LIB !- CONSTANTS & VARIABLES: CONST bkMask=%10010001 BYTE PORTB=$D301,NMIEN=$D40E,bkTag INT bkNum !- DUMMY array representing ---------! !- selected BANK_s slice ------------! BYTE bkMem[$4000]=$4000 !- Bank Selector Values -------------! !- Atari800WinPlus 576XE ------------! BYTE bkSel[33] DATA $91, $81,$83,$85,$87,$89,$8B,$8D,$8F, $A1,$A3,$A5,$A7,$A9,$AB,$AD,$AF, $C1,$C3,$C5,$C7,$C9,$CB,$CD,$CF, $E1,$E3,$E5,$E7,$E9,$EB,$ED,$EF; ! String VAR to store in all BANKS STRING inp$[4+27] DATA "==> User DATA from Bank #00"; ! Set string as VAR for appending STRING out$[4+27] DATA " "; !- PROCEDURES: !- Clear Screen Procedure -----------! PROC clrScr() CONST clr=255 BEGIN WRTSTR(CHR$(125)) END !- Wait for Any Key Pressed ---------! PROC anyKey() CONST none=255 BYTE CH=764 BEGIN WRTSTR("Wait for a Key...") CR() WHILE CH=none DO ENDWHILE CH=none END PROC setBk*(BYTE bkTag) BEGIN ! Wrapper STOPs/STARTs IRQ & NMI SEI LDA #$00 STA NMIEN LDA PORTB AND bkMask OR bkTag STA PORTB LDA #$40 STA NMIEN CLI END !- Place bkSel Tags into PORTB ------! PROC setBank(INT bkNum) BEGIN bkTag=bkSel[bkNum] setBk*(bkTag) END !- Writes to Bank -------------------! PROC writBk() BEGIN FOR bkNum=0 TO 32 DO WRTSTR("Writing to BANK #") WRITE(bkNum) CR() IF bkNum<10 THEN inp$[25,25]=STR$(0) inp$[26,26]=STR$(bkNum) ELSE inp$[25]=STR$(bkNum) ENDIF out$=inp$ setBank(bkNum) MOVE(.out,LEN(out$),.bkMem) NEXT END !- Reads from Bank ------------------! PROC readBk() BEGIN FOR bkNum=0 TO 32 DO WRTSTR("Reading BANK #") WRITE(bkNum) CR() setBank(bkNum) MOVE(.bkMem,LEN(out$),.out) WRTSTR(out$) CR() NEXT END !------------------------------------! MAIN() BEGIN clrScr() anyKey() writBk() anyKey() clrScr() readBk() END ! >>> EOF <<< ! zen Edited December 20, 2020 by 576XE Quote Link to comment Share on other sites More sharing options...
576XE Posted January 1, 2021 Share Posted January 1, 2021 Just using $93 (Which moves BASIC out) instead of $91 makes all work done. BASIC steals 8KiB of high memory and thus reloades and refreshes screen. Phaeron help me and we all happy! Best wishes from Moscow! zen Quote Link to comment Share on other sites More sharing options...
+Larry Posted January 1, 2021 Share Posted January 1, 2021 Happy New Year, Zen! -Larry 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 2, 2021 Share Posted January 2, 2021 PORTB Bit 4 turns the CPU access to extended 130XE memory at $4000-$7FFF on and off. If the screen lives in that area then you could easily corrupt any data you have in extended Ram. If a Basic program is in there, which is very likely if a Dos is loaded then you potentially switch part of it out and crash - and not forgetting stuff like strings and the stack for loops/subs lives above the program. Also remember, default bitsettings for everything except Basic are 1. 1 Quote Link to comment Share on other sites More sharing options...
576XE Posted January 3, 2021 Share Posted January 3, 2021 Merry Christmas and Happy New Year, FRIENDS! zen 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.