| |
Peiselulli
Registered: Oct 2006 Posts: 81 |
detecting pal, drean, ntsc or old ntsc
Hello,
I want to know if a test like this is reliable for the four different machine types PAL, NTSC, NTSC(old) and DREAN (ACME source code):
OLD_NTSC = 1
NTSC = 0
PAL = 2
DREAN = 3
!to "detect.prg",cbm
!cpu 6510
* = $0801
!by $0b,$08,$00,$00,$9e,$32,$30,$36,$31,$00,$00,$00
detect: sei
w0: lda $d012
w1: cmp $d012
beq w1
bmi w0
and #$03
cmp #$01
bne w2
lda #OLD_NTSC
bne detected ; unconditional
w2: cmp #$03
lda #$00
rol
beq detected ;ntsc
;check for drean or pal
ldx #$00
lda #$10
l inx
cmp $d012
bne l
lda #PAL
cpx #$70
bcc detected
;is a drean
lda #DREAN
detected:
tay
lax offset,y
l2: lda base_text,x
beq end
jsr $ffd2
inx
bne l2
end: lda #$0d
jmp $ffd2
base_text:
old_ntsc_text: !text "OLD "
ntsc_text: !text "NTSC",0
pal_text: !text "PAL",0
drean_text: !text "DREAN",0
offset:
!byte ntsc_text-base_text
!byte old_ntsc_text-base_text
!byte pal_text-base_text
!byte drean_text-base_text
|
|
... 63 posts hidden. Click here to view all posts.... |
| |
Copyfault
Registered: Dec 2001 Posts: 467 |
Quoting FranticAh.. Haha.. yes, maybe I should have a cup of coffee to wake up properly. I obviously meant cpu registers. You were hearing the melody of that code, weren't you *rotfl*
By the way, I think y must be init'ed with a higher value since it might not be enough to double-check line $fc.
Before porting it to codebase I'll check it at least on vice with the different VIC-type settings.
Aaaand: coffee ftw!!! |
| |
Copyfault
Registered: Dec 2001 Posts: 467 |
The idea with checking the same line multiple times was crap! We need to ensure (somehow) that we start at a line that exists on all systems and is unique AND that the edge case of starting the routine while IN this specific line is avoided/handled. No matter what value we choose for y, there will still be cases that lead to a wrong starting situation.
So here comes my final (and hopefully robust-as-f*ck) version:
chk_victype: sei
ldy #$04
ld_DEY: ldx #DEY //DEY = $88
waitline: cpy $d012
bne waitline
dex
bmi ld_DEY + 1
wait40lines: lda $d012 - $7f,x
dey
bne wait40lines
and #$03
rts
If someone with real machines wants to volunteer to test it, send me a pm. Ah, and I'll feed codebase within the next days, promised! |
| |
Knight Rider
Registered: Mar 2005 Posts: 116 |
I have all 4 machines. |
| |
Knight Rider
Registered: Mar 2005 Posts: 116 |
Results submited by PM |
| |
hedning
Registered: Mar 2009 Posts: 4627 |
Yup. Sent 4 screenshots from 4 machines as well. |
| |
Frantic
Registered: Mar 2003 Posts: 1635 |
It is good to hear that you are sending lots of messages to each other. ;) Now I am also curious to hear if the routine seemed to work well or not? :) |
| |
hedning
Registered: Mar 2009 Posts: 4627 |
Quote: It is good to hear that you are sending lots of messages to each other. ;) Now I am also curious to hear if the routine seemed to work well or not? :)
I can send you a Pm too. :D |
| |
Frantic
Registered: Mar 2003 Posts: 1635 |
Thanks for the offer, but on careful consideration I have come to the conclusion that I am primarily interested to hear if the aforementioned routine seemed to work well or not. Does that constitute a type of information that you would be willing to share, publicly, in a forum discussion thread like the present one? |
| |
hedning
Registered: Mar 2009 Posts: 4627 |
Quote: Thanks for the offer, but on careful consideration I have come to the conclusion that I am primarily interested to hear if the aforementioned routine seemed to work well or not. Does that constitute a type of information that you would be willing to share, publicly, in a forum discussion thread like the present one?
Ah. No. I'll leave that to Copyfault. But I was was told my screenshots made him very happy. |
| |
Knight Rider
Registered: Mar 2005 Posts: 116 |
My videos produced the desired results on all 4 machines. |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - Next |