+therealbountybob Posted May 4, 2018 Share Posted May 4, 2018 (edited) While my latest assemble runs I may as well ask for some help with this one. Still for my abbuc game Ski-It in MAC/65... Trying to make the High Score Table save and load - game is an EXE running on a DOS2.5 disk (and yes I know there is XBIOS out there but one thing at a time!) The I/O code is from Assembly Language Programming for the Atari Computers (Mark Chasin) I have modified the routine to flag read or write (IOWRITEFLAG) and to change the background colour briefly. It looks like the SAVE is working - you can hear it, but the LOAD fails "raspberry" and then timesout back to the program, you see the colour change in both cases. I have my game code at $1D00 which I thought was far enough past what DOS would use I'm trying to get as near as I can as my last two games have been boot disks with no DOS so this is really eating into my available RAM for the game. Here's the code (listed from MAC/65 to PC via APE and then pasted here from Memopad (the spurious chars have appeared as part of this process!) 10 ; save #d1:hscio.m6520 ;30 ; see ALP Ch9-440 ;50 ; ***********60 ; CIO equates70 ; ***********80 ICHID = $034090 ICDNO = $03410100 ICCOM = $03420110 ICSTA = $03430120 ICBAL = $03440130 ICBAH = $03450140 ICPTL = $03460150 ICPTH = $03470160 ICBLL = $03480170 ICBLH = $03490180 ICAX1 = $034A0190 ICAX2 = $034B0200 CIOV = $E4560210 ;0220 ; *= $8000 ; x$0600 ªªª0230 ;0240 HSCIO0250 ;0260 ; ***************************0270 ; First, close and open IOCB20280 ; ***************************0290 LDX #$20 ; For IOCB20300 LDA #12 ; Close command0310 STA ICCOM,X ; Into ICCOM0320 JSR CIOV ; Do the CLOSE0330 ;0340 LDX #$20 ; IOCB2 again0350 LDA #3 ; Open file0360 STA ICCOM,X ; Is the command0370 ;0380 ;0390 ; check if write flag set0400 LDA IOWRITEFLAG0410 BNE HSCIOPREPWRITE0420 ;0430 ;0440 LDA #4 ; Input0450 STA ICAX1,X ; Open for read0460 ;0470 ; dest RAM data table0480 LDA #HSCTABLE&255 ; Low byte0490 STA ICBAL,X0500 LDA #HSCTABLE/256 ; High byt0510 STA ICBAH,X0520 ;0530 BNE HSCIOPREPALL ; æ0540 ;0550 ;0560 HSCIOPREPWRITE0570 LDA #8 ; Output0580 STA ICAX1,X ; Open0590 ;0600 ; dest disk file (for printer set "P:" in filename)0610 LDA #FILENAME&255 ; Low byte0620 STA ICBAL,X0630 LDA #FILENAME/256 ; High byt0640 STA ICBAH,X0650 ;0660 ;0670 HSCIOPREPALL0680 LDA #00690 STA ICBLH,X ; H byte length0700 LDA #$FF0710 STA ICBLL,X ; L byte length0720 JSR CIOV ; Do the OPEN0730 ;0740 ; ***************************0750 ; Now we'll print the message0760 ; ***************************0770 LDX #$20 ; By using IOCB20780 ;0790 LDA IOWRITEFLAG0800 BNE HSCIOWRITE0810 ;0820 ;HSCIOREAD0821 LDA #$A4 ;«0822 STA COLBAK ;«0823 ;0830 LDA #5 ; Get record0840 STA ICCOM,X ; Command0850 ;0860 ; source disk file0870 LDA #FILENAME&255 ; Low byte0880 STA ICBAL,X0890 LDA #FILENAME/256 ; High byt0900 STA ICBAH,X0910 ;0920 BNE HSCIOREADY ; æ0930 ;0940 ;0950 HSCIOWRITE0951 LDA #$42 ;«0952 STA COLBAK ;«0953 ;0960 LDA #9 ; Put record0970 STA ICCOM,X ; Command0980 ;0990 ; source table in RAM1000 LDA #HSCTABLE&255 ; Low byte1010 STA ICBAL,X1020 LDA #HSCTABLE/256 ; High byt1030 STA ICBAH,X1040 ;1050 ;1060 HSCIOREADY1070 LDA #0 ; Length tbl1080 STA ICBLH,X ; High byte1090 LDA #$FF ;1100 STA ICBLL,X ; Low byte1110 JSR CIOV ;Put out the line1120 RTS ; End of routine1130 ;1140 ;1150 FILENAME .BYTE "D1:RECORDS.SKI",$9B1160 ; HSCTABLE .BYTE "A SUCCESSFUL WRITE!",$9B Thanks hscio.txt Edited May 4, 2018 by therealbountybob Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted May 4, 2018 Share Posted May 4, 2018 You're not pointing the CIO buffer address at the filename before opening it for read. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 5, 2018 Share Posted May 5, 2018 Moving a label or two should about fix it. For OPEN, you don't need to worry about the buffer length - just the $9B terminating the filespec is all that's needed. I imagine though that there's probably a 256 char limit on filespec though most handlers rarely use more than about 20. 1 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.