Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opcode Ex9E not working as expected #3

Open
gulrak opened this issue Feb 13, 2023 · 0 comments
Open

Opcode Ex9E not working as expected #3

gulrak opened this issue Feb 13, 2023 · 0 comments

Comments

@gulrak
Copy link

gulrak commented Feb 13, 2023

First of all: Thank you for your work on an improved CHIPOS version!

While testing it agains my DREAM6800 emulation, I came across an issue that is resulting from the modifications:

The Ex9E opcode is not working in the current CHIPOSLO version. The Problem originates in the reorganization of the skip opcode handling.

The relevant code:

SKFKEY: JSR     KEYINP      ; INTERROGATE KEYBOARD  <--- This sets the key in KEYCOD and A, A not same as PIR+1 anymore!!!
        TST     BADRED      ; KEY DOWN?
        BEQ     SKFK1
        LDAB    #$A1        ; WHAT INSTRN?
        CMPB    PIR+1       ; SKF VX#KEY   <--- This still works as it doesn't rely on A being content of PIR+1
        BEQ     SKIP2
        RTS                 ; NO KEY GO FETCH
SKFK1:  CMPA    #$9E.       ;  <--- But this now compares the pressed key against $9E, not the second opcode byte
        BEQ     SKFEQ
SKFNE:  CMPA    VX
        BNE     SKIP2
        RTS
LETVK:  ADDA    VX
        BRA     PUTVX
RANDV:  BSR     RANDOM      ; GET RANDOM BYTE
        ANDA    PIR+1
        BRA     PUTVX

The original code in comparison does explicitly use PIR+1:

SKFK1:  LDAB  	#$9E
        CMPB  	PIR+1       ; WHAT INSTRN?
        BEQ     SKFEQ
        BRA     SKFNE

I might try to fix it myself and would put out a PR if I do, but I'm not sure if and when I would manage to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant