Jump to content

Photo

BupSystem


16 replies to this topic

#1 TailChao OFFLINE  

TailChao

    Dragonstomper

  • 541 posts
  • Bup?

Posted Tue Dec 11, 2018 5:25 PM

Oh, hello there.
Welcome to BupSystem.
 

g_foxbox.gif


BupSystem is an Atari 7800 ProSystem emulator originally written to assist in the development and distribution of Rikki & Vikki.
Currently it's closed source and only available for Microsoft Windows.

What's Emulated
  • Sally, Maria (NTSC or PAL), TIA, RIOT, and the BIOS
  • Mappers : 16K, 32K, 48K, SUPER, SOUPER, ABSOLUTE, and ACTIVISION
  • Hardware Expansion : XBoard
  • Audio Expansion : Pokey, BupBoop + CoreTone
  • YIQ Color Generation
  • One and Two Button Joysticks
  • Light Pens and Light Guns
Conveniences
  • Gamepad Support
  • Save States
  • Sally and Maria Overclocking

The newest version is BupSystem 0.9.5.4.
You can download older versions from the BupSystem Webpage.

 
Grocery List for Future Versions
(these may happen eventually)
  • Video - Maria and TIA
    • Full recheck of Maria's rendering behavior and timing with the actual hardware
    • TIA Video generation isn't supported
  • Audio - TIA, Pokey, and BupChip
    • Better resampling algorithms and possibly adjustable chip volumes
    • Pokey behavior needs to be more thoroughly confirmed
  • Conveniences
    • Quick Screenshots
    • Additional Video Filters
    • Full Hardware Documentation in HTML Help
    • Article detailing the ProSystem's development and commercial life in HTML Help

Implemented Changes for the Next Version (0.9.5.5)
(these will be included in the next release)
  • Added
    • EMPTY cartridge support.
    • RIOT edge detection on PA7 support.
    • VCS compatible memory map support via INPTCTRL's MEN bit.
    • TIA INPT0 - INPT3 ground path and INPT4 - INPT5 latch support.
  • Cleanup
    • Default settings now favor accuracy rather than performance.
    • Disabling EXT only held A15 and A14 low on cartridge accesses rather than A15, A14, and A12.
    • Maria's palette registers aren't readable, no matter which addressing mode you use.
    • Input merging feature now allows the Left or Right Triggers to be read in single button mode, this more closely replicates the behavior of a ProLine controller.
    • RIOT's timer was stopping after its second underflow instead of continuing to decrement.
    • Sally's ABS,X and ABS,Y reads now perform dummy accesses on page boundaries.
    • Sally's ABS,X and ABS,Y writes are now five cycles long and perform dummy accesses, these previously had identical timing to reads.
    • XBoard is now installed by default, but will remain “asleep” until XCTRL is written to.

More information can be found in the included help file, and from you!
If you have any bug reports, feature requests, or are just a happy BupSystem user - let me know!

Edited by TailChao, Yesterday, 8:55 AM.


#2 Trebor OFFLINE  

Trebor

    River Patroller

  • 4,744 posts

Posted Sun Dec 16, 2018 3:07 PM

Hey TailChao,
 
Very nice progress with the BupSystem emulator.  Ran some NTSC testing and provided the results below that hopefully will be found useful and aid in its development.
 
Off the bat, there are some things to consider:
1. Overall Timing/MARIA Issues  - See 7800 Test ROM captures in spoiler.
2. Game Specific Timing/MARIA Issues (Kung Fu Master, Scrapyard Dog).
3. Game Visibility Issues (Choplifter, Midnight Mutants, Commando, Tank Command, Galaga, Donkey Kong Jr, Food Fight).
4. RIOT/Controller emulation issue(s): One-On-One Basketball - Cannot shoot the ball or call timeouts.  No button response in-game.
5. POKEY @450 missing sound (Donkey Kong PK & Bentley Bear's Crystal Quest are silent).
6. Official Diagnostic Test ROM failure.
 

Spoiler

Nonetheless, looking forward to future developments, in which hopefully, open source and other platforms may be under consideration.



#3 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Sun Dec 16, 2018 10:13 PM

Ah, thanks for the tests!

 

Looks like you're running BupSystem with Coarse Rendering Enabled (Options -> Maria (Video) -> Coarse Rendering) and No BIOS. These cause some of the inaccuracies you're experiencing but also a few are my fault. I'll go into detail below...

 

1) Overall Timing/MARIA Issues

