Switching to R43 frustration
Re: Switching to R43 frustration
Another thing I've been meaning to ask:
Does a line interrupt trigger at the beginning or end of the line in question? When the line starts or when it hits the horizontal blank?
Does a line interrupt trigger at the beginning or end of the line in question? When the line starts or when it hits the horizontal blank?
-
- Posts: 292
- Joined: Wed Jun 03, 2020 11:33 am
- Location: Kalmar, Sweden
Re: Switching to R43 frustration
Thanks for making this clear! I have been confused by this too. I had code that stopped working and I didn’t understand why. I made some changes and got it working again without really knowing what I was doing. But now I get it.StephenHorn wrote: ↑Thu Jun 01, 2023 4:58 pm I dimly recall there being some PRs having to do with VERA IRQ triggering and line IRQs... ah, yeah, found the change that matters in the emulation code. In January this year (2023 for time travelers from the future), a change went in to match emulation behavior with hardware behavior. On VERA hardware, the ISR bits are set regardless of the state of the IEN bits -- IEN only controls whether VERA generates an interrupt request to the CPU when certain ISR bits are set.
Previous to that change, the relationship in the emulator was the other way around, and IEN bits would control whether ISR bits could ever get set, and VERA would generate interrupt requests if any bits in ISR were set. This means the line interrupt bit is pretty much guaranteed to be set most of the time -- it just doesn't generate interrupts anymore unless the appropriate IEN bit is set.
Re: Switching to R43 frustration
Well, that does work! Thank you so much.
Now it just has some sprite position anomalies at the beginning of the game that weren't there before. Maybe to do with the randomized ram? (Your spaceship changes position then fires bullets that come out of a different position out of thin air for a few seconds, then everything settles into normal. But that's a new problem.)
Now it just has some sprite position anomalies at the beginning of the game that weren't there before. Maybe to do with the randomized ram? (Your spaceship changes position then fires bullets that come out of a different position out of thin air for a few seconds, then everything settles into normal. But that's a new problem.)
- StephenHorn
- Posts: 565
- Joined: Tue Apr 28, 2020 12:00 am
- Contact:
Re: Switching to R43 frustration
The emulator is setting the bit in VERA ISR at the start of the visible line. That said, there are several possible places where a change to VERA state will take effect. I don't remember the exact list off the top of my head, but in general the background layer settings are applied 2 scanlines after they are set, I think VSTART is applied on the next line (please don't hold me to that), and other state changes are applied immediately (i.e. are visible mid-scanline and can benefit/suffer from "racing the beam" techniques).
Someone please correct me if I'm getting this wrong.
Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
- desertfish
- Posts: 1091
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
Re: Switching to R43 frustration
You can easily check if this is the case by running the emulator with the -zeroram command line option. That will clear the ram to zero again which was the old behavior, but it is not what the hardware is doing.ch4rl3sb wrote: ↑Thu Jun 01, 2023 7:44 pm Well, that does work! Thank you so much.
Now it just has some sprite position anomalies at the beginning of the game that weren't there before. Maybe to do with the randomized ram? (Your spaceship changes position then fires bullets that come out of a different position out of thin air for a few seconds, then everything settles into normal. But that's a new problem.)
-
- Posts: 503
- Joined: Sat Jul 11, 2020 3:30 pm
Re: Switching to R43 frustration
I have similar frustrations with the way files are handled now, particularly with subfolders. No matter what I do I can't seem to load a file if it's in a subfolder.
I wrote some code to save a file with the following filename:
And that saved PIX40.DAT properly in the IMG subfolder in the DEMO folder.
But no matter what filename I try I cannot load that file back into memory. Here's some of the filenames I tried:
So what am I missing? And why not simply leave it the way it was in r41, the way every other computer system that has used subfolders for the last 40 years? Why make it a unique syntax?
I wrote some code to save a file with the following filename:
Code: Select all
@:DEMO/IMG/PIX40.DAT
But no matter what filename I try I cannot load that file back into memory. Here's some of the filenames I tried:
Code: Select all
DEMO/IMG/PIX40.DAT
/DEMO/IMG/PIX40.DAT
DEMO:/IMG:/PIX40.DAT
DEMO/IMG/:PIX40.DAT
DEMO/:IMG/:PIX40.DAT
DEMO/IMG:/PIX40.DAT
:/DEMO/IMG:/PIX40.DAT
and so on and so on.
Re: Switching to R43 frustration
This sounds like a bug. I'll ping MooingLemur on this and see if he has any insight.Ed Minchau wrote: ↑Thu Jul 13, 2023 11:48 pm I have similar frustrations with the way files are handled now, particularly with subfolders. No matter what I do I can't seem to load a file if it's in a subfolder.
I wrote some code to save a file with the following filename:And that saved PIX40.DAT properly in the IMG subfolder in the DEMO folder.Code: Select all
@:DEMO/IMG/PIX40.DAT
But no matter what filename I try I cannot load that file back into memory. Here's some of the filenames I tried:So what am I missing? And why not simply leave it the way it was in r41, the way every other computer system that has used subfolders for the last 40 years? Why make it a unique syntax?Code: Select all
DEMO/IMG/PIX40.DAT /DEMO/IMG/PIX40.DAT DEMO:/IMG:/PIX40.DAT DEMO/IMG/:PIX40.DAT DEMO/:IMG/:PIX40.DAT DEMO/IMG:/PIX40.DAT :/DEMO/IMG:/PIX40.DAT and so on and so on.
update: I can save and load from subdirectories with the usual syntax: Make sure you're using the -fsroot parameter when starting the emulator and point that to a directory with your files. I have a "root" directory parallel to my emu directory, like this:
C:\CX16\Emulator
C:\CX16\root
and I start the emu with .\emulator\x16emu.exe -scale 2 -echo -rtc -fsroot .\root
Re: Switching to R43 frustration
What is the exact command you are using? The first format seems to work fine for me.Ed Minchau wrote: ↑Thu Jul 13, 2023 11:48 pm I have similar frustrations with the way files are handled now, particularly with subfolders. No matter what I do I can't seem to load a file if it's in a subfolder.
I wrote some code to save a file with the following filename:And that saved PIX40.DAT properly in the IMG subfolder in the DEMO folder.Code: Select all
@:DEMO/IMG/PIX40.DAT
But no matter what filename I try I cannot load that file back into memory. Here's some of the filenames I tried:So what am I missing? And why not simply leave it the way it was in r41, the way every other computer system that has used subfolders for the last 40 years? Why make it a unique syntax?Code: Select all
DEMO/IMG/PIX40.DAT /DEMO/IMG/PIX40.DAT DEMO:/IMG:/PIX40.DAT DEMO/IMG/:PIX40.DAT DEMO/:IMG/:PIX40.DAT DEMO/IMG:/PIX40.DAT :/DEMO/IMG:/PIX40.DAT and so on and so on.
Code: Select all
BLOAD "TETRADS/SOUNDS.BIN",8,1,$A000
SEARCHING FOR TETRADS/SOUNDS.BIN
LOADING FROM $01:A000 TO $05:B3EB
READY.
-
- Posts: 503
- Joined: Sat Jul 11, 2020 3:30 pm
Re: Switching to R43 frustration
That's a file in a folder. I need a file in a subfolder in a folder.
Re: Switching to R43 frustration
I did a quick look at the kernal rom, and the parser wants something like this:
"@0/HERES/MY/PATH/:FILE.PRG"
I think you can omit the leading number (it's the "medium" and it defaults to zero). The path part must begin and end with a slash, and the part directly after the colon is the filename plus options like usual.
I can't test right now to confirm, sorry.
"@0/HERES/MY/PATH/:FILE.PRG"
I think you can omit the leading number (it's the "medium" and it defaults to zero). The path part must begin and end with a slash, and the part directly after the colon is the filename plus options like usual.
I can't test right now to confirm, sorry.