Giter VIP home page Giter VIP logo

bdd6502's People

Contributors

markjfisher avatar martinpiper avatar oziphantom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

p-a markjfisher

bdd6502's Issues

How do you build/run this?

The readme mentions BDD6502-1.0-SNAPSHOT-jar-with-dependencies.jar but when I download the files there are no jar files in it.
From looking at the source files I guess there are also a bunch of other libs that are not linked so I need to download them and put them somewhere specific? If I'm to build it?

Feature Request : Ability to check against a location in memory

Say you are making some code that looks up which X offset you want it to check, it reads in some data and then looks up a table.
You either write the code to check the X or the Y register is the right offset - this is brittle and may not work as by the end of the function they might be restored to the value when passed in.
You might also re-factor the code at some point and change your use of X and Y causing the test to fail

OR

You check that A or the variable it writes contains the expected value that is currently in the table. Which again might change at some point causing the test to fail.

So having a
And I expect ZPTemp to contain the value in MyTable+6
or
And I expect ZPTemp to contain the value (MyTable+6) <- might work better when part of an Examples: table

would be nice.

Bug in loadLabels - trimming whitespace not assigned

At https://github.com/martinpiper/BDD6502/blob/76de59bd605a4cfd58680676fe6bdf14e59d673d/src/main/java/TestGlue/Glue.java#L1579C25-L1579C25

            splits[0] = splits[0].trim();
            String[] splits2 = splits[1].split(";");
            splits2[0].trim();

The final trim of this block is not being assigned back to splits2[0], as the version 2 lines above it does.

It means assignments of labels like:

FOO = 0x1000
BAR =0x1001

are failing for FOO, but not for BAR due to trying to parse " 0x1000" and the leading space breaking the test for char[0] and char[1] being '0' and 'x'.

Initially couldn't work out it was the space, and things like FOO+0 were working around the bug.
Locally I've fixed my labels to never have spaces after =, so it's working, but thought I'd report bug.

ST register checking seems to be broken

When testing the ST register state seems to pass no matter what

Then I expect register ST contain stN
And I expect register ST contain stV
And I expect register ST equal 0
And I expect register ST equal stZ

Passes, even though there is no way all of them can be true.

Feature Request : % parser

Can we have % as well as $. When testing bit patterns in compression or graphics writing, or emulating say the Joystick register DC00. Writing 21 for down and right is really easy to mess up and hard to read while doing %00010101 makes it a bit more obvious what you are testing.

Can macros accept raw strings as parameters?

I'm trying to write something like:

      And I create file "build/tests/sio-patch" and patch machine with
      """
      ; stub SIOV
        icl "../../../../src/libs/atari/inc/os.inc"

        org SIOV
        ; copy t_v into the DBUF buffer (which is a pointer to real location of memory)
        mvw DBUFLO $80
        ldy #0
        mva t_v ($80),y
        rts

      ; an address for the test to write to. this is the stubbed value that will be written to by pointer at DBUF
      t_v dta 0

    """

I've got several macros working fine, but I'm struggling to write one for the above.

I've got this:

Given I create file "*" and patch machine with "*"
  When I create file "build/tests/$1.asm" with "$2"
   And I mads-compile "$1" from "build/tests/$1.asm"
   And I convert mads-labels file "build/tests/$1.lbl" to acme labels file "build/tests/$1.al"
   And I patch machine from obx file "build/tests/$1"

but when I run the feature I get an error saying there's no definition for the step:

// You can implement missing steps with the snippets below:

@Given("^I create file \"([^\"]*)\" and patch machine with$")
public void i_create_file_and_patch_machine_with(String arg1, String arg2) throws Throwable {
    // Write code here that turns the phrase above into concrete actions
    throw new PendingException();
}

so it doesn't seem to be matching the macro.

I've tried putting triple quotes around the macro's 2nd parameter, but still had same error.
I also tried joining the raw string in the Step itself onto the step line, like:

