mirror of
https://github.com/Pecusx/libretro-atari800.git
synced 2026-05-21 06:39:36 +02:00
initial commit
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
.include equates.m65
|
||||
*= $0600
|
||||
PHA
|
||||
TXA
|
||||
PHA
|
||||
TYA
|
||||
PHA
|
||||
LDA 1536
|
||||
STA WSYNC
|
||||
;
|
||||
STA WSYNC
|
||||
STA WSYNC
|
||||
STA WSYNC
|
||||
STA WSYNC
|
||||
STA WSYNC
|
||||
STA WSYNC
|
||||
STA WSYNC
|
||||
LDY RANDOM ;sta $D20B ;POTGO
|
||||
STA WSYNC
|
||||
;NOP
|
||||
;NOP
|
||||
;NOP
|
||||
;NOP
|
||||
;NOP
|
||||
;NOP
|
||||
;NOP
|
||||
;LDX 203
|
||||
;
|
||||
;STA COLPF0+2
|
||||
.byte 99 ;change this to -1 in the data statements
|
||||
LDA RANDOM;LDA $D207 ;POT7
|
||||
STA 207
|
||||
;STA 204
|
||||
LDA VCOUNT
|
||||
STA 205
|
||||
STY 206 ;save old random
|
||||
LDA 208 ;disable dli flag
|
||||
CMP #$0
|
||||
BEQ SKIP
|
||||
LDA #64
|
||||
STA NMIEN
|
||||
SKIP sta wsync
|
||||
sta wsync
|
||||
lda 1537
|
||||
sta HPOSP0
|
||||
lda 1538
|
||||
sta SIZEP0
|
||||
lda 1539
|
||||
sta GRAFP0
|
||||
PLA
|
||||
TAY
|
||||
PLA
|
||||
TAX
|
||||
PLA
|
||||
RTI
|
||||
;jmp SKIP2
|
||||
;REG
|
||||
;.dbyte $0001
|
||||
;SKIP2
|
||||
;LDA REG
|
||||
;ror a
|
||||
;STA REG
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
T7.bas a test program for cycle-counting.
|
||||
The basic idea: we can find out how the real Atari does things by
|
||||
changing a register after a certain number of NOP's on a certain
|
||||
scanline. By aligning a player with the colour change, the horizontal
|
||||
position can be determined and checked on the emulator.
|
||||
Second idea: We can use RANDOM as a cycle-timer. Set the 9-bit
|
||||
random number generator (repeating 511 different values in a sequence),
|
||||
then generate all 511 values and store them in an array, with
|
||||
the value as the index and the index as the value.
|
||||
Then given two different readings of RANDOM at different times,
|
||||
look up the index of both in the table, and the difference , mod 511
|
||||
is the number of cycles elapsed between the readings.
|
||||
Only problem is that we can only read 8 bits of RANDOM, so there's
|
||||
two possible values for each reading, giving 4 possible offsets.
|
||||
But only one of these will remain constant if the procedure is
|
||||
repeated.
|
||||
The 4 values printed by the program at the bottom are the computed
|
||||
possible offsets, the one which remains constant is the acutal
|
||||
offset.
|
||||
|
||||
N=# of NOP cycles
|
||||
P=HPOSP0
|
||||
C=register to change (0=player 0, 9=COLBK, 10=DMACTL, 11-13 HPOS,SIZE,GRAF)
|
||||
V=value to change to
|
||||
PG=player graphics
|
||||
M=antic IR mode
|
||||
|
||||
|
||||
Reference in New Issue
Block a user