phaeron Posted July 24, 2020 Author Share Posted July 24, 2020 Yes and no. In the power-up testing that I've done, RANDOM ($D20A) is not typically random on power-up as POKEY typically powers-up either in init state or with the LFSR locked up. The value sequence after POKEY is initialized is also fully deterministic and so cartridges can't rely on this. Executables are a bit different because it depends on what medium you load them from. Auto-boot the executable from a cart and it will be fully deterministic. Loading from disk is non-deterministic, however, and the value in RANDOM is based on the number of machine cycles after leaving init mode. Even then it's not fully random -- keyboard scan can only report keys on specific cycles, for instance. I'm OK with adding an option to do this, as it comes up often enough that it'd be worth leaving on even. But I'd have to think about how to do it because not everything is completely randomized -- VCOUNT is synced in some cases due to a wait on vertical blank due to a timed out SIO command. I can either put in a random 0-1 frame delay or warp the polynomial counters, not sure which is better yet. 2 Quote Link to comment Share on other sites More sharing options...
mr-atari Posted July 25, 2020 Share Posted July 25, 2020 I have perhaps a very stupid question, but I can not find it or figure it out.... How do I change the memory map? I would like to change D500-D5FF from mode --R to ARW So it can be used as normal RAM Grtz, Sijmen. Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 25, 2020 Author Share Posted July 25, 2020 7 hours ago, mr-atari said: I have perhaps a very stupid question, but I can not find it or figure it out.... How do I change the memory map? I would like to change D500-D5FF from mode --R to ARW So it can be used as normal RAM You can't just change the protection on an address space range, something has to provide RAM at that address. One way is to write a custom device that has a memory layer to map 256 bytes of RAM there. Quote Link to comment Share on other sites More sharing options...
mr-atari Posted July 26, 2020 Share Posted July 26, 2020 (edited) 13 hours ago, phaeron said: You can't just change the protection on an address space range, something has to provide RAM at that address. One way is to write a custom device that has a memory layer to map 256 bytes of RAM there. How do I write a custom device? Is there a template I can download/use? I know my way around in 6502, that's about it.... OK, I cut/paste your example of 8k cartridge and changed to this: It does something, any good like this ??? Thanks! --------------------------------------------- option "name": "256b D500-RAM"; Segment ram: { size: 256, source: "d5ram.bin" }; MemoryLayer wina: { name: "D500-RAM", address: $D500, size: $100, segment: { source: ram, offset: 0, mode: "rw" }, cart_mode: "left" }; Edited July 26, 2020 by mr-atari Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 26, 2020 Author Share Posted July 26, 2020 1 hour ago, mr-atari said: How do I write a custom device? Is there a template I can download/use? I know my way around in 6502, that's about it.... The help file has the full spec. You've basically got it, but you don't need the file source as you don't need to init the RAM data: option "name": "256b D500-RAM"; Segment ram: { size: 256 }; MemoryLayer wina: { name: "D500-RAM", address: $D500, size: $100, segment: { source: ram, offset: 0, mode: "rw" } }; 2 1 Quote Link to comment Share on other sites More sharing options...
mr-atari Posted July 26, 2020 Share Posted July 26, 2020 Thank you so much, this was easier then I thought. It will help me a lot debugging special hardware. Nice. ? 2 Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted July 26, 2020 Share Posted July 26, 2020 is the latest altirra 4.0 test in the first post? or where there updates in following post? looking to test the newest 4.0 version there is... Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted July 26, 2020 Share Posted July 26, 2020 (edited) 28 minutes ago, Yaron Nir said: is the latest altirra 4.0 test in the first post? or where there updates in following post? looking to test the newest 4.0 version there is... Scroll backwards through the thread and download the first thing you run into. Appears to be this one: https://atariage.com/forums/topic/308053-altirra-390-released/?do=findComment&comment=4581908 Edited July 26, 2020 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted July 26, 2020 Share Posted July 26, 2020 So it turns out test5 is the latest (saw that in page 6 of this post somewhere) Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted July 26, 2020 Share Posted July 26, 2020 4 minutes ago, Yaron Nir said: saw that in page 6 of this post somewhere That's the one I linked to, yes. Quote Link to comment Share on other sites More sharing options...
Yaron Nir Posted July 26, 2020 Share Posted July 26, 2020 1 minute ago, flashjazzcat said: That's the one I linked to, yes. thanks @flashjazzcat Quote Link to comment Share on other sites More sharing options...
tane Posted July 26, 2020 Share Posted July 26, 2020 What is the equivalent in assembly code for?: Altirra> r a 0 The following by itself doesn't do the trick: lda #$00 Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 27, 2020 Author Share Posted July 27, 2020 3 hours ago, tane said: What is the equivalent in assembly code for?: Altirra> r a 0 The following by itself doesn't do the trick: lda #$00 LDA #0 does set A=0 as "r a 0" does, but LDA also sets the N and Z flags. There isn't a way in assembly to only set A without the flags. 1 Quote Link to comment Share on other sites More sharing options...
StickJock Posted July 27, 2020 Share Posted July 27, 2020 You could do this to preserve the flags: PHP LDA #$00 PLP 1 Quote Link to comment Share on other sites More sharing options...
tane Posted July 27, 2020 Share Posted July 27, 2020 (edited) 1 hour ago, phaeron said: LDA #0 does set A=0 as "r a 0" does, but LDA also sets the N and Z flags. There isn't a way in assembly to only set A without the flags. 1 hour ago, StickJock said: You could do this to preserve the flags: PHP LDA #$00 PLP Thank you, but it didn't work after adding the previous code: - Here is a saved state, it only shows the image after a "r a 0": Game with image.atstate2 - The xex, when you get to the "Bridge 2", you get to the same position: Game with image.xex - A description of the purpose is in this forum. - The code where the changes were made: code.asm Code.asm: before launching the image with jsr $2c00 is the suggested code to replace the "r a 0". Beyond my knowledge of hardware, the idea is to break out the loop waiting for the VBI. I'm guessing is not in the right position. php lda #$0 plp However such changes made no effect, still is required a "r a 0". At the end, the idea is that it must show the image after exit the game, but the game is still making processes. icl "sys_equates.m65" icl "sys_macros.m65" org $8000 lda $62 ;original code sed ;original code adc #$00 ;original code sta $62 ;original code lda $61 ;original code adc #$00 ;original code cld ;original code sta $61 ;original code inc $2e ;original code lda $62 cmp #$02 beq newchange jmp $a500 ;Else: Back to normal code newchange lda #$00 ; disable the display sta DMACTL sta SDMCTL lda PORTB ; disable BASIC on XL/XE ora #$02 sta PORTB ClearSystem ;sys_macros.m65 CopyMemory $82B6,$2000, ($908C-$82B6+1) ;sys_macros.m65: move image from $82B6-$908C to $2000-$2DD6 php lda #$0 ;(not working), it breaks out of the loop waiting for the VBI plp lda #$38 ;puts PORTB into data direction mode sta $D303 lda #$FF ;configures all PORTB bits as outputs sta $D301 lda #$3C ;puts PORTB back into i/o mode sta $D303 jsr $2c00 ;INI image jmp $9ff6 ;JMP $9ff6 launch game again Edited July 27, 2020 by tane Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 27, 2020 Author Share Posted July 27, 2020 http://www.virtualdub.org/beta/Altirra-4.00-test6.zip http://www.virtualdub.org/beta/Altirra-4.00-test6-src.zip Add new advanced configuration variable system for editing under the hood parameters. Currently only has a few dark mode colors, but the intent is to add more here that can be tweaked if necessary for unsupported parameters that don't need a full UI. Add additional startup logging. Centralize startup randomization. Randomization is now all chained off of a single seed, which is now exposed in the UI. You can lock to a specific seed to repeat the same behavior on each boot for debugging. Disks now have randomized starting rotational positions. Add load timing randomization option for executables, defaulted on. On 7/18/2020 at 1:29 PM, Mr Robot said: Wine version 5.7 Here's the output from test5 I ran it for all the previous test versions and I get almost exactly the same output, just the timings and a few hex numbers in the fixme's change, I can post them if you like. Try on -test6 with /startuplog:hostui,hostdisp. Something is going on in display pane init and there's more logging in this version to narrow down what's triggering the problem. 25 minutes ago, tane said: Thank you, but it didn't work after adding the previous code: - Here is a saved state, it only shows the image after a "r a 0": Game with image.atstate2 - The xex, when you get to the "Bridge 2", you get to the same position: Game with image.xex - A description of the purpose is in this forum. - The code where the changes were made: code.asm Code.asm: before launching the image with jsr $2c00 is the suggested code to replace the "r a 0". Beyond my knowledge of hardware, the idea is to break out the loop waiting for the VBI. I'm guessing is not in the right position. php lda #$0 plp However such changes made no effect, still is required a "r a 0". At the end, the idea is that it must show the image after exit the game, but the game is still making processes. What you're doing with the debugger is impossible in code as it requires the 6502 to run two pieces of code at the same time: you're trying to execute code to set A=0 at the same time as the loop that is waiting for RTCLOK to increment. You could run an interrupt to do this, but that would be silly compared to just editing the code to skip the loop that you don't want. 5 2 Quote Link to comment Share on other sites More sharing options...
Mr Robot Posted July 27, 2020 Share Posted July 27, 2020 12 hours ago, phaeron said: Try on -test6 with /startuplog:hostui,hostdisp. Something is going on in display pane init and there's more logging in this version to narrow down what's triggering the problem. » ChoccyBook:Altirra-4.00-test6 >wine64 Altirra64.exe /startuplog:hostui,hostdisp [ 0.000] Startup logging enabled. [ 0.001] Initializing OLE. 0009:fixme:uxtheme:BufferedPaintInit Stub () [ 0.006] Initializing themes [ 0.006] Loading config var overrides [ 0.007] Loading options [ 0.008] Loading settings [ 0.008] Running instance [ 0.008] Preloading DLLs [ 0.025] Registering controls [ 0.025] Initializing frame system [ 0.025] Initializing commands and accelerators [ 0.025] Applying options [ 0.025] Initializing filespec system [ 0.026] Initializing UI panes [ 0.035] Initializing logging [ 0.035] Initializing native UI [ 0.035] Creating main window 0009:fixme:win:RegisterTouchWindow (0x1005a 00000000): stub 0009:fixme:win:UnregisterTouchWindow (0x1005a): stub 0009:fixme:win:SetGestureConfig (0x1005a 00000000 1 0x21e510 12): stub [ 0.168] Restoring main window [ 0.223] Initializing WinSock [ 0.223] Initializing simulator [ 0.229] Initializing game controllers [ 0.239] Initializing menus [ 0.339] Initializing debugger [ 0.339] Initializing compatibility system [ 0.339] Initializing display UI [ 0.415] Loading profiles [ 0.415] Loading current profile [ 0.417] Initializing native audio 0016:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff 0016:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff 0016:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff 0016:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff [ 0.613] Loading ROMs [ 0.613] Restoring pane layout 0009:fixme:win:RegisterTouchWindow (0x100b8 00000000): stub 0009:fixme:win:UnregisterTouchWindow (0x100b8): stub 0009:fixme:win:SetGestureConfig (0x100b8 00000000 1 0x21e560 12): stub [ 0.620] HOSTUI: Creating display window Assertion failed: sz > 0, file ../../../wine/dlls/dbghelp/stabs.c, line 118 Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 28, 2020 Author Share Posted July 28, 2020 14 hours ago, Mr Robot said: [ 0.620] HOSTUI: Creating display window Assertion failed: sz > 0, file ../../../wine/dlls/dbghelp/stabs.c, line 118 Hmm... that's code that shouldn't have changed. Try this version with /startuplog:hostdisp,hostui,hostwinmsg /gdi: http://www.virtualdub.org/beta/Altirra-4.00-test7.zip http://www.virtualdub.org/beta/Altirra-4.00-test7-src.zip This will log all window messages as well as attempt to do a manual crash dump to bypass Wine's busted dbghelp.dll. The log will be longer than usual, but only the part after "Creating display window" is needed. We'll see if this is enough to pin down where exactly the crash is occurring. (For anyone else -- test7 doesn't contain changes other than diagnostics for the above issue, so you can skip it.) 1 Quote Link to comment Share on other sites More sharing options...
+skr Posted July 28, 2020 Share Posted July 28, 2020 3 hours ago, phaeron said: Hmm... that's code that shouldn't have changed. Try this version with /startuplog:hostdisp,hostui,hostwinmsg /gdi: http://www.virtualdub.org/beta/Altirra-4.00-test7.zip http://www.virtualdub.org/beta/Altirra-4.00-test7-src.zip This will log all window messages as well as attempt to do a manual crash dump to bypass Wine's busted dbghelp.dll. The log will be longer than usual, but only the part after "Creating display window" is needed. We'll see if this is enough to pin down where exactly the crash is occurring. (For anyone else -- test7 doesn't contain changes other than diagnostics for the above issue, so you can skip it.) I´m having the same issue since test 4. With test7 I got this: Sascha@Digistar-5-Mac ~ % wine64 /Applications/Atari/Altirra-4.00-test7/Altirra64.exe /startuplog:hostui,hostdisp 001b:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\wineusb": c0000142 000f:fixme:service:scmdatabase_autostart_services Auto-start service L"wineusb" failed to start: 1114 001f:err:display:macdrv_ChangeDisplaySettingsEx No matching mode found 1920x1200x32 @60! [ 0.000] Windows 6.1.7601 [ 0.000] Startup logging enabled. [ 0.000] Initializing OLE. 0009:fixme:uxtheme:BufferedPaintInit Stub () [ 0.003] Initializing themes [ 0.003] Loading config var overrides [ 0.003] Loading options [ 0.003] Loading settings [ 0.004] Running instance [ 0.004] Preloading DLLs [ 0.013] Registering controls [ 0.013] Initializing frame system [ 0.013] Initializing commands and accelerators [ 0.014] Applying options [ 0.014] Initializing filespec system [ 0.014] Initializing UI panes [ 0.018] Initializing logging [ 0.018] Initializing native UI [ 0.019] Creating main window 0009:fixme:win:RegisterTouchWindow (0x1005a 00000000): stub 0009:fixme:win:UnregisterTouchWindow (0x1005a): stub 0009:fixme:win:SetGestureConfig (0x1005a 00000000 1 0x21e510 12): stub [ 0.118] Restoring main window [ 0.206] Initializing WinSock [ 0.206] Initializing simulator [ 0.211] Initializing game controllers [ 0.232] Initializing menus [ 0.581] Initializing debugger [ 0.581] Initializing compatibility system [ 0.581] Initializing display UI [ 0.690] Loading profiles [ 0.690] Loading current profile [ 0.698] Initializing native audio 0032:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff 0032:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff 0032:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff 0032:fixme:coreaudio:ca_channel_layout_to_channel_mask Unhandled channel 0xffffffff [ 0.935] Loading ROMs [ 0.937] Restoring pane layout 0009:fixme:win:RegisterTouchWindow (0x100b8 00000000): stub 0009:fixme:win:UnregisterTouchWindow (0x100b8): stub 0009:fixme:win:SetGestureConfig (0x100b8 00000000 1 0x21e360 12): stub [ 0.941] HOSTUI: Creating display window [ 0.943] CRASH: Code: C0000005 PC: 00000001`400BD8FE ExeBase: 00000001`40000000 [ 0.943] CRASH: [ 0] exe+000B1FCE [ 0.943] CRASH: [ 1] exe+000B1FA0 [ 0.943] CRASH: [ 2] exe+000B1FA0 Assertion failed: sz > 0, file ../../../wine/dlls/dbghelp/stabs.c, line 118 Quote Link to comment Share on other sites More sharing options...
Mr Robot Posted July 28, 2020 Share Posted July 28, 2020 » ChoccyBook:Altirra-4.00-test7 >wine64 Altirra64.exe /startuplog:hostdisp,hostui,hostwinmsg /gdi: . . . [ 0.614] HOSTUI: Creating display window [ 0.614] HOSTWINMSG: S 000100C4 00000024 0000000000000000 000000000021DEC0 [ 0.615] HOSTWINMSG: R 000100C4 00000024 0000000000000000 000000000021DEC0 -> 0000000000000000 [ 0.616] HOSTWINMSG: S 000100C4 00000081 0000000000000000 000000000021E170 [ 0.616] HOSTWINMSG: R 000100C4 00000081 0000000000000000 000000000021E170 -> 0000000000000001 [ 0.617] HOSTWINMSG: S 000100C4 00000083 0000000000000000 000000000021E090 [ 0.617] HOSTWINMSG: R 000100C4 00000083 0000000000000000 000000000021E090 -> 0000000000000000 [ 0.619] HOSTWINMSG: S 000100C4 00000001 0000000000000000 000000000021E170 [ 0.620] HOSTWINMSG: R 000100C4 00000001 0000000000000000 000000000021E170 -> 0000000000000000 [ 0.620] CRASH: Code: C0000005 PC: 00000001`400BD8FE ExeBase: 00000001`40000000 [ 0.620] CRASH: [ 0] exe+000B1FCE [ 0.621] CRASH: [ 1] exe+000B1FA0 [ 0.621] CRASH: [ 2] exe+000B1FA0 Assertion failed: sz > 0, file ../../../wine/dlls/dbghelp/stabs.c, line 118 Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 29, 2020 Author Share Posted July 29, 2020 10 hours ago, Mr Robot said: » ChoccyBook:Altirra-4.00-test7 >wine64 Altirra64.exe /startuplog:hostdisp,hostui,hostwinmsg /gdi: . . . [ 0.614] HOSTUI: Creating display window [ 0.614] HOSTWINMSG: S 000100C4 00000024 0000000000000000 000000000021DEC0 [ 0.615] HOSTWINMSG: R 000100C4 00000024 0000000000000000 000000000021DEC0 -> 0000000000000000 [ 0.616] HOSTWINMSG: S 000100C4 00000081 0000000000000000 000000000021E170 [ 0.616] HOSTWINMSG: R 000100C4 00000081 0000000000000000 000000000021E170 -> 0000000000000001 [ 0.617] HOSTWINMSG: S 000100C4 00000083 0000000000000000 000000000021E090 [ 0.617] HOSTWINMSG: R 000100C4 00000083 0000000000000000 000000000021E090 -> 0000000000000000 [ 0.619] HOSTWINMSG: S 000100C4 00000001 0000000000000000 000000000021E170 [ 0.620] HOSTWINMSG: R 000100C4 00000001 0000000000000000 000000000021E170 -> 0000000000000000 [ 0.620] CRASH: Code: C0000005 PC: 00000001`400BD8FE ExeBase: 00000001`40000000 [ 0.620] CRASH: [ 0] exe+000B1FCE [ 0.621] CRASH: [ 1] exe+000B1FA0 [ 0.621] CRASH: [ 2] exe+000B1FA0 Assertion failed: sz > 0, file ../../../wine/dlls/dbghelp/stabs.c, line 118 This is unfortunately the same problem that someone else reported earlier: your macOS-specific version of Wine is not setting up the Windows thread/process environment control blocks correctly and this is causing the core thread creation function in the C runtime library to fail. Quote Link to comment Share on other sites More sharing options...
+skr Posted July 29, 2020 Share Posted July 29, 2020 At least I get an Altirra window for a very short moment: Altirra_wine64.mp4 Quote Link to comment Share on other sites More sharing options...
Mr Robot Posted July 29, 2020 Share Posted July 29, 2020 10 hours ago, phaeron said: This is unfortunately the same problem that someone else reported earlier: your macOS-specific version of Wine is not setting up the Windows thread/process environment control blocks correctly and this is causing the core thread creation function in the C runtime library to fail. So I stick with 3.90until a new version of wine-dev is released and try again. Thanks for looking ? Quote Link to comment Share on other sites More sharing options...
baktra Posted August 7, 2020 Share Posted August 7, 2020 I have trouble with 4.0-test7 and loading Rambit Turbo Tapes. The standard part loads fine, but the turbo signal is never recognized. Steps to reproduce: 0. Setup the emulated computer to plain PAL 800XL with 64KB of RAM and original ROMs 1. In cassette settings, set Turbo to "Interrupt Sense", no filtering, no inversion of the signal. 2. File>Cassette>Load... (and select the attached file) 3. Boot from cassette (START+OPTION) The standard part loads fine; the turbo part never loads. The OSD never shows T-Play, only Play. Notes: Tried inversion of the signal, doesn't work either. The last Altirra version where this works fine for me is 3.20. Version 3.90 doesn't work either. rambit-test.7z Quote Link to comment Share on other sites More sharing options...
phaeron Posted August 8, 2020 Author Share Posted August 8, 2020 16 hours ago, baktra said: I have trouble with 4.0-test7 and loading Rambit Turbo Tapes. The standard part loads fine, but the turbo signal is never recognized. Steps to reproduce: 0. Setup the emulated computer to plain PAL 800XL with 64KB of RAM and original ROMs 1. In cassette settings, set Turbo to "Interrupt Sense", no filtering, no inversion of the signal. 2. File>Cassette>Load... (and select the attached file) 3. Boot from cassette (START+OPTION) The standard part loads fine; the turbo part never loads. The OSD never shows T-Play, only Play. Notes: Tried inversion of the signal, doesn't work either. The last Altirra version where this works fine for me is 3.20. Version 3.90 doesn't work either Okay, I think I see what happened here, it affects the proceed/interrupt modes since they don't have switchable turbo and don't replace the data on the SIO data lines. You won't see T-Play because there is no switch to turbo mode, the turbo data is always sent on proceed/interrupt. I'll post a fix in the next 4.00 test release. 1 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.