And I create file "build/tests/sio-patch" and patch machine with """
    ; stub SIOV
    // ...

but that threw an error parsing the feature.

EDIT: I've worked around it by using the " And I create file "build/tests/sio-patch.asm" with" step instead, but still wonder if there's a way to do it directly.
Thanks.

Speed

I know this is Java and it is slow but this is getting beyond the Java is slow joke.
40 Scenarios (40 passed)
480 Steps (480 passed)
1m43.582s

Most of the time seems to be in the regexs. maybe there is a way to tweak them to make them faster. Or since the Given, Then etc are just calling straight Java code, is there a way to compile the features into actual java files, so once we are happy with a feature and its test, we convert them to java for speed during regression?

Can't send pull request

I have a bunch of changes and enhancements for this on my machines, but I can't sync the branch or send you a pull request for it.

The update includes
These new methods

*I have a simple overclocked 6502 system *- disables the delay that makes the 6502 1Mhz

That does fail on BRK - this will cause a test to fail if CPU hits a BRK, so you can put BRKs into code like an assert/check to see if the code enters no mans land

That does exit on BRK - just stops running as if it has rts'ed everything, this lets you put in artificial stops for extra checks.

I load bin “XXXX” at XXXX - lets you load any file ( sans PRG 2 byte header ) into RAM, useful for loading in test levels and other data

I enable trace - turn on trace in the middle of a feature, so you just get the code you want, and not a 100MB text file

I disable trace - turns it off again

I execute the procedure at XXXX until XXXX = XX(XX|XX) - runs code until a memory location(s) is a certain value, normally in code you have a Frame lock, that code waits for. For the test you can change that code to inc a Frame counter, then use this function to run the code for N frames. The XX(XX|XX) is Automagical expansion - if you ask for 200 at $600 it checks just $600, if you ask for a word like 1500 frames, from $600 it will check $600 and $601, if you ask for a long 100,000 frames it will check $600,$601 and $602

I expect to see XXXX less than XX
I expect to see XXXX greater than XX
check to see if memory is above or below a value

I expect to see register a|x|y|st to be less than XX
I expect to see register a|x|y|st to be greater than XX
check to see if register is above or below a value

Joystick 1|2 is NONE|U|D|L|R|FIRE|UFIRE|ULFIRE|URFIRE|DFIRE|DLFIRE|DRFIRE|LFIRE|RFIRE
No more write $dc00 with X, this sets DC00 or DC01 with the "normal" values for this direction, as taken from BASIC without any modifications to the DCXX range

Enhancements
6502 can now be overclocked ( i.e no delay ) which made my 9seconds tests become 3 seconds so it is not the bottle neck but still a good boost

Trace functionality, I have removed the extra line and made it write out a label for the address

1B5F  E8        INX           A:00 X:01 Y:00 F:20 S:1FD [..-.....]
1B60  E8        INX           A:00 X:02 Y:00 F:20 S:1FD [..-.....]
1B61  20 70 10  JSR $1070     A:00 X:02 Y:00 F:20 S:1FB [..-.....]
convertXSingleByteEntX:
1070  BD 40 C0  LDA $C040,X   A:FF X:02 Y:00 F:A0 S:1FB [N.-.....]
1073  D0 07     BNE $07       A:FF X:02 Y:00 F:A0 S:1FB [N.-.....]
convertXSingleByteEntX__notMSB:
107C  BD 20 C0  LDA $C020,X   A:98 X:02 Y:00 F:A0 S:1FB [N.-.....]
107F  38        SEC           A:98 X:02 Y:00 F:A1 S:1FB [N.-....C]

New testing based Opcodes

$02 PAT - Push A Test
$12 PXT - Push X Test
$22 PYT - Push Y Test
$32 TTA - Test Test A
$42 TTX - Test Test X
$52 TTY - Test Test Y

P?T - this pushes the register onto a separate stack, a new stack is added per JSR level and if one was made it is removed upon RTS
TT? - makes sure that the current value of ? matches what is in the current "stack frame"
So you write some code and you make the subroutine not change X, and the code is fine, you make a bug fix or use the subroutine elsewhere 2 months later and make it change X. This breaks your old code and you might notice a bug you might not. These opcodes can be used to "assert" that it is true, and fail when it changes.

Joystick

I've just been doing some new tests, and since it is a game it scans the joystick. Since I forgot to set Joystick 2 to NONE it was getting input data, took me a while to work out it was possible.
What are you thoughts on making the Simple 6502 or Simple overclocked 6502 have the default "no joystick" movement set for the CIA registers and not the current "0"?

Can cukesplus be made public? And problems running the project

Hi, I've come across your project and decided to use it for some work I'm doing with the FujiNet (https://github.com/FujiNetWIFI/) project I'm involved in.

I'm predominantly a Kotlin user, and tried writing a project that uses your release jar, but uses Kotlin's class extensions to write new Given clauses, e.g.

import com.replicanet.cukesplus.Main
import TestGlue.Glue
import cucumber.api.java.en.Given
import java.io.FileInputStream

fun main(args: Array<String>) {
    val mainArgs = "--monochrome --plugin pretty --plugin html:target/cucumber --plugin json:target/report1.json --glue TestGlue features".split(" ").toTypedArray()
    Main.main(mainArgs)
}

@Throws(Throwable::class)
@Given("^I load xex \"([^\"]*)\"$")
fun Glue.i_load_xex(file: String) {
    val inFile = FileInputStream(file)
    // ... etc
}

This does bring up the listener, but sadly my Glue extensions are not getting recognised in the JVM that is launched. I tried using java.lang.String instead of kotlin's builtin String, but still no joy.

So I thought I'd work at making a Kotlin version that does allow this, based on your codebase (reimplementing in pure Kotlin instead of java), but stripping back most of the C64 code, as I'm predominantly going to be using Atari/MADS/Altirra instead of C64/ACME/VICE, and providing the core functionality but agnostic of target hardware.

My idea is to get an initial setup going, and maybe build it in a way that different platforms could extend the functionality for themselves, as the FujiNet project works on many types of boards. Thus provide 'runners' for each board, but allow people to write Given clauses outside the the BDD framework, which is where I'm currently struggling.

Does this sound like an approach you could see working? I've only really scratched at the codebase's surface.
Or maybe there's an easier way for me to write new Given clauses from a separate project I haven't considered? (As that's my main usecase, and porting to Kotlin is a huge direction change for what I'm currently working on).

However, I tried to start, but the first problem I hit is I can't download the source mentioned in pom.xml for https://github.com/martinpiper/CukesPlus.git as it's a private repo of yours.

So rather than rip it out the jar file, I wondered if I could start a dialogue with yourself, and see where it leads :)

Thanks,
Mark

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.