Jump to content
IGNORED

Microchess


xxl

Recommended Posts

14 minutes ago, Preppie said:

Thanks but still getting error, maybe I've changed something in emulator that's messing thing up.

Send screenshot .. most likely you have CPU set to break on BRK, NOP or illegal instruction.

Edited by R0ger
Link to comment
Share on other sites

8 minutes ago, R0ger said:

Send screenshot .. most likely you have CPU set to break on BRK, NOP or illegal instruction.

No, that's not set.  I don't think I've changed anything major since installing but you never know.

 

It's just the standard popup that says 'emulator has stopped due to program error'

 

I know nothing about altirra, if a program runs then great but if not I usualy just accept it and move on.  

Link to comment
Share on other sites

you have to set the operating system to XL OS (any) surely it's about the procedures:

 

OUTCHAR equ $F2B0

SGETCH equ $F180

 

https://www.atariarchives.org/mapping/appendix12.php

 

in a few days "chess" will be improved, there is a lot of garbage in the current version - unleashed test procedures, unused data etc.

  • Haha 1
Link to comment
Share on other sites

@xxlNo real excuse for jumping directly into the OS these days?

 

The $F2B0 routine in the XL OS is reflected in the Vector table at $E400 (so the E: PUT is at $E406), but stored as EOUTCH-1.

Similarly SGETCH-1 is found at $E414.

 

image.png.a9ddd53533507735c7350df12cb48caf.png

 

So during initialisation this can be inserted (incremented) into a replacement JMP which is called instead. E.g.

InitOutCh:
 CLC
 LDA $E406
 ADC #1
 STA VecOutCh+1
 LDA $E407
 ADC #0
 STA VecOutCh+2
 RTS

VecOutCh:
 JMP $FFFF

Then this should allow your programs to work OK on other OS's. E.g. for OS/B

 

image.png.23a4356d1b99ffdfd40468e0bfe3d547.png

 

image.png.a5487f29943a71683089cd9608c923c5.png

 

 

Edited by Wrathchild
  • Like 4
Link to comment
Share on other sites

1 hour ago, Wrathchild said:

@xxlNo real excuse for jumping directly into the OS these days?

Unless causing problems with anything third-party is one of your trademark methods. :)

 

Those entry points in Mapping the Atari should never have been published in the first place; the impressionable are encouraged to think they are legitimate calls.

  • Like 2
Link to comment
Share on other sites

20 hours ago, xxl said:

a couple of game play requests

 

- display the notation for the computer's last move.

 

- a mistake typing is easy to do.  it's not too diffiucult to restore a piece to its original position by entering another move but only if the piece is still on the board.  please make it possible to restore removed pieces back to the board.  an un-do option would be even better.

  • Like 1
Link to comment
Share on other sites

4 hours ago, Wrathchild said:

@xxlNo real excuse for jumping directly into the OS these days?

 

The $F2B0 routine in the XL OS is reflected in the Vector table at $E400 (so the E: PUT is at $E406), but stored as EOUTCH-1.

Similarly SGETCH-1 is found at $E414.

 

Is (was) the table guaranteed to stay there?   Would it be safer-ish, more compliant to get it from the open E: IOCB #0 table?   I've seen it done this way:

 

 
IOCB = $0340 ; Base IO Control Block, Channel 0, E: by default

ICPTL = IOCB+$06 ; Put char routine (low)

ICPTH = IOCB+$07 ; Put char routine (high)

; . . . . .

PutCH
	sta OUTPUT ; Self modifying code - save the byte below.

	lda ICPTH ; High byte for Put Char in E:/IOCB Channel 0.
	pha       ; Push to stack

	lda ICPTL ; Low byte for Put Char in E:/IOCB Channel 0.
	pha       ; Push to stack

OUTPUT = *+1
	lda #$00 ; Modified at routine entry.

; This rts actually triggers calling the address of PutCH
; that was pushed onto the stack above.

	rts 

 

 

 

 

  • Like 2
Link to comment
Share on other sites

1 hour ago, kenjennings said:

Is (was) the table guaranteed to stay there?

I had included an image of that area in my original post but removed it (hence the edit).

 

I'd considered that as maybe less sure if any other startup code running before and closing or opening things would maybe alter the $34x location.

Additionally, xxl is using the S: GET routine without that having been opened and hence not present in that area to perform the same obtaining of the address, hence my decision not to opt for this.

 

From the OS listings I'd consider that table fixed and others (e.g. Altirra OS, MyIDE) would have followed this and not relocated it, but there maybe others that don't.

 

Link to comment
Share on other sites

1 hour ago, Wrathchild said:

I had included an image of that area in my original post but removed it (hence the edit).

 

I'd considered that as maybe less sure if any other startup code running before and closing or opening things would maybe alter the $34x location.

Additionally, xxl is using the S: GET routine without that having been opened and hence not present in that area to perform the same obtaining of the address, hence my decision not to opt for this.

 

From the OS listings I'd consider that table fixed and others (e.g. Altirra OS, MyIDE) would have followed this and not relocated it, but there maybe others that don't.

 

$E400-E44F is officially documented as a stable address region for the built-in CIO device tables in both Section 5 and Appendix J of the Atari Operating System User's Manual and will work on any Atari OS. The catch is that it only points to the built-in devices and will bypass a fast E:/S: handler or XEP80 driver. For printing to the screen, there is no advantage over using ICPTL/H.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

8 minutes ago, phaeron said:

will bypass a fast E:/S: handler

Indeed, and as the OP's intent (by jumping direct into the O/S) appeared to be to use the OS's routines, choosing to go with obtaining from the OS device table.

Whether that would still place nice with other handlers present is an exercise for others :D 

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...