Coarse Rendering only allows Maria register and configuration changes per-scanline rather than per-pixel which leads to the issues here. Disabling it will make most of the tests look as they do on the hardware with the exception of some being a few clocks off.

 

2) Game Specific Timing/MARIA Issues - (Kung Fu Master, Scrapyard Dog)

Same as above, these issues show up if Coarse Rendering is enabled. Scrapyard Dog still might not be totally correct though, I need to confirm some of Maria's fetch behaviors on the first few lines with a logic analyzer before I go back to these.

 

3) Game Visibility Issues - (Choplifter, Midnight Mutants, Commando, Tank Command, Galaga, Donkey Kong Jr, Food Fight)

My decision to show overscan was intentional so I can ensure the garbage matches the hardware and also whatever I'm developing doesn't show garbage. I'll consider allowing the user to disable overscan as you described since... yeah it's kinda gross.

 

4) RIOT/Controller emulation issue(s) - (One-On-One Basketball)

This is actually caused by the game not properly initializing the RIOT and relying on the BIOS to do so. If you run the BIOS before hand the game's controls will (magically) work. Ninja Golf has a similar issue where it needs the BIOS to initialize a few things or one of the channels for its title music will be silent.

 

5) POKEY @450 - missing sound (Donkey Kong PK & Bentley Bear's Crystal Quest are silent)

Yeah, BupSystem doesn't officially support this type of cartridge yet. But you can play these games with POKEY sound if you enable XBoard emulation. See Options -> Advanced in HTML Help (Help -> Contents or F1).

 

6) Official Diagnostic Test ROM failure.

Now this one is going to take awhile because it relies on TIA video emulation working, which I'm not ready to dive into yet. I'd like to get Maria 100% right first.

 

Addendum : Looks like I should probably default to "accurate" rather than "fast" :) .


Edited by TailChao, Sun Dec 16, 2018 10:27 PM.


#4 Trebor OFFLINE  

Trebor

    River Patroller

  • 4,744 posts

Posted Sat Dec 22, 2018 11:25 AM

Hi TailChao,

 

Forgot to follow-up; thank you for your response here, it served as a jog of my memory.   :)

 

I tried the advice of changing the default emulator settings, modifying Course Rendering off-unchecked and BIOS on-enabled.  It creates a flickering scanline glitch under Karateka, on the right side of the screen where the red ground should end, above the enemy's life meter. 

 

Coarse Rendering off has no visibly evident impact on the Scrapyard Dog graphic issue.  The results are the same as when Coarse Rendering is on.

 

Commando experiences infrequent but noticeable corruption across the last scanline of letters under game difficulty and number of players selection at the title screen.  A flash of white is seen.  This occurs regardless of BIOS or/and Course Rendering settings.

 

Having the BIOS enabled-on did not fix the issue with One-On-One Basketball.  The same no button response in-game remains.  A portion of the title screen music is confirmed missing with Ninja Golf, so there may be some sort of disconnect between the BIOS being recognized and utilized despite being present and enabled.

 

It does not matter, the combination of Coarse Rendering being on or off, and whether the BIOS is enabled or disabled, Beef Drop runs incorrectly at a very fast speed.  

 

FailSafe has scanline glitching, regardless of settings, at the bottom of the status area towards the top of the screen:  Coarse Rendering off-unchecked, it occupies ~1/4 width of the display on the right.  Coarse Rendering on-checked, it takes up the entire width of the display.  

 

Coarse Rendering off creates scanline corruption between the fuel line and playfield of Scramble, while reverting back to Coarse Rendering on removes it.

 

The tip on enabling POKEY @450 support is appreciated. Unfortunately though, POKEY sound emulation has issues.  Donkey Kong PK/XM experiences some of the worst; especially during the "How High Can You Get?" screens.  Bentley Bear's Crystal Quest demonstrates an annoying high pitch ring consistently heard while the music is playing.

 

Definitely recommend going with accurate over fast.  Without the BIOS present/enabled, the WIP Bullet Festival goes corrupt.  From title screen onward into gameplay, all graphics are corrupted throughout the game.  Saving a few seconds having the BIOS disabled is not worth misleading and inaccurate results.  ;)



#5 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Sun Dec 23, 2018 12:16 PM

Forgot to follow-up; thank you for your response here, it served as a jog of my memory.

No problem, thanks for all these tests :) .
 
Looks like there's definitely something off with Maria's timing, particularly when software sets up a DLI in its first DLL. This I'll need to trace manually and it'll take awhile to confirm what's going on. I do recall Xenophobe in particular is super fussy about the behavior here.

 

The tip on enabling POKEY @450 support is appreciated. Unfortunately though, POKEY sound emulation has issues. Donkey Kong PK/XM experiences some of the worst; especially during the "How High Can You Get?" screens. Bentley Bear's Crystal Quest demonstrates an annoying high pitch ring consistently heard while the music is playing.

Yeah, there's definitely lots to do with the POKEY core. Some of the distortion is from aliasing since BupSystem's audio is (as of writing) nearest-neightbor resampled. In particular, Bentley Bear's Crystal Quest sets the frequency registers to an extremely low divisor (and therefore a very high frequency) which averages down and becomes inaudible on the real thing.

 

Definitely recommend going with accurate over fast. Without the BIOS present/enabled, the WIP Bullet Festival goes corrupt. From title screen onward into gameplay, all graphics are corrupted throughout the game. Saving a few seconds having the BIOS disabled is not worth misleading and inaccurate results. ;)

Agreed.
 
Addendum : I do want to point out that lots of software relies on the BIOS to initialize registers and memory, far more than I expected. As a developer, I want to make sure I'm not doing this and so in a few cases BupSystem is much less forgiving than the real hardware. I've noticed some titles will function differently when run after the "Atari Rainbow" or Asteroids BIOSes. A user-controlled option to start in a completely scrambled state or with "BIOS Residue" would probably be best.


Edited by TailChao, Sun Dec 23, 2018 12:34 PM.


#6 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Sun Jan 20, 2019 10:54 AM

Hardware safari, here's a scope capture of Maria taking and releasing the bus.

 

7800_Maria_DMA_Scope.png

 

HALTn lowers around 28 ticks @ 7.16MHz into each line, slightly after PHI2 has fallen. Sally will still be driving the bus for the first tick of PHI2 and by the second falling edge she'll have given it up to Maria. R/W will stay high whenever Maria has the bus.



#7 RevEng OFFLINE  

RevEng

    Bit Player

  • 5,213 posts
  • Location:bottom of the stack

Posted Sun Jan 20, 2019 12:30 PM

Very nice. The 28 MARIA cycles matches the 7 6502 cycles mentioned in the Software Guide. Given how much correcting the guide has needed, it's nice to get confirmation here, and a visual on PHI2. :thumbsup:

#8 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Sun Jan 20, 2019 1:34 PM

More safari time, here's the Maria Diagnostic screen in Rikki & Vikki. You can access this by switching the Right Difficulty Switch to the Right and entering R-U-D-D-L-D-U-U on Player 2's Joystick during the PenguiNet Screen. Or at least you'll be able to when the cartridges ship out.
 

c_mardiag_x.PNG

 
There's some notes regarding this in the Compatibility section of BupSystem's HTML Help, but I think they should be duplicated and expanded upon here.
; Because the manual doesn't really say much about how Maria reads from
; $0000 - $17FF and there's some argument as to how long a frame actually is.
;
; Maria Diagnostic
; MSTAT : [VBL] [ACT] [VBIAS] [ABIAS]
;
; [$0000 - $007F]
; [$0080 - $00FF]
; [$1000 - $107F]
; [$1080 - $10FF]
;
; VBL : VBL Line Count
; ACT : Active Line Count
; *VBIAS : MSTAT Alignment in VBL -> Active
; *ABIAS : MSTAT Alignment in Active -> VBL
;
; * Only available in TST_MARIA_EXTENDED.
 
