Giter Club home page Giter Club logo

kick-c64-dead-test's Introduction

Commodore 64 Dead Test - Kick assembler port

This is a kick assembler adapted and slight personalized version of the COMMODORE 64 Dead Test rev. 781220. It's based on the Original disassembly by worldofjani.com. The pre existing test logic is in fact untouched.

If you just need to test your machine, I strongly suggest to go with the original version. This version is mainly useful if you want to understand the logic behind the tests and add your personal touch to them.

Running Dead Test

Prerequisites

  • kickassembler should be installed in your system. Also if you use the provided makefile, you need to ensure it will be in same path as KICKASS_BIN is pointing at. You can update this variable to match your needs of course.

  • vice is the recommended way to test the compiled .crt file and is also required to convert the .prg output to crt and then bin. If you are on MacOS like me, best option is to use the brew version of vice. The make file assume cartconv is available in the execution path. Note as an alternative path you can generate the bin from the prg by just remove the first two bytes in it.

Binary files

Stable release are published under https://github.com/stid/kick-c64-dead-test/releases. Both CRT and BIN files are available.

Build, Compile & run

You should be able to compile the code starring from src/main.asm - chunks of the program will be subsequently included.

A convenient makefile was included to simplify the compilation, it will generate a proper .crt image via build.

make

To execute the generated .crt via VICE (I'm using brew installed version of VICE on MacOS):

x64sc ./bin/dead-test.crt

The dead test should start with the common black screen, during this phase, the memory is tested. The common test view will show up just after (it will take around 10 seconds).

Differences with the original rev. 781220 dead test

The original test logic & sequence is in fact untouched, it should act as the original. Below are the main differences between this version and the original rev. 781220:

  • Code has been split in small chunks and kickassembler imports are used to include related dependencies. This change the way the different parts of code are ordered in memory.
  • Border & Background colors are different from the original version at start. Also the border color will cycle (0-255) at every test execution.
  • A color reference bar is rendered at the bottom of the screen, just above the counter and timers info. I have found this to be a good reference to fast check color issues when testing a machine.
  • Very small optimizations were added to the code.
  • compared to the worldofjani.com original disassembly, constants, labels & comments has been added on the code. Definitely something that cab be further improved.
  • I personalized (hacked by) the about string :) - didn't resist.
  • Sound Filters test was added just after the original sound test. This was pointed out in the facebook group "Commodore 64/128 programming" and based on this video: https://www.youtube.com/watch?v=QYgfcvlqIlc&t=1438s. Broken filters are not easy to be spotted with the sound only test.

Customizing the Dead Test

You should be able to customize this version very easily, assuming proper assembler knowledge & C64 hardware.

NOTE: memBankTest, zeroPageTestDone & stackPageTestDone are execute at start without using any JSR. As much as you might be tempted to improve the code a bit by JSR / RTS instead of using absolute JMP, you should keep care of the fact that the stack memory is not tested yet at this stage and this means a JSR used before the stack test can lead to a unrecoverable state - leaving you without any clue about the effective stack failure.

Test Flow

As mentioned above, test logic and flow is untouched and should be identical to the Dead Test rev. 781220. These is the high level flow executed on any test cycle:

  1. memBankTest - Black screen, if test fail, jump to screen blinking and go in infinite loop
  2. drawLayout executed - VIC initialized
  3. zeroPageTest
  4. stackPageTest
  5. screenRamTest
  6. colorRamTest
  7. ramTest
  8. fontTest
  9. soundTest
  10. filtersTest
  11. Counter updated, loop to VIC initialization and restart tests

Burning EPROM & compatible Cartridge

The make will generate a .bin file ready to be burned on an EPROM. I was able to successfully burn the Dead Test on a M2764A. You can also use the faster and easy to be erased/rewritten 2W27C512, but you need to ensure the code is positioned at 256Kb offset. You can concat the 8k bin 33 times to just fill the cartridge with cloned code up to the 256k offset. 27C256 should also work but I didn't try it myself.

Image of Cartridge

I used a HomeBrew development cartridge to install the related EPROM. You need to have an 8K setup with GAME = 0, EXROM = 1, Ultimax Mode, ROMLOW should be ignored - This should be an Util (ROMHI) cartrige.

You can also buy a pre assembled Dead Test "DEAD TEST DIAGNOSTIC cartridge 781220" and substitute the related EPROM (or burn over it if you don't mind loosing the original version).

You can definitely try to build your own.

WARNING: As much as this program will probably never be able to harm your C64/128, a bad assembled cartridge can potentially do. Keep this in mind if you go on your own. If you are not comfortable with soldering, boards & jumpers, I strongly recommend to buy a pre assembled Dead Test Cartridge on e-bay or on one of the many retro stores (ensure rev. 781220) and just swap the pre existing EPROM with your custom version.

Potential bugs

I ported the original source to kick assembler and ensured the compiled version matched 1:1 with the original bin - byte to byte. After that I started splitting the code in multiple files, adding macros, constants & labels. As much as I tested the flow many times I can't exclude some bug has been introduced in the process.

kick-c64-dead-test's People

Contributors

stid 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kick-c64-dead-test's Issues

Extended RAM Test

It is not a bug, just a suggestion.
The original RAM Test only tests 4k of RAM (according to the dead test manual). It would be nice to have a final RAM Test, that tests all RAM. Or at least the previously untested RAM. The original RAM Test is IMHO not very effective, either. It sets all bits separately etc. Actually, a test writing AA, then 55 and finally a Pseudo Random Number sequence, would also reveal address bus problems. The PRN are not so Random, just a fix sequence of bytes that repeat after like 247 and not 256 numbers. This odd length allows to see, if there are RAM pages confused or overwritten. I have done such a test for the VIC-20 (Expansion) RAM Tester, that I have written. It would be a really helpful feature. Probably not much works (maybe a bit tricky for the memory below the Kernal).

Your SID Filter Test is really cool, BTW.

Regards,
Sven.

ROM Test

Not a bug or an issue, but it would be nice if you could add the little BASIC/KERNAL/CHAR rom test from the diag cart.

Here it is:
;KERNAL/BASIC/CHARAC ROM test
I890E LDX #$09
I8910 LDA F993C,X ;"KERNAL ROM"
STA F0568,X
DEX
BPL I8910
LDX #$08
I891B LDA F9933,X ;"BASIC"
STA F0590,X
DEX
BPL I891B
LDX #$09
I8926 LDA F9946,X ;"CHARAC"
STA F05B8,X
DEX
BPL I8926

                          ;KERNAL ROM TEST       
   LDA #$37
   STA A01
   LDA #>$E000
   STA AF9
   LDA #$20               ;$2000 of mem to test
   STA A0F
   LDA #$00
   STA AF8
   TAY
   CLC

I8941 ADC (PF8),Y
INY
BNE I8941
INC AF9
DEC A0F
BNE I8941
ADC #$00
PHA
LDA AFF80 ;Kernal Version Number
CMP #$AA
BEQ I896A
CMP #$00
BEQ I8962
PLA
CMP #$E0
BEQ I8972 ;"OK"
JMP I8983 ;"BAD"
I8962 PLA
CMP #$E1
BEQ I8972 ;"OK"
JMP I8983 ;"BAD"
I896A PLA
CMP #$E1
BEQ I8972 ;"OK"
JMP I8983 ;"BAD"

I8972 LDA #$37 ;"Kernal ROM OK"
STA A01
LDA #$0F ;"O"
STA A0575
LDA #$0B ;"K"
STA A0576
JMP I89A1

I8983 LDA #$37 ;"Kernal ROM BAD"
STA A01
LDA #$02 ;"B"
STA A0575
LDA #$01 ;"A"
STA A0576
LDA #$04 ;"D"
STA A0577
LDA #$02
STA AD975
STA AD976
STA AD977

                          ;BASIC ROM TEST

I89A1 LDA #$37
STA A01
LDA #>$A000
STA AF9
LDA #$20 ;$2000 of mem to test
STA A0F
LDA #$00
STA AF8
TAY
CLC
I89B3 ADC (PF8),Y
INY
BNE I89B3
INC AF9
DEC A0F
BNE I89B3
ADC #$00
CMP #$A1
BNE I89D5
LDA #$37
STA A01
LDA #$0F ;"O"
STA A059D
LDA #$0B ;"K"
STA A059E
JMP I89F3

I89D5 LDA #$37 ;BASIC ROM "BAD"
STA A01
LDA #$02 ;"B"
STA A059D
LDA #$01 ;"A"
STA A059E
LDA #$04 ;"D"
STA A059F
LDA #$02
STA AD99D
STA AD99E
STA AD99F

                          ;CHARACTER ROM TEST

I89F3 LDA #$33
STA A01
LDA #>$D000
STA AF9
LDA #$10 ;$1000 of mem
STA A0F
LDA #$00
STA AF8
TAY
CLC
I8A05 ADC (PF8),Y
INY
BNE I8A05
INC AF9
DEC A0F
BNE I8A05
ADC #$00
CMP #$F7
BNE I8A25
LDA #$37
STA A01
LDA #$0F ;"O"
STA A05C5
LDA #$0B ;"K"
STA A05C6
RTS

I8A25 LDA #$37 ;CHAR ROM "BAD"
STA A01
LDA #$02 ;"B"
STA A05C5
LDA #$01 ;"A"
STA A05C6
LDA #$04 ;"D"
STA A05C7
LDA #$02
STA AD9C5
STA AD9C6
STA AD9C7
RTS

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.