+bf2k+ Posted December 24, 2008 Share Posted December 24, 2008 Is there anyway for an Atari 8-bit program to determine whether it is running on the 800winplus emulator as opposed to a real a8 machine? Like a value in an address? Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 24, 2008 Share Posted December 24, 2008 Some things don't work properly in the emulator so a program can test for such conditions: . Pokey Timers are only scanline exact, not cycle exact. . POT (paddle) registers count up by cycle on a real machine in fast scan mode - they don't do so on the emulator. So, a short bit of code should be enough to determine the running environment. Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 24, 2008 Share Posted December 24, 2008 OK - short program. Only tested on Version 4.1 but should work on others. EMUTEST.zip (LISTed program, ENTER "H:EMUTEST.BAS") The routine should return a value of 228 in the emulator, 134 on the real machine. It sets the paddles to fast scan mode, then waits for a VBI to execute then waits several scanlines. Then it starts a Pot Scan and waits one scanline plus a few extra cycles. It could easily be written more efficiently - actually would do better without the NOPs then you could just have a BPL which would branch if running on a real machine. 0600: 68 PLA 0601: A9 40 LDA #$40 0603: 8D 0E D4 STA $D40E ;NMIEN 0606: AD 32 02 LDA $0232 ;SSKCTL 0609: 09 04 ORA #$04 060B: 8D 32 02 STA $0232 ;SSKCTL 060E: 8D 0F D2 STA $D20F ;SKCTL - enable Fast Pot Scan mode 0611: A5 14 LDA $14 ;RTCLOK+2 0613: C5 14 CMP $14 ;RTCLOK+2 0615: F0 FC BEQ $0613 ; Wait for a VBI to complete 0617: 8D 0A D4 STA $D40A ;WSYNC 061A: 8D 0A D4 STA $D40A ;WSYNC 061D: 8D 0A D4 STA $D40A ;WSYNC 0620: 8D 0A D4 STA $D40A ;WSYNC 0623: 8D 0A D4 STA $D40A ;WSYNC - wait a few more scanlines 0626: 8D 0B D2 STA $D20B ;POTGO - start another Pot Scan 0629: 8D 0A D4 STA $D40A ;WSYNC 062C: EA NOP 062D: EA NOP 062E: EA NOP 062F: EA NOP 0630: EA NOP 0631: EA NOP 0632: EA NOP 0633: EA NOP 0634: EA NOP 0635: EA NOP 0636: EA NOP; wait some more 0637: AD 07 D2 LDA $D207 ;POT7 063A: 85 D4 STA $D4 ;FR0 063C: A9 00 LDA #$00 063E: 85 D5 STA $D5 ;FR0+1 0640: 60 RTS Quote Link to comment Share on other sites More sharing options...
pps Posted December 24, 2008 Share Posted December 24, 2008 But don´t forget, that the emulator could pass this tests in future versions... Quote Link to comment Share on other sites More sharing options...
+bf2k+ Posted December 24, 2008 Author Share Posted December 24, 2008 But don´t forget, that the emulator could pass this tests in future versions... Well... if a future version fixes the DCB drive cfg table, I won't need this anyway... hmm.. maybe I'll setup a800 and see if that one works. Quote Link to comment Share on other sites More sharing options...
+bf2k+ Posted December 25, 2008 Author Share Posted December 25, 2008 I wonder... Is anyone still actively developing a800win plus? Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 25, 2008 Share Posted December 25, 2008 I don't think so. There's been a couple of "requests" threads over the last 2-3 years where we've thrown around ideas of what we'd like in it. It's my emu of choice despite the shortcomings. Just a few more features like stretchable window and more accurate Pokey emulation and it would be near enough to the best emulator for any system. 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.