Here's what's going on to get VBL, ACT, VBIAS, and ABIAS :
Spoiler

 
There's a few interesting things here, in particular we can see noise when Maria reads her own palette registers. It also appears MSTAT's state changes within a scanline rather than at its start or end, which has been nudging me towards the assumption that all Maria's operations and updates are aligned with her DMA start point. Any reads from RIOT or the TIA are pretty chaotic, which does make sense since Maria's access timings are way out of their spec.
 

Very nice. The 28 MARIA cycles matches the 7 6502 cycles mentioned in the Software Guide. Given how much correcting the guide has needed, it's nice to get confirmation here, and a visual on PHI2. :thumbsup:

A few years ago nichtsnutz posted a logic analyzer capture of the same behavior, but it's good to have the scope version too since the reads of several lines are visually mashed together.

Much of GCC's original guide I wouldn't consider wrong, but rather it's not clear about what why the variations in timing are there and what happens with them. For example, the remark about Maria's DMA kicking off 8 Sally cycles into a scanline has some validity since Sally always runs for at least one cycle after HALTn lowers.
 
Addendum : I do want to confirm what's going on with Maria's palette registers, though. The guide says they can be read only in certain addressing modes but I couldn't get stable data out of them in any addressing mode.

Edited by TailChao, Sun Jan 20, 2019 1:44 PM.


#9 RevEng OFFLINE  

RevEng

    Bit Player

  • 5,213 posts
  • Location:bottom of the stack

Posted Sun Jan 20, 2019 2:04 PM

Much of GCC's original guide I wouldn't consider wrong, but rather it's not clear about what why the variations in timing are there and what happens with them. For example, the remark about Maria's DMA kicking off 8 Sally cycles into a scanline has some validity since Sally always runs for at least one cycle after HALTn lowers.
 
Addendum : I do want to confirm what's going on with Maria's palette registers, though. The guide says they can be read only in certain addressing modes but I couldn't get stable data out of them in any addressing mode.


I would agree with what you say about the GCC guide. There are bits of context that are missing for a lot of the statements.

Reading from the palette registers doesn't work, as you've observed. Atari may have based that on the earlier MARIA design, and never updated it. The GCC guide says explicitly that they're write-only. A while back I updated the online version of the 7800 software guide to match that.

#10 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Mon Jan 21, 2019 9:07 AM

Reading from the palette registers doesn't work, as you've observed. Atari may have based that on the earlier MARIA design, and never updated it. The GCC guide says explicitly that they're write-only. A while back I updated the online version of the 7800 software guide to match that.

Ah, thanks! I didn't know the GCC guide had a different opinion. Now there's one more thing thing to fix in the next version of BupSystem.

#11 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 11,256 posts
  • Location:Baden-Württemberg, Germany

Posted Sun Jan 27, 2019 2:49 AM

Does the emu support a proper debugger?

And command line support?

#12 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Sun Jan 27, 2019 7:54 AM

Does the emu support a proper debugger?

And command line support?

Unfortunately, no debugger (yet).

Regarding command line support, if you mean loading a cartridge from the command line then yes. The syntax is BupSystem [cartridge] where [cartridge] can be an *.a78, *.cdf, or *.bin file. HTML Help has some more info on each of these formats and their restrictions.

#13 Heaven/TQA OFFLINE  

Heaven/TQA

    Quadrunner

  • 11,256 posts
  • Location:Baden-Württemberg, Germany

Posted Sun Jan 27, 2019 8:20 AM

Without debugger hard for dev. ;) as I realized that bank switching with mad gone code and stores at 8000-bfff

Thanks to a7800 and watchpoints easy to track down.

#14 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Wed Apr 24, 2019 7:10 AM

Had some time to look into this again :
 

4. RIOT/Controller emulation issue(s): One-On-One Basketball - Cannot shoot the ball or call timeouts.  No button response in-game... Memory fails me as to why exactly or what, but I remember this impacting what is now the A7800 emulator several years ago.


I've confirmed this wasn't caused by my RIOT emulation, but rather the input block and input merging feature. Report 06060 on MAME Testers does cover some of the mischief One-on-One Basketball is doing, but I'd like to expand upon it.
 
Games are expected to do the following initialization procedure before reading input :

  • Write $14 to SWBCNT.
    This sets both PB2 and PB4 into output mode and allows enabling or disabling transistors Q6 and Q5, respectively. These are part of the stronger pullup section used for driving two-button inputs.
     
  • Set SWCHB to one of the values below depending upon the current input configuration or requirements.
    $00 : Both Player 1 and Player 2 are using ProLines.
    $04 : Player 1 is using a Single Button Joystick, Player 2 is using a ProLine.
    $10 - Player 1 is using a ProLine, Player 2 is using a Single Button Joystick.
    $14 - Both Player 1 and Player 2 are using Single Button Joysticks.
     
  • The state of SWCHB may be altered during play if more elaborate input handling is desired by the software.
     

What's happening here is One-on-One Basketball sets SWBCNT to $14 but never writes anything to SWCHB. As SWCHB's output state after reset is $FF, this leaves transistors Q6 and Q5 off - the game is running in single button mode. It also reads from INPT4 while in the menu but uses INPT0 - 3 when on the court. Basically, the game is relying not only on the default state of SWCHB's outputs - but also on the ProLine's electrical behavior of pulling down INPT4 when INPT0 - 1 are yanked up during a button press when Q6 is off.

 

In short, One-on-One Basketball is extremely lucky that its input works at all.

 

 

So how does this affect BupSystem?

 

The issue was in its input merging feature - originally BupSystem only allowed the Left Trigger, Right Trigger, and VCS / Single Button Joystick Trigger to be treated as separate inputs as they are in hardware. Later on I added input merging (enabled by default) which makes the Left or Right Triggers register a press on the Single Button Joystick Trigger when Q6 or Q5 are disabled, a little closer to how the ProLine works - but not close enough.

 

If a ProLine is connected to a controller port while its two-button pullup transistor is disabled, pressing the Left or Right Trigger will pull Pin 6 down and raise either Pin 9 or 5 depending upon which button was pressed. BupSystem's input merger was only lowering Pin 6. So if you absolutely must play One-on-One Basketball in the current version of BupSystem, disable input merging ([input] -> merge=n, see Advanced Options in HTML Help) - and please don't write your own 7800 software this way.



#15 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Thu Apr 25, 2019 9:07 AM

While the input problems with One-on-One Basketball above weren't caused by an issue with BupSystem's implementation of RIOT...
 

It does not matter, the combination of Coarse Rendering being on or off, and whether the BIOS is enabled or disabled, Beef Drop runs incorrectly at a very fast speed.

 

...this was!

 

Looks like Beef Drop is using the RIOT's timer for a couple delays and BupSystem's implementation had the down counter stop after the second underflow instead of continuing to decrement. This will be corrected in the next version along with proper implementation of the PA7 edge detection feature.



#16 swapd0 OFFLINE  

swapd0

    Moonsweeper

  • 420 posts

Posted Mon Apr 29, 2019 10:28 AM

Could it be possible to port SOUPER mapper code and BupBoop + CoreTone to a7800 emulator? It's open source and it's avaliable for Linux and Mac...



#17 TailChao OFFLINE  

TailChao

    Dragonstomper

  • Topic Starter
  • 541 posts
  • Bup?

Posted Mon Apr 29, 2019 11:38 AM

Could it be possible to port SOUPER mapper code and BupBoop + CoreTone to a7800 emulator? It's open source and it's avaliable for Linux and Mac...

Sure, but I can't be the one to implement this feature with my current schedule.

The *.A78 format will also have to be updated with a new mapper type for SOUPER and specification for where the (optional) audio data is located